@xyo-network/dapp-template 4.2.4 → 4.2.6

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.
Files changed (81) hide show
  1. package/dist/neutral/{components/Dapp.d.ts → CustomDappPathToComponent.d.ts} +1 -1
  2. package/dist/neutral/CustomDappPathToComponent.d.ts.map +1 -0
  3. package/dist/neutral/Dapp.d.ts.map +1 -0
  4. package/dist/neutral/Params.d.ts.map +1 -1
  5. package/dist/neutral/components/host/DappHost.d.ts.map +1 -0
  6. package/dist/neutral/components/host/Routable.d.ts +4 -0
  7. package/dist/neutral/components/host/Routable.d.ts.map +1 -0
  8. package/dist/neutral/components/host/Routes.d.ts +4 -0
  9. package/dist/neutral/components/host/Routes.d.ts.map +1 -0
  10. package/dist/neutral/components/host/XyOsHost.d.ts.map +1 -0
  11. package/dist/neutral/components/host/index.d.ts +5 -0
  12. package/dist/neutral/components/host/index.d.ts.map +1 -0
  13. package/dist/neutral/components/index.d.ts +1 -1
  14. package/dist/neutral/components/index.d.ts.map +1 -1
  15. package/dist/neutral/helpers/registration/index.d.ts +1 -1
  16. package/dist/neutral/helpers/registration/index.d.ts.map +1 -1
  17. package/dist/neutral/helpers/registration/{useInitializeDapp.d.ts → useInitializeDappAdHoc.d.ts} +7 -2
  18. package/dist/neutral/helpers/registration/useInitializeDappAdHoc.d.ts.map +1 -0
  19. package/dist/neutral/index.d.ts +1 -2
  20. package/dist/neutral/index.d.ts.map +1 -1
  21. package/dist/neutral/index.mjs +82 -56
  22. package/dist/neutral/index.mjs.map +1 -1
  23. package/dist/node/{components/Dapp.d.ts → CustomDappPathToComponent.d.ts} +1 -1
  24. package/dist/node/CustomDappPathToComponent.d.ts.map +1 -0
  25. package/dist/node/Dapp.d.ts.map +1 -0
  26. package/dist/node/Params.d.ts.map +1 -1
  27. package/dist/node/components/host/DappHost.d.ts.map +1 -0
  28. package/dist/node/components/host/Routable.d.ts +4 -0
  29. package/dist/node/components/host/Routable.d.ts.map +1 -0
  30. package/dist/node/components/host/Routes.d.ts +4 -0
  31. package/dist/node/components/host/Routes.d.ts.map +1 -0
  32. package/dist/node/components/host/XyOsHost.d.ts.map +1 -0
  33. package/dist/node/components/host/index.d.ts +5 -0
  34. package/dist/node/components/host/index.d.ts.map +1 -0
  35. package/dist/node/components/index.d.ts +1 -1
  36. package/dist/node/components/index.d.ts.map +1 -1
  37. package/dist/node/helpers/registration/index.d.ts +1 -1
  38. package/dist/node/helpers/registration/index.d.ts.map +1 -1
  39. package/dist/node/helpers/registration/{useInitializeDapp.d.ts → useInitializeDappAdHoc.d.ts} +7 -2
  40. package/dist/node/helpers/registration/useInitializeDappAdHoc.d.ts.map +1 -0
  41. package/dist/node/index.d.ts +1 -2
  42. package/dist/node/index.d.ts.map +1 -1
  43. package/dist/node/index.mjs +82 -56
  44. package/dist/node/index.mjs.map +1 -1
  45. package/package.json +7 -8
  46. package/src/{window/Dapp.tsx → Dapp.tsx} +2 -2
  47. package/src/Params.ts +0 -2
  48. package/src/UiParams.ts +1 -1
  49. package/src/{DappHost.tsx → components/host/DappHost.tsx} +12 -10
  50. package/src/components/host/Routable.tsx +15 -0
  51. package/src/components/host/Routes.tsx +33 -0
  52. package/src/components/host/index.ts +4 -0
  53. package/src/components/index.ts +1 -1
  54. package/src/dapp.manifest.json +2 -7
  55. package/src/dapp.stories.tsx +5 -43
  56. package/src/helpers/registration/index.ts +1 -1
  57. package/src/helpers/registration/{useInitializeDapp.tsx → useInitializeDappAdHoc.tsx} +6 -1
  58. package/src/index.ts +1 -2
  59. package/dist/neutral/DappHost.d.ts.map +0 -1
  60. package/dist/neutral/XyOsHost.d.ts.map +0 -1
  61. package/dist/neutral/components/Dapp.d.ts.map +0 -1
  62. package/dist/neutral/helpers/registration/useInitializeDapp.d.ts.map +0 -1
  63. package/dist/neutral/window/Dapp.d.ts.map +0 -1
  64. package/dist/neutral/window/index.d.ts +0 -2
  65. package/dist/neutral/window/index.d.ts.map +0 -1
  66. package/dist/node/DappHost.d.ts.map +0 -1
  67. package/dist/node/XyOsHost.d.ts.map +0 -1
  68. package/dist/node/components/Dapp.d.ts.map +0 -1
  69. package/dist/node/helpers/registration/useInitializeDapp.d.ts.map +0 -1
  70. package/dist/node/window/Dapp.d.ts.map +0 -1
  71. package/dist/node/window/index.d.ts +0 -2
  72. package/dist/node/window/index.d.ts.map +0 -1
  73. package/src/window/index.ts +0 -1
  74. /package/dist/neutral/{window/Dapp.d.ts → Dapp.d.ts} +0 -0
  75. /package/dist/neutral/{DappHost.d.ts → components/host/DappHost.d.ts} +0 -0
  76. /package/dist/neutral/{XyOsHost.d.ts → components/host/XyOsHost.d.ts} +0 -0
  77. /package/dist/node/{window/Dapp.d.ts → Dapp.d.ts} +0 -0
  78. /package/dist/node/{DappHost.d.ts → components/host/DappHost.d.ts} +0 -0
  79. /package/dist/node/{XyOsHost.d.ts → components/host/XyOsHost.d.ts} +0 -0
  80. /package/src/{components/Dapp.tsx → CustomDappPathToComponent.tsx} +0 -0
  81. /package/src/{XyOsHost.tsx → components/host/XyOsHost.tsx} +0 -0
@@ -1,42 +1,10 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
- // src/dapp.manifest.json
5
- var dapp_manifest_default = {
6
- $schema: "https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/compilations/dapp-package-manifest-schema.json",
7
- nodes: [
8
- {
9
- config: {
10
- accountPath: "0'",
11
- name: "Node",
12
- schema: "network.xyo.node.config"
13
- },
14
- modules: {
15
- private: [],
16
- public: [
17
- {
18
- config: {
19
- accountPath: "1'",
20
- name: "DappArchivist",
21
- dbName: "DappArchivist",
22
- storeName: "payloads",
23
- schema: "network.xyo.archivist.config",
24
- labels: {
25
- "network.xyo.archivist.persistence.scope": "device"
26
- }
27
- }
28
- }
29
- ]
30
- }
31
- }
32
- ],
33
- schema: "network.xyo.manifest.package.dapp"
34
- };
35
-
36
- // src/DappHost.tsx
4
+ // src/components/host/DappHost.tsx
37
5
  import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
38
6
  import { DappRendered } from "@xyo-network/os-react-runtime";
39
- import React2, { useMemo as useMemo2 } from "react";
7
+ import React2 from "react";
40
8
 
41
9
  // src/helpers/registration/DappInitializer.ts
42
10
  import { assertEx } from "@xylabs/assert";
@@ -76,10 +44,15 @@ var DappInitializer = class {
76
44
  }
77
45
  };
78
46
 
79
- // src/helpers/registration/useInitializeDapp.tsx
47
+ // src/helpers/registration/useInitializeDappAdHoc.tsx
80
48
  import { usePromise } from "@xylabs/react-promise";
81
49
  import { useDappMenu, useManageDappInjectableParamsFromRoute, useManageDappPathFromRoute, useXyOsUiContext } from "@xyo-network/os-react-runtime";
82
- var useInitializeDapp = /* @__PURE__ */ __name((dapp) => {
50
+ var dappState = {
51
+ active: true,
52
+ minimized: false,
53
+ closed: false
54
+ };
55
+ var useInitializeDappAdHoc = /* @__PURE__ */ __name((dapp) => {
83
56
  const xyOs = useXyOsUiContext();
84
57
  const [installedDapp, nodeCreateError] = usePromise(async () => {
85
58
  if (xyOs && dapp) {
@@ -105,6 +78,7 @@ var useInitializeDapp = /* @__PURE__ */ __name((dapp) => {
105
78
  return {
106
79
  context,
107
80
  dappMenu,
81
+ dappState,
108
82
  dappWallet,
109
83
  errors: [
110
84
  routingError,
@@ -112,9 +86,9 @@ var useInitializeDapp = /* @__PURE__ */ __name((dapp) => {
112
86
  ...injectableErrors
113
87
  ].filter(Boolean)
114
88
  };
115
- }, "useInitializeDapp");
89
+ }, "useInitializeDappAdHoc");
116
90
 
117
- // src/XyOsHost.tsx
91
+ // src/components/host/XyOsHost.tsx
118
92
  import { Typography } from "@mui/material";
119
93
  import { FlexCol } from "@xylabs/react-flexbox";
120
94
  import { usePromise as usePromise2 } from "@xylabs/react-promise";
@@ -159,19 +133,14 @@ var XyOsHost = /* @__PURE__ */ __name(({ children, eventBus, kernel, locator: lo
159
133
  }, children) : /* @__PURE__ */ React.createElement(FlexCol, null, /* @__PURE__ */ React.createElement(Typography, null, "wallet:", walletToUse ? "ready" : "loading"), /* @__PURE__ */ React.createElement(Typography, null, "kernel:", kernelToUse ? "ready" : "loading"), /* @__PURE__ */ React.createElement(Typography, null, "os:", os ? "ready" : "loading"), /* @__PURE__ */ React.createElement(Typography, null, "os-error:", error?.message));
160
134
  }, "XyOsHost");
161
135
 
162
- // src/DappHost.tsx
136
+ // src/components/host/DappHost.tsx
163
137
  var DappHostInner = /* @__PURE__ */ __name(({ dapp }) => {
164
- const { context, dappMenu, dappWallet, errors } = useInitializeDapp(dapp);
165
- const dappState = useMemo2(() => ({
166
- active: true,
167
- minimized: false,
168
- closed: false
169
- }), []);
138
+ const { context, dappMenu, dappState: dappState2, dappWallet, errors } = useInitializeDappAdHoc(dapp);
170
139
  return /* @__PURE__ */ React2.createElement(FlexCol2, null, /* @__PURE__ */ React2.createElement(DappRendered, {
171
140
  context,
172
141
  dapp,
173
142
  dappMenuProperties: dappMenu,
174
- dappState,
143
+ dappState: dappState2,
175
144
  dappWallet,
176
145
  errors
177
146
  }));
@@ -180,8 +149,64 @@ var DappHost = /* @__PURE__ */ __name(({ dapp }) => /* @__PURE__ */ React2.creat
180
149
  dapp
181
150
  })), "DappHost");
182
151
 
152
+ // src/components/host/Routable.tsx
153
+ import React4 from "react";
154
+ import { BrowserRouter } from "react-router-dom";
155
+
156
+ // src/components/host/Routes.tsx
157
+ import React3 from "react";
158
+ import { Route, Routes } from "react-router-dom";
159
+ var DappRoutes = /* @__PURE__ */ __name((args) => /* @__PURE__ */ React3.createElement(Routes, null, /* @__PURE__ */ React3.createElement(Route, {
160
+ path: "/",
161
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
162
+ }), /* @__PURE__ */ React3.createElement(Route, {
163
+ path: "/:dappName",
164
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
165
+ }), /* @__PURE__ */ React3.createElement(Route, {
166
+ path: "/:dappName/:path/*",
167
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
168
+ }), /* @__PURE__ */ React3.createElement(Route, {
169
+ path: "*",
170
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
171
+ })), "DappRoutes");
172
+
173
+ // src/components/host/Routable.tsx
174
+ var RoutableDapp = /* @__PURE__ */ __name(({ dapp }) => {
175
+ return /* @__PURE__ */ React4.createElement(BrowserRouter, null, /* @__PURE__ */ React4.createElement(DappRoutes, {
176
+ dapp
177
+ }), /* @__PURE__ */ React4.createElement(DappHost, {
178
+ dapp
179
+ }));
180
+ }, "RoutableDapp");
181
+
182
+ // src/dapp.manifest.json
183
+ var dapp_manifest_default = {
184
+ $schema: "https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/compilations/dapp-package-manifest-schema.json",
185
+ nodes: [
186
+ {
187
+ config: {
188
+ accountPath: "0'",
189
+ name: "CustomDappNode",
190
+ schema: "network.xyo.node.config"
191
+ },
192
+ modules: {
193
+ private: [],
194
+ public: [
195
+ {
196
+ config: {
197
+ accountPath: "1'",
198
+ name: "DappArchivist",
199
+ schema: "network.xyo.archivist.config"
200
+ }
201
+ }
202
+ ]
203
+ }
204
+ }
205
+ ],
206
+ schema: "network.xyo.manifest.package.dapp"
207
+ };
208
+
183
209
  // src/Params.ts
184
- import { IndexedDbArchivist } from "@xyo-network/archivist-indexeddb";
185
210
  import { ModuleFactoryLocator as ModuleFactoryLocator2 } from "@xyo-network/module-factory-locator";
186
211
 
187
212
  // src/icon/Icon.tsx
@@ -232,7 +257,6 @@ var CustomDappIconSvg = `
232
257
 
233
258
  // src/Params.ts
234
259
  var locator = new ModuleFactoryLocator2();
235
- locator.register(IndexedDbArchivist);
236
260
  var CustomDappParams = {
237
261
  iconSvg: CustomDappIconSvg,
238
262
  locator
@@ -295,28 +319,28 @@ var CustomDappMenuPayloads = [
295
319
  CustomDappMenuConfig
296
320
  ];
297
321
 
298
- // src/window/Dapp.tsx
322
+ // src/Dapp.tsx
299
323
  import { ErrorRender } from "@xylabs/react-error";
300
324
  import { DappPathSwitcher, useAddDappMenuItems } from "@xyo-network/os-react-runtime";
301
- import React4 from "react";
325
+ import React6 from "react";
302
326
 
303
- // src/components/Dapp.tsx
327
+ // src/CustomDappPathToComponent.tsx
304
328
  import { FlexRow } from "@xylabs/react-flexbox";
305
- import React3 from "react";
329
+ import React5 from "react";
306
330
  var CustomDappPathToComponent = [
307
331
  {
308
- component: /* @__PURE__ */ React3.createElement(FlexRow, null),
332
+ component: /* @__PURE__ */ React5.createElement(FlexRow, null),
309
333
  path: "home"
310
334
  }
311
335
  ];
312
336
 
313
- // src/window/Dapp.tsx
337
+ // src/Dapp.tsx
314
338
  var CustomDapp = /* @__PURE__ */ __name(() => {
315
339
  const { menuConfig, path, error } = useAddDappMenuItems(CustomDappMenuPayloads);
316
- return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(ErrorRender, {
340
+ return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(ErrorRender, {
317
341
  error,
318
342
  scope: "CustomDapp"
319
- }), /* @__PURE__ */ React4.createElement(DappPathSwitcher, {
343
+ }), /* @__PURE__ */ React6.createElement(DappPathSwitcher, {
320
344
  activePath: path?.path ?? menuConfig?.defaultPath,
321
345
  pathToComponent: CustomDappPathToComponent
322
346
  }));
@@ -341,6 +365,8 @@ export {
341
365
  DappHost,
342
366
  DappHostInner,
343
367
  DappPayloads,
368
+ DappRoutes,
369
+ RoutableDapp,
344
370
  XyOsHost,
345
371
  dapp_manifest_default as accountsDappManifest
346
372
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/dapp.manifest.json","../../src/DappHost.tsx","../../src/helpers/registration/DappInitializer.ts","../../src/helpers/registration/useInitializeDapp.tsx","../../src/XyOsHost.tsx","../../src/Params.ts","../../src/icon/Icon.tsx","../../src/Payloads.ts","../../src/window/Dapp.tsx","../../src/components/Dapp.tsx","../../src/UiParams.ts"],"sourcesContent":["{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/compilations/dapp-package-manifest-schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"0'\",\n \"name\": \"Node\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [],\n \"public\": [\n {\n \"config\": {\n \"accountPath\": \"1'\",\n \"name\": \"DappArchivist\",\n \"dbName\": \"DappArchivist\",\n \"storeName\": \"payloads\",\n \"schema\": \"network.xyo.archivist.config\",\n \"labels\": {\n \"network.xyo.archivist.persistence.scope\": \"device\"\n }\n }\n }\n ]\n }\n }\n ],\n \"schema\": \"network.xyo.manifest.package.dapp\"\n}","import { FlexCol } from '@xylabs/react-flexbox'\nimport type { RegisteredReactDapp } from '@xyo-network/os-react-model'\nimport type { DappState } from '@xyo-network/os-react-runtime'\nimport { DappRendered } from '@xyo-network/os-react-runtime'\nimport React, { useMemo } from 'react'\n\nimport { useInitializeDapp } from './helpers/index.ts'\nimport { XyOsHost } from './XyOsHost.tsx'\n\nexport interface DappHostProps {\n dapp: RegisteredReactDapp\n}\n\nexport const DappHostInner: React.FC<DappHostProps> = ({ dapp }) => {\n const {\n context, dappMenu, dappWallet, errors,\n } = useInitializeDapp(dapp)\n\n const dappState: DappState = useMemo(() => ({\n active: true, minimized: false, closed: false,\n }), [])\n\n return (\n <FlexCol>\n <DappRendered context={context} dapp={dapp} dappMenuProperties={dappMenu} dappState={dappState} dappWallet={dappWallet} errors={errors} />\n </FlexCol>\n )\n}\n\nexport const DappHost: React.FC<DappHostProps> = ({ dapp }) => (\n <XyOsHost>\n <DappHostInner dapp={dapp} />\n </XyOsHost>\n)\n","import { assertEx } from '@xylabs/assert'\nimport type { WindowDappNodeSet, XyOsContext } from '@xyo-network/os-model'\nimport type { RegisteredReactDapp } from '@xyo-network/os-react-model'\nimport { DappSeedPhraseRepository, RunningDappCache } from '@xyo-network/os-runtime'\n\nexport interface DappInitializerConfig {\n allowedNames: string[]\n dapp: RegisteredReactDapp\n xnsNetwork: string | undefined\n xnsNodeUrl: string | undefined\n xyOs: XyOsContext\n}\n\nexport class DappInitializer {\n private _config: DappInitializerConfig\n\n constructor(config: DappInitializerConfig) {\n this._config = config\n }\n\n get config() {\n return assertEx(this._config, () => new Error('Options not set'))\n }\n\n async install(): Promise<WindowDappNodeSet> {\n const dappWithWalletId = await this.installDappWallet()\n\n return await this.initializeDappContext(dappWithWalletId)\n }\n\n private async initializeDappContext(dappWithWalletId: RegisteredReactDapp): Promise<WindowDappNodeSet> {\n const {\n allowedNames, xnsNetwork, xnsNodeUrl, xyOs,\n } = this.config\n\n return await RunningDappCache.findOrCreate(dappWithWalletId, xyOs, allowedNames ?? [], xnsNodeUrl, xnsNetwork)\n }\n\n private async installDappWallet(): Promise<RegisteredReactDapp> {\n const { xyOs, dapp } = this.config\n const dappSeedPhraseRepository = new DappSeedPhraseRepository(xyOs, [dapp.config.name])\n const walletId = await dappSeedPhraseRepository.findOrCreate(dapp.config.name)\n\n // Update the dapp with the walletId\n return {\n ...dapp,\n config: {\n ...dapp.config,\n walletId,\n },\n }\n }\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { RegisteredReactDapp } from '@xyo-network/os-react-model'\nimport {\n useDappMenu, useManageDappInjectableParamsFromRoute, useManageDappPathFromRoute, useXyOsUiContext,\n} from '@xyo-network/os-react-runtime'\n\nimport { DappInitializer } from './DappInitializer.ts'\n\nexport const useInitializeDapp = (dapp: RegisteredReactDapp) => {\n const xyOs = useXyOsUiContext()\n\n const [installedDapp, nodeCreateError] = usePromise(async () => {\n if (xyOs && dapp) {\n const installer = new DappInitializer({\n allowedNames: [dapp.config.name],\n dapp,\n xnsNetwork: undefined,\n xnsNodeUrl: undefined,\n xyOs,\n })\n return await installer.install()\n }\n }, [xyOs, dapp])\n\n const { dappWallet, context } = installedDapp ?? {}\n\n // support for routing\n const routingError = useManageDappPathFromRoute(context, dapp.config.name)\n const injectableErrors = useManageDappInjectableParamsFromRoute(context)\n\n const dappMenu = useDappMenu(context, dapp.config.name)\n\n return {\n context,\n dappMenu,\n dappWallet,\n errors: [routingError, nodeCreateError, ...injectableErrors].filter(Boolean),\n }\n}\n","import { Typography } from '@mui/material'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { HDWallet, type WalletInstance } from '@xyo-network/account'\nimport { Kernel } from '@xyo-network/kernel'\nimport type { KernelExternal } from '@xyo-network/kernel-model'\nimport { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'\nimport { XyOsUiContextProvider } from '@xyo-network/os-react-runtime'\nimport { EventBus, XyOs } from '@xyo-network/os-runtime'\nimport React, { useMemo } from 'react'\n\nexport interface XyOsHostProps {\n children?: React.ReactNode\n eventBus?: EventBus\n kernel?: KernelExternal\n locator?: ModuleFactoryLocator\n wallet?: WalletInstance\n}\n\nexport const XyOsHost: React.FC<XyOsHostProps> = ({\n children, eventBus, kernel, locator, wallet,\n}) => {\n const [walletToUse] = usePromise(async () => wallet ?? await HDWallet.random(), [wallet])\n const eventBusToUse: EventBus = useMemo(() => eventBus ?? new EventBus(), [kernel])\n const kernelToUse: KernelExternal = useMemo(() => kernel ?? new Kernel(), [kernel])\n const locatorToUse = useMemo(() => locator ?? new ModuleFactoryLocator(), [locator])\n\n const [os, error] = usePromise(async () => {\n if (walletToUse && kernelToUse && eventBusToUse && locatorToUse) {\n const os = new XyOs({\n kernel: kernelToUse, eventBus: new EventBus(), locator: locatorToUse,\n })\n await os.boot(walletToUse, locatorToUse)\n return os\n }\n }, [kernelToUse, walletToUse, locator, eventBusToUse, locatorToUse])\n\n return os\n ? <XyOsUiContextProvider value={os}>{children}</XyOsUiContextProvider>\n : (\n <FlexCol>\n <Typography>\n wallet:\n {walletToUse ? 'ready' : 'loading'}\n </Typography>\n <Typography>\n kernel:\n {kernelToUse ? 'ready' : 'loading'}\n </Typography>\n <Typography>\n os:\n {os ? 'ready' : 'loading'}\n </Typography>\n <Typography>\n os-error:\n {error?.message}\n </Typography>\n </FlexCol>\n )\n}\n","import { IndexedDbArchivist } from '@xyo-network/archivist-indexeddb'\nimport { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'\nimport type { UnregisteredDapp } from '@xyo-network/os-model'\n\nimport { CustomDappIconSvg } from './icon/index.ts'\n\nconst locator = new ModuleFactoryLocator()\nlocator.register(IndexedDbArchivist)\n\nexport const CustomDappParams: UnregisteredDapp['params'] = {\n iconSvg: CustomDappIconSvg,\n locator,\n}\n\nexport { CustomDappParams as default }\n","/* eslint-disable @stylistic/max-len */\nexport const CustomDappIconSvg = `\n<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 40\">\n <path\n fill=\"transparent\"\n d=\"M6.44,27.12c-.78,0-1.44.28-2,.83-.55.55-.83,1.21-.83,1.99s.28,1.44.83,2c.55.55,1.21.83,1.99.83s1.44-.28,2-.83c.55-.55.83-1.21.83-1.99s-.28-1.44-.83-2c-.55-.55-1.21-.83-1.99-.83Z\"\n />\n <path\n fill=\"transparent\"\n d=\"M18.01,27.91c-.55.55-.83,1.22-.83,1.99s.28,1.44.83,2c.55.55,1.21.83,1.99.83s1.44-.28,2-.83c.55-.55.83-1.21.83-1.99s-.28-1.44-.83-2c-.55-.55-1.21-.83-1.99-.83s-1.44.28-2,.83Z\"\n />\n <path\n fill=\"transparent\"\n d=\"M33.56,27.12c-.78,0-1.44.28-2,.83-.55.55-.83,1.21-.83,1.99s.28,1.44.83,2c.55.55,1.21.83,1.99.83s1.44-.28,2-.83c.55-.55.83-1.21.83-1.99s-.28-1.44-.83-2c-.55-.55-1.21-.83-1.99-.83Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M36.55,26.94c-.82-.82-1.82-1.23-3-1.23-.32,0-.63.04-.93.11-.3.07-.59.17-.87.31l-5.87-8.09c-.18.03-.36.05-.56.05h-1.13l6.42,8.83c-.39.4-.7.85-.93,1.36-.23.51-.35,1.06-.35,1.66,0,1.18.41,2.17,1.23,3s1.82,1.23,3,1.23,2.17-.41,3-1.23,1.23-1.82,1.23-3-.41-2.17-1.23-3ZM35.55,31.93c-.55.55-1.22.83-2,.83s-1.44-.28-1.99-.83c-.55-.55-.83-1.22-.83-2s.28-1.44.83-1.99c.55-.55,1.22-.83,2-.83s1.44.28,1.99.83c.55.55.83,1.22.83,2s-.28,1.44-.83,1.99Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M19.29,25.73c-1,.16-1.84.64-2.52,1.42-.67.79-1.01,1.7-1.01,2.75,0,1.18.41,2.17,1.23,3,.82.82,1.82,1.23,3,1.23s2.17-.41,3-1.23c.82-.82,1.23-1.82,1.23-3,0-1.05-.34-1.97-1.01-2.74-.67-.78-1.51-1.25-2.52-1.43v-7.65h-1.41v7.65ZM22,27.91c.55.55.83,1.22.83,2s-.28,1.44-.83,1.99c-.55.55-1.22.83-2,.83s-1.44-.28-1.99-.83c-.55-.55-.83-1.22-.83-2s.28-1.44.83-1.99c.55-.55,1.22-.83,2-.83s1.44.28,1.99.83Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M14.1,18l-5.89,8.08c-.28-.13-.56-.22-.86-.28-.29-.06-.6-.09-.91-.09-1.18,0-2.17.41-3,1.23-.82.82-1.23,1.82-1.23,3s.41,2.17,1.23,3,1.82,1.23,3,1.23,2.17-.41,3-1.23,1.23-1.82,1.23-3c0-.6-.12-1.15-.36-1.66s-.56-.96-.95-1.36l6.45-8.83h-1c-.25,0-.48-.03-.7-.08ZM8.44,31.93c-.55.55-1.22.83-2,.83s-1.44-.28-1.99-.83c-.55-.55-.83-1.22-.83-2s.28-1.44.83-1.99c.55-.55,1.22-.83,2-.83s1.44.28,1.99.83c.55.55.83,1.22.83,2s-.28,1.44-.83,1.99Z\"\n />\n <path\n fill=\"transparent\"\n d=\"M20,12.91c1.26,0,2.46.19,3.61.56,1.15.37,2.23.88,3.23,1.54V4.86c0-.44-.15-.82-.46-1.12s-.68-.46-1.12-.46h-10.52c-.44,0-.82.15-1.12.46s-.46.68-.46,1.12v10.15c1-.66,2.08-1.17,3.23-1.54s2.36-.56,3.61-.56ZM17.7,5.83c.63-.63,1.4-.95,2.3-.95s1.66.32,2.3.95.95,1.4.95,2.3-.32,1.66-.95,2.3-1.4.95-2.3.95-1.66-.32-2.3-.95-.95-1.4-.95-2.3.32-1.66.95-2.3Z\"\n />\n <path\n fill=\"transparent\"\n d=\"M20,10.32c.6,0,1.12-.21,1.55-.64.43-.43.65-.94.65-1.55s-.22-1.12-.65-1.55c-.43-.43-.95-.65-1.55-.65s-1.12.22-1.55.65-.64.95-.64,1.55.21,1.12.64,1.55.94.64,1.55.64Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M20,11.37c.9,0,1.66-.32,2.3-.95s.95-1.4.95-2.3-.32-1.66-.95-2.3-1.4-.95-2.3-.95-1.66.32-2.3.95-.95,1.4-.95,2.3.32,1.66.95,2.3,1.4.95,2.3.95ZM18.45,6.58c.43-.43.95-.65,1.55-.65s1.12.22,1.55.65c.43.43.65.95.65,1.55s-.22,1.12-.65,1.55c-.43.43-.95.64-1.55.64s-1.12-.21-1.55-.64-.64-.95-.64-1.55.21-1.12.64-1.55Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M27.21,2.9c-.5-.5-1.15-.75-1.95-.75h-10.52c-.8,0-1.45.25-1.95.75-.5.5-.75,1.15-.75,1.95v10.52c0,.8.25,1.45.75,1.95.35.35.77.56,1.25.67.22.05.45.08.7.08h10.52c.2,0,.38-.02.56-.05.55-.09,1.01-.33,1.39-.71.5-.5.75-1.15.75-1.95V4.86c0-.8-.25-1.45-.75-1.95ZM25.93,16.74c-.26.14-.55.22-.86.22h-10.15s-.08-.01-.12-.01c-.25-.02-.5-.08-.74-.2-.28-.14-.45-.35-.5-.63.99-.7,2.03-1.22,3.12-1.57s2.19-.52,3.31-.52,2.27.18,3.4.55c1.13.36,2.18.88,3.16,1.54-.15.27-.36.48-.63.63ZM26.84,15.01c-1-.66-2.08-1.17-3.23-1.54-1.15-.37-2.36-.56-3.61-.56s-2.46.19-3.61.56-2.23.88-3.23,1.54V4.86c0-.44.15-.82.46-1.12s.68-.46,1.12-.46h10.52c.44,0,.82.15,1.12.46s.46.68.46,1.12v10.15Z\"\n />\n </svg>\n `\n","/* eslint-disable @stylistic/max-len */\nimport type {\n DappConfig,\n DappIcon,\n DappName,\n DappNavItem,\n DappNavMenuConfig,\n DappPackageManifestPayload,\n DappVersion,\n} from '@xyo-network/os-model'\nimport {\n DappConfigSchema,\n DappIconSchema,\n DappMode,\n DappNavItemSchema,\n DappNavMenuConfigSchema,\n} from '@xyo-network/os-model'\n\nimport dappManifest from './dapp.manifest.json' assert { type: 'json' }\n\nexport const CustomDappName: DappName = 'Custom Dapp' as const\n\nconst version: DappVersion = '1.0.0'\n\nexport const CustomDappConfig: DappConfig = {\n manifest: dappManifest as DappPackageManifestPayload,\n modes: [DappMode.Window],\n name: CustomDappName,\n schema: DappConfigSchema,\n sources: ['network.xyo.dapp.accounts.source'],\n version,\n}\n\nexport const CustomDappIcon: DappIcon = {\n active: false,\n installed: 'installed',\n name: CustomDappName,\n schema: DappIconSchema,\n type: 'system',\n version,\n}\n\nexport const DappPayloads = [CustomDappConfig, CustomDappIcon]\n\nexport type CustomDappMenuItemPaths = 'home' | 'settings'\n\nconst CustomDappMenuItems: DappNavItem<CustomDappMenuItemPaths>[] = [\n {\n path: 'home',\n primaryText: 'Home',\n schema: DappNavItemSchema,\n svgIcon: `\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 -960 960 960\" width=\"24\" fill=\"none\"><path fill=\"currentColor\" d=\"M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z\"/></svg>\n `,\n weight: 0,\n },\n {\n path: 'settings',\n primaryText: 'Settings',\n schema: DappNavItemSchema,\n svgIcon: `\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 -960 960 960\" width=\"24\" fill=\"none\"><path fill=\"currentColor\" d=\"M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z\"/></svg>\n `,\n weight: 0,\n },\n]\n\nconst CustomDappMenuConfig: DappNavMenuConfig = {\n defaultPath: 'home',\n schema: DappNavMenuConfigSchema,\n}\n\nexport const CustomDappMenuPayloads = [...CustomDappMenuItems, CustomDappMenuConfig]\n","import { ErrorRender } from '@xylabs/react-error'\nimport { DappPathSwitcher, useAddDappMenuItems } from '@xyo-network/os-react-runtime'\nimport React from 'react'\n\nimport { CustomDappPathToComponent } from '../components/index.ts'\nimport { CustomDappMenuPayloads } from '../Payloads.js'\n\nexport const CustomDapp = () => {\n const {\n menuConfig, path, error,\n } = useAddDappMenuItems(CustomDappMenuPayloads)\n\n return (\n <>\n <ErrorRender error={error} scope=\"CustomDapp\" />\n <DappPathSwitcher activePath={path?.path ?? menuConfig?.defaultPath} pathToComponent={CustomDappPathToComponent} />\n </>\n )\n}\n","import { FlexRow } from '@xylabs/react-flexbox'\nimport type { PathToComponent } from '@xyo-network/os-react-runtime'\nimport React from 'react'\n\nexport const CustomDappPathToComponent: PathToComponent[] = [\n {\n component: <FlexRow />,\n path: 'home',\n },\n]\n","import type { UnregisteredReactDapp } from '@xyo-network/os-react-model'\n\nimport { CustomDappParams } from './Params.js'\nimport { CustomDapp } from './window/index.ts'\n\nexport const CustomDappUiParams: UnregisteredReactDapp['params'] = {\n ...CustomDappParams,\n modes: { window: { component: CustomDapp } },\n}\n\nexport { CustomDappUiParams as default }\n"],"mappings":";;;;AAAA;AAAA,EACE,SAAW;AAAA,EACX,OAAS;AAAA,IACP;AAAA,MACE,QAAU;AAAA,QACR,aAAe;AAAA,QACf,MAAQ;AAAA,QACR,QAAU;AAAA,MACZ;AAAA,MACA,SAAW;AAAA,QACT,SAAW,CAAC;AAAA,QACZ,QAAU;AAAA,UACR;AAAA,YACE,QAAU;AAAA,cACR,aAAe;AAAA,cACf,MAAQ;AAAA,cACR,QAAU;AAAA,cACV,WAAa;AAAA,cACb,QAAU;AAAA,cACV,QAAU;AAAA,gBACR,2CAA2C;AAAA,cAC7C;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAU;AACZ;;;AC7BA,SAASA,WAAAA,gBAAe;AAGxB,SAASC,oBAAoB;AAC7B,OAAOC,UAASC,WAAAA,gBAAe;;;ACJ/B,SAASC,gBAAgB;AAGzB,SAASC,0BAA0BC,wBAAwB;AAUpD,IAAMC,kBAAN,MAAMA;EAbb,OAaaA;;;EACHC;EAERC,YAAYC,QAA+B;AACzC,SAAKF,UAAUE;EACjB;EAEA,IAAIA,SAAS;AACX,WAAOC,SAAS,KAAKH,SAAS,MAAM,IAAII,MAAM,iBAAA,CAAA;EAChD;EAEA,MAAMC,UAAsC;AAC1C,UAAMC,mBAAmB,MAAM,KAAKC,kBAAiB;AAErD,WAAO,MAAM,KAAKC,sBAAsBF,gBAAAA;EAC1C;EAEA,MAAcE,sBAAsBF,kBAAmE;AACrG,UAAM,EACJG,cAAcC,YAAYC,YAAYC,KAAI,IACxC,KAAKV;AAET,WAAO,MAAMW,iBAAiBC,aAAaR,kBAAkBM,MAAMH,gBAAgB,CAAA,GAAIE,YAAYD,UAAAA;EACrG;EAEA,MAAcH,oBAAkD;AAC9D,UAAM,EAAEK,MAAMG,KAAI,IAAK,KAAKb;AAC5B,UAAMc,2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AA+C;EAC1D;IACEC,WAAW,gBAAAF,OAAA,cAACD,SAAAA,IAAAA;IACZI,MAAM;EACR;;;;ADDK,IAAMC,aAAa,6BAAA;AACxB,QAAM,EACJC,YAAYC,MAAMC,MAAK,IACrBC,oBAAoBC,sBAAAA;AAExB,SACE,gBAAAC,OAAA,cAAAA,OAAA,UAAA,MACE,gBAAAA,OAAA,cAACC,aAAAA;IAAYJ;IAAcK,OAAM;MACjC,gBAAAF,OAAA,cAACG,kBAAAA;IAAiBC,YAAYR,MAAMA,QAAQD,YAAYU;IAAaC,iBAAiBC;;AAG5F,GAX0B;;;AEFnB,IAAMC,qBAAsD;EACjE,GAAGC;EACHC,OAAO;IAAEC,QAAQ;MAAEC,WAAWC;IAAW;EAAE;AAC7C;","names":["FlexCol","DappRendered","React","useMemo","assertEx","DappSeedPhraseRepository","RunningDappCache","DappInitializer","_config","constructor","config","assertEx","Error","install","dappWithWalletId","installDappWallet","initializeDappContext","allowedNames","xnsNetwork","xnsNodeUrl","xyOs","RunningDappCache","findOrCreate","dapp","dappSeedPhraseRepository","DappSeedPhraseRepository","name","walletId","usePromise","useDappMenu","useManageDappInjectableParamsFromRoute","useManageDappPathFromRoute","useXyOsUiContext","useInitializeDapp","dapp","xyOs","useXyOsUiContext","installedDapp","nodeCreateError","usePromise","installer","DappInitializer","allowedNames","config","name","xnsNetwork","undefined","xnsNodeUrl","install","dappWallet","context","routingError","useManageDappPathFromRoute","injectableErrors","useManageDappInjectableParamsFromRoute","dappMenu","useDappMenu","errors","filter","Boolean","Typography","FlexCol","usePromise","HDWallet","Kernel","ModuleFactoryLocator","XyOsUiContextProvider","EventBus","XyOs","React","useMemo","XyOsHost","children","eventBus","kernel","locator","wallet","walletToUse","usePromise","HDWallet","random","eventBusToUse","useMemo","EventBus","kernelToUse","Kernel","locatorToUse","ModuleFactoryLocator","os","error","XyOs","boot","XyOsUiContextProvider","value","FlexCol","Typography","message","DappHostInner","dapp","context","dappMenu","dappWallet","errors","useInitializeDapp","dappState","useMemo","active","minimized","closed","React","FlexCol","DappRendered","dappMenuProperties","DappHost","XyOsHost","IndexedDbArchivist","ModuleFactoryLocator","CustomDappIconSvg","locator","ModuleFactoryLocator","register","IndexedDbArchivist","CustomDappParams","iconSvg","CustomDappIconSvg","DappConfigSchema","DappIconSchema","DappMode","DappNavItemSchema","DappNavMenuConfigSchema","CustomDappName","version","CustomDappConfig","manifest","dappManifest","modes","DappMode","Window","name","schema","DappConfigSchema","sources","CustomDappIcon","active","installed","DappIconSchema","type","DappPayloads","CustomDappMenuItems","path","primaryText","DappNavItemSchema","svgIcon","weight","CustomDappMenuConfig","defaultPath","DappNavMenuConfigSchema","CustomDappMenuPayloads","ErrorRender","DappPathSwitcher","useAddDappMenuItems","React","FlexRow","React","CustomDappPathToComponent","component","path","CustomDapp","menuConfig","path","error","useAddDappMenuItems","CustomDappMenuPayloads","React","ErrorRender","scope","DappPathSwitcher","activePath","defaultPath","pathToComponent","CustomDappPathToComponent","CustomDappUiParams","CustomDappParams","modes","window","component","CustomDapp"]}
1
+ {"version":3,"sources":["../../src/components/host/DappHost.tsx","../../src/helpers/registration/DappInitializer.ts","../../src/helpers/registration/useInitializeDappAdHoc.tsx","../../src/components/host/XyOsHost.tsx","../../src/components/host/Routable.tsx","../../src/components/host/Routes.tsx","../../src/dapp.manifest.json","../../src/Params.ts","../../src/icon/Icon.tsx","../../src/Payloads.ts","../../src/Dapp.tsx","../../src/CustomDappPathToComponent.tsx","../../src/UiParams.ts"],"sourcesContent":["import { FlexCol } from '@xylabs/react-flexbox'\nimport type { RegisteredReactDapp } from '@xyo-network/os-react-model'\nimport { DappRendered } from '@xyo-network/os-react-runtime'\nimport React from 'react'\n\nimport { useInitializeDappAdHoc } from '../../helpers/index.ts'\nimport { XyOsHost } from './XyOsHost.tsx'\n\nexport interface DappHostProps {\n dapp: RegisteredReactDapp\n}\n\nexport const DappHostInner: React.FC<DappHostProps> = ({ dapp }) => {\n const {\n context, dappMenu, dappState, dappWallet, errors,\n } = useInitializeDappAdHoc(dapp)\n\n return (\n <FlexCol>\n <DappRendered\n context={context}\n dapp={dapp}\n dappMenuProperties={dappMenu}\n dappState={dappState}\n dappWallet={dappWallet}\n errors={errors}\n />\n </FlexCol>\n )\n}\n\nexport const DappHost: React.FC<DappHostProps> = ({ dapp }) => (\n <XyOsHost>\n <DappHostInner dapp={dapp} />\n </XyOsHost>\n)\n","import { assertEx } from '@xylabs/assert'\nimport type { WindowDappNodeSet, XyOsContext } from '@xyo-network/os-model'\nimport type { RegisteredReactDapp } from '@xyo-network/os-react-model'\nimport { DappSeedPhraseRepository, RunningDappCache } from '@xyo-network/os-runtime'\n\nexport interface DappInitializerConfig {\n allowedNames: string[]\n dapp: RegisteredReactDapp\n xnsNetwork: string | undefined\n xnsNodeUrl: string | undefined\n xyOs: XyOsContext\n}\n\nexport class DappInitializer {\n private _config: DappInitializerConfig\n\n constructor(config: DappInitializerConfig) {\n this._config = config\n }\n\n get config() {\n return assertEx(this._config, () => new Error('Options not set'))\n }\n\n async install(): Promise<WindowDappNodeSet> {\n const dappWithWalletId = await this.installDappWallet()\n\n return await this.initializeDappContext(dappWithWalletId)\n }\n\n private async initializeDappContext(dappWithWalletId: RegisteredReactDapp): Promise<WindowDappNodeSet> {\n const {\n allowedNames, xnsNetwork, xnsNodeUrl, xyOs,\n } = this.config\n\n return await RunningDappCache.findOrCreate(dappWithWalletId, xyOs, allowedNames ?? [], xnsNodeUrl, xnsNetwork)\n }\n\n private async installDappWallet(): Promise<RegisteredReactDapp> {\n const { xyOs, dapp } = this.config\n const dappSeedPhraseRepository = new DappSeedPhraseRepository(xyOs, [dapp.config.name])\n const walletId = await dappSeedPhraseRepository.findOrCreate(dapp.config.name)\n\n // Update the dapp with the walletId\n return {\n ...dapp,\n config: {\n ...dapp.config,\n walletId,\n },\n }\n }\n}\n","import { usePromise } from '@xylabs/react-promise'\nimport type { RegisteredReactDapp } from '@xyo-network/os-react-model'\nimport {\n useDappMenu, useManageDappInjectableParamsFromRoute, useManageDappPathFromRoute, useXyOsUiContext,\n} from '@xyo-network/os-react-runtime'\n\nimport { DappInitializer } from './DappInitializer.ts'\n\nconst dappState = {\n active: true, minimized: false, closed: false,\n}\n\nexport const useInitializeDappAdHoc = (dapp: RegisteredReactDapp) => {\n const xyOs = useXyOsUiContext()\n\n const [installedDapp, nodeCreateError] = usePromise(async () => {\n if (xyOs && dapp) {\n const installer = new DappInitializer({\n allowedNames: [dapp.config.name],\n dapp,\n xnsNetwork: undefined,\n xnsNodeUrl: undefined,\n xyOs,\n })\n return await installer.install()\n }\n }, [xyOs, dapp])\n\n const { dappWallet, context } = installedDapp ?? {}\n\n // support for routing\n const routingError = useManageDappPathFromRoute(context, dapp.config.name)\n const injectableErrors = useManageDappInjectableParamsFromRoute(context)\n\n const dappMenu = useDappMenu(context, dapp.config.name)\n\n return {\n context,\n dappMenu,\n dappState,\n dappWallet,\n errors: [routingError, nodeCreateError, ...injectableErrors].filter(Boolean),\n }\n}\n","import { Typography } from '@mui/material'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport { usePromise } from '@xylabs/react-promise'\nimport { HDWallet, type WalletInstance } from '@xyo-network/account'\nimport { Kernel } from '@xyo-network/kernel'\nimport type { KernelExternal } from '@xyo-network/kernel-model'\nimport { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'\nimport { XyOsUiContextProvider } from '@xyo-network/os-react-runtime'\nimport { EventBus, XyOs } from '@xyo-network/os-runtime'\nimport React, { useMemo } from 'react'\n\nexport interface XyOsHostProps {\n children?: React.ReactNode\n eventBus?: EventBus\n kernel?: KernelExternal\n locator?: ModuleFactoryLocator\n wallet?: WalletInstance\n}\n\nexport const XyOsHost: React.FC<XyOsHostProps> = ({\n children, eventBus, kernel, locator, wallet,\n}) => {\n const [walletToUse] = usePromise(async () => wallet ?? await HDWallet.random(), [wallet])\n const eventBusToUse: EventBus = useMemo(() => eventBus ?? new EventBus(), [kernel])\n const kernelToUse: KernelExternal = useMemo(() => kernel ?? new Kernel(), [kernel])\n const locatorToUse = useMemo(() => locator ?? new ModuleFactoryLocator(), [locator])\n\n const [os, error] = usePromise(async () => {\n if (walletToUse && kernelToUse && eventBusToUse && locatorToUse) {\n const os = new XyOs({\n kernel: kernelToUse, eventBus: new EventBus(), locator: locatorToUse,\n })\n await os.boot(walletToUse, locatorToUse)\n return os\n }\n }, [kernelToUse, walletToUse, locator, eventBusToUse, locatorToUse])\n\n return os\n ? <XyOsUiContextProvider value={os}>{children}</XyOsUiContextProvider>\n : (\n <FlexCol>\n <Typography>\n wallet:\n {walletToUse ? 'ready' : 'loading'}\n </Typography>\n <Typography>\n kernel:\n {kernelToUse ? 'ready' : 'loading'}\n </Typography>\n <Typography>\n os:\n {os ? 'ready' : 'loading'}\n </Typography>\n <Typography>\n os-error:\n {error?.message}\n </Typography>\n </FlexCol>\n )\n}\n","import React from 'react'\nimport { BrowserRouter } from 'react-router-dom'\n\nimport type { DappHostProps } from './DappHost.tsx'\nimport { DappHost } from './DappHost.tsx'\nimport { DappRoutes } from './Routes.tsx'\n\nexport const RoutableDapp: React.FC<DappHostProps> = ({ dapp }) => {\n return (\n <BrowserRouter>\n <DappRoutes dapp={dapp} />\n <DappHost dapp={dapp} />\n </BrowserRouter>\n )\n}\n","import React from 'react'\nimport { Route, Routes } from 'react-router-dom'\n\nimport { DappHost, type DappHostProps } from './DappHost.tsx'\n\nexport const DappRoutes: React.FC<DappHostProps> = args => (\n <Routes>\n <Route\n path=\"/\"\n element={(\n <DappHost {...args} />\n )}\n />\n <Route\n path=\"/:dappName\"\n element={(\n <DappHost {...args} />\n )}\n />\n <Route\n path=\"/:dappName/:path/*\"\n element={(\n <DappHost {...args} />\n )}\n />\n <Route\n path=\"*\"\n element={(\n <DappHost {...args} />\n )}\n />\n </Routes>\n)\n","{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/compilations/dapp-package-manifest-schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"0'\",\n \"name\": \"CustomDappNode\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [],\n \"public\": [\n {\n \"config\": {\n \"accountPath\": \"1'\",\n \"name\": \"DappArchivist\",\n \"schema\": \"network.xyo.archivist.config\"\n }\n }\n ]\n }\n }\n ],\n \"schema\": \"network.xyo.manifest.package.dapp\"\n}","import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'\nimport type { UnregisteredDapp } from '@xyo-network/os-model'\n\nimport { CustomDappIconSvg } from './icon/index.ts'\n\nconst locator = new ModuleFactoryLocator()\n\nexport const CustomDappParams: UnregisteredDapp['params'] = {\n iconSvg: CustomDappIconSvg,\n locator,\n}\n\nexport { CustomDappParams as default }\n","/* eslint-disable @stylistic/max-len */\nexport const CustomDappIconSvg = `\n<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 40\">\n <path\n fill=\"transparent\"\n d=\"M6.44,27.12c-.78,0-1.44.28-2,.83-.55.55-.83,1.21-.83,1.99s.28,1.44.83,2c.55.55,1.21.83,1.99.83s1.44-.28,2-.83c.55-.55.83-1.21.83-1.99s-.28-1.44-.83-2c-.55-.55-1.21-.83-1.99-.83Z\"\n />\n <path\n fill=\"transparent\"\n d=\"M18.01,27.91c-.55.55-.83,1.22-.83,1.99s.28,1.44.83,2c.55.55,1.21.83,1.99.83s1.44-.28,2-.83c.55-.55.83-1.21.83-1.99s-.28-1.44-.83-2c-.55-.55-1.21-.83-1.99-.83s-1.44.28-2,.83Z\"\n />\n <path\n fill=\"transparent\"\n d=\"M33.56,27.12c-.78,0-1.44.28-2,.83-.55.55-.83,1.21-.83,1.99s.28,1.44.83,2c.55.55,1.21.83,1.99.83s1.44-.28,2-.83c.55-.55.83-1.21.83-1.99s-.28-1.44-.83-2c-.55-.55-1.21-.83-1.99-.83Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M36.55,26.94c-.82-.82-1.82-1.23-3-1.23-.32,0-.63.04-.93.11-.3.07-.59.17-.87.31l-5.87-8.09c-.18.03-.36.05-.56.05h-1.13l6.42,8.83c-.39.4-.7.85-.93,1.36-.23.51-.35,1.06-.35,1.66,0,1.18.41,2.17,1.23,3s1.82,1.23,3,1.23,2.17-.41,3-1.23,1.23-1.82,1.23-3-.41-2.17-1.23-3ZM35.55,31.93c-.55.55-1.22.83-2,.83s-1.44-.28-1.99-.83c-.55-.55-.83-1.22-.83-2s.28-1.44.83-1.99c.55-.55,1.22-.83,2-.83s1.44.28,1.99.83c.55.55.83,1.22.83,2s-.28,1.44-.83,1.99Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M19.29,25.73c-1,.16-1.84.64-2.52,1.42-.67.79-1.01,1.7-1.01,2.75,0,1.18.41,2.17,1.23,3,.82.82,1.82,1.23,3,1.23s2.17-.41,3-1.23c.82-.82,1.23-1.82,1.23-3,0-1.05-.34-1.97-1.01-2.74-.67-.78-1.51-1.25-2.52-1.43v-7.65h-1.41v7.65ZM22,27.91c.55.55.83,1.22.83,2s-.28,1.44-.83,1.99c-.55.55-1.22.83-2,.83s-1.44-.28-1.99-.83c-.55-.55-.83-1.22-.83-2s.28-1.44.83-1.99c.55-.55,1.22-.83,2-.83s1.44.28,1.99.83Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M14.1,18l-5.89,8.08c-.28-.13-.56-.22-.86-.28-.29-.06-.6-.09-.91-.09-1.18,0-2.17.41-3,1.23-.82.82-1.23,1.82-1.23,3s.41,2.17,1.23,3,1.82,1.23,3,1.23,2.17-.41,3-1.23,1.23-1.82,1.23-3c0-.6-.12-1.15-.36-1.66s-.56-.96-.95-1.36l6.45-8.83h-1c-.25,0-.48-.03-.7-.08ZM8.44,31.93c-.55.55-1.22.83-2,.83s-1.44-.28-1.99-.83c-.55-.55-.83-1.22-.83-2s.28-1.44.83-1.99c.55-.55,1.22-.83,2-.83s1.44.28,1.99.83c.55.55.83,1.22.83,2s-.28,1.44-.83,1.99Z\"\n />\n <path\n fill=\"transparent\"\n d=\"M20,12.91c1.26,0,2.46.19,3.61.56,1.15.37,2.23.88,3.23,1.54V4.86c0-.44-.15-.82-.46-1.12s-.68-.46-1.12-.46h-10.52c-.44,0-.82.15-1.12.46s-.46.68-.46,1.12v10.15c1-.66,2.08-1.17,3.23-1.54s2.36-.56,3.61-.56ZM17.7,5.83c.63-.63,1.4-.95,2.3-.95s1.66.32,2.3.95.95,1.4.95,2.3-.32,1.66-.95,2.3-1.4.95-2.3.95-1.66-.32-2.3-.95-.95-1.4-.95-2.3.32-1.66.95-2.3Z\"\n />\n <path\n fill=\"transparent\"\n d=\"M20,10.32c.6,0,1.12-.21,1.55-.64.43-.43.65-.94.65-1.55s-.22-1.12-.65-1.55c-.43-.43-.95-.65-1.55-.65s-1.12.22-1.55.65-.64.95-.64,1.55.21,1.12.64,1.55.94.64,1.55.64Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M20,11.37c.9,0,1.66-.32,2.3-.95s.95-1.4.95-2.3-.32-1.66-.95-2.3-1.4-.95-2.3-.95-1.66.32-2.3.95-.95,1.4-.95,2.3.32,1.66.95,2.3,1.4.95,2.3.95ZM18.45,6.58c.43-.43.95-.65,1.55-.65s1.12.22,1.55.65c.43.43.65.95.65,1.55s-.22,1.12-.65,1.55c-.43.43-.95.64-1.55.64s-1.12-.21-1.55-.64-.64-.95-.64-1.55.21-1.12.64-1.55Z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M27.21,2.9c-.5-.5-1.15-.75-1.95-.75h-10.52c-.8,0-1.45.25-1.95.75-.5.5-.75,1.15-.75,1.95v10.52c0,.8.25,1.45.75,1.95.35.35.77.56,1.25.67.22.05.45.08.7.08h10.52c.2,0,.38-.02.56-.05.55-.09,1.01-.33,1.39-.71.5-.5.75-1.15.75-1.95V4.86c0-.8-.25-1.45-.75-1.95ZM25.93,16.74c-.26.14-.55.22-.86.22h-10.15s-.08-.01-.12-.01c-.25-.02-.5-.08-.74-.2-.28-.14-.45-.35-.5-.63.99-.7,2.03-1.22,3.12-1.57s2.19-.52,3.31-.52,2.27.18,3.4.55c1.13.36,2.18.88,3.16,1.54-.15.27-.36.48-.63.63ZM26.84,15.01c-1-.66-2.08-1.17-3.23-1.54-1.15-.37-2.36-.56-3.61-.56s-2.46.19-3.61.56-2.23.88-3.23,1.54V4.86c0-.44.15-.82.46-1.12s.68-.46,1.12-.46h10.52c.44,0,.82.15,1.12.46s.46.68.46,1.12v10.15Z\"\n />\n </svg>\n `\n","/* eslint-disable @stylistic/max-len */\nimport type {\n DappConfig,\n DappIcon,\n DappName,\n DappNavItem,\n DappNavMenuConfig,\n DappPackageManifestPayload,\n DappVersion,\n} from '@xyo-network/os-model'\nimport {\n DappConfigSchema,\n DappIconSchema,\n DappMode,\n DappNavItemSchema,\n DappNavMenuConfigSchema,\n} from '@xyo-network/os-model'\n\nimport dappManifest from './dapp.manifest.json' assert { type: 'json' }\n\nexport const CustomDappName: DappName = 'Custom Dapp' as const\n\nconst version: DappVersion = '1.0.0'\n\nexport const CustomDappConfig: DappConfig = {\n manifest: dappManifest as DappPackageManifestPayload,\n modes: [DappMode.Window],\n name: CustomDappName,\n schema: DappConfigSchema,\n sources: ['network.xyo.dapp.accounts.source'],\n version,\n}\n\nexport const CustomDappIcon: DappIcon = {\n active: false,\n installed: 'installed',\n name: CustomDappName,\n schema: DappIconSchema,\n type: 'system',\n version,\n}\n\nexport const DappPayloads = [CustomDappConfig, CustomDappIcon]\n\nexport type CustomDappMenuItemPaths = 'home' | 'settings'\n\nconst CustomDappMenuItems: DappNavItem<CustomDappMenuItemPaths>[] = [\n {\n path: 'home',\n primaryText: 'Home',\n schema: DappNavItemSchema,\n svgIcon: `\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 -960 960 960\" width=\"24\" fill=\"none\"><path fill=\"currentColor\" d=\"M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z\"/></svg>\n `,\n weight: 0,\n },\n {\n path: 'settings',\n primaryText: 'Settings',\n schema: DappNavItemSchema,\n svgIcon: `\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 -960 960 960\" width=\"24\" fill=\"none\"><path fill=\"currentColor\" d=\"M420-360h120l-23-129q20-10 31.5-29t11.5-42q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 23 11.5 42t31.5 29l-23 129Zm60 280q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z\"/></svg>\n `,\n weight: 0,\n },\n]\n\nconst CustomDappMenuConfig: DappNavMenuConfig = {\n defaultPath: 'home',\n schema: DappNavMenuConfigSchema,\n}\n\nexport const CustomDappMenuPayloads = [...CustomDappMenuItems, CustomDappMenuConfig]\n","import { ErrorRender } from '@xylabs/react-error'\nimport { DappPathSwitcher, useAddDappMenuItems } from '@xyo-network/os-react-runtime'\nimport React from 'react'\n\nimport { CustomDappPathToComponent } from './CustomDappPathToComponent.tsx'\nimport { CustomDappMenuPayloads } from './Payloads.ts'\n\nexport const CustomDapp = () => {\n const {\n menuConfig, path, error,\n } = useAddDappMenuItems(CustomDappMenuPayloads)\n\n return (\n <>\n <ErrorRender error={error} scope=\"CustomDapp\" />\n <DappPathSwitcher activePath={path?.path ?? menuConfig?.defaultPath} pathToComponent={CustomDappPathToComponent} />\n </>\n )\n}\n","import { FlexRow } from '@xylabs/react-flexbox'\nimport type { PathToComponent } from '@xyo-network/os-react-runtime'\nimport React from 'react'\n\nexport const CustomDappPathToComponent: PathToComponent[] = [\n {\n component: <FlexRow />,\n path: 'home',\n },\n]\n","import type { UnregisteredReactDapp } from '@xyo-network/os-react-model'\n\nimport { CustomDapp } from './Dapp.tsx'\nimport { CustomDappParams } from './Params.js'\n\nexport const CustomDappUiParams: UnregisteredReactDapp['params'] = {\n ...CustomDappParams,\n modes: { window: { component: CustomDapp } },\n}\n\nexport { CustomDappUiParams as default }\n"],"mappings":";;;;AAAA,SAASA,WAAAA,gBAAe;AAExB,SAASC,oBAAoB;AAC7B,OAAOC,YAAW;;;ACHlB,SAASC,gBAAgB;AAGzB,SAASC,0BAA0BC,wBAAwB;AAUpD,IAAMC,kBAAN,MAAMA;EAbb,OAaaA;;;EACHC;EAERC,YAAYC,QAA+B;AACzC,SAAKF,UAAUE;EACjB;EAEA,IAAIA,SAAS;AACX,WAAOC,SAAS,KAAKH,SAAS,MAAM,IAAII,MAAM,iBAAA,CAAA;EAChD;EAEA,MAAMC,UAAsC;AAC1C,UAAMC,mBAAmB,MAAM,KAAKC,kBAAiB;AAErD,WAAO,MAAM,KAAKC,sBAAsBF,gBAAAA;EAC1C;EAEA,MAAcE,sBAAsBF,kBAAmE;AACrG,UAAM,EACJG,cAAcC,YAAYC,YAAYC,KAAI,IACxC,KAAKV;AAET,WAAO,MAAMW,iBAAiBC,aAAaR,kBAAkBM,MAAMH,gBAAgB,CAAA,GAAIE,YAAYD,UAAAA;EACrG;EAEA,MAAcH,oBAAkD;AAC9D,UAAM,EAAEK,MAAMG,KAAI,IAAK,KAAKb;AAC5B,UAAMc,2BAA2B,IAAIC,yBAAyBL,MAAM;MAACG,KAAKb,OAAOgB;KAAK;AACtF,UAAMC,WAAW,MAAMH,yBAAyBF,aAAaC,KAAKb,OAAOgB,IAAI;AAG7E,WAAO;MACL,GAAGH;MACHb,QAAQ;QACN,GAAGa,KAAKb;QACRiB;MACF;IACF;EACF;AACF;;;ACpDA,SAASC,kBAAkB;AAE3B,SACEC,aAAaC,wCAAwCC,4BAA4BC,wBAC5E;AAIP,IAAMC,YAAY;EAChBC,QAAQ;EAAMC,WAAW;EAAOC,QAAQ;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AExC,IAAMC,UAAuB;AAEtB,IAAMC,mBAA+B;EAC1CC,UAAUC;EACVC,OAAO;IAACC,SAASC;;EACjBC,MAAMR;EACNS,QAAQC;EACRC,SAAS;IAAC;;EACVV;AACF;AAEO,IAAMW,iBAA2B;EACtCC,QAAQ;EACRC,WAAW;EACXN,MAAMR;EACNS,QAAQM;EACRC,MAAM;EACNf;AACF;AAEO,IAAMgB,eAAe;EAACf;EAAkBU;;AAI/C,IAAMM,sBAA8D;EAClE;IACEC,MAAM;IACNC,aAAa;IACbX,QAAQY;IACRC,SAAS;;;IAGTC,QAAQ;EACV;EACA;IACEJ,MAAM;IACNC,aAAa;IACbX,QAAQY;IACRC,SAAS;;;IAGTC,QAAQ;EACV;;AAGF,IAAMC,uBAA0C;EAC9CC,aAAa;EACbhB,QAAQiB;AACV;AAEO,IAAMC,yBAAyB;KAAIT;EAAqBM;;;;ACxE/D,SAASI,mBAAmB;AAC5B,SAASC,kBAAkBC,2BAA2B;AACtD,OAAOC,YAAW;;;ACFlB,SAASC,eAAe;AAExB,OAAOC,YAAW;AAEX,IAAMC,4BAA+C;EAC1D;IACEC,WAAW,gBAAAF,OAAA,cAACD,SAAAA,IAAAA;IACZI,MAAM;EACR;;;;ADDK,IAAMC,aAAa,6BAAA;AACxB,QAAM,EACJC,YAAYC,MAAMC,MAAK,IACrBC,oBAAoBC,sBAAAA;AAExB,SACE,gBAAAC,OAAA,cAAAA,OAAA,UAAA,MACE,gBAAAA,OAAA,cAACC,aAAAA;IAAYJ;IAAcK,OAAM;MACjC,gBAAAF,OAAA,cAACG,kBAAAA;IAAiBC,YAAYR,MAAMA,QAAQD,YAAYU;IAAaC,iBAAiBC;;AAG5F,GAX0B;;;AEFnB,IAAMC,qBAAsD;EACjE,GAAGC;EACHC,OAAO;IAAEC,QAAQ;MAAEC,WAAWC;IAAW;EAAE;AAC7C;","names":["FlexCol","DappRendered","React","assertEx","DappSeedPhraseRepository","RunningDappCache","DappInitializer","_config","constructor","config","assertEx","Error","install","dappWithWalletId","installDappWallet","initializeDappContext","allowedNames","xnsNetwork","xnsNodeUrl","xyOs","RunningDappCache","findOrCreate","dapp","dappSeedPhraseRepository","DappSeedPhraseRepository","name","walletId","usePromise","useDappMenu","useManageDappInjectableParamsFromRoute","useManageDappPathFromRoute","useXyOsUiContext","dappState","active","minimized","closed","useInitializeDappAdHoc","dapp","xyOs","useXyOsUiContext","installedDapp","nodeCreateError","usePromise","installer","DappInitializer","allowedNames","config","name","xnsNetwork","undefined","xnsNodeUrl","install","dappWallet","context","routingError","useManageDappPathFromRoute","injectableErrors","useManageDappInjectableParamsFromRoute","dappMenu","useDappMenu","errors","filter","Boolean","Typography","FlexCol","usePromise","HDWallet","Kernel","ModuleFactoryLocator","XyOsUiContextProvider","EventBus","XyOs","React","useMemo","XyOsHost","children","eventBus","kernel","locator","wallet","walletToUse","usePromise","HDWallet","random","eventBusToUse","useMemo","EventBus","kernelToUse","Kernel","locatorToUse","ModuleFactoryLocator","os","error","XyOs","boot","XyOsUiContextProvider","value","FlexCol","Typography","message","DappHostInner","dapp","context","dappMenu","dappState","dappWallet","errors","useInitializeDappAdHoc","React","FlexCol","DappRendered","dappMenuProperties","DappHost","XyOsHost","React","BrowserRouter","React","Route","Routes","DappRoutes","args","React","Routes","Route","path","element","DappHost","RoutableDapp","dapp","React","BrowserRouter","DappRoutes","DappHost","ModuleFactoryLocator","CustomDappIconSvg","locator","ModuleFactoryLocator","CustomDappParams","iconSvg","CustomDappIconSvg","DappConfigSchema","DappIconSchema","DappMode","DappNavItemSchema","DappNavMenuConfigSchema","CustomDappName","version","CustomDappConfig","manifest","dappManifest","modes","DappMode","Window","name","schema","DappConfigSchema","sources","CustomDappIcon","active","installed","DappIconSchema","type","DappPayloads","CustomDappMenuItems","path","primaryText","DappNavItemSchema","svgIcon","weight","CustomDappMenuConfig","defaultPath","DappNavMenuConfigSchema","CustomDappMenuPayloads","ErrorRender","DappPathSwitcher","useAddDappMenuItems","React","FlexRow","React","CustomDappPathToComponent","component","path","CustomDapp","menuConfig","path","error","useAddDappMenuItems","CustomDappMenuPayloads","React","ErrorRender","scope","DappPathSwitcher","activePath","defaultPath","pathToComponent","CustomDappPathToComponent","CustomDappUiParams","CustomDappParams","modes","window","component","CustomDapp"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/dapp-template",
3
- "version": "4.2.4",
3
+ "version": "4.2.6",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -41,15 +41,14 @@
41
41
  "@xylabs/react-flexbox": "^5.3.14",
42
42
  "@xylabs/react-promise": "^5.3.14",
43
43
  "@xyo-network/account": "^3.6.6",
44
- "@xyo-network/archivist-indexeddb": "^3.6.6",
45
- "@xyo-network/kernel": "^4.2.4",
46
- "@xyo-network/kernel-model": "^4.2.4",
44
+ "@xyo-network/kernel": "^4.2.6",
45
+ "@xyo-network/kernel-model": "^4.2.6",
47
46
  "@xyo-network/module-factory-locator": "^3.6.6",
48
47
  "@xyo-network/object": "^3.6.6",
49
- "@xyo-network/os-model": "^4.2.4",
50
- "@xyo-network/os-react-model": "^4.2.4",
51
- "@xyo-network/os-react-runtime": "^4.2.4",
52
- "@xyo-network/os-runtime": "^4.2.4",
48
+ "@xyo-network/os-model": "^4.2.6",
49
+ "@xyo-network/os-react-model": "^4.2.6",
50
+ "@xyo-network/os-react-runtime": "^4.2.6",
51
+ "@xyo-network/os-runtime": "^4.2.6",
53
52
  "@xyo-network/payload-model": "^3.6.6",
54
53
  "@xyo-network/react-node": "^4.3.1",
55
54
  "@xyo-network/react-sdk": "^4.3.1",
@@ -2,8 +2,8 @@ import { ErrorRender } from '@xylabs/react-error'
2
2
  import { DappPathSwitcher, useAddDappMenuItems } from '@xyo-network/os-react-runtime'
3
3
  import React from 'react'
4
4
 
5
- import { CustomDappPathToComponent } from '../components/index.ts'
6
- import { CustomDappMenuPayloads } from '../Payloads.js'
5
+ import { CustomDappPathToComponent } from './CustomDappPathToComponent.tsx'
6
+ import { CustomDappMenuPayloads } from './Payloads.ts'
7
7
 
8
8
  export const CustomDapp = () => {
9
9
  const {
package/src/Params.ts CHANGED
@@ -1,11 +1,9 @@
1
- import { IndexedDbArchivist } from '@xyo-network/archivist-indexeddb'
2
1
  import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
3
2
  import type { UnregisteredDapp } from '@xyo-network/os-model'
4
3
 
5
4
  import { CustomDappIconSvg } from './icon/index.ts'
6
5
 
7
6
  const locator = new ModuleFactoryLocator()
8
- locator.register(IndexedDbArchivist)
9
7
 
10
8
  export const CustomDappParams: UnregisteredDapp['params'] = {
11
9
  iconSvg: CustomDappIconSvg,
package/src/UiParams.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { UnregisteredReactDapp } from '@xyo-network/os-react-model'
2
2
 
3
+ import { CustomDapp } from './Dapp.tsx'
3
4
  import { CustomDappParams } from './Params.js'
4
- import { CustomDapp } from './window/index.ts'
5
5
 
6
6
  export const CustomDappUiParams: UnregisteredReactDapp['params'] = {
7
7
  ...CustomDappParams,
@@ -1,10 +1,9 @@
1
1
  import { FlexCol } from '@xylabs/react-flexbox'
2
2
  import type { RegisteredReactDapp } from '@xyo-network/os-react-model'
3
- import type { DappState } from '@xyo-network/os-react-runtime'
4
3
  import { DappRendered } from '@xyo-network/os-react-runtime'
5
- import React, { useMemo } from 'react'
4
+ import React from 'react'
6
5
 
7
- import { useInitializeDapp } from './helpers/index.ts'
6
+ import { useInitializeDappAdHoc } from '../../helpers/index.ts'
8
7
  import { XyOsHost } from './XyOsHost.tsx'
9
8
 
10
9
  export interface DappHostProps {
@@ -13,16 +12,19 @@ export interface DappHostProps {
13
12
 
14
13
  export const DappHostInner: React.FC<DappHostProps> = ({ dapp }) => {
15
14
  const {
16
- context, dappMenu, dappWallet, errors,
17
- } = useInitializeDapp(dapp)
18
-
19
- const dappState: DappState = useMemo(() => ({
20
- active: true, minimized: false, closed: false,
21
- }), [])
15
+ context, dappMenu, dappState, dappWallet, errors,
16
+ } = useInitializeDappAdHoc(dapp)
22
17
 
23
18
  return (
24
19
  <FlexCol>
25
- <DappRendered context={context} dapp={dapp} dappMenuProperties={dappMenu} dappState={dappState} dappWallet={dappWallet} errors={errors} />
20
+ <DappRendered
21
+ context={context}
22
+ dapp={dapp}
23
+ dappMenuProperties={dappMenu}
24
+ dappState={dappState}
25
+ dappWallet={dappWallet}
26
+ errors={errors}
27
+ />
26
28
  </FlexCol>
27
29
  )
28
30
  }
@@ -0,0 +1,15 @@
1
+ import React from 'react'
2
+ import { BrowserRouter } from 'react-router-dom'
3
+
4
+ import type { DappHostProps } from './DappHost.tsx'
5
+ import { DappHost } from './DappHost.tsx'
6
+ import { DappRoutes } from './Routes.tsx'
7
+
8
+ export const RoutableDapp: React.FC<DappHostProps> = ({ dapp }) => {
9
+ return (
10
+ <BrowserRouter>
11
+ <DappRoutes dapp={dapp} />
12
+ <DappHost dapp={dapp} />
13
+ </BrowserRouter>
14
+ )
15
+ }
@@ -0,0 +1,33 @@
1
+ import React from 'react'
2
+ import { Route, Routes } from 'react-router-dom'
3
+
4
+ import { DappHost, type DappHostProps } from './DappHost.tsx'
5
+
6
+ export const DappRoutes: React.FC<DappHostProps> = args => (
7
+ <Routes>
8
+ <Route
9
+ path="/"
10
+ element={(
11
+ <DappHost {...args} />
12
+ )}
13
+ />
14
+ <Route
15
+ path="/:dappName"
16
+ element={(
17
+ <DappHost {...args} />
18
+ )}
19
+ />
20
+ <Route
21
+ path="/:dappName/:path/*"
22
+ element={(
23
+ <DappHost {...args} />
24
+ )}
25
+ />
26
+ <Route
27
+ path="*"
28
+ element={(
29
+ <DappHost {...args} />
30
+ )}
31
+ />
32
+ </Routes>
33
+ )
@@ -0,0 +1,4 @@
1
+ export * from './DappHost.tsx'
2
+ export * from './Routable.tsx'
3
+ export * from './Routes.tsx'
4
+ export * from './XyOsHost.tsx'
@@ -1 +1 @@
1
- export * from './Dapp.tsx'
1
+ export * from './host/index.ts'
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "config": {
6
6
  "accountPath": "0'",
7
- "name": "Node",
7
+ "name": "CustomDappNode",
8
8
  "schema": "network.xyo.node.config"
9
9
  },
10
10
  "modules": {
@@ -14,12 +14,7 @@
14
14
  "config": {
15
15
  "accountPath": "1'",
16
16
  "name": "DappArchivist",
17
- "dbName": "DappArchivist",
18
- "storeName": "payloads",
19
- "schema": "network.xyo.archivist.config",
20
- "labels": {
21
- "network.xyo.archivist.persistence.scope": "device"
22
- }
17
+ "schema": "network.xyo.archivist.config"
23
18
  }
24
19
  }
25
20
  ]
@@ -2,58 +2,20 @@ import type { Meta, StoryFn } from '@storybook/react'
2
2
  import { DappRegisteredSchema, DappRegisteredState } from '@xyo-network/os-model'
3
3
  import type { RegisteredReactDapp } from '@xyo-network/os-react-model'
4
4
  import React from 'react'
5
- import {
6
- BrowserRouter, Route, Routes,
7
- } from 'react-router-dom'
8
5
 
9
- import type { DappHostProps } from './DappHost.tsx'
10
- import { DappHost } from './DappHost.tsx'
6
+ import type { DappHostProps } from './components/index.ts'
7
+ import { RoutableDapp } from './components/index.ts'
11
8
  import { CustomDappConfig } from './Payloads.ts'
12
9
  import { CustomDappUiParams } from './ReactDapp.ts'
13
10
 
14
11
  const StorybookEntry = {
15
12
  argTypes: {},
16
- component: DappHost,
13
+ component: RoutableDapp,
17
14
  parameters: { docs: { page: null } },
18
15
  title: 'dapps/customDapp',
19
- } as Meta<typeof DappHost>
16
+ } as Meta<typeof RoutableDapp>
20
17
 
21
- const DappRoutes: React.FC<DappHostProps> = args => (
22
- <Routes>
23
- <Route
24
- path="/"
25
- element={(
26
- <DappHost {...args} />
27
- )}
28
- />
29
- <Route
30
- path="/:dappName"
31
- element={(
32
- <DappHost {...args} />
33
- )}
34
- />
35
- <Route
36
- path="/:dappName/:path/*"
37
- element={(
38
- <DappHost {...args} />
39
- )}
40
- />
41
- <Route
42
- path="*"
43
- element={(
44
- <DappHost {...args} />
45
- )}
46
- />
47
- </Routes>
48
- )
49
-
50
- const Template: StoryFn<typeof DappHost> = (args: DappHostProps) => {
51
- return (
52
- <BrowserRouter>
53
- <DappRoutes {...args} />
54
- </BrowserRouter>
55
- )
56
- }
18
+ const Template: StoryFn<typeof RoutableDapp> = (args: DappHostProps) => <RoutableDapp {...args} />
57
19
 
58
20
  const dapp: RegisteredReactDapp = {
59
21
  config: {
@@ -1,2 +1,2 @@
1
1
  export * from './DappInitializer.ts'
2
- export * from './useInitializeDapp.tsx'
2
+ export * from './useInitializeDappAdHoc.tsx'
@@ -6,7 +6,11 @@ import {
6
6
 
7
7
  import { DappInitializer } from './DappInitializer.ts'
8
8
 
9
- export const useInitializeDapp = (dapp: RegisteredReactDapp) => {
9
+ const dappState = {
10
+ active: true, minimized: false, closed: false,
11
+ }
12
+
13
+ export const useInitializeDappAdHoc = (dapp: RegisteredReactDapp) => {
10
14
  const xyOs = useXyOsUiContext()
11
15
 
12
16
  const [installedDapp, nodeCreateError] = usePromise(async () => {
@@ -33,6 +37,7 @@ export const useInitializeDapp = (dapp: RegisteredReactDapp) => {
33
37
  return {
34
38
  context,
35
39
  dappMenu,
40
+ dappState,
36
41
  dappWallet,
37
42
  errors: [routingError, nodeCreateError, ...injectableErrors].filter(Boolean),
38
43
  }
package/src/index.ts CHANGED
@@ -1,6 +1,5 @@
1
+ export * from './components/index.ts'
1
2
  export { default as accountsDappManifest } from './dapp.manifest.json'
2
- export * from './DappHost.tsx'
3
3
  export * from './Params.ts'
4
4
  export * from './Payloads.ts'
5
5
  export * from './UiParams.ts'
6
- export * from './XyOsHost.tsx'
@@ -1 +0,0 @@
1
- {"version":3,"file":"DappHost.d.ts","sourceRoot":"","sources":["../../src/DappHost.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAGtE,OAAO,KAAkB,MAAM,OAAO,CAAA;AAKtC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,mBAAmB,CAAA;CAC1B;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAcjD,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAI5C,CAAA"}