@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.
- package/dist/browser/index.d.ts +4 -99
- package/package.json +38 -34
- package/src/hooks/stories/TestSchemaHooks.stories.tsx +1 -1
- package/typedoc.json +0 -5
- package/xy.config.ts +0 -10
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,99 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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": "
|
|
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": "^
|
|
43
|
-
"@xylabs/hex": "^
|
|
44
|
-
"@xylabs/react-async-effect": "^
|
|
45
|
-
"@xylabs/react-flexbox": "^
|
|
46
|
-
"@xylabs/react-link": "^
|
|
47
|
-
"@xylabs/react-promise": "^
|
|
48
|
-
"@xylabs/react-select": "^
|
|
49
|
-
"@xylabs/react-shared": "^
|
|
50
|
-
"@xyo-network/diviner-schema-list-model": "^
|
|
51
|
-
"@xyo-network/diviner-schema-stats-model": "^
|
|
52
|
-
"@xyo-network/node-core-types": "^3.
|
|
53
|
-
"@xyo-network/payload-builder": "^
|
|
54
|
-
"@xyo-network/payload-model": "^
|
|
55
|
-
"@xyo-network/react-diviner": "^
|
|
56
|
-
"@xyo-network/react-event": "^
|
|
57
|
-
"@xyo-network/react-property": "^
|
|
58
|
-
"@xyo-network/schema-cache": "^
|
|
59
|
-
"@xyo-network/schema-payload-plugin": "^
|
|
60
|
-
"react-router-dom": "^7.7.
|
|
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.
|
|
69
|
-
"@xylabs/react-flexbox": "^
|
|
70
|
-
"@xylabs/react-hooks": "^
|
|
71
|
-
"@xylabs/ts-scripts-yarn3": "
|
|
72
|
-
"@xylabs/tsconfig-react": "
|
|
73
|
-
"@xyo-network/bridge-http": "^
|
|
74
|
-
"@xyo-network/node-memory": "^
|
|
75
|
-
"@xyo-network/node-model": "^
|
|
76
|
-
"@xyo-network/react-node": "^
|
|
77
|
-
"@xyo-network/react-payload-raw-info": "^
|
|
78
|
-
"@xyo-network/react-storybook": "^
|
|
79
|
-
"@xyo-network/react-wallet": "^
|
|
80
|
-
"react": "^19.1.
|
|
81
|
-
"react-dom": "^19.1.
|
|
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