@fluid-app/portal-sdk 0.1.83 → 0.1.84
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/{AppNavigationContext-Du3Qq0yc.mjs → AppNavigationContext-BSnbFILQ.mjs} +1 -1
- package/dist/{AppNavigationContext-Du3Qq0yc.mjs.map → AppNavigationContext-BSnbFILQ.mjs.map} +1 -1
- package/dist/{AppNavigationContext-Agp0UkCQ.cjs → AppNavigationContext-DnwdUAjn.cjs} +1 -1
- package/dist/{AppNavigationContext-Agp0UkCQ.cjs.map → AppNavigationContext-DnwdUAjn.cjs.map} +1 -1
- package/dist/{ContactsScreen-FJUtn2_G.mjs → ContactsScreen-DrkHWPMm.mjs} +4 -4
- package/dist/{ContactsScreen-FJUtn2_G.mjs.map → ContactsScreen-DrkHWPMm.mjs.map} +1 -1
- package/dist/{ContactsScreen-aPH9Xaim.cjs → ContactsScreen-Du9M90zi.cjs} +5 -5
- package/dist/{ContactsScreen-6gXKTN61.cjs → ContactsScreen-DvmqkXOu.cjs} +4 -4
- package/dist/{ContactsScreen-6gXKTN61.cjs.map → ContactsScreen-DvmqkXOu.cjs.map} +1 -1
- package/dist/{CustomersScreen-9f10-_AZ.cjs → CustomersScreen-Bd9eK18y.cjs} +1 -1
- package/dist/{CustomersScreen-9f10-_AZ.cjs.map → CustomersScreen-Bd9eK18y.cjs.map} +1 -1
- package/dist/{CustomersScreen-xAauAB-B.mjs → CustomersScreen-DEFY3mRL.mjs} +1 -1
- package/dist/{CustomersScreen-xAauAB-B.mjs.map → CustomersScreen-DEFY3mRL.mjs.map} +1 -1
- package/dist/{MessagingScreen-CWJA4usG.cjs → MessagingScreen-BlN6KjV-.cjs} +3 -3
- package/dist/{MessagingScreen-DWNe8VFM.mjs → MessagingScreen-C4-8_bvB.mjs} +3 -3
- package/dist/{MessagingScreen-7_YhiLVY.mjs → MessagingScreen-Cg2XvQZF.mjs} +3 -3
- package/dist/{MessagingScreen-7_YhiLVY.mjs.map → MessagingScreen-Cg2XvQZF.mjs.map} +1 -1
- package/dist/{MessagingScreen-B_5Ci5s-.cjs → MessagingScreen-Lc81OXIN.cjs} +3 -3
- package/dist/{MessagingScreen-B_5Ci5s-.cjs.map → MessagingScreen-Lc81OXIN.cjs.map} +1 -1
- package/dist/{MySiteScreen-CtVL7wfc.cjs → MySiteScreen-B-I4V3Cc.cjs} +2 -2
- package/dist/{MySiteScreen-CtVL7wfc.cjs.map → MySiteScreen-B-I4V3Cc.cjs.map} +1 -1
- package/dist/{MySiteScreen-Cspeq0cy.mjs → MySiteScreen-BedF13nt.mjs} +2 -2
- package/dist/{MySiteScreen-Cspeq0cy.mjs.map → MySiteScreen-BedF13nt.mjs.map} +1 -1
- package/dist/{MySiteScreen-D5tr7TdT.cjs → MySiteScreen-DEOKI32H.cjs} +1 -1
- package/dist/{OrdersScreen-DiKPQvwJ.cjs → OrdersScreen-BE_E1QGL.cjs} +2 -2
- package/dist/{OrdersScreen-Bu82RCok.cjs → OrdersScreen-C-rU9cx6.cjs} +4 -4
- package/dist/{OrdersScreen-Bu82RCok.cjs.map → OrdersScreen-C-rU9cx6.cjs.map} +1 -1
- package/dist/{OrdersScreen-DrCPl7uv.mjs → OrdersScreen-CfAmUUN3.mjs} +4 -4
- package/dist/{OrdersScreen-DrCPl7uv.mjs.map → OrdersScreen-CfAmUUN3.mjs.map} +1 -1
- package/dist/{ProductsScreen-BHHo6Wen.mjs → ProductsScreen-CGo9KQ9L.mjs} +3 -3
- package/dist/{ProductsScreen-BHHo6Wen.mjs.map → ProductsScreen-CGo9KQ9L.mjs.map} +1 -1
- package/dist/{ProductsScreen-CoyGeILD.mjs → ProductsScreen-CgG79XW9.mjs} +5 -5
- package/dist/{ProductsScreen-Doc9tmAQ.cjs → ProductsScreen-Csw96ete.cjs} +3 -3
- package/dist/{ProductsScreen-Doc9tmAQ.cjs.map → ProductsScreen-Csw96ete.cjs.map} +1 -1
- package/dist/{ProductsScreen-CCNyLHqR.cjs → ProductsScreen-DUPhUJ7p.cjs} +5 -5
- package/dist/{ShareablesScreen-CNMWSoKY.mjs → ShareablesScreen-BK0H5fb2.mjs} +30 -9
- package/dist/ShareablesScreen-BK0H5fb2.mjs.map +1 -0
- package/dist/{ShareablesScreen-BRxLz3zn.mjs → ShareablesScreen-BmKYYRZq.mjs} +5 -5
- package/dist/{ShareablesScreen-Dp3BcjuA.cjs → ShareablesScreen-D0kIiW8S.cjs} +34 -7
- package/dist/ShareablesScreen-D0kIiW8S.cjs.map +1 -0
- package/dist/{ShareablesScreen-C5GJg1EP.cjs → ShareablesScreen-loETsu9v.cjs} +5 -5
- package/dist/{ShopScreen-CVxmqfmN.mjs → ShopScreen-B0Pr0CTu.mjs} +3 -3
- package/dist/{ShopScreen-CVxmqfmN.mjs.map → ShopScreen-B0Pr0CTu.mjs.map} +1 -1
- package/dist/{ShopScreen-CPWZhKgE.cjs → ShopScreen-CDwCW5Go.cjs} +3 -3
- package/dist/{ShopScreen-CPWZhKgE.cjs.map → ShopScreen-CDwCW5Go.cjs.map} +1 -1
- package/dist/{ShopScreen-nJhut901.cjs → ShopScreen-CaTpU5go.cjs} +1 -1
- package/dist/{SubscriptionsScreen-CSKVsakI.cjs → SubscriptionsScreen-CfvaEuTS.cjs} +4 -4
- package/dist/{SubscriptionsScreen-CSKVsakI.cjs.map → SubscriptionsScreen-CfvaEuTS.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-CJdcyH-e.mjs → SubscriptionsScreen-D3LAx25s.mjs} +4 -4
- package/dist/{SubscriptionsScreen-CJdcyH-e.mjs.map → SubscriptionsScreen-D3LAx25s.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-C1UWxvQk.cjs → SubscriptionsScreen-Dpn0YuDb.cjs} +3 -3
- package/dist/{dist-B4Ke7bHH.cjs → dist-BK4mvUPm.cjs} +2 -2
- package/dist/{dist-B4Ke7bHH.cjs.map → dist-BK4mvUPm.cjs.map} +1 -1
- package/dist/{dist-Cl4FsM3V.mjs → dist-C9vpl_rR.mjs} +2 -2
- package/dist/{dist-Cl4FsM3V.mjs.map → dist-C9vpl_rR.mjs.map} +1 -1
- package/dist/{dist-CMGXkSgZ.mjs → dist-CkIGP8my.mjs} +1 -1
- package/dist/{dist-CMGXkSgZ.mjs.map → dist-CkIGP8my.mjs.map} +1 -1
- package/dist/{dist-BbS_7TvS.cjs → dist-thaj08s5.cjs} +1 -1
- package/dist/{dist-BbS_7TvS.cjs.map → dist-thaj08s5.cjs.map} +1 -1
- package/dist/{es-1KItbbYg.mjs → es-Dlib2eNY.mjs} +1 -1
- package/dist/{es-1KItbbYg.mjs.map → es-Dlib2eNY.mjs.map} +1 -1
- package/dist/{es-BSkb3AZk.cjs → es-xQF-WIMq.cjs} +1 -1
- package/dist/{es-BSkb3AZk.cjs.map → es-xQF-WIMq.cjs.map} +1 -1
- package/dist/index.cjs +140 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +21 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +137 -44
- package/dist/index.mjs.map +1 -1
- package/dist/{order-detail-Cj68hbgK.cjs → order-detail-06VbWJjw.cjs} +1 -1
- package/dist/{order-detail-Cj68hbgK.cjs.map → order-detail-06VbWJjw.cjs.map} +1 -1
- package/dist/{order-detail-B-4hsupW.mjs → order-detail-B5X_QRpi.mjs} +1 -1
- package/dist/{order-detail-B-4hsupW.mjs.map → order-detail-B5X_QRpi.mjs.map} +1 -1
- package/dist/{products-BKZ1siXg.cjs → products-CjZof7c2.cjs} +1 -1
- package/dist/{products-BKZ1siXg.cjs.map → products-CjZof7c2.cjs.map} +1 -1
- package/dist/{products-DOO1TBcm.mjs → products-Dkwd_Bh0.mjs} +1 -1
- package/dist/{products-DOO1TBcm.mjs.map → products-Dkwd_Bh0.mjs.map} +1 -1
- package/dist/{src-nhqydD53.mjs → src-BjmyVJoe.mjs} +21 -20
- package/dist/src-BjmyVJoe.mjs.map +1 -0
- package/dist/{src-Dzexc0vw.cjs → src-Dt66UB0B.cjs} +1 -1
- package/dist/{src-Dzexc0vw.cjs.map → src-Dt66UB0B.cjs.map} +1 -1
- package/dist/{src-fXyI4AWk.cjs → src-bzRRiTN4.cjs} +21 -20
- package/dist/src-bzRRiTN4.cjs.map +1 -0
- package/dist/{src-DfVbSKm5.mjs → src-p8DA1dH0.mjs} +1 -1
- package/dist/{src-DfVbSKm5.mjs.map → src-p8DA1dH0.mjs.map} +1 -1
- package/dist/{use-customer-account-Dysq4hpT.cjs → use-customer-account-BoobPvSQ.cjs} +1 -1
- package/dist/{use-customer-account-Dysq4hpT.cjs.map → use-customer-account-BoobPvSQ.cjs.map} +1 -1
- package/dist/{use-customer-account-B0DeL6m0.mjs → use-customer-account-Dt3kO7ti.mjs} +1 -1
- package/dist/{use-customer-account-B0DeL6m0.mjs.map → use-customer-account-Dt3kO7ti.mjs.map} +1 -1
- package/package.json +9 -9
- package/dist/ShareablesScreen-CNMWSoKY.mjs.map +0 -1
- package/dist/ShareablesScreen-Dp3BcjuA.cjs.map +0 -1
- package/dist/src-fXyI4AWk.cjs.map +0 -1
- package/dist/src-nhqydD53.mjs.map +0 -1
- /package/dist/{ProfileScreen-BKKIMZiD.cjs → ProfileScreen-BSZLS9hY.cjs} +0 -0
- /package/dist/{src-BakNjVTk.mjs → src-B7j_mfeS.mjs} +0 -0
- /package/dist/{src-C_kOrGdZ.cjs → src-Bp-dRR29.cjs} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { r as calendarWidgetPropertySchema, t as CalendarWidget } from "./Calend
|
|
|
15
15
|
import { r as cardWidgetPropertySchema, t as CardWidget } from "./CardWidget-zZAhy3oQ.mjs";
|
|
16
16
|
import "./purify.es-D4F6PAAZ.mjs";
|
|
17
17
|
import { C as SheetContent, D as SheetTrigger, I as Input, K as DropdownMenu, R as IconButton, S as Sheet, Y as DropdownMenuLabel, an as AlertDialogContent, cn as AlertDialogHeader, et as DropdownMenuTrigger, ht as CollapsibleTrigger, in as AlertDialogCancel, ln as AlertDialogMedia, mt as CollapsibleContent, nn as AlertDialog, on as AlertDialogDescription, pt as Collapsible, q as DropdownMenuContent, rn as AlertDialogAction, sn as AlertDialogFooter, un as AlertDialogTitle, x as Skeleton$1, yn as cn$1 } from "./src-77nf0QPD.mjs";
|
|
18
|
-
import { a as useMessagingAuth, i as useMessagingConfig, n as messagingScreenPropertySchema, r as createFluidFileUploader, t as MessagingScreen } from "./MessagingScreen-
|
|
18
|
+
import { a as useMessagingAuth, i as useMessagingConfig, n as messagingScreenPropertySchema, r as createFluidFileUploader, t as MessagingScreen } from "./MessagingScreen-Cg2XvQZF.mjs";
|
|
19
19
|
import "./scroll-arrows-CjjaRceq.mjs";
|
|
20
20
|
import "./MediaRenderer-BKgR0Nd5.mjs";
|
|
21
21
|
import { r as carouselWidgetPropertySchema, t as CarouselWidget } from "./CarouselWidget-v1NWYsQe.mjs";
|
|
@@ -38,22 +38,22 @@ import { o as useFluidAuth } from "./use-account-clients-Cf_6sxeC.mjs";
|
|
|
38
38
|
import { i as useScreenHeaderContext, t as ScreenHeaderProvider } from "./ScreenHeaderContext-NdrJ58Mg.mjs";
|
|
39
39
|
import { t as useFluidApi } from "./use-fluid-api-DPhr-9Jv.mjs";
|
|
40
40
|
import { i as useCompanyScopedQueryKey, n as useCurrentUser, r as createCompanyQueryKey, t as CURRENT_USER_QUERY_KEY } from "./use-current-user-Bl9nPNFt.mjs";
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import "./
|
|
44
|
-
import
|
|
45
|
-
import "./
|
|
46
|
-
import "./
|
|
47
|
-
import
|
|
48
|
-
import "./
|
|
49
|
-
import "./
|
|
50
|
-
import
|
|
51
|
-
import "./
|
|
52
|
-
import
|
|
53
|
-
import {
|
|
41
|
+
import { n as shareablesScreenPropertySchema, r as useUserType, t as ShareablesScreen } from "./ShareablesScreen-BK0H5fb2.mjs";
|
|
42
|
+
import { i as CoreScreenPlaceholder, r as customersScreenPropertySchema, t as CustomersScreen } from "./CustomersScreen-DEFY3mRL.mjs";
|
|
43
|
+
import { n as useAppNavigation, t as AppNavigationProvider } from "./AppNavigationContext-BSnbFILQ.mjs";
|
|
44
|
+
import "./order-detail-B5X_QRpi.mjs";
|
|
45
|
+
import { r as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-D3LAx25s.mjs";
|
|
46
|
+
import "./dist-CkIGP8my.mjs";
|
|
47
|
+
import "./es-Dlib2eNY.mjs";
|
|
48
|
+
import { r as contactsScreenPropertySchema, t as ContactsScreen } from "./ContactsScreen-DrkHWPMm.mjs";
|
|
49
|
+
import "./src-B7j_mfeS.mjs";
|
|
50
|
+
import "./dist-C9vpl_rR.mjs";
|
|
51
|
+
import { r as ordersScreenPropertySchema, t as OrdersScreen } from "./OrdersScreen-CfAmUUN3.mjs";
|
|
52
|
+
import "./src-BjmyVJoe.mjs";
|
|
53
|
+
import { r as shopScreenPropertySchema, t as ShopScreen } from "./ShopScreen-B0Pr0CTu.mjs";
|
|
54
54
|
import "./sortable.esm-CzzU6kIR.mjs";
|
|
55
|
-
import { n as productsScreenPropertySchema, t as ProductsScreen } from "./ProductsScreen-
|
|
56
|
-
import { r as mySiteScreenPropertySchema, t as MySiteScreen } from "./MySiteScreen-
|
|
55
|
+
import { n as productsScreenPropertySchema, t as ProductsScreen } from "./ProductsScreen-CGo9KQ9L.mjs";
|
|
56
|
+
import { r as mySiteScreenPropertySchema, t as MySiteScreen } from "./MySiteScreen-BedF13nt.mjs";
|
|
57
57
|
import "./UpgradeScreen-CaTBqSyO.mjs";
|
|
58
58
|
import "./AppDownloadScreen-BE6M8WxN.mjs";
|
|
59
59
|
import * as React$1 from "react";
|
|
@@ -1156,6 +1156,22 @@ const SYSTEM_NAVIGATION_SLUGS = [
|
|
|
1156
1156
|
"shop",
|
|
1157
1157
|
"upgrade"
|
|
1158
1158
|
];
|
|
1159
|
+
/**
|
|
1160
|
+
* Slugs restricted to rep (non-customer) users.
|
|
1161
|
+
* Customers will not see these in navigation and cannot access these routes.
|
|
1162
|
+
*/
|
|
1163
|
+
const REP_ONLY_SLUGS = new Set(["messages", "my-site"]);
|
|
1164
|
+
/**
|
|
1165
|
+
* Check if a slug is restricted to rep users only.
|
|
1166
|
+
* Handles both exact matches and prefix matches (e.g. "contacts/123").
|
|
1167
|
+
*/
|
|
1168
|
+
function isRepOnlySlug(slug) {
|
|
1169
|
+
if (!slug) return false;
|
|
1170
|
+
const normalized = slug.startsWith("/") ? slug.slice(1) : slug;
|
|
1171
|
+
if (REP_ONLY_SLUGS.has(normalized)) return true;
|
|
1172
|
+
for (const repSlug of REP_ONLY_SLUGS) if (normalized.startsWith(repSlug + "/")) return true;
|
|
1173
|
+
return false;
|
|
1174
|
+
}
|
|
1159
1175
|
const SYSTEM_NAVIGATION_ITEMS = {
|
|
1160
1176
|
"app-download": {
|
|
1161
1177
|
slug: "app-download",
|
|
@@ -1672,6 +1688,43 @@ function SdkNavigation({ navItems, currentSlug, onNavigate }) {
|
|
|
1672
1688
|
}) });
|
|
1673
1689
|
}
|
|
1674
1690
|
//#endregion
|
|
1691
|
+
//#region src/navigation/filter-nav-items.ts
|
|
1692
|
+
/**
|
|
1693
|
+
* Filter navigation items by removing rep-only slugs.
|
|
1694
|
+
* Handles nested children: rep-only children are removed, and parents
|
|
1695
|
+
* with no remaining children are also removed.
|
|
1696
|
+
*/
|
|
1697
|
+
function filterRepOnlyNavItems(items) {
|
|
1698
|
+
const result = [];
|
|
1699
|
+
for (const item of items) {
|
|
1700
|
+
if (!item.children?.length) {
|
|
1701
|
+
if (isRepOnlySlug(item.slug)) continue;
|
|
1702
|
+
result.push(item);
|
|
1703
|
+
continue;
|
|
1704
|
+
}
|
|
1705
|
+
if (isRepOnlySlug(item.slug)) continue;
|
|
1706
|
+
const filteredChildren = filterRepOnlyNavItems(item.children);
|
|
1707
|
+
if (filteredChildren.length === 0) continue;
|
|
1708
|
+
result.push({
|
|
1709
|
+
...item,
|
|
1710
|
+
children: filteredChildren
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
return result;
|
|
1714
|
+
}
|
|
1715
|
+
/**
|
|
1716
|
+
* Filter system navigation sections by removing rep-only items.
|
|
1717
|
+
* Sections with no remaining items are dropped entirely.
|
|
1718
|
+
*/
|
|
1719
|
+
function filterRepOnlySections(sections) {
|
|
1720
|
+
const filtered = {};
|
|
1721
|
+
for (const [section, items] of Object.entries(sections)) {
|
|
1722
|
+
const allowed = items.filter((item) => !isRepOnlySlug(item.slug));
|
|
1723
|
+
if (allowed.length > 0) filtered[section] = allowed;
|
|
1724
|
+
}
|
|
1725
|
+
return filtered;
|
|
1726
|
+
}
|
|
1727
|
+
//#endregion
|
|
1675
1728
|
//#region src/shell/QuickLinksDropdown.tsx
|
|
1676
1729
|
function QuickLinksDropdown({ onNavigate }) {
|
|
1677
1730
|
const [open, setOpen] = useState(false);
|
|
@@ -1693,7 +1746,11 @@ function QuickLinksDropdown({ onNavigate }) {
|
|
|
1693
1746
|
document.removeEventListener("keydown", handleKeyDown);
|
|
1694
1747
|
};
|
|
1695
1748
|
}, [open, close]);
|
|
1696
|
-
const
|
|
1749
|
+
const { isCustomer } = useUserType();
|
|
1750
|
+
const sections = useMemo(() => {
|
|
1751
|
+
const all = getSystemNavigationBySection();
|
|
1752
|
+
return isCustomer ? filterRepOnlySections(all) : all;
|
|
1753
|
+
}, [isCustomer]);
|
|
1697
1754
|
const handleItemClick = (slug) => {
|
|
1698
1755
|
onNavigate(slug);
|
|
1699
1756
|
close();
|
|
@@ -1750,7 +1807,11 @@ function QuickLinksDropdown({ onNavigate }) {
|
|
|
1750
1807
|
//#endregion
|
|
1751
1808
|
//#region src/shell/SdkMobileQuickLinksGrid.tsx
|
|
1752
1809
|
function SdkMobileQuickLinksGrid({ onNavigate }) {
|
|
1753
|
-
const
|
|
1810
|
+
const { isCustomer } = useUserType();
|
|
1811
|
+
const sections = useMemo(() => {
|
|
1812
|
+
const all = getSystemNavigationBySection();
|
|
1813
|
+
return isCustomer ? filterRepOnlySections(all) : all;
|
|
1814
|
+
}, [isCustomer]);
|
|
1754
1815
|
return /* @__PURE__ */ jsx("div", {
|
|
1755
1816
|
className: "space-y-4",
|
|
1756
1817
|
children: Object.entries(sections).map(([sectionName, items]) => /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h4", {
|
|
@@ -2353,6 +2414,33 @@ const ACCOUNT_MANAGE_TABS = ACCOUNT_MANAGE_SLUGS.map((slug) => ({
|
|
|
2353
2414
|
label: SYSTEM_NAVIGATION_ITEMS[slug].label,
|
|
2354
2415
|
slug
|
|
2355
2416
|
}));
|
|
2417
|
+
//#endregion
|
|
2418
|
+
//#region src/screens/AccessDeniedScreen.tsx
|
|
2419
|
+
/**
|
|
2420
|
+
* Shown when a customer attempts to access a rep-only page via direct URL.
|
|
2421
|
+
*/
|
|
2422
|
+
function AccessDeniedScreen() {
|
|
2423
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2424
|
+
className: "flex min-h-[400px] items-center justify-center",
|
|
2425
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
2426
|
+
className: "border-border max-w-sm rounded-lg border border-dashed p-8 text-center",
|
|
2427
|
+
children: [
|
|
2428
|
+
/* @__PURE__ */ jsx("h2", {
|
|
2429
|
+
className: "text-foreground text-xl font-semibold",
|
|
2430
|
+
children: "Access Denied"
|
|
2431
|
+
}),
|
|
2432
|
+
/* @__PURE__ */ jsx("p", {
|
|
2433
|
+
className: "text-muted-foreground mt-2",
|
|
2434
|
+
children: "You don't have permission to view this page."
|
|
2435
|
+
}),
|
|
2436
|
+
/* @__PURE__ */ jsx("p", {
|
|
2437
|
+
className: "text-muted-foreground mt-1 text-sm",
|
|
2438
|
+
children: "This feature is not available for your account type."
|
|
2439
|
+
})
|
|
2440
|
+
]
|
|
2441
|
+
})
|
|
2442
|
+
});
|
|
2443
|
+
}
|
|
2356
2444
|
/** Lookup map for O(1) preset resolution */
|
|
2357
2445
|
const PRESET_MAP = new Map([
|
|
2358
2446
|
{
|
|
@@ -2906,15 +2994,15 @@ function AccountManageLayout({ children }) {
|
|
|
2906
2994
|
//#endregion
|
|
2907
2995
|
//#region src/shell/system-screen-map.ts
|
|
2908
2996
|
const ProfileScreen$1 = lazy(() => import("./ProfileScreen-C4g7ZGPo.mjs").then((n) => n.n).then((m) => ({ default: m.ProfileScreen })));
|
|
2909
|
-
const OrdersScreen$1 = lazy(() => import("./OrdersScreen-
|
|
2910
|
-
const SubscriptionsScreen$1 = lazy(() => import("./SubscriptionsScreen-
|
|
2911
|
-
const MessagingScreen$1 = lazy(() => import("./MessagingScreen-
|
|
2912
|
-
const ContactsScreen$1 = lazy(() => import("./ContactsScreen-
|
|
2913
|
-
const ShopScreen$1 = lazy(() => import("./ShopScreen-
|
|
2914
|
-
const CustomersScreen$1 = lazy(() => import("./CustomersScreen-
|
|
2915
|
-
const ProductsScreen$1 = lazy(() => import("./ProductsScreen-
|
|
2916
|
-
const ShareablesScreen$1 = lazy(() => import("./ShareablesScreen-
|
|
2917
|
-
const MySiteScreen$1 = lazy(() => import("./MySiteScreen-
|
|
2997
|
+
const OrdersScreen$1 = lazy(() => import("./OrdersScreen-CfAmUUN3.mjs").then((n) => n.n).then((m) => ({ default: m.OrdersScreen })));
|
|
2998
|
+
const SubscriptionsScreen$1 = lazy(() => import("./SubscriptionsScreen-D3LAx25s.mjs").then((n) => n.n).then((m) => ({ default: m.SubscriptionsScreen })));
|
|
2999
|
+
const MessagingScreen$1 = lazy(() => import("./MessagingScreen-C4-8_bvB.mjs").then((m) => ({ default: m.MessagingScreen })));
|
|
3000
|
+
const ContactsScreen$1 = lazy(() => import("./ContactsScreen-DrkHWPMm.mjs").then((n) => n.n).then((m) => ({ default: m.ContactsScreen })));
|
|
3001
|
+
const ShopScreen$1 = lazy(() => import("./ShopScreen-B0Pr0CTu.mjs").then((n) => n.n).then((m) => ({ default: m.ShopScreen })));
|
|
3002
|
+
const CustomersScreen$1 = lazy(() => import("./CustomersScreen-DEFY3mRL.mjs").then((n) => n.n).then((m) => ({ default: m.CustomersScreen })));
|
|
3003
|
+
const ProductsScreen$1 = lazy(() => import("./ProductsScreen-CgG79XW9.mjs").then((m) => ({ default: m.ProductsScreen })));
|
|
3004
|
+
const ShareablesScreen$1 = lazy(() => import("./ShareablesScreen-BmKYYRZq.mjs").then((m) => ({ default: m.ShareablesScreen })));
|
|
3005
|
+
const MySiteScreen$1 = lazy(() => import("./MySiteScreen-BedF13nt.mjs").then((n) => n.n).then((m) => ({ default: m.MySiteScreen })));
|
|
2918
3006
|
const UpgradeScreen = lazy(() => import("./UpgradeScreen-CaTBqSyO.mjs").then((n) => n.t).then((m) => ({ default: m.UpgradeScreen })));
|
|
2919
3007
|
const AppDownloadScreen = lazy(() => import("./AppDownloadScreen-BE6M8WxN.mjs").then((n) => n.t).then((m) => ({ default: m.AppDownloadScreen })));
|
|
2920
3008
|
const SYSTEM_SLUG_SCREEN_MAP = {
|
|
@@ -2946,6 +3034,7 @@ function findScreenByPrefix(slug) {
|
|
|
2946
3034
|
//#region src/shell/PageRouter.tsx
|
|
2947
3035
|
const ACCOUNT_SLUGS = new Set(ACCOUNT_MANAGE_SLUGS);
|
|
2948
3036
|
function PageRouter({ currentSlug, currentNavItem, customPages, screens, baseSlug, restParams }) {
|
|
3037
|
+
const { isCustomer } = useUserType();
|
|
2949
3038
|
const screenById = useMemo(() => {
|
|
2950
3039
|
if (!screens || screens.length === 0) return void 0;
|
|
2951
3040
|
return new Map(screens.map((s) => [s.id, s]));
|
|
@@ -2967,6 +3056,7 @@ function PageRouter({ currentSlug, currentNavItem, customPages, screens, baseSlu
|
|
|
2967
3056
|
currentSlug,
|
|
2968
3057
|
baseSlug
|
|
2969
3058
|
]);
|
|
3059
|
+
if (isCustomer && isRepOnlySlug(currentSlug)) return /* @__PURE__ */ jsx(AccessDeniedScreen, {});
|
|
2970
3060
|
const ExactCustomPage = customPages?.[currentSlug];
|
|
2971
3061
|
if (ExactCustomPage) return /* @__PURE__ */ jsx(ExactCustomPage, {
|
|
2972
3062
|
slug: currentSlug,
|
|
@@ -3214,8 +3304,11 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
3214
3304
|
if (mobileNav && mobileNav.length > 0) return mobileNav;
|
|
3215
3305
|
return navItems;
|
|
3216
3306
|
}, [appData?.profile?.mobile_navigation?.navigation_items, navItems]);
|
|
3307
|
+
const { isCustomer } = useUserType();
|
|
3308
|
+
const filteredNavItems = useMemo(() => isCustomer ? filterRepOnlyNavItems(navItems) : navItems, [navItems, isCustomer]);
|
|
3309
|
+
const filteredMobileNavItems = useMemo(() => isCustomer ? filterRepOnlyNavItems(mobileNavItems) : mobileNavItems, [mobileNavItems, isCustomer]);
|
|
3217
3310
|
const screens = appData?.screens;
|
|
3218
|
-
const navSlugs = useMemo(() => collectNavSlugs(
|
|
3311
|
+
const navSlugs = useMemo(() => collectNavSlugs(filteredNavItems), [filteredNavItems]);
|
|
3219
3312
|
const [themeMode, setThemeMode] = useState(getInitialThemeMode);
|
|
3220
3313
|
const handleThemeModeChange = useCallback((mode) => {
|
|
3221
3314
|
setThemeMode(mode);
|
|
@@ -3269,7 +3362,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
3269
3362
|
if (controlledSlug !== void 0) return;
|
|
3270
3363
|
if (typeof window === "undefined") return;
|
|
3271
3364
|
if (!extractSlugFromPathname(window.location.pathname, normalizedBasePath)) {
|
|
3272
|
-
const firstSlug = findFirstNavigableSlug(
|
|
3365
|
+
const firstSlug = findFirstNavigableSlug(filteredNavItems);
|
|
3273
3366
|
if (firstSlug) {
|
|
3274
3367
|
const targetPath = normalizedBasePath === "/" ? `/${firstSlug}` : `${normalizedBasePath}/${firstSlug}`;
|
|
3275
3368
|
history.replaceState(null, "", targetPath);
|
|
@@ -3277,7 +3370,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
3277
3370
|
}
|
|
3278
3371
|
}
|
|
3279
3372
|
}, [
|
|
3280
|
-
|
|
3373
|
+
filteredNavItems,
|
|
3281
3374
|
controlledSlug,
|
|
3282
3375
|
normalizedBasePath
|
|
3283
3376
|
]);
|
|
@@ -3307,8 +3400,8 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
3307
3400
|
const slugMatch = useMemo(() => matchSlugPrefix(activeSlug, navSlugs), [activeSlug, navSlugs]);
|
|
3308
3401
|
const baseSlug = slugMatch?.matchedSlug ?? normalizeSlug(activeSlug);
|
|
3309
3402
|
const restParams = slugMatch?.rest ?? "";
|
|
3310
|
-
const mobileSecondLevelTabs = findCurrentSection(
|
|
3311
|
-
const currentNavItem = findNavItem(
|
|
3403
|
+
const mobileSecondLevelTabs = findCurrentSection(filteredMobileNavItems, baseSlug)?.children ?? [];
|
|
3404
|
+
const currentNavItem = findNavItem(filteredNavItems, baseSlug);
|
|
3312
3405
|
const screenTitle = currentNavItem?.label || screens?.find((s) => s.id === currentNavItem?.screen_id)?.name || void 0;
|
|
3313
3406
|
const content = typeof children === "function" ? children({
|
|
3314
3407
|
currentSlug: activeSlug,
|
|
@@ -3338,7 +3431,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
3338
3431
|
navigate: handleNavigate,
|
|
3339
3432
|
children: /* @__PURE__ */ jsx(AppShellLayout, {
|
|
3340
3433
|
sidebarContent: /* @__PURE__ */ jsx(SdkNavigation, {
|
|
3341
|
-
navItems,
|
|
3434
|
+
navItems: filteredNavItems,
|
|
3342
3435
|
currentSlug: activeSlug,
|
|
3343
3436
|
onNavigate: handleNavigate
|
|
3344
3437
|
}),
|
|
@@ -3352,7 +3445,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
|
|
|
3352
3445
|
sidebarFooter: resolvedSidebarFooter,
|
|
3353
3446
|
useBottomNav: true,
|
|
3354
3447
|
afterContent: /* @__PURE__ */ jsx(SdkBottomNav, {
|
|
3355
|
-
navItems:
|
|
3448
|
+
navItems: filteredMobileNavItems,
|
|
3356
3449
|
currentSlug: activeSlug,
|
|
3357
3450
|
onNavigate: handleNavigate,
|
|
3358
3451
|
appDefinitionId: appData?.definition_id ?? 0
|
|
@@ -4370,15 +4463,15 @@ function useContact(_contactId) {
|
|
|
4370
4463
|
//#region src/screens/index.ts
|
|
4371
4464
|
const screenPropertySchemas = {
|
|
4372
4465
|
ProfileScreen: () => import("./ProfileScreen-C4g7ZGPo.mjs").then((n) => n.n).then((m) => m.profileScreenPropertySchema),
|
|
4373
|
-
MessagingScreen: () => import("./MessagingScreen-
|
|
4374
|
-
ContactsScreen: () => import("./ContactsScreen-
|
|
4375
|
-
OrdersScreen: () => import("./OrdersScreen-
|
|
4376
|
-
SubscriptionsScreen: () => import("./SubscriptionsScreen-
|
|
4377
|
-
CustomersScreen: () => import("./CustomersScreen-
|
|
4378
|
-
ProductsScreen: () => import("./ProductsScreen-
|
|
4379
|
-
MySiteScreen: () => import("./MySiteScreen-
|
|
4380
|
-
ShareablesScreen: () => import("./ShareablesScreen-
|
|
4381
|
-
ShopScreen: () => import("./ShopScreen-
|
|
4466
|
+
MessagingScreen: () => import("./MessagingScreen-C4-8_bvB.mjs").then((m) => m.messagingScreenPropertySchema),
|
|
4467
|
+
ContactsScreen: () => import("./ContactsScreen-DrkHWPMm.mjs").then((n) => n.n).then((m) => m.contactsScreenPropertySchema),
|
|
4468
|
+
OrdersScreen: () => import("./OrdersScreen-CfAmUUN3.mjs").then((n) => n.n).then((m) => m.ordersScreenPropertySchema),
|
|
4469
|
+
SubscriptionsScreen: () => import("./SubscriptionsScreen-D3LAx25s.mjs").then((n) => n.n).then((m) => m.subscriptionsScreenPropertySchema),
|
|
4470
|
+
CustomersScreen: () => import("./CustomersScreen-DEFY3mRL.mjs").then((n) => n.n).then((m) => m.customersScreenPropertySchema),
|
|
4471
|
+
ProductsScreen: () => import("./ProductsScreen-CgG79XW9.mjs").then((m) => m.productsScreenPropertySchema),
|
|
4472
|
+
MySiteScreen: () => import("./MySiteScreen-BedF13nt.mjs").then((n) => n.n).then((m) => m.mySiteScreenPropertySchema),
|
|
4473
|
+
ShareablesScreen: () => import("./ShareablesScreen-BmKYYRZq.mjs").then((m) => m.shareablesScreenPropertySchema),
|
|
4474
|
+
ShopScreen: () => import("./ShopScreen-B0Pr0CTu.mjs").then((n) => n.n).then((m) => m.shopScreenPropertySchema),
|
|
4382
4475
|
UpgradeScreen: () => import("./UpgradeScreen-CaTBqSyO.mjs").then((n) => n.t).then((m) => m.upgradeScreenPropertySchema),
|
|
4383
4476
|
AppDownloadScreen: () => import("./AppDownloadScreen-BE6M8WxN.mjs").then((n) => n.t).then((m) => m.appDownloadScreenPropertySchema)
|
|
4384
4477
|
};
|
|
@@ -4717,6 +4810,6 @@ const SCAFFOLD_MANIFEST = {
|
|
|
4717
4810
|
]
|
|
4718
4811
|
};
|
|
4719
4812
|
//#endregion
|
|
4720
|
-
export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, AUTH_CONSTANTS, AlertWidget, ApiError, AppLink, AppNavigationProvider, AppShell, AuthError, AuthLoading, BuilderScreenView, BulletListWidget, CORE_PAGE_IDS, CURRENT_REP_QUERY_KEY, CURRENT_USER_QUERY_KEY, CalendarWidget, CardWidget, CarouselWidget, CatchUpWidget, ChartWidget, ContactsScreen, ContainerWidget, CustomersScreen, DEFAULT_AUTH_URL, DEFAULT_COLORS, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_RADII, DEFAULT_SDK_WIDGET_REGISTRY, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_THEME_NAME, EmbedWidget, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, FluidAuthProvider, FluidProvider, FluidThemeProvider, ImageWidget, LayoutWidget, LinkWidget, ListWidget, MessagingScreen, MySiteScreen, MySiteWidget, NestedWidget, OrdersScreen, PAGE_CATEGORIES, PERMISSIONS_QUERY_KEY, PROFILE_QUERY_KEY, PROPERTY_FIELD_TYPES, PageRouter, PageTemplateProvider, PageTemplateRegistry, PointsWidget, ProductsScreen, ProfileScreen, QuickLinksDropdown, QuickShareWidget, RADIUS_KEYS, RecentActivityWidget, RequireAuth, SCAFFOLD_MANIFEST, SEMANTIC_COLOR_NAMES, SHADE_STEPS, STORAGE_KEYS, SdkCompanySwitcher, SdkHeader, SdkNavigation, SeparatorWidget, ShareablesScreen, ShopScreen, SpacerWidget, SubscriptionsScreen, TableWidget, TextWidget, ThemeModeProvider, ToDoWidget, URL_PARAMS, USER_TYPES, VideoWidget, WIDGET_TYPE_NAMES, alertWidgetPropertySchema, applyTheme, assertDefined, assertNever, buildThemeDefinition, buildWidgetRegistry, bulletListWidgetPropertySchema, calendarWidgetPropertySchema, cardWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, cleanTokenFromUrl, clearTokens, collectNavSlugs, contactsScreenPropertySchema, containerWidgetPropertySchema, createCompanyQueryKey, createDefaultAuthConfig, createDefaultAuthRedirect, createDefaultFluidConfig, createFluidClient, createFluidFileUploader, createPortal, createScreen, createWidgetFromShareable, createWidgetRegistry, customersScreenPropertySchema, decodeToken, deriveDarkVariant, deserialiseTheme, embedWidgetPropertySchema, extractAllTokensFromUrl, extractCompanyTokenFromUrl, extractSlugFromPathname, extractTokenFromUrl, gapValues, generateShades, generateThemeCSS, getActiveThemeId, getAvailablePageTemplates, getCorePageTemplates, getDefaultThemeDefinition, getForegroundColor, getOptionalPageTemplates, getProperty, getStoredToken, getThemeModeAttribute, getTokenExpiration, getTokenTimeRemaining, groupChildrenByColumn, hasData, hasStoredToken, hasTokenInUrl, imageWidgetPropertySchema, isActivitySlug, isApiError, isContactStatus, isErrorResult, isIdle, isLoading, isPropertyFieldType, isSlugInSection, isTokenExpired, isUserType, isValidToken, isWidgetType, isWidgetTypeName, layoutWidgetPropertySchema, linkWidgetPropertySchema, listWidgetPropertySchema, matchSlugPrefix, mergeDarkOverrides, messagingScreenPropertySchema, mySiteScreenPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, normalizeComponentTree, ordersScreenPropertySchema, parseColor, pointsWidgetPropertySchema, productsScreenPropertySchema, profileScreenPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, removeAllThemes, removeTheme, resolveNavigationPages, resolveTheme, screenPropertySchemas, sectionLayoutConfig, selectProperty, separatorWidgetPropertySchema, serialiseTheme, shareablesScreenPropertySchema, shopScreenPropertySchema, spacerWidgetPropertySchema, storeToken, subscriptionsScreenPropertySchema, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, toNavigationItem, toScreenDefinition, transformManifestToRepAppData, transformThemes, useActivities, useAppNavigation, useCalendarEvents, useCatchUps, useCompanyScopedQueryKey, useCompanySwitch, useContact, useContacts, useConversationMessages, useConversations, useCurrentRep, useCurrentUser, useFluidApi, useFluidApp, useFluidAuth, useFluidAuthContext, useFluidContext, useFluidPermissions, useFluidProfile, useFluidTheme, useLogout, useMessagingAuth, useMessagingConfig, useMySite, usePageTemplates, useResolvedPages, useThemeContext, useThemeMode, useTodos, validateNavigationPages, validateToken, videoWidgetPropertySchema, widgetPropertySchemas };
|
|
4813
|
+
export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, AUTH_CONSTANTS, AlertWidget, ApiError, AppLink, AppNavigationProvider, AppShell, AuthError, AuthLoading, BuilderScreenView, BulletListWidget, CORE_PAGE_IDS, CURRENT_REP_QUERY_KEY, CURRENT_USER_QUERY_KEY, CalendarWidget, CardWidget, CarouselWidget, CatchUpWidget, ChartWidget, ContactsScreen, ContainerWidget, CustomersScreen, DEFAULT_AUTH_URL, DEFAULT_COLORS, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_RADII, DEFAULT_SDK_WIDGET_REGISTRY, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_THEME_NAME, EmbedWidget, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, FluidAuthProvider, FluidProvider, FluidThemeProvider, ImageWidget, LayoutWidget, LinkWidget, ListWidget, MessagingScreen, MySiteScreen, MySiteWidget, NestedWidget, OrdersScreen, PAGE_CATEGORIES, PERMISSIONS_QUERY_KEY, PROFILE_QUERY_KEY, PROPERTY_FIELD_TYPES, PageRouter, PageTemplateProvider, PageTemplateRegistry, PointsWidget, ProductsScreen, ProfileScreen, QuickLinksDropdown, QuickShareWidget, RADIUS_KEYS, RecentActivityWidget, RequireAuth, SCAFFOLD_MANIFEST, SEMANTIC_COLOR_NAMES, SHADE_STEPS, STORAGE_KEYS, SdkCompanySwitcher, SdkHeader, SdkNavigation, SeparatorWidget, ShareablesScreen, ShopScreen, SpacerWidget, SubscriptionsScreen, TableWidget, TextWidget, ThemeModeProvider, ToDoWidget, URL_PARAMS, USER_TYPES, VideoWidget, WIDGET_TYPE_NAMES, alertWidgetPropertySchema, applyTheme, assertDefined, assertNever, buildThemeDefinition, buildWidgetRegistry, bulletListWidgetPropertySchema, calendarWidgetPropertySchema, cardWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, cleanTokenFromUrl, clearTokens, collectNavSlugs, contactsScreenPropertySchema, containerWidgetPropertySchema, createCompanyQueryKey, createDefaultAuthConfig, createDefaultAuthRedirect, createDefaultFluidConfig, createFluidClient, createFluidFileUploader, createPortal, createScreen, createWidgetFromShareable, createWidgetRegistry, customersScreenPropertySchema, decodeToken, deriveDarkVariant, deserialiseTheme, embedWidgetPropertySchema, extractAllTokensFromUrl, extractCompanyTokenFromUrl, extractSlugFromPathname, extractTokenFromUrl, filterRepOnlyNavItems, gapValues, generateShades, generateThemeCSS, getActiveThemeId, getAvailablePageTemplates, getCorePageTemplates, getDefaultThemeDefinition, getForegroundColor, getOptionalPageTemplates, getProperty, getStoredToken, getThemeModeAttribute, getTokenExpiration, getTokenTimeRemaining, groupChildrenByColumn, hasData, hasStoredToken, hasTokenInUrl, imageWidgetPropertySchema, isActivitySlug, isApiError, isContactStatus, isErrorResult, isIdle, isLoading, isPropertyFieldType, isSlugInSection, isTokenExpired, isUserType, isValidToken, isWidgetType, isWidgetTypeName, layoutWidgetPropertySchema, linkWidgetPropertySchema, listWidgetPropertySchema, matchSlugPrefix, mergeDarkOverrides, messagingScreenPropertySchema, mySiteScreenPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, normalizeComponentTree, ordersScreenPropertySchema, parseColor, pointsWidgetPropertySchema, productsScreenPropertySchema, profileScreenPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, removeAllThemes, removeTheme, resolveNavigationPages, resolveTheme, screenPropertySchemas, sectionLayoutConfig, selectProperty, separatorWidgetPropertySchema, serialiseTheme, shareablesScreenPropertySchema, shopScreenPropertySchema, spacerWidgetPropertySchema, storeToken, subscriptionsScreenPropertySchema, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, toNavigationItem, toScreenDefinition, transformManifestToRepAppData, transformThemes, useActivities, useAppNavigation, useCalendarEvents, useCatchUps, useCompanyScopedQueryKey, useCompanySwitch, useContact, useContacts, useConversationMessages, useConversations, useCurrentRep, useCurrentUser, useFluidApi, useFluidApp, useFluidAuth, useFluidAuthContext, useFluidContext, useFluidPermissions, useFluidProfile, useFluidTheme, useLogout, useMessagingAuth, useMessagingConfig, useMySite, usePageTemplates, useResolvedPages, useThemeContext, useThemeMode, useTodos, useUserType, validateNavigationPages, validateToken, videoWidgetPropertySchema, widgetPropertySchemas };
|
|
4721
4814
|
|
|
4722
4815
|
//# sourceMappingURL=index.mjs.map
|