@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.
@@ -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, context) => {
2159
+ var deriveDappState = /* @__PURE__ */ __name((intent) => {
2160
2160
  const minimized = intent?.intent === DappIntentTypes7.Minimize;
2161
- const open = intent?.intent === DappIntentTypes7.Launch;
2162
- const active = !!(context && open);
2161
+ const active = intent?.intent === DappIntentTypes7.Launch;
2162
+ const closed = intent?.intent === DappIntentTypes7.Close;
2163
2163
  return {
2164
2164
  active,
2165
- minimized,
2166
- open
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, intent, nodeCreateError }) => {
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, open } = dappState ?? {};
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 resolvedError = nodeCreateError || menuError;
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: resolvedError ? null : /* @__PURE__ */ React25.createElement(DappLoadingFlexbox, {
3186
+ splashScreen: hasErrors ? null : /* @__PURE__ */ React25.createElement(DappLoadingFlexbox, {
3183
3187
  minimize: !!minimized,
3184
3188
  name,
3185
- open: !!open
3189
+ open: !!active
3186
3190
  })
3187
- }, resolvedError || errors?.length > 0 ? /* @__PURE__ */ React25.createElement(FlexCol10, {
3191
+ }, hasErrors ? /* @__PURE__ */ React25.createElement(FlexCol10, {
3188
3192
  padding: 2
3189
- }, resolvedError ? /* @__PURE__ */ React25.createElement(ErrorRender3, {
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: "DappWindowErrors"
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, context);
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, index) => /* @__PURE__ */ React29.createElement(DappContainerMemo, {
3309
+ }, /* @__PURE__ */ React29.createElement(StyledGridContainer, null, filteredRegisteredDappSets?.map((dappSet) => /* @__PURE__ */ React29.createElement(DappContainerMemo, {
3310
3310
  currentIntent: intentPayload,
3311
- key: index,
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,