@xyo-network/os-react-runtime 4.2.0-rc.11 → 4.2.0-rc.13
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/DappPathSwitcher.d.ts.map +1 -1
- package/dist/browser/index.mjs +27 -31
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/modules/Dapp/Container.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/DappWindow.d.ts.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/DappPathSwitcher.tsx +9 -11
- package/src/modules/Dapp/Container.tsx +1 -5
- package/src/modules/Dapp/modules/Window/DappWindow.tsx +4 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DappPathSwitcher.d.ts","sourceRoot":"","sources":["../../src/DappPathSwitcher.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"DappPathSwitcher.d.ts","sourceRoot":"","sources":["../../src/DappPathSwitcher.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,eAAe,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM;IAChE,SAAS,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE,SAAS,CAAA;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,eAAe,EAAE,CAAA;CACpC;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAyC5D,CAAA"}
|
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
|
-
const
|
|
3135
|
+
const routingError = useManageDappPathFromRoute(context, name);
|
|
3136
|
+
const injectableErrors = useManageDappInjectableParamsFromRoute(context);
|
|
3137
3137
|
const { activePath, error: menuError, menuConfig, menuItemsVisible, onPathChange } = useDappMenu(context, name);
|
|
3138
3138
|
const resolvedErrors = [
|
|
3139
|
-
...
|
|
3139
|
+
...injectableErrors,
|
|
3140
|
+
routingError,
|
|
3140
3141
|
nodeCreateError,
|
|
3141
3142
|
menuError,
|
|
3142
3143
|
...errors ?? []
|
|
@@ -3209,7 +3210,6 @@ var DappWindow = /* @__PURE__ */ __name(({ context, dappSet, dappState, dappWall
|
|
|
3209
3210
|
var DappContainer = /* @__PURE__ */ __name(({ currentIntent, dappSet, xnsNodeUrl, xnsNetwork }) => {
|
|
3210
3211
|
const { dapp, dappIcon } = dappSet;
|
|
3211
3212
|
const { dappWallet, context, nodeCreateError } = useDappContextCreator(xnsNodeUrl, xnsNetwork, dapp, currentIntent);
|
|
3212
|
-
useManageDappPathFromRoute(context, dapp.config.name);
|
|
3213
3213
|
const dappState = useMemo13(() => {
|
|
3214
3214
|
if (currentIntent?.targetDappId === dapp.config.name) {
|
|
3215
3215
|
return deriveDappState(currentIntent);
|
|
@@ -4005,7 +4005,7 @@ var WidgetCardExamples = /* @__PURE__ */ __name(() => {
|
|
|
4005
4005
|
// src/DappPathSwitcher.tsx
|
|
4006
4006
|
import { animated as animated3, useTransition } from "@react-spring/web";
|
|
4007
4007
|
import { ErrorRender as ErrorRender4 } from "@xylabs/react-error";
|
|
4008
|
-
import React42
|
|
4008
|
+
import React42 from "react";
|
|
4009
4009
|
var DappPathSwitcher = /* @__PURE__ */ __name(({ activePath, pathToComponent }) => {
|
|
4010
4010
|
const transitions = useTransition(activePath, {
|
|
4011
4011
|
enter: {
|
|
@@ -4023,18 +4023,7 @@ var DappPathSwitcher = /* @__PURE__ */ __name(({ activePath, pathToComponent })
|
|
|
4023
4023
|
});
|
|
4024
4024
|
const possibleZIndex = pathToComponent?.findIndex((item) => item.path === activePath);
|
|
4025
4025
|
const zIndex = possibleZIndex !== -1 && possibleZIndex !== void 0 ? possibleZIndex : 1;
|
|
4026
|
-
|
|
4027
|
-
const activeIndex = pathToComponent?.findIndex(({ path: componentPath }) => activePath === componentPath);
|
|
4028
|
-
const activeItem = pathToComponent && activeIndex !== -1 && activeIndex !== void 0 ? pathToComponent[activeIndex] : void 0;
|
|
4029
|
-
return activeItem ? activeItem.component : /* @__PURE__ */ React42.createElement(ErrorRender4, {
|
|
4030
|
-
error: new Error(`No component found for path: ${activePath}`),
|
|
4031
|
-
scope: "DappPathSwitcher"
|
|
4032
|
-
});
|
|
4033
|
-
}, [
|
|
4034
|
-
activePath,
|
|
4035
|
-
pathToComponent
|
|
4036
|
-
]);
|
|
4037
|
-
return /* @__PURE__ */ React42.createElement(React42.Fragment, null, transitions((transitionProps) => /* @__PURE__ */ React42.createElement(animated3.div, {
|
|
4026
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null, transitions((transitionProps, activePathRef) => /* @__PURE__ */ React42.createElement(animated3.div, {
|
|
4038
4027
|
style: {
|
|
4039
4028
|
...transitionProps,
|
|
4040
4029
|
alignItems: "stretch",
|
|
@@ -4050,7 +4039,14 @@ var DappPathSwitcher = /* @__PURE__ */ __name(({ activePath, pathToComponent })
|
|
|
4050
4039
|
top: 0,
|
|
4051
4040
|
zIndex
|
|
4052
4041
|
}
|
|
4053
|
-
},
|
|
4042
|
+
}, (() => {
|
|
4043
|
+
const activeIndex = pathToComponent?.findIndex(({ path: componentPath }) => activePathRef === componentPath);
|
|
4044
|
+
const activeItem = pathToComponent && activeIndex !== -1 && activeIndex !== void 0 ? pathToComponent[activeIndex] : void 0;
|
|
4045
|
+
return activeItem ? activeItem.component : /* @__PURE__ */ React42.createElement(ErrorRender4, {
|
|
4046
|
+
error: new Error(`No component found for path: ${activePathRef}`),
|
|
4047
|
+
scope: "DappPathSwitcher"
|
|
4048
|
+
});
|
|
4049
|
+
})())));
|
|
4054
4050
|
}, "DappPathSwitcher");
|
|
4055
4051
|
|
|
4056
4052
|
// src/dapps/shared/accounts/components/AnimatedComponents/GenericAnimations/ShiftAnimation.tsx
|
|
@@ -4420,10 +4416,10 @@ import React52 from "react";
|
|
|
4420
4416
|
|
|
4421
4417
|
// src/dapps/shared/table/head/hooks/useVisibleColumns.tsx
|
|
4422
4418
|
import { useMediaQuery as useMediaQuery2 } from "@mui/material";
|
|
4423
|
-
import { useMemo as
|
|
4419
|
+
import { useMemo as useMemo18 } from "react";
|
|
4424
4420
|
var useVisibleColumns = /* @__PURE__ */ __name((tableHeadCells) => {
|
|
4425
4421
|
const isMedium = useMediaQuery2((theme) => theme.breakpoints.down("lg"));
|
|
4426
|
-
const VisibleTableCells =
|
|
4422
|
+
const VisibleTableCells = useMemo18(() => {
|
|
4427
4423
|
return isMedium ? tableHeadCells.filter((cell) => cell.showOnMobile) : tableHeadCells;
|
|
4428
4424
|
}, [
|
|
4429
4425
|
isMedium,
|
|
@@ -4502,7 +4498,7 @@ var NextIteratorFlexbox = /* @__PURE__ */ __name(({ next: changePage, loading, .
|
|
|
4502
4498
|
|
|
4503
4499
|
// src/settings/Theme/ThemeProvider.tsx
|
|
4504
4500
|
import { InvertibleMuiThemeProvider } from "@xylabs/react-invertible-theme";
|
|
4505
|
-
import React54, { useMemo as
|
|
4501
|
+
import React54, { useMemo as useMemo19 } from "react";
|
|
4506
4502
|
|
|
4507
4503
|
// src/settings/Theme/ThemeCssVars.ts
|
|
4508
4504
|
import { alpha as alpha9, createTheme, darken as darken2, lighten } from "@mui/material";
|
|
@@ -4797,7 +4793,7 @@ var ThemeCssVars = createTheme({
|
|
|
4797
4793
|
|
|
4798
4794
|
// src/settings/Theme/ThemeProvider.tsx
|
|
4799
4795
|
var AppOsThemeProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
4800
|
-
const initialValue =
|
|
4796
|
+
const initialValue = useMemo19(() => {
|
|
4801
4797
|
const validValues = [
|
|
4802
4798
|
"light",
|
|
4803
4799
|
"dark"
|