@pezkuwi/vue-identicon 3.16.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +37 -0
  2. package/build/Identicon.d.ts +28 -0
  3. package/build/Identicon.js +111 -0
  4. package/build/LICENSE +201 -0
  5. package/build/README.md +37 -0
  6. package/build/bundle-pezkuwi-vue-identicon.js +887 -0
  7. package/build/bundle.d.ts +2 -0
  8. package/build/bundle.js +2 -0
  9. package/build/cjs/Identicon.d.ts +28 -0
  10. package/build/cjs/Identicon.js +115 -0
  11. package/build/cjs/bundle.d.ts +2 -0
  12. package/build/cjs/bundle.js +7 -0
  13. package/build/cjs/icons/Beachball.d.ts +17 -0
  14. package/build/cjs/icons/Beachball.js +21 -0
  15. package/build/cjs/icons/Empty.d.ts +11 -0
  16. package/build/cjs/icons/Empty.js +16 -0
  17. package/build/cjs/icons/Jdenticon.d.ts +14 -0
  18. package/build/cjs/icons/Jdenticon.js +19 -0
  19. package/build/cjs/icons/Polkadot.d.ts +17 -0
  20. package/build/cjs/icons/Polkadot.js +24 -0
  21. package/build/cjs/icons/index.d.ts +4 -0
  22. package/build/cjs/icons/index.js +7 -0
  23. package/build/cjs/index.d.ts +4 -0
  24. package/build/cjs/index.js +7 -0
  25. package/build/cjs/package.json +3 -0
  26. package/build/cjs/packageDetect.d.ts +1 -0
  27. package/build/cjs/packageDetect.js +6 -0
  28. package/build/cjs/packageInfo.d.ts +6 -0
  29. package/build/cjs/packageInfo.js +4 -0
  30. package/build/cjs/util.d.ts +6 -0
  31. package/build/cjs/util.js +15 -0
  32. package/build/icons/Beachball.d.ts +17 -0
  33. package/build/icons/Beachball.js +18 -0
  34. package/build/icons/Empty.d.ts +11 -0
  35. package/build/icons/Empty.js +13 -0
  36. package/build/icons/Jdenticon.d.ts +14 -0
  37. package/build/icons/Jdenticon.js +15 -0
  38. package/build/icons/Polkadot.d.ts +17 -0
  39. package/build/icons/Polkadot.js +21 -0
  40. package/build/icons/index.d.ts +4 -0
  41. package/build/icons/index.js +4 -0
  42. package/build/index.d.ts +4 -0
  43. package/build/index.js +4 -0
  44. package/build/package.json +213 -0
  45. package/build/packageDetect.d.ts +1 -0
  46. package/build/packageDetect.js +4 -0
  47. package/build/packageInfo.d.ts +6 -0
  48. package/build/packageInfo.js +1 -0
  49. package/build/util.d.ts +6 -0
  50. package/build/util.js +12 -0
  51. package/build-tsc/Identicon.d.ts +28 -0
  52. package/build-tsc/bundle.d.ts +2 -0
  53. package/build-tsc/icons/Beachball.d.ts +17 -0
  54. package/build-tsc/icons/Empty.d.ts +11 -0
  55. package/build-tsc/icons/Jdenticon.d.ts +14 -0
  56. package/build-tsc/icons/Polkadot.d.ts +17 -0
  57. package/build-tsc/icons/index.d.ts +4 -0
  58. package/build-tsc/index.d.ts +4 -0
  59. package/build-tsc/packageDetect.d.ts +1 -0
  60. package/build-tsc/packageInfo.d.ts +6 -0
  61. package/build-tsc/util.d.ts +6 -0
  62. package/build-tsc-cjs/Identicon.js +115 -0
  63. package/build-tsc-cjs/bundle.js +7 -0
  64. package/build-tsc-cjs/icons/Beachball.js +21 -0
  65. package/build-tsc-cjs/icons/Empty.js +16 -0
  66. package/build-tsc-cjs/icons/Jdenticon.js +19 -0
  67. package/build-tsc-cjs/icons/Polkadot.js +24 -0
  68. package/build-tsc-cjs/icons/index.js +7 -0
  69. package/build-tsc-cjs/index.js +7 -0
  70. package/build-tsc-cjs/packageDetect.js +6 -0
  71. package/build-tsc-cjs/packageInfo.js +4 -0
  72. package/build-tsc-cjs/util.js +15 -0
  73. package/build-tsc-esm/Identicon.js +111 -0
  74. package/build-tsc-esm/bundle.js +2 -0
  75. package/build-tsc-esm/icons/Beachball.js +18 -0
  76. package/build-tsc-esm/icons/Empty.js +13 -0
  77. package/build-tsc-esm/icons/Jdenticon.js +15 -0
  78. package/build-tsc-esm/icons/Polkadot.js +21 -0
  79. package/build-tsc-esm/icons/index.js +4 -0
  80. package/build-tsc-esm/index.js +4 -0
  81. package/build-tsc-esm/packageDetect.js +4 -0
  82. package/build-tsc-esm/packageInfo.js +1 -0
  83. package/build-tsc-esm/util.js +12 -0
  84. package/index.html +17 -0
  85. package/package.json +38 -0
  86. package/src/Identicon.ts +141 -0
  87. package/src/bundle.ts +5 -0
  88. package/src/icons/Beachball.ts +32 -0
  89. package/src/icons/Empty.ts +17 -0
  90. package/src/icons/Jdenticon.ts +27 -0
  91. package/src/icons/Polkadot.ts +38 -0
  92. package/src/icons/index.ts +7 -0
  93. package/src/index.ts +10 -0
  94. package/src/packageDetect.ts +12 -0
  95. package/src/packageInfo.ts +6 -0
  96. package/src/util.ts +17 -0
  97. package/tsconfig.build.json +11 -0
  98. package/tsconfig.build.tsbuildinfo +1 -0
@@ -0,0 +1,2 @@
1
+ export { Identicon } from './Identicon.js';
2
+ export { packageInfo } from './packageInfo.js';
@@ -0,0 +1,2 @@
1
+ export { Identicon } from './Identicon.js';
2
+ export { packageInfo } from './packageInfo.js';
@@ -0,0 +1,28 @@
1
+ import type { Prefix } from '@pezkuwi/util-crypto/address/types';
2
+ interface Account {
3
+ address: string;
4
+ publicKey: string;
5
+ }
6
+ interface Data {
7
+ address: string;
8
+ iconSize: number;
9
+ isAlternativeIcon: boolean;
10
+ publicKey: string;
11
+ type: 'beachball' | 'empty' | 'jdenticon' | 'polkadot' | 'substrate';
12
+ }
13
+ export declare function encodeAccount(value: string | Uint8Array, prefix?: Prefix): Account;
14
+ /**
15
+ * @name Identicon
16
+ * @description The main Identicon component, taking a number of properties
17
+ * @example
18
+ * ```html
19
+ * <Identicon :size="128" :theme="polkadot" :value="..." />
20
+ * ```
21
+ */
22
+ export declare const Identicon: import("vue").DefineComponent<string[], {}, Data, {}, {
23
+ createData: () => void;
24
+ recodeAddress: () => void;
25
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<string[]>>, {
26
+ [x: number]: string;
27
+ }>;
28
+ export {};
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Identicon = void 0;
4
+ exports.encodeAccount = encodeAccount;
5
+ const vue_1 = require("vue");
6
+ const util_1 = require("@pezkuwi/util");
7
+ const util_crypto_1 = require("@pezkuwi/util-crypto");
8
+ const index_js_1 = require("./icons/index.js");
9
+ const util_js_1 = require("./util.js");
10
+ const DEFAULT_SIZE = 64;
11
+ function resolvePublicKey(value, prefix) {
12
+ if ((0, util_1.isHex)(value) && (0, util_crypto_1.isEthereumAddress)(value)) {
13
+ return value.padEnd(66, '0');
14
+ }
15
+ return (0, util_1.isU8a)(value) || (0, util_1.isHex)(value)
16
+ ? (0, util_crypto_1.encodeAddress)(value, prefix)
17
+ : value;
18
+ }
19
+ function encodeAccount(value, prefix) {
20
+ try {
21
+ const address = resolvePublicKey(value, prefix);
22
+ const publicKey = (0, util_1.u8aToHex)((0, util_crypto_1.decodeAddress)(address, false, prefix));
23
+ return { address, publicKey };
24
+ }
25
+ catch {
26
+ return { address: '', publicKey: '0x' };
27
+ }
28
+ }
29
+ /**
30
+ * @name Identicon
31
+ * @description The main Identicon component, taking a number of properties
32
+ * @example
33
+ * ```html
34
+ * <Identicon :size="128" :theme="polkadot" :value="..." />
35
+ * ```
36
+ */
37
+ exports.Identicon = (0, vue_1.defineComponent)({
38
+ components: {
39
+ Beachball: index_js_1.Beachball,
40
+ Empty: index_js_1.Empty,
41
+ Jdenticon: index_js_1.Jdenticon,
42
+ Polkadot: index_js_1.Polkadot
43
+ },
44
+ created: function () {
45
+ this.createData();
46
+ },
47
+ data: function () {
48
+ return {
49
+ address: '',
50
+ iconSize: DEFAULT_SIZE,
51
+ isAlternativeIcon: false,
52
+ publicKey: '0x',
53
+ type: 'empty'
54
+ };
55
+ },
56
+ methods: {
57
+ createData: function () {
58
+ this.iconSize = this.size || DEFAULT_SIZE;
59
+ this.type = this.theme;
60
+ this.isAlternativeIcon = this.isAlternative || false;
61
+ this.recodeAddress();
62
+ },
63
+ recodeAddress: function () {
64
+ const { address, publicKey } = encodeAccount(this.value);
65
+ this.address = address;
66
+ this.publicKey = publicKey;
67
+ }
68
+ },
69
+ props: ['prefix', 'isAlternative', 'size', 'theme', 'value'],
70
+ render() {
71
+ const { address, iconSize, isAlternativeIcon, publicKey, type } = this.$data;
72
+ if (type === 'empty') {
73
+ return (0, vue_1.h)(index_js_1.Empty, {
74
+ ...(0, util_js_1.adaptVNodeAttrs)({
75
+ key: address,
76
+ size: iconSize
77
+ })
78
+ }, []);
79
+ }
80
+ else if (type === 'jdenticon') {
81
+ return (0, vue_1.h)(index_js_1.Jdenticon, {
82
+ ...(0, util_js_1.adaptVNodeAttrs)({
83
+ key: address,
84
+ publicKey,
85
+ size: iconSize
86
+ })
87
+ }, []);
88
+ }
89
+ else if (type === 'substrate') {
90
+ throw new Error('substrate type is not supported');
91
+ }
92
+ const cmp = type.charAt(0).toUpperCase() + type.slice(1);
93
+ if (['Beachball', 'Polkadot'].includes(cmp)) {
94
+ const component = cmp === 'Beachball'
95
+ ? index_js_1.Beachball
96
+ : index_js_1.Polkadot;
97
+ return (0, vue_1.h)(component, {
98
+ ...(0, util_js_1.adaptVNodeAttrs)({
99
+ address,
100
+ isAlternative: isAlternativeIcon,
101
+ key: address,
102
+ size: iconSize
103
+ })
104
+ }, []);
105
+ }
106
+ else {
107
+ return (0, vue_1.h)(cmp, {}, []);
108
+ }
109
+ },
110
+ watch: {
111
+ value: function () {
112
+ this.recodeAddress();
113
+ }
114
+ }
115
+ });
@@ -0,0 +1,2 @@
1
+ export { Identicon } from './Identicon.js';
2
+ export { packageInfo } from './packageInfo.js';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.packageInfo = exports.Identicon = void 0;
4
+ var Identicon_js_1 = require("./Identicon.js");
5
+ Object.defineProperty(exports, "Identicon", { enumerable: true, get: function () { return Identicon_js_1.Identicon; } });
6
+ var packageInfo_js_1 = require("./packageInfo.js");
7
+ Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @name Beachball
3
+ * @description The Beachball identicon
4
+ */
5
+ export declare const Beachball: import("vue").DefineComponent<Readonly<{
6
+ address?: any;
7
+ size?: any;
8
+ isAlternative?: any;
9
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<Readonly<{
10
+ address?: any;
11
+ size?: any;
12
+ isAlternative?: any;
13
+ }>>>, {
14
+ readonly address?: any;
15
+ readonly size?: any;
16
+ readonly isAlternative?: any;
17
+ }>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Beachball = void 0;
4
+ const vue_1 = require("vue");
5
+ const ui_shared_1 = require("@pezkuwi/ui-shared");
6
+ /**
7
+ * @name Beachball
8
+ * @description The Beachball identicon
9
+ */
10
+ exports.Beachball = (0, vue_1.defineComponent)({
11
+ props: ['address', 'size', 'isAlternative'],
12
+ render() {
13
+ const { address, isAlternative, size } = this.$props;
14
+ return (0, vue_1.h)({
15
+ template: (0, ui_shared_1.beachballIcon)(address, {
16
+ isAlternative,
17
+ size
18
+ }).outerHTML
19
+ });
20
+ }
21
+ });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @name Empty
3
+ * @description An empty identicon
4
+ */
5
+ export declare const Empty: import("vue").DefineComponent<Readonly<{
6
+ size?: any;
7
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<Readonly<{
8
+ size?: any;
9
+ }>>>, {
10
+ readonly size?: any;
11
+ }>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Empty = void 0;
4
+ const vue_1 = require("vue");
5
+ /**
6
+ * @name Empty
7
+ * @description An empty identicon
8
+ */
9
+ exports.Empty = (0, vue_1.defineComponent)({
10
+ props: ['size'],
11
+ template: `
12
+ <svg :height="size" :width="size" viewBox="0 0 64 64">
13
+ <circle cx="50%" cy="50%" fill="#eee" r="50%" />
14
+ </svg>
15
+ `
16
+ });
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @name Jdenticon
3
+ * @description The substrate default via Jdenticon
4
+ */
5
+ export declare const Jdenticon: import("vue").DefineComponent<Readonly<{
6
+ size?: any;
7
+ publicKey?: any;
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<Readonly<{
9
+ size?: any;
10
+ publicKey?: any;
11
+ }>>>, {
12
+ readonly size?: any;
13
+ readonly publicKey?: any;
14
+ }>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Jdenticon = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jdenticon = tslib_1.__importStar(require("jdenticon"));
6
+ const vue_1 = require("vue");
7
+ /**
8
+ * @name Jdenticon
9
+ * @description The substrate default via Jdenticon
10
+ */
11
+ exports.Jdenticon = (0, vue_1.defineComponent)({
12
+ props: ['publicKey', 'size'],
13
+ render() {
14
+ const { publicKey, size } = this.$props;
15
+ return (0, vue_1.h)({
16
+ template: jdenticon.toSvg(publicKey.substring(2), size)
17
+ });
18
+ }
19
+ });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @name Polkadot
3
+ * @description The Polkadot default identicon
4
+ */
5
+ export declare const Polkadot: import("vue").DefineComponent<Readonly<{
6
+ address?: any;
7
+ size?: any;
8
+ isAlternative?: any;
9
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<Readonly<{
10
+ address?: any;
11
+ size?: any;
12
+ isAlternative?: any;
13
+ }>>>, {
14
+ readonly address?: any;
15
+ readonly size?: any;
16
+ readonly isAlternative?: any;
17
+ }>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Polkadot = void 0;
4
+ const vue_1 = require("vue");
5
+ const ui_shared_1 = require("@pezkuwi/ui-shared");
6
+ const util_js_1 = require("../util.js");
7
+ /**
8
+ * @name Polkadot
9
+ * @description The Polkadot default identicon
10
+ */
11
+ exports.Polkadot = (0, vue_1.defineComponent)({
12
+ props: ['address', 'isAlternative', 'size'],
13
+ render() {
14
+ const { address, isAlternative, size } = this.$props;
15
+ const circles = (0, ui_shared_1.polkadotIcon)(address, { isAlternative }).map(({ cx, cy, fill, r }) => (0, vue_1.h)('circle', { ...(0, util_js_1.adaptVNodeAttrs)({ cx, cy, fill, r }) }, []));
16
+ return (0, vue_1.h)('svg', {
17
+ ...(0, util_js_1.adaptVNodeAttrs)({
18
+ height: size,
19
+ viewBox: '0 0 64 64',
20
+ width: size
21
+ })
22
+ }, circles);
23
+ }
24
+ });
@@ -0,0 +1,4 @@
1
+ export * from './Beachball.js';
2
+ export * from './Empty.js';
3
+ export * from './Jdenticon.js';
4
+ export * from './Polkadot.js';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./Beachball.js"), exports);
5
+ tslib_1.__exportStar(require("./Empty.js"), exports);
6
+ tslib_1.__exportStar(require("./Jdenticon.js"), exports);
7
+ tslib_1.__exportStar(require("./Polkadot.js"), exports);
@@ -0,0 +1,4 @@
1
+ import './packageDetect.js';
2
+ import { Identicon } from './bundle.js';
3
+ export * from './bundle.js';
4
+ export default Identicon;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ require("./packageDetect.js");
5
+ const bundle_js_1 = require("./bundle.js");
6
+ tslib_1.__exportStar(require("./bundle.js"), exports);
7
+ exports.default = bundle_js_1.Identicon;
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const packageInfo_1 = require("@pezkuwi/ui-shared/cjs/packageInfo");
4
+ const util_1 = require("@pezkuwi/util");
5
+ const packageInfo_js_1 = require("./packageInfo.js");
6
+ (0, util_1.detectPackage)(packageInfo_js_1.packageInfo, null, [packageInfo_1.packageInfo]);
@@ -0,0 +1,6 @@
1
+ export declare const packageInfo: {
2
+ name: string;
3
+ path: string;
4
+ type: string;
5
+ version: string;
6
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.packageInfo = void 0;
4
+ exports.packageInfo = { name: '@pezkuwi/vue-identicon', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '3.16.6' };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @internal
3
+ *
4
+ * Adjust attributes to be usable in both Vue 2 and Vue 3 components.
5
+ */
6
+ export declare function adaptVNodeAttrs(data: Record<string, unknown>): Record<string, unknown>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adaptVNodeAttrs = adaptVNodeAttrs;
4
+ const vue_1 = require("vue");
5
+ const isV3 = vue_1.version.startsWith('3.');
6
+ /**
7
+ * @internal
8
+ *
9
+ * Adjust attributes to be usable in both Vue 2 and Vue 3 components.
10
+ */
11
+ function adaptVNodeAttrs(data) {
12
+ return isV3
13
+ ? data
14
+ : { attrs: data };
15
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @name Beachball
3
+ * @description The Beachball identicon
4
+ */
5
+ export declare const Beachball: import("vue").DefineComponent<Readonly<{
6
+ address?: any;
7
+ size?: any;
8
+ isAlternative?: any;
9
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<Readonly<{
10
+ address?: any;
11
+ size?: any;
12
+ isAlternative?: any;
13
+ }>>>, {
14
+ readonly address?: any;
15
+ readonly size?: any;
16
+ readonly isAlternative?: any;
17
+ }>;
@@ -0,0 +1,18 @@
1
+ import { defineComponent, h } from 'vue';
2
+ import { beachballIcon } from '@pezkuwi/ui-shared';
3
+ /**
4
+ * @name Beachball
5
+ * @description The Beachball identicon
6
+ */
7
+ export const Beachball = defineComponent({
8
+ props: ['address', 'size', 'isAlternative'],
9
+ render() {
10
+ const { address, isAlternative, size } = this.$props;
11
+ return h({
12
+ template: beachballIcon(address, {
13
+ isAlternative,
14
+ size
15
+ }).outerHTML
16
+ });
17
+ }
18
+ });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @name Empty
3
+ * @description An empty identicon
4
+ */
5
+ export declare const Empty: import("vue").DefineComponent<Readonly<{
6
+ size?: any;
7
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<Readonly<{
8
+ size?: any;
9
+ }>>>, {
10
+ readonly size?: any;
11
+ }>;
@@ -0,0 +1,13 @@
1
+ import { defineComponent } from 'vue';
2
+ /**
3
+ * @name Empty
4
+ * @description An empty identicon
5
+ */
6
+ export const Empty = defineComponent({
7
+ props: ['size'],
8
+ template: `
9
+ <svg :height="size" :width="size" viewBox="0 0 64 64">
10
+ <circle cx="50%" cy="50%" fill="#eee" r="50%" />
11
+ </svg>
12
+ `
13
+ });
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @name Jdenticon
3
+ * @description The substrate default via Jdenticon
4
+ */
5
+ export declare const Jdenticon: import("vue").DefineComponent<Readonly<{
6
+ size?: any;
7
+ publicKey?: any;
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<Readonly<{
9
+ size?: any;
10
+ publicKey?: any;
11
+ }>>>, {
12
+ readonly size?: any;
13
+ readonly publicKey?: any;
14
+ }>;
@@ -0,0 +1,15 @@
1
+ import * as jdenticon from 'jdenticon';
2
+ import { defineComponent, h } from 'vue';
3
+ /**
4
+ * @name Jdenticon
5
+ * @description The substrate default via Jdenticon
6
+ */
7
+ export const Jdenticon = defineComponent({
8
+ props: ['publicKey', 'size'],
9
+ render() {
10
+ const { publicKey, size } = this.$props;
11
+ return h({
12
+ template: jdenticon.toSvg(publicKey.substring(2), size)
13
+ });
14
+ }
15
+ });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @name Polkadot
3
+ * @description The Polkadot default identicon
4
+ */
5
+ export declare const Polkadot: import("vue").DefineComponent<Readonly<{
6
+ address?: any;
7
+ size?: any;
8
+ isAlternative?: any;
9
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<Readonly<{
10
+ address?: any;
11
+ size?: any;
12
+ isAlternative?: any;
13
+ }>>>, {
14
+ readonly address?: any;
15
+ readonly size?: any;
16
+ readonly isAlternative?: any;
17
+ }>;
@@ -0,0 +1,21 @@
1
+ import { defineComponent, h } from 'vue';
2
+ import { polkadotIcon } from '@pezkuwi/ui-shared';
3
+ import { adaptVNodeAttrs } from '../util.js';
4
+ /**
5
+ * @name Polkadot
6
+ * @description The Polkadot default identicon
7
+ */
8
+ export const Polkadot = defineComponent({
9
+ props: ['address', 'isAlternative', 'size'],
10
+ render() {
11
+ const { address, isAlternative, size } = this.$props;
12
+ const circles = polkadotIcon(address, { isAlternative }).map(({ cx, cy, fill, r }) => h('circle', { ...adaptVNodeAttrs({ cx, cy, fill, r }) }, []));
13
+ return h('svg', {
14
+ ...adaptVNodeAttrs({
15
+ height: size,
16
+ viewBox: '0 0 64 64',
17
+ width: size
18
+ })
19
+ }, circles);
20
+ }
21
+ });
@@ -0,0 +1,4 @@
1
+ export * from './Beachball.js';
2
+ export * from './Empty.js';
3
+ export * from './Jdenticon.js';
4
+ export * from './Polkadot.js';
@@ -0,0 +1,4 @@
1
+ export * from './Beachball.js';
2
+ export * from './Empty.js';
3
+ export * from './Jdenticon.js';
4
+ export * from './Polkadot.js';
@@ -0,0 +1,4 @@
1
+ import './packageDetect.js';
2
+ import { Identicon } from './bundle.js';
3
+ export * from './bundle.js';
4
+ export default Identicon;
package/build/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import './packageDetect.js';
2
+ import { Identicon } from './bundle.js';
3
+ export * from './bundle.js';
4
+ export default Identicon;