@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/{ProfileScreen-BPPBknUb.mjs → ProfileScreen-3gbdDTy0.mjs} +1 -1
- package/dist/{ProfileScreen-Gvi6qWH9.mjs → ProfileScreen-BdzjBeMm.mjs} +2 -2
- package/dist/ProfileScreen-BdzjBeMm.mjs.map +1 -0
- package/dist/{ProfileScreen-Dh1zfLSC.cjs → ProfileScreen-Cs3B8vfS.cjs} +2 -2
- package/dist/ProfileScreen-Cs3B8vfS.cjs.map +1 -0
- package/dist/{ProfileScreen-Bp3kvBsM.cjs → ProfileScreen-cCOWdo-G.cjs} +1 -1
- package/dist/index.cjs +67 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +67 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
- package/dist/ProfileScreen-Dh1zfLSC.cjs.map +0 -1
- package/dist/ProfileScreen-Gvi6qWH9.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -68,7 +68,7 @@ const require_MessagingScreen = require("./MessagingScreen-CApfcPd5.cjs");
|
|
|
68
68
|
require("./use-portal-card-add-3ds-flow-1JkstOR0.cjs");
|
|
69
69
|
require("./display-B4SeWw2h.cjs");
|
|
70
70
|
require("./use-mysite-portal-DtJ9elyn.cjs");
|
|
71
|
-
const require_ProfileScreen = require("./ProfileScreen-
|
|
71
|
+
const require_ProfileScreen = require("./ProfileScreen-Cs3B8vfS.cjs");
|
|
72
72
|
const require_SubscriptionsScreen = require("./SubscriptionsScreen-aaF2B1qD.cjs");
|
|
73
73
|
require("./dist-Cpt-uZEu.cjs");
|
|
74
74
|
require("./es-DgpoYsI0.cjs");
|
|
@@ -896,6 +896,59 @@ function useSuppressInitialIframeFocusScroll(ref) {
|
|
|
896
896
|
}, [ref]);
|
|
897
897
|
}
|
|
898
898
|
//#endregion
|
|
899
|
+
//#region ../react/src/shell/BottomNavVisibilityContext.tsx
|
|
900
|
+
function createBottomNavVisibilityCoordinator() {
|
|
901
|
+
let hideCount = 0;
|
|
902
|
+
let hidden = false;
|
|
903
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
904
|
+
const emit = () => {
|
|
905
|
+
const next = hideCount > 0;
|
|
906
|
+
if (next === hidden) return;
|
|
907
|
+
hidden = next;
|
|
908
|
+
for (const listener of listeners) listener();
|
|
909
|
+
};
|
|
910
|
+
return {
|
|
911
|
+
subscribe: (listener) => {
|
|
912
|
+
listeners.add(listener);
|
|
913
|
+
return () => {
|
|
914
|
+
listeners.delete(listener);
|
|
915
|
+
};
|
|
916
|
+
},
|
|
917
|
+
getSnapshot: () => hidden,
|
|
918
|
+
requestHide: () => {
|
|
919
|
+
hideCount += 1;
|
|
920
|
+
emit();
|
|
921
|
+
let released = false;
|
|
922
|
+
return () => {
|
|
923
|
+
if (released) return;
|
|
924
|
+
released = true;
|
|
925
|
+
hideCount -= 1;
|
|
926
|
+
emit();
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
const BottomNavVisibilityContext = (0, react.createContext)(null);
|
|
932
|
+
function BottomNavVisibilityProvider({ children }) {
|
|
933
|
+
const coordinatorRef = (0, react.useRef)(null);
|
|
934
|
+
if (!coordinatorRef.current) coordinatorRef.current = createBottomNavVisibilityCoordinator();
|
|
935
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BottomNavVisibilityContext.Provider, {
|
|
936
|
+
value: coordinatorRef.current,
|
|
937
|
+
children
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
const subscribeToNothing = () => () => void 0;
|
|
941
|
+
const getNotHidden = () => false;
|
|
942
|
+
/**
|
|
943
|
+
* Read whether the bottom nav should currently be hidden. Safe to call without
|
|
944
|
+
* a provider — falls back to "visible" so shells that never mount the provider
|
|
945
|
+
* (and existing tests) behave exactly as before.
|
|
946
|
+
*/
|
|
947
|
+
function useBottomNavHidden() {
|
|
948
|
+
const coordinator = (0, react.useContext)(BottomNavVisibilityContext);
|
|
949
|
+
return (0, react.useSyncExternalStore)(coordinator?.subscribe ?? subscribeToNothing, coordinator?.getSnapshot ?? getNotHidden, getNotHidden);
|
|
950
|
+
}
|
|
951
|
+
//#endregion
|
|
899
952
|
//#region ../react/src/shell/AppShellLayout.tsx
|
|
900
953
|
/**
|
|
901
954
|
* Pure visual frame that replicates the RepApp layout:
|
|
@@ -907,6 +960,8 @@ function useSuppressInitialIframeFocusScroll(ref) {
|
|
|
907
960
|
*/
|
|
908
961
|
function AppShellLayout({ sidebarContent, headerContent, children, sidebarHeader, sidebarFooter, afterContent, useBottomNav = false }) {
|
|
909
962
|
const screenContentRef = (0, react.useRef)(null);
|
|
963
|
+
const bottomNavHidden = useBottomNavHidden();
|
|
964
|
+
const mobileBottomPadding = useBottomNav ? bottomNavHidden ? "max-md:pb-0" : "max-md:pb-[calc(3.5rem+env(safe-area-inset-bottom))]" : "";
|
|
910
965
|
(0, react.useLayoutEffect)(() => {
|
|
911
966
|
const el = screenContentRef.current;
|
|
912
967
|
if (!el) return;
|
|
@@ -938,7 +993,7 @@ function AppShellLayout({ sidebarContent, headerContent, children, sidebarHeader
|
|
|
938
993
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SidebarInset, {
|
|
939
994
|
className: "flex flex-1 flex-col overflow-hidden",
|
|
940
995
|
children: [headerContent, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
941
|
-
className: `bg-muted min-h-0 flex-1 md:pt-4 md:pr-4 md:pb-4 md:pl-2 ${
|
|
996
|
+
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}`,
|
|
942
997
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
943
998
|
ref: screenContentRef,
|
|
944
999
|
"data-fluid-portal-screen-area": "",
|
|
@@ -1226,6 +1281,7 @@ function SdkBottomNav({ navItems, currentSlug, onNavigate, appDefinitionId = 0,
|
|
|
1226
1281
|
const shellApi = require_shell_translation_api_context.useShellTranslation();
|
|
1227
1282
|
const { t } = shellApi;
|
|
1228
1283
|
const nativeCapabilities = require_FluidProvider.useNativeCapabilities();
|
|
1284
|
+
const hidden = useBottomNavHidden();
|
|
1229
1285
|
const [moreOpen, setMoreOpen] = react.useState(false);
|
|
1230
1286
|
if (!isMobile || !useBottomNav) return null;
|
|
1231
1287
|
const navigableItems = navItems.filter((item) => !item.parent_id).filter((item) => item.slug || item.children && item.children.length > 0);
|
|
@@ -1246,7 +1302,11 @@ function SdkBottomNav({ navItems, currentSlug, onNavigate, appDefinitionId = 0,
|
|
|
1246
1302
|
setMoreOpen(true);
|
|
1247
1303
|
};
|
|
1248
1304
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", {
|
|
1249
|
-
|
|
1305
|
+
"data-fluid-bottom-nav": "",
|
|
1306
|
+
"data-hidden": hidden ? "" : void 0,
|
|
1307
|
+
"aria-hidden": hidden || void 0,
|
|
1308
|
+
inert: hidden,
|
|
1309
|
+
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"}`,
|
|
1250
1310
|
children: [visibleItems.map((item) => {
|
|
1251
1311
|
const isActive = isInSection(item, currentSlug);
|
|
1252
1312
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -1866,7 +1926,7 @@ function resolveMemberTypePage(registry, memberTypeSlug, currentSlug, baseSlug)
|
|
|
1866
1926
|
}
|
|
1867
1927
|
//#endregion
|
|
1868
1928
|
//#region src/shell/system-screen-map.ts
|
|
1869
|
-
const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-
|
|
1929
|
+
const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-cCOWdo-G.cjs")).then((m) => ({ default: m.ProfileScreen })));
|
|
1870
1930
|
const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-CgU8hdeD.cjs")).then((m) => ({ default: m.OrdersScreen })));
|
|
1871
1931
|
const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-CYCQcYMB.cjs")).then((m) => ({ default: m.SubscriptionsScreen })));
|
|
1872
1932
|
const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-N3CiZ807.cjs")).then((m) => ({ default: m.MessagingScreen })));
|
|
@@ -2626,7 +2686,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
2626
2686
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WidgetInteractionContext.WidgetInteractionProvider, {
|
|
2627
2687
|
onItemClick: handleWidgetItemClick,
|
|
2628
2688
|
onNavigate: handleNavigate,
|
|
2629
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppShellLayout, {
|
|
2689
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BottomNavVisibilityProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppShellLayout, {
|
|
2630
2690
|
sidebarContent: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SdkNavigation, {
|
|
2631
2691
|
navItems: filteredNavItems,
|
|
2632
2692
|
currentSlug: activeSlug,
|
|
@@ -2650,7 +2710,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
2650
2710
|
appDefinitionId: appData?.definition_id ?? 0
|
|
2651
2711
|
}),
|
|
2652
2712
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_build_widget_registry.ScreenAreaFullscreenProvider, { children: content })
|
|
2653
|
-
})
|
|
2713
|
+
}) })
|
|
2654
2714
|
})
|
|
2655
2715
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src$1.Toaster, {})]
|
|
2656
2716
|
})
|
|
@@ -3779,7 +3839,7 @@ const CORE_PAGE_IDS = {
|
|
|
3779
3839
|
//#endregion
|
|
3780
3840
|
//#region src/screens/index.ts
|
|
3781
3841
|
const screenPropertySchemas = {
|
|
3782
|
-
ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-
|
|
3842
|
+
ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-cCOWdo-G.cjs")).then((m) => m.profileScreenPropertySchema),
|
|
3783
3843
|
MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-N3CiZ807.cjs")).then((m) => m.messagingScreenPropertySchema),
|
|
3784
3844
|
ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-C1kfIxoL.cjs")).then((m) => m.contactsScreenPropertySchema),
|
|
3785
3845
|
OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-CgU8hdeD.cjs")).then((m) => m.ordersScreenPropertySchema),
|