@pezkuwi/reactnative-identicon 3.16.7 → 3.16.8

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 (79) hide show
  1. package/package.json +153 -6
  2. package/build/Identicon.js +0 -46
  3. package/build/README.md +0 -30
  4. package/build/bundle.js +0 -2
  5. package/build/cjs/Identicon.d.ts +0 -20
  6. package/build/cjs/Identicon.js +0 -50
  7. package/build/cjs/bundle.d.ts +0 -2
  8. package/build/cjs/bundle.js +0 -7
  9. package/build/cjs/icons/Empty.js +0 -11
  10. package/build/cjs/icons/Polkadot.js +0 -16
  11. package/build/cjs/icons/index.js +0 -8
  12. package/build/cjs/index.js +0 -7
  13. package/build/cjs/packageInfo.js +0 -4
  14. package/build/cjs/types.js +0 -2
  15. package/build/icons/Empty.d.ts +0 -3
  16. package/build/icons/Empty.js +0 -7
  17. package/build/icons/Polkadot.d.ts +0 -3
  18. package/build/icons/Polkadot.js +0 -12
  19. package/build/icons/index.d.ts +0 -2
  20. package/build/icons/index.js +0 -2
  21. package/build/index.d.ts +0 -4
  22. package/build/index.js +0 -4
  23. package/build/package.json +0 -186
  24. package/build/packageDetect.d.ts +0 -1
  25. package/build/packageDetect.js +0 -4
  26. package/build/packageInfo.d.ts +0 -6
  27. package/build/packageInfo.js +0 -1
  28. package/build/types.d.ts +0 -6
  29. package/build/types.js +0 -1
  30. package/build-tsc-cjs/packageDetect.js +0 -6
  31. package/src/Identicon.tsx +0 -81
  32. package/src/bundle.ts +0 -5
  33. package/src/icons/Empty.tsx +0 -27
  34. package/src/icons/Polkadot.tsx +0 -43
  35. package/src/icons/index.ts +0 -5
  36. package/src/index.ts +0 -10
  37. package/src/packageDetect.ts +0 -12
  38. package/src/packageInfo.ts +0 -6
  39. package/src/types.ts +0 -9
  40. package/tsconfig.build.json +0 -11
  41. package/tsconfig.build.tsbuildinfo +0 -1
  42. /package/{build-tsc/Identicon.d.ts → Identicon.d.ts} +0 -0
  43. /package/{build-tsc-esm/Identicon.js → Identicon.js} +0 -0
  44. /package/{build/LICENSE → LICENSE} +0 -0
  45. /package/{build-tsc/bundle.d.ts → bundle.d.ts} +0 -0
  46. /package/{build-tsc-esm/bundle.js → bundle.js} +0 -0
  47. /package/{build → cjs}/Identicon.d.ts +0 -0
  48. /package/{build-tsc-cjs → cjs}/Identicon.js +0 -0
  49. /package/{build → cjs}/bundle.d.ts +0 -0
  50. /package/{build-tsc-cjs → cjs}/bundle.js +0 -0
  51. /package/{build-tsc → cjs}/icons/Empty.d.ts +0 -0
  52. /package/{build-tsc-cjs → cjs}/icons/Empty.js +0 -0
  53. /package/{build-tsc → cjs}/icons/Polkadot.d.ts +0 -0
  54. /package/{build-tsc-cjs → cjs}/icons/Polkadot.js +0 -0
  55. /package/{build-tsc → cjs}/icons/index.d.ts +0 -0
  56. /package/{build-tsc-cjs → cjs}/icons/index.js +0 -0
  57. /package/{build-tsc → cjs}/index.d.ts +0 -0
  58. /package/{build-tsc-cjs → cjs}/index.js +0 -0
  59. /package/{build/cjs → cjs}/package.json +0 -0
  60. /package/{build-tsc → cjs}/packageDetect.d.ts +0 -0
  61. /package/{build/cjs → cjs}/packageDetect.js +0 -0
  62. /package/{build-tsc → cjs}/packageInfo.d.ts +0 -0
  63. /package/{build-tsc-cjs → cjs}/packageInfo.js +0 -0
  64. /package/{build-tsc → cjs}/types.d.ts +0 -0
  65. /package/{build-tsc-cjs → cjs}/types.js +0 -0
  66. /package/{build/cjs/icons → icons}/Empty.d.ts +0 -0
  67. /package/{build-tsc-esm/icons → icons}/Empty.js +0 -0
  68. /package/{build/cjs/icons → icons}/Polkadot.d.ts +0 -0
  69. /package/{build-tsc-esm/icons → icons}/Polkadot.js +0 -0
  70. /package/{build/cjs/icons → icons}/index.d.ts +0 -0
  71. /package/{build-tsc-esm/icons → icons}/index.js +0 -0
  72. /package/{build/cjs/index.d.ts → index.d.ts} +0 -0
  73. /package/{build-tsc-esm/index.js → index.js} +0 -0
  74. /package/{build/cjs/packageDetect.d.ts → packageDetect.d.ts} +0 -0
  75. /package/{build-tsc-esm/packageDetect.js → packageDetect.js} +0 -0
  76. /package/{build/cjs/packageInfo.d.ts → packageInfo.d.ts} +0 -0
  77. /package/{build-tsc-esm/packageInfo.js → packageInfo.js} +0 -0
  78. /package/{build/cjs/types.d.ts → types.d.ts} +0 -0
  79. /package/{build-tsc-esm/types.js → types.js} +0 -0
package/build/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const packageInfo_1 = require("@pezkuwi/ui-shared/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]);
package/src/Identicon.tsx DELETED
@@ -1,81 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/reactnative-identicon authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import type { Prefix } from '@pezkuwi/util-crypto/address/types';
5
- import type { Props as ComponentProps } from './types.js';
6
-
7
- import React from 'react';
8
-
9
- import { isHex, isU8a, u8aToHex } from '@pezkuwi/util';
10
- import { decodeAddress, encodeAddress } from '@pezkuwi/util-crypto';
11
-
12
- import { Empty, Polkadot } from './icons/index.js';
13
-
14
- const Fallback = Polkadot;
15
-
16
- interface Props {
17
- prefix?: Prefix;
18
- size?: number;
19
- theme?: 'polkadot';
20
- value?: string | Uint8Array | null;
21
- }
22
-
23
- interface State {
24
- address: string;
25
- publicKey: string;
26
- }
27
-
28
- const DEFAULT_SIZE = 64;
29
- const DEFAULT_THEME = 'polkadot';
30
-
31
- const Components: Record<string, React.ComponentType<ComponentProps>> = {
32
- polkadot: Polkadot
33
- };
34
-
35
- export default class IdentityIcon extends React.PureComponent<Props, State> {
36
- public override state: State = {
37
- address: '',
38
- publicKey: '0x'
39
- };
40
-
41
- private static prefix?: Prefix = undefined;
42
-
43
- public static setDefaultPrefix (prefix: Prefix): void {
44
- IdentityIcon.prefix = prefix;
45
- }
46
-
47
- public static getDerivedStateFromProps ({ prefix = IdentityIcon.prefix, value }: Props, prevState: State): State | null {
48
- try {
49
- const address = isU8a(value) || isHex(value)
50
- ? encodeAddress(value, prefix)
51
- : (value || '');
52
- const publicKey = u8aToHex(decodeAddress(address, true, prefix));
53
-
54
- return address === prevState.address
55
- ? null
56
- : { address, publicKey };
57
- } catch {
58
- return {
59
- address: '',
60
- publicKey: '0x'
61
- };
62
- }
63
- }
64
-
65
- public override render (): React.ReactNode {
66
- const { size = DEFAULT_SIZE, theme = DEFAULT_THEME } = this.props;
67
- const { address, publicKey } = this.state;
68
-
69
- const Component = !address
70
- ? Empty
71
- : Components[theme] || Fallback;
72
-
73
- return (
74
- <Component
75
- address={address}
76
- publicKey={publicKey}
77
- size={size}
78
- />
79
- );
80
- }
81
- }
package/src/bundle.ts DELETED
@@ -1,5 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/reactnative-identicon authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- export * from './icons/index.js';
5
- export { packageInfo } from './packageInfo.js';
@@ -1,27 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/reactnative-identicon authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import type { Props } from '../types.js';
5
-
6
- import React from 'react';
7
- import { View } from 'react-native';
8
- import { Circle, Svg } from 'react-native-svg';
9
-
10
- export default function Empty ({ size }: Props): React.ReactElement<Props> {
11
- return (
12
- <View>
13
- <Svg
14
- height={size}
15
- viewBox='0 0 64 64'
16
- width={size}
17
- >
18
- <Circle
19
- cx='32'
20
- cy='32'
21
- fill='#eee'
22
- r='32'
23
- />
24
- </Svg>
25
- </View>
26
- );
27
- }
@@ -1,43 +0,0 @@
1
- // Copyright 2018-2025 @pezkuwi/reactnative-identicon authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import type { Circle as CircleType } from '@pezkuwi/ui-shared/icons/types';
5
- import type { Props } from '../types.js';
6
-
7
- import React, { useMemo } from 'react';
8
- import { View } from 'react-native';
9
- import { Circle as SvgCircle, Svg } from 'react-native-svg';
10
-
11
- import { polkadotIcon } from '@pezkuwi/ui-shared';
12
-
13
- function renderCircle ({ cx, cy, fill, r }: CircleType, key: number): React.ReactNode {
14
- return (
15
- <SvgCircle
16
- cx={cx}
17
- cy={cy}
18
- fill={fill}
19
- key={key}
20
- r={r}
21
- />
22
- );
23
- }
24
-
25
- export default function Identicon ({ address, isAlternative = false, size }: Props): React.ReactElement<Props> {
26
- const circles = useMemo(
27
- () => polkadotIcon(address, { isAlternative }),
28
- [address, isAlternative]
29
- );
30
-
31
- return (
32
- <View>
33
- <Svg
34
- height={size}
35
- id={address}
36
- viewBox='0 0 64 64'
37
- width={size}
38
- >
39
- {circles.map(renderCircle)}
40
- </Svg>
41
- </View>
42
- );
43
- }
@@ -1,5 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/reactnative-identicon authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- export { default as Empty } from './Empty.js';
5
- export { default as Polkadot } from './Polkadot.js';
package/src/index.ts DELETED
@@ -1,10 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/reactnative-identicon authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import './packageDetect.js';
5
-
6
- import Identicon from './Identicon.js';
7
-
8
- export * from './bundle.js';
9
-
10
- export default Identicon;
@@ -1,12 +0,0 @@
1
- // Copyright 2017-2026 @pezkuwi/reactnative-identicon authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- // Do not edit, auto-generated by @pezkuwi/dev
5
- // (packageInfo imports will be kept as-is, user-editable)
6
-
7
- import { packageInfo as sharedInfo } from '@pezkuwi/ui-shared/packageInfo';
8
- import { detectPackage } from '@pezkuwi/util';
9
-
10
- import { packageInfo } from './packageInfo.js';
11
-
12
- detectPackage(packageInfo, null, [sharedInfo]);
@@ -1,6 +0,0 @@
1
- // Copyright 2017-2026 @pezkuwi/reactnative-identicon authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- // Do not edit, auto-generated by @pezkuwi/dev
5
-
6
- export const packageInfo = { name: '@pezkuwi/reactnative-identicon', path: 'auto', type: 'auto', version: '3.16.6' };
package/src/types.ts DELETED
@@ -1,9 +0,0 @@
1
- // Copyright 2018-2025 @pezkuwi/reactnative-identicon authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- export interface Props {
5
- address: string;
6
- isAlternative?: boolean;
7
- publicKey: string;
8
- size: number;
9
- }
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "baseUrl": "..",
5
- "outDir": "./build",
6
- "rootDir": "./src"
7
- },
8
- "references": [
9
- { "path": "../ui-shared/tsconfig.build.json" }
10
- ]
11
- }