@xyo-network/react-chain-blockies 1.21.0 → 1.21.2
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/README.md +4 -0
- package/dist/browser/components/blockies/Account.d.ts +6 -0
- package/dist/browser/components/blockies/Account.d.ts.map +1 -1
- package/dist/browser/components/blockies/Avatar.d.ts +18 -0
- package/dist/browser/components/blockies/Avatar.d.ts.map +1 -1
- package/dist/browser/components/blockies/blockies.d.ts +12 -0
- package/dist/browser/components/blockies/blockies.d.ts.map +1 -1
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +28 -27
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @xyo-network/react-chain-blockies
|
|
2
2
|
|
|
3
|
+
**DEPRECATED.** This package has been replaced by [`@xyo-network/xl1-blockies`](https://github.com/xylabs/xl1-protocol/tree/main/packages/react/packages/blockies). New code should depend on the replacement; existing dependents should migrate at their next opportunity.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
3
7
|
[![npm][npm-badge]][npm-link]
|
|
4
8
|
[![license][license-badge]][license-link]
|
|
5
9
|
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { BlockiesOptions } from './blockies.ts';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use {@link BlockiesAccountProps} from `@xyo-network/xl1-blockies` instead.
|
|
5
|
+
*/
|
|
3
6
|
export interface BlockiesAccountProps extends Partial<BlockiesOptions> {
|
|
4
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use {@link BlockiesAccount} from `@xyo-network/xl1-blockies` instead.
|
|
10
|
+
*/
|
|
5
11
|
export declare const BlockiesAccount: React.FC<BlockiesAccountProps>;
|
|
6
12
|
//# sourceMappingURL=Account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/Account.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC;CAAG;AAEzE,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAQ1D,CAAA"}
|
|
1
|
+
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/Account.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC;CAAG;AAEzE;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAQ1D,CAAA"}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import type { AvatarProps, BadgeProps } from '@mui/material';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { BlockiesOptions } from './blockies.ts';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use {@link BlockiesAvatarProps} from `@xyo-network/xl1-blockies` instead.
|
|
6
|
+
*/
|
|
4
7
|
export interface BlockiesAvatarProps extends AvatarProps {
|
|
5
8
|
blockiesOptions?: Partial<BlockiesOptions>;
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use {@link BlockiesAvatar} from `@xyo-network/xl1-blockies` instead.
|
|
12
|
+
*/
|
|
7
13
|
export declare const BlockiesAvatar: React.FC<BlockiesAvatarProps>;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use {@link BlockiesAvatarAddressProps} from `@xyo-network/xl1-blockies` instead.
|
|
16
|
+
*/
|
|
8
17
|
export interface BlockiesAvatarAddressProps extends AvatarProps {
|
|
9
18
|
/** The Address to display */
|
|
10
19
|
address?: string;
|
|
@@ -13,11 +22,20 @@ export interface BlockiesAvatarAddressProps extends AvatarProps {
|
|
|
13
22
|
/** The size of the avatar in pixels, defaults to 24 */
|
|
14
23
|
size?: number;
|
|
15
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use {@link BlockiesAvatarAddress} from `@xyo-network/xl1-blockies` instead.
|
|
27
|
+
*/
|
|
16
28
|
export declare const BlockiesAvatarAddress: React.FC<BlockiesAvatarAddressProps>;
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Use {@link BlockiesAvatarAddressApprovedProps} from `@xyo-network/xl1-blockies` instead.
|
|
31
|
+
*/
|
|
17
32
|
export interface BlockiesAvatarAddressApprovedProps extends BlockiesAvatarAddressProps {
|
|
18
33
|
/** Whether to show the approved badge */
|
|
19
34
|
approved?: boolean;
|
|
20
35
|
badgeVariant?: BadgeProps['variant'];
|
|
21
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use {@link BlockiesAvatarAddressApproved} from `@xyo-network/xl1-blockies` instead.
|
|
39
|
+
*/
|
|
22
40
|
export declare const BlockiesAvatarAddressApproved: React.FC<BlockiesAvatarAddressApprovedProps>;
|
|
23
41
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM5D,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAC3C;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA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AAK,CAAC,EAAE,CAAC,0BAA0B,CAsBtE,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,kCAAmC,SAAQ,0BAA0B;IACpF,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;CACrC;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAE,KAAK,CAAC,EAAE,CAAC,kCAAkC,CAyBtF,CAAA"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* inspired by https://github.com/download13/blockies/blob/master/src/blockies.mjs
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use {@link BlockiesOptions} from `@xyo-network/xl1-blockies` instead.
|
|
6
|
+
*/
|
|
4
7
|
export interface BlockiesOptions {
|
|
5
8
|
bgcolor: string;
|
|
6
9
|
color: string;
|
|
@@ -9,7 +12,16 @@ export interface BlockiesOptions {
|
|
|
9
12
|
size: number;
|
|
10
13
|
spotcolor: string;
|
|
11
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use {@link buildOpts} from `@xyo-network/xl1-blockies` instead.
|
|
17
|
+
*/
|
|
12
18
|
export declare function buildOpts(opts: Partial<BlockiesOptions>): BlockiesOptions;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use {@link renderIcon} from `@xyo-network/xl1-blockies` instead.
|
|
21
|
+
*/
|
|
13
22
|
export declare function renderIcon(opts: Partial<BlockiesOptions>, canvas: HTMLCanvasElement): HTMLCanvasElement;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use {@link createIcon} from `@xyo-network/xl1-blockies` instead.
|
|
25
|
+
*/
|
|
14
26
|
export declare function createIcon(opts: Partial<BlockiesOptions>): HTMLCanvasElement;
|
|
15
27
|
//# sourceMappingURL=blockies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockies.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/blockies.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiEH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAczE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,iBAAiB,qBA2BnF;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,qBAMxD"}
|
|
1
|
+
{"version":3,"file":"blockies.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/blockies.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAczE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,iBAAiB,qBA2BnF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,qBAMxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/blockies/Account.tsx","../../src/components/blockies/blockies.ts","../../src/components/blockies/Avatar.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\n\nimport type { BlockiesOptions } from './blockies.ts'\nimport { createIcon } from './blockies.ts'\n\nexport interface BlockiesAccountProps extends Partial<BlockiesOptions> {}\n\nexport const BlockiesAccount: React.FC<BlockiesAccountProps> = ({ ...options }) => {\n const img = useMemo(() => {\n if (options.seed !== undefined) {\n return createIcon(options).toDataURL()\n }\n }, [options])\n\n return <img src={img} />\n}\n","/**\n * inspired by https://github.com/download13/blockies/blob/master/src/blockies.mjs\n */\n\n// The random number is a js implementation of the Xorshift PRNG\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst randomSeed: any[] = Array.from({ length: 4 }) // Xorshift: [x, y, z, w] 32 bit values\n\nfunction seedRandom(seed: string) {\n for (let i = 0; i < randomSeed.length; i++) {\n randomSeed[i] = 0\n }\n for (let i = 0; i < seed.length; i++) {\n randomSeed[i % 4] = ((randomSeed[i % 4] << 5) - randomSeed[i % 4]) + seed.codePointAt(i)!\n }\n}\n\nfunction rand() {\n // based on Java's String.hashCode(), expanded to 4 32bit values\n const t = randomSeed[0] ^ (randomSeed[0] << 11)\n\n randomSeed[0] = randomSeed[1]\n randomSeed[1] = randomSeed[2]\n randomSeed[2] = randomSeed[3]\n randomSeed[3] = (randomSeed[3] ^ (randomSeed[3] >> 19) ^ t ^ (t >> 8))\n\n return (randomSeed[3] >>> 0) / ((1 << 31) >>> 0)\n}\n\nfunction createColor() {\n // saturation is the whole color spectrum\n const h = Math.floor(rand() * 360)\n // saturation goes from 40 to 100, it avoids greyish colors\n const s = ((rand() * 60) + 40) + '%'\n // lightness can be anything from 0 to 100, but probabilities are a bell curve around 50%\n const l = ((rand() + rand() + rand() + rand()) * 25) + '%'\n\n return 'hsl(' + h + ',' + s + ',' + l + ')'\n}\n\nfunction createImageData(size: number) {\n const width = size // Only support square icons for now\n const height = size\n\n const dataWidth = Math.ceil(width / 2)\n const mirrorWidth = width - dataWidth\n\n const data = []\n for (let y = 0; y < height; y++) {\n let row = []\n for (let x = 0; x < dataWidth; x++) {\n // this makes foreground and background color to have a 43% (1/2.3) probability\n // spot color has 13% chance\n row[x] = Math.floor(rand() * 2.3)\n }\n const r = row.slice(0, mirrorWidth)\n r.reverse()\n row = [...row, ...r]\n\n for (const element of row) {\n data.push(element)\n }\n }\n\n return data\n}\n\nexport interface BlockiesOptions {\n bgcolor: string\n color: string\n scale: number\n seed: string\n size: number\n spotcolor: string\n}\n\nexport function buildOpts(opts: Partial<BlockiesOptions>): BlockiesOptions {\n const newOpts = {} as BlockiesOptions\n\n newOpts.seed = opts.seed ?? Math.floor((Math.random() * Math.pow(10, 16))).toString(16)\n\n seedRandom(newOpts.seed)\n\n newOpts.size = opts.size ?? 8\n newOpts.scale = opts.scale ?? 4\n newOpts.color = opts.color ?? createColor()\n newOpts.bgcolor = opts.bgcolor ?? createColor()\n newOpts.spotcolor = opts.spotcolor ?? createColor()\n\n return newOpts\n}\n\nexport function renderIcon(opts: Partial<BlockiesOptions>, canvas: HTMLCanvasElement) {\n const updatedOptions = buildOpts(opts ?? {})\n const imageData = createImageData(updatedOptions.size)\n const width = Math.sqrt(imageData.length)\n\n canvas.width = canvas.height = updatedOptions.size * updatedOptions.scale\n\n const cc = canvas.getContext('2d')\n if (cc === null) throw new Error('unable to get 2d context')\n cc.fillStyle = updatedOptions.bgcolor\n cc.fillRect(0, 0, canvas.width, canvas.height)\n cc.fillStyle = updatedOptions.color\n\n for (const [i, imageDatum] of imageData.entries()) {\n // if data is 0, leave the background\n if (imageDatum > 0) {\n const row = Math.floor(i / width)\n const col = i % width\n\n // if data is 2, choose spot color, if 1 choose foreground\n cc.fillStyle = (imageDatum == 1) ? updatedOptions.color : updatedOptions.spotcolor\n\n cc.fillRect(col * updatedOptions.scale, row * updatedOptions.scale, updatedOptions.scale, updatedOptions.scale)\n }\n }\n\n return canvas\n}\n\nexport function createIcon(opts: Partial<BlockiesOptions>) {\n const canvas = document.createElement('canvas')\n\n renderIcon(opts, canvas)\n\n return canvas\n}\n","import { Circle } from '@mui/icons-material'\nimport type { AvatarProps, BadgeProps } from '@mui/material'\nimport {\n Avatar, Badge, useTheme,\n} from '@mui/material'\nimport { grey } from '@mui/material/colors'\nimport { alphaCss } from '@xylabs/react-theme'\nimport React, { useMemo } from 'react'\n\nimport type { BlockiesOptions } from './blockies.ts'\nimport { createIcon } from './blockies.ts'\n\nexport interface BlockiesAvatarProps extends AvatarProps {\n blockiesOptions?: Partial<BlockiesOptions>\n}\n\nexport const BlockiesAvatar: React.FC<BlockiesAvatarProps> = ({ blockiesOptions, ...props }) => {\n const img = useMemo(() => {\n if (blockiesOptions?.seed !== undefined) {\n return createIcon(blockiesOptions).toDataURL()\n }\n }, [blockiesOptions])\n\n return (\n <Avatar component=\"span\" src={img} {...props} />\n )\n}\n\nexport interface BlockiesAvatarAddressProps extends AvatarProps {\n /** The Address to display */\n address?: string\n /** Size of the border is the size prop * borderSizeFactor and rounded up */\n borderSizeFactor?: number\n /** The size of the avatar in pixels, defaults to 24 */\n size?: number\n}\n\nexport const BlockiesAvatarAddress: React.FC<BlockiesAvatarAddressProps> = ({\n address, borderSizeFactor = 0.0833, size = 24, sx, ...props\n}) => {\n const theme = useTheme()\n const options = useMemo(() => {\n if (address !== undefined) {\n return { seed: address }\n }\n }, [address])\n\n return (\n <BlockiesAvatar\n blockiesOptions={options}\n sx={{\n width: size,\n height: size,\n border: `${Math.ceil(size * borderSizeFactor)}px solid ${alphaCss(theme.vars?.palette.text.primary ?? grey[500], 0.8)}`,\n ...sx,\n }}\n {...props}\n />\n )\n}\n\nexport interface BlockiesAvatarAddressApprovedProps extends BlockiesAvatarAddressProps {\n /** Whether to show the approved badge */\n approved?: boolean\n badgeVariant?: BadgeProps['variant']\n}\n\nexport const BlockiesAvatarAddressApproved: React.FC<BlockiesAvatarAddressApprovedProps> = ({\n approved, badgeVariant, ...props\n}) => {\n const sx = badgeVariant === 'dot'\n ? {}\n : {\n bgcolor: 'white', borderRadius: 12, fontSize: '0.83333rem',\n }\n const dotPlacement = badgeVariant === 'dot' ? 3 : 5\n return (\n <Badge\n color={badgeVariant === 'dot' ? 'success' : 'default'}\n variant={badgeVariant}\n invisible={!approved}\n badgeContent={approved ? <Circle color=\"success\" sx={sx} /> : ''}\n sx={{\n '& .MuiBadge-badge': {\n top: dotPlacement,\n right: dotPlacement,\n },\n }}\n >\n <BlockiesAvatarAddress {...props} />\n </Badge>\n )\n}\n"],"mappings":";;;;AAAA,OAAOA,SAASC,eAAe;;;ACM/B,IAAMC,aAAoBC,MAAMC,KAAK;EAAEC,QAAQ;AAAE,CAAA;AAEjD,SAASC,WAAWC,MAAY;AAC9B,WAASC,IAAI,GAAGA,IAAIN,WAAWG,QAAQG,KAAK;AAC1CN,eAAWM,CAAAA,IAAK;EAClB;AACA,WAASA,IAAI,GAAGA,IAAID,KAAKF,QAAQG,KAAK;AACpCN,eAAWM,IAAI,CAAA,KAAON,WAAWM,IAAI,CAAA,KAAM,KAAKN,WAAWM,IAAI,CAAA,IAAMD,KAAKE,YAAYD,CAAAA;EACxF;AACF;AAPSF;AAST,SAASI,OAAAA;AAEP,QAAMC,IAAIT,WAAW,CAAA,IAAMA,WAAW,CAAA,KAAM;AAE5CA,aAAW,CAAA,IAAKA,WAAW,CAAA;AAC3BA,aAAW,CAAA,IAAKA,WAAW,CAAA;AAC3BA,aAAW,CAAA,IAAKA,WAAW,CAAA;AAC3BA,aAAW,CAAA,IAAMA,WAAW,CAAA,IAAMA,WAAW,CAAA,KAAM,KAAMS,IAAKA,KAAK;AAEnE,UAAQT,WAAW,CAAA,MAAO,MAAO,KAAK,OAAQ;AAChD;AAVSQ;AAYT,SAASE,cAAAA;AAEP,QAAMC,IAAIC,KAAKC,MAAML,KAAAA,IAAS,GAAA;AAE9B,QAAMM,IAAMN,KAAAA,IAAS,KAAM,KAAM;AAEjC,QAAMO,KAAMP,KAAAA,IAASA,KAAAA,IAASA,KAAAA,IAASA,KAAAA,KAAU,KAAM;AAEvD,SAAO,SAASG,IAAI,MAAMG,I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BAAA7B,OAAA,cAACI,uBAA0BX,KAAAA,CAAAA;AAGjC,GAzB2F;","names":["React","useMemo","randomSeed","Array","from","length","seedRandom","seed","i","codePointAt","rand","t","createColor","h","Math","floor","s","l","createImageData","size","width","height","dataWidth","ceil","mirrorWidth","data","y","row","x","r","slice","reverse","element","push","buildOpts","opts","newOpts","random","pow","toString","scale","color","bgcolor","spotcolor","renderIcon","canvas","updatedOptions","imageData","sqrt","cc","getContext","Error","fillStyle","fillRect","imageDatum","entries","col","createIcon","document","createElement","BlockiesAccount","options","img","useMemo","seed","undefined","createIcon","toDataURL","src","Circle","Avatar","Badge","useTheme","grey","alphaCss","React","useMemo","BlockiesAvatar","blockiesOptions","props","img","useMemo","seed","undefined","createIcon","toDataURL","React","Avatar","component","src","BlockiesAvatarAddress","address","borderSizeFactor","size","sx","theme","useTheme","options","width","height","border","Math","ceil","alphaCss","vars","palette","text","primary","grey","BlockiesAvatarAddressApproved","approved","badgeVariant","bgcolor","borderRadius","fontSize","dotPlacement","Badge","color","variant","invisible","badgeContent","Circle","top","right"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/blockies/Account.tsx","../../src/components/blockies/blockies.ts","../../src/components/blockies/Avatar.tsx"],"sourcesContent":["import React, { useMemo } from 'react'\n\nimport type { BlockiesOptions } from './blockies.ts'\nimport { createIcon } from './blockies.ts'\n\n/**\n * @deprecated Use {@link BlockiesAccountProps} from `@xyo-network/xl1-blockies` instead.\n */\nexport interface BlockiesAccountProps extends Partial<BlockiesOptions> {}\n\n/**\n * @deprecated Use {@link BlockiesAccount} from `@xyo-network/xl1-blockies` instead.\n */\nexport const BlockiesAccount: React.FC<BlockiesAccountProps> = ({ ...options }) => {\n const img = useMemo(() => {\n if (options.seed !== undefined) {\n return createIcon(options).toDataURL()\n }\n }, [options])\n\n return <img src={img} />\n}\n","/**\n * inspired by https://github.com/download13/blockies/blob/master/src/blockies.mjs\n */\n\n// The random number is a js implementation of the Xorshift PRNG\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst randomSeed: any[] = Array.from({ length: 4 }) // Xorshift: [x, y, z, w] 32 bit values\n\nfunction seedRandom(seed: string) {\n for (let i = 0; i < randomSeed.length; i++) {\n randomSeed[i] = 0\n }\n for (let i = 0; i < seed.length; i++) {\n randomSeed[i % 4] = ((randomSeed[i % 4] << 5) - randomSeed[i % 4]) + seed.codePointAt(i)!\n }\n}\n\nfunction rand() {\n // based on Java's String.hashCode(), expanded to 4 32bit values\n const t = randomSeed[0] ^ (randomSeed[0] << 11)\n\n randomSeed[0] = randomSeed[1]\n randomSeed[1] = randomSeed[2]\n randomSeed[2] = randomSeed[3]\n randomSeed[3] = (randomSeed[3] ^ (randomSeed[3] >> 19) ^ t ^ (t >> 8))\n\n return (randomSeed[3] >>> 0) / ((1 << 31) >>> 0)\n}\n\nfunction createColor() {\n // saturation is the whole color spectrum\n const h = Math.floor(rand() * 360)\n // saturation goes from 40 to 100, it avoids greyish colors\n const s = ((rand() * 60) + 40) + '%'\n // lightness can be anything from 0 to 100, but probabilities are a bell curve around 50%\n const l = ((rand() + rand() + rand() + rand()) * 25) + '%'\n\n return 'hsl(' + h + ',' + s + ',' + l + ')'\n}\n\nfunction createImageData(size: number) {\n const width = size // Only support square icons for now\n const height = size\n\n const dataWidth = Math.ceil(width / 2)\n const mirrorWidth = width - dataWidth\n\n const data = []\n for (let y = 0; y < height; y++) {\n let row = []\n for (let x = 0; x < dataWidth; x++) {\n // this makes foreground and background color to have a 43% (1/2.3) probability\n // spot color has 13% chance\n row[x] = Math.floor(rand() * 2.3)\n }\n const r = row.slice(0, mirrorWidth)\n r.reverse()\n row = [...row, ...r]\n\n for (const element of row) {\n data.push(element)\n }\n }\n\n return data\n}\n\n/**\n * @deprecated Use {@link BlockiesOptions} from `@xyo-network/xl1-blockies` instead.\n */\nexport interface BlockiesOptions {\n bgcolor: string\n color: string\n scale: number\n seed: string\n size: number\n spotcolor: string\n}\n\n/**\n * @deprecated Use {@link buildOpts} from `@xyo-network/xl1-blockies` instead.\n */\nexport function buildOpts(opts: Partial<BlockiesOptions>): BlockiesOptions {\n const newOpts = {} as BlockiesOptions\n\n newOpts.seed = opts.seed ?? Math.floor((Math.random() * Math.pow(10, 16))).toString(16)\n\n seedRandom(newOpts.seed)\n\n newOpts.size = opts.size ?? 8\n newOpts.scale = opts.scale ?? 4\n newOpts.color = opts.color ?? createColor()\n newOpts.bgcolor = opts.bgcolor ?? createColor()\n newOpts.spotcolor = opts.spotcolor ?? createColor()\n\n return newOpts\n}\n\n/**\n * @deprecated Use {@link renderIcon} from `@xyo-network/xl1-blockies` instead.\n */\nexport function renderIcon(opts: Partial<BlockiesOptions>, canvas: HTMLCanvasElement) {\n const updatedOptions = buildOpts(opts ?? {})\n const imageData = createImageData(updatedOptions.size)\n const width = Math.sqrt(imageData.length)\n\n canvas.width = canvas.height = updatedOptions.size * updatedOptions.scale\n\n const cc = canvas.getContext('2d')\n if (cc === null) throw new Error('unable to get 2d context')\n cc.fillStyle = updatedOptions.bgcolor\n cc.fillRect(0, 0, canvas.width, canvas.height)\n cc.fillStyle = updatedOptions.color\n\n for (const [i, imageDatum] of imageData.entries()) {\n // if data is 0, leave the background\n if (imageDatum > 0) {\n const row = Math.floor(i / width)\n const col = i % width\n\n // if data is 2, choose spot color, if 1 choose foreground\n cc.fillStyle = (imageDatum == 1) ? updatedOptions.color : updatedOptions.spotcolor\n\n cc.fillRect(col * updatedOptions.scale, row * updatedOptions.scale, updatedOptions.scale, updatedOptions.scale)\n }\n }\n\n return canvas\n}\n\n/**\n * @deprecated Use {@link createIcon} from `@xyo-network/xl1-blockies` instead.\n */\nexport function createIcon(opts: Partial<BlockiesOptions>) {\n const canvas = document.createElement('canvas')\n\n renderIcon(opts, canvas)\n\n return canvas\n}\n","import { Circle } from '@mui/icons-material'\nimport type { AvatarProps, BadgeProps } from '@mui/material'\nimport {\n Avatar, Badge, useTheme,\n} from '@mui/material'\nimport { grey } from '@mui/material/colors'\nimport { alphaCss } from '@xylabs/react-theme'\nimport React, { useMemo } from 'react'\n\nimport type { BlockiesOptions } from './blockies.ts'\nimport { createIcon } from './blockies.ts'\n\n/**\n * @deprecated Use {@link BlockiesAvatarProps} from `@xyo-network/xl1-blockies` instead.\n */\nexport interface BlockiesAvatarProps extends AvatarProps {\n blockiesOptions?: Partial<BlockiesOptions>\n}\n\n/**\n * @deprecated Use {@link BlockiesAvatar} from `@xyo-network/xl1-blockies` instead.\n */\nexport const BlockiesAvatar: React.FC<BlockiesAvatarProps> = ({ blockiesOptions, ...props }) => {\n const img = useMemo(() => {\n if (blockiesOptions?.seed !== undefined) {\n return createIcon(blockiesOptions).toDataURL()\n }\n }, [blockiesOptions])\n\n return (\n <Avatar component=\"span\" src={img} {...props} />\n )\n}\n\n/**\n * @deprecated Use {@link BlockiesAvatarAddressProps} from `@xyo-network/xl1-blockies` instead.\n */\nexport interface BlockiesAvatarAddressProps extends AvatarProps {\n /** The Address to display */\n address?: string\n /** Size of the border is the size prop * borderSizeFactor and rounded up */\n borderSizeFactor?: number\n /** The size of the avatar in pixels, defaults to 24 */\n size?: number\n}\n\n/**\n * @deprecated Use {@link BlockiesAvatarAddress} from `@xyo-network/xl1-blockies` instead.\n */\nexport const BlockiesAvatarAddress: React.FC<BlockiesAvatarAddressProps> = ({\n address, borderSizeFactor = 0.0833, size = 24, sx, ...props\n}) => {\n const theme = useTheme()\n const options = useMemo(() => {\n if (address !== undefined) {\n return { seed: address }\n }\n }, [address])\n\n return (\n <BlockiesAvatar\n blockiesOptions={options}\n sx={{\n width: size,\n height: size,\n border: `${Math.ceil(size * borderSizeFactor)}px solid ${alphaCss(theme.vars?.palette.text.primary ?? grey[500], 0.8)}`,\n ...sx,\n }}\n {...props}\n />\n )\n}\n\n/**\n * @deprecated Use {@link BlockiesAvatarAddressApprovedProps} from `@xyo-network/xl1-blockies` instead.\n */\nexport interface BlockiesAvatarAddressApprovedProps extends BlockiesAvatarAddressProps {\n /** Whether to show the approved badge */\n approved?: boolean\n badgeVariant?: BadgeProps['variant']\n}\n\n/**\n * @deprecated Use {@link BlockiesAvatarAddressApproved} from `@xyo-network/xl1-blockies` instead.\n */\nexport const BlockiesAvatarAddressApproved: React.FC<BlockiesAvatarAddressApprovedProps> = ({\n approved, badgeVariant, ...props\n}) => {\n const sx = badgeVariant === 'dot'\n ? {}\n : {\n bgcolor: 'white', borderRadius: 12, fontSize: '0.83333rem',\n }\n const dotPlacement = badgeVariant === 'dot' ? 3 : 5\n return (\n <Badge\n color={badgeVariant === 'dot' ? 'success' : 'default'}\n variant={badgeVariant}\n invisible={!approved}\n badgeContent={approved ? <Circle color=\"success\" sx={sx} /> : ''}\n sx={{\n '& .MuiBadge-badge': {\n top: dotPlacement,\n right: dotPlacement,\n },\n }}\n >\n <BlockiesAvatarAddress {...props} />\n </Badge>\n )\n}\n"],"mappings":";;;;AAAA,OAAOA,SAASC,eAAe;;;ACM/B,IAAMC,aAAoBC,MAAMC,KAAK;EAAEC,QAAQ;AAAE,CAAA;AAEjD,SAASC,WAAWC,MAAY;AAC9B,WAASC,IAAI,GAAGA,IAAIN,WAAWG,QAAQG,KAAK;AAC1CN,eAAWM,CAAAA,IAAK;EAClB;AACA,WAASA,IAAI,GAAGA,IAAID,KAAKF,QAAQG,KAAK;AACpCN,eAAWM,IAAI,CAAA,KAAON,WAAWM,IAAI,CAAA,KAAM,KAAKN,WAAWM,IAAI,CAAA,IAAMD,KAAKE,YAAYD,CAAAA;EACxF;AACF;AAPSF;AAST,SAASI,OAAAA;AAEP,QAAMC,IAAIT,WAAW,CAAA,IAAMA,WAAW,CAAA,KAAM;AAE5CA,aAAW,CAAA,IAAKA,WAAW,CAAA;AAC3BA,aAAW,CAAA,IAAKA,WAAW,CAAA;AAC3BA,aAAW,CAAA,IAAKA,WAAW,CAAA;AAC3BA,aAAW,CAAA,IAAMA,WAAW,CAAA,IAAMA,WAAW,CAAA,KAAM,KAAMS,IAAKA,KAAK;AAEnE,UAAQT,WAAW,CAAA,MAAO,MAAO,KAAK,OAA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gBAAAzB,OAAA,cAAC8B,OAAAA;IACCC,OAAON,iBAAiB,QAAQ,YAAY;IAC5CO,SAASP;IACTQ,WAAW,CAACT;IACZU,cAAcV,WAAW,gBAAAxB,OAAA,cAACmC,QAAAA;MAAOJ,OAAM;MAAUvB;SAAa;IAC9DA,IAAI;MACF,qBAAqB;QACnB4B,KAAKP;QACLQ,OAAOR;MACT;IACF;KAEA,gBAAA7B,OAAA,cAACI,uBAA0BX,KAAAA,CAAAA;AAGjC,GAzB2F;","names":["React","useMemo","randomSeed","Array","from","length","seedRandom","seed","i","codePointAt","rand","t","createColor","h","Math","floor","s","l","createImageData","size","width","height","dataWidth","ceil","mirrorWidth","data","y","row","x","r","slice","reverse","element","push","buildOpts","opts","newOpts","random","pow","toString","scale","color","bgcolor","spotcolor","renderIcon","canvas","updatedOptions","imageData","sqrt","cc","getContext","Error","fillStyle","fillRect","imageDatum","entries","col","createIcon","document","createElement","BlockiesAccount","options","img","useMemo","seed","undefined","createIcon","toDataURL","src","Circle","Avatar","Badge","useTheme","grey","alphaCss","React","useMemo","BlockiesAvatar","blockiesOptions","props","img","useMemo","seed","undefined","createIcon","toDataURL","React","Avatar","component","src","BlockiesAvatarAddress","address","borderSizeFactor","size","sx","theme","useTheme","options","width","height","border","Math","ceil","alphaCss","vars","palette","text","primary","grey","BlockiesAvatarAddressApproved","approved","badgeVariant","bgcolor","borderRadius","fontSize","dotPlacement","Badge","color","variant","invisible","badgeContent","Circle","top","right"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/react-chain-blockies",
|
|
4
|
-
"version": "1.21.
|
|
4
|
+
"version": "1.21.2",
|
|
5
5
|
"description": "XYO Layer One React SDK Blockies",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@types/react": "^19.2.14",
|
|
49
49
|
"@xylabs/react-theme": "~7.2.3",
|
|
50
50
|
"@xylabs/sdk-js": "^5.1.1",
|
|
51
|
-
"@xylabs/toolchain": "~7.13.
|
|
52
|
-
"@xylabs/tsconfig": "~7.13.
|
|
53
|
-
"@xylabs/tsconfig-dom": "~7.13.
|
|
54
|
-
"@xylabs/tsconfig-react": "~7.13.
|
|
51
|
+
"@xylabs/toolchain": "~7.13.13",
|
|
52
|
+
"@xylabs/tsconfig": "~7.13.13",
|
|
53
|
+
"@xylabs/tsconfig-dom": "~7.13.13",
|
|
54
|
+
"@xylabs/tsconfig-react": "~7.13.13",
|
|
55
55
|
"async-mutex": "^0.5.0",
|
|
56
56
|
"bn.js": "^5.2.3",
|
|
57
57
|
"buffer": "^6.0.3",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"eslint": "^10.3.0",
|
|
60
60
|
"ethers": "^6.16.0",
|
|
61
61
|
"pako": "^2.1.0",
|
|
62
|
-
"react": "^19.2.
|
|
63
|
-
"react-dom": "^19.2.
|
|
64
|
-
"react-is": "~19.2.
|
|
62
|
+
"react": "^19.2.6",
|
|
63
|
+
"react-dom": "^19.2.6",
|
|
64
|
+
"react-is": "~19.2.6",
|
|
65
65
|
"react-router-dom": "^7.15.0",
|
|
66
66
|
"recharts": "~3.8.1",
|
|
67
67
|
"storybook": "^10.3.6",
|
|
@@ -70,25 +70,25 @@
|
|
|
70
70
|
"zod": "~4.4.3"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@mui/icons-material": "
|
|
74
|
-
"@mui/material": "
|
|
75
|
-
"@opentelemetry/api": "
|
|
76
|
-
"@opentelemetry/sdk-trace-base": "
|
|
77
|
-
"@react-spring/web": "
|
|
78
|
-
"@xylabs/react-theme": "
|
|
79
|
-
"@xylabs/sdk-js": "
|
|
80
|
-
"async-mutex": "
|
|
81
|
-
"bn.js": "
|
|
82
|
-
"buffer": "
|
|
83
|
-
"chalk": "
|
|
84
|
-
"ethers": "
|
|
85
|
-
"pako": "
|
|
86
|
-
"react": "
|
|
87
|
-
"react-dom": "
|
|
88
|
-
"react-is": "
|
|
89
|
-
"react-router-dom": "
|
|
90
|
-
"recharts": "
|
|
91
|
-
"zod": "
|
|
73
|
+
"@mui/icons-material": "^7.3",
|
|
74
|
+
"@mui/material": "^7.3",
|
|
75
|
+
"@opentelemetry/api": "^1.9",
|
|
76
|
+
"@opentelemetry/sdk-trace-base": "^2.7",
|
|
77
|
+
"@react-spring/web": "~10.0",
|
|
78
|
+
"@xylabs/react-theme": "~7.2",
|
|
79
|
+
"@xylabs/sdk-js": "^5.1",
|
|
80
|
+
"async-mutex": "^0.5",
|
|
81
|
+
"bn.js": "^5.2",
|
|
82
|
+
"buffer": "^6.0",
|
|
83
|
+
"chalk": "^5.6",
|
|
84
|
+
"ethers": "^6.16",
|
|
85
|
+
"pako": "^2.1",
|
|
86
|
+
"react": "^19.2",
|
|
87
|
+
"react-dom": "^19.2",
|
|
88
|
+
"react-is": "~19.2",
|
|
89
|
+
"react-router-dom": "^7.15",
|
|
90
|
+
"recharts": "~3.8",
|
|
91
|
+
"zod": "~4.4"
|
|
92
92
|
},
|
|
93
93
|
"engines": {
|
|
94
94
|
"node": ">=24"
|
|
@@ -96,5 +96,6 @@
|
|
|
96
96
|
"publishConfig": {
|
|
97
97
|
"access": "public"
|
|
98
98
|
},
|
|
99
|
+
"deprecated": "Replaced by @xyo-network/xl1-blockies. See https://github.com/xylabs/xl1-protocol",
|
|
99
100
|
"docs": "dist/docs.json"
|
|
100
101
|
}
|