@xyo-network/os-react-runtime 4.2.0-rc.5 → 4.2.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.mjs +21 -37
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/DappWindow.d.ts +3 -3
- package/dist/browser/modules/Dapp/modules/Window/DappWindow.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/index.d.ts +4 -4
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/index.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.d.ts +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.d.ts +2 -0
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappStateFromRoute.d.ts +2 -2
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappStateFromRoute.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/index.d.ts +0 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/index.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/hooks/os/useWidgetDapps.tsx +1 -1
- package/src/modules/Dapp/modules/Window/DappWindow.tsx +7 -8
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/RoutingNodes.md +7 -0
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/index.ts +4 -4
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.tsx +1 -1
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.tsx +2 -0
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappStateFromRoute.tsx +26 -20
- package/src/modules/Dapp/modules/Window/hooks/route/index.ts +0 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/useManageDappBasedOffRoute.d.ts +0 -19
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/useManageDappBasedOffRoute.d.ts.map +0 -1
- package/src/modules/Dapp/modules/Window/hooks/route/useManageDappBasedOffRoute.tsx +0 -33
package/dist/browser/index.mjs
CHANGED
|
@@ -1021,7 +1021,7 @@ var WidgetCaller = class extends OsCallerBase {
|
|
|
1021
1021
|
var useWidgetDapps = /* @__PURE__ */ __name((registeredDapps, widgetTrayLayout) => {
|
|
1022
1022
|
const context = useXyOsUiContext();
|
|
1023
1023
|
return usePromise8(async () => {
|
|
1024
|
-
if (registeredDapps && context && widgetTrayLayout) {
|
|
1024
|
+
if (registeredDapps && registeredDapps.length > 0 && context && widgetTrayLayout) {
|
|
1025
1025
|
const caller = new WidgetCaller(context, registeredDapps, widgetTrayLayout);
|
|
1026
1026
|
return await caller.buildWidgetComponents();
|
|
1027
1027
|
}
|
|
@@ -2409,62 +2409,47 @@ var useManageDappPathFromRoute = /* @__PURE__ */ __name((context, dappName) => {
|
|
|
2409
2409
|
import { usePromise as usePromise14 } from "@xylabs/react-promise";
|
|
2410
2410
|
import { DappIntentTypes as DappIntentTypes9 } from "@xyo-network/os-model";
|
|
2411
2411
|
import { DappIntentCaller as DappIntentCaller5, NameTransforms as NameTransforms3 } from "@xyo-network/os-runtime";
|
|
2412
|
-
import {
|
|
2413
|
-
|
|
2412
|
+
import { useRef as useRef6 } from "react";
|
|
2413
|
+
import { useParams as useParams5 } from "react-router-dom";
|
|
2414
|
+
var useManageDappStateFromRoute = /* @__PURE__ */ __name((intentPayload) => {
|
|
2414
2415
|
const params = useParams5();
|
|
2415
2416
|
const { dappName: dappNameParam } = params;
|
|
2416
2417
|
const sendIntent = useSendDappIntent();
|
|
2417
|
-
const navigationType = useNavigationType();
|
|
2418
2418
|
const intentCaller = useDappIntentCaller();
|
|
2419
|
+
const dappNameParamRef = useRef6();
|
|
2420
|
+
const intentRef = useRef6();
|
|
2419
2421
|
usePromise14(async () => {
|
|
2420
2422
|
const launched = intentPayload?.intent === DappIntentTypes9.Launch;
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
+
const dappNameParamRemoved = !!dappNameParamRef.current && dappNameParam === void 0;
|
|
2424
|
+
if (launched && dappNameParamRemoved && sendIntent) {
|
|
2425
|
+
const closeIntent = DappIntentCaller5.buildIntent(DappIntentCaller5.OsDappName, DappIntentTypes9.Close);
|
|
2423
2426
|
await sendIntent(closeIntent);
|
|
2424
2427
|
}
|
|
2428
|
+
dappNameParamRef.current = dappNameParam;
|
|
2425
2429
|
}, [
|
|
2426
|
-
dappName,
|
|
2427
2430
|
dappNameParam,
|
|
2428
2431
|
intentPayload,
|
|
2429
|
-
navigationType,
|
|
2430
2432
|
sendIntent
|
|
2431
2433
|
]);
|
|
2432
2434
|
usePromise14(async () => {
|
|
2433
|
-
if (dappNameParam &&
|
|
2435
|
+
if (dappNameParam && sendIntent && intentCaller) {
|
|
2434
2436
|
const dappNameParamDeSlugged = new NameTransforms3(dappNameParam).deSlug();
|
|
2435
|
-
const
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
const launchIntent = DappIntentCaller5.buildIntent(DappIntentCaller5.OsDappName, DappIntentTypes9.Launch, dappNameParamDeSlugged);
|
|
2442
|
-
await sendIntent(launchIntent);
|
|
2443
|
-
return;
|
|
2444
|
-
}
|
|
2437
|
+
const autoLaunchNeeded = intentRef.current === void 0 && dappNameParam;
|
|
2438
|
+
if (autoLaunchNeeded) {
|
|
2439
|
+
const launchIntent = DappIntentCaller5.buildIntent(DappIntentCaller5.OsDappName, DappIntentTypes9.Launch, dappNameParamDeSlugged);
|
|
2440
|
+
await sendIntent(launchIntent);
|
|
2441
|
+
intentRef.current = launchIntent;
|
|
2442
|
+
return;
|
|
2445
2443
|
}
|
|
2446
2444
|
}
|
|
2447
2445
|
}, [
|
|
2448
2446
|
dappNameParam,
|
|
2449
|
-
dappName,
|
|
2450
2447
|
sendIntent,
|
|
2451
2448
|
intentCaller,
|
|
2452
2449
|
intentPayload?.intent
|
|
2453
2450
|
]);
|
|
2454
2451
|
}, "useManageDappStateFromRoute");
|
|
2455
2452
|
|
|
2456
|
-
// src/modules/Dapp/modules/Window/hooks/route/useManageDappBasedOffRoute.tsx
|
|
2457
|
-
var useManageDappBasedOffRoute = /* @__PURE__ */ __name((intentPayload, dappName, context) => {
|
|
2458
|
-
const handleIntentError = useManageDappIntentRequest(context, dappName);
|
|
2459
|
-
useManageDappStateFromRoute(intentPayload, dappName);
|
|
2460
|
-
useManageDappPathFromRoute(context, dappName);
|
|
2461
|
-
const injectableErrors = useManageDappInjectableParamsFromRoute(context);
|
|
2462
|
-
return [
|
|
2463
|
-
...injectableErrors,
|
|
2464
|
-
handleIntentError
|
|
2465
|
-
];
|
|
2466
|
-
}, "useManageDappBasedOffRoute");
|
|
2467
|
-
|
|
2468
2453
|
// src/modules/Dapp/modules/Window/NodeManifest.tsx
|
|
2469
2454
|
import { usePromise as usePromise15 } from "@xylabs/react-promise";
|
|
2470
2455
|
import { useProvidedNode } from "@xyo-network/react-node";
|
|
@@ -3166,7 +3151,7 @@ var DappWindow = /* @__PURE__ */ __name(({ context, dappSet, dappState, dappWall
|
|
|
3166
3151
|
})),
|
|
3167
3152
|
height: "100dvh",
|
|
3168
3153
|
width: "100dvw",
|
|
3169
|
-
largeScreenMenu: /* @__PURE__ */ React25.createElement(DappMenuDrawer, {
|
|
3154
|
+
largeScreenMenu: active && /* @__PURE__ */ React25.createElement(DappMenuDrawer, {
|
|
3170
3155
|
context,
|
|
3171
3156
|
name,
|
|
3172
3157
|
version,
|
|
@@ -3175,7 +3160,7 @@ var DappWindow = /* @__PURE__ */ __name(({ context, dappSet, dappState, dappWall
|
|
|
3175
3160
|
menuConfig,
|
|
3176
3161
|
menuItems: menuItemsVisible
|
|
3177
3162
|
}),
|
|
3178
|
-
smallScreenMenu: /* @__PURE__ */ React25.createElement(DappBottomNavigation, {
|
|
3163
|
+
smallScreenMenu: active && /* @__PURE__ */ React25.createElement(DappBottomNavigation, {
|
|
3179
3164
|
activePath,
|
|
3180
3165
|
onPathChange,
|
|
3181
3166
|
menuConfig,
|
|
@@ -3192,8 +3177,8 @@ var DappWindow = /* @__PURE__ */ __name(({ context, dappSet, dappState, dappWall
|
|
|
3192
3177
|
})
|
|
3193
3178
|
}, hasErrors ? /* @__PURE__ */ React25.createElement(FlexCol10, {
|
|
3194
3179
|
padding: 2
|
|
3195
|
-
}, resolvedErrors?.map((error
|
|
3196
|
-
key:
|
|
3180
|
+
}, resolvedErrors?.map((error) => /* @__PURE__ */ React25.createElement(ErrorRender3, {
|
|
3181
|
+
key: error?.message,
|
|
3197
3182
|
error,
|
|
3198
3183
|
scope: "DappWindow"
|
|
3199
3184
|
}))) : null, /* @__PURE__ */ React25.createElement(WalletProvider, {
|
|
@@ -4932,7 +4917,6 @@ export {
|
|
|
4932
4917
|
useExposedNode,
|
|
4933
4918
|
useIntentResourceViews,
|
|
4934
4919
|
useKernel,
|
|
4935
|
-
useManageDappBasedOffRoute,
|
|
4936
4920
|
useManageDappInjectableParamsFromRoute,
|
|
4937
4921
|
useManageDappIntentRequest,
|
|
4938
4922
|
useManageDappPathFromRoute,
|