@xyo-network/os-react-runtime 4.2.0-rc.8 → 4.2.0

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.
@@ -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, useParams as useParams3, useSearchParams as useSearchParams2 } from "react-router-dom";
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 && (params || queryParams)) {
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 useParams4 } from "react-router-dom";
2356
+ import { useNavigate as useNavigate6, useParams as useParams3 } from "react-router-dom";
2359
2357
  var useManageDappPathFromRoute = /* @__PURE__ */ __name((context, dappName) => {
2360
- const params = useParams4();
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 useParams5 } from "react-router-dom";
2412
+ import { useParams as useParams4 } from "react-router-dom";
2414
2413
  var useManageDappStateFromRoute = /* @__PURE__ */ __name((intentPayload) => {
2415
- const params = useParams5();
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 ?? []
@@ -4022,7 +4023,7 @@ var DappPathSwitcher = /* @__PURE__ */ __name(({ activePath, pathToComponent })
4022
4023
  });
4023
4024
  const possibleZIndex = pathToComponent?.findIndex((item) => item.path === activePath);
4024
4025
  const zIndex = possibleZIndex !== -1 && possibleZIndex !== void 0 ? possibleZIndex : 1;
4025
- return /* @__PURE__ */ React42.createElement(React42.Fragment, null, transitions((transitionProps, activePath2) => /* @__PURE__ */ React42.createElement(animated3.div, {
4026
+ return /* @__PURE__ */ React42.createElement(React42.Fragment, null, transitions((transitionProps, activePathRef) => /* @__PURE__ */ React42.createElement(animated3.div, {
4026
4027
  style: {
4027
4028
  ...transitionProps,
4028
4029
  alignItems: "stretch",
@@ -4039,10 +4040,10 @@ var DappPathSwitcher = /* @__PURE__ */ __name(({ activePath, pathToComponent })
4039
4040
  zIndex
4040
4041
  }
4041
4042
  }, (() => {
4042
- const activeIndex = pathToComponent?.findIndex(({ path: componentPath }) => activePath2 === componentPath);
4043
+ const activeIndex = pathToComponent?.findIndex(({ path: componentPath }) => activePathRef === componentPath);
4043
4044
  const activeItem = pathToComponent && activeIndex !== -1 && activeIndex !== void 0 ? pathToComponent[activeIndex] : void 0;
4044
4045
  return activeItem ? activeItem.component : /* @__PURE__ */ React42.createElement(ErrorRender4, {
4045
- error: new Error(`No component found for path: ${activePath2}`),
4046
+ error: new Error(`No component found for path: ${activePathRef}`),
4046
4047
  scope: "DappPathSwitcher"
4047
4048
  });
4048
4049
  })())));