@xyo-network/react-schema 7.6.2 → 8.0.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProperty.d.ts","sourceRoot":"","sources":["../../../../src/components/Property/SchemaProperty.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAIhE,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAkBD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiHxD,CAAA"}
1
+ {"version":3,"file":"SchemaProperty.d.ts","sourceRoot":"","sources":["../../../../src/components/Property/SchemaProperty.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAIhE,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAkBD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAqIxD,CAAA"}
@@ -61,7 +61,15 @@ var SchemaProperty = ({
61
61
  }
62
62
  onClick(buttonDispatch);
63
63
  },
64
- children: /* @__PURE__ */ jsx(NewReleasesIcon, { color: "warning", fontSize: "inherit" })
64
+ children: /* @__PURE__ */ jsx(
65
+ NewReleasesIcon,
66
+ {
67
+ sx: {
68
+ color: "warning",
69
+ fontSize: "inherit"
70
+ }
71
+ }
72
+ )
65
73
  }
66
74
  ) : resolvedSchema === void 0 ? /* @__PURE__ */ jsx(
67
75
  IconButton,
@@ -74,17 +82,54 @@ var SchemaProperty = ({
74
82
  }
75
83
  onClick(buttonDispatch);
76
84
  },
77
- children: /* @__PURE__ */ jsx(NewReleasesIcon, { color: "disabled", fontSize: "inherit" })
85
+ children: /* @__PURE__ */ jsx(
86
+ NewReleasesIcon,
87
+ {
88
+ sx: {
89
+ color: "disabled",
90
+ fontSize: "inherit"
91
+ }
92
+ }
93
+ )
94
+ }
95
+ ) : /* @__PURE__ */ jsx(IconButton, { rel: "noopener noreferrer", size: "small", target: "_blank", href: resolvedSchema?.huri?.href ?? "", children: /* @__PURE__ */ jsx(
96
+ VerifiedIcon,
97
+ {
98
+ sx: {
99
+ color: "success",
100
+ fontSize: "inherit"
101
+ }
78
102
  }
79
- ) : /* @__PURE__ */ jsx(IconButton, { rel: "noopener noreferrer", size: "small", target: "_blank", href: resolvedSchema?.huri?.href ?? "", children: /* @__PURE__ */ jsx(VerifiedIcon, { color: "success", fontSize: "inherit" }) }) : null,
80
- value ? /* @__PURE__ */ jsxs(FlexGrowRow, { ref: divRef, justifyContent: "space-between", children: [
81
- showLinkNames ? /* @__PURE__ */ jsx(
82
- LinkEx,
83
- {
84
- display: "block",
85
- width: "100%",
86
- sx: { cursor: "pointer" },
87
- children: /* @__PURE__ */ jsx(
103
+ ) }) : null,
104
+ value ? /* @__PURE__ */ jsxs(
105
+ FlexGrowRow,
106
+ {
107
+ ref: divRef,
108
+ sx: { justifyContent: "space-between" },
109
+ children: [
110
+ showLinkNames ? /* @__PURE__ */ jsx(
111
+ LinkEx,
112
+ {
113
+ sx: {
114
+ display: "block",
115
+ width: "100%",
116
+ cursor: "pointer"
117
+ },
118
+ children: /* @__PURE__ */ jsx(
119
+ PropertyValue,
120
+ {
121
+ value,
122
+ title: "view schema",
123
+ onClick: () => {
124
+ if (!divRef.current) {
125
+ console.warn("divRef.current is null");
126
+ }
127
+ onClick(divDispatch);
128
+ }
129
+ }
130
+ )
131
+ }
132
+ ) : /* @__PURE__ */ jsx(
88
133
  PropertyValue,
89
134
  {
90
135
  value,
@@ -96,36 +141,24 @@ var SchemaProperty = ({
96
141
  onClick(divDispatch);
97
142
  }
98
143
  }
99
- )
100
- }
101
- ) : /* @__PURE__ */ jsx(
102
- PropertyValue,
103
- {
104
- value,
105
- title: "view schema",
106
- onClick: () => {
107
- if (!divRef.current) {
108
- console.warn("divRef.current is null");
109
- }
110
- onClick(divDispatch);
111
- }
112
- }
113
- ),
114
- showOpenNewWindowLink ? /* @__PURE__ */ jsx(
115
- IconButton,
116
- {
117
- ref: buttonRef,
118
- size: "small",
119
- onClick: () => {
120
- if (!buttonRef.current) {
121
- console.warn("buttonRef.current is null");
144
+ ),
145
+ showOpenNewWindowLink ? /* @__PURE__ */ jsx(
146
+ IconButton,
147
+ {
148
+ ref: buttonRef,
149
+ size: "small",
150
+ onClick: () => {
151
+ if (!buttonRef.current) {
152
+ console.warn("buttonRef.current is null");
153
+ }
154
+ onClick(buttonDispatch, true);
155
+ },
156
+ children: /* @__PURE__ */ jsx(OpenInNewIcon, { sx: { fontSize: "inherit" } })
122
157
  }
123
- onClick(buttonDispatch, true);
124
- },
125
- children: /* @__PURE__ */ jsx(OpenInNewIcon, { fontSize: "inherit" })
126
- }
127
- ) : null
128
- ] }) : null
158
+ ) : null
159
+ ]
160
+ }
161
+ ) : null
129
162
  ] });
130
163
  };
131
164
  SchemaProperty.displayName = "SchemaProperty";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Property/SchemaProperty.tsx","../../src/components/SelectEx/SchemaSelectEx.tsx","../../src/contexts/Schema/Context.ts","../../src/contexts/Schema/Provider/Memory.tsx","../../src/hooks/useGetSchema.tsx","../../src/hooks/useSchemaDefinitions.tsx","../../src/hooks/useSchemaList.tsx","../../src/hooks/useSchemaStats.tsx","../../src/contexts/Schema/Provider/Route.tsx","../../src/contexts/Schema/use.ts"],"sourcesContent":["import {\n NewReleases as NewReleasesIcon, OpenInNew as OpenInNewIcon, Verified as VerifiedIcon,\n} from '@mui/icons-material'\nimport { IconButton } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport type { EventDispatch, EventNoun } from '@xyo-network/react-event'\nimport { useEvent } from '@xyo-network/react-event'\nimport type { PropertyProps } from '@xyo-network/react-property'\nimport { Property, PropertyValue } from '@xyo-network/react-property'\nimport type { SchemaCacheEntry } from '@xyo-network/schema-cache'\nimport { SchemaCache } from '@xyo-network/schema-cache'\nimport React, { useState } from 'react'\n\nexport type SchemaPropertyProps = PropertyProps & {\n showLinkNames?: boolean\n showOpenNewWindowLink?: boolean\n showStatusIcon?: boolean\n value?: string\n}\n\nconst useResolveSchema = (schema?: string) => {\n const [entry, setEntry] = useState<SchemaCacheEntry | null>()\n useAsyncEffect(\n async (mounted) => {\n if (schema) {\n const entry = await SchemaCache.instance.get(schema)\n if (mounted()) {\n setEntry(entry)\n }\n }\n },\n [schema],\n )\n return entry\n}\n\nexport const SchemaProperty: React.FC<SchemaPropertyProps> = ({\n showLinkNames = true, showOpenNewWindowLink = true, showStatusIcon = true, titleProps, value, ...props\n}) => {\n const resolvedSchema = useResolveSchema(value)\n const [buttonRef, buttonDispatch] = useEvent<HTMLButtonElement>()\n const [divRef, divDispatch] = useEvent<HTMLDivElement>()\n\n const onClick = (dispatch?: EventDispatch<EventNoun, 'click', string>, openNewWindow = false) => {\n dispatch?.(\n 'schema',\n 'click',\n JSON.stringify({\n openNewWindow,\n schema: value,\n }),\n )\n }\n\n return (\n <Property title=\"Schema\" value={value} tip=\"Schema sent with the payload\" titleProps={titleProps} {...props}>\n {value && showStatusIcon\n ? resolvedSchema === null\n ? (\n <IconButton\n ref={buttonRef}\n size=\"small\"\n onClick={() => {\n if (!buttonRef.current) {\n console.warn('buttonRef.current is null')\n }\n onClick(buttonDispatch)\n }}\n >\n <NewReleasesIcon color=\"warning\" fontSize=\"inherit\" />\n </IconButton>\n )\n : resolvedSchema === undefined\n ? (\n <IconButton\n ref={buttonRef}\n size=\"small\"\n onClick={() => {\n if (!buttonRef.current) {\n console.warn('buttonRef.current is null')\n }\n onClick(buttonDispatch)\n }}\n >\n <NewReleasesIcon color=\"disabled\" fontSize=\"inherit\" />\n </IconButton>\n )\n : (\n <IconButton rel=\"noopener noreferrer\" size=\"small\" target=\"_blank\" href={resolvedSchema?.huri?.href ?? ''}>\n <VerifiedIcon color=\"success\" fontSize=\"inherit\" />\n </IconButton>\n )\n\n : null}\n {value\n ? (\n <FlexGrowRow ref={divRef} justifyContent=\"space-between\">\n {showLinkNames\n ? (\n <LinkEx\n display=\"block\"\n width=\"100%\"\n sx={{ cursor: 'pointer' }}\n >\n <PropertyValue\n value={value}\n title=\"view schema\"\n onClick={() => {\n if (!divRef.current) {\n console.warn('divRef.current is null')\n }\n onClick(divDispatch)\n }}\n />\n </LinkEx>\n )\n : (\n <PropertyValue\n value={value}\n title=\"view schema\"\n onClick={() => {\n if (!divRef.current) {\n console.warn('divRef.current is null')\n }\n onClick(divDispatch)\n }}\n />\n )}\n {showOpenNewWindowLink\n ? (\n <IconButton\n ref={buttonRef}\n size=\"small\"\n onClick={() => {\n if (!buttonRef.current) {\n console.warn('buttonRef.current is null')\n }\n onClick(buttonDispatch, true)\n }}\n >\n <OpenInNewIcon fontSize=\"inherit\" />\n </IconButton>\n )\n : null}\n </FlexGrowRow>\n )\n : null}\n </Property>\n )\n}\n\nSchemaProperty.displayName = 'SchemaProperty'\n","import { MenuItem, Typography } from '@mui/material'\nimport type { SelectExProps } from '@xylabs/react-select'\nimport { SelectEx } from '@xylabs/react-select'\nimport React from 'react'\n\nimport { useSchema } from '../../contexts/index.ts'\n\nexport type SchemaSelectExProps = SelectExProps<string>\n\nexport const SchemaSelectEx: React.FC<SchemaSelectExProps> = ({\n onChange, variant = 'outlined', ...props\n}) => {\n const {\n schema, setSchema, schemaList,\n } = useSchema(false)\n\n return (\n <SelectEx\n variant={variant}\n size=\"small\"\n value={schema ?? 'none'}\n onChange={(event, child) => {\n if (event.target.value !== schema) {\n onChange?.(event, child)\n setSchema?.(event.target.value)\n }\n }}\n renderValue={(value) => {\n return <Typography>{value === 'none' ? '- None -' : value}</Typography>\n }}\n {...props}\n >\n {schemaList?.map((schema) => {\n return (\n <MenuItem key={schemaList.indexOf(schema)} value={schema}>\n {schema}\n </MenuItem>\n )\n })}\n <MenuItem key=\"none\" value=\"none\">\n - None -\n </MenuItem>\n </SelectEx>\n )\n}\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { SchemaContextState } from './State.ts'\n\nexport const SchemaContext = createContextEx<SchemaContextState>()\n","import { exists } from '@xylabs/sdk-js'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { useSchemaStats } from '../../../hooks/index.ts'\nimport { SchemaContext } from '../Context.ts'\nimport type { SchemaContextState } from '../State.ts'\nimport type { SchemaProviderProps } from './Props.ts'\n\nexport const SchemaMemoryProvider: React.FC<PropsWithChildren<SchemaProviderProps>> = ({\n defaultSchema, knownSchemaList, ...props\n}) => {\n const [schema, setSchema] = useState(defaultSchema)\n const [schemaList, setSchemaList] = useState<string[] | undefined>(knownSchemaList)\n const [fetchedSchemaStats] = useSchemaStats()\n\n useEffect(() => {\n if (fetchedSchemaStats) {\n const newSchemaList = (fetchedSchemaStats.map(({ name }) => name)).filter(exists)\n // eslint-disable-next-line react-x/set-state-in-effect, react-hooks/set-state-in-effect\n setSchemaList(newSchemaList)\n }\n }, [fetchedSchemaStats])\n\n const value: SchemaContextState = useMemo(() => ({\n provided: true as const, schema, schemaList: knownSchemaList ?? schemaList, setSchema, setSchemaList,\n }), [schema, schemaList, knownSchemaList])\n\n return <SchemaContext value={value} {...props} />\n}\n","import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { ModuleError, WithSources } from '@xyo-network/payload-model'\nimport { ModuleErrorSchema } from '@xyo-network/payload-model'\nimport type { SchemaCacheEntry } from '@xyo-network/schema-cache'\nimport { SchemaCache } from '@xyo-network/schema-cache'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { useState } from 'react'\n\nexport interface UseGetSchemaPayloadResult {\n notFound: boolean\n schemaHuri: SchemaCacheEntry['huri'] | undefined\n schemaPayload: SchemaPayload | null | undefined\n xyoError: WithSources<ModuleError> | undefined\n}\n\n/**\n * Gets a Huri and schema payload from a schema string\n */\nconst useGetSchemaPayload = (schema?: string): UseGetSchemaPayloadResult => {\n const [notFound, setNotFound] = useState(false)\n const [xyoError, setXyoError] = useState<WithSources<ModuleError>>()\n const [schemaCacheEntry, setSchemaCacheEntry] = useState<SchemaCacheEntry | null | undefined>()\n const [schemaLocal, setSchemaLocal] = useState<string>()\n\n useAsyncEffect(\n async (mounted) => {\n const firstRequest = !notFound && !schemaCacheEntry && !xyoError\n const schemaChanged = schema !== schemaLocal\n\n if ((schema && firstRequest) || (schema && schemaChanged)) {\n try {\n const schemaCacheEntry = await SchemaCache.instance.get(schema)\n if (mounted()) {\n setSchemaCacheEntry(schemaCacheEntry)\n setNotFound(schemaCacheEntry === null || schemaCacheEntry === undefined)\n }\n } catch (e) {\n const error = e as Error\n console.error(e)\n if (mounted()) {\n setXyoError({\n message: error.message, schema: ModuleErrorSchema, $sources: [],\n })\n }\n }\n }\n if (schemaChanged) {\n setSchemaLocal(schema)\n }\n },\n [xyoError, notFound, schema, schemaLocal, schemaCacheEntry],\n )\n\n return {\n notFound,\n schemaHuri: schemaCacheEntry?.huri,\n schemaPayload:\n schemaCacheEntry ? new PayloadBuilder<SchemaPayload>(schemaCacheEntry?.payload).fields(schemaCacheEntry.payload).build() : schemaCacheEntry,\n xyoError,\n }\n}\n\nexport { useGetSchemaPayload }\n","import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { SchemaCache } from '@xyo-network/schema-cache'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { useState } from 'react'\n\nexport interface SchemaList { name: string }\n\nexport const useSchemaDefinitions = (schemaList?: SchemaList[]): SchemaPayload[] | undefined => {\n const [schemaPayloads, setSchemaPayloads] = useState<SchemaPayload[]>()\n useAsyncEffect(\n async (mounted) => {\n if (schemaList) {\n const promiseResults = await Promise.allSettled(schemaList?.map(({ name }) => SchemaCache.instance.get(name)))\n if (mounted()) {\n setSchemaPayloads(\n promiseResults\n .map(result => (result.status === 'fulfilled' ? result.value?.payload : undefined))\n .filter(item => item !== undefined && item !== null) as SchemaPayload[],\n )\n }\n }\n },\n [schemaList],\n )\n return schemaPayloads\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { Address } from '@xylabs/sdk-js'\nimport type { SchemaListPayload, SchemaListQueryPayload } from '@xyo-network/diviner-schema-list'\nimport { SchemaListQuerySchema } from '@xyo-network/diviner-schema-list'\nimport { useWeakDivinerFromNode } from '@xyo-network/react-diviner'\nimport { useMemo } from 'react'\n\nexport const useSchemaList = (address?: Address, nameOrAddress = 'SchemaListDiviner'): [SchemaListPayload | null | undefined, Error | undefined] => {\n const [diviner, divinerError] = useWeakDivinerFromNode(nameOrAddress)\n\n const query: SchemaListQueryPayload[] | undefined = useMemo(\n () =>\n address\n ? [\n {\n address,\n schema: SchemaListQuerySchema,\n },\n ]\n : undefined,\n [address],\n )\n\n const [schemaList, error] = usePromise(\n async () => {\n const divinerInstance = diviner?.deref()\n if (divinerInstance) {\n const response = (await divinerInstance.divine(query)) as SchemaListPayload[]\n return response.at(0)\n }\n },\n [diviner, divinerError, query],\n )\n return [schemaList, error]\n}\n","import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { type Address, isDefined } from '@xylabs/sdk-js'\nimport type { SchemaStatsPayload } from '@xyo-network/diviner-schema-stats'\nimport {\n SchemaStatsDivinerSchema,\n SchemaStatsQuerySchema,\n} from '@xyo-network/diviner-schema-stats'\nimport { TYPES } from '@xyo-network/node-core-types'\nimport type { WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport { useWeakDivinerFromNode } from '@xyo-network/react-diviner'\nimport type { Dispatch, SetStateAction } from 'react'\nimport { useState } from 'react'\n\nexport const useSchemaStats = (\n statsAddress?: Address,\n nameOrAddress = TYPES.SchemaStatsDiviner,\n): [SchemaStatsPayload[] | undefined, Error | undefined, Dispatch<SetStateAction<number>>] => {\n const [refresh, setRefresh] = useState(1)\n const [diviner, divinerError] = useWeakDivinerFromNode(nameOrAddress)\n const [error, setError] = useState<Error>()\n const refreshHistory = () => setRefresh(previous => previous + 1)\n\n const [schemaList, setSchemaList] = useState<WithSources<SchemaStatsPayload>[]>()\n\n useAsyncEffect(\n async (mounted) => {\n const instance = diviner?.deref()\n if (isDefined(instance) && isDefined(statsAddress)) {\n if (divinerError) {\n if (mounted()) {\n setError(divinerError)\n setSchemaList(undefined)\n }\n } else {\n try {\n const query = {\n address: statsAddress,\n schema: SchemaStatsQuerySchema,\n }\n const schemas = (await instance.divine([query])).filter(isPayloadOfSchemaType(SchemaStatsDivinerSchema)) as WithSources<\n SchemaStatsPayload\n >[]\n if (mounted()) {\n setSchemaList(schemas)\n setError(undefined)\n }\n } catch (ex) {\n setError(ex as Error)\n setSchemaList(undefined)\n }\n }\n }\n },\n [diviner, refresh, divinerError, statsAddress],\n )\n\n return [schemaList, error, refreshHistory]\n}\n","import type { PropsWithChildren } from 'react'\nimport React, {\n useCallback, useEffect, useMemo,\n} from 'react'\nimport { useSearchParams } from 'react-router-dom'\n\nimport { SchemaContext } from '../Context.ts'\nimport type { SchemaContextState } from '../State.ts'\nimport { useSchema } from '../use.ts'\nimport { SchemaMemoryProvider } from './Memory.tsx'\nimport type { SchemaProviderProps } from './Props.ts'\n\nconst SchemaRouteProviderInner: React.FC<PropsWithChildren> = ({ children }) => {\n const {\n schema, setSchema, schemaList,\n } = useSchema()\n\n const [params, setParams] = useSearchParams()\n\n const routeSchema = params.get('schema')\n\n // update the network stored in the route\n const setSchemaParam = useCallback(\n (schema?: string) => {\n if (schema) {\n params.set('schema', schema)\n setParams(params, { replace: true })\n setSchema?.(schema)\n } else {\n params.delete('network')\n }\n },\n [params, setParams, setSchema],\n )\n\n // if the network is actively changed, update both memory and route\n const setSchemaLocal = useCallback(\n (schema: string) => {\n setSchemaParam(schema)\n setSchema?.(schema)\n },\n [setSchemaParam, setSchema],\n )\n\n // sync memory and route storage of network\n useEffect(() => {\n if (routeSchema !== schema) {\n if (routeSchema === undefined && schema !== undefined) {\n // if the route does not have a network selected, use what is in the memory context\n setSchemaLocal(schema)\n } else if (routeSchema) {\n // if the route has a selection and it is different from memory, update memory\n setSchema?.(routeSchema)\n }\n }\n }, [routeSchema, schema, setSchemaParam, setSchema, setSchemaLocal])\n\n const value: SchemaContextState = useMemo(() => ({\n provided: true, schema, schemaList, setSchema: setSchemaLocal,\n }), [schema, schemaList, setSchemaLocal])\n\n return <SchemaContext value={value}>{children}</SchemaContext>\n}\n\nexport const SchemaRouteProvider: React.FC<PropsWithChildren<SchemaProviderProps>> = ({\n knownSchemaList, defaultSchema, ...props\n}) => {\n return (\n <SchemaMemoryProvider knownSchemaList={knownSchemaList} defaultSchema={defaultSchema}>\n <SchemaRouteProviderInner {...props} />\n </SchemaMemoryProvider>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { SchemaContext } from './Context.ts'\nimport type { SchemaContextState } from './State.ts'\n\nexport const useSchema = (required = false) => {\n return useContextEx<SchemaContextState>(SchemaContext, 'Schema', required)\n}\n"],"mappings":";AAAA;AAAA,EACE,eAAe;AAAA,EAAiB,aAAa;AAAA,EAAe,YAAY;AAAA,OACnE;AACP,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AAEvB,SAAS,gBAAgB;AAEzB,SA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ACC;AAAA,MACA,MAAK;AAAA,MACL,OAAO,UAAU;AAAA,MACjB,UAAU,CAAC,OAAO,UAAU;AAC1B,YAAI,MAAM,OAAO,UAAU,QAAQ;AACjC,qBAAW,OAAO,KAAK;AACvB,sBAAY,MAAM,OAAO,KAAK;AAAA,QAChC;AAAA,MACF;AAAA,MACA,aAAa,CAAC,UAAU;AACtB,eAAO,gBAAAD,KAAC,cAAY,oBAAU,SAAS,aAAa,OAAM;AAAA,MAC5D;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,oBAAY,IAAI,CAACE,YAAW;AAC3B,iBACE,gBAAAF,KAAC,YAA0C,OAAOE,SAC/C,UAAAA,WADY,WAAW,QAAQA,OAAM,CAExC;AAAA,QAEJ,CAAC;AAAA,QACD,gBAAAF,KAAC,YAAoB,OAAM,QAAO,wBAApB,MAEd;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["entry","useMemo","useState","useAsyncEffect","SchemaCache","useState","schemaCacheEntry","useAsyncEffect","SchemaCache","useState","useAsyncEffect","useWeakDivinerFromNode","useState","jsx","useState","useMemo","useEffect","useMemo","jsx","schema","useEffect","useMemo","jsx","jsxs","schema"]}
1
+ {"version":3,"sources":["../../src/components/Property/SchemaProperty.tsx","../../src/components/SelectEx/SchemaSelectEx.tsx","../../src/contexts/Schema/Context.ts","../../src/contexts/Schema/Provider/Memory.tsx","../../src/hooks/useGetSchema.tsx","../../src/hooks/useSchemaDefinitions.tsx","../../src/hooks/useSchemaList.tsx","../../src/hooks/useSchemaStats.tsx","../../src/contexts/Schema/Provider/Route.tsx","../../src/contexts/Schema/use.ts"],"sourcesContent":["import {\n NewReleases as NewReleasesIcon, OpenInNew as OpenInNewIcon, Verified as VerifiedIcon,\n} from '@mui/icons-material'\nimport { IconButton } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport type { EventDispatch, EventNoun } from '@xyo-network/react-event'\nimport { useEvent } from '@xyo-network/react-event'\nimport type { PropertyProps } from '@xyo-network/react-property'\nimport { Property, PropertyValue } from '@xyo-network/react-property'\nimport type { SchemaCacheEntry } from '@xyo-network/schema-cache'\nimport { SchemaCache } from '@xyo-network/schema-cache'\nimport React, { useState } from 'react'\n\nexport type SchemaPropertyProps = PropertyProps & {\n showLinkNames?: boolean\n showOpenNewWindowLink?: boolean\n showStatusIcon?: boolean\n value?: string\n}\n\nconst useResolveSchema = (schema?: string) => {\n const [entry, setEntry] = useState<SchemaCacheEntry | null>()\n useAsyncEffect(\n async (mounted) => {\n if (schema) {\n const entry = await SchemaCache.instance.get(schema)\n if (mounted()) {\n setEntry(entry)\n }\n }\n },\n [schema],\n )\n return entry\n}\n\nexport const SchemaProperty: React.FC<SchemaPropertyProps> = ({\n showLinkNames = true, showOpenNewWindowLink = true, showStatusIcon = true, titleProps, value, ...props\n}) => {\n const resolvedSchema = useResolveSchema(value)\n const [buttonRef, buttonDispatch] = useEvent<HTMLButtonElement>()\n const [divRef, divDispatch] = useEvent<HTMLDivElement>()\n\n const onClick = (dispatch?: EventDispatch<EventNoun, 'click', string>, openNewWindow = false) => {\n dispatch?.(\n 'schema',\n 'click',\n JSON.stringify({\n openNewWindow,\n schema: value,\n }),\n )\n }\n\n return (\n <Property title=\"Schema\" value={value} tip=\"Schema sent with the payload\" titleProps={titleProps} {...props}>\n {value && showStatusIcon\n ? resolvedSchema === null\n ? (\n <IconButton\n ref={buttonRef}\n size=\"small\"\n onClick={() => {\n if (!buttonRef.current) {\n console.warn('buttonRef.current is null')\n }\n onClick(buttonDispatch)\n }}\n >\n <NewReleasesIcon\n sx={{\n color: 'warning',\n fontSize: 'inherit',\n }}\n />\n </IconButton>\n )\n : resolvedSchema === undefined\n ? (\n <IconButton\n ref={buttonRef}\n size=\"small\"\n onClick={() => {\n if (!buttonRef.current) {\n console.warn('buttonRef.current is null')\n }\n onClick(buttonDispatch)\n }}\n >\n <NewReleasesIcon\n sx={{\n color: 'disabled',\n fontSize: 'inherit',\n }}\n />\n </IconButton>\n )\n : (\n <IconButton rel=\"noopener noreferrer\" size=\"small\" target=\"_blank\" href={resolvedSchema?.huri?.href ?? ''}>\n <VerifiedIcon\n sx={{\n color: 'success',\n fontSize: 'inherit',\n }}\n />\n </IconButton>\n )\n\n : null}\n {value\n ? (\n <FlexGrowRow\n ref={divRef}\n sx={{ justifyContent: 'space-between' }}\n >\n {showLinkNames\n ? (\n <LinkEx\n sx={{\n display: 'block',\n width: '100%',\n cursor: 'pointer',\n }}\n >\n <PropertyValue\n value={value}\n title=\"view schema\"\n onClick={() => {\n if (!divRef.current) {\n console.warn('divRef.current is null')\n }\n onClick(divDispatch)\n }}\n />\n </LinkEx>\n )\n : (\n <PropertyValue\n value={value}\n title=\"view schema\"\n onClick={() => {\n if (!divRef.current) {\n console.warn('divRef.current is null')\n }\n onClick(divDispatch)\n }}\n />\n )}\n {showOpenNewWindowLink\n ? (\n <IconButton\n ref={buttonRef}\n size=\"small\"\n onClick={() => {\n if (!buttonRef.current) {\n console.warn('buttonRef.current is null')\n }\n onClick(buttonDispatch, true)\n }}\n >\n <OpenInNewIcon sx={{ fontSize: 'inherit' }} />\n </IconButton>\n )\n : null}\n </FlexGrowRow>\n )\n : null}\n </Property>\n )\n}\n\nSchemaProperty.displayName = 'SchemaProperty'\n","import { MenuItem, Typography } from '@mui/material'\nimport type { SelectExProps } from '@xylabs/react-select'\nimport { SelectEx } from '@xylabs/react-select'\nimport React from 'react'\n\nimport { useSchema } from '../../contexts/index.ts'\n\nexport type SchemaSelectExProps = SelectExProps<string>\n\nexport const SchemaSelectEx: React.FC<SchemaSelectExProps> = ({\n onChange, variant = 'outlined', ...props\n}) => {\n const {\n schema, setSchema, schemaList,\n } = useSchema(false)\n\n return (\n <SelectEx\n variant={variant}\n size=\"small\"\n value={schema ?? 'none'}\n onChange={(event, child) => {\n if (event.target.value !== schema) {\n onChange?.(event, child)\n setSchema?.(event.target.value)\n }\n }}\n renderValue={(value) => {\n return <Typography>{value === 'none' ? '- None -' : value}</Typography>\n }}\n {...props}\n >\n {schemaList?.map((schema) => {\n return (\n <MenuItem key={schemaList.indexOf(schema)} value={schema}>\n {schema}\n </MenuItem>\n )\n })}\n <MenuItem key=\"none\" value=\"none\">\n - None -\n </MenuItem>\n </SelectEx>\n )\n}\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { SchemaContextState } from './State.ts'\n\nexport const SchemaContext = createContextEx<SchemaContextState>()\n","import { exists } from '@xylabs/sdk-js'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { useSchemaStats } from '../../../hooks/index.ts'\nimport { SchemaContext } from '../Context.ts'\nimport type { SchemaContextState } from '../State.ts'\nimport type { SchemaProviderProps } from './Props.ts'\n\nexport const SchemaMemoryProvider: React.FC<PropsWithChildren<SchemaProviderProps>> = ({\n defaultSchema, knownSchemaList, ...props\n}) => {\n const [schema, setSchema] = useState(defaultSchema)\n const [schemaList, setSchemaList] = useState<string[] | undefined>(knownSchemaList)\n const [fetchedSchemaStats] = useSchemaStats()\n\n useEffect(() => {\n if (fetchedSchemaStats) {\n const newSchemaList = (fetchedSchemaStats.map(({ name }) => name)).filter(exists)\n // eslint-disable-next-line react-x/set-state-in-effect, react-hooks/set-state-in-effect\n setSchemaList(newSchemaList)\n }\n }, [fetchedSchemaStats])\n\n const value: SchemaContextState = useMemo(() => ({\n provided: true as const, schema, schemaList: knownSchemaList ?? schemaList, setSchema, setSchemaList,\n }), [schema, schemaList, knownSchemaList])\n\n return <SchemaContext value={value} {...props} />\n}\n","import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { ModuleError, WithSources } from '@xyo-network/payload-model'\nimport { ModuleErrorSchema } from '@xyo-network/payload-model'\nimport type { SchemaCacheEntry } from '@xyo-network/schema-cache'\nimport { SchemaCache } from '@xyo-network/schema-cache'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { useState } from 'react'\n\nexport interface UseGetSchemaPayloadResult {\n notFound: boolean\n schemaHuri: SchemaCacheEntry['huri'] | undefined\n schemaPayload: SchemaPayload | null | undefined\n xyoError: WithSources<ModuleError> | undefined\n}\n\n/**\n * Gets a Huri and schema payload from a schema string\n */\nconst useGetSchemaPayload = (schema?: string): UseGetSchemaPayloadResult => {\n const [notFound, setNotFound] = useState(false)\n const [xyoError, setXyoError] = useState<WithSources<ModuleError>>()\n const [schemaCacheEntry, setSchemaCacheEntry] = useState<SchemaCacheEntry | null | undefined>()\n const [schemaLocal, setSchemaLocal] = useState<string>()\n\n useAsyncEffect(\n async (mounted) => {\n const firstRequest = !notFound && !schemaCacheEntry && !xyoError\n const schemaChanged = schema !== schemaLocal\n\n if ((schema && firstRequest) || (schema && schemaChanged)) {\n try {\n const schemaCacheEntry = await SchemaCache.instance.get(schema)\n if (mounted()) {\n setSchemaCacheEntry(schemaCacheEntry)\n setNotFound(schemaCacheEntry === null || schemaCacheEntry === undefined)\n }\n } catch (e) {\n const error = e as Error\n console.error(e)\n if (mounted()) {\n setXyoError({\n message: error.message, schema: ModuleErrorSchema, $sources: [],\n })\n }\n }\n }\n if (schemaChanged) {\n setSchemaLocal(schema)\n }\n },\n [xyoError, notFound, schema, schemaLocal, schemaCacheEntry],\n )\n\n return {\n notFound,\n schemaHuri: schemaCacheEntry?.huri,\n schemaPayload:\n schemaCacheEntry ? new PayloadBuilder<SchemaPayload>(schemaCacheEntry?.payload).fields(schemaCacheEntry.payload).build() : schemaCacheEntry,\n xyoError,\n }\n}\n\nexport { useGetSchemaPayload }\n","import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { SchemaCache } from '@xyo-network/schema-cache'\nimport type { SchemaPayload } from '@xyo-network/schema-payload-plugin'\nimport { useState } from 'react'\n\nexport interface SchemaList { name: string }\n\nexport const useSchemaDefinitions = (schemaList?: SchemaList[]): SchemaPayload[] | undefined => {\n const [schemaPayloads, setSchemaPayloads] = useState<SchemaPayload[]>()\n useAsyncEffect(\n async (mounted) => {\n if (schemaList) {\n const promiseResults = await Promise.allSettled(schemaList?.map(({ name }) => SchemaCache.instance.get(name)))\n if (mounted()) {\n setSchemaPayloads(\n promiseResults\n .map(result => (result.status === 'fulfilled' ? result.value?.payload : undefined))\n .filter(item => item !== undefined && item !== null) as SchemaPayload[],\n )\n }\n }\n },\n [schemaList],\n )\n return schemaPayloads\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { Address } from '@xylabs/sdk-js'\nimport type { SchemaListPayload, SchemaListQueryPayload } from '@xyo-network/diviner-schema-list'\nimport { SchemaListQuerySchema } from '@xyo-network/diviner-schema-list'\nimport { useWeakDivinerFromNode } from '@xyo-network/react-diviner'\nimport { useMemo } from 'react'\n\nexport const useSchemaList = (address?: Address, nameOrAddress = 'SchemaListDiviner'): [SchemaListPayload | null | undefined, Error | undefined] => {\n const [diviner, divinerError] = useWeakDivinerFromNode(nameOrAddress)\n\n const query: SchemaListQueryPayload[] | undefined = useMemo(\n () =>\n address\n ? [\n {\n address,\n schema: SchemaListQuerySchema,\n },\n ]\n : undefined,\n [address],\n )\n\n const [schemaList, error] = usePromise(\n async () => {\n const divinerInstance = diviner?.deref()\n if (divinerInstance) {\n const response = (await divinerInstance.divine(query)) as SchemaListPayload[]\n return response.at(0)\n }\n },\n [diviner, divinerError, query],\n )\n return [schemaList, error]\n}\n","import { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { type Address, isDefined } from '@xylabs/sdk-js'\nimport type { SchemaStatsPayload } from '@xyo-network/diviner-schema-stats'\nimport {\n SchemaStatsDivinerSchema,\n SchemaStatsQuerySchema,\n} from '@xyo-network/diviner-schema-stats'\nimport { TYPES } from '@xyo-network/node-core-types'\nimport type { WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport { useWeakDivinerFromNode } from '@xyo-network/react-diviner'\nimport type { Dispatch, SetStateAction } from 'react'\nimport { useState } from 'react'\n\nexport const useSchemaStats = (\n statsAddress?: Address,\n nameOrAddress = TYPES.SchemaStatsDiviner,\n): [SchemaStatsPayload[] | undefined, Error | undefined, Dispatch<SetStateAction<number>>] => {\n const [refresh, setRefresh] = useState(1)\n const [diviner, divinerError] = useWeakDivinerFromNode(nameOrAddress)\n const [error, setError] = useState<Error>()\n const refreshHistory = () => setRefresh(previous => previous + 1)\n\n const [schemaList, setSchemaList] = useState<WithSources<SchemaStatsPayload>[]>()\n\n useAsyncEffect(\n async (mounted) => {\n const instance = diviner?.deref()\n if (isDefined(instance) && isDefined(statsAddress)) {\n if (divinerError) {\n if (mounted()) {\n setError(divinerError)\n setSchemaList(undefined)\n }\n } else {\n try {\n const query = {\n address: statsAddress,\n schema: SchemaStatsQuerySchema,\n }\n const schemas = (await instance.divine([query])).filter(isPayloadOfSchemaType(SchemaStatsDivinerSchema)) as WithSources<\n SchemaStatsPayload\n >[]\n if (mounted()) {\n setSchemaList(schemas)\n setError(undefined)\n }\n } catch (ex) {\n setError(ex as Error)\n setSchemaList(undefined)\n }\n }\n }\n },\n [diviner, refresh, divinerError, statsAddress],\n )\n\n return [schemaList, error, refreshHistory]\n}\n","import type { PropsWithChildren } from 'react'\nimport React, {\n useCallback, useEffect, useMemo,\n} from 'react'\nimport { useSearchParams } from 'react-router-dom'\n\nimport { SchemaContext } from '../Context.ts'\nimport type { SchemaContextState } from '../State.ts'\nimport { useSchema } from '../use.ts'\nimport { SchemaMemoryProvider } from './Memory.tsx'\nimport type { SchemaProviderProps } from './Props.ts'\n\nconst SchemaRouteProviderInner: React.FC<PropsWithChildren> = ({ children }) => {\n const {\n schema, setSchema, schemaList,\n } = useSchema()\n\n const [params, setParams] = useSearchParams()\n\n const routeSchema = params.get('schema')\n\n // update the network stored in the route\n const setSchemaParam = useCallback(\n (schema?: string) => {\n if (schema) {\n params.set('schema', schema)\n setParams(params, { replace: true })\n setSchema?.(schema)\n } else {\n params.delete('network')\n }\n },\n [params, setParams, setSchema],\n )\n\n // if the network is actively changed, update both memory and route\n const setSchemaLocal = useCallback(\n (schema: string) => {\n setSchemaParam(schema)\n setSchema?.(schema)\n },\n [setSchemaParam, setSchema],\n )\n\n // sync memory and route storage of network\n useEffect(() => {\n if (routeSchema !== schema) {\n if (routeSchema === undefined && schema !== undefined) {\n // if the route does not have a network selected, use what is in the memory context\n setSchemaLocal(schema)\n } else if (routeSchema) {\n // if the route has a selection and it is different from memory, update memory\n setSchema?.(routeSchema)\n }\n }\n }, [routeSchema, schema, setSchemaParam, setSchema, setSchemaLocal])\n\n const value: SchemaContextState = useMemo(() => ({\n provided: true, schema, schemaList, setSchema: setSchemaLocal,\n }), [schema, schemaList, setSchemaLocal])\n\n return <SchemaContext value={value}>{children}</SchemaContext>\n}\n\nexport const SchemaRouteProvider: React.FC<PropsWithChildren<SchemaProviderProps>> = ({\n knownSchemaList, defaultSchema, ...props\n}) => {\n return (\n <SchemaMemoryProvider knownSchemaList={knownSchemaList} defaultSchema={defaultSchema}>\n <SchemaRouteProviderInner {...props} />\n </SchemaMemoryProvider>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { SchemaContext } from './Context.ts'\nimport type { SchemaContextState } from './State.ts'\n\nexport const useSchema = (required = false) => {\n return useContextEx<SchemaContextState>(SchemaContext, 'Schema', required)\n}\n"],"mappings":";AAAA;AAAA,EACE,eAAe;AAAA,EAAiB,aAAa;AAAA,EAAe,YAAY;AAAA,OACnE;AACP,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AAEvB,SAAS,gBAAgB;AAEzB,SAAS,UAAU,qBAAqB;AAExC,SAAS,mBAAmB;AAC5B,SAAgB,gBAAgB;AA0DhB,cA0CJ,YA1CI;AAjDhB,IAAM,mBAAmB,CAAC,WAAoB;AAC5C,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAkC;AAC5D;AAAA,IACE,OAAO,YAAY;AACjB,UAAI,QAAQ;AACV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;AAEnB,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,OAAO,UAAU;AAAA,MACjB,UAAU,CAAC,OAAO,UAAU;AAC1B,YAAI,MAAM,OAAO,UAAU,QAAQ;AACjC,qBAAW,OAAO,KAAK;AACvB,sBAAY,MAAM,OAAO,KAAK;AAAA,QAChC;AAAA,MACF;AAAA,MACA,aAAa,CAAC,UAAU;AACtB,eAAO,gBAAAD,KAAC,cAAY,oBAAU,SAAS,aAAa,OAAM;AAAA,MAC5D;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,oBAAY,IAAI,CAACE,YAAW;AAC3B,iBACE,gBAAAF,KAAC,YAA0C,OAAOE,SAC/C,UAAAA,WADY,WAAW,QAAQA,OAAM,CAExC;AAAA,QAEJ,CAAC;AAAA,QACD,gBAAAF,KAAC,YAAoB,OAAM,QAAO,wBAApB,MAEd;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["entry","useMemo","useState","useAsyncEffect","SchemaCache","useState","schemaCacheEntry","useAsyncEffect","SchemaCache","useState","useAsyncEffect","useWeakDivinerFromNode","useState","jsx","useState","useMemo","useEffect","useMemo","jsx","schema","useEffect","useMemo","jsx","jsxs","schema"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-schema",
3
- "version": "7.6.2",
3
+ "version": "8.0.0",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -41,18 +41,18 @@
41
41
  "README.md"
42
42
  ],
43
43
  "dependencies": {
44
- "@xyo-network/react-diviner": "~7.6.2",
45
- "@xyo-network/react-event": "~7.6.2",
46
- "@xyo-network/react-property": "~7.6.2"
44
+ "@xyo-network/react-property": "~8.0.0",
45
+ "@xyo-network/react-event": "~8.0.0",
46
+ "@xyo-network/react-diviner": "~8.0.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@bitauth/libauth": "~3.0.0",
50
50
  "@emotion/react": "^11.14.0",
51
51
  "@emotion/styled": "^11.14.1",
52
- "@mui/icons-material": "^7.3.10",
53
- "@mui/material": "^7.3.10",
54
- "@mui/system": "^7.3.10",
55
- "@mui/x-tree-view": "~8.27.2",
52
+ "@mui/icons-material": "~9.0",
53
+ "@mui/material": "~9.0",
54
+ "@mui/system": "~9.0",
55
+ "@mui/x-tree-view": "~9.1",
56
56
  "@opentelemetry/api": "^1.9.1",
57
57
  "@opentelemetry/sdk-trace-base": "^2.7.1",
58
58
  "@react-spring/web": "~10.0.3",
@@ -61,52 +61,51 @@
61
61
  "@storybook/react-vite": "~10.3.6",
62
62
  "@textea/json-viewer": "~4.0.1",
63
63
  "@types/react": "^19.2.14",
64
- "@xylabs/pixel": "~5.1.1",
65
- "@xylabs/react-async-effect": "~7.2.3",
66
- "@xylabs/react-button": "~7.2.3",
67
- "@xylabs/react-crypto": "~7.2.3",
68
- "@xylabs/react-flexbox": "~7.2.3",
69
- "@xylabs/react-hooks": "~7.2.3",
70
- "@xylabs/react-identicon": "~7.2.3",
71
- "@xylabs/react-link": "~7.2.3",
72
- "@xylabs/react-number-status": "~7.2.3",
73
- "@xylabs/react-promise": "~7.2.3",
74
- "@xylabs/react-quick-tip-button": "~7.2.3",
75
- "@xylabs/react-select": "~7.2.3",
76
- "@xylabs/react-shared": "~7.2.3",
77
- "@xylabs/react-theme": "~7.2.3",
78
- "@xylabs/sdk-js": "^5.1.1",
79
- "@xylabs/threads": "~5.1.1",
80
- "@xylabs/toolchain": "~7.13.7",
81
- "@xylabs/tsconfig": "^7.13.7",
82
- "@xylabs/tsconfig-dom": "^7.13.7",
83
- "@xylabs/tsconfig-react": "~7.13.7",
84
- "@xyo-network/account": "~5.6.1",
85
- "@xyo-network/account-model": "^5.6.2",
86
- "@xyo-network/boundwitness-builder": "^5.6.1",
87
- "@xyo-network/boundwitness-model": "^5.6.2",
88
- "@xyo-network/boundwitness-validator": "^5.6.1",
89
- "@xyo-network/boundwitness-wrapper": "~5.6.1",
90
- "@xyo-network/bridge-http": "~5.6.3",
91
- "@xyo-network/config-payload-plugin": "~5.6.2",
92
- "@xyo-network/diviner-model": "^5.6.3",
93
- "@xyo-network/diviner-schema-list": "~5.6.3",
94
- "@xyo-network/diviner-schema-stats": "~5.6.3",
95
- "@xyo-network/manifest-model": "~5.6.2",
96
- "@xyo-network/module-abstract": "^5.6.3",
97
- "@xyo-network/module-model": "^5.6.3",
98
- "@xyo-network/network": "~5.6.2",
99
- "@xyo-network/node-core-types": "~4.2",
100
- "@xyo-network/node-memory": "~5.6.3",
101
- "@xyo-network/node-model": "^5.6.3",
102
- "@xyo-network/payload-builder": "^5.6.1",
103
- "@xyo-network/payload-model": "^5.6.2",
104
- "@xyo-network/query-payload-plugin": "~5.6.2",
105
- "@xyo-network/schema-cache": "~5.6.2",
106
- "@xyo-network/schema-payload-plugin": "~5.6.2",
64
+ "@xylabs/pixel": "~5.1.2",
65
+ "@xylabs/react-async-effect": "~8.0",
66
+ "@xylabs/react-button": "~8.0",
67
+ "@xylabs/react-crypto": "~8.0",
68
+ "@xylabs/react-flexbox": "~8.0",
69
+ "@xylabs/react-hooks": "~8.0",
70
+ "@xylabs/react-identicon": "~8.0",
71
+ "@xylabs/react-link": "~8.0",
72
+ "@xylabs/react-number-status": "~8.0",
73
+ "@xylabs/react-promise": "~8.0",
74
+ "@xylabs/react-quick-tip-button": "~8.0",
75
+ "@xylabs/react-select": "~8.0",
76
+ "@xylabs/react-shared": "~8.0",
77
+ "@xylabs/react-theme": "~8.0",
78
+ "@xylabs/sdk-js": "^5.1.2",
79
+ "@xylabs/threads": "~5.1.2",
80
+ "@xylabs/toolchain": "~7.13.22",
81
+ "@xylabs/tsconfig": "^7.13.22",
82
+ "@xylabs/tsconfig-dom": "^7.13.22",
83
+ "@xylabs/tsconfig-react": "~7.13.22",
84
+ "@xyo-network/account": "~5.6.2",
85
+ "@xyo-network/account-model": "^5.6.3",
86
+ "@xyo-network/boundwitness-builder": "^5.6.2",
87
+ "@xyo-network/boundwitness-model": "^5.6.3",
88
+ "@xyo-network/boundwitness-validator": "^5.6.2",
89
+ "@xyo-network/boundwitness-wrapper": "~5.6.2",
90
+ "@xyo-network/bridge-http": "~5.6.4",
91
+ "@xyo-network/config-payload-plugin": "~5.6.3",
92
+ "@xyo-network/diviner-model": "^5.6.4",
93
+ "@xyo-network/diviner-schema-list": "~5.6.4",
94
+ "@xyo-network/diviner-schema-stats": "~5.6.4",
95
+ "@xyo-network/manifest-model": "~5.6.3",
96
+ "@xyo-network/module-model": "^5.6.4",
97
+ "@xyo-network/network": "~5.6.3",
98
+ "@xyo-network/node-core-types": "~4.2.2",
99
+ "@xyo-network/node-memory": "~5.6.4",
100
+ "@xyo-network/node-model": "^5.6.4",
101
+ "@xyo-network/payload-builder": "^5.6.2",
102
+ "@xyo-network/payload-model": "^5.6.3",
103
+ "@xyo-network/query-payload-plugin": "~5.6.3",
104
+ "@xyo-network/schema-cache": "~5.6.3",
105
+ "@xyo-network/schema-payload-plugin": "~5.6.3",
107
106
  "@xyo-network/typeof": "~5.3.30",
108
- "@xyo-network/wallet": "~5.6.1",
109
- "@xyo-network/wallet-model": "^5.6.2",
107
+ "@xyo-network/wallet": "~5.6.2",
108
+ "@xyo-network/wallet-model": "^5.6.3",
110
109
  "ajv": "^8.20.0",
111
110
  "async-mutex": "^0.5.0",
112
111
  "bn.js": "^5.2.3",
@@ -126,95 +125,94 @@
126
125
  "observable-fns": "~0.6.1",
127
126
  "pako": "^2.1.0",
128
127
  "query-string": "~9.3.1",
129
- "react": "^19.2.5",
130
- "react-dom": "^19.2.5",
131
- "react-is": "^19.2.5",
128
+ "react": "^19.2.6",
129
+ "react-dom": "^19.2.6",
130
+ "react-is": "^19.2.6",
132
131
  "react-router-dom": "^7.15.0",
133
132
  "recharts": "~3.8.1",
134
133
  "spark-md5": "~3.0.2",
135
134
  "storybook": "^10.3.6",
136
135
  "typescript": "^5.9.3",
137
- "viem": "~2.48.8",
138
- "vite": "^8.0.10",
136
+ "viem": "~2.48.11",
137
+ "vite": "^8.0.11",
139
138
  "wasm-feature-detect": "~1.8.0",
140
139
  "zod": "^4.4.3",
141
- "@xyo-network/react-payload-raw-info": "~7.6.2",
142
- "@xyo-network/react-storybook": "~7.6.2",
143
- "@xyo-network/react-node": "~7.6.2",
144
- "@xyo-network/react-wallet": "~7.6.2"
140
+ "@xyo-network/react-node": "~8.0.0",
141
+ "@xyo-network/react-storybook": "~8.0.0",
142
+ "@xyo-network/react-wallet": "~8.0.0",
143
+ "@xyo-network/react-payload-raw-info": "~8.0.0"
145
144
  },
146
145
  "peerDependencies": {
147
- "@bitauth/libauth": ">=3.0.0 <3.1",
148
- "@mui/icons-material": ">=7.3.10 <8",
149
- "@mui/material": ">=7.3.10 <8",
150
- "@mui/system": ">=7.3.10 <8",
151
- "@mui/x-tree-view": ">=8.27.2 <8.28",
152
- "@opentelemetry/api": ">=1.9.1 <2",
153
- "@opentelemetry/sdk-trace-base": ">=2.7.1 <3",
154
- "@react-spring/web": ">=10.0.3 <10.1",
155
- "@scure/base": ">=2.2.0 <2.3",
156
- "@xylabs/pixel": ">=5.1.1 <5.2",
157
- "@xylabs/react-async-effect": ">=7.2.3 <7.3",
158
- "@xylabs/react-button": ">=7.2.3 <7.3",
159
- "@xylabs/react-flexbox": ">=7.2.3 <7.3",
160
- "@xylabs/react-hooks": ">=7.2.3 <7.3",
161
- "@xylabs/react-identicon": ">=7.2.3 <7.3",
162
- "@xylabs/react-link": ">=7.2.3 <7.3",
163
- "@xylabs/react-promise": ">=7.2.3 <7.3",
164
- "@xylabs/react-quick-tip-button": ">=7.2.3 <7.3",
165
- "@xylabs/react-select": ">=7.2.3 <7.3",
166
- "@xylabs/react-shared": ">=7.2.3 <7.3",
167
- "@xylabs/react-theme": ">=7.2.3 <7.3",
168
- "@xylabs/sdk-js": ">=5.1.1 <6",
169
- "@xylabs/threads": ">=5.1.1 <5.2",
170
- "@xyo-network/account": ">=5.6.1 <5.7",
171
- "@xyo-network/account-model": ">=5.6.2 <6",
172
- "@xyo-network/boundwitness-builder": ">=5.6.1 <6",
173
- "@xyo-network/boundwitness-model": ">=5.6.2 <6",
174
- "@xyo-network/boundwitness-validator": ">=5.6.1 <6",
175
- "@xyo-network/boundwitness-wrapper": ">=5.6.1 <5.7",
176
- "@xyo-network/config-payload-plugin": ">=5.6.2 <5.7",
177
- "@xyo-network/diviner-model": ">=5.6.3 <6",
178
- "@xyo-network/diviner-schema-list": ">=5.6.3 <5.7",
179
- "@xyo-network/diviner-schema-stats": ">=5.6.3 <5.7",
180
- "@xyo-network/manifest-model": ">=5.6.2 <5.7",
181
- "@xyo-network/module-abstract": ">=5.6.3 <6",
182
- "@xyo-network/module-model": ">=5.6.3 <6",
183
- "@xyo-network/node-core-types": ">=4.2.0 <4.3",
184
- "@xyo-network/node-memory": ">=5.6.3 <5.7",
185
- "@xyo-network/node-model": ">=5.6.3 <6",
186
- "@xyo-network/payload-builder": ">=5.6.1 <6",
187
- "@xyo-network/payload-model": ">=5.6.2 <6",
188
- "@xyo-network/query-payload-plugin": ">=5.6.2 <5.7",
189
- "@xyo-network/schema-cache": ">=5.6.2 <5.7",
190
- "@xyo-network/schema-payload-plugin": ">=5.6.2 <5.7",
191
- "@xyo-network/typeof": ">=5.3.30 <5.4",
192
- "@xyo-network/wallet-model": ">=5.6.2 <6",
193
- "ajv": ">=8.20.0 <9",
194
- "async-mutex": ">=0.5.0 <1",
195
- "bn.js": ">=5.2.3 <6",
196
- "bowser": ">=2.14.1 <3",
197
- "buffer": ">=6.0.3 <7",
198
- "chalk": ">=5.6.2 <6",
199
- "debug": ">=4.4.3 <4.5",
200
- "ethers": ">=6.16.0 <7",
201
- "fast-deep-equal": ">=3.1.3 <3.2",
202
- "hash-wasm": ">=4.12.0 <4.13",
203
- "js-cookie": ">=3.0.5 <3.1",
204
- "lru-cache": ">=11.3.6 <12",
205
- "md5": ">=2.3.0 <2.4",
206
- "mixpanel-browser": ">=2.78.0 <2.79",
207
- "observable-fns": ">=0.6.1 <0.7",
208
- "pako": ">=2.1.0 <3",
209
- "query-string": ">=9.3.1 <9.4",
210
- "react": ">=19.2.5 <20",
211
- "react-dom": ">=19.2.5 <20",
212
- "react-is": ">=19.2.5 <20",
213
- "react-router-dom": ">=7.15.0 <8",
214
- "recharts": ">=3.8.1 <3.9",
215
- "spark-md5": ">=3.0.2 <3.1",
216
- "wasm-feature-detect": ">=1.8.0 <1.9",
217
- "zod": ">=4.4.3 <5"
146
+ "@bitauth/libauth": "~3.0",
147
+ "@mui/icons-material": "~9.0",
148
+ "@mui/material": "~9.0",
149
+ "@mui/system": "~9.0",
150
+ "@mui/x-tree-view": "~9.1",
151
+ "@opentelemetry/api": "^1.9",
152
+ "@opentelemetry/sdk-trace-base": "^2.7",
153
+ "@react-spring/web": "~10.0",
154
+ "@scure/base": "~2.2",
155
+ "@xylabs/pixel": "~5.1",
156
+ "@xylabs/react-async-effect": "~8.0",
157
+ "@xylabs/react-button": "~8.0",
158
+ "@xylabs/react-flexbox": "~8.0",
159
+ "@xylabs/react-hooks": "~8.0",
160
+ "@xylabs/react-identicon": "~8.0",
161
+ "@xylabs/react-link": "~8.0",
162
+ "@xylabs/react-promise": "~8.0",
163
+ "@xylabs/react-quick-tip-button": "~8.0",
164
+ "@xylabs/react-select": "~8.0",
165
+ "@xylabs/react-shared": "~8.0",
166
+ "@xylabs/react-theme": "~8.0",
167
+ "@xylabs/sdk-js": "^5.1",
168
+ "@xylabs/threads": "~5.1",
169
+ "@xyo-network/account": "~5.6",
170
+ "@xyo-network/account-model": "^5.6",
171
+ "@xyo-network/boundwitness-builder": "^5.6",
172
+ "@xyo-network/boundwitness-model": "^5.6",
173
+ "@xyo-network/boundwitness-validator": "^5.6",
174
+ "@xyo-network/boundwitness-wrapper": "~5.6",
175
+ "@xyo-network/config-payload-plugin": "~5.6",
176
+ "@xyo-network/diviner-model": "^5.6",
177
+ "@xyo-network/diviner-schema-list": "~5.6",
178
+ "@xyo-network/diviner-schema-stats": "~5.6",
179
+ "@xyo-network/manifest-model": "~5.6",
180
+ "@xyo-network/module-model": "^5.6",
181
+ "@xyo-network/node-core-types": "~4.2",
182
+ "@xyo-network/node-memory": "~5.6",
183
+ "@xyo-network/node-model": "^5.6",
184
+ "@xyo-network/payload-builder": "^5.6",
185
+ "@xyo-network/payload-model": "^5.6",
186
+ "@xyo-network/query-payload-plugin": "~5.6",
187
+ "@xyo-network/schema-cache": "~5.6",
188
+ "@xyo-network/schema-payload-plugin": "~5.6",
189
+ "@xyo-network/typeof": "~5.3",
190
+ "@xyo-network/wallet-model": "^5.6",
191
+ "ajv": "^8.20",
192
+ "async-mutex": "^0.5",
193
+ "bn.js": "^5.2",
194
+ "bowser": "^2.14",
195
+ "buffer": "^6.0",
196
+ "chalk": "^5.6",
197
+ "debug": "~4.4",
198
+ "ethers": "^6.16",
199
+ "fast-deep-equal": "~3.1",
200
+ "hash-wasm": "~4.12",
201
+ "js-cookie": "~3.0",
202
+ "lru-cache": "^11.3",
203
+ "md5": "~2.3",
204
+ "mixpanel-browser": "~2.78",
205
+ "observable-fns": "~0.6",
206
+ "pako": "^2.1",
207
+ "query-string": "~9.3",
208
+ "react": "^19.2",
209
+ "react-dom": "^19.2",
210
+ "react-is": "^19.2",
211
+ "react-router-dom": "^7.15",
212
+ "recharts": "~3.8",
213
+ "spark-md5": "~3.0",
214
+ "wasm-feature-detect": "~1.8",
215
+ "zod": "^4.4"
218
216
  },
219
217
  "publishConfig": {
220
218
  "access": "public"