@xyo-network/react-chain-shared 1.3.12 → 1.3.14

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 CHANGED
@@ -1,6 +1,16 @@
1
+ # @xyo-network/react-chain-shared
2
+
1
3
  [![logo][]](https://xyo.network)
2
4
 
3
- Part of [@xyo-network/react-chain](https://www.npmjs.com/package/@xyo-network/react-chain)
5
+ Version: 1.3.13
6
+
7
+ XYO Layer One React SDK
8
+
9
+ ## Documentation
10
+
11
+ [TypeDoc Generated Documentation](https://gitbook.xyo.network/xyo-data-lab/xyo-reference/package-documentation/xyo-network__react-chain-shared)
12
+
13
+ Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js)
4
14
 
5
15
  ## License
6
16
 
@@ -37,7 +37,22 @@ var StyledMenuItem = styled(MenuItem, {
37
37
  paddingLeft: theme.spacing(1),
38
38
  marginBottom: theme.spacing(1)
39
39
  }));
40
+
41
+ // src/story/buildRandomBlockchain.ts
42
+ import { Account } from "@xyo-network/account";
43
+ import { buildRandomChain } from "@xyo-network/chain-protocol";
44
+ var buildRandomBlockChain = /* @__PURE__ */ __name(async (blockCount = 10) => {
45
+ const initialBlockProducer = await Account.random();
46
+ const blocks = await buildRandomChain(initialBlockProducer, blockCount);
47
+ return blocks;
48
+ }, "buildRandomBlockChain");
49
+ var buildRandomBlockChainBlocksOnly = /* @__PURE__ */ __name(async (blockCount = 10) => {
50
+ const chain = await buildRandomChain(await Account.random(), blockCount);
51
+ return chain;
52
+ }, "buildRandomBlockChainBlocksOnly");
40
53
  export {
41
- ActiveMenuItem
54
+ ActiveMenuItem,
55
+ buildRandomBlockChain,
56
+ buildRandomBlockChainBlocksOnly
42
57
  };
43
58
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/menu-item/ActiveMenuItem.tsx"],"sourcesContent":["import type { MenuItemProps } from '@mui/material'\nimport {\n MenuItem, styled, useTheme,\n} from '@mui/material'\nimport React from 'react'\n\nexport const ActiveMenuItem: React.FC<MenuItemProps & { active?: boolean }> = ({\n active, children, sx, ...props\n}) => {\n const theme = useTheme()\n return (\n <StyledMenuItem\n disableRipple\n sx={{\n // left border color and background color for active state\n 'borderLeft': `5px solid ${active ? theme.vars.palette.secondary.light : 'transparent'}`,\n 'backgroundColor': active ? theme.vars.palette.secondary.dark : 'transparent',\n // force white text color for active state for improved readability with background color\n 'color': active ? 'white' : 'unset',\n '&:hover': {\n // overriding default hover color and backgroundColor since active state conflicts visually with\n // default styles of MenuItem hover\n ...(active ? { backgroundColor: theme.vars.palette.secondary.dark } : {}),\n color: active ? 'white' : 'unset',\n },\n ...sx,\n }}\n {...props}\n >\n {children}\n </StyledMenuItem>\n )\n}\n\nconst StyledMenuItem = styled(MenuItem, { name: 'StyledMenuItem' })(({ theme }) => ({\n display: 'flex-inline',\n flexDirection: 'row',\n gap: theme.spacing(1),\n padding: 0,\n paddingLeft: theme.spacing(1),\n marginBottom: theme.spacing(1),\n}))\n"],"mappings":";;;;AACA,SACEA,UAAUC,QAAQC,gBACb;AACP,OAAOC,WAAW;AAEX,IAAMC,iBAAiE,wBAAC,EAC7EC,QAAQC,UAAUC,IAAI,GAAGC,MAAAA,MAC1B;AACC,QAAMC,QAAQC,SAAAA;AACd,SACE,sBAAA,cAACC,gBAAAA;IACCC,eAAAA;IACAL,IAAI;;MAEF,cAAc,aAAaF,SAASI,MAAMI,KAAKC,QAAQC,UAAUC,QAAQ,aAAA;MACzE,mBAAmBX,SAASI,MAAMI,KAAKC,QAAQC,UAAUE,OAAO;;MAEhE,SAASZ,SAAS,UAAU;MAC5B,WAAW;;;QAGT,GAAIA,SAAS;UAAEa,iBAAiBT,MAAMI,KAAKC,QAAQC,UAAUE;QAAK,IAAI,CAAC;QACvEE,OAAOd,SAAS,UAAU;MAC5B;MACA,GAAGE;IACL;IACC,GAAGC;KAEHF,QAAAA;AAGP,GA1B8E;AA4B9E,IAAMK,iBAAiBS,OAAOC,UAAU;EAAEC,MAAM;AAAiB,CAAA,EAAG,CAAC,EAAEb,MAAK,OAAQ;EAClFc,SAAS;EACTC,eAAe;EACfC,KAAKhB,MAAMiB,QAAQ,CAAA;EACnBC,SAAS;EACTC,aAAanB,MAAMiB,QAAQ,CAAA;EAC3BG,cAAcpB,MAAMiB,QAAQ,CAAA;AAC9B,EAAA;","names":["MenuItem","styled","useTheme","React","ActiveMenuItem","active","children","sx","props","theme","useTheme","StyledMenuItem","disableRipple","vars","palette","secondary","light","dark","backgroundColor","color","styled","MenuItem","name","display","flexDirection","gap","spacing","padding","paddingLeft","marginBottom"]}
1
+ {"version":3,"sources":["../../src/components/menu-item/ActiveMenuItem.tsx","../../src/story/buildRandomBlockchain.ts"],"sourcesContent":["import type { MenuItemProps } from '@mui/material'\nimport {\n MenuItem, styled, useTheme,\n} from '@mui/material'\nimport React from 'react'\n\nexport const ActiveMenuItem: React.FC<MenuItemProps & { active?: boolean }> = ({\n active, children, sx, ...props\n}) => {\n const theme = useTheme()\n return (\n <StyledMenuItem\n disableRipple\n sx={{\n // left border color and background color for active state\n 'borderLeft': `5px solid ${active ? theme.vars.palette.secondary.light : 'transparent'}`,\n 'backgroundColor': active ? theme.vars.palette.secondary.dark : 'transparent',\n // force white text color for active state for improved readability with background color\n 'color': active ? 'white' : 'unset',\n '&:hover': {\n // overriding default hover color and backgroundColor since active state conflicts visually with\n // default styles of MenuItem hover\n ...(active ? { backgroundColor: theme.vars.palette.secondary.dark } : {}),\n color: active ? 'white' : 'unset',\n },\n ...sx,\n }}\n {...props}\n >\n {children}\n </StyledMenuItem>\n )\n}\n\nconst StyledMenuItem = styled(MenuItem, { name: 'StyledMenuItem' })(({ theme }) => ({\n display: 'flex-inline',\n flexDirection: 'row',\n gap: theme.spacing(1),\n padding: 0,\n paddingLeft: theme.spacing(1),\n marginBottom: theme.spacing(1),\n}))\n","import { Account } from '@xyo-network/account'\nimport { buildRandomChain } from '@xyo-network/chain-protocol'\nimport type { HydratedBlock } from '@xyo-network/xl1-protocol'\n\nexport const buildRandomBlockChain = async (blockCount = 10) => {\n // Create a producer\n const initialBlockProducer = await Account.random()\n\n // Create multiple blocks\n const blocks: HydratedBlock[] = await buildRandomChain(initialBlockProducer, blockCount)\n return blocks\n}\n\nexport const buildRandomBlockChainBlocksOnly = async (blockCount = 10) => {\n const chain = await buildRandomChain(await Account.random(), blockCount)\n return chain\n}\n"],"mappings":";;;;AACA,SACEA,UAAUC,QAAQC,gBACb;AACP,OAAOC,WAAW;AAEX,IAAMC,iBAAiE,wBAAC,EAC7EC,QAAQC,UAAUC,IAAI,GAAGC,MAAAA,MAC1B;AACC,QAAMC,QAAQC,SAAAA;AACd,SACE,sBAAA,cAACC,gBAAAA;IACCC,eAAAA;IACAL,IAAI;;MAEF,cAAc,aAAaF,SAASI,MAAMI,KAAKC,QAAQC,UAAUC,QAAQ,aAAA;MACzE,mBAAmBX,SAASI,MAAMI,KAAKC,QAAQC,UAAUE,OAAO;;MAEhE,SAASZ,SAAS,UAAU;MAC5B,WAAW;;;QAGT,GAAIA,SAAS;UAAEa,iBAAiBT,MAAMI,KAAKC,QAAQC,UAAUE;QAAK,IAAI,CAAC;QACvEE,OAAOd,SAAS,UAAU;MAC5B;MACA,GAAGE;IACL;IACC,GAAGC;KAEHF,QAAAA;AAGP,GA1B8E;AA4B9E,IAAMK,iBAAiBS,OAAOC,UAAU;EAAEC,MAAM;AAAiB,CAAA,EAAG,CAAC,EAAEb,MAAK,OAAQ;EAClFc,SAAS;EACTC,eAAe;EACfC,KAAKhB,MAAMiB,QAAQ,CAAA;EACnBC,SAAS;EACTC,aAAanB,MAAMiB,QAAQ,CAAA;EAC3BG,cAAcpB,MAAMiB,QAAQ,CAAA;AAC9B,EAAA;;;ACzCA,SAASI,eAAe;AACxB,SAASC,wBAAwB;AAG1B,IAAMC,wBAAwB,8BAAOC,aAAa,OAAE;AAEzD,QAAMC,uBAAuB,MAAMC,QAAQC,OAAM;AAGjD,QAAMC,SAA0B,MAAMC,iBAAiBJ,sBAAsBD,UAAAA;AAC7E,SAAOI;AACT,GAPqC;AAS9B,IAAME,kCAAkC,8BAAON,aAAa,OAAE;AACnE,QAAMO,QAAQ,MAAMF,iBAAiB,MAAMH,QAAQC,OAAM,GAAIH,UAAAA;AAC7D,SAAOO;AACT,GAH+C;","names":["MenuItem","styled","useTheme","React","ActiveMenuItem","active","children","sx","props","theme","useTheme","StyledMenuItem","disableRipple","vars","palette","secondary","light","dark","backgroundColor","color","styled","MenuItem","name","display","flexDirection","gap","spacing","padding","paddingLeft","marginBottom","Account","buildRandomChain","buildRandomBlockChain","blockCount","initialBlockProducer","Account","random","blocks","buildRandomChain","buildRandomBlockChainBlocksOnly","chain"]}
@@ -1,2 +1,3 @@
1
1
  export * from './components/index.ts';
2
+ export * from './story/index.ts';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { HydratedBlock } from '@xyo-network/xl1-protocol';
2
+ export declare const buildRandomBlockChain: (blockCount?: number) => Promise<HydratedBlock[]>;
3
+ export declare const buildRandomBlockChainBlocksOnly: (blockCount?: number) => Promise<import("@xyo-network/xl1-protocol").SignedHydratedBlock[]>;
4
+ //# sourceMappingURL=buildRandomBlockchain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildRandomBlockchain.d.ts","sourceRoot":"","sources":["../../../src/story/buildRandomBlockchain.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE9D,eAAO,MAAM,qBAAqB,GAAU,mBAAe,6BAO1D,CAAA;AAED,eAAO,MAAM,+BAA+B,GAAU,mBAAe,uEAGpE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './buildRandomBlockchain.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/story/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA"}
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-shared",
4
- "version": "1.3.12",
4
+ "version": "1.3.14",
5
5
  "description": "XYO Layer One React SDK",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -37,14 +37,18 @@
37
37
  "build-storybook": "storybook build",
38
38
  "start": "storybook dev -p 6006"
39
39
  },
40
+ "dependencies": {
41
+ "@xyo-network/chain-protocol": "^1.3.14",
42
+ "@xyo-network/xl1-protocol": "^1.3.11"
43
+ },
40
44
  "devDependencies": {
41
45
  "@emotion/react": "^11.14.0",
42
46
  "@emotion/styled": "^11.14.0",
43
47
  "@mui/material": "^7.0.2",
44
48
  "@types/react": "^19.1.2",
45
- "@xylabs/ts-scripts-yarn3": "^6.5.4",
46
- "@xylabs/tsconfig-react": "^6.5.4",
47
- "knip": "^5.51.1",
49
+ "@xylabs/ts-scripts-yarn3": "^6.5.5",
50
+ "@xylabs/tsconfig-react": "^6.5.5",
51
+ "knip": "^5.52.0",
48
52
  "react": "^19.1.0",
49
53
  "react-dom": "^19.1.0",
50
54
  "typescript": "^5.8.3"
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './components/index.ts'
2
+ export * from './story/index.ts'
@@ -0,0 +1,17 @@
1
+ import { Account } from '@xyo-network/account'
2
+ import { buildRandomChain } from '@xyo-network/chain-protocol'
3
+ import type { HydratedBlock } from '@xyo-network/xl1-protocol'
4
+
5
+ export const buildRandomBlockChain = async (blockCount = 10) => {
6
+ // Create a producer
7
+ const initialBlockProducer = await Account.random()
8
+
9
+ // Create multiple blocks
10
+ const blocks: HydratedBlock[] = await buildRandomChain(initialBlockProducer, blockCount)
11
+ return blocks
12
+ }
13
+
14
+ export const buildRandomBlockChainBlocksOnly = async (blockCount = 10) => {
15
+ const chain = await buildRandomChain(await Account.random(), blockCount)
16
+ return chain
17
+ }
@@ -0,0 +1 @@
1
+ export * from './buildRandomBlockchain.ts'