@xyo-network/os-react-runtime 4.2.0-rc.2 → 4.2.0-rc.4
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 +22 -21
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/modules/Dapp/Page/Row.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/DappWindow.d.ts +1 -0
- package/dist/browser/modules/Dapp/modules/Window/DappWindow.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/index.d.ts +1 -0
- package/dist/browser/modules/Dapp/modules/Window/hooks/index.d.ts.map +1 -1
- package/dist/browser/modules/Dapp/modules/Window/hooks/lib/deriveDappState.d.ts +3 -3
- package/dist/browser/modules/Dapp/modules/Window/hooks/lib/deriveDappState.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/modules/Dapp/Container.tsx +2 -2
- package/src/modules/Dapp/Page/Row.tsx +2 -3
- package/src/modules/Dapp/modules/Window/DappWindow.tsx +10 -15
- package/src/modules/Dapp/modules/Window/hooks/index.ts +1 -0
- package/src/modules/Dapp/modules/Window/hooks/lib/deriveDappState.ts +6 -6
- package/src/modules/Dapp/modules/Window/hooks/menu/useDappMenu.tsx +1 -1
package/dist/browser/index.mjs
CHANGED
|
@@ -2156,14 +2156,14 @@ var DappPathHelpers = {
|
|
|
2156
2156
|
|
|
2157
2157
|
// src/modules/Dapp/modules/Window/hooks/lib/deriveDappState.ts
|
|
2158
2158
|
import { DappIntentTypes as DappIntentTypes7 } from "@xyo-network/os-model";
|
|
2159
|
-
var deriveDappState = /* @__PURE__ */ __name((intent
|
|
2159
|
+
var deriveDappState = /* @__PURE__ */ __name((intent) => {
|
|
2160
2160
|
const minimized = intent?.intent === DappIntentTypes7.Minimize;
|
|
2161
|
-
const
|
|
2162
|
-
const
|
|
2161
|
+
const active = intent?.intent === DappIntentTypes7.Launch;
|
|
2162
|
+
const closed = intent?.intent === DappIntentTypes7.Close;
|
|
2163
2163
|
return {
|
|
2164
2164
|
active,
|
|
2165
|
-
|
|
2166
|
-
|
|
2165
|
+
closed,
|
|
2166
|
+
minimized
|
|
2167
2167
|
};
|
|
2168
2168
|
}, "deriveDappState");
|
|
2169
2169
|
|
|
@@ -3143,14 +3143,18 @@ var DappMenuDrawer = /* @__PURE__ */ __name(({ activePath, context, iconSvg, nam
|
|
|
3143
3143
|
}, "DappMenuDrawer");
|
|
3144
3144
|
|
|
3145
3145
|
// src/modules/Dapp/modules/Window/DappWindow.tsx
|
|
3146
|
-
var DappWindow = /* @__PURE__ */ __name(({ context, dappSet, dappState, dappWallet,
|
|
3146
|
+
var DappWindow = /* @__PURE__ */ __name(({ context, dappSet, dappState, dappWallet, errors, nodeCreateError }) => {
|
|
3147
3147
|
const { DappComponent, name, scrollable = true, version } = decomposeDappSet(dappSet);
|
|
3148
|
-
const { active, minimized
|
|
3148
|
+
const { active, minimized } = dappState ?? {};
|
|
3149
3149
|
const TypedDappComponent = useMemo12(() => DappComponent, []);
|
|
3150
|
-
const errors = useManageDappBasedOffRoute(intent, name, context);
|
|
3151
3150
|
useSyncOsRegisteredAccessInterfaces(context);
|
|
3152
3151
|
const { activePath, error: menuError, menuConfig, menuItemsVisible, onPathChange } = useDappMenu(context, name);
|
|
3153
|
-
const
|
|
3152
|
+
const resolvedErrors = [
|
|
3153
|
+
nodeCreateError,
|
|
3154
|
+
menuError,
|
|
3155
|
+
...errors ?? []
|
|
3156
|
+
].filter(Boolean);
|
|
3157
|
+
const hasErrors = resolvedErrors.length > 0;
|
|
3154
3158
|
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, active ? /* @__PURE__ */ React25.createElement(Helmet, null, /* @__PURE__ */ React25.createElement("title", null, activePath ? `${new NameTransforms4(activePath).deSlug()} | ` : "", " ", name, " ", "dApp")) : null, /* @__PURE__ */ React25.createElement(ErrorBoundary, null, /* @__PURE__ */ React25.createElement(DappChrome, {
|
|
3155
3159
|
appBar: /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(DappBar, {
|
|
3156
3160
|
context,
|
|
@@ -3179,20 +3183,17 @@ var DappWindow = /* @__PURE__ */ __name(({ context, dappSet, dappState, dappWall
|
|
|
3179
3183
|
}
|
|
3180
3184
|
}),
|
|
3181
3185
|
/* Ensure that loading goes away when error occurs */
|
|
3182
|
-
splashScreen:
|
|
3186
|
+
splashScreen: hasErrors ? null : /* @__PURE__ */ React25.createElement(DappLoadingFlexbox, {
|
|
3183
3187
|
minimize: !!minimized,
|
|
3184
3188
|
name,
|
|
3185
|
-
open: !!
|
|
3189
|
+
open: !!active
|
|
3186
3190
|
})
|
|
3187
|
-
},
|
|
3191
|
+
}, hasErrors ? /* @__PURE__ */ React25.createElement(FlexCol10, {
|
|
3188
3192
|
padding: 2
|
|
3189
|
-
},
|
|
3190
|
-
error: resolvedError,
|
|
3191
|
-
scope: "DappWindow"
|
|
3192
|
-
}) : null, errors.map((error, index) => /* @__PURE__ */ React25.createElement(ErrorRender3, {
|
|
3193
|
+
}, resolvedErrors?.map((error, index) => /* @__PURE__ */ React25.createElement(ErrorRender3, {
|
|
3193
3194
|
key: index,
|
|
3194
3195
|
error,
|
|
3195
|
-
scope: "
|
|
3196
|
+
scope: "DappWindow"
|
|
3196
3197
|
}))) : null, /* @__PURE__ */ React25.createElement(WalletProvider, {
|
|
3197
3198
|
rootWallet: dappWallet
|
|
3198
3199
|
}, context === null ? null : /* @__PURE__ */ React25.createElement(XyOsUiContextProvider, {
|
|
@@ -3223,11 +3224,10 @@ var DappContainer = /* @__PURE__ */ __name(({ currentIntent, dappSet, xnsNodeUrl
|
|
|
3223
3224
|
const { dappWallet, context, nodeCreateError } = useDappContextCreator(xnsNodeUrl, xnsNetwork, dapp, currentIntent);
|
|
3224
3225
|
const dappState = useMemo13(() => {
|
|
3225
3226
|
if (currentIntent?.targetDappId === dapp.config.name) {
|
|
3226
|
-
return deriveDappState(currentIntent
|
|
3227
|
+
return deriveDappState(currentIntent);
|
|
3227
3228
|
}
|
|
3228
3229
|
}, [
|
|
3229
3230
|
currentIntent,
|
|
3230
|
-
context,
|
|
3231
3231
|
dapp
|
|
3232
3232
|
]);
|
|
3233
3233
|
return /* @__PURE__ */ React26.createElement(DappIconButton, {
|
|
@@ -3306,9 +3306,9 @@ var DappsRow = /* @__PURE__ */ __name(({ chipLabel, installType, registeredDapps
|
|
|
3306
3306
|
})), filteredRegisteredDappSets?.length ? /* @__PURE__ */ React29.createElement(Fade2, {
|
|
3307
3307
|
in: !!filteredRegisteredDappSets?.length,
|
|
3308
3308
|
timeout: 1e3
|
|
3309
|
-
}, /* @__PURE__ */ React29.createElement(StyledGridContainer, null, filteredRegisteredDappSets?.map((dappSet
|
|
3309
|
+
}, /* @__PURE__ */ React29.createElement(StyledGridContainer, null, filteredRegisteredDappSets?.map((dappSet) => /* @__PURE__ */ React29.createElement(DappContainerMemo, {
|
|
3310
3310
|
currentIntent: intentPayload,
|
|
3311
|
-
key:
|
|
3311
|
+
key: dappSet.dapp.config.name,
|
|
3312
3312
|
dappSet,
|
|
3313
3313
|
xnsNodeUrl,
|
|
3314
3314
|
xnsNetwork
|
|
@@ -4922,6 +4922,7 @@ export {
|
|
|
4922
4922
|
useDappIntentListener2,
|
|
4923
4923
|
useDappMenu,
|
|
4924
4924
|
useDappMenuCaller,
|
|
4925
|
+
useDappMenuDependencies,
|
|
4925
4926
|
useDappRegistrationResults,
|
|
4926
4927
|
useDappRegistry,
|
|
4927
4928
|
useDappSeedPhraseRepository,
|