@xyo-network/react-payload-plugin-resolver 8.0.0 → 8.0.1
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.mjs +1 -1
- package/dist/browser/index.mjs.map +7 -1
- package/package.json +45 -41
package/dist/browser/index.mjs
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/contexts/PayloadPluginResolver/Context.ts", "../../src/contexts/PayloadPluginResolver/Provider.tsx", "../../src/contexts/PayloadPluginResolver/use.ts", "../../src/contexts/PayloadRenderPluginResolver/Context.ts", "../../src/contexts/PayloadRenderPluginResolver/Provider.tsx", "../../src/contexts/PayloadRenderPluginResolver/use.ts", "../../src/contexts/PayloadSetPluginResolver/Context.ts", "../../src/contexts/PayloadSetPluginResolver/Provider.tsx", "../../src/contexts/PayloadSetPluginResolver/use.ts", "../../src/PayloadRenderPluginResolver.ts"],
|
|
4
|
+
"sourcesContent": ["import { createContextEx } from '@xylabs/react-shared'\n\nimport type { PayloadPluginResolverState } from './State.ts'\n\nconst PayloadPluginResolverContext = createContextEx<PayloadPluginResolverState>()\n\nexport { PayloadPluginResolverContext }\n", "import type { ContextExProviderProps } from '@xylabs/react-shared'\nimport type { PayloadPluginResolver } from '@xyo-network/payload-plugin'\nimport React, { useMemo, useState } from 'react'\n\nimport { PayloadPluginResolverContext } from './Context.ts'\nimport type { PayloadPluginResolverState } from './State.ts'\n\nexport type PayloadPluginResolverProviderProps = ContextExProviderProps<{\n resolver: PayloadPluginResolver\n}>\n\nexport const PayloadPluginResolverProvider: React.FC<PayloadPluginResolverProviderProps> = ({\n resolver: resolverProp,\n required = false,\n children,\n}) => {\n const [resolver, setResolver] = useState<PayloadPluginResolver>(resolverProp)\n\n const value: PayloadPluginResolverState = useMemo(() => ({\n provided: true, resolver, setResolver,\n }), [resolver, setResolver])\n\n return (\n <PayloadPluginResolverContext\n value={value}\n >\n {resolver\n ? children\n : required\n ? null\n : children}\n </PayloadPluginResolverContext>\n )\n}\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { PayloadPluginResolverContext } from './Context.ts'\n\nexport const usePayloadPluginResolver = (required = false) => {\n return useContextEx(PayloadPluginResolverContext, 'PayloadPluginResolver', required)\n}\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { PayloadRenderPluginResolverState } from './State.ts'\n\nconst PayloadRenderPluginResolverContext = createContextEx<PayloadRenderPluginResolverState>()\n\nexport { PayloadRenderPluginResolverContext }\n", "import type { ContextExProviderProps } from '@xylabs/react-shared'\nimport React, { useMemo, useState } from 'react'\n\nimport type { PayloadRenderPluginResolver } from '../../PayloadRenderPluginResolver.ts'\nimport { PayloadRenderPluginResolverContext } from './Context.ts'\nimport type { PayloadRenderPluginResolverState } from './State.ts'\n\nexport type PayloadRenderPluginResolverProviderProps = ContextExProviderProps<{\n resolver: PayloadRenderPluginResolver\n}>\n\nexport const PayloadRenderPluginResolverProvider: React.FC<PayloadRenderPluginResolverProviderProps> = ({\n resolver: resolverProp,\n required = false,\n children,\n}) => {\n const [resolver, setResolver] = useState<PayloadRenderPluginResolver>(resolverProp)\n\n const value: PayloadRenderPluginResolverState = useMemo(() => ({\n resolver, provided: true, setResolver,\n }), [resolver, setResolver])\n\n return (\n <PayloadRenderPluginResolverContext\n value={value}\n >\n {resolver\n ? children\n : required\n ? null\n : children}\n </PayloadRenderPluginResolverContext>\n )\n}\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { PayloadRenderPluginResolverContext } from './Context.ts'\n\nexport const usePayloadRenderPluginResolver = (required = false) => {\n return useContextEx(PayloadRenderPluginResolverContext, 'PayloadRenderPluginResolver', required)\n}\n", "import { createContextEx } from '@xylabs/react-shared'\n\nimport type { PayloadSetPluginResolverState } from './State.ts'\n\nconst PayloadSetPluginResolverContext = createContextEx<PayloadSetPluginResolverState>()\n\nexport { PayloadSetPluginResolverContext }\n", "import { useResetState } from '@xylabs/react-hooks'\nimport type { ContextExProviderProps } from '@xylabs/react-shared'\nimport type { PayloadSetPluginResolver } from '@xyo-network/payloadset-plugin'\nimport React, { useMemo } from 'react'\n\nimport { PayloadSetPluginResolverContext } from './Context.ts'\n\nexport type PayloadSetPluginResolverProviderProps = ContextExProviderProps<{\n resolver: PayloadSetPluginResolver\n}>\n\nexport const PayloadSetPluginResolverProvider: React.FC<PayloadSetPluginResolverProviderProps> = ({\n resolver: resolverProp,\n required = false,\n children,\n}) => {\n const [resolver, setResolver] = useResetState<PayloadSetPluginResolver>(resolverProp)\n\n const value = useMemo(() => ({\n provided: true as const,\n resolver,\n setResolver,\n }), [resolver, setResolver])\n\n return (\n <PayloadSetPluginResolverContext\n value={value}\n >\n {resolver\n ? children\n : required\n ? null\n : children}\n </PayloadSetPluginResolverContext>\n )\n}\n", "import { useContextEx } from '@xylabs/react-shared'\n\nimport { PayloadSetPluginResolverContext } from './Context.ts'\n\nexport const usePayloadSetPluginResolver = (required = false) => {\n return useContextEx(PayloadSetPluginResolverContext, 'PayloadSetPluginResolver', required)\n}\n", "import { assertEx } from '@xylabs/sdk-js'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport type { PayloadRenderPlugin } from '@xyo-network/react-payload-plugin'\n\nexport class PayloadRenderPluginResolver {\n protected plugins: PayloadRenderPlugin[] = []\n protected schemaDefaultPlugin = new Map<string, PayloadRenderPlugin>()\n\n list(payload?: Payload) {\n if (!payload) {\n return this.plugins\n }\n const defaultPlugin = this.schemaDefaultPlugin.get(payload.schema)\n const result = defaultPlugin ? [defaultPlugin] : []\n for (const plugin of this.plugins) {\n if (defaultPlugin !== plugin && plugin.canRender(payload)) {\n result.push(plugin)\n }\n }\n return result\n }\n\n register(plugin: PayloadRenderPlugin, defaultForSchema?: Schema[]) {\n this.plugins.push(plugin)\n if (defaultForSchema)\n for (const schema of defaultForSchema) {\n assertEx(plugin.canRender({ schema }), () => 'Default renderer must be able to render schema')\n this.schemaDefaultPlugin.set(schema, plugin)\n }\n return this\n }\n\n resolve(payload: Payload) {\n return this.schemaDefaultPlugin.get(payload.schema) ?? [...this.plugins.values()].find(plugin => plugin.canRender(payload))\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,uBAAuB;AAIhC,IAAM,+BAA+B,gBAA4C;;;ACFjF,SAAgB,SAAS,gBAAgB;AAqBrC;AAZG,IAAM,gCAA8E,CAAC;AAAA,EAC1F,UAAU;AAAA,EACV,WAAW;AAAA,EACX;AACF,MAAM;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,SAAgC,YAAY;AAE5E,QAAM,QAAoC,QAAQ,OAAO;AAAA,IACvD,UAAU;AAAA,IAAM;AAAA,IAAU;AAAA,EAC5B,IAAI,CAAC,UAAU,WAAW,CAAC;AAE3B,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MAEC,qBACG,WACA,WACE,OACA;AAAA;AAAA,EACR;AAEJ;;;ACjCA,SAAS,oBAAoB;AAItB,IAAM,2BAA2B,CAAC,WAAW,UAAU;AAC5D,SAAO,aAAa,8BAA8B,yBAAyB,QAAQ;AACrF;;;ACNA,SAAS,mBAAAA,wBAAuB;AAIhC,IAAM,qCAAqCA,iBAAkD;;;ACH7F,SAAgB,WAAAC,UAAS,YAAAC,iBAAgB;AAsBrC,gBAAAC,YAAA;AAZG,IAAM,sCAA0F,CAAC;AAAA,EACtG,UAAU;AAAA,EACV,WAAW;AAAA,EACX;AACF,MAAM;AACJ,QAAM,CAAC,UAAU,WAAW,IAAIC,UAAsC,YAAY;AAElF,QAAM,QAA0CC,SAAQ,OAAO;AAAA,IAC7D;AAAA,IAAU,UAAU;AAAA,IAAM;AAAA,EAC5B,IAAI,CAAC,UAAU,WAAW,CAAC;AAE3B,SACE,gBAAAF;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MAEC,qBACG,WACA,WACE,OACA;AAAA;AAAA,EACR;AAEJ;;;ACjCA,SAAS,gBAAAG,qBAAoB;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W,UAAU,kBAAkB;AACrC,iBAAS,OAAO,UAAU,EAAE,OAAO,CAAC,GAAG,MAAM,gDAAgD;AAC7F,aAAK,oBAAoB,IAAI,QAAQ,MAAM;AAAA,MAC7C;AACF,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ,SAAkB;AACxB,WAAO,KAAK,oBAAoB,IAAI,QAAQ,MAAM,KAAK,CAAC,GAAG,KAAK,QAAQ,OAAO,CAAC,EAAE,KAAK,YAAU,OAAO,UAAU,OAAO,CAAC;AAAA,EAC5H;AACF;",
|
|
6
|
+
"names": ["createContextEx", "useMemo", "useState", "jsx", "useState", "useMemo", "useContextEx", "useContextEx", "createContextEx", "useMemo", "jsx", "useMemo", "useContextEx", "useContextEx"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-payload-plugin-resolver",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -41,40 +41,38 @@
|
|
|
41
41
|
"README.md"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@xyo-network/react-payload-plugin": "~8.0.
|
|
44
|
+
"@xyo-network/react-payload-plugin": "~8.0.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@bitauth/libauth": "~3.0.0",
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@mui/
|
|
51
|
-
"@mui/
|
|
52
|
-
"@mui/system": "~9.0",
|
|
53
|
-
"@mui/x-tree-view": "~9.1",
|
|
48
|
+
"@mui/icons-material": "^9.0.1",
|
|
49
|
+
"@mui/material": "^9.0.1",
|
|
50
|
+
"@mui/system": "^9.0.1",
|
|
51
|
+
"@mui/x-tree-view": "~9.1.0",
|
|
54
52
|
"@opentelemetry/api": "^1.9.1",
|
|
55
53
|
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
56
54
|
"@react-spring/web": "~10.0.3",
|
|
57
55
|
"@scure/base": "~2.2.0",
|
|
58
|
-
"@textea/json-viewer": "~4.0.1",
|
|
59
56
|
"@types/react": "^19.2.14",
|
|
60
|
-
"@xylabs/pixel": "~5.1.
|
|
61
|
-
"@xylabs/react-async-effect": "~8.0",
|
|
62
|
-
"@xylabs/react-button": "~8.0",
|
|
63
|
-
"@xylabs/react-flexbox": "~8.0",
|
|
64
|
-
"@xylabs/react-hooks": "~8.0",
|
|
65
|
-
"@xylabs/react-identicon": "~8.0",
|
|
66
|
-
"@xylabs/react-link": "~8.0",
|
|
67
|
-
"@xylabs/react-promise": "~8.0",
|
|
68
|
-
"@xylabs/react-quick-tip-button": "~8.0",
|
|
69
|
-
"@xylabs/react-select": "~8.0",
|
|
70
|
-
"@xylabs/react-shared": "~8.0",
|
|
71
|
-
"@xylabs/react-theme": "~8.0",
|
|
72
|
-
"@xylabs/sdk-js": "^5.1.
|
|
73
|
-
"@xylabs/
|
|
74
|
-
"@xylabs/
|
|
75
|
-
"@xylabs/
|
|
76
|
-
"@xylabs/tsconfig
|
|
77
|
-
"@xylabs/tsconfig-
|
|
57
|
+
"@xylabs/pixel": "~5.1.3",
|
|
58
|
+
"@xylabs/react-async-effect": "~8.0.3",
|
|
59
|
+
"@xylabs/react-button": "~8.0.3",
|
|
60
|
+
"@xylabs/react-flexbox": "~8.0.3",
|
|
61
|
+
"@xylabs/react-hooks": "~8.0.3",
|
|
62
|
+
"@xylabs/react-identicon": "~8.0.3",
|
|
63
|
+
"@xylabs/react-link": "~8.0.3",
|
|
64
|
+
"@xylabs/react-promise": "~8.0.3",
|
|
65
|
+
"@xylabs/react-quick-tip-button": "~8.0.3",
|
|
66
|
+
"@xylabs/react-select": "~8.0.3",
|
|
67
|
+
"@xylabs/react-shared": "~8.0.3",
|
|
68
|
+
"@xylabs/react-theme": "~8.0.3",
|
|
69
|
+
"@xylabs/sdk-js": "^5.1.3",
|
|
70
|
+
"@xylabs/sdk-react": "~8.0.3",
|
|
71
|
+
"@xylabs/threads": "~5.1.3",
|
|
72
|
+
"@xylabs/toolchain": "~8.0.6",
|
|
73
|
+
"@xylabs/tsconfig": "^8.0.6",
|
|
74
|
+
"@xylabs/tsconfig-dom": "^8.0.6",
|
|
75
|
+
"@xylabs/tsconfig-react": "~8.0.6",
|
|
78
76
|
"@xyo-network/account": "~5.6.2",
|
|
79
77
|
"@xyo-network/account-model": "^5.6.3",
|
|
80
78
|
"@xyo-network/boundwitness-builder": "^5.6.2",
|
|
@@ -106,41 +104,42 @@
|
|
|
106
104
|
"bowser": "^2.14.1",
|
|
107
105
|
"buffer": "^6.0.3",
|
|
108
106
|
"chalk": "^5.6.2",
|
|
107
|
+
"clsx": "~2.1.1",
|
|
109
108
|
"debug": "~4.4.3",
|
|
110
|
-
"eslint": "^10.
|
|
109
|
+
"eslint": "^10.4.0",
|
|
111
110
|
"ethers": "^6.16.0",
|
|
112
111
|
"fast-deep-equal": "~3.1.3",
|
|
113
112
|
"hash-wasm": "~4.12.0",
|
|
114
|
-
"js-cookie": "~3.0.
|
|
113
|
+
"js-cookie": "~3.0.6",
|
|
115
114
|
"lru-cache": "^11.3.6",
|
|
116
115
|
"md5": "~2.3.0",
|
|
117
|
-
"mixpanel-browser": "~2.
|
|
116
|
+
"mixpanel-browser": "~2.79.0",
|
|
117
|
+
"numeral": "~2.0.6",
|
|
118
118
|
"observable-fns": "~0.6.1",
|
|
119
119
|
"pako": "^2.1.0",
|
|
120
120
|
"query-string": "~9.3.1",
|
|
121
121
|
"react": "^19.2.6",
|
|
122
122
|
"react-dom": "^19.2.6",
|
|
123
123
|
"react-is": "^19.2.6",
|
|
124
|
-
"react-router-dom": "^7.15.
|
|
124
|
+
"react-router-dom": "^7.15.1",
|
|
125
125
|
"recharts": "~3.8.1",
|
|
126
126
|
"spark-md5": "~3.0.2",
|
|
127
|
-
"typescript": "^
|
|
127
|
+
"typescript": "^6.0.3",
|
|
128
|
+
"viem": "^2.49.3",
|
|
128
129
|
"wasm-feature-detect": "~1.8.0",
|
|
129
|
-
"zod": "^4.4.3"
|
|
130
|
+
"zod": "^4.4.3",
|
|
131
|
+
"zustand": "~5.0.13"
|
|
130
132
|
},
|
|
131
133
|
"peerDependencies": {
|
|
132
134
|
"@bitauth/libauth": "~3.0",
|
|
133
|
-
"@
|
|
134
|
-
"@
|
|
135
|
-
"@mui/
|
|
136
|
-
"@mui/material": "~9.0",
|
|
137
|
-
"@mui/system": "~9.0",
|
|
135
|
+
"@mui/icons-material": "^9.0",
|
|
136
|
+
"@mui/material": "^9.0",
|
|
137
|
+
"@mui/system": "^9.0",
|
|
138
138
|
"@mui/x-tree-view": "~9.1",
|
|
139
139
|
"@opentelemetry/api": "^1.9",
|
|
140
140
|
"@opentelemetry/sdk-trace-base": "^2.7",
|
|
141
141
|
"@react-spring/web": "~10.0",
|
|
142
142
|
"@scure/base": "~2.2",
|
|
143
|
-
"@textea/json-viewer": "~4.0",
|
|
144
143
|
"@xylabs/pixel": "~5.1",
|
|
145
144
|
"@xylabs/react-async-effect": "~8.0",
|
|
146
145
|
"@xylabs/react-button": "~8.0",
|
|
@@ -154,6 +153,7 @@
|
|
|
154
153
|
"@xylabs/react-shared": "~8.0",
|
|
155
154
|
"@xylabs/react-theme": "~8.0",
|
|
156
155
|
"@xylabs/sdk-js": "^5.1",
|
|
156
|
+
"@xylabs/sdk-react": "~8.0",
|
|
157
157
|
"@xylabs/threads": "~5.1",
|
|
158
158
|
"@xyo-network/account": "~5.6",
|
|
159
159
|
"@xyo-network/account-model": "^5.6",
|
|
@@ -186,6 +186,7 @@
|
|
|
186
186
|
"bowser": "^2.14",
|
|
187
187
|
"buffer": "^6.0",
|
|
188
188
|
"chalk": "^5.6",
|
|
189
|
+
"clsx": "~2.1",
|
|
189
190
|
"debug": "~4.4",
|
|
190
191
|
"ethers": "^6.16",
|
|
191
192
|
"fast-deep-equal": "~3.1",
|
|
@@ -193,7 +194,8 @@
|
|
|
193
194
|
"js-cookie": "~3.0",
|
|
194
195
|
"lru-cache": "^11.3",
|
|
195
196
|
"md5": "~2.3",
|
|
196
|
-
"mixpanel-browser": "~2.
|
|
197
|
+
"mixpanel-browser": "~2.79",
|
|
198
|
+
"numeral": "~2.0",
|
|
197
199
|
"observable-fns": "~0.6",
|
|
198
200
|
"pako": "^2.1",
|
|
199
201
|
"query-string": "~9.3",
|
|
@@ -203,8 +205,10 @@
|
|
|
203
205
|
"react-router-dom": "^7.15",
|
|
204
206
|
"recharts": "~3.8",
|
|
205
207
|
"spark-md5": "~3.0",
|
|
208
|
+
"viem": "^2.48",
|
|
206
209
|
"wasm-feature-detect": "~1.8",
|
|
207
|
-
"zod": "^4.4"
|
|
210
|
+
"zod": "^4.4",
|
|
211
|
+
"zustand": "~5.0"
|
|
208
212
|
},
|
|
209
213
|
"publishConfig": {
|
|
210
214
|
"access": "public"
|