@fluid-app/portal-sdk 0.1.13 → 0.1.15
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/AccountScreen-B08uxzt6.mjs +2 -0
- package/dist/AccountScreen-CQCwpKEC.mjs +741 -0
- package/dist/AccountScreen-CQCwpKEC.mjs.map +1 -0
- package/dist/AccountScreen-CbhrIAa4.cjs +780 -0
- package/dist/AccountScreen-CbhrIAa4.cjs.map +1 -0
- package/dist/{ContactsScreen-CB6l0Lf1.mjs → ContactsScreen-CHLFZX_N.mjs} +2 -2
- package/dist/{ContactsScreen-CB6l0Lf1.mjs.map → ContactsScreen-CHLFZX_N.mjs.map} +1 -1
- package/dist/{ContactsScreen-Dwn5onLu.cjs → ContactsScreen-CjnCemeI.cjs} +4 -4
- package/dist/{ContactsScreen-Dwn5onLu.cjs.map → ContactsScreen-CjnCemeI.cjs.map} +1 -1
- package/dist/{CoreScreenPlaceholder-Bw8YOPwv.cjs → CoreScreenPlaceholder-C9lBkcyc.cjs} +2 -2
- package/dist/{CoreScreenPlaceholder-Bw8YOPwv.cjs.map → CoreScreenPlaceholder-C9lBkcyc.cjs.map} +1 -1
- package/dist/{CoreScreenPlaceholder-D93ZYKt2.mjs → CoreScreenPlaceholder-DCJ1hFvJ.mjs} +1 -1
- package/dist/{CoreScreenPlaceholder-D93ZYKt2.mjs.map → CoreScreenPlaceholder-DCJ1hFvJ.mjs.map} +1 -1
- package/dist/{CustomersScreen-gQb6cWL5.cjs → CustomersScreen-CqwRJogV.cjs} +4 -4
- package/dist/{CustomersScreen-gQb6cWL5.cjs.map → CustomersScreen-CqwRJogV.cjs.map} +1 -1
- package/dist/{CustomersScreen-BEar6Leg.mjs → CustomersScreen-DBicCB3o.mjs} +2 -2
- package/dist/{CustomersScreen-BEar6Leg.mjs.map → CustomersScreen-DBicCB3o.mjs.map} +1 -1
- package/dist/{MessagingScreen-YyzXdr95.mjs → FluidProvider-BafZw8PJ.mjs} +6 -503
- package/dist/FluidProvider-BafZw8PJ.mjs.map +1 -0
- package/dist/{MessagingScreen-Ca22FObh.cjs → FluidProvider-C6SCZDjX.cjs} +3 -542
- package/dist/FluidProvider-C6SCZDjX.cjs.map +1 -0
- package/dist/MessagingScreen-Bd-1_J9q.cjs +369 -0
- package/dist/MessagingScreen-Bd-1_J9q.cjs.map +1 -0
- package/dist/MessagingScreen-D8W8V2TW.mjs +2 -0
- package/dist/MessagingScreen-DCS0mtbd.mjs +324 -0
- package/dist/MessagingScreen-DCS0mtbd.mjs.map +1 -0
- package/dist/{OrdersScreen-DB1v051q.mjs → OrdersScreen-B6JCMBY5.mjs} +2 -2
- package/dist/{OrdersScreen-DB1v051q.mjs.map → OrdersScreen-B6JCMBY5.mjs.map} +1 -1
- package/dist/{OrdersScreen-DbON-kBA.cjs → OrdersScreen-DBxpXgZ9.cjs} +4 -4
- package/dist/{OrdersScreen-DbON-kBA.cjs.map → OrdersScreen-DBxpXgZ9.cjs.map} +1 -1
- package/dist/{ProductsScreen-CMDGGvE2.cjs → ProductsScreen-BK8cz_MN.cjs} +4 -4
- package/dist/{ProductsScreen-CMDGGvE2.cjs.map → ProductsScreen-BK8cz_MN.cjs.map} +1 -1
- package/dist/{ProductsScreen-nVDsY6kf.mjs → ProductsScreen-DafsauTY.mjs} +2 -2
- package/dist/{ProductsScreen-nVDsY6kf.mjs.map → ProductsScreen-DafsauTY.mjs.map} +1 -1
- package/dist/index.cjs +73 -138
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -22
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +29 -22
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +49 -116
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -13
- package/dist/MessagingScreen-Ca22FObh.cjs.map +0 -1
- package/dist/MessagingScreen-YyzXdr95.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { r as
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
6
|
-
import { r as
|
|
1
|
+
import { _ as normalizeComponentTree, a as useFluidAuthContext, b as createDefaultAuthRedirect, c as themes_exports, d as isApiError, f as buildThemeDefinition, g as toNavigationItem, h as transformThemes, i as FluidAuthProvider, l as ApiError, m as transformManifestToRepAppData, n as useFluidContext, o as FluidThemeProvider, p as getActiveThemeId, r as DEFAULT_SDK_WIDGET_REGISTRY, s as useThemeContext, t as FluidProvider, u as createFluidClient, v as toScreenDefinition, y as DEFAULT_AUTH_URL } from "./FluidProvider-BafZw8PJ.mjs";
|
|
2
|
+
import { a as useMessagingAuth, i as useMessagingConfig, n as messagingScreenPropertySchema, o as useFluidApi, r as createFluidFileUploader, t as MessagingScreen } from "./MessagingScreen-DCS0mtbd.mjs";
|
|
3
|
+
import { a as useFluidAuth, i as useAppNavigation, n as accountScreenPropertySchema, r as AppNavigationProvider, t as AccountScreen } from "./AccountScreen-CQCwpKEC.mjs";
|
|
4
|
+
import { t as CoreScreenPlaceholder } from "./CoreScreenPlaceholder-DCJ1hFvJ.mjs";
|
|
5
|
+
import { r as contactsScreenPropertySchema, t as ContactsScreen } from "./ContactsScreen-CHLFZX_N.mjs";
|
|
6
|
+
import { r as ordersScreenPropertySchema, t as OrdersScreen } from "./OrdersScreen-B6JCMBY5.mjs";
|
|
7
|
+
import { r as customersScreenPropertySchema, t as CustomersScreen } from "./CustomersScreen-DBicCB3o.mjs";
|
|
8
|
+
import { r as productsScreenPropertySchema, t as ProductsScreen } from "./ProductsScreen-DafsauTY.mjs";
|
|
7
9
|
import * as React$1 from "react";
|
|
8
10
|
import { createContext, forwardRef, memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
9
11
|
import { useQuery } from "@tanstack/react-query";
|
|
@@ -14,21 +16,15 @@ import { useRegistry } from "@fluid-app/portal-widgets/contexts";
|
|
|
14
16
|
import { createScreen, createWidgetFromShareable, createWidgetRegistry, groupChildrenByColumn } from "@fluid-app/portal-core/widget-utils";
|
|
15
17
|
import { AlertWidget, CalendarWidget, CarouselWidget, CatchUpWidget, ChartWidget, ContainerWidget, EmbedWidget, ImageWidget, LayoutWidget, ListWidget, MySiteWidget, NestedWidget, QuickShareWidget, RecentActivityWidget, SpacerWidget, TableWidget, TextWidget, ToDoWidget, VideoWidget, alertWidgetPropertySchema, calendarWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, containerWidgetPropertySchema, embedWidgetPropertySchema, imageWidgetPropertySchema, layoutWidgetPropertySchema, listWidgetPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, spacerWidgetPropertySchema, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, videoWidgetPropertySchema, widgetPropertySchemas } from "@fluid-app/portal-widgets/widgets";
|
|
16
18
|
import { WIDGET_TYPE_NAMES, assertDefined, assertNever, isWidgetType, isWidgetTypeName, sectionLayoutConfig } from "@fluid-app/portal-core/types";
|
|
19
|
+
import { Ellipsis, LayoutGrid, Menu, Moon, Sun, X } from "lucide-react";
|
|
17
20
|
import { PROPERTY_FIELD_TYPES, gapValues, isPropertyFieldType } from "@fluid-app/portal-core/registries";
|
|
18
21
|
import { AppShellLayout } from "@fluid-app/portal-core/shell/AppShellLayout";
|
|
19
22
|
import { ThemeModeProvider, ThemeModeProvider as ThemeModeProvider$1, getThemeModeAttribute, useThemeMode, useThemeMode as useThemeMode$1 } from "@fluid-app/portal-core/shell/ThemeModeContext";
|
|
20
23
|
import { getSystemNavigationBySection, isSystemNavigationItem, normalizeSlug } from "@fluid-app/portal-core/navigation/system-navigation-items";
|
|
21
24
|
import { ScreenHeader } from "@fluid-app/portal-core/shell/ScreenHeader";
|
|
22
25
|
import { ScreenHeaderProvider } from "@fluid-app/portal-core/shell/ScreenHeaderContext";
|
|
23
|
-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
24
|
-
import { faEllipsis } from "@fortawesome/pro-regular-svg-icons/faEllipsis";
|
|
25
|
-
import { faXmark } from "@fortawesome/pro-regular-svg-icons/faXmark";
|
|
26
26
|
import { RepIcon } from "@fluid-app/portal-core/components/RepIcon";
|
|
27
27
|
import { SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from "@fluid-app/portal-core/shell/sidebar";
|
|
28
|
-
import { faBars } from "@fortawesome/pro-regular-svg-icons/faBars";
|
|
29
|
-
import { faSun } from "@fortawesome/pro-regular-svg-icons/faSun";
|
|
30
|
-
import { faMoon } from "@fortawesome/pro-regular-svg-icons/faMoon";
|
|
31
|
-
import { faTableCellsLarge } from "@fortawesome/pro-regular-svg-icons/faTableCellsLarge";
|
|
32
28
|
import { DataAwareWidget } from "@fluid-app/portal-core/data-sources/DataAwareWidget";
|
|
33
29
|
//#region src/types/page-template.ts
|
|
34
30
|
/**
|
|
@@ -1121,47 +1117,6 @@ function useCurrentUser() {
|
|
|
1121
1117
|
});
|
|
1122
1118
|
}
|
|
1123
1119
|
//#endregion
|
|
1124
|
-
//#region src/hooks/use-fluid-auth.ts
|
|
1125
|
-
/**
|
|
1126
|
-
* useFluidAuth Hook
|
|
1127
|
-
*
|
|
1128
|
-
* Provides access to authentication state and utilities.
|
|
1129
|
-
* This is the primary hook for interacting with auth in components.
|
|
1130
|
-
*/
|
|
1131
|
-
/**
|
|
1132
|
-
* Hook to access authentication state and utilities.
|
|
1133
|
-
*
|
|
1134
|
-
* Must be used within a `FluidAuthProvider`.
|
|
1135
|
-
*
|
|
1136
|
-
* @returns Authentication context with user info, loading state, and utilities
|
|
1137
|
-
* @throws Error if used outside FluidAuthProvider
|
|
1138
|
-
*
|
|
1139
|
-
* @example
|
|
1140
|
-
* ```tsx
|
|
1141
|
-
* function UserProfile() {
|
|
1142
|
-
* const { isAuthenticated, isLoading, user, clearAuth } = useFluidAuth();
|
|
1143
|
-
*
|
|
1144
|
-
* if (isLoading) {
|
|
1145
|
-
* return <Spinner />;
|
|
1146
|
-
* }
|
|
1147
|
-
*
|
|
1148
|
-
* if (!isAuthenticated) {
|
|
1149
|
-
* return <p>Please log in</p>;
|
|
1150
|
-
* }
|
|
1151
|
-
*
|
|
1152
|
-
* return (
|
|
1153
|
-
* <div>
|
|
1154
|
-
* <p>Welcome, {user.full_name}!</p>
|
|
1155
|
-
* <button onClick={clearAuth}>Log out</button>
|
|
1156
|
-
* </div>
|
|
1157
|
-
* );
|
|
1158
|
-
* }
|
|
1159
|
-
* ```
|
|
1160
|
-
*/
|
|
1161
|
-
function useFluidAuth() {
|
|
1162
|
-
return useFluidAuthContext();
|
|
1163
|
-
}
|
|
1164
|
-
//#endregion
|
|
1165
1120
|
//#region src/hooks/demo-data/calendar-events.ts
|
|
1166
1121
|
const now$4 = /* @__PURE__ */ new Date();
|
|
1167
1122
|
function daysFromNow$1(days, hour, minute = 0) {
|
|
@@ -2092,16 +2047,18 @@ function RequireAuth({ children, fallback = /* @__PURE__ */ jsx(AuthLoading, {})
|
|
|
2092
2047
|
//#endregion
|
|
2093
2048
|
//#region src/screens/index.ts
|
|
2094
2049
|
const screenPropertySchemas = {
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2050
|
+
AccountScreen: () => import("./AccountScreen-B08uxzt6.mjs").then((m) => m.accountScreenPropertySchema),
|
|
2051
|
+
MessagingScreen: () => import("./MessagingScreen-D8W8V2TW.mjs").then((m) => m.messagingScreenPropertySchema),
|
|
2052
|
+
ContactsScreen: () => import("./ContactsScreen-CHLFZX_N.mjs").then((n) => n.n).then((m) => m.contactsScreenPropertySchema),
|
|
2053
|
+
OrdersScreen: () => import("./OrdersScreen-B6JCMBY5.mjs").then((n) => n.n).then((m) => m.ordersScreenPropertySchema),
|
|
2054
|
+
CustomersScreen: () => import("./CustomersScreen-DBicCB3o.mjs").then((n) => n.n).then((m) => m.customersScreenPropertySchema),
|
|
2055
|
+
ProductsScreen: () => import("./ProductsScreen-DafsauTY.mjs").then((n) => n.n).then((m) => m.productsScreenPropertySchema)
|
|
2100
2056
|
};
|
|
2101
2057
|
/**
|
|
2102
2058
|
* Core page template IDs
|
|
2103
2059
|
*/
|
|
2104
2060
|
const CORE_PAGE_IDS = {
|
|
2061
|
+
ACCOUNT: "core-account",
|
|
2105
2062
|
MESSAGING: "core-messaging",
|
|
2106
2063
|
CONTACTS: "core-contacts",
|
|
2107
2064
|
ORDERS: "core-orders",
|
|
@@ -2113,6 +2070,27 @@ const CORE_PAGE_IDS = {
|
|
|
2113
2070
|
* These are automatically registered when the SDK is imported.
|
|
2114
2071
|
*/
|
|
2115
2072
|
function registerCorePageTemplates() {
|
|
2073
|
+
PageTemplateRegistry.register({
|
|
2074
|
+
id: CORE_PAGE_IDS.ACCOUNT,
|
|
2075
|
+
slug: "account",
|
|
2076
|
+
name: "Account",
|
|
2077
|
+
description: "Account management with profile, orders, and subscriptions",
|
|
2078
|
+
category: PAGE_CATEGORIES.CORE,
|
|
2079
|
+
tags: [
|
|
2080
|
+
"account",
|
|
2081
|
+
"profile",
|
|
2082
|
+
"orders",
|
|
2083
|
+
"subscriptions"
|
|
2084
|
+
],
|
|
2085
|
+
version: "1.0.0",
|
|
2086
|
+
isCore: true,
|
|
2087
|
+
component_tree: [{
|
|
2088
|
+
type: "AccountScreen",
|
|
2089
|
+
id: "account-screen-root",
|
|
2090
|
+
props: {}
|
|
2091
|
+
}],
|
|
2092
|
+
defaultProps: {}
|
|
2093
|
+
});
|
|
2116
2094
|
PageTemplateRegistry.register({
|
|
2117
2095
|
id: CORE_PAGE_IDS.MESSAGING,
|
|
2118
2096
|
slug: "messaging",
|
|
@@ -2263,10 +2241,7 @@ function SdkBottomNav({ navItems, currentSlug, onNavigate, maxVisibleItems = 5 }
|
|
|
2263
2241
|
type: "button",
|
|
2264
2242
|
onClick: () => setMoreOpen(true),
|
|
2265
2243
|
className: `flex flex-1 flex-col items-center justify-center gap-0.5 py-2 text-[10px] font-medium transition-colors ${overflowItems.some((item) => isInSection(item, currentSlug)) ? "text-primary" : "text-muted-foreground"}`,
|
|
2266
|
-
children: [/* @__PURE__ */ jsx(
|
|
2267
|
-
icon: faEllipsis,
|
|
2268
|
-
className: "size-5"
|
|
2269
|
-
}), /* @__PURE__ */ jsx("span", { children: "More" })]
|
|
2244
|
+
children: [/* @__PURE__ */ jsx(Ellipsis, { className: "size-5" }), /* @__PURE__ */ jsx("span", { children: "More" })]
|
|
2270
2245
|
})]
|
|
2271
2246
|
}), moreOpen && /* @__PURE__ */ jsxs("div", {
|
|
2272
2247
|
className: "fixed inset-0 z-50 flex flex-col",
|
|
@@ -2286,10 +2261,7 @@ function SdkBottomNav({ navItems, currentSlug, onNavigate, maxVisibleItems = 5 }
|
|
|
2286
2261
|
onClick: () => setMoreOpen(false),
|
|
2287
2262
|
className: "text-muted-foreground hover:bg-sidebar-accent flex items-center justify-center rounded-full p-1",
|
|
2288
2263
|
"aria-label": "Close",
|
|
2289
|
-
children: /* @__PURE__ */ jsx(
|
|
2290
|
-
icon: faXmark,
|
|
2291
|
-
className: "size-5"
|
|
2292
|
-
})
|
|
2264
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-5" })
|
|
2293
2265
|
})]
|
|
2294
2266
|
}), /* @__PURE__ */ jsx("div", {
|
|
2295
2267
|
className: "px-2 pb-4",
|
|
@@ -2464,10 +2436,7 @@ function QuickLinksDropdown({ onNavigate }) {
|
|
|
2464
2436
|
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex shrink-0 items-center justify-center rounded-md p-2",
|
|
2465
2437
|
"aria-label": "Quick links",
|
|
2466
2438
|
"aria-expanded": open,
|
|
2467
|
-
children: /* @__PURE__ */ jsx(
|
|
2468
|
-
icon: faTableCellsLarge,
|
|
2469
|
-
className: "h-4 w-4"
|
|
2470
|
-
})
|
|
2439
|
+
children: /* @__PURE__ */ jsx(LayoutGrid, { className: "h-4 w-4" })
|
|
2471
2440
|
}), open && /* @__PURE__ */ jsx("div", {
|
|
2472
2441
|
ref: panelRef,
|
|
2473
2442
|
className: "border-border bg-background absolute top-full right-0 z-50 mt-1 w-[700px] max-w-[90vw] overflow-hidden rounded-lg border shadow-lg",
|
|
@@ -2475,10 +2444,7 @@ function QuickLinksDropdown({ onNavigate }) {
|
|
|
2475
2444
|
className: "flex flex-col",
|
|
2476
2445
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
2477
2446
|
className: "bg-background flex items-center gap-2 border-b p-4",
|
|
2478
|
-
children: [/* @__PURE__ */ jsx(
|
|
2479
|
-
icon: faTableCellsLarge,
|
|
2480
|
-
className: "text-muted-foreground h-5 w-5"
|
|
2481
|
-
}), /* @__PURE__ */ jsx("h3", {
|
|
2447
|
+
children: [/* @__PURE__ */ jsx(LayoutGrid, { className: "text-muted-foreground h-5 w-5" }), /* @__PURE__ */ jsx("h3", {
|
|
2482
2448
|
className: "text-foreground text-sm font-semibold",
|
|
2483
2449
|
children: "Shortcuts"
|
|
2484
2450
|
})]
|
|
@@ -2516,7 +2482,7 @@ function SdkHeader({ tabs, mobileTabs, currentSlug, onNavigate, navSlugs }) {
|
|
|
2516
2482
|
const sidebar = useSidebar();
|
|
2517
2483
|
const themeMode = useThemeMode$1();
|
|
2518
2484
|
const baseSlug = matchSlugPrefix(currentSlug, navSlugs)?.matchedSlug ?? normalizeSlug(currentSlug);
|
|
2519
|
-
const
|
|
2485
|
+
const ThemeIcon = themeMode.mode === "dark" ? Moon : Sun;
|
|
2520
2486
|
const activeTabs = sidebar.isMobile && sidebar.useBottomNav && mobileTabs ? mobileTabs : tabs;
|
|
2521
2487
|
return /* @__PURE__ */ jsxs("header", {
|
|
2522
2488
|
className: "bg-sidebar flex h-[52px] shrink-0 items-center gap-2 px-6",
|
|
@@ -2526,10 +2492,7 @@ function SdkHeader({ tabs, mobileTabs, currentSlug, onNavigate, navSlugs }) {
|
|
|
2526
2492
|
onClick: sidebar.toggleSidebar,
|
|
2527
2493
|
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground mr-2 flex shrink-0 items-center justify-center rounded-md p-2",
|
|
2528
2494
|
"aria-label": "Toggle sidebar",
|
|
2529
|
-
children: /* @__PURE__ */ jsx(
|
|
2530
|
-
icon: faBars,
|
|
2531
|
-
className: "size-5"
|
|
2532
|
-
})
|
|
2495
|
+
children: /* @__PURE__ */ jsx(Menu, { className: "size-5" })
|
|
2533
2496
|
}),
|
|
2534
2497
|
/* @__PURE__ */ jsx("nav", {
|
|
2535
2498
|
className: "scrollbar-none flex flex-1 items-center gap-1 overflow-x-auto",
|
|
@@ -2550,10 +2513,7 @@ function SdkHeader({ tabs, mobileTabs, currentSlug, onNavigate, navSlugs }) {
|
|
|
2550
2513
|
onClick: themeMode.cycleMode,
|
|
2551
2514
|
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground ml-2 flex shrink-0 items-center justify-center rounded-md p-2",
|
|
2552
2515
|
"aria-label": `Switch theme (current: ${themeMode.mode})`,
|
|
2553
|
-
children: /* @__PURE__ */ jsx(
|
|
2554
|
-
icon: themeIcon,
|
|
2555
|
-
className: "size-3"
|
|
2556
|
-
})
|
|
2516
|
+
children: /* @__PURE__ */ jsx(ThemeIcon, { className: "size-3" })
|
|
2557
2517
|
})
|
|
2558
2518
|
]
|
|
2559
2519
|
});
|
|
@@ -2617,6 +2577,10 @@ const BuilderScreenView = memo(BuilderScreenViewImpl);
|
|
|
2617
2577
|
//#endregion
|
|
2618
2578
|
//#region src/shell/PageRouter.tsx
|
|
2619
2579
|
const SYSTEM_SLUG_SCREEN_MAP = {
|
|
2580
|
+
account: AccountScreen,
|
|
2581
|
+
"account/profile": AccountScreen,
|
|
2582
|
+
"account/orders": AccountScreen,
|
|
2583
|
+
"account/subscriptions": AccountScreen,
|
|
2620
2584
|
messages: MessagingScreen,
|
|
2621
2585
|
contacts: ContactsScreen,
|
|
2622
2586
|
shop: OrdersScreen,
|
|
@@ -2664,37 +2628,6 @@ function PageRouter({ currentSlug, currentNavItem, customPages, screens, baseSlu
|
|
|
2664
2628
|
return /* @__PURE__ */ jsx(CoreScreenPlaceholder, { name: currentNavItem?.label ?? currentSlug });
|
|
2665
2629
|
}
|
|
2666
2630
|
//#endregion
|
|
2667
|
-
//#region src/shell/AppNavigationContext.tsx
|
|
2668
|
-
const AppNavigationContext = createContext(null);
|
|
2669
|
-
function AppNavigationProvider({ currentSlug, basePath, navigate, children }) {
|
|
2670
|
-
const buildHref = useMemo(() => {
|
|
2671
|
-
return (slug) => {
|
|
2672
|
-
if (basePath === "/") return `/${slug}`;
|
|
2673
|
-
return `${basePath}/${slug}`;
|
|
2674
|
-
};
|
|
2675
|
-
}, [basePath]);
|
|
2676
|
-
const value = useMemo(() => ({
|
|
2677
|
-
currentSlug,
|
|
2678
|
-
basePath,
|
|
2679
|
-
navigate,
|
|
2680
|
-
buildHref
|
|
2681
|
-
}), [
|
|
2682
|
-
currentSlug,
|
|
2683
|
-
basePath,
|
|
2684
|
-
navigate,
|
|
2685
|
-
buildHref
|
|
2686
|
-
]);
|
|
2687
|
-
return /* @__PURE__ */ jsx(AppNavigationContext.Provider, {
|
|
2688
|
-
value,
|
|
2689
|
-
children
|
|
2690
|
-
});
|
|
2691
|
-
}
|
|
2692
|
-
function useAppNavigation() {
|
|
2693
|
-
const ctx = useContext(AppNavigationContext);
|
|
2694
|
-
if (!ctx) throw new Error("useAppNavigation must be used within an <AppShell> or <AppNavigationProvider>");
|
|
2695
|
-
return ctx;
|
|
2696
|
-
}
|
|
2697
|
-
//#endregion
|
|
2698
2631
|
//#region src/shell/AppShell.tsx
|
|
2699
2632
|
const THEME_STORAGE_KEY = "portal-theme-mode";
|
|
2700
2633
|
const DEFAULT_NAVIGATION = [
|
|
@@ -2944,6 +2877,6 @@ var removeAllThemes = themes_exports.removeAllThemes;
|
|
|
2944
2877
|
var removeTheme = themes_exports.removeTheme;
|
|
2945
2878
|
var resolveTheme = themes_exports.resolveTheme;
|
|
2946
2879
|
var serialiseTheme = themes_exports.serialiseTheme;
|
|
2947
|
-
export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, AUTH_CONSTANTS, AlertWidget, ApiError, AppLink, AppNavigationProvider, AppShell, AuthError, AuthLoading, BuilderScreenView, CORE_PAGE_IDS, CURRENT_REP_QUERY_KEY, CURRENT_USER_QUERY_KEY, CalendarWidget, 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, ListWidget, MessagingScreen, MySiteWidget, NestedWidget, OrdersScreen, PAGE_CATEGORIES, PERMISSIONS_QUERY_KEY, PROFILE_QUERY_KEY, PROPERTY_FIELD_TYPES, PageRouter, PageTemplateProvider, PageTemplateRegistry, ProductsScreen, QuickLinksDropdown, QuickShareWidget, RADIUS_KEYS, RecentActivityWidget, RequireAuth, SEMANTIC_COLOR_NAMES, SHADE_STEPS, STORAGE_KEYS, SdkHeader, SdkNavigation, SpacerWidget, TableWidget, TextWidget, ThemeModeProvider, ToDoWidget, URL_PARAMS, USER_TYPES, VideoWidget, WIDGET_TYPE_NAMES, alertWidgetPropertySchema, applyTheme, assertDefined, assertNever, buildThemeDefinition, calendarWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, cleanTokenFromUrl, clearTokens, collectNavSlugs, contactsScreenPropertySchema, containerWidgetPropertySchema, createDefaultAuthRedirect, createFluidClient, createFluidFileUploader, 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, listWidgetPropertySchema, matchSlugPrefix, mergeDarkOverrides, messagingScreenPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, normalizeComponentTree, ordersScreenPropertySchema, parseColor, productsScreenPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, removeAllThemes, removeTheme, resolveNavigationPages, resolveTheme, screenPropertySchemas, sectionLayoutConfig, selectProperty, serialiseTheme, spacerWidgetPropertySchema, storeToken, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, toNavigationItem, toScreenDefinition, transformManifestToRepAppData, transformThemes, useActivities, useAppNavigation, useCalendarEvents, useCatchUps, useContact, useContacts, useConversationMessages, useConversations, useCurrentRep, useCurrentUser, useFluidApi, useFluidApp, useFluidAuth, useFluidAuthContext, useFluidContext, useFluidPermissions, useFluidProfile, useFluidTheme, useMessagingAuth, useMessagingConfig, useMySite, usePageTemplates, useResolvedPages, useThemeContext, useThemeMode, useTodos, validateNavigationPages, validateToken, videoWidgetPropertySchema, widgetPropertySchemas };
|
|
2880
|
+
export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, AUTH_CONSTANTS, AccountScreen, AlertWidget, ApiError, AppLink, AppNavigationProvider, AppShell, AuthError, AuthLoading, BuilderScreenView, CORE_PAGE_IDS, CURRENT_REP_QUERY_KEY, CURRENT_USER_QUERY_KEY, CalendarWidget, 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, ListWidget, MessagingScreen, MySiteWidget, NestedWidget, OrdersScreen, PAGE_CATEGORIES, PERMISSIONS_QUERY_KEY, PROFILE_QUERY_KEY, PROPERTY_FIELD_TYPES, PageRouter, PageTemplateProvider, PageTemplateRegistry, ProductsScreen, QuickLinksDropdown, QuickShareWidget, RADIUS_KEYS, RecentActivityWidget, RequireAuth, SEMANTIC_COLOR_NAMES, SHADE_STEPS, STORAGE_KEYS, SdkHeader, SdkNavigation, SpacerWidget, TableWidget, TextWidget, ThemeModeProvider, ToDoWidget, URL_PARAMS, USER_TYPES, VideoWidget, WIDGET_TYPE_NAMES, accountScreenPropertySchema, alertWidgetPropertySchema, applyTheme, assertDefined, assertNever, buildThemeDefinition, calendarWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, cleanTokenFromUrl, clearTokens, collectNavSlugs, contactsScreenPropertySchema, containerWidgetPropertySchema, createDefaultAuthRedirect, createFluidClient, createFluidFileUploader, 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, listWidgetPropertySchema, matchSlugPrefix, mergeDarkOverrides, messagingScreenPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, normalizeComponentTree, ordersScreenPropertySchema, parseColor, productsScreenPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, removeAllThemes, removeTheme, resolveNavigationPages, resolveTheme, screenPropertySchemas, sectionLayoutConfig, selectProperty, serialiseTheme, spacerWidgetPropertySchema, storeToken, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, toNavigationItem, toScreenDefinition, transformManifestToRepAppData, transformThemes, useActivities, useAppNavigation, useCalendarEvents, useCatchUps, useContact, useContacts, useConversationMessages, useConversations, useCurrentRep, useCurrentUser, useFluidApi, useFluidApp, useFluidAuth, useFluidAuthContext, useFluidContext, useFluidPermissions, useFluidProfile, useFluidTheme, useMessagingAuth, useMessagingConfig, useMySite, usePageTemplates, useResolvedPages, useThemeContext, useThemeMode, useTodos, validateNavigationPages, validateToken, videoWidgetPropertySchema, widgetPropertySchemas };
|
|
2948
2881
|
|
|
2949
2882
|
//# sourceMappingURL=index.mjs.map
|