@fluid-app/portal-sdk 0.1.227 → 0.1.229

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/index.cjs CHANGED
@@ -62,7 +62,7 @@ require("./order-status-badge-NMygmn5d.cjs");
62
62
  const require_OrdersScreen = require("./OrdersScreen-BPrt9kNr.cjs");
63
63
  require("./dist-FHf4OHgt.cjs");
64
64
  const require_MySiteScreen = require("./MySiteScreen-DwgWY0cl.cjs");
65
- const require_ShareablesScreen = require("./ShareablesScreen-AMlPuFFk.cjs");
65
+ const require_ShareablesScreen = require("./ShareablesScreen-o6frhZUM.cjs");
66
66
  require("./PortalProductsApiProvider-Bb5B1Hv5.cjs");
67
67
  const require_ShopScreen = require("./ShopScreen-yZUXE55P.cjs");
68
68
  require("./UpgradeScreen-BaclFXEh.cjs");
@@ -2149,7 +2149,7 @@ const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => req
2149
2149
  const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-BfS33bcq.cjs")).then((m) => ({ default: m.ContactsScreen })));
2150
2150
  const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-IQ3tqLfP.cjs")).then((m) => ({ default: m.ShopScreen })));
2151
2151
  const CustomersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./CustomersScreen-DW3BuhBs.cjs")).then((n) => n.CustomersScreen_exports).then((m) => ({ default: m.CustomersScreen })));
2152
- const ShareablesScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShareablesScreen-DyGQ-Yo_.cjs")).then((m) => ({ default: m.ShareablesScreen })));
2152
+ const ShareablesScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShareablesScreen-CTIe6EH0.cjs")).then((m) => ({ default: m.ShareablesScreen })));
2153
2153
  const MySiteScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MySiteScreen-DsR9VEwa.cjs")).then((m) => ({ default: m.MySiteScreen })));
2154
2154
  const UpgradeScreen = (0, react.lazy)(() => Promise.resolve().then(() => require("./UpgradeScreen-4Z5_ALSr.cjs")).then((m) => ({ default: m.UpgradeScreen })));
2155
2155
  const AppDownloadScreen = (0, react.lazy)(() => Promise.resolve().then(() => require("./AppDownloadScreen-BmYJ7Zgb.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => ({ default: m.AppDownloadScreen })));
@@ -2410,17 +2410,18 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
2410
2410
  account?.slug
2411
2411
  ]);
2412
2412
  const activeTheme = (0, react.useMemo)(() => {
2413
- if (!appData?.profile?.themes?.length) return void 0;
2414
- const themes = appData.profile.themes;
2415
- const activeId = appData.profile.activeThemeId;
2416
- return activeId ? themes.find((t) => t.id === activeId) ?? themes[0] : themes[0];
2413
+ const themes = appData?.profile?.themes;
2414
+ const activeId = appData?.profile?.activeThemeId;
2415
+ if (themes?.length) {
2416
+ const matched = activeId ? themes.find((t) => t.id === activeId) : void 0;
2417
+ const first = themes[0];
2418
+ if (matched) return matched;
2419
+ if (first) return first;
2420
+ }
2421
+ return require_src.getDefaultThemeDefinition();
2417
2422
  }, [appData?.profile?.themes, appData?.profile?.activeThemeId]);
2418
- const resolvedTheme = (0, react.useMemo)(() => {
2419
- if (!activeTheme) return void 0;
2420
- return require_src.resolveTheme(activeTheme);
2421
- }, [activeTheme]);
2423
+ const resolvedTheme = (0, react.useMemo)(() => require_src.resolveTheme(activeTheme), [activeTheme]);
2422
2424
  (0, react.useEffect)(() => {
2423
- if (!resolvedTheme) return;
2424
2425
  require_src.applyTheme(resolvedTheme);
2425
2426
  return () => {
2426
2427
  require_src.removeAllThemes();
@@ -2428,12 +2429,11 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
2428
2429
  }, [resolvedTheme]);
2429
2430
  (0, react.useEffect)(() => {
2430
2431
  const root = document.documentElement;
2431
- if (activeTheme?.id) root.setAttribute("data-theme", activeTheme.id);
2432
- else root.removeAttribute("data-theme");
2432
+ root.setAttribute("data-theme", activeTheme.id);
2433
2433
  return () => {
2434
2434
  root.removeAttribute("data-theme");
2435
2435
  };
2436
- }, [activeTheme?.id]);
2436
+ }, [activeTheme.id]);
2437
2437
  const navItems = (0, react.useMemo)(() => {
2438
2438
  if (navigationProp) return navigationProp;
2439
2439
  const profileNav = appData?.profile?.navigation?.navigation_items;
@@ -2465,7 +2465,6 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
2465
2465
  };
2466
2466
  }, [themeMode]);
2467
2467
  (0, react.useEffect)(() => {
2468
- if (!resolvedTheme) return;
2469
2468
  let meta = document.querySelector("meta[name=\"theme-color\"]");
2470
2469
  if (!meta) {
2471
2470
  meta = document.createElement("meta");
@@ -2564,7 +2563,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
2564
2563
  autoModeEnabled: false,
2565
2564
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2566
2565
  className: "font-body",
2567
- "data-theme": activeTheme?.id,
2566
+ "data-theme": activeTheme.id,
2568
2567
  "data-theme-mode": themeMode === "auto" ? void 0 : themeMode,
2569
2568
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AppNavigationContext.AppNavigationProvider, {
2570
2569
  currentSlug: activeSlug,
@@ -3644,7 +3643,7 @@ const screenPropertySchemas = {
3644
3643
  SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-CISCXowf.cjs")).then((m) => m.subscriptionsScreenPropertySchema),
3645
3644
  CustomersScreen: () => Promise.resolve().then(() => require("./CustomersScreen-DW3BuhBs.cjs")).then((n) => n.CustomersScreen_exports).then((m) => m.customersScreenPropertySchema),
3646
3645
  MySiteScreen: () => Promise.resolve().then(() => require("./MySiteScreen-DsR9VEwa.cjs")).then((m) => m.mySiteScreenPropertySchema),
3647
- ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-DyGQ-Yo_.cjs")).then((m) => m.shareablesScreenPropertySchema),
3646
+ ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-CTIe6EH0.cjs")).then((m) => m.shareablesScreenPropertySchema),
3648
3647
  ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-IQ3tqLfP.cjs")).then((m) => m.shopScreenPropertySchema),
3649
3648
  UpgradeScreen: () => Promise.resolve().then(() => require("./UpgradeScreen-4Z5_ALSr.cjs")).then((m) => m.upgradeScreenPropertySchema),
3650
3649
  AppDownloadScreen: () => Promise.resolve().then(() => require("./AppDownloadScreen-BmYJ7Zgb.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => m.appDownloadScreenPropertySchema)