@xyo-network/react-schema 2.81.10 → 2.83.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.
- package/dist/browser/index.d.ts +117 -4
- package/dist/browser/index.mjs +422 -0
- package/dist/browser/index.mjs.map +1 -0
- package/package.json +35 -51
- package/src/components/Property/SchemaProperty.stories.tsx +2 -2
- package/src/components/Property/SchemaProperty.tsx +40 -29
- package/src/components/Property/index.ts +1 -1
- package/src/components/SelectEx/SchemaSelectEx.tsx +2 -1
- package/src/components/SelectEx/index.ts +1 -1
- package/src/components/index.ts +2 -2
- package/src/contexts/Schema/Context.ts +1 -1
- package/src/contexts/Schema/Provider/Memory.tsx +8 -6
- package/src/contexts/Schema/Provider/Route.tsx +13 -11
- package/src/contexts/Schema/Provider/index.ts +3 -3
- package/src/contexts/Schema/index.ts +4 -4
- package/src/contexts/Schema/use.ts +2 -2
- package/src/contexts/index.ts +1 -1
- package/src/hooks/index.ts +4 -4
- package/src/hooks/stories/TestSchemaHooks.stories.tsx +12 -14
- package/src/hooks/useGetSchema.stories.tsx +3 -4
- package/src/hooks/useGetSchema.tsx +0 -1
- package/src/hooks/useSchemaDefinitions.tsx +2 -3
- package/src/hooks/useSchemaList.tsx +8 -9
- package/src/hooks/useSchemaStats.tsx +1 -2
- package/src/index.ts +3 -3
- package/xy.config.ts +12 -0
- package/dist/browser/components/Property/SchemaProperty.d.cts +0 -39
- package/dist/browser/components/Property/SchemaProperty.d.cts.map +0 -1
- package/dist/browser/components/Property/SchemaProperty.d.mts +0 -39
- package/dist/browser/components/Property/SchemaProperty.d.mts.map +0 -1
- package/dist/browser/components/Property/SchemaProperty.d.ts +0 -39
- package/dist/browser/components/Property/SchemaProperty.d.ts.map +0 -1
- package/dist/browser/components/Property/index.d.cts +0 -2
- package/dist/browser/components/Property/index.d.cts.map +0 -1
- package/dist/browser/components/Property/index.d.mts +0 -2
- package/dist/browser/components/Property/index.d.mts.map +0 -1
- package/dist/browser/components/Property/index.d.ts +0 -2
- package/dist/browser/components/Property/index.d.ts.map +0 -1
- package/dist/browser/components/SelectEx/SchemaSelectEx.d.cts +0 -4
- package/dist/browser/components/SelectEx/SchemaSelectEx.d.cts.map +0 -1
- package/dist/browser/components/SelectEx/SchemaSelectEx.d.mts +0 -4
- package/dist/browser/components/SelectEx/SchemaSelectEx.d.mts.map +0 -1
- package/dist/browser/components/SelectEx/SchemaSelectEx.d.ts +0 -4
- package/dist/browser/components/SelectEx/SchemaSelectEx.d.ts.map +0 -1
- package/dist/browser/components/SelectEx/index.d.cts +0 -2
- package/dist/browser/components/SelectEx/index.d.cts.map +0 -1
- package/dist/browser/components/SelectEx/index.d.mts +0 -2
- package/dist/browser/components/SelectEx/index.d.mts.map +0 -1
- package/dist/browser/components/SelectEx/index.d.ts +0 -2
- package/dist/browser/components/SelectEx/index.d.ts.map +0 -1
- package/dist/browser/components/index.d.cts +0 -3
- package/dist/browser/components/index.d.cts.map +0 -1
- package/dist/browser/components/index.d.mts +0 -3
- package/dist/browser/components/index.d.mts.map +0 -1
- package/dist/browser/components/index.d.ts +0 -3
- package/dist/browser/components/index.d.ts.map +0 -1
- package/dist/browser/contexts/Schema/Context.d.cts +0 -3
- package/dist/browser/contexts/Schema/Context.d.cts.map +0 -1
- package/dist/browser/contexts/Schema/Context.d.mts +0 -3
- package/dist/browser/contexts/Schema/Context.d.mts.map +0 -1
- package/dist/browser/contexts/Schema/Context.d.ts +0 -3
- package/dist/browser/contexts/Schema/Context.d.ts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/Memory.d.cts +0 -4
- package/dist/browser/contexts/Schema/Provider/Memory.d.cts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/Memory.d.mts +0 -4
- package/dist/browser/contexts/Schema/Provider/Memory.d.mts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/Memory.d.ts +0 -4
- package/dist/browser/contexts/Schema/Provider/Memory.d.ts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/Props.d.cts +0 -5
- package/dist/browser/contexts/Schema/Provider/Props.d.cts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/Props.d.mts +0 -5
- package/dist/browser/contexts/Schema/Provider/Props.d.mts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/Props.d.ts +0 -5
- package/dist/browser/contexts/Schema/Provider/Props.d.ts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/Route.d.cts +0 -4
- package/dist/browser/contexts/Schema/Provider/Route.d.cts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/Route.d.mts +0 -4
- package/dist/browser/contexts/Schema/Provider/Route.d.mts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/Route.d.ts +0 -4
- package/dist/browser/contexts/Schema/Provider/Route.d.ts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/index.d.cts +0 -4
- package/dist/browser/contexts/Schema/Provider/index.d.cts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/index.d.mts +0 -4
- package/dist/browser/contexts/Schema/Provider/index.d.mts.map +0 -1
- package/dist/browser/contexts/Schema/Provider/index.d.ts +0 -4
- package/dist/browser/contexts/Schema/Provider/index.d.ts.map +0 -1
- package/dist/browser/contexts/Schema/State.d.cts +0 -9
- package/dist/browser/contexts/Schema/State.d.cts.map +0 -1
- package/dist/browser/contexts/Schema/State.d.mts +0 -9
- package/dist/browser/contexts/Schema/State.d.mts.map +0 -1
- package/dist/browser/contexts/Schema/State.d.ts +0 -9
- package/dist/browser/contexts/Schema/State.d.ts.map +0 -1
- package/dist/browser/contexts/Schema/index.d.cts +0 -5
- package/dist/browser/contexts/Schema/index.d.cts.map +0 -1
- package/dist/browser/contexts/Schema/index.d.mts +0 -5
- package/dist/browser/contexts/Schema/index.d.mts.map +0 -1
- package/dist/browser/contexts/Schema/index.d.ts +0 -5
- package/dist/browser/contexts/Schema/index.d.ts.map +0 -1
- package/dist/browser/contexts/Schema/use.d.cts +0 -3
- package/dist/browser/contexts/Schema/use.d.cts.map +0 -1
- package/dist/browser/contexts/Schema/use.d.mts +0 -3
- package/dist/browser/contexts/Schema/use.d.mts.map +0 -1
- package/dist/browser/contexts/Schema/use.d.ts +0 -3
- package/dist/browser/contexts/Schema/use.d.ts.map +0 -1
- package/dist/browser/contexts/index.d.cts +0 -2
- package/dist/browser/contexts/index.d.cts.map +0 -1
- package/dist/browser/contexts/index.d.mts +0 -2
- package/dist/browser/contexts/index.d.mts.map +0 -1
- package/dist/browser/contexts/index.d.ts +0 -2
- package/dist/browser/contexts/index.d.ts.map +0 -1
- package/dist/browser/hooks/index.d.cts +0 -5
- package/dist/browser/hooks/index.d.cts.map +0 -1
- package/dist/browser/hooks/index.d.mts +0 -5
- package/dist/browser/hooks/index.d.mts.map +0 -1
- package/dist/browser/hooks/index.d.ts +0 -5
- package/dist/browser/hooks/index.d.ts.map +0 -1
- package/dist/browser/hooks/useGetSchema.d.cts +0 -26
- package/dist/browser/hooks/useGetSchema.d.cts.map +0 -1
- package/dist/browser/hooks/useGetSchema.d.mts +0 -26
- package/dist/browser/hooks/useGetSchema.d.mts.map +0 -1
- package/dist/browser/hooks/useGetSchema.d.ts +0 -26
- package/dist/browser/hooks/useGetSchema.d.ts.map +0 -1
- package/dist/browser/hooks/useSchemaDefinitions.d.cts +0 -6
- package/dist/browser/hooks/useSchemaDefinitions.d.cts.map +0 -1
- package/dist/browser/hooks/useSchemaDefinitions.d.mts +0 -6
- package/dist/browser/hooks/useSchemaDefinitions.d.mts.map +0 -1
- package/dist/browser/hooks/useSchemaDefinitions.d.ts +0 -6
- package/dist/browser/hooks/useSchemaDefinitions.d.ts.map +0 -1
- package/dist/browser/hooks/useSchemaList.d.cts +0 -4
- package/dist/browser/hooks/useSchemaList.d.cts.map +0 -1
- package/dist/browser/hooks/useSchemaList.d.mts +0 -4
- package/dist/browser/hooks/useSchemaList.d.mts.map +0 -1
- package/dist/browser/hooks/useSchemaList.d.ts +0 -4
- package/dist/browser/hooks/useSchemaList.d.ts.map +0 -1
- package/dist/browser/hooks/useSchemaStats.d.cts +0 -5
- package/dist/browser/hooks/useSchemaStats.d.cts.map +0 -1
- package/dist/browser/hooks/useSchemaStats.d.mts +0 -5
- package/dist/browser/hooks/useSchemaStats.d.mts.map +0 -1
- package/dist/browser/hooks/useSchemaStats.d.ts +0 -5
- package/dist/browser/hooks/useSchemaStats.d.ts.map +0 -1
- package/dist/browser/index.cjs +0 -357
- package/dist/browser/index.cjs.map +0 -1
- package/dist/browser/index.d.cts +0 -4
- package/dist/browser/index.d.cts.map +0 -1
- package/dist/browser/index.d.mts +0 -4
- package/dist/browser/index.d.mts.map +0 -1
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -337
- package/dist/browser/index.js.map +0 -1
- package/dist/neutral/components/Property/SchemaProperty.d.cts +0 -39
- package/dist/neutral/components/Property/SchemaProperty.d.cts.map +0 -1
- package/dist/neutral/components/Property/SchemaProperty.d.mts +0 -39
- package/dist/neutral/components/Property/SchemaProperty.d.mts.map +0 -1
- package/dist/neutral/components/Property/SchemaProperty.d.ts +0 -39
- package/dist/neutral/components/Property/SchemaProperty.d.ts.map +0 -1
- package/dist/neutral/components/Property/index.d.cts +0 -2
- package/dist/neutral/components/Property/index.d.cts.map +0 -1
- package/dist/neutral/components/Property/index.d.mts +0 -2
- package/dist/neutral/components/Property/index.d.mts.map +0 -1
- package/dist/neutral/components/Property/index.d.ts +0 -2
- package/dist/neutral/components/Property/index.d.ts.map +0 -1
- package/dist/neutral/components/SelectEx/SchemaSelectEx.d.cts +0 -4
- package/dist/neutral/components/SelectEx/SchemaSelectEx.d.cts.map +0 -1
- package/dist/neutral/components/SelectEx/SchemaSelectEx.d.mts +0 -4
- package/dist/neutral/components/SelectEx/SchemaSelectEx.d.mts.map +0 -1
- package/dist/neutral/components/SelectEx/SchemaSelectEx.d.ts +0 -4
- package/dist/neutral/components/SelectEx/SchemaSelectEx.d.ts.map +0 -1
- package/dist/neutral/components/SelectEx/index.d.cts +0 -2
- package/dist/neutral/components/SelectEx/index.d.cts.map +0 -1
- package/dist/neutral/components/SelectEx/index.d.mts +0 -2
- package/dist/neutral/components/SelectEx/index.d.mts.map +0 -1
- package/dist/neutral/components/SelectEx/index.d.ts +0 -2
- package/dist/neutral/components/SelectEx/index.d.ts.map +0 -1
- package/dist/neutral/components/index.d.cts +0 -3
- package/dist/neutral/components/index.d.cts.map +0 -1
- package/dist/neutral/components/index.d.mts +0 -3
- package/dist/neutral/components/index.d.mts.map +0 -1
- package/dist/neutral/components/index.d.ts +0 -3
- package/dist/neutral/components/index.d.ts.map +0 -1
- package/dist/neutral/contexts/Schema/Context.d.cts +0 -3
- package/dist/neutral/contexts/Schema/Context.d.cts.map +0 -1
- package/dist/neutral/contexts/Schema/Context.d.mts +0 -3
- package/dist/neutral/contexts/Schema/Context.d.mts.map +0 -1
- package/dist/neutral/contexts/Schema/Context.d.ts +0 -3
- package/dist/neutral/contexts/Schema/Context.d.ts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/Memory.d.cts +0 -4
- package/dist/neutral/contexts/Schema/Provider/Memory.d.cts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/Memory.d.mts +0 -4
- package/dist/neutral/contexts/Schema/Provider/Memory.d.mts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/Memory.d.ts +0 -4
- package/dist/neutral/contexts/Schema/Provider/Memory.d.ts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/Props.d.cts +0 -5
- package/dist/neutral/contexts/Schema/Provider/Props.d.cts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/Props.d.mts +0 -5
- package/dist/neutral/contexts/Schema/Provider/Props.d.mts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/Props.d.ts +0 -5
- package/dist/neutral/contexts/Schema/Provider/Props.d.ts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/Route.d.cts +0 -4
- package/dist/neutral/contexts/Schema/Provider/Route.d.cts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/Route.d.mts +0 -4
- package/dist/neutral/contexts/Schema/Provider/Route.d.mts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/Route.d.ts +0 -4
- package/dist/neutral/contexts/Schema/Provider/Route.d.ts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/index.d.cts +0 -4
- package/dist/neutral/contexts/Schema/Provider/index.d.cts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/index.d.mts +0 -4
- package/dist/neutral/contexts/Schema/Provider/index.d.mts.map +0 -1
- package/dist/neutral/contexts/Schema/Provider/index.d.ts +0 -4
- package/dist/neutral/contexts/Schema/Provider/index.d.ts.map +0 -1
- package/dist/neutral/contexts/Schema/State.d.cts +0 -9
- package/dist/neutral/contexts/Schema/State.d.cts.map +0 -1
- package/dist/neutral/contexts/Schema/State.d.mts +0 -9
- package/dist/neutral/contexts/Schema/State.d.mts.map +0 -1
- package/dist/neutral/contexts/Schema/State.d.ts +0 -9
- package/dist/neutral/contexts/Schema/State.d.ts.map +0 -1
- package/dist/neutral/contexts/Schema/index.d.cts +0 -5
- package/dist/neutral/contexts/Schema/index.d.cts.map +0 -1
- package/dist/neutral/contexts/Schema/index.d.mts +0 -5
- package/dist/neutral/contexts/Schema/index.d.mts.map +0 -1
- package/dist/neutral/contexts/Schema/index.d.ts +0 -5
- package/dist/neutral/contexts/Schema/index.d.ts.map +0 -1
- package/dist/neutral/contexts/Schema/use.d.cts +0 -3
- package/dist/neutral/contexts/Schema/use.d.cts.map +0 -1
- package/dist/neutral/contexts/Schema/use.d.mts +0 -3
- package/dist/neutral/contexts/Schema/use.d.mts.map +0 -1
- package/dist/neutral/contexts/Schema/use.d.ts +0 -3
- package/dist/neutral/contexts/Schema/use.d.ts.map +0 -1
- package/dist/neutral/contexts/index.d.cts +0 -2
- package/dist/neutral/contexts/index.d.cts.map +0 -1
- package/dist/neutral/contexts/index.d.mts +0 -2
- package/dist/neutral/contexts/index.d.mts.map +0 -1
- package/dist/neutral/contexts/index.d.ts +0 -2
- package/dist/neutral/contexts/index.d.ts.map +0 -1
- package/dist/neutral/hooks/index.d.cts +0 -5
- package/dist/neutral/hooks/index.d.cts.map +0 -1
- package/dist/neutral/hooks/index.d.mts +0 -5
- package/dist/neutral/hooks/index.d.mts.map +0 -1
- package/dist/neutral/hooks/index.d.ts +0 -5
- package/dist/neutral/hooks/index.d.ts.map +0 -1
- package/dist/neutral/hooks/useGetSchema.d.cts +0 -26
- package/dist/neutral/hooks/useGetSchema.d.cts.map +0 -1
- package/dist/neutral/hooks/useGetSchema.d.mts +0 -26
- package/dist/neutral/hooks/useGetSchema.d.mts.map +0 -1
- package/dist/neutral/hooks/useGetSchema.d.ts +0 -26
- package/dist/neutral/hooks/useGetSchema.d.ts.map +0 -1
- package/dist/neutral/hooks/useSchemaDefinitions.d.cts +0 -6
- package/dist/neutral/hooks/useSchemaDefinitions.d.cts.map +0 -1
- package/dist/neutral/hooks/useSchemaDefinitions.d.mts +0 -6
- package/dist/neutral/hooks/useSchemaDefinitions.d.mts.map +0 -1
- package/dist/neutral/hooks/useSchemaDefinitions.d.ts +0 -6
- package/dist/neutral/hooks/useSchemaDefinitions.d.ts.map +0 -1
- package/dist/neutral/hooks/useSchemaList.d.cts +0 -4
- package/dist/neutral/hooks/useSchemaList.d.cts.map +0 -1
- package/dist/neutral/hooks/useSchemaList.d.mts +0 -4
- package/dist/neutral/hooks/useSchemaList.d.mts.map +0 -1
- package/dist/neutral/hooks/useSchemaList.d.ts +0 -4
- package/dist/neutral/hooks/useSchemaList.d.ts.map +0 -1
- package/dist/neutral/hooks/useSchemaStats.d.cts +0 -5
- package/dist/neutral/hooks/useSchemaStats.d.cts.map +0 -1
- package/dist/neutral/hooks/useSchemaStats.d.mts +0 -5
- package/dist/neutral/hooks/useSchemaStats.d.mts.map +0 -1
- package/dist/neutral/hooks/useSchemaStats.d.ts +0 -5
- package/dist/neutral/hooks/useSchemaStats.d.ts.map +0 -1
- package/dist/neutral/index.cjs +0 -357
- package/dist/neutral/index.cjs.map +0 -1
- package/dist/neutral/index.d.cts +0 -4
- package/dist/neutral/index.d.cts.map +0 -1
- package/dist/neutral/index.d.mts +0 -4
- package/dist/neutral/index.d.mts.map +0 -1
- package/dist/neutral/index.d.ts +0 -4
- package/dist/neutral/index.d.ts.map +0 -1
- package/dist/neutral/index.js +0 -337
- package/dist/neutral/index.js.map +0 -1
- package/dist/node/components/Property/SchemaProperty.d.cts +0 -39
- package/dist/node/components/Property/SchemaProperty.d.cts.map +0 -1
- package/dist/node/components/Property/SchemaProperty.d.mts +0 -39
- package/dist/node/components/Property/SchemaProperty.d.mts.map +0 -1
- package/dist/node/components/Property/SchemaProperty.d.ts +0 -39
- package/dist/node/components/Property/SchemaProperty.d.ts.map +0 -1
- package/dist/node/components/Property/index.d.cts +0 -2
- package/dist/node/components/Property/index.d.cts.map +0 -1
- package/dist/node/components/Property/index.d.mts +0 -2
- package/dist/node/components/Property/index.d.mts.map +0 -1
- package/dist/node/components/Property/index.d.ts +0 -2
- package/dist/node/components/Property/index.d.ts.map +0 -1
- package/dist/node/components/SelectEx/SchemaSelectEx.d.cts +0 -4
- package/dist/node/components/SelectEx/SchemaSelectEx.d.cts.map +0 -1
- package/dist/node/components/SelectEx/SchemaSelectEx.d.mts +0 -4
- package/dist/node/components/SelectEx/SchemaSelectEx.d.mts.map +0 -1
- package/dist/node/components/SelectEx/SchemaSelectEx.d.ts +0 -4
- package/dist/node/components/SelectEx/SchemaSelectEx.d.ts.map +0 -1
- package/dist/node/components/SelectEx/index.d.cts +0 -2
- package/dist/node/components/SelectEx/index.d.cts.map +0 -1
- package/dist/node/components/SelectEx/index.d.mts +0 -2
- package/dist/node/components/SelectEx/index.d.mts.map +0 -1
- package/dist/node/components/SelectEx/index.d.ts +0 -2
- package/dist/node/components/SelectEx/index.d.ts.map +0 -1
- package/dist/node/components/index.d.cts +0 -3
- package/dist/node/components/index.d.cts.map +0 -1
- package/dist/node/components/index.d.mts +0 -3
- package/dist/node/components/index.d.mts.map +0 -1
- package/dist/node/components/index.d.ts +0 -3
- package/dist/node/components/index.d.ts.map +0 -1
- package/dist/node/contexts/Schema/Context.d.cts +0 -3
- package/dist/node/contexts/Schema/Context.d.cts.map +0 -1
- package/dist/node/contexts/Schema/Context.d.mts +0 -3
- package/dist/node/contexts/Schema/Context.d.mts.map +0 -1
- package/dist/node/contexts/Schema/Context.d.ts +0 -3
- package/dist/node/contexts/Schema/Context.d.ts.map +0 -1
- package/dist/node/contexts/Schema/Provider/Memory.d.cts +0 -4
- package/dist/node/contexts/Schema/Provider/Memory.d.cts.map +0 -1
- package/dist/node/contexts/Schema/Provider/Memory.d.mts +0 -4
- package/dist/node/contexts/Schema/Provider/Memory.d.mts.map +0 -1
- package/dist/node/contexts/Schema/Provider/Memory.d.ts +0 -4
- package/dist/node/contexts/Schema/Provider/Memory.d.ts.map +0 -1
- package/dist/node/contexts/Schema/Provider/Props.d.cts +0 -5
- package/dist/node/contexts/Schema/Provider/Props.d.cts.map +0 -1
- package/dist/node/contexts/Schema/Provider/Props.d.mts +0 -5
- package/dist/node/contexts/Schema/Provider/Props.d.mts.map +0 -1
- package/dist/node/contexts/Schema/Provider/Props.d.ts +0 -5
- package/dist/node/contexts/Schema/Provider/Props.d.ts.map +0 -1
- package/dist/node/contexts/Schema/Provider/Route.d.cts +0 -4
- package/dist/node/contexts/Schema/Provider/Route.d.cts.map +0 -1
- package/dist/node/contexts/Schema/Provider/Route.d.mts +0 -4
- package/dist/node/contexts/Schema/Provider/Route.d.mts.map +0 -1
- package/dist/node/contexts/Schema/Provider/Route.d.ts +0 -4
- package/dist/node/contexts/Schema/Provider/Route.d.ts.map +0 -1
- package/dist/node/contexts/Schema/Provider/index.d.cts +0 -4
- package/dist/node/contexts/Schema/Provider/index.d.cts.map +0 -1
- package/dist/node/contexts/Schema/Provider/index.d.mts +0 -4
- package/dist/node/contexts/Schema/Provider/index.d.mts.map +0 -1
- package/dist/node/contexts/Schema/Provider/index.d.ts +0 -4
- package/dist/node/contexts/Schema/Provider/index.d.ts.map +0 -1
- package/dist/node/contexts/Schema/State.d.cts +0 -9
- package/dist/node/contexts/Schema/State.d.cts.map +0 -1
- package/dist/node/contexts/Schema/State.d.mts +0 -9
- package/dist/node/contexts/Schema/State.d.mts.map +0 -1
- package/dist/node/contexts/Schema/State.d.ts +0 -9
- package/dist/node/contexts/Schema/State.d.ts.map +0 -1
- package/dist/node/contexts/Schema/index.d.cts +0 -5
- package/dist/node/contexts/Schema/index.d.cts.map +0 -1
- package/dist/node/contexts/Schema/index.d.mts +0 -5
- package/dist/node/contexts/Schema/index.d.mts.map +0 -1
- package/dist/node/contexts/Schema/index.d.ts +0 -5
- package/dist/node/contexts/Schema/index.d.ts.map +0 -1
- package/dist/node/contexts/Schema/use.d.cts +0 -3
- package/dist/node/contexts/Schema/use.d.cts.map +0 -1
- package/dist/node/contexts/Schema/use.d.mts +0 -3
- package/dist/node/contexts/Schema/use.d.mts.map +0 -1
- package/dist/node/contexts/Schema/use.d.ts +0 -3
- package/dist/node/contexts/Schema/use.d.ts.map +0 -1
- package/dist/node/contexts/index.d.cts +0 -2
- package/dist/node/contexts/index.d.cts.map +0 -1
- package/dist/node/contexts/index.d.mts +0 -2
- package/dist/node/contexts/index.d.mts.map +0 -1
- package/dist/node/contexts/index.d.ts +0 -2
- package/dist/node/contexts/index.d.ts.map +0 -1
- package/dist/node/hooks/index.d.cts +0 -5
- package/dist/node/hooks/index.d.cts.map +0 -1
- package/dist/node/hooks/index.d.mts +0 -5
- package/dist/node/hooks/index.d.mts.map +0 -1
- package/dist/node/hooks/index.d.ts +0 -5
- package/dist/node/hooks/index.d.ts.map +0 -1
- package/dist/node/hooks/useGetSchema.d.cts +0 -26
- package/dist/node/hooks/useGetSchema.d.cts.map +0 -1
- package/dist/node/hooks/useGetSchema.d.mts +0 -26
- package/dist/node/hooks/useGetSchema.d.mts.map +0 -1
- package/dist/node/hooks/useGetSchema.d.ts +0 -26
- package/dist/node/hooks/useGetSchema.d.ts.map +0 -1
- package/dist/node/hooks/useSchemaDefinitions.d.cts +0 -6
- package/dist/node/hooks/useSchemaDefinitions.d.cts.map +0 -1
- package/dist/node/hooks/useSchemaDefinitions.d.mts +0 -6
- package/dist/node/hooks/useSchemaDefinitions.d.mts.map +0 -1
- package/dist/node/hooks/useSchemaDefinitions.d.ts +0 -6
- package/dist/node/hooks/useSchemaDefinitions.d.ts.map +0 -1
- package/dist/node/hooks/useSchemaList.d.cts +0 -4
- package/dist/node/hooks/useSchemaList.d.cts.map +0 -1
- package/dist/node/hooks/useSchemaList.d.mts +0 -4
- package/dist/node/hooks/useSchemaList.d.mts.map +0 -1
- package/dist/node/hooks/useSchemaList.d.ts +0 -4
- package/dist/node/hooks/useSchemaList.d.ts.map +0 -1
- package/dist/node/hooks/useSchemaStats.d.cts +0 -5
- package/dist/node/hooks/useSchemaStats.d.cts.map +0 -1
- package/dist/node/hooks/useSchemaStats.d.mts +0 -5
- package/dist/node/hooks/useSchemaStats.d.mts.map +0 -1
- package/dist/node/hooks/useSchemaStats.d.ts +0 -5
- package/dist/node/hooks/useSchemaStats.d.ts.map +0 -1
- package/dist/node/index.cjs +0 -374
- package/dist/node/index.cjs.map +0 -1
- package/dist/node/index.d.cts +0 -4
- package/dist/node/index.d.cts.map +0 -1
- package/dist/node/index.d.mts +0 -4
- package/dist/node/index.d.mts.map +0 -1
- package/dist/node/index.d.ts +0 -4
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.js +0 -341
- package/dist/node/index.js.map +0 -1
- /package/src/contexts/Schema/Provider/{Props.tsx → Props.ts} +0 -0
package/package.json
CHANGED
|
@@ -10,37 +10,37 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/hex": "^3.6.
|
|
14
|
-
"@xylabs/lodash": "^3.6.
|
|
15
|
-
"@xylabs/react-async-effect": "^3.4.
|
|
16
|
-
"@xylabs/react-link": "^3.4.
|
|
17
|
-
"@xylabs/react-select": "^3.4.
|
|
18
|
-
"@xylabs/react-shared": "^3.4.
|
|
19
|
-
"@xyo-network/diviner-schema-list-model": "^2.
|
|
20
|
-
"@xyo-network/diviner-schema-stats-model": "^2.
|
|
13
|
+
"@xylabs/hex": "^3.6.12",
|
|
14
|
+
"@xylabs/lodash": "^3.6.12",
|
|
15
|
+
"@xylabs/react-async-effect": "^3.4.2",
|
|
16
|
+
"@xylabs/react-link": "^3.4.2",
|
|
17
|
+
"@xylabs/react-select": "^3.4.2",
|
|
18
|
+
"@xylabs/react-shared": "^3.4.2",
|
|
19
|
+
"@xyo-network/diviner-schema-list-model": "^2.111.3",
|
|
20
|
+
"@xyo-network/diviner-schema-stats-model": "^2.111.3",
|
|
21
21
|
"@xyo-network/node-core-types": "^2.89.1",
|
|
22
|
-
"@xyo-network/payload-builder": "^2.
|
|
23
|
-
"@xyo-network/payload-model": "^2.
|
|
24
|
-
"@xyo-network/react-diviner": "^2.
|
|
25
|
-
"@xyo-network/react-event": "^2.
|
|
26
|
-
"@xyo-network/react-property": "^2.
|
|
27
|
-
"@xyo-network/react-shared": "^2.
|
|
28
|
-
"@xyo-network/schema-cache": "^2.
|
|
29
|
-
"@xyo-network/schema-payload-plugin": "^2.
|
|
30
|
-
"react-router-dom": "^6.
|
|
22
|
+
"@xyo-network/payload-builder": "^2.111.3",
|
|
23
|
+
"@xyo-network/payload-model": "^2.111.3",
|
|
24
|
+
"@xyo-network/react-diviner": "^2.83.0",
|
|
25
|
+
"@xyo-network/react-event": "^2.83.0",
|
|
26
|
+
"@xyo-network/react-property": "^2.83.0",
|
|
27
|
+
"@xyo-network/react-shared": "^2.83.0",
|
|
28
|
+
"@xyo-network/schema-cache": "^2.111.3",
|
|
29
|
+
"@xyo-network/schema-payload-plugin": "^2.111.3",
|
|
30
|
+
"react-router-dom": "^6.26.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@storybook/react": "^
|
|
34
|
-
"@xylabs/react-flexbox": "^3.4.
|
|
35
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
36
|
-
"@xylabs/tsconfig-react": "^
|
|
37
|
-
"@xyo-network/bridge-http": "^2.
|
|
38
|
-
"@xyo-network/node-memory": "^2.
|
|
39
|
-
"@xyo-network/node-model": "^2.
|
|
40
|
-
"@xyo-network/react-node": "^2.
|
|
41
|
-
"@xyo-network/react-payload-raw-info": "^2.
|
|
42
|
-
"@xyo-network/react-storybook": "^2.
|
|
43
|
-
"@xyo-network/react-wallet": "^2.
|
|
33
|
+
"@storybook/react": "^8.2.7",
|
|
34
|
+
"@xylabs/react-flexbox": "^3.4.2",
|
|
35
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.7",
|
|
36
|
+
"@xylabs/tsconfig-react": "^4.0.0-rc.7",
|
|
37
|
+
"@xyo-network/bridge-http": "^2.111.3",
|
|
38
|
+
"@xyo-network/node-memory": "^2.111.3",
|
|
39
|
+
"@xyo-network/node-model": "^2.111.3",
|
|
40
|
+
"@xyo-network/react-node": "^2.83.0",
|
|
41
|
+
"@xyo-network/react-payload-raw-info": "^2.83.0",
|
|
42
|
+
"@xyo-network/react-storybook": "^2.83.0",
|
|
43
|
+
"@xyo-network/react-wallet": "^2.83.0",
|
|
44
44
|
"typescript": "^5.5.4"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -56,32 +56,16 @@
|
|
|
56
56
|
"docs": "dist/docs.json",
|
|
57
57
|
"exports": {
|
|
58
58
|
".": {
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
"default": "./dist/node/index.js"
|
|
63
|
-
},
|
|
64
|
-
"require": {
|
|
65
|
-
"types": "./dist/node/index.d.cts",
|
|
66
|
-
"default": "./dist/node/index.cjs"
|
|
67
|
-
}
|
|
59
|
+
"import": {
|
|
60
|
+
"types": "./dist/browser/index.d.ts",
|
|
61
|
+
"default": "./dist/browser/index.mjs"
|
|
68
62
|
},
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
"types": "./dist/browser/index.d.mts",
|
|
72
|
-
"default": "./dist/browser/index.js"
|
|
73
|
-
},
|
|
74
|
-
"require": {
|
|
75
|
-
"types": "./dist/browser/index.d.cts",
|
|
76
|
-
"default": "./dist/browser/index.cjs"
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
"default": "./dist/browser/index.js"
|
|
63
|
+
"types": "./dist/browser/index.d.ts",
|
|
64
|
+
"default": "./dist/browser/index.mjs"
|
|
80
65
|
},
|
|
81
66
|
"./package.json": "./package.json"
|
|
82
67
|
},
|
|
83
|
-
"
|
|
84
|
-
"module": "dist/browser/index.js",
|
|
68
|
+
"module": "dist/browser/index.mjs",
|
|
85
69
|
"homepage": "https://xyo.network",
|
|
86
70
|
"keywords": [
|
|
87
71
|
"xyo",
|
|
@@ -103,6 +87,6 @@
|
|
|
103
87
|
},
|
|
104
88
|
"sideEffects": false,
|
|
105
89
|
"types": "dist/browser/index.d.ts",
|
|
106
|
-
"version": "2.
|
|
90
|
+
"version": "2.83.0",
|
|
107
91
|
"type": "module"
|
|
108
92
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Meta, StoryFn } from '@storybook/react'
|
|
2
2
|
import { useEvent } from '@xyo-network/react-event'
|
|
3
|
+
import React from 'react'
|
|
3
4
|
|
|
4
|
-
import { SchemaProperty, SchemaPropertyProps } from './SchemaProperty.
|
|
5
|
+
import { SchemaProperty, SchemaPropertyProps } from './SchemaProperty.tsx'
|
|
5
6
|
|
|
6
7
|
const StorybookEntry: Meta = {
|
|
7
8
|
component: SchemaProperty,
|
|
@@ -38,5 +39,4 @@ WithUnverifiedValue.args = { value: 'network.xyo.blahblah' }
|
|
|
38
39
|
|
|
39
40
|
export { Default, WithUnverifiedValue, WithVerifiedValue, WithVerifiedValuePaper }
|
|
40
41
|
|
|
41
|
-
// eslint-disable-next-line import/no-default-export
|
|
42
42
|
export default StorybookEntry
|
|
@@ -5,7 +5,7 @@ import { LinkEx } from '@xylabs/react-link'
|
|
|
5
5
|
import { EventDispatch, EventNoun, useEvent } from '@xyo-network/react-event'
|
|
6
6
|
import { Property, PropertyProps, PropertyValue } from '@xyo-network/react-property'
|
|
7
7
|
import { SchemaCache, SchemaCacheEntry } from '@xyo-network/schema-cache'
|
|
8
|
-
import { forwardRef, useState } from 'react'
|
|
8
|
+
import React, { forwardRef, useState } from 'react'
|
|
9
9
|
|
|
10
10
|
export type SchemaPropertyProps = PropertyProps & {
|
|
11
11
|
showLinkNames?: boolean
|
|
@@ -17,7 +17,6 @@ export type SchemaPropertyProps = PropertyProps & {
|
|
|
17
17
|
const useResolveSchema = (schema?: string) => {
|
|
18
18
|
const [entry, setEntry] = useState<SchemaCacheEntry | null>()
|
|
19
19
|
useAsyncEffect(
|
|
20
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
20
|
async (mounted) => {
|
|
22
21
|
if (schema) {
|
|
23
22
|
const entry = await SchemaCache.instance.get(schema)
|
|
@@ -50,34 +49,46 @@ export const SchemaProperty = forwardRef<HTMLDivElement, SchemaPropertyProps>(
|
|
|
50
49
|
|
|
51
50
|
return (
|
|
52
51
|
<Property ref={forwardedRef} title="Schema" value={value} tip="Schema sent with the payload" titleProps={titleProps} {...props}>
|
|
53
|
-
{value && showStatusIcon
|
|
54
|
-
resolvedSchema === null
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
{value && showStatusIcon
|
|
53
|
+
? resolvedSchema === null
|
|
54
|
+
? (
|
|
55
|
+
<IconButton ref={buttonRef} size="small" onClick={() => onClick(buttonDispatch)}>
|
|
56
|
+
<NewReleasesIcon color="warning" fontSize="inherit" />
|
|
57
|
+
</IconButton>
|
|
58
|
+
)
|
|
59
|
+
: resolvedSchema === undefined
|
|
60
|
+
? (
|
|
61
|
+
<IconButton ref={buttonRef} size="small" onClick={() => onClick(buttonDispatch)}>
|
|
62
|
+
<NewReleasesIcon color="disabled" fontSize="inherit" />
|
|
63
|
+
</IconButton>
|
|
64
|
+
)
|
|
65
|
+
: (
|
|
66
|
+
<IconButton rel="noopener noreferrer" size="small" target="_blank" href={resolvedSchema?.huri?.href ?? ''}>
|
|
67
|
+
<VerifiedIcon color="success" fontSize="inherit" />
|
|
68
|
+
</IconButton>
|
|
69
|
+
)
|
|
65
70
|
|
|
66
|
-
|
|
67
|
-
{value
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
71
|
+
: null}
|
|
72
|
+
{value
|
|
73
|
+
? (
|
|
74
|
+
<>
|
|
75
|
+
{showLinkNames
|
|
76
|
+
? (
|
|
77
|
+
<LinkEx display="block" width="100%" sx={{ cursor: 'pointer' }}>
|
|
78
|
+
<PropertyValue ref={divRef} value={value} title="view schema" onClick={() => onClick(divDispatch)} />
|
|
79
|
+
</LinkEx>
|
|
80
|
+
)
|
|
81
|
+
: <PropertyValue ref={divRef} value={value} title="view schema" onClick={() => onClick(divDispatch)} />}
|
|
82
|
+
{showOpenNewWindowLink
|
|
83
|
+
? (
|
|
84
|
+
<IconButton ref={buttonRef} size="small" onClick={() => onClick(buttonDispatch, true)}>
|
|
85
|
+
<OpenInNewIcon fontSize="inherit" />
|
|
86
|
+
</IconButton>
|
|
87
|
+
)
|
|
88
|
+
: null}
|
|
89
|
+
</>
|
|
90
|
+
)
|
|
91
|
+
: null}
|
|
81
92
|
</Property>
|
|
82
93
|
)
|
|
83
94
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './SchemaProperty.
|
|
1
|
+
export * from './SchemaProperty.tsx'
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { MenuItem, Typography } from '@mui/material'
|
|
2
2
|
import { SelectEx, SelectExProps } from '@xylabs/react-select'
|
|
3
|
+
import React from 'react'
|
|
3
4
|
|
|
4
|
-
import { useSchema } from '../../contexts/index.
|
|
5
|
+
import { useSchema } from '../../contexts/index.ts'
|
|
5
6
|
|
|
6
7
|
export type SchemaSelectExProps = SelectExProps<string>
|
|
7
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './SchemaSelectEx.
|
|
1
|
+
export * from './SchemaSelectEx.tsx'
|
package/src/components/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Property/index.
|
|
2
|
-
export * from './SelectEx/index.
|
|
1
|
+
export * from './Property/index.ts'
|
|
2
|
+
export * from './SelectEx/index.ts'
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { compact } from '@xylabs/lodash'
|
|
2
2
|
import { WithChildren } from '@xylabs/react-shared'
|
|
3
|
-
import { useEffect, useState } from 'react'
|
|
3
|
+
import React, { useEffect, useMemo, useState } from 'react'
|
|
4
4
|
|
|
5
|
-
import { useSchemaStats } from '../../../hooks/index.
|
|
6
|
-
import { SchemaContext } from '../Context.
|
|
7
|
-
import { SchemaProviderProps } from './Props.
|
|
5
|
+
import { useSchemaStats } from '../../../hooks/index.ts'
|
|
6
|
+
import { SchemaContext } from '../Context.ts'
|
|
7
|
+
import { SchemaProviderProps } from './Props.ts'
|
|
8
8
|
|
|
9
|
-
export const SchemaMemoryProvider: React.FC<WithChildren<SchemaProviderProps>> = ({ defaultSchema, knownSchemaList
|
|
9
|
+
export const SchemaMemoryProvider: React.FC<WithChildren<SchemaProviderProps>> = ({ defaultSchema, knownSchemaList, ...props }) => {
|
|
10
10
|
const [schema, setSchema] = useState(defaultSchema)
|
|
11
11
|
const [schemaList, setSchemaList] = useState<string[] | undefined>(knownSchemaList)
|
|
12
12
|
const [fetchedSchemaStats] = useSchemaStats()
|
|
@@ -18,5 +18,7 @@ export const SchemaMemoryProvider: React.FC<WithChildren<SchemaProviderProps>> =
|
|
|
18
18
|
}
|
|
19
19
|
}, [fetchedSchemaStats])
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const value = useMemo(() => ({ provided: true, schema, schemaList: knownSchemaList ?? schemaList, setSchema, setSchemaList }), [schema, schemaList, knownSchemaList])
|
|
22
|
+
|
|
23
|
+
return <SchemaContext.Provider value={value} {...props} />
|
|
22
24
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { WithChildren } from '@xylabs/react-shared'
|
|
2
|
-
import { useCallback, useEffect } from 'react'
|
|
2
|
+
import React, { useCallback, useEffect, useMemo } from 'react'
|
|
3
3
|
import { useSearchParams } from 'react-router-dom'
|
|
4
4
|
|
|
5
|
-
import { SchemaContext } from '../Context.
|
|
6
|
-
import { useSchema } from '../use.
|
|
7
|
-
import { SchemaMemoryProvider } from './Memory.
|
|
8
|
-
import { SchemaProviderProps } from './Props.
|
|
5
|
+
import { SchemaContext } from '../Context.ts'
|
|
6
|
+
import { useSchema } from '../use.ts'
|
|
7
|
+
import { SchemaMemoryProvider } from './Memory.tsx'
|
|
8
|
+
import { SchemaProviderProps } from './Props.ts'
|
|
9
9
|
|
|
10
10
|
const SchemaRouteProviderInner: React.FC<WithChildren> = ({ children }) => {
|
|
11
11
|
const { schema, setSchema, schemaList } = useSchema()
|
|
@@ -14,7 +14,7 @@ const SchemaRouteProviderInner: React.FC<WithChildren> = ({ children }) => {
|
|
|
14
14
|
|
|
15
15
|
const routeSchema = params.get('schema')
|
|
16
16
|
|
|
17
|
-
//update the network stored in the route
|
|
17
|
+
// update the network stored in the route
|
|
18
18
|
const setSchemaParam = useCallback(
|
|
19
19
|
(schema?: string) => {
|
|
20
20
|
if (schema) {
|
|
@@ -28,7 +28,7 @@ const SchemaRouteProviderInner: React.FC<WithChildren> = ({ children }) => {
|
|
|
28
28
|
[params, setParams, setSchema],
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
//if the network is actively changed, update both memory and route
|
|
31
|
+
// if the network is actively changed, update both memory and route
|
|
32
32
|
const setSchemaLocal = useCallback(
|
|
33
33
|
(schema: string) => {
|
|
34
34
|
setSchemaParam(schema)
|
|
@@ -37,20 +37,22 @@ const SchemaRouteProviderInner: React.FC<WithChildren> = ({ children }) => {
|
|
|
37
37
|
[setSchemaParam, setSchema],
|
|
38
38
|
)
|
|
39
39
|
|
|
40
|
-
//sync memory and route storage of network
|
|
40
|
+
// sync memory and route storage of network
|
|
41
41
|
useEffect(() => {
|
|
42
42
|
if (routeSchema !== schema) {
|
|
43
43
|
if (routeSchema === undefined && schema !== undefined) {
|
|
44
|
-
//if the route does not have a network selected, use what is in the memory context
|
|
44
|
+
// if the route does not have a network selected, use what is in the memory context
|
|
45
45
|
setSchemaLocal(schema)
|
|
46
46
|
} else if (routeSchema) {
|
|
47
|
-
//if the route has a selection and it is different from memory, update memory
|
|
47
|
+
// if the route has a selection and it is different from memory, update memory
|
|
48
48
|
setSchema?.(routeSchema)
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}, [routeSchema, schema, setSchemaParam, setSchema, setSchemaLocal])
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
const value = useMemo(() => ({ provided: true, schema, schemaList, setSchema: setSchemaLocal }), [schema, schemaList, setSchemaLocal])
|
|
54
|
+
|
|
55
|
+
return <SchemaContext.Provider value={value}>{children}</SchemaContext.Provider>
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
export const SchemaRouteProvider: React.FC<WithChildren<SchemaProviderProps>> = ({ knownSchemaList, defaultSchema, ...props }) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Memory.
|
|
2
|
-
export * from './Props.
|
|
3
|
-
export * from './Route.
|
|
1
|
+
export * from './Memory.tsx'
|
|
2
|
+
export * from './Props.ts'
|
|
3
|
+
export * from './Route.tsx'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Context.
|
|
2
|
-
export * from './Provider/index.
|
|
3
|
-
export * from './State.
|
|
4
|
-
export * from './use.
|
|
1
|
+
export * from './Context.ts'
|
|
2
|
+
export * from './Provider/index.ts'
|
|
3
|
+
export * from './State.ts'
|
|
4
|
+
export * from './use.ts'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContextEx } from '@xyo-network/react-shared'
|
|
2
2
|
|
|
3
|
-
import { SchemaContext } from './Context.
|
|
4
|
-
import { SchemaContextState } from './State.
|
|
3
|
+
import { SchemaContext } from './Context.ts'
|
|
4
|
+
import { SchemaContextState } from './State.ts'
|
|
5
5
|
|
|
6
6
|
export const useSchema = (required = false) => {
|
|
7
7
|
return useContextEx<SchemaContextState>(SchemaContext, 'Schema', required)
|
package/src/contexts/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Schema/index.
|
|
1
|
+
export * from './Schema/index.ts'
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './useGetSchema.
|
|
2
|
-
export * from './useSchemaDefinitions.
|
|
3
|
-
export * from './useSchemaList.
|
|
4
|
-
export * from './useSchemaStats.
|
|
1
|
+
export * from './useGetSchema.tsx'
|
|
2
|
+
export * from './useSchemaDefinitions.tsx'
|
|
3
|
+
export * from './useSchemaList.tsx'
|
|
4
|
+
export * from './useSchemaStats.tsx'
|
|
@@ -10,11 +10,11 @@ import { NodeProvider } from '@xyo-network/react-node'
|
|
|
10
10
|
import { DefaultSeedPhrase } from '@xyo-network/react-storybook'
|
|
11
11
|
import { useWallet, WalletProvider } from '@xyo-network/react-wallet'
|
|
12
12
|
import { SchemaCache } from '@xyo-network/schema-cache'
|
|
13
|
-
import { useState } from 'react'
|
|
13
|
+
import React, { useState } from 'react'
|
|
14
14
|
|
|
15
|
-
import { useSchemaDefinitions } from '../useSchemaDefinitions.
|
|
16
|
-
import { useSchemaList } from '../useSchemaList.
|
|
17
|
-
import { useSchemaStats } from '../useSchemaStats.
|
|
15
|
+
import { useSchemaDefinitions } from '../useSchemaDefinitions.tsx'
|
|
16
|
+
import { useSchemaList } from '../useSchemaList.tsx'
|
|
17
|
+
import { useSchemaStats } from '../useSchemaStats.tsx'
|
|
18
18
|
|
|
19
19
|
const apiConfig = { apiDomain: 'https://api.archivist.xyo.network' }
|
|
20
20
|
const nodeUrl = 'http://localhost:8080/node'
|
|
@@ -23,7 +23,6 @@ const MemoryNodeDecorator: Decorator = (Story, args) => {
|
|
|
23
23
|
const [node, setNode] = useState<MemoryNode>()
|
|
24
24
|
|
|
25
25
|
useAsyncEffect(
|
|
26
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
26
|
async () => {
|
|
28
27
|
const node = await MemoryNode.create({ config: { schema: NodeConfigSchema } })
|
|
29
28
|
const bridge = await HttpBridge.create({ config: { nodeUrl, schema: HttpBridgeConfigSchema, security: { allowAnonymous: true } } })
|
|
@@ -45,7 +44,6 @@ const MemoryNodeDecorator: Decorator = (Story, args) => {
|
|
|
45
44
|
)
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
// eslint-disable-next-line import/no-default-export
|
|
49
47
|
export default {
|
|
50
48
|
decorators: [MemoryNodeDecorator],
|
|
51
49
|
title: 'schema/Hooks',
|
|
@@ -57,29 +55,29 @@ const Template: StoryFn<React.FC> = () => {
|
|
|
57
55
|
const [address, setAddress] = useState<Address>()
|
|
58
56
|
const [schemaStats, schemaStatsError] = useSchemaStats(address)
|
|
59
57
|
const [schemaList, schemaListError] = useSchemaList(address)
|
|
60
|
-
const mappedSchemaList = schemaList?.schemas?.map(
|
|
58
|
+
const mappedSchemaList = schemaList?.schemas?.map(name => ({ name })) as { name: string }[]
|
|
61
59
|
const schemaDefinitions = useSchemaDefinitions(mappedSchemaList)
|
|
62
60
|
|
|
63
61
|
return (
|
|
64
62
|
<div style={{ display: 'flex', flexDirection: 'column', rowGap: '16px' }}>
|
|
65
|
-
{schemaStatsError
|
|
66
|
-
<Alert severity=
|
|
67
|
-
|
|
63
|
+
{schemaStatsError
|
|
64
|
+
? <Alert severity="error">{schemaStatsError.message ?? schemaListError?.message}</Alert>
|
|
65
|
+
: null}
|
|
68
66
|
<FlexGrowRow columnGap={4}>
|
|
69
|
-
<TextField fullWidth size="small" value={address} label="Address" onChange={
|
|
67
|
+
<TextField fullWidth size="small" value={address} label="Address" onChange={event => setAddressText(event.target.value as Address)} />
|
|
70
68
|
<Button variant="contained" onClick={() => setAddress(addressText)} sx={{ whiteSpace: 'nowrap' }}>
|
|
71
69
|
Get Stats
|
|
72
70
|
</Button>
|
|
73
71
|
</FlexGrowRow>
|
|
74
|
-
<Typography variant=
|
|
72
|
+
<Typography variant="h2">Schema Stats</Typography>
|
|
75
73
|
<code>
|
|
76
74
|
<pre>{JSON.stringify(schemaStats, null, 2)}</pre>
|
|
77
75
|
</code>
|
|
78
|
-
<Typography variant=
|
|
76
|
+
<Typography variant="h2">Schema List</Typography>
|
|
79
77
|
<code>
|
|
80
78
|
<pre>{JSON.stringify(schemaList, null, 2)}</pre>
|
|
81
79
|
</code>
|
|
82
|
-
<Typography variant=
|
|
80
|
+
<Typography variant="h2">Schema Definitions</Typography>
|
|
83
81
|
<pre>
|
|
84
82
|
<code>{JSON.stringify(schemaDefinitions, null, 2)}</code>
|
|
85
83
|
</pre>
|
|
@@ -3,9 +3,9 @@ import { Meta, StoryFn } from '@storybook/react'
|
|
|
3
3
|
import { FlexRow } from '@xylabs/react-flexbox'
|
|
4
4
|
import { JsonViewerEx } from '@xyo-network/react-payload-raw-info'
|
|
5
5
|
import { SchemaCache } from '@xyo-network/schema-cache'
|
|
6
|
-
import { useEffect, useState } from 'react'
|
|
6
|
+
import React, { useEffect, useState } from 'react'
|
|
7
7
|
|
|
8
|
-
import { useGetSchemaPayload } from './useGetSchema.
|
|
8
|
+
import { useGetSchemaPayload } from './useGetSchema.tsx'
|
|
9
9
|
|
|
10
10
|
SchemaCache.instance.proxy = 'https://beta.api.archivist.xyo.network/domain'
|
|
11
11
|
|
|
@@ -37,7 +37,7 @@ const UseGetSchemaComponent: React.FC<{ schema: string }> = ({ schema }) => {
|
|
|
37
37
|
))}
|
|
38
38
|
</Typography>
|
|
39
39
|
<FormControl>
|
|
40
|
-
<TextField value={schemaFieldValue} label="Schema Name" onChange={
|
|
40
|
+
<TextField value={schemaFieldValue} label="Schema Name" onChange={e => setSchemaFieldValue(e.target.value)} />
|
|
41
41
|
</FormControl>
|
|
42
42
|
<FlexRow my={3} justifyContent="start">
|
|
43
43
|
<JsonViewerEx value={schemaPayload || {}} />
|
|
@@ -69,5 +69,4 @@ Domain.args = { schema: 'network.xyo.domain' }
|
|
|
69
69
|
|
|
70
70
|
export { Default, Domain }
|
|
71
71
|
|
|
72
|
-
// eslint-disable-next-line import/no-default-export
|
|
73
72
|
export default StorybookEntry
|
|
@@ -15,7 +15,6 @@ const useGetSchemaPayload = (schema?: string) => {
|
|
|
15
15
|
const [schemaLocal, setSchemaLocal] = useState<string>()
|
|
16
16
|
|
|
17
17
|
useAsyncEffect(
|
|
18
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
18
|
async (mounted) => {
|
|
20
19
|
const firstRequest = !notFound && !schemaCacheEntry && !xyoError
|
|
21
20
|
const schemaChanged = schema !== schemaLocal
|
|
@@ -8,15 +8,14 @@ export type SchemaList = { name: string }
|
|
|
8
8
|
export const useSchemaDefinitions = (schemaList?: SchemaList[]): SchemaPayload[] | undefined => {
|
|
9
9
|
const [schemaPayloads, setSchemaPayloads] = useState<SchemaPayload[]>()
|
|
10
10
|
useAsyncEffect(
|
|
11
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12
11
|
async (mounted) => {
|
|
13
12
|
if (schemaList) {
|
|
14
13
|
const promiseResults = await Promise.allSettled(schemaList?.map(({ name }) => SchemaCache.instance.get(name)))
|
|
15
14
|
if (mounted()) {
|
|
16
15
|
setSchemaPayloads(
|
|
17
16
|
promiseResults
|
|
18
|
-
.map(
|
|
19
|
-
.filter(
|
|
17
|
+
.map(result => (result.status === 'fulfilled' ? result.value?.payload : undefined))
|
|
18
|
+
.filter(item => item !== undefined && item !== null) as SchemaPayload[],
|
|
20
19
|
)
|
|
21
20
|
}
|
|
22
21
|
}
|
|
@@ -12,14 +12,14 @@ export const useSchemaList = (address?: Address, nameOrAddress = 'SchemaListDivi
|
|
|
12
12
|
|
|
13
13
|
const query: SchemaListQueryPayload[] | undefined = useMemo(
|
|
14
14
|
() =>
|
|
15
|
-
address
|
|
16
|
-
[
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
address
|
|
16
|
+
? [
|
|
17
|
+
{
|
|
18
|
+
address,
|
|
19
|
+
schema: SchemaListQuerySchema,
|
|
20
|
+
},
|
|
21
|
+
]
|
|
22
|
+
: undefined,
|
|
23
23
|
[address],
|
|
24
24
|
)
|
|
25
25
|
|
|
@@ -31,7 +31,6 @@ export const useSchemaList = (address?: Address, nameOrAddress = 'SchemaListDivi
|
|
|
31
31
|
}, [diviner])
|
|
32
32
|
|
|
33
33
|
useAsyncEffect(
|
|
34
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps, require-await
|
|
35
34
|
async (mounted) => {
|
|
36
35
|
const divinerInstance = diviner?.deref()
|
|
37
36
|
if (divinerInstance) {
|
|
@@ -18,7 +18,7 @@ export const useSchemaStats = (
|
|
|
18
18
|
const [refresh, setRefresh] = useState(1)
|
|
19
19
|
const [diviner, divinerError] = useWeakDivinerFromNode(nameOrAddress)
|
|
20
20
|
const [error, setError] = useState<Error>()
|
|
21
|
-
const refreshHistory = () => setRefresh(
|
|
21
|
+
const refreshHistory = () => setRefresh(previous => previous + 1)
|
|
22
22
|
|
|
23
23
|
const [schemaList, setSchemaList] = useState<WithSources<WithMeta<SchemaStatsPayload>>[]>()
|
|
24
24
|
|
|
@@ -31,7 +31,6 @@ export const useSchemaStats = (
|
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
useAsyncEffect(
|
|
34
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
34
|
async (mounted) => {
|
|
36
35
|
const instance = diviner?.deref()
|
|
37
36
|
if (instance) {
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './components/index.
|
|
2
|
-
export * from './contexts/index.
|
|
3
|
-
export * from './hooks/index.
|
|
1
|
+
export * from './components/index.ts'
|
|
2
|
+
export * from './contexts/index.ts'
|
|
3
|
+
export * from './hooks/index.ts'
|
package/xy.config.ts
ADDED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { PropertyProps } from '@xyo-network/react-property';
|
|
2
|
-
export type SchemaPropertyProps = PropertyProps & {
|
|
3
|
-
showLinkNames?: boolean;
|
|
4
|
-
showOpenNewWindowLink?: boolean;
|
|
5
|
-
showStatusIcon?: boolean;
|
|
6
|
-
value?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const SchemaProperty: import("react").ForwardRefExoticComponent<((import("@xyo-network/react-property").PropertyBaseProps & {
|
|
9
|
-
actions?: import("@xyo-network/react-property").PropertyAction[];
|
|
10
|
-
badge?: boolean;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
size?: import("@xyo-network/react-shared").SizeProp;
|
|
13
|
-
value?: string | number | boolean | null;
|
|
14
|
-
} & import("@xylabs/react-flexbox").BusyBoxProps & {
|
|
15
|
-
paper?: false;
|
|
16
|
-
} & {
|
|
17
|
-
showLinkNames?: boolean;
|
|
18
|
-
showOpenNewWindowLink?: boolean;
|
|
19
|
-
showStatusIcon?: boolean;
|
|
20
|
-
value?: string;
|
|
21
|
-
}) | Omit<import("@xyo-network/react-property").PropertyBaseProps & {
|
|
22
|
-
actions?: import("@xyo-network/react-property").PropertyAction[];
|
|
23
|
-
badge?: boolean;
|
|
24
|
-
required?: boolean;
|
|
25
|
-
size?: import("@xyo-network/react-shared").SizeProp;
|
|
26
|
-
value?: string | number | boolean | null;
|
|
27
|
-
} & import("@mui/material").PaperOwnProps & import("@mui/material/OverridableComponent.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
28
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
29
|
-
}, "className" | "style" | "classes" | "children" | "elevation" | "square" | "sx" | "variant"> & {
|
|
30
|
-
component?: import("react").ElementType;
|
|
31
|
-
} & {
|
|
32
|
-
paper: true;
|
|
33
|
-
} & {
|
|
34
|
-
showLinkNames?: boolean;
|
|
35
|
-
showOpenNewWindowLink?: boolean;
|
|
36
|
-
showStatusIcon?: boolean;
|
|
37
|
-
value?: string;
|
|
38
|
-
}, "ref">) & import("react").RefAttributes<HTMLDivElement>>;
|
|
39
|
-
//# sourceMappingURL=SchemaProperty.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaProperty.d.ts","sourceRoot":"","sources":["../../../../src/components/Property/SchemaProperty.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAY,aAAa,EAAiB,MAAM,6BAA6B,CAAA;AAIpF,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;AAmBD,eAAO,MAAM,cAAc;;;;;;;;;oBAvBT,OAAO;4BACC,OAAO;qBACd,OAAO;YAChB,MAAM;;;;;;;;;;;;;;oBAHE,OAAO;4BACC,OAAO;qBACd,OAAO;YAChB,MAAM;2DAsEf,CAAA"}
|