Compare commits

...

43 Commits

Author SHA1 Message Date
github-actions[bot]
96b0470ee7 [CI Skip] release/stable 2.9.1
skip-checks: true
2022-07-21 07:17:27 +00:00
Jaco
0a5bea1d4a 2.9.1 (#669) 2022-07-21 10:14:49 +03:00
github-actions[bot]
573f92f00d [CI Skip] bump/beta 2.8.3-2-x
skip-checks: true
2022-07-12 13:40:18 +00:00
Jaco
d0bac4cfb1 Bump deps (#667) 2022-07-12 16:37:53 +03:00
github-actions[bot]
e00e1b8d6d [CI Skip] bump/beta 2.8.3-1-x
skip-checks: true
2022-07-12 04:58:50 +00:00
Jaco
9705f1de4a Bump deps (#666) 2022-07-12 07:56:03 +03:00
github-actions[bot]
bd849e317a [CI Skip] bump/beta 2.8.3-0-x
skip-checks: true
2022-07-11 05:15:58 +00:00
Jaco
69754474f2 Bump dev (#665) 2022-07-11 08:13:04 +03:00
github-actions[bot]
994fdeed5d [CI Skip] release/stable 2.8.2
skip-checks: true
2022-07-10 09:07:57 +00:00
Jaco
e1b7f8cdcd 2.8.2 (#664)
* 2.8.2

* Bump dev
2022-07-10 12:05:27 +03:00
github-actions[bot]
0b2e8e1bbe [CI Skip] release/stable 2.8.1
skip-checks: true
2022-07-09 07:28:32 +00:00
Jaco
951a745d0f 2.8.1 (#663)
* 2.8.1

* trigger
2022-07-09 10:26:03 +03:00
github-actions[bot]
c9afdacb89 [CI Skip] bump/beta 2.7.3-0-x
skip-checks: true
2022-07-06 11:05:03 +00:00
Jaco
f909cf9bbf Adjust issue template (#662)
* Adjust issue template

* isolated export
2022-07-06 14:02:23 +03:00
github-actions[bot]
a1ea61688e [CI Skip] release/stable 2.7.2
skip-checks: true
2022-07-04 06:43:00 +00:00
Jaco
a3b0e3607f 2.7.2 (#660) 2022-07-04 09:40:43 +03:00
github-actions[bot]
c802f71617 [CI Skip] release/stable 2.7.1
skip-checks: true
2022-07-01 17:51:56 +00:00
Jaco
525ace3f52 2.7.1 (#659) 2022-07-01 20:49:24 +03:00
Derek Colley
42f1b3a6c3 Remove redundant div wrappers in vue-identicon (#643)
* Remove redundant `div` wrappers in vue-identicon

* Delete console.debug statememt

* remove redundant declarations

* fix lint errors

* refactor for codeclimate
2022-07-01 18:06:15 +03:00
github-actions[bot]
5ce56670d1 [CI Skip] release/stable 2.6.2
skip-checks: true
2022-06-25 06:02:24 +00:00
Jaco
414392e69b 2.6.2 (#657)
* 2.6.2

* CHANGELOG
2022-06-25 08:59:36 +03:00
github-actions[bot]
ae5b64a75f [CI Skip] bump/beta 2.6.2-0-x
skip-checks: true
2022-06-23 14:27:01 +00:00
Jaco
f2077dcab2 Bump dev deps (#656) 2022-06-23 17:24:01 +03:00
github-actions[bot]
75d03bb15a [CI Skip] release/stable 2.6.1
skip-checks: true
2022-06-23 09:01:27 +00:00
Jaco
269ec7adb7 2.6.1 (#655) 2022-06-23 11:58:22 +03:00
github-actions[bot]
03e6974c25 [CI Skip] release/beta 2.5.2-0
skip-checks: true
2022-06-21 04:49:38 +00:00
Jaco
a31c524878 Bump TS to 4.7.4 (#654) 2022-06-21 07:47:19 +03:00
github-actions[bot]
a057f0c279 [CI Skip] release/stable 2.5.1
skip-checks: true
2022-06-19 05:37:35 +00:00
Jaco
06dcc3bc5b 2.5.1 (#653) 2022-06-19 08:35:18 +03:00
github-actions[bot]
fc3df455ef [CI Skip] release/beta 2.4.2-2
skip-checks: true
2022-06-12 08:14:09 +00:00
Jaco
121715231d Update issue template (#651) 2022-06-12 11:11:47 +03:00
github-actions[bot]
a35c1f98e8 [CI Skip] release/beta 2.4.2-1
skip-checks: true
2022-06-11 05:44:34 +00:00
Jaco
fbaf440766 Bump deps (& issue template) (#650) 2022-06-11 08:42:20 +03:00
github-actions[bot]
813c589752 [CI Skip] release/beta 2.4.2-0
skip-checks: true
2022-06-05 06:18:23 +00:00
Jaco
806ae4fe42 Bump deps (#649) 2022-06-05 09:16:01 +03:00
github-actions[bot]
75507c5fa7 [CI Skip] release/stable 2.4.1
skip-checks: true
2022-06-04 06:28:48 +00:00
Jaco
d1c265130e 2.4.1 (#648) 2022-06-04 09:26:22 +03:00
github-actions[bot]
0eb4663442 [CI Skip] release/beta 2.3.2-1
skip-checks: true
2022-06-04 04:49:49 +00:00
Jaco
9e134ff95e Bump deps (#647) 2022-06-04 07:47:13 +03:00
github-actions[bot]
c09d58bba1 [CI Skip] release/beta 2.3.2-0
skip-checks: true
2022-05-30 07:27:38 +00:00
Jaco
fdc2b5011b Bump TS (#645) 2022-05-30 10:24:01 +03:00
github-actions[bot]
420ad06a7e [CI Skip] release/stable 2.3.1
skip-checks: true
2022-05-30 06:16:17 +00:00
Jaco
28988479c5 2.3.1 (#644) 2022-05-30 09:13:48 +03:00
33 changed files with 2439 additions and 2487 deletions

View File

@@ -1,27 +0,0 @@
2
0.57.20.57.3
0.66.2
0.66.3
0.71.2
0.71.3
0.84.2
0.84.3
0.85.2
0.85.3
0.85.4
0.85.5
0.86.2
0.86.3
0.86.4
0.86.5
0.86.6
0.86.7
0.87.2
0.87.3
0.87.4
0.87.5
0.87.6
0.87.7
0.89.2
0.89.3

86
.github/issue_template.md vendored Normal file
View File

@@ -0,0 +1,86 @@
<!--
For general support, howto, coding and bundling questions, please
use the Substrate & Polkadot StackExchange at
https://substrate.stackexchange.com/
and get other ecosystem developers involved. This issues in this
repository are meant for the tracking of feature requests and bug
reports.
While all issues are looked at non-bug and non-features would take
quite a bit longer to get to and may yield less than satisfactory
responses in this format.
Additionally, please ensure you have done a search on the existing
and closed issues before logging a new request. This saves time on
all sides.
-->
* **I'm submitting a ...**
<!---
REQUIRED:
Classify the type of report your are submitting
-->
- [ ] Bug report
- [ ] Feature request
- [ ] Support request
- [ ] Other
* **What is the current behavior and expected behavior?**
<!---
REQUIRED:
If you're describing a bug, tell us what should happen. If you're
suggesting a change/improvement, tell us how it should work.
-->
* **What is the motivation for changing the behavior?**
<!---
OPTIONAL:
Suggest a motivation for the request or ideas how to implement the
addition or change
-->
* **Please tell us about your environment:**
<!---
REQUIRED:
Include as many relevant details about the environment in which you
experienced the issue. Also ensure that you have tested against the
latest stable releases if you believe this to be a bug
-->
- Version:
- Environment:
- [ ] Node.js
- [ ] Browser
- [ ] Other (limited support for other environments)
- Language:
- [ ] JavaScript
- [ ] TypeScript (include tsc --version)
- [ ] Other

4
.gitignore vendored
View File

@@ -1,7 +1,5 @@
build/
build-cjs/
build-esm/
build-docs/
build-*/
coverage/
node_modules/
tmp/

View File

@@ -1,5 +1,81 @@
# CHANGELOG
## 2.9.1 Jul 21, 2022
Changes:
- Bump to `@polkadot/util` 10.1.1
## 2.8.2 Jul 10, 2022
Changes:
- Bump to `@polkadot/util` 10.0.2
## 2.8.1 Jul 9, 2022
Changes:
- Bump to `@polkadot/util` 10.0.1
## 2.7.2 Jul 4, 2022
Changes:
- Bump to `@polkadot/util-crypto` 9.7.2 (w/ `@polkadot/wasm-crypto` 6.2.2)
## 2.7.1 Jul 1, 2022
Contributed:
- Remove extra div wrappers in `vue-identicon` (Thanks to https://github.com/dcolley)
Changes:
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.7.1
## 2.6.2 Jun 25, 2022
Changes:
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.6.2
## 2.6.1 Jun 23, 2022
Changes:
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.6.1
- Upgrade libs to latest stable versions
## 2.5.1 Jun 19, 2022
Changes:
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.5.1
- Upgrade libs to latest stable versions
## 2.4.1 Jun 4, 2022
Changes:
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.4.1
## 2.3.1 May 30, 2022
Changes:
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.3.1
## 2.2.1 May 14, 2022
Changes:

View File

@@ -1,4 +1,4 @@
611 Jaco 2.2.1 (#641)
632 Jaco 2.9.1 (#669)
7 YJ fix #224: decrease frame size to 1024, set multipart bool (#225)
4 Antoine Estienne Refactor logic to better use prefix (#491)
4 kwingram25 fix ff api url issue (#289)
@@ -18,6 +18,7 @@
1 Axel Chalon Simplify KeyringAddress interface (#144)
1 Cameron Franz react-native example app port (#223)
1 carumusan Add kulupu (#342)
1 Derek Colley Remove redundant `div` wrappers in vue-identicon (#643)
1 Harry Liu Update README.md (#166)
1 Jake Naviasky Add Edgeware chain prefix to settings. (#317)
1 Logan Saether Propose W3F node (#188)

View File

@@ -10,7 +10,12 @@
"url": "https://github.com/polkadot-js/ui.git"
},
"sideEffects": false,
"version": "2.2.1",
"type": "module",
"version": "2.9.1",
"versions": {
"git": "2.9.1",
"npm": "2.9.1"
},
"workspaces": [
"packages/*"
],
@@ -27,26 +32,26 @@
"test:one": "polkadot-dev-run-test"
},
"devDependencies": {
"@babel/core": "^7.17.10",
"@babel/runtime": "^7.17.9",
"@polkadot/dev": "^0.66.21",
"@polkadot/x-bundle": "^9.2.1",
"@types/jest": "^27.5.1",
"@babel/core": "^7.18.9",
"@babel/runtime": "^7.18.9",
"@polkadot/dev": "^0.67.84",
"@polkadot/x-bundle": "^10.1.1",
"@types/jest": "^28.1.6",
"babel-loader": "^8.2.5",
"babel-plugin-transform-vue-template": "^0.4.2",
"empty": "^0.10.1",
"process": "^0.11.10",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-is": "^18.1.0",
"react-native": "^0.68.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
"react-native": "^0.69.2",
"stream-browserify": "^3.0.0",
"vue-template-compiler": "^2.6.14",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2",
"vue-template-compiler": "^2.7.7",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-serve": "^4.0.0"
},
"resolutions": {
"typescript": "^4.6.4"
"typescript": "^4.7.4"
}
}

View File

@@ -14,9 +14,9 @@
"url": "https://github.com/polkadot-js/ui.git"
},
"sideEffects": false,
"version": "2.2.1",
"version": "2.9.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9"
"@babel/runtime": "^7.18.9"
}
}

View File

@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/example-react', path: 'auto', type: 'auto', version: '2.2.1' };
export const packageInfo = { name: '@polkadot/example-react', path: 'auto', type: 'auto', version: '2.9.1' };

View File

@@ -14,9 +14,9 @@
"url": "https://github.com/polkadot-js/ui.git"
},
"sideEffects": false,
"version": "2.2.1",
"version": "2.9.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9"
"@babel/runtime": "^7.18.9"
}
}

View File

@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/example-vue', path: 'auto', type: 'auto', version: '2.2.1' };
export const packageInfo = { name: '@polkadot/example-vue', path: 'auto', type: 'auto', version: '2.9.1' };

View File

@@ -17,15 +17,15 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "2.2.1",
"version": "2.9.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/keyring": "^9.2.1",
"@polkadot/ui-settings": "2.2.1",
"@polkadot/ui-shared": "2.2.1",
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"@babel/runtime": "^7.18.9",
"@polkadot/keyring": "^10.1.1",
"@polkadot/ui-settings": "2.9.1",
"@polkadot/ui-shared": "2.9.1",
"@polkadot/util": "^10.1.1",
"@polkadot/util-crypto": "^10.1.1",
"color": "^3.2.1",
"ethereum-blockies-base64": "^1.0.2",
"jdenticon": "3.1.1",
@@ -34,7 +34,7 @@
},
"devDependencies": {
"@types/react-copy-to-clipboard": "^5.0.2",
"@types/react-dom": "^18.0.4",
"@types/react-dom": "^18.0.6",
"@types/styled-components": "^5.1.25",
"styled-components": "^5.3.5",
"xmlserializer": "^0.6.1"

View File

@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/react-identicon', path: 'auto', type: 'auto', version: '2.2.1' };
export const packageInfo = { name: '@polkadot/react-identicon', path: 'auto', type: 'auto', version: '2.9.1' };

View File

@@ -17,13 +17,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "2.2.1",
"version": "2.9.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/ui-settings": "2.2.1",
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"@babel/runtime": "^7.18.9",
"@polkadot/ui-settings": "2.9.1",
"@polkadot/util": "^10.1.1",
"@polkadot/util-crypto": "^10.1.1",
"qrcode-generator": "^1.4.4",
"react-qr-reader": "^2.2.1",
"styled-components": "^5.3.5"

View File

@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/react-qr', path: 'auto', type: 'auto', version: '2.2.1' };
export const packageInfo = { name: '@polkadot/react-qr', path: 'auto', type: 'auto', version: '2.9.1' };

View File

@@ -17,17 +17,17 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "2.2.1",
"version": "2.9.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/ui-shared": "2.2.1",
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"react-native-svg": "^12.3.0"
"@babel/runtime": "^7.18.9",
"@polkadot/ui-shared": "2.9.1",
"@polkadot/util": "^10.1.1",
"@polkadot/util-crypto": "^10.1.1",
"react-native-svg": "^12.4.0"
},
"devDependencies": {
"@types/react-native": "^0.67.7"
"@types/react-native": "^0.69.3"
},
"peerDependencies": {
"@polkadot/util": "*",

View File

@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/reactnative-identicon', path: 'auto', type: 'auto', version: '2.2.1' };
export const packageInfo = { name: '@polkadot/reactnative-identicon', path: 'auto', type: 'auto', version: '2.9.1' };

View File

@@ -13,10 +13,10 @@
"url": "https://github.com/polkadot-js/ui.git"
},
"sideEffects": false,
"version": "2.2.1",
"version": "2.9.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/util": "^9.2.1"
"@babel/runtime": "^7.18.9",
"@polkadot/util": "^10.1.1"
}
}

View File

@@ -1,4 +1,4 @@
// Copyright 2017-2022 @polkadot/ui-assets authors & contributors
// SPDX-License-Identifier: Apache-2.0
// empty
export {};

View File

@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/ui-assets', path: 'auto', type: 'auto', version: '2.2.1' };
export const packageInfo = { name: '@polkadot/ui-assets', path: 'auto', type: 'auto', version: '2.9.1' };

View File

@@ -16,16 +16,16 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "2.2.1",
"version": "2.9.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/keyring": "^9.2.1",
"@polkadot/ui-settings": "2.2.1",
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"@babel/runtime": "^7.18.9",
"@polkadot/keyring": "^10.1.1",
"@polkadot/ui-settings": "2.9.1",
"@polkadot/util": "^10.1.1",
"@polkadot/util-crypto": "^10.1.1",
"mkdirp": "^1.0.4",
"rxjs": "^7.5.5",
"rxjs": "^7.5.6",
"store": "^2.0.12"
},
"devDependencies": {

View File

@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/ui-keyring', path: 'auto', type: 'auto', version: '2.2.1' };
export const packageInfo = { name: '@polkadot/ui-keyring', path: 'auto', type: 'auto', version: '2.9.1' };

View File

@@ -17,12 +17,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "2.2.1",
"version": "2.9.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/networks": "^9.2.1",
"@polkadot/util": "^9.2.1",
"@babel/runtime": "^7.18.9",
"@polkadot/networks": "^10.1.1",
"@polkadot/util": "^10.1.1",
"eventemitter3": "^4.0.7",
"store": "^2.0.12"
},

View File

@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/ui-settings', path: 'auto', type: 'auto', version: '2.2.1' };
export const packageInfo = { name: '@polkadot/ui-settings', path: 'auto', type: 'auto', version: '2.9.1' };

View File

@@ -17,17 +17,17 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "2.2.1",
"version": "2.9.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@babel/runtime": "^7.18.9",
"color": "^3.2.1"
},
"devDependencies": {
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"@polkadot/util": "^10.1.1",
"@polkadot/util-crypto": "^10.1.1",
"@types/color": "^3.0.3",
"@types/xmlserializer": "^0.6.2",
"@types/xmlserializer": "^0.6.3",
"xmlserializer": "^0.6.1"
},
"peerDependencies": {

View File

@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/ui-shared', path: 'auto', type: 'auto', version: '2.2.1' };
export const packageInfo = { name: '@polkadot/ui-shared', path: 'auto', type: 'auto', version: '2.9.1' };

View File

@@ -17,17 +17,17 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "2.2.1",
"version": "2.9.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/ui-shared": "2.2.1",
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"@babel/runtime": "^7.18.9",
"@polkadot/ui-shared": "2.9.1",
"@polkadot/util": "^10.1.1",
"@polkadot/util-crypto": "^10.1.1",
"jdenticon": "3.1.1"
},
"devDependencies": {
"vue": "^2.6.14"
"vue": "^2.7.7"
},
"peerDependencies": {
"@polkadot/util": "*",

View File

@@ -3,7 +3,7 @@
import type { Prefix } from '@polkadot/util-crypto/address/types';
import Vue from 'vue';
import Vue, { VNode } from 'vue';
import { isHex, isU8a, u8aToHex } from '@polkadot/util';
import { decodeAddress, encodeAddress } from '@polkadot/util-crypto';
@@ -18,6 +18,7 @@ interface Account {
interface Data {
address: string;
iconSize: number;
isAlternative: boolean;
publicKey: string;
type: 'beachball' | 'empty' | 'jdenticon' | 'polkadot' | 'substrate';
}
@@ -59,6 +60,7 @@ export const Identicon = Vue.extend({
return {
address: '',
iconSize: DEFAULT_SIZE,
isAlternative: false,
publicKey: '0x',
type: 'empty'
};
@@ -78,22 +80,21 @@ export const Identicon = Vue.extend({
}
},
props: ['prefix', 'isAlternative', 'size', 'theme', 'value'],
// FIXME These nested divs are not correct, would like a different way
// here so we don't create a div wrapped for the div wrapper of the icon
template: `
<div v-if="type === 'empty' || address === ''">
<Empty :key="address" :size="iconSize" />
</div>
<div v-else-if="type === 'beachball'">
<Beachball :key="address" :address="address" :size="iconSize" />
</div>
<div v-else-if="type === 'polkadot'">
<Polkadot :key="address" :address="address" :isAlternative="isAlternative" :size="iconSize" />
</div>
<div v-else>
<Jdenticon :key="address" :publicKey="publicKey" :size="iconSize" />
</div>
`,
render (h): VNode {
const { address, iconSize, isAlternative, publicKey, type } = this.$data as Data;
if (type === 'empty') {
return h('Empty', { attrs: { key: address, size: iconSize } }, []);
} else if (type === 'jdenticon') {
return h('Jdenticon', { attrs: { key: address, publicKey, size: iconSize } }, []);
} else {
// handles: beachball and polkadot
// TODO: substrate
const cmp = type.charAt(0).toUpperCase() + type.slice(1);
return h(cmp, { attrs: { address, isAlternative, key: address, size: iconSize } }, []);
}
},
watch: {
value: function (): void {
this.recodeAddress();

View File

@@ -1,14 +1,14 @@
// Copyright 2017-2022 @polkadot/vue-identicon authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Options } from '@polkadot/ui-shared/icons/types';
import Vue from 'vue';
import Vue, { VNode } from 'vue';
import { beachballIcon } from '@polkadot/ui-shared';
interface Data {
html: string;
type propsType = {
address: string;
size: number;
isAlternative: boolean;
}
/**
@@ -16,21 +16,12 @@ interface Data {
* @description The Beachball identicon
*/
export const Beachball = Vue.extend({
created: function (): void {
this.createHtml();
},
data: function (): Data {
return {
// eslint-disable-next-line quotes
html: `<div />`
};
},
methods: {
createHtml: function (): void {
this.html = beachballIcon(this.address as string, this.size as Options).outerHTML;
}
},
props: ['address', 'size'],
props: ['address', 'size', 'isAlternative'],
// eslint-disable-next-line quotes
template: `<div v-html="html" />`
render (h): VNode {
const { address, isAlternative, size } = this.$props as propsType;
const bb = beachballIcon(address, { isAlternative, size });
return h(Vue.component('VCBeachball', { template: bb.outerHTML }));
}
});

View File

@@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
import * as jdenticon from 'jdenticon';
import Vue from 'vue';
import Vue, { VNode } from 'vue';
interface Data {
svgHtml: string;
type propsType = {
publicKey: string,
size: number
}
/**
@@ -13,21 +14,12 @@ interface Data {
* @description The substrate default via Jdenticon
*/
export const Jdenticon = Vue.extend({
created: function (): void {
this.createSvgHtml();
},
data: function (): Data {
return {
// eslint-disable-next-line quotes
svgHtml: `<svg viewBox="0 0 64 64" />`
};
},
methods: {
createSvgHtml: function (): void {
this.svgHtml = jdenticon.toSvg((this.publicKey as string).substr(2), this.size as number);
}
},
props: ['publicKey', 'size'],
// eslint-disable-next-line quotes
template: `<div v-html="svgHtml" />`
render (h): VNode {
const { publicKey, size } = this.$props as propsType;
const cmp = Vue.component('CJdenticon', { template: jdenticon.toSvg(publicKey.substring(2), size) });
return h(cmp);
}
});

View File

@@ -1,17 +1,14 @@
// Copyright 2017-2022 @polkadot/vue-identicon authors & contributors
// SPDX-License-Identifier: Apache-2.0
import Vue from 'vue';
import Vue, { VNode } from 'vue';
import { polkadotIcon } from '@polkadot/ui-shared';
interface Data {
svgHtml: string;
}
interface This {
type propsType = {
address: string;
isAlternative?: boolean;
isAlternative: boolean;
size: number;
}
/**
@@ -19,25 +16,20 @@ interface This {
* @description The Polkadot default identicon
*/
export const Polkadot = Vue.extend({
created: function (): void {
this.createSvgHtml();
},
data: function (): Data {
return {
// eslint-disable-next-line quotes
svgHtml: `<svg viewBox="0 0 64 64" />`
};
},
methods: {
createSvgHtml: function (): void {
const circles = polkadotIcon(this.address as string, { isAlternative: (this as This).isAlternative || false }).map(({ cx, cy, fill, r }) =>
`<circle cx=${cx} cy=${cy} fill="${fill}" r=${r} />`
).join('');
this.svgHtml = `<svg height=${this.size as number} viewBox='0 0 64 64' width=${this.size as number}>${circles}</svg>`;
}
},
props: ['address', 'isAlternative', 'size'],
// eslint-disable-next-line quotes
template: `<div v-html="svgHtml" />`
render (h): VNode {
const { address, isAlternative, size } = this.$props as propsType;
const circles = polkadotIcon(address, {
isAlternative: isAlternative || false
}).map(({ cx,
cy,
fill,
r }) => {
return h('circle', { attrs: { cx, cy, fill, r } }, []);
}
);
return h('svg', { attrs: { height: size, viewBox: '0 0 64 64', width: size } }, circles);
}
});

View File

@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/vue-identicon', path: 'auto', type: 'auto', version: '2.2.1' };
export const packageInfo = { name: '@polkadot/vue-identicon', path: 'auto', type: 'auto', version: '2.9.1' };

4437
yarn.lock

File diff suppressed because it is too large Load Diff