@pezkuwi/react-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.
- package/package.json +209 -8
- package/build/Identicon.js +0 -104
- package/build/README.md +0 -34
- package/build/bundle.js +0 -3
- package/build/cjs/Identicon.d.ts +0 -5
- package/build/cjs/Identicon.js +0 -108
- package/build/cjs/bundle.d.ts +0 -3
- package/build/cjs/bundle.js +0 -9
- package/build/cjs/icons/Beachball.js +0 -17
- package/build/cjs/icons/Empty.js +0 -10
- package/build/cjs/icons/Ethereum.js +0 -18
- package/build/cjs/icons/Jdenticon.js +0 -12
- package/build/cjs/icons/Polkadot.js +0 -15
- package/build/cjs/icons/index.js +0 -13
- package/build/cjs/index.js +0 -7
- package/build/cjs/packageInfo.js +0 -4
- package/build/cjs/styled.js +0 -5
- package/build/cjs/types.js +0 -2
- package/build/icons/Beachball.d.ts +0 -5
- package/build/icons/Beachball.js +0 -13
- package/build/icons/Empty.d.ts +0 -5
- package/build/icons/Empty.js +0 -6
- package/build/icons/Ethereum.d.ts +0 -5
- package/build/icons/Ethereum.js +0 -14
- package/build/icons/Jdenticon.d.ts +0 -5
- package/build/icons/Jdenticon.js +0 -8
- package/build/icons/Polkadot.d.ts +0 -5
- package/build/icons/Polkadot.js +0 -11
- package/build/icons/index.d.ts +0 -5
- package/build/icons/index.js +0 -5
- package/build/index.d.ts +0 -4
- package/build/index.js +0 -4
- package/build/package.json +0 -249
- package/build/packageDetect.d.ts +0 -1
- package/build/packageDetect.js +0 -5
- package/build/packageInfo.d.ts +0 -6
- package/build/packageInfo.js +0 -1
- package/build/styled.d.ts +0 -1
- package/build/styled.js +0 -1
- package/build/types.d.ts +0 -23
- package/build/types.js +0 -1
- package/build-tsc-cjs/packageDetect.js +0 -7
- package/demo.png +0 -0
- package/index.html +0 -17
- package/src/Identicon.tsx +0 -154
- package/src/bundle.ts +0 -6
- package/src/icons/Beachball.tsx +0 -32
- package/src/icons/Empty.tsx +0 -20
- package/src/icons/Ethereum.tsx +0 -37
- package/src/icons/Jdenticon.tsx +0 -24
- package/src/icons/Polkadot.tsx +0 -59
- package/src/icons/index.ts +0 -8
- package/src/index.ts +0 -10
- package/src/packageDetect.ts +0 -13
- package/src/packageInfo.ts +0 -6
- package/src/styled.ts +0 -4
- package/src/types.ts +0 -30
- package/tsconfig.build.json +0 -12
- package/tsconfig.build.tsbuildinfo +0 -1
- /package/{build-tsc/Identicon.d.ts → Identicon.d.ts} +0 -0
- /package/{build-tsc-esm/Identicon.js → Identicon.js} +0 -0
- /package/{build/LICENSE → LICENSE} +0 -0
- /package/{build/bundle-pezkuwi-react-identicon.js → bundle-pezkuwi-react-identicon.js} +0 -0
- /package/{build-tsc/bundle.d.ts → bundle.d.ts} +0 -0
- /package/{build-tsc-esm/bundle.js → bundle.js} +0 -0
- /package/{build → cjs}/Identicon.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/Identicon.js +0 -0
- /package/{build → cjs}/bundle.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/bundle.js +0 -0
- /package/{build-tsc → cjs}/icons/Beachball.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/icons/Beachball.js +0 -0
- /package/{build-tsc → cjs}/icons/Empty.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/icons/Empty.js +0 -0
- /package/{build-tsc → cjs}/icons/Ethereum.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/icons/Ethereum.js +0 -0
- /package/{build-tsc → cjs}/icons/Jdenticon.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/icons/Jdenticon.js +0 -0
- /package/{build-tsc → cjs}/icons/Polkadot.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/icons/Polkadot.js +0 -0
- /package/{build-tsc → cjs}/icons/index.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/icons/index.js +0 -0
- /package/{build-tsc → cjs}/index.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/index.js +0 -0
- /package/{build/cjs → cjs}/package.json +0 -0
- /package/{build-tsc → cjs}/packageDetect.d.ts +0 -0
- /package/{build/cjs → cjs}/packageDetect.js +0 -0
- /package/{build-tsc → cjs}/packageInfo.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/packageInfo.js +0 -0
- /package/{build-tsc → cjs}/styled.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/styled.js +0 -0
- /package/{build-tsc → cjs}/types.d.ts +0 -0
- /package/{build-tsc-cjs → cjs}/types.js +0 -0
- /package/{build/cjs/icons → icons}/Beachball.d.ts +0 -0
- /package/{build-tsc-esm/icons → icons}/Beachball.js +0 -0
- /package/{build/cjs/icons → icons}/Empty.d.ts +0 -0
- /package/{build-tsc-esm/icons → icons}/Empty.js +0 -0
- /package/{build/cjs/icons → icons}/Ethereum.d.ts +0 -0
- /package/{build-tsc-esm/icons → icons}/Ethereum.js +0 -0
- /package/{build/cjs/icons → icons}/Jdenticon.d.ts +0 -0
- /package/{build-tsc-esm/icons → icons}/Jdenticon.js +0 -0
- /package/{build/cjs/icons → icons}/Polkadot.d.ts +0 -0
- /package/{build-tsc-esm/icons → icons}/Polkadot.js +0 -0
- /package/{build/cjs/icons → icons}/index.d.ts +0 -0
- /package/{build-tsc-esm/icons → icons}/index.js +0 -0
- /package/{build/cjs/index.d.ts → index.d.ts} +0 -0
- /package/{build-tsc-esm/index.js → index.js} +0 -0
- /package/{build/cjs/packageDetect.d.ts → packageDetect.d.ts} +0 -0
- /package/{build-tsc-esm/packageDetect.js → packageDetect.js} +0 -0
- /package/{build/cjs/packageInfo.d.ts → packageInfo.d.ts} +0 -0
- /package/{build-tsc-esm/packageInfo.js → packageInfo.js} +0 -0
- /package/{build/cjs/styled.d.ts → styled.d.ts} +0 -0
- /package/{build-tsc-esm/styled.js → styled.js} +0 -0
- /package/{build/cjs/types.d.ts → types.d.ts} +0 -0
- /package/{build-tsc-esm/types.js → types.js} +0 -0
package/src/icons/Jdenticon.tsx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Copyright 2017-2025 @pezkuwi/react-identicon authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import type { Props } from '../types.js';
|
|
5
|
-
|
|
6
|
-
import * as jdenticon from 'jdenticon';
|
|
7
|
-
import React, { useMemo } from 'react';
|
|
8
|
-
|
|
9
|
-
function Identicon ({ className = '', publicKey, size, style = {} }: Props): React.ReactElement<Props> {
|
|
10
|
-
const html = useMemo(
|
|
11
|
-
() => ({ __html: jdenticon.toSvg(publicKey.substring(2), size) }),
|
|
12
|
-
[publicKey, size]
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<div
|
|
17
|
-
className={className}
|
|
18
|
-
dangerouslySetInnerHTML={html}
|
|
19
|
-
style={style}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const Jdenticon = React.memo(Identicon);
|
package/src/icons/Polkadot.tsx
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 @pezkuwi/react-identicon authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
// Copyright 2018 Paritytech via paritytech/oo7/polkadot-identicon
|
|
5
|
-
|
|
6
|
-
// This has been converted from the original version that can be found at
|
|
7
|
-
//
|
|
8
|
-
// https://github.com/paritytech/oo7/blob/251ba2b7c45503b68eab4320c270b5afa9bccb60/packages/polkadot-identicon/src/index.jsx
|
|
9
|
-
//
|
|
10
|
-
// Here we have done the following to convert the component -
|
|
11
|
-
// - Converted the code to TypeScript
|
|
12
|
-
// - Removed the oo7 dependencies (since not initialised properly, it makes calls to wrong endpoints)
|
|
13
|
-
// - Remove encoding functionality, these are catered for in the base
|
|
14
|
-
// - Remove copy functionality (this is catered from in the base components)
|
|
15
|
-
// - Split calculations into relevant functions
|
|
16
|
-
// - Move constants to file-level
|
|
17
|
-
// - Overall it is now just a static component, expecting an address as an input value
|
|
18
|
-
|
|
19
|
-
import type { Circle } from '@pezkuwi/ui-shared/icons/types';
|
|
20
|
-
import type { Props } from '../types.js';
|
|
21
|
-
|
|
22
|
-
import React, { useMemo } from 'react';
|
|
23
|
-
|
|
24
|
-
import { polkadotIcon } from '@pezkuwi/ui-shared';
|
|
25
|
-
|
|
26
|
-
function renderCircle ({ cx, cy, fill, r }: Circle, key: number): React.ReactNode {
|
|
27
|
-
return (
|
|
28
|
-
<circle
|
|
29
|
-
cx={cx}
|
|
30
|
-
cy={cy}
|
|
31
|
-
fill={fill}
|
|
32
|
-
key={key}
|
|
33
|
-
r={r}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function Identicon ({ address, className = '', isAlternative = false, size, style = {} }: Props): React.ReactElement<Props> {
|
|
39
|
-
const circles = useMemo(
|
|
40
|
-
() => polkadotIcon(address, { isAlternative }),
|
|
41
|
-
[address, isAlternative]
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<svg
|
|
46
|
-
className={className}
|
|
47
|
-
height={size}
|
|
48
|
-
id={address}
|
|
49
|
-
name={address}
|
|
50
|
-
style={style}
|
|
51
|
-
viewBox='0 0 64 64'
|
|
52
|
-
width={size}
|
|
53
|
-
>
|
|
54
|
-
{circles.map(renderCircle)}
|
|
55
|
-
</svg>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const Polkadot = React.memo(Identicon);
|
package/src/icons/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Copyright 2017-2025 @pezkuwi/react-identicon authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
export { Beachball } from './Beachball.js';
|
|
5
|
-
export { Empty } from './Empty.js';
|
|
6
|
-
export { Ethereum } from './Ethereum.js';
|
|
7
|
-
export { Jdenticon } from './Jdenticon.js';
|
|
8
|
-
export { Polkadot } from './Polkadot.js';
|
package/src/index.ts
DELETED
package/src/packageDetect.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Copyright 2017-2026 @pezkuwi/react-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 settingsInfo } from '@pezkuwi/ui-settings/packageInfo';
|
|
8
|
-
import { packageInfo as sharedInfo } from '@pezkuwi/ui-shared/packageInfo';
|
|
9
|
-
import { detectPackage } from '@pezkuwi/util';
|
|
10
|
-
|
|
11
|
-
import { packageInfo } from './packageInfo.js';
|
|
12
|
-
|
|
13
|
-
detectPackage(packageInfo, null, [settingsInfo, sharedInfo]);
|
package/src/packageInfo.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Copyright 2017-2026 @pezkuwi/react-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/react-identicon', path: 'auto', type: 'auto', version: '3.16.6' };
|
package/src/styled.ts
DELETED
package/src/types.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2025 @pezkuwi/react-identicon authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import type React from 'react';
|
|
5
|
-
import type { Prefix } from '@pezkuwi/util-crypto/address/types';
|
|
6
|
-
|
|
7
|
-
export interface BaseProps {
|
|
8
|
-
className?: string;
|
|
9
|
-
style?: React.CSSProperties;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Props extends BaseProps {
|
|
13
|
-
address: string;
|
|
14
|
-
isAlternative?: boolean | undefined;
|
|
15
|
-
publicKey: string;
|
|
16
|
-
size: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface IdentityProps extends BaseProps {
|
|
20
|
-
Custom?: React.ComponentType<Props>;
|
|
21
|
-
isAlternative?: boolean;
|
|
22
|
-
isHighlight?: boolean;
|
|
23
|
-
onCopy?: (value: string) => void;
|
|
24
|
-
prefix?: Prefix;
|
|
25
|
-
size?: number;
|
|
26
|
-
theme?: IconTheme;
|
|
27
|
-
value?: string | Uint8Array | null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type IconTheme = 'beachball' | 'empty' | 'ethereum' | 'jdenticon' | 'polkadot' | 'substrate';
|
package/tsconfig.build.json
DELETED
|
@@ -1,12 +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
|
-
{ "path": "../ui-settings/tsconfig.build.json" }
|
|
11
|
-
]
|
|
12
|
-
}
|