@fluid-app/portal-sdk 0.1.451 → 0.1.453

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.mjs CHANGED
@@ -67,7 +67,7 @@ import { a as implementPortalFunction } from "./portal-function-DiozZloV.mjs";
67
67
  import "./use-portal-card-add-3ds-flow-DueNr2yx.mjs";
68
68
  import "./display-nScoMx87.mjs";
69
69
  import "./use-mysite-portal-B1lFZMl2.mjs";
70
- import { n as profileScreenPropertySchema, t as ProfileScreen } from "./ProfileScreen-Gvi6qWH9.mjs";
70
+ import { n as profileScreenPropertySchema, t as ProfileScreen } from "./ProfileScreen-BdzjBeMm.mjs";
71
71
  import "./dist-CBZLrT5S.mjs";
72
72
  import "./es-B3I_oMk-.mjs";
73
73
  import "./dist-CU-tsJ00.mjs";
@@ -894,6 +894,59 @@ function useSuppressInitialIframeFocusScroll(ref) {
894
894
  }, [ref]);
895
895
  }
896
896
  //#endregion
897
+ //#region ../react/src/shell/BottomNavVisibilityContext.tsx
898
+ function createBottomNavVisibilityCoordinator() {
899
+ let hideCount = 0;
900
+ let hidden = false;
901
+ const listeners = /* @__PURE__ */ new Set();
902
+ const emit = () => {
903
+ const next = hideCount > 0;
904
+ if (next === hidden) return;
905
+ hidden = next;
906
+ for (const listener of listeners) listener();
907
+ };
908
+ return {
909
+ subscribe: (listener) => {
910
+ listeners.add(listener);
911
+ return () => {
912
+ listeners.delete(listener);
913
+ };
914
+ },
915
+ getSnapshot: () => hidden,
916
+ requestHide: () => {
917
+ hideCount += 1;
918
+ emit();
919
+ let released = false;
920
+ return () => {
921
+ if (released) return;
922
+ released = true;
923
+ hideCount -= 1;
924
+ emit();
925
+ };
926
+ }
927
+ };
928
+ }
929
+ const BottomNavVisibilityContext = createContext(null);
930
+ function BottomNavVisibilityProvider({ children }) {
931
+ const coordinatorRef = useRef(null);
932
+ if (!coordinatorRef.current) coordinatorRef.current = createBottomNavVisibilityCoordinator();
933
+ return /* @__PURE__ */ jsx(BottomNavVisibilityContext.Provider, {
934
+ value: coordinatorRef.current,
935
+ children
936
+ });
937
+ }
938
+ const subscribeToNothing = () => () => void 0;
939
+ const getNotHidden = () => false;
940
+ /**
941
+ * Read whether the bottom nav should currently be hidden. Safe to call without
942
+ * a provider — falls back to "visible" so shells that never mount the provider
943
+ * (and existing tests) behave exactly as before.
944
+ */
945
+ function useBottomNavHidden() {
946
+ const coordinator = useContext(BottomNavVisibilityContext);
947
+ return useSyncExternalStore(coordinator?.subscribe ?? subscribeToNothing, coordinator?.getSnapshot ?? getNotHidden, getNotHidden);
948
+ }
949
+ //#endregion
897
950
  //#region ../react/src/shell/AppShellLayout.tsx
898
951
  /**
899
952
  * Pure visual frame that replicates the RepApp layout:
@@ -905,6 +958,8 @@ function useSuppressInitialIframeFocusScroll(ref) {
905
958
  */
906
959
  function AppShellLayout({ sidebarContent, headerContent, children, sidebarHeader, sidebarFooter, afterContent, useBottomNav = false }) {
907
960
  const screenContentRef = useRef(null);
961
+ const bottomNavHidden = useBottomNavHidden();
962
+ const mobileBottomPadding = useBottomNav ? bottomNavHidden ? "max-md:pb-0" : "max-md:pb-[calc(3.5rem+env(safe-area-inset-bottom))]" : "";
908
963
  useLayoutEffect(() => {
909
964
  const el = screenContentRef.current;
910
965
  if (!el) return;
@@ -936,7 +991,7 @@ function AppShellLayout({ sidebarContent, headerContent, children, sidebarHeader
936
991
  /* @__PURE__ */ jsxs(SidebarInset, {
937
992
  className: "flex flex-1 flex-col overflow-hidden",
938
993
  children: [headerContent, /* @__PURE__ */ jsx("div", {
939
- className: `bg-muted min-h-0 flex-1 md:pt-4 md:pr-4 md:pb-4 md:pl-2 ${useBottomNav ? "max-md:pb-[calc(3.5rem+env(safe-area-inset-bottom))]" : ""}`,
994
+ className: `bg-muted min-h-0 flex-1 transition-[padding] duration-300 ease-out motion-reduce:transition-none md:pt-4 md:pr-4 md:pb-4 md:pl-2 ${mobileBottomPadding}`,
940
995
  children: /* @__PURE__ */ jsx("div", {
941
996
  ref: screenContentRef,
942
997
  "data-fluid-portal-screen-area": "",
@@ -1224,6 +1279,7 @@ function SdkBottomNav({ navItems, currentSlug, onNavigate, appDefinitionId = 0,
1224
1279
  const shellApi = useShellTranslation();
1225
1280
  const { t } = shellApi;
1226
1281
  const nativeCapabilities = useNativeCapabilities();
1282
+ const hidden = useBottomNavHidden();
1227
1283
  const [moreOpen, setMoreOpen] = React$1.useState(false);
1228
1284
  if (!isMobile || !useBottomNav) return null;
1229
1285
  const navigableItems = navItems.filter((item) => !item.parent_id).filter((item) => item.slug || item.children && item.children.length > 0);
@@ -1244,7 +1300,11 @@ function SdkBottomNav({ navItems, currentSlug, onNavigate, appDefinitionId = 0,
1244
1300
  setMoreOpen(true);
1245
1301
  };
1246
1302
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("nav", {
1247
- className: "border-border bg-sidebar fixed right-0 bottom-0 left-0 z-40 flex h-[calc(3.5rem+env(safe-area-inset-bottom))] items-start justify-around border-t pb-[env(safe-area-inset-bottom)]",
1303
+ "data-fluid-bottom-nav": "",
1304
+ "data-hidden": hidden ? "" : void 0,
1305
+ "aria-hidden": hidden || void 0,
1306
+ inert: hidden,
1307
+ className: `border-border bg-sidebar fixed right-0 bottom-0 left-0 z-40 flex h-[calc(3.5rem+env(safe-area-inset-bottom))] items-start justify-around border-t pb-[env(safe-area-inset-bottom)] transition-[transform,opacity] duration-300 ease-out motion-reduce:transition-none ${hidden ? "pointer-events-none translate-y-full opacity-0" : "translate-y-0 opacity-100"}`,
1248
1308
  children: [visibleItems.map((item) => {
1249
1309
  const isActive = isInSection(item, currentSlug);
1250
1310
  return /* @__PURE__ */ jsxs("button", {
@@ -1864,7 +1924,7 @@ function resolveMemberTypePage(registry, memberTypeSlug, currentSlug, baseSlug)
1864
1924
  }
1865
1925
  //#endregion
1866
1926
  //#region src/shell/system-screen-map.ts
1867
- const ProfileScreen$1 = lazy(() => import("./ProfileScreen-BPPBknUb.mjs").then((m) => ({ default: m.ProfileScreen })));
1927
+ const ProfileScreen$1 = lazy(() => import("./ProfileScreen-3gbdDTy0.mjs").then((m) => ({ default: m.ProfileScreen })));
1868
1928
  const OrdersScreen$1 = lazy(() => import("./OrdersScreen-Cv-qovZG.mjs").then((m) => ({ default: m.OrdersScreen })));
1869
1929
  const SubscriptionsScreen$1 = lazy(() => import("./SubscriptionsScreen-Db9gI6D6.mjs").then((m) => ({ default: m.SubscriptionsScreen })));
1870
1930
  const MessagingScreen$1 = lazy(() => import("./MessagingScreen-BdsSr7l4.mjs").then((m) => ({ default: m.MessagingScreen })));
@@ -2624,7 +2684,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
2624
2684
  children: /* @__PURE__ */ jsx(WidgetInteractionProvider, {
2625
2685
  onItemClick: handleWidgetItemClick,
2626
2686
  onNavigate: handleNavigate,
2627
- children: /* @__PURE__ */ jsx(AppShellLayout, {
2687
+ children: /* @__PURE__ */ jsx(BottomNavVisibilityProvider, { children: /* @__PURE__ */ jsx(AppShellLayout, {
2628
2688
  sidebarContent: /* @__PURE__ */ jsx(SdkNavigation, {
2629
2689
  navItems: filteredNavItems,
2630
2690
  currentSlug: activeSlug,
@@ -2648,7 +2708,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
2648
2708
  appDefinitionId: appData?.definition_id ?? 0
2649
2709
  }),
2650
2710
  children: /* @__PURE__ */ jsx(ScreenAreaFullscreenProvider, { children: content })
2651
- })
2711
+ }) })
2652
2712
  })
2653
2713
  }), /* @__PURE__ */ jsx(Toaster, {})]
2654
2714
  })
@@ -3777,7 +3837,7 @@ const CORE_PAGE_IDS = {
3777
3837
  //#endregion
3778
3838
  //#region src/screens/index.ts
3779
3839
  const screenPropertySchemas = {
3780
- ProfileScreen: () => import("./ProfileScreen-BPPBknUb.mjs").then((m) => m.profileScreenPropertySchema),
3840
+ ProfileScreen: () => import("./ProfileScreen-3gbdDTy0.mjs").then((m) => m.profileScreenPropertySchema),
3781
3841
  MessagingScreen: () => import("./MessagingScreen-BdsSr7l4.mjs").then((m) => m.messagingScreenPropertySchema),
3782
3842
  ContactsScreen: () => import("./ContactsScreen-DjMBu144.mjs").then((n) => n.n).then((m) => m.contactsScreenPropertySchema),
3783
3843
  OrdersScreen: () => import("./OrdersScreen-Cv-qovZG.mjs").then((m) => m.ordersScreenPropertySchema),