@xyo-network/react-schema 6.1.4 → 7.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,99 +1,4 @@
1
- import { PropertyProps } from '@xyo-network/react-property';
2
- import * as react from 'react';
3
- import react__default, { PropsWithChildren, Dispatch, SetStateAction } from 'react';
4
- import { SelectExProps } from '@xylabs/react-select';
5
- import * as _xylabs_react_shared from '@xylabs/react-shared';
6
- import { ContextExState } from '@xylabs/react-shared';
7
- import * as _xyo_network_huri from '@xyo-network/huri';
8
- import * as _xyo_network_payload_model from '@xyo-network/payload-model';
9
- import { WithSources, ModuleError } from '@xyo-network/payload-model';
10
- import { SchemaPayload } from '@xyo-network/schema-payload-plugin';
11
- import { Address } from '@xylabs/hex';
12
- import { SchemaListPayload } from '@xyo-network/diviner-schema-list-model';
13
- import { SchemaStatsPayload } from '@xyo-network/diviner-schema-stats-model';
14
-
15
- type SchemaPropertyProps = PropertyProps & {
16
- showLinkNames?: boolean;
17
- showOpenNewWindowLink?: boolean;
18
- showStatusIcon?: boolean;
19
- value?: string;
20
- };
21
- declare const SchemaProperty: react__default.FC<SchemaPropertyProps>;
22
-
23
- type SchemaSelectExProps = SelectExProps<string>;
24
- declare const SchemaSelectEx: react__default.FC<SchemaSelectExProps>;
25
-
26
- declare const SchemaContext: react.Context<({
27
- schema?: string;
28
- schemaList?: string[];
29
- setSchema?: react.Dispatch<string>;
30
- setSchemaList?: react.Dispatch<string[]>;
31
- } & {
32
- provided: true;
33
- }) | (_xylabs_react_shared.FixedValues<_xylabs_react_shared.ProvidedContextExState<{
34
- schema?: string;
35
- schemaList?: string[];
36
- setSchema?: react.Dispatch<string>;
37
- setSchemaList?: react.Dispatch<string[]>;
38
- }>, never> & {
39
- provided: false;
40
- }) | (_xylabs_react_shared.FixedValues<_xylabs_react_shared.NotProvidedContextExState<{
41
- schema?: string;
42
- schemaList?: string[];
43
- setSchema?: react.Dispatch<string>;
44
- setSchemaList?: react.Dispatch<string[]>;
45
- }>, never> & {
46
- provided: false;
47
- })>;
48
-
49
- interface SchemaProviderProps {
50
- defaultSchema?: string;
51
- knownSchemaList?: string[];
52
- }
53
-
54
- declare const SchemaMemoryProvider: react__default.FC<PropsWithChildren<SchemaProviderProps>>;
55
-
56
- declare const SchemaRouteProvider: react__default.FC<PropsWithChildren<SchemaProviderProps>>;
57
-
58
- type SchemaContextState = ContextExState<{
59
- /** @field The currently selected XYO Schema */
60
- schema?: string;
61
- /** @field The list of known available schema */
62
- schemaList?: string[];
63
- /** @field Function to set the selected Schema */
64
- setSchema?: Dispatch<string>;
65
- /** @field Function to set the list of known available schema */
66
- setSchemaList?: Dispatch<string[]>;
67
- }>;
68
-
69
- declare const useSchema: (required?: boolean) => Omit<{
70
- schema?: string;
71
- schemaList?: string[];
72
- setSchema?: react.Dispatch<string>;
73
- setSchemaList?: react.Dispatch<string[]>;
74
- } & {
75
- provided: true;
76
- }, "provided"> | Omit<_xylabs_react_shared.NotProvidedContextExState<SchemaContextState>, "provided">;
77
-
78
- /**
79
- * Gets a Huri and schema payload from a schema string
80
- */
81
- declare const useGetSchemaPayload: (schema?: string) => {
82
- notFound: boolean;
83
- schemaHuri: _xyo_network_huri.Huri<_xyo_network_payload_model.Payload> | undefined;
84
- schemaPayload: SchemaPayload | null | undefined;
85
- xyoError: WithSources<ModuleError> | undefined;
86
- };
87
- //# sourceMappingURL=useGetSchema.d.ts.map
88
-
89
- type SchemaList = {
90
- name: string;
91
- };
92
- declare const useSchemaDefinitions: (schemaList?: SchemaList[]) => SchemaPayload[] | undefined;
93
-
94
- declare const useSchemaList: (address?: Address, nameOrAddress?: string) => [SchemaListPayload | null | undefined, Error | undefined];
95
-
96
- declare const useSchemaStats: (statsAddress?: Address, nameOrAddress?: string) => [SchemaStatsPayload[] | undefined, Error | undefined, Dispatch<SetStateAction<number>>];
97
-
98
- export { SchemaContext, SchemaMemoryProvider, SchemaProperty, SchemaRouteProvider, SchemaSelectEx, useGetSchemaPayload, useSchema, useSchemaDefinitions, useSchemaList, useSchemaStats };
99
- export type { SchemaContextState, SchemaList, SchemaPropertyProps, SchemaProviderProps, SchemaSelectExProps };
1
+ export * from './components/index.ts';
2
+ export * from './contexts/index.ts';
3
+ export * from './hooks/index.ts';
4
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-schema",
3
- "version": "6.1.4",
3
+ "version": "7.0.0",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -38,26 +38,30 @@
38
38
  },
39
39
  "module": "dist/browser/index.mjs",
40
40
  "types": "dist/browser/index.d.ts",
41
+ "files": [
42
+ "dist",
43
+ "src"
44
+ ],
41
45
  "dependencies": {
42
- "@xylabs/exists": "^4.13.23",
43
- "@xylabs/hex": "^4.13.23",
44
- "@xylabs/react-async-effect": "^6.3.13",
45
- "@xylabs/react-flexbox": "^6.3.13",
46
- "@xylabs/react-link": "^6.3.13",
47
- "@xylabs/react-promise": "^6.3.13",
48
- "@xylabs/react-select": "^6.3.13",
49
- "@xylabs/react-shared": "^6.3.13",
50
- "@xyo-network/diviner-schema-list-model": "^4.1.7",
51
- "@xyo-network/diviner-schema-stats-model": "^4.1.7",
52
- "@xyo-network/node-core-types": "^3.7.16",
53
- "@xyo-network/payload-builder": "^4.1.7",
54
- "@xyo-network/payload-model": "^4.1.7",
55
- "@xyo-network/react-diviner": "^6.1.4",
56
- "@xyo-network/react-event": "^6.1.4",
57
- "@xyo-network/react-property": "^6.1.4",
58
- "@xyo-network/schema-cache": "^4.1.7",
59
- "@xyo-network/schema-payload-plugin": "^4.1.7",
60
- "react-router-dom": "^7.7.0"
46
+ "@xylabs/exists": "^5.0.0",
47
+ "@xylabs/hex": "^5.0.0",
48
+ "@xylabs/react-async-effect": "^7.0.0",
49
+ "@xylabs/react-flexbox": "^7.0.0",
50
+ "@xylabs/react-link": "^7.0.0",
51
+ "@xylabs/react-promise": "^7.0.0",
52
+ "@xylabs/react-select": "^7.0.0",
53
+ "@xylabs/react-shared": "^7.0.0",
54
+ "@xyo-network/diviner-schema-list-model": "^5.0.0",
55
+ "@xyo-network/diviner-schema-stats-model": "^5.0.0",
56
+ "@xyo-network/node-core-types": "^3.8.0",
57
+ "@xyo-network/payload-builder": "^5.0.0",
58
+ "@xyo-network/payload-model": "^5.0.0",
59
+ "@xyo-network/react-diviner": "^7.0.0",
60
+ "@xyo-network/react-event": "^7.0.0",
61
+ "@xyo-network/react-property": "^7.0.0",
62
+ "@xyo-network/schema-cache": "^5.0.0",
63
+ "@xyo-network/schema-payload-plugin": "^5.0.0",
64
+ "react-router-dom": "^7.7.1"
61
65
  },
62
66
  "devDependencies": {
63
67
  "@emotion/react": "^11.14.0",
@@ -65,20 +69,20 @@
65
69
  "@mui/icons-material": "^7.2.0",
66
70
  "@mui/material": "^7.2.0",
67
71
  "@storybook/react-vite": "^9.0.18",
68
- "@types/react": "^19.1.8",
69
- "@xylabs/react-flexbox": "^6.3.13",
70
- "@xylabs/react-hooks": "^6.3.13",
71
- "@xylabs/ts-scripts-yarn3": "next",
72
- "@xylabs/tsconfig-react": "next",
73
- "@xyo-network/bridge-http": "^4.1.7",
74
- "@xyo-network/node-memory": "^4.1.7",
75
- "@xyo-network/node-model": "^4.1.7",
76
- "@xyo-network/react-node": "^6.1.4",
77
- "@xyo-network/react-payload-raw-info": "^6.1.4",
78
- "@xyo-network/react-storybook": "^6.1.4",
79
- "@xyo-network/react-wallet": "^6.1.4",
80
- "react": "^19.1.0",
81
- "react-dom": "^19.1.0",
72
+ "@types/react": "^19.1.9",
73
+ "@xylabs/react-flexbox": "^7.0.0",
74
+ "@xylabs/react-hooks": "^7.0.0",
75
+ "@xylabs/ts-scripts-yarn3": "^7.0.2",
76
+ "@xylabs/tsconfig-react": "^7.0.2",
77
+ "@xyo-network/bridge-http": "^5.0.0",
78
+ "@xyo-network/node-memory": "^5.0.0",
79
+ "@xyo-network/node-model": "^5.0.0",
80
+ "@xyo-network/react-node": "^7.0.0",
81
+ "@xyo-network/react-payload-raw-info": "^7.0.0",
82
+ "@xyo-network/react-storybook": "^7.0.0",
83
+ "@xyo-network/react-wallet": "^7.0.0",
84
+ "react": "^19.1.1",
85
+ "react-dom": "^19.1.1",
82
86
  "storybook": "^9.0.18",
83
87
  "typescript": "^5.8.3"
84
88
  },
@@ -59,7 +59,7 @@ export default {
59
59
 
60
60
  const Template: StoryFn<React.FC> = () => {
61
61
  SchemaCache.instance.proxy = `${apiConfig.apiDomain}/domain`
62
- const [addressText, setAddressText] = useState<Address>('')
62
+ const [addressText, setAddressText] = useState<Address>('' as Address)
63
63
  const [address, setAddress] = useState<Address>()
64
64
  const [schemaStats, schemaStatsError] = useSchemaStats(address)
65
65
  const [schemaList, schemaListError] = useSchemaList(address)
package/typedoc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://typedoc.org/schema.json",
3
- "entryPoints": ["src/index.ts"],
4
- "tsconfig": "./tsconfig.typedoc.json"
5
- }
package/xy.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
- const config: XyTsupConfig = {
3
- compile: {
4
- browser: { src: true },
5
- node: {},
6
- neutral: {},
7
- },
8
- }
9
-
10
- export default config