@xyo-network/dapp-template 7.2.0 → 7.2.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.
@@ -1,4 +1,4 @@
1
- import type { JsonObject } from '@xylabs/object';
1
+ import type { JsonObject } from '@xylabs/sdk-js';
2
2
  import type { DappParams } from '@xyo-network/os-model';
3
3
  import type { DappReactParams } from '@xyo-network/os-react-model';
4
4
  import type { Payload } from '@xyo-network/payload-model';
@@ -2,7 +2,7 @@ import type { Meta } from '@storybook/react-vite';
2
2
  import type { DappHostProps } from './components/index.ts';
3
3
  import { RoutableDapp } from './components/index.ts';
4
4
  declare const StorybookEntry: Meta<typeof RoutableDapp>;
5
- declare const Default: import(".store/storybook-virtual-8410686a41/package/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, DappHostProps>;
5
+ declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, DappHostProps>;
6
6
  export { Default };
7
7
  export default StorybookEntry;
8
8
  //# sourceMappingURL=dapp.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dapp.stories.d.ts","sourceRoot":"","sources":["../../src/dapp.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAIpD,QAAA,MAAM,cAAc,EAKf,IAAI,CAAC,OAAO,YAAY,CAAC,CAAA;AAgB9B,QAAA,MAAM,OAAO,mJAAoB,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"dapp.stories.d.ts","sourceRoot":"","sources":["../../src/dapp.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAIpD,QAAA,MAAM,cAAc,EAKf,IAAI,CAAC,OAAO,YAAY,CAAC,CAAA;AAgB9B,QAAA,MAAM,OAAO,4GAAoB,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,eAAe,cAAc,CAAA"}
@@ -1,27 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
1
4
  // src/components/host/DappHost.tsx
2
5
  import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
3
6
  import { DappRendered } from "@xyo-network/os-react-runtime";
7
+ import React2 from "react";
4
8
 
5
9
  // src/helpers/registration/useInitializeDappAdHoc.tsx
6
10
  import { usePromise } from "@xylabs/react-promise";
7
- import {
8
- useDappMenu,
9
- useManageDappInjectableParamsFromRoute,
10
- useManageDappPathFromRoute,
11
- useXyOsUiContext
12
- } from "@xyo-network/os-react-runtime";
11
+ import { useDappMenu, useManageDappInjectableParamsFromRoute, useManageDappPathFromRoute, useXyOsUiContext } from "@xyo-network/os-react-runtime";
13
12
  import { DappInitializer } from "@xyo-network/os-runtime";
14
13
  var dappState = {
15
14
  active: true,
16
15
  minimized: false,
17
16
  closed: false
18
17
  };
19
- var useInitializeDappAdHoc = (dapp) => {
18
+ var useInitializeDappAdHoc = /* @__PURE__ */ __name((dapp) => {
20
19
  const xyOs = useXyOsUiContext();
21
20
  const [installedDapp, nodeCreateError] = usePromise(async () => {
22
21
  if (xyOs && dapp) {
23
22
  const installer = new DappInitializer({
24
- allowedNames: [dapp.config.name],
23
+ allowedNames: [
24
+ dapp.config.name
25
+ ],
25
26
  dapp,
26
27
  xnsNetwork: void 0,
27
28
  xnsNodeUrl: void 0,
@@ -29,7 +30,10 @@ var useInitializeDappAdHoc = (dapp) => {
29
30
  });
30
31
  return await installer.install();
31
32
  }
32
- }, [xyOs, dapp]);
33
+ }, [
34
+ xyOs,
35
+ dapp
36
+ ]);
33
37
  const { dappWallet, context } = installedDapp ?? {};
34
38
  const routingError = useManageDappPathFromRoute(context, dapp.config.name);
35
39
  const injectableErrors = useManageDappInjectableParamsFromRoute(context);
@@ -39,9 +43,13 @@ var useInitializeDappAdHoc = (dapp) => {
39
43
  dappMenu,
40
44
  dappState,
41
45
  dappWallet,
42
- errors: [routingError, nodeCreateError, ...injectableErrors].filter(Boolean)
46
+ errors: [
47
+ routingError,
48
+ nodeCreateError,
49
+ ...injectableErrors
50
+ ].filter(Boolean)
43
51
  };
44
- };
52
+ }, "useInitializeDappAdHoc");
45
53
 
46
54
  // src/components/host/XyOsHost.tsx
47
55
  import { Typography } from "@mui/material";
@@ -52,19 +60,20 @@ import { ModuleFactoryLocator } from "@xyo-network/module-factory-locator";
52
60
  import { XyOsUiContextProvider } from "@xyo-network/os-react-runtime";
53
61
  import { EventBus, XyOs } from "@xyo-network/os-runtime";
54
62
  import { HDWallet } from "@xyo-network/wallet";
55
- import { useMemo } from "react";
56
- import { jsx, jsxs } from "react/jsx-runtime";
57
- var XyOsHost = ({
58
- children,
59
- eventBus,
60
- kernel,
61
- locator: locator2,
62
- wallet
63
- }) => {
64
- const [walletToUse] = usePromise2(async () => wallet ?? await HDWallet.random(), [wallet]);
65
- const eventBusToUse = useMemo(() => eventBus ?? new EventBus(), [kernel]);
66
- const kernelToUse = useMemo(() => kernel ?? new Kernel(), [kernel]);
67
- const locatorToUse = useMemo(() => locator2 ?? new ModuleFactoryLocator(), [locator2]);
63
+ import React, { useMemo } from "react";
64
+ var XyOsHost = /* @__PURE__ */ __name(({ children, eventBus, kernel, locator: locator2, wallet }) => {
65
+ const [walletToUse] = usePromise2(async () => wallet ?? await HDWallet.random(), [
66
+ wallet
67
+ ]);
68
+ const eventBusToUse = useMemo(() => eventBus ?? new EventBus(), [
69
+ kernel
70
+ ]);
71
+ const kernelToUse = useMemo(() => kernel ?? new Kernel(), [
72
+ kernel
73
+ ]);
74
+ const locatorToUse = useMemo(() => locator2 ?? new ModuleFactoryLocator(), [
75
+ locator2
76
+ ]);
68
77
  const [os, error] = usePromise2(async () => {
69
78
  if (walletToUse && kernelToUse && eventBusToUse && locatorToUse) {
70
79
  const os2 = new XyOs({
@@ -75,96 +84,63 @@ var XyOsHost = ({
75
84
  await os2.boot(walletToUse, locatorToUse);
76
85
  return os2;
77
86
  }
78
- }, [kernelToUse, walletToUse, locator2, eventBusToUse, locatorToUse]);
79
- return os ? /* @__PURE__ */ jsx(XyOsUiContextProvider, { value: os, children }) : /* @__PURE__ */ jsxs(FlexCol, { children: [
80
- /* @__PURE__ */ jsxs(Typography, { children: [
81
- "wallet:",
82
- walletToUse ? "ready" : "loading"
83
- ] }),
84
- /* @__PURE__ */ jsxs(Typography, { children: [
85
- "kernel:",
86
- kernelToUse ? "ready" : "loading"
87
- ] }),
88
- /* @__PURE__ */ jsxs(Typography, { children: [
89
- "os:",
90
- os ? "ready" : "loading"
91
- ] }),
92
- /* @__PURE__ */ jsxs(Typography, { children: [
93
- "os-error:",
94
- error?.message
95
- ] })
96
- ] });
97
- };
87
+ }, [
88
+ kernelToUse,
89
+ walletToUse,
90
+ locator2,
91
+ eventBusToUse,
92
+ locatorToUse
93
+ ]);
94
+ return os ? /* @__PURE__ */ React.createElement(XyOsUiContextProvider, {
95
+ value: os
96
+ }, 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));
97
+ }, "XyOsHost");
98
98
 
99
99
  // src/components/host/DappHost.tsx
100
- import { jsx as jsx2 } from "react/jsx-runtime";
101
- var DappHostInner = ({ dapp }) => {
102
- const {
100
+ var DappHostInner = /* @__PURE__ */ __name(({ dapp }) => {
101
+ const { context, dappMenu, dappState: dappState2, dappWallet, errors } = useInitializeDappAdHoc(dapp);
102
+ return /* @__PURE__ */ React2.createElement(FlexCol2, null, /* @__PURE__ */ React2.createElement(DappRendered, {
103
103
  context,
104
- dappMenu,
104
+ dapp,
105
+ dappMenuProperties: dappMenu,
105
106
  dappState: dappState2,
106
107
  dappWallet,
107
108
  errors
108
- } = useInitializeDappAdHoc(dapp);
109
- return /* @__PURE__ */ jsx2(FlexCol2, { children: /* @__PURE__ */ jsx2(
110
- DappRendered,
111
- {
112
- context,
113
- dapp,
114
- dappMenuProperties: dappMenu,
115
- dappState: dappState2,
116
- dappWallet,
117
- errors
118
- }
119
- ) });
120
- };
121
- var DappHost = ({ dapp }) => /* @__PURE__ */ jsx2(XyOsHost, { children: /* @__PURE__ */ jsx2(DappHostInner, { dapp }) });
109
+ }));
110
+ }, "DappHostInner");
111
+ var DappHost = /* @__PURE__ */ __name(({ dapp }) => /* @__PURE__ */ React2.createElement(XyOsHost, null, /* @__PURE__ */ React2.createElement(DappHostInner, {
112
+ dapp
113
+ })), "DappHost");
122
114
 
123
115
  // src/components/host/Routable.tsx
116
+ import React4 from "react";
124
117
  import { BrowserRouter } from "react-router-dom";
125
118
 
126
119
  // src/components/host/Routes.tsx
120
+ import React3 from "react";
127
121
  import { Route, Routes } from "react-router-dom";
128
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
129
- var DappRoutes = (args) => /* @__PURE__ */ jsxs2(Routes, { children: [
130
- /* @__PURE__ */ jsx3(
131
- Route,
132
- {
133
- path: "/",
134
- element: /* @__PURE__ */ jsx3(DappHost, { ...args })
135
- }
136
- ),
137
- /* @__PURE__ */ jsx3(
138
- Route,
139
- {
140
- path: "/:dappName",
141
- element: /* @__PURE__ */ jsx3(DappHost, { ...args })
142
- }
143
- ),
144
- /* @__PURE__ */ jsx3(
145
- Route,
146
- {
147
- path: "/:dappName/:path/*",
148
- element: /* @__PURE__ */ jsx3(DappHost, { ...args })
149
- }
150
- ),
151
- /* @__PURE__ */ jsx3(
152
- Route,
153
- {
154
- path: "*",
155
- element: /* @__PURE__ */ jsx3(DappHost, { ...args })
156
- }
157
- )
158
- ] });
122
+ var DappRoutes = /* @__PURE__ */ __name((args) => /* @__PURE__ */ React3.createElement(Routes, null, /* @__PURE__ */ React3.createElement(Route, {
123
+ path: "/",
124
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
125
+ }), /* @__PURE__ */ React3.createElement(Route, {
126
+ path: "/:dappName",
127
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
128
+ }), /* @__PURE__ */ React3.createElement(Route, {
129
+ path: "/:dappName/:path/*",
130
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
131
+ }), /* @__PURE__ */ React3.createElement(Route, {
132
+ path: "*",
133
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
134
+ })), "DappRoutes");
159
135
 
160
136
  // src/components/host/Routable.tsx
161
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
162
- var RoutableDapp = ({ dapp }) => {
163
- return /* @__PURE__ */ jsxs3(BrowserRouter, { children: [
164
- /* @__PURE__ */ jsx4(DappRoutes, { dapp }),
165
- /* @__PURE__ */ jsx4(DappHost, { dapp })
166
- ] });
167
- };
137
+ var RoutableDapp = /* @__PURE__ */ __name(({ dapp }) => {
138
+ return /* @__PURE__ */ React4.createElement(BrowserRouter, null, /* @__PURE__ */ React4.createElement(DappRoutes, {
139
+ dapp
140
+ }), /* @__PURE__ */ React4.createElement(DappHost, {
141
+ dapp
142
+ }));
143
+ }, "RoutableDapp");
168
144
 
169
145
  // src/dapp.manifest.json
170
146
  var dapp_manifest_default = {
@@ -250,21 +226,19 @@ var CustomDappParams = {
250
226
  };
251
227
 
252
228
  // src/Payloads.ts
253
- import {
254
- DappConfigSchema,
255
- DappIconSchema,
256
- DappMode,
257
- DappNavItemSchema,
258
- DappNavMenuConfigSchema
259
- } from "@xyo-network/os-model";
229
+ import { DappConfigSchema, DappIconSchema, DappMode, DappNavItemSchema, DappNavMenuConfigSchema } from "@xyo-network/os-model";
260
230
  var CustomDappName = "Custom Dapp";
261
231
  var version = "1.0.0";
262
232
  var CustomDappConfig = {
263
233
  manifest: dapp_manifest_default,
264
- modes: [DappMode.Window],
234
+ modes: [
235
+ DappMode.Window
236
+ ],
265
237
  name: CustomDappName,
266
238
  schema: DappConfigSchema,
267
- sources: ["network.xyo.dapp.accounts.source"],
239
+ sources: [
240
+ "network.xyo.dapp.accounts.source"
241
+ ],
268
242
  version
269
243
  };
270
244
  var CustomDappIcon = {
@@ -275,7 +249,10 @@ var CustomDappIcon = {
275
249
  type: "system",
276
250
  version
277
251
  };
278
- var DappPayloads = [CustomDappConfig, CustomDappIcon];
252
+ var DappPayloads = [
253
+ CustomDappConfig,
254
+ CustomDappIcon
255
+ ];
279
256
  var CustomDappMenuItems = [
280
257
  {
281
258
  path: "home",
@@ -300,40 +277,46 @@ var CustomDappMenuConfig = {
300
277
  defaultPath: "home",
301
278
  schema: DappNavMenuConfigSchema
302
279
  };
303
- var CustomDappMenuPayloads = [...CustomDappMenuItems, CustomDappMenuConfig];
280
+ var CustomDappMenuPayloads = [
281
+ ...CustomDappMenuItems,
282
+ CustomDappMenuConfig
283
+ ];
304
284
 
305
285
  // src/Dapp.tsx
306
286
  import { ErrorRender } from "@xylabs/react-error";
307
287
  import { DappPathSwitcher, useAddDappMenuItems } from "@xyo-network/os-react-runtime";
288
+ import React6 from "react";
308
289
 
309
290
  // src/CustomDappPathToComponent.tsx
310
291
  import { FlexRow } from "@xylabs/react-flexbox";
311
- import { jsx as jsx5 } from "react/jsx-runtime";
292
+ import React5 from "react";
312
293
  var CustomDappPathToComponent = [
313
294
  {
314
- component: /* @__PURE__ */ jsx5(FlexRow, {}),
295
+ component: /* @__PURE__ */ React5.createElement(FlexRow, null),
315
296
  path: "home"
316
297
  }
317
298
  ];
318
299
 
319
300
  // src/Dapp.tsx
320
- import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
321
- var CustomDapp = () => {
322
- const {
323
- menuConfig,
324
- path,
325
- error
326
- } = useAddDappMenuItems(CustomDappMenuPayloads);
327
- return /* @__PURE__ */ jsxs4(Fragment, { children: [
328
- /* @__PURE__ */ jsx6(ErrorRender, { error, scope: "CustomDapp" }),
329
- /* @__PURE__ */ jsx6(DappPathSwitcher, { activePath: path?.path ?? menuConfig?.defaultPath, pathToComponent: CustomDappPathToComponent })
330
- ] });
331
- };
301
+ var CustomDapp = /* @__PURE__ */ __name(() => {
302
+ const { menuConfig, path, error } = useAddDappMenuItems(CustomDappMenuPayloads);
303
+ return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(ErrorRender, {
304
+ error,
305
+ scope: "CustomDapp"
306
+ }), /* @__PURE__ */ React6.createElement(DappPathSwitcher, {
307
+ activePath: path?.path ?? menuConfig?.defaultPath,
308
+ pathToComponent: CustomDappPathToComponent
309
+ }));
310
+ }, "CustomDapp");
332
311
 
333
312
  // src/UiParams.ts
334
313
  var CustomDappUiParams = {
335
314
  ...CustomDappParams,
336
- modes: { window: { component: CustomDapp } }
315
+ modes: {
316
+ window: {
317
+ component: CustomDapp
318
+ }
319
+ }
337
320
  };
338
321
  export {
339
322
  CustomDappConfig,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/host/DappHost.tsx","../../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 { 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'\nimport { DappInitializer } from '@xyo-network/os-runtime'\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 { 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 { HDWallet } from '@xyo-network/wallet'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\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 default CustomDappParams\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' with { 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.ts'\n\nexport const CustomDappUiParams: UnregisteredReactDapp['params'] = {\n ...CustomDappParams,\n modes: { window: { component: CustomDapp } },\n}\n\nexport default CustomDappUiParams\n"],"mappings":";AAAA,SAAS,WAAAA,gBAAe;AAExB,SAAS,oBAAoB;;;ACF7B,SAAS,kBAAkB;AAE3B;AAAA,EACE;AAAA,EAAa;AAAA,EAAwC;AAAA,EAA4B;AAAA,OAC5E;AACP,SAAS,uBAAuB;AAEhC,IAAM,YAAY;AAAA,EAChB,QAAQ;AAAA,EAAM,WAAW;AAAA,EAAO,QAAQ;AAC1C;AAEO,IAAM,yBAAyB,CAAC,SAA8B;AACnE,QAAM,OAAO,iBAAiB;AAE9B,QAAM,CAAC,eAAe,eAAe,IAAI,WAAW,YAAY;AAC9D,QAAI,QAAQ,MAAM;AAChB,YAAM,YAAY,IAAI,gBAAgB;AAAA,QACpC,cAAc,CAAC,KAAK,OAAO,IAAI;AAAA,QAC/B;AAAA,QACA,YAAY;A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AAA,IAAY;AAAA,IAAM;AAAA,EACpB,IAAI,oBAAoB,sBAAsB;AAE9C,SACE,gBAAAA,MAAA,YACE;AAAA,oBAAAD,KAAC,eAAY,OAAc,OAAM,cAAa;AAAA,IAC9C,gBAAAA,KAAC,oBAAiB,YAAY,MAAM,QAAQ,YAAY,aAAa,iBAAiB,2BAA2B;AAAA,KACnH;AAEJ;;;AEbO,IAAM,qBAAsD;AAAA,EACjE,GAAG;AAAA,EACH,OAAO,EAAE,QAAQ,EAAE,WAAW,WAAW,EAAE;AAC7C;","names":["FlexCol","usePromise","locator","os","jsx","dappState","FlexCol","jsx","jsxs","jsx","jsxs","ModuleFactoryLocator","ModuleFactoryLocator","jsx","jsx","jsxs"]}
1
+ {"version":3,"sources":["../../src/components/host/DappHost.tsx","../../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 { 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'\nimport { DappInitializer } from '@xyo-network/os-runtime'\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 { 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 { HDWallet } from '@xyo-network/wallet'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\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 default CustomDappParams\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' with { 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 unknown 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.ts'\n\nexport const CustomDappUiParams: UnregisteredReactDapp['params'] = {\n ...CustomDappParams,\n modes: { window: { component: CustomDapp } },\n}\n\nexport default CustomDappUiParams\n"],"mappings":";;;;AAAA,SAASA,WAAAA,gBAAe;AAExB,SAASC,oBAAoB;AAC7B,OAAOC,YAAW;;;ACHlB,SAASC,kBAAkB;AAE3B,SACEC,aAAaC,wCAAwCC,4BAA4BC,wBAC5E;AACP,SAASC,uBAAuB;AAEhC,IAAMC,YAAY;EAChBC,QAAQ;EAAMC,WAAW;EAAOC,QAAQ;AAC1C;AAEO,IAAMC,yBAAyB,wBAACC,SAAAA;AACrC,QAAMC,OAAOC,iBAAAA;AAEb,QAAM,CAACC,eAAeC,eAAAA,IAAmBC,WAAW,YAAA;AAClD,QAAIJ,QAAQD,MAAM;AAChB,YAAMM,YAAY,IAAIC,gBAAgB;QACpCC,cAAc;UAACR,KAAKS,OAAOC;;QAC3BV;QACAW,YAAYC;QACZC,YAAYD;QACZX;MACF,CAAA;AACA,aAAO,MAAMK,UAAUQ,QAAO;IAChC;EACF,GAAG;IAACb;IAAMD;GAAK;AAEf,QAAM,EAAEe,YAAYC,QAAO,IAAKb,iBAAiB,CAAC;AAGlD,QAAMc,eAAeC,2BAA2BF,SAAShB,KAAKS,OAAOC,IAAI;AACzE,QAAMS,mBAAmBC,uCAAuCJ,OAAAA;AAEhE,QAAMK,WAAWC,YAAYN,SAAShB,KAAKS,OAAOC,IAAI;AAEtD,SAAO;IACLM;IACAK;IACA1B;IACAoB;IACAQ,QAAQ;MAACN;MAAcb;SAAoBe;MAAkBK,OAAOC,OAAAA;EACtE;AACF,G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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","usePromise","useDappMenu","useManageDappInjectableParamsFromRoute","useManageDappPathFromRoute","useXyOsUiContext","DappInitializer","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","Kernel","ModuleFactoryLocator","XyOsUiContextProvider","EventBus","XyOs","HDWallet","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"]}
@@ -1,4 +1,4 @@
1
- import type { JsonObject } from '@xylabs/object';
1
+ import type { JsonObject } from '@xylabs/sdk-js';
2
2
  import type { DappParams } from '@xyo-network/os-model';
3
3
  import type { DappReactParams } from '@xyo-network/os-react-model';
4
4
  import type { Payload } from '@xyo-network/payload-model';
@@ -2,7 +2,7 @@ import type { Meta } from '@storybook/react-vite';
2
2
  import type { DappHostProps } from './components/index.ts';
3
3
  import { RoutableDapp } from './components/index.ts';
4
4
  declare const StorybookEntry: Meta<typeof RoutableDapp>;
5
- declare const Default: import(".store/storybook-virtual-8410686a41/package/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, DappHostProps>;
5
+ declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, DappHostProps>;
6
6
  export { Default };
7
7
  export default StorybookEntry;
8
8
  //# sourceMappingURL=dapp.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dapp.stories.d.ts","sourceRoot":"","sources":["../../src/dapp.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAIpD,QAAA,MAAM,cAAc,EAKf,IAAI,CAAC,OAAO,YAAY,CAAC,CAAA;AAgB9B,QAAA,MAAM,OAAO,mJAAoB,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"dapp.stories.d.ts","sourceRoot":"","sources":["../../src/dapp.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAIpD,QAAA,MAAM,cAAc,EAKf,IAAI,CAAC,OAAO,YAAY,CAAC,CAAA;AAgB9B,QAAA,MAAM,OAAO,4GAAoB,CAAA;AAGjC,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,eAAe,cAAc,CAAA"}
@@ -1,27 +1,28 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
1
4
  // src/components/host/DappHost.tsx
2
5
  import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
3
6
  import { DappRendered } from "@xyo-network/os-react-runtime";
7
+ import React2 from "react";
4
8
 
5
9
  // src/helpers/registration/useInitializeDappAdHoc.tsx
6
10
  import { usePromise } from "@xylabs/react-promise";
7
- import {
8
- useDappMenu,
9
- useManageDappInjectableParamsFromRoute,
10
- useManageDappPathFromRoute,
11
- useXyOsUiContext
12
- } from "@xyo-network/os-react-runtime";
11
+ import { useDappMenu, useManageDappInjectableParamsFromRoute, useManageDappPathFromRoute, useXyOsUiContext } from "@xyo-network/os-react-runtime";
13
12
  import { DappInitializer } from "@xyo-network/os-runtime";
14
13
  var dappState = {
15
14
  active: true,
16
15
  minimized: false,
17
16
  closed: false
18
17
  };
19
- var useInitializeDappAdHoc = (dapp) => {
18
+ var useInitializeDappAdHoc = /* @__PURE__ */ __name((dapp) => {
20
19
  const xyOs = useXyOsUiContext();
21
20
  const [installedDapp, nodeCreateError] = usePromise(async () => {
22
21
  if (xyOs && dapp) {
23
22
  const installer = new DappInitializer({
24
- allowedNames: [dapp.config.name],
23
+ allowedNames: [
24
+ dapp.config.name
25
+ ],
25
26
  dapp,
26
27
  xnsNetwork: void 0,
27
28
  xnsNodeUrl: void 0,
@@ -29,7 +30,10 @@ var useInitializeDappAdHoc = (dapp) => {
29
30
  });
30
31
  return await installer.install();
31
32
  }
32
- }, [xyOs, dapp]);
33
+ }, [
34
+ xyOs,
35
+ dapp
36
+ ]);
33
37
  const { dappWallet, context } = installedDapp ?? {};
34
38
  const routingError = useManageDappPathFromRoute(context, dapp.config.name);
35
39
  const injectableErrors = useManageDappInjectableParamsFromRoute(context);
@@ -39,9 +43,13 @@ var useInitializeDappAdHoc = (dapp) => {
39
43
  dappMenu,
40
44
  dappState,
41
45
  dappWallet,
42
- errors: [routingError, nodeCreateError, ...injectableErrors].filter(Boolean)
46
+ errors: [
47
+ routingError,
48
+ nodeCreateError,
49
+ ...injectableErrors
50
+ ].filter(Boolean)
43
51
  };
44
- };
52
+ }, "useInitializeDappAdHoc");
45
53
 
46
54
  // src/components/host/XyOsHost.tsx
47
55
  import { Typography } from "@mui/material";
@@ -52,19 +60,20 @@ import { ModuleFactoryLocator } from "@xyo-network/module-factory-locator";
52
60
  import { XyOsUiContextProvider } from "@xyo-network/os-react-runtime";
53
61
  import { EventBus, XyOs } from "@xyo-network/os-runtime";
54
62
  import { HDWallet } from "@xyo-network/wallet";
55
- import { useMemo } from "react";
56
- import { jsx, jsxs } from "react/jsx-runtime";
57
- var XyOsHost = ({
58
- children,
59
- eventBus,
60
- kernel,
61
- locator: locator2,
62
- wallet
63
- }) => {
64
- const [walletToUse] = usePromise2(async () => wallet ?? await HDWallet.random(), [wallet]);
65
- const eventBusToUse = useMemo(() => eventBus ?? new EventBus(), [kernel]);
66
- const kernelToUse = useMemo(() => kernel ?? new Kernel(), [kernel]);
67
- const locatorToUse = useMemo(() => locator2 ?? new ModuleFactoryLocator(), [locator2]);
63
+ import React, { useMemo } from "react";
64
+ var XyOsHost = /* @__PURE__ */ __name(({ children, eventBus, kernel, locator: locator2, wallet }) => {
65
+ const [walletToUse] = usePromise2(async () => wallet ?? await HDWallet.random(), [
66
+ wallet
67
+ ]);
68
+ const eventBusToUse = useMemo(() => eventBus ?? new EventBus(), [
69
+ kernel
70
+ ]);
71
+ const kernelToUse = useMemo(() => kernel ?? new Kernel(), [
72
+ kernel
73
+ ]);
74
+ const locatorToUse = useMemo(() => locator2 ?? new ModuleFactoryLocator(), [
75
+ locator2
76
+ ]);
68
77
  const [os, error] = usePromise2(async () => {
69
78
  if (walletToUse && kernelToUse && eventBusToUse && locatorToUse) {
70
79
  const os2 = new XyOs({
@@ -75,96 +84,63 @@ var XyOsHost = ({
75
84
  await os2.boot(walletToUse, locatorToUse);
76
85
  return os2;
77
86
  }
78
- }, [kernelToUse, walletToUse, locator2, eventBusToUse, locatorToUse]);
79
- return os ? /* @__PURE__ */ jsx(XyOsUiContextProvider, { value: os, children }) : /* @__PURE__ */ jsxs(FlexCol, { children: [
80
- /* @__PURE__ */ jsxs(Typography, { children: [
81
- "wallet:",
82
- walletToUse ? "ready" : "loading"
83
- ] }),
84
- /* @__PURE__ */ jsxs(Typography, { children: [
85
- "kernel:",
86
- kernelToUse ? "ready" : "loading"
87
- ] }),
88
- /* @__PURE__ */ jsxs(Typography, { children: [
89
- "os:",
90
- os ? "ready" : "loading"
91
- ] }),
92
- /* @__PURE__ */ jsxs(Typography, { children: [
93
- "os-error:",
94
- error?.message
95
- ] })
96
- ] });
97
- };
87
+ }, [
88
+ kernelToUse,
89
+ walletToUse,
90
+ locator2,
91
+ eventBusToUse,
92
+ locatorToUse
93
+ ]);
94
+ return os ? /* @__PURE__ */ React.createElement(XyOsUiContextProvider, {
95
+ value: os
96
+ }, 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));
97
+ }, "XyOsHost");
98
98
 
99
99
  // src/components/host/DappHost.tsx
100
- import { jsx as jsx2 } from "react/jsx-runtime";
101
- var DappHostInner = ({ dapp }) => {
102
- const {
100
+ var DappHostInner = /* @__PURE__ */ __name(({ dapp }) => {
101
+ const { context, dappMenu, dappState: dappState2, dappWallet, errors } = useInitializeDappAdHoc(dapp);
102
+ return /* @__PURE__ */ React2.createElement(FlexCol2, null, /* @__PURE__ */ React2.createElement(DappRendered, {
103
103
  context,
104
- dappMenu,
104
+ dapp,
105
+ dappMenuProperties: dappMenu,
105
106
  dappState: dappState2,
106
107
  dappWallet,
107
108
  errors
108
- } = useInitializeDappAdHoc(dapp);
109
- return /* @__PURE__ */ jsx2(FlexCol2, { children: /* @__PURE__ */ jsx2(
110
- DappRendered,
111
- {
112
- context,
113
- dapp,
114
- dappMenuProperties: dappMenu,
115
- dappState: dappState2,
116
- dappWallet,
117
- errors
118
- }
119
- ) });
120
- };
121
- var DappHost = ({ dapp }) => /* @__PURE__ */ jsx2(XyOsHost, { children: /* @__PURE__ */ jsx2(DappHostInner, { dapp }) });
109
+ }));
110
+ }, "DappHostInner");
111
+ var DappHost = /* @__PURE__ */ __name(({ dapp }) => /* @__PURE__ */ React2.createElement(XyOsHost, null, /* @__PURE__ */ React2.createElement(DappHostInner, {
112
+ dapp
113
+ })), "DappHost");
122
114
 
123
115
  // src/components/host/Routable.tsx
116
+ import React4 from "react";
124
117
  import { BrowserRouter } from "react-router-dom";
125
118
 
126
119
  // src/components/host/Routes.tsx
120
+ import React3 from "react";
127
121
  import { Route, Routes } from "react-router-dom";
128
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
129
- var DappRoutes = (args) => /* @__PURE__ */ jsxs2(Routes, { children: [
130
- /* @__PURE__ */ jsx3(
131
- Route,
132
- {
133
- path: "/",
134
- element: /* @__PURE__ */ jsx3(DappHost, { ...args })
135
- }
136
- ),
137
- /* @__PURE__ */ jsx3(
138
- Route,
139
- {
140
- path: "/:dappName",
141
- element: /* @__PURE__ */ jsx3(DappHost, { ...args })
142
- }
143
- ),
144
- /* @__PURE__ */ jsx3(
145
- Route,
146
- {
147
- path: "/:dappName/:path/*",
148
- element: /* @__PURE__ */ jsx3(DappHost, { ...args })
149
- }
150
- ),
151
- /* @__PURE__ */ jsx3(
152
- Route,
153
- {
154
- path: "*",
155
- element: /* @__PURE__ */ jsx3(DappHost, { ...args })
156
- }
157
- )
158
- ] });
122
+ var DappRoutes = /* @__PURE__ */ __name((args) => /* @__PURE__ */ React3.createElement(Routes, null, /* @__PURE__ */ React3.createElement(Route, {
123
+ path: "/",
124
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
125
+ }), /* @__PURE__ */ React3.createElement(Route, {
126
+ path: "/:dappName",
127
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
128
+ }), /* @__PURE__ */ React3.createElement(Route, {
129
+ path: "/:dappName/:path/*",
130
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
131
+ }), /* @__PURE__ */ React3.createElement(Route, {
132
+ path: "*",
133
+ element: /* @__PURE__ */ React3.createElement(DappHost, args)
134
+ })), "DappRoutes");
159
135
 
160
136
  // src/components/host/Routable.tsx
161
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
162
- var RoutableDapp = ({ dapp }) => {
163
- return /* @__PURE__ */ jsxs3(BrowserRouter, { children: [
164
- /* @__PURE__ */ jsx4(DappRoutes, { dapp }),
165
- /* @__PURE__ */ jsx4(DappHost, { dapp })
166
- ] });
167
- };
137
+ var RoutableDapp = /* @__PURE__ */ __name(({ dapp }) => {
138
+ return /* @__PURE__ */ React4.createElement(BrowserRouter, null, /* @__PURE__ */ React4.createElement(DappRoutes, {
139
+ dapp
140
+ }), /* @__PURE__ */ React4.createElement(DappHost, {
141
+ dapp
142
+ }));
143
+ }, "RoutableDapp");
168
144
 
169
145
  // src/dapp.manifest.json
170
146
  var dapp_manifest_default = {
@@ -250,21 +226,19 @@ var CustomDappParams = {
250
226
  };
251
227
 
252
228
  // src/Payloads.ts
253
- import {
254
- DappConfigSchema,
255
- DappIconSchema,
256
- DappMode,
257
- DappNavItemSchema,
258
- DappNavMenuConfigSchema
259
- } from "@xyo-network/os-model";
229
+ import { DappConfigSchema, DappIconSchema, DappMode, DappNavItemSchema, DappNavMenuConfigSchema } from "@xyo-network/os-model";
260
230
  var CustomDappName = "Custom Dapp";
261
231
  var version = "1.0.0";
262
232
  var CustomDappConfig = {
263
233
  manifest: dapp_manifest_default,
264
- modes: [DappMode.Window],
234
+ modes: [
235
+ DappMode.Window
236
+ ],
265
237
  name: CustomDappName,
266
238
  schema: DappConfigSchema,
267
- sources: ["network.xyo.dapp.accounts.source"],
239
+ sources: [
240
+ "network.xyo.dapp.accounts.source"
241
+ ],
268
242
  version
269
243
  };
270
244
  var CustomDappIcon = {
@@ -275,7 +249,10 @@ var CustomDappIcon = {
275
249
  type: "system",
276
250
  version
277
251
  };
278
- var DappPayloads = [CustomDappConfig, CustomDappIcon];
252
+ var DappPayloads = [
253
+ CustomDappConfig,
254
+ CustomDappIcon
255
+ ];
279
256
  var CustomDappMenuItems = [
280
257
  {
281
258
  path: "home",
@@ -300,40 +277,46 @@ var CustomDappMenuConfig = {
300
277
  defaultPath: "home",
301
278
  schema: DappNavMenuConfigSchema
302
279
  };
303
- var CustomDappMenuPayloads = [...CustomDappMenuItems, CustomDappMenuConfig];
280
+ var CustomDappMenuPayloads = [
281
+ ...CustomDappMenuItems,
282
+ CustomDappMenuConfig
283
+ ];
304
284
 
305
285
  // src/Dapp.tsx
306
286
  import { ErrorRender } from "@xylabs/react-error";
307
287
  import { DappPathSwitcher, useAddDappMenuItems } from "@xyo-network/os-react-runtime";
288
+ import React6 from "react";
308
289
 
309
290
  // src/CustomDappPathToComponent.tsx
310
291
  import { FlexRow } from "@xylabs/react-flexbox";
311
- import { jsx as jsx5 } from "react/jsx-runtime";
292
+ import React5 from "react";
312
293
  var CustomDappPathToComponent = [
313
294
  {
314
- component: /* @__PURE__ */ jsx5(FlexRow, {}),
295
+ component: /* @__PURE__ */ React5.createElement(FlexRow, null),
315
296
  path: "home"
316
297
  }
317
298
  ];
318
299
 
319
300
  // src/Dapp.tsx
320
- import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
321
- var CustomDapp = () => {
322
- const {
323
- menuConfig,
324
- path,
325
- error
326
- } = useAddDappMenuItems(CustomDappMenuPayloads);
327
- return /* @__PURE__ */ jsxs4(Fragment, { children: [
328
- /* @__PURE__ */ jsx6(ErrorRender, { error, scope: "CustomDapp" }),
329
- /* @__PURE__ */ jsx6(DappPathSwitcher, { activePath: path?.path ?? menuConfig?.defaultPath, pathToComponent: CustomDappPathToComponent })
330
- ] });
331
- };
301
+ var CustomDapp = /* @__PURE__ */ __name(() => {
302
+ const { menuConfig, path, error } = useAddDappMenuItems(CustomDappMenuPayloads);
303
+ return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(ErrorRender, {
304
+ error,
305
+ scope: "CustomDapp"
306
+ }), /* @__PURE__ */ React6.createElement(DappPathSwitcher, {
307
+ activePath: path?.path ?? menuConfig?.defaultPath,
308
+ pathToComponent: CustomDappPathToComponent
309
+ }));
310
+ }, "CustomDapp");
332
311
 
333
312
  // src/UiParams.ts
334
313
  var CustomDappUiParams = {
335
314
  ...CustomDappParams,
336
- modes: { window: { component: CustomDapp } }
315
+ modes: {
316
+ window: {
317
+ component: CustomDapp
318
+ }
319
+ }
337
320
  };
338
321
  export {
339
322
  CustomDappConfig,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/host/DappHost.tsx","../../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 { 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'\nimport { DappInitializer } from '@xyo-network/os-runtime'\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 { 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 { HDWallet } from '@xyo-network/wallet'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\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 default CustomDappParams\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' with { 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.ts'\n\nexport const CustomDappUiParams: UnregisteredReactDapp['params'] = {\n ...CustomDappParams,\n modes: { window: { component: CustomDapp } },\n}\n\nexport default CustomDappUiParams\n"],"mappings":";AAAA,SAAS,WAAAA,gBAAe;AAExB,SAAS,oBAAoB;;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AAA,IAGT,QAAQ;AAAA,EACV;AACF;AAEA,IAAM,uBAA0C;AAAA,EAC9C,aAAa;AAAA,EACb,QAAQ;AACV;AAEO,IAAM,yBAAyB,CAAC,GAAG,qBAAqB,oBAAoB;;;ACxEnF,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB,2BAA2B;;;ACDtD,SAAS,eAAe;AAMT,gBAAAC,YAAA;AAFR,IAAM,4BAA+C;AAAA,EAC1D;AAAA,IACE,WAAW,gBAAAA,KAAC,WAAQ;AAAA,IACpB,MAAM;AAAA,EACR;AACF;;;ADII,mBACE,OAAAC,MADF,QAAAC,aAAA;AANG,IAAM,aAAa,MAAM;AAC9B,QAAM;AAAA,IACJ;AAAA,IAAY;AAAA,IAAM;AAAA,EACpB,IAAI,oBAAoB,sBAAsB;AAE9C,SACE,gBAAAA,MAAA,YACE;AAAA,oBAAAD,KAAC,eAAY,OAAc,OAAM,cAAa;AAAA,IAC9C,gBAAAA,KAAC,oBAAiB,YAAY,MAAM,QAAQ,YAAY,aAAa,iBAAiB,2BAA2B;AAAA,KACnH;AAEJ;;;AEbO,IAAM,qBAAsD;AAAA,EACjE,GAAG;AAAA,EACH,OAAO,EAAE,QAAQ,EAAE,WAAW,WAAW,EAAE;AAC7C;","names":["FlexCol","usePromise","locator","os","jsx","dappState","FlexCol","jsx","jsxs","jsx","jsxs","ModuleFactoryLocator","ModuleFactoryLocator","jsx","jsx","jsxs"]}
1
+ {"version":3,"sources":["../../src/components/host/DappHost.tsx","../../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 { 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'\nimport { DappInitializer } from '@xyo-network/os-runtime'\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 { 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 { HDWallet } from '@xyo-network/wallet'\nimport type { WalletInstance } from '@xyo-network/wallet-model'\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 default CustomDappParams\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' with { 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 unknown 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.ts'\n\nexport const CustomDappUiParams: UnregisteredReactDapp['params'] = {\n ...CustomDappParams,\n modes: { window: { component: CustomDapp } },\n}\n\nexport default CustomDappUiParams\n"],"mappings":";;;;AAAA,SAASA,WAAAA,gBAAe;AAExB,SAASC,oBAAoB;AAC7B,OAAOC,YAAW;;;ACHlB,SAASC,kBAAkB;AAE3B,SACEC,aAAaC,wCAAwCC,4BAA4BC,wBAC5E;AACP,SAASC,uBAAuB;AAEhC,IAAMC,YAAY;EAChBC,QAAQ;EAAMC,WAAW;EAAOC,QAAQ;AAC1C;AAEO,IAAMC,yBAAyB,wBAACC,SAAAA;AACrC,QAAMC,OAAOC,iBAAAA;AAEb,QAAM,CAACC,eAAeC,eAAAA,IAAmBC,WAAW,YAAA;AAClD,QAAIJ,QAAQD,MAAM;AAChB,YAAMM,YAAY,IAAIC,gBAAgB;QACpCC,cAAc;UAACR,KAAKS,OAAOC;;QAC3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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","usePromise","useDappMenu","useManageDappInjectableParamsFromRoute","useManageDappPathFromRoute","useXyOsUiContext","DappInitializer","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","Kernel","ModuleFactoryLocator","XyOsUiContextProvider","EventBus","XyOs","HDWallet","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": "7.2.0",
3
+ "version": "7.2.1",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -37,38 +37,38 @@
37
37
  "src"
38
38
  ],
39
39
  "dependencies": {
40
- "@xylabs/object": "~5.0.42",
41
- "@xylabs/react-error": "~7.1.8",
42
- "@xylabs/react-flexbox": "~7.1.8",
43
- "@xylabs/react-promise": "~7.1.8",
44
- "@xyo-network/kernel": "~7.2.0",
45
- "@xyo-network/kernel-model": "~7.2.0",
46
- "@xyo-network/module-factory-locator": "~5.2.9",
47
- "@xyo-network/os-model": "~7.2.0",
48
- "@xyo-network/os-react-model": "~7.2.0",
49
- "@xyo-network/os-react-runtime": "~7.2.0",
50
- "@xyo-network/os-runtime": "~7.2.0",
51
- "@xyo-network/payload-model": "~5.2.9",
52
- "@xyo-network/wallet": "~5.2.9",
53
- "@xyo-network/wallet-model": "~5.2.9"
40
+ "@xylabs/react-error": "~7.1.9",
41
+ "@xylabs/react-flexbox": "~7.1.9",
42
+ "@xylabs/react-promise": "~7.1.9",
43
+ "@xylabs/sdk-js": "~5.0.64",
44
+ "@xyo-network/kernel": "~7.2.1",
45
+ "@xyo-network/kernel-model": "~7.2.1",
46
+ "@xyo-network/module-factory-locator": "~5.3.2",
47
+ "@xyo-network/os-model": "~7.2.1",
48
+ "@xyo-network/os-react-model": "~7.2.1",
49
+ "@xyo-network/os-react-runtime": "~7.2.1",
50
+ "@xyo-network/os-runtime": "~7.2.1",
51
+ "@xyo-network/payload-model": "~5.3.2",
52
+ "@xyo-network/wallet": "~5.3.2",
53
+ "@xyo-network/wallet-model": "~5.3.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@emotion/react": "~11.14.0",
57
57
  "@emotion/styled": "~11.14.1",
58
- "@mui/icons-material": "~7.3.5",
59
- "@mui/material": "~7.3.5",
60
- "@storybook/react-vite": "~10.0.8",
61
- "@types/react": "~19.2.6",
62
- "@xylabs/ts-scripts-yarn3": "~7.2.8",
63
- "@xylabs/tsconfig": "~7.2.8",
64
- "@xylabs/tsconfig-dom": "~7.2.8",
65
- "@xylabs/tsconfig-react": "~7.2.8",
66
- "react": "~19.2.0",
67
- "react-dom": "~19.2.0",
68
- "react-router-dom": "~7.9.6",
69
- "storybook": "~10.0.8",
58
+ "@mui/icons-material": "~7.3.7",
59
+ "@mui/material": "~7.3.7",
60
+ "@storybook/react-vite": "~10.2.1",
61
+ "@types/react": "~19.2.10",
62
+ "@xylabs/ts-scripts-yarn3": "~7.3.2",
63
+ "@xylabs/tsconfig": "~7.3.2",
64
+ "@xylabs/tsconfig-dom": "~7.3.2",
65
+ "@xylabs/tsconfig-react": "~7.3.2",
66
+ "react": "~19.2.4",
67
+ "react-dom": "~19.2.4",
68
+ "react-router-dom": "~7.13.0",
69
+ "storybook": "~10.2.1",
70
70
  "typescript": "~5.9.3",
71
- "vite": "~7.2.4"
71
+ "vite": "~7.3.1"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "@mui/icons-material": ">=6 <8",
@@ -80,4 +80,4 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  }
83
- }
83
+ }
package/src/Payloads.ts CHANGED
@@ -23,7 +23,7 @@ export const CustomDappName: DappName = 'Custom Dapp' as const
23
23
  const version: DappVersion = '1.0.0'
24
24
 
25
25
  export const CustomDappConfig: DappConfig = {
26
- manifest: dappManifest as DappPackageManifestPayload,
26
+ manifest: dappManifest as unknown as DappPackageManifestPayload,
27
27
  modes: [DappMode.Window],
28
28
  name: CustomDappName,
29
29
  schema: DappConfigSchema,
package/src/ReactDapp.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { JsonObject } from '@xylabs/object'
1
+ import type { JsonObject } from '@xylabs/sdk-js'
2
2
  import type { DappParams } from '@xyo-network/os-model'
3
3
  import type { DappReactParams } from '@xyo-network/os-react-model'
4
4
  import type { Payload } from '@xyo-network/payload-model'