@xyo-network/os-react-runtime 4.2.0-rc.10 → 4.2.0-rc.12
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 +13 -12
- package/dist/browser/index.mjs.map +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 +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/modules/Dapp/modules/Window/DappWindow.tsx +3 -3
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappInjectableParamsFromRoute.tsx +3 -6
- package/src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.tsx +3 -1
package/dist/browser/index.mjs
CHANGED
|
@@ -2242,21 +2242,19 @@ import { usePromise as usePromise11 } from "@xylabs/react-promise";
|
|
|
2242
2242
|
import { asArchivistInstance } from "@xyo-network/archivist-model";
|
|
2243
2243
|
import { isDappInjectableParams } from "@xyo-network/os-model";
|
|
2244
2244
|
import { DappCaller as DappCaller2 } from "@xyo-network/os-runtime";
|
|
2245
|
-
import { useNavigate as useNavigate5,
|
|
2245
|
+
import { useNavigate as useNavigate5, useSearchParams as useSearchParams2 } from "react-router-dom";
|
|
2246
2246
|
var useManageDappInjectableParamsFromRoute = /* @__PURE__ */ __name((context) => {
|
|
2247
2247
|
const [queryParams] = useSearchParams2();
|
|
2248
|
-
const params = useParams3();
|
|
2249
2248
|
const navigate = useNavigate5();
|
|
2250
2249
|
const [, callerError] = usePromise11(async () => {
|
|
2251
|
-
if (context &&
|
|
2250
|
+
if (context && queryParams) {
|
|
2252
2251
|
const dappCaller = new DappCaller2(context);
|
|
2253
2252
|
const pathname = globalThis.location.pathname;
|
|
2254
2253
|
await dappCaller.setDappInjectableRouteParams(queryParams, pathname);
|
|
2255
2254
|
}
|
|
2256
2255
|
}, [
|
|
2257
2256
|
context,
|
|
2258
|
-
queryParams
|
|
2259
|
-
params
|
|
2257
|
+
queryParams
|
|
2260
2258
|
]);
|
|
2261
2259
|
const [, listenerError] = usePromise11(async () => {
|
|
2262
2260
|
let archivist;
|
|
@@ -2355,9 +2353,9 @@ var useManageDappIntentRequest = /* @__PURE__ */ __name((context, dappId) => {
|
|
|
2355
2353
|
// src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappPathFromRoute.tsx
|
|
2356
2354
|
import { usePromise as usePromise13 } from "@xylabs/react-promise";
|
|
2357
2355
|
import { useCallback as useCallback5, useEffect as useEffect14, useRef as useRef5 } from "react";
|
|
2358
|
-
import { useNavigate as useNavigate6, useParams as
|
|
2356
|
+
import { useNavigate as useNavigate6, useParams as useParams3 } from "react-router-dom";
|
|
2359
2357
|
var useManageDappPathFromRoute = /* @__PURE__ */ __name((context, dappName) => {
|
|
2360
|
-
const params =
|
|
2358
|
+
const params = useParams3();
|
|
2361
2359
|
const { path: pathParam } = params;
|
|
2362
2360
|
const dappMenuCaller = useDappMenuCaller(context, {
|
|
2363
2361
|
ignoreProvidedNode: true
|
|
@@ -2393,7 +2391,7 @@ var useManageDappPathFromRoute = /* @__PURE__ */ __name((context, dappName) => {
|
|
|
2393
2391
|
defaultPath,
|
|
2394
2392
|
menuSelection
|
|
2395
2393
|
]);
|
|
2396
|
-
usePromise13(async () => {
|
|
2394
|
+
const [, updateErrors] = usePromise13(async () => {
|
|
2397
2395
|
if (context && pathParam !== currentPathRef.current) {
|
|
2398
2396
|
await updateMenuArchivist(pathParam);
|
|
2399
2397
|
currentPathRef.current = pathParam;
|
|
@@ -2403,6 +2401,7 @@ var useManageDappPathFromRoute = /* @__PURE__ */ __name((context, dappName) => {
|
|
|
2403
2401
|
pathParam,
|
|
2404
2402
|
updateMenuArchivist
|
|
2405
2403
|
]);
|
|
2404
|
+
return updateErrors;
|
|
2406
2405
|
}, "useManageDappPathFromRoute");
|
|
2407
2406
|
|
|
2408
2407
|
// src/modules/Dapp/modules/Window/hooks/route/helpers/useManageDappStateFromRoute.tsx
|
|
@@ -2410,9 +2409,9 @@ import { usePromise as usePromise14 } from "@xylabs/react-promise";
|
|
|
2410
2409
|
import { DappIntentTypes as DappIntentTypes9 } from "@xyo-network/os-model";
|
|
2411
2410
|
import { DappIntentCaller as DappIntentCaller5, NameTransforms as NameTransforms3 } from "@xyo-network/os-runtime";
|
|
2412
2411
|
import { useRef as useRef6 } from "react";
|
|
2413
|
-
import { useParams as
|
|
2412
|
+
import { useParams as useParams4 } from "react-router-dom";
|
|
2414
2413
|
var useManageDappStateFromRoute = /* @__PURE__ */ __name((intentPayload) => {
|
|
2415
|
-
const params =
|
|
2414
|
+
const params = useParams4();
|
|
2416
2415
|
const { dappName: dappNameParam } = params;
|
|
2417
2416
|
const sendIntent = useSendDappIntent();
|
|
2418
2417
|
const intentCaller = useDappIntentCaller();
|
|
@@ -3133,10 +3132,12 @@ var DappWindow = /* @__PURE__ */ __name(({ context, dappSet, dappState, dappWall
|
|
|
3133
3132
|
const { active, minimized } = dappState ?? {};
|
|
3134
3133
|
const TypedDappComponent = useMemo12(() => DappComponent, []);
|
|
3135
3134
|
useSyncOsRegisteredAccessInterfaces(context);
|
|
3136
|
-
useManageDappPathFromRoute(context, name);
|
|
3137
|
-
useManageDappInjectableParamsFromRoute(context);
|
|
3135
|
+
const routingError = useManageDappPathFromRoute(context, name);
|
|
3136
|
+
const injectableErrors = useManageDappInjectableParamsFromRoute(context);
|
|
3138
3137
|
const { activePath, error: menuError, menuConfig, menuItemsVisible, onPathChange } = useDappMenu(context, name);
|
|
3139
3138
|
const resolvedErrors = [
|
|
3139
|
+
...injectableErrors,
|
|
3140
|
+
routingError,
|
|
3140
3141
|
nodeCreateError,
|
|
3141
3142
|
menuError,
|
|
3142
3143
|
...errors ?? []
|