@fluid-app/rep-sdk 0.1.9 → 0.1.10

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.
Files changed (85) hide show
  1. package/dist/ContactsScreen-CB6l0Lf1.mjs +24 -0
  2. package/dist/ContactsScreen-CB6l0Lf1.mjs.map +1 -0
  3. package/dist/ContactsScreen-UfrdOORn.cjs +41 -0
  4. package/dist/ContactsScreen-UfrdOORn.cjs.map +1 -0
  5. package/dist/CoreScreenPlaceholder-D93ZYKt2.mjs +32 -0
  6. package/dist/CoreScreenPlaceholder-D93ZYKt2.mjs.map +1 -0
  7. package/dist/CoreScreenPlaceholder-DBZqxDsK.cjs +38 -0
  8. package/dist/CoreScreenPlaceholder-DBZqxDsK.cjs.map +1 -0
  9. package/dist/CustomersScreen-BEar6Leg.mjs +24 -0
  10. package/dist/CustomersScreen-BEar6Leg.mjs.map +1 -0
  11. package/dist/CustomersScreen-DXXPpWZW.cjs +41 -0
  12. package/dist/CustomersScreen-DXXPpWZW.cjs.map +1 -0
  13. package/dist/MessagingScreen-CsDvKkLC.cjs +1458 -0
  14. package/dist/MessagingScreen-CsDvKkLC.cjs.map +1 -0
  15. package/dist/MessagingScreen-xO9YudMx.mjs +1285 -0
  16. package/dist/MessagingScreen-xO9YudMx.mjs.map +1 -0
  17. package/dist/OrdersScreen-DB1v051q.mjs +24 -0
  18. package/dist/OrdersScreen-DB1v051q.mjs.map +1 -0
  19. package/dist/OrdersScreen-fcxcnpNU.cjs +41 -0
  20. package/dist/OrdersScreen-fcxcnpNU.cjs.map +1 -0
  21. package/dist/ProductsScreen-BaEng3LB.cjs +41 -0
  22. package/dist/ProductsScreen-BaEng3LB.cjs.map +1 -0
  23. package/dist/ProductsScreen-nVDsY6kf.mjs +24 -0
  24. package/dist/ProductsScreen-nVDsY6kf.mjs.map +1 -0
  25. package/dist/chunk-D1SwGrFN.mjs +27 -0
  26. package/dist/index.cjs +3397 -2850
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +1026 -955
  29. package/dist/index.d.cts.map +1 -0
  30. package/dist/index.d.mts +2207 -0
  31. package/dist/index.d.mts.map +1 -0
  32. package/dist/index.mjs +2921 -0
  33. package/dist/index.mjs.map +1 -0
  34. package/package.json +9 -9
  35. package/dist/ContactsScreen-7RGAMMGN.cjs +0 -18
  36. package/dist/ContactsScreen-7RGAMMGN.cjs.map +0 -1
  37. package/dist/ContactsScreen-XKZE5HTP.js +0 -5
  38. package/dist/ContactsScreen-XKZE5HTP.js.map +0 -1
  39. package/dist/CustomersScreen-BBQ3YHI4.js +0 -5
  40. package/dist/CustomersScreen-BBQ3YHI4.js.map +0 -1
  41. package/dist/CustomersScreen-EMGCQ2PV.cjs +0 -18
  42. package/dist/CustomersScreen-EMGCQ2PV.cjs.map +0 -1
  43. package/dist/MessagingScreen-I3GVOGKY.js +0 -4
  44. package/dist/MessagingScreen-I3GVOGKY.js.map +0 -1
  45. package/dist/MessagingScreen-ZRD4WEOE.cjs +0 -17
  46. package/dist/MessagingScreen-ZRD4WEOE.cjs.map +0 -1
  47. package/dist/OrdersScreen-ANDGND6F.js +0 -5
  48. package/dist/OrdersScreen-ANDGND6F.js.map +0 -1
  49. package/dist/OrdersScreen-NNE6OSRS.cjs +0 -18
  50. package/dist/OrdersScreen-NNE6OSRS.cjs.map +0 -1
  51. package/dist/ProductsScreen-5PMFLPWS.js +0 -5
  52. package/dist/ProductsScreen-5PMFLPWS.js.map +0 -1
  53. package/dist/ProductsScreen-ALQYD7ID.cjs +0 -18
  54. package/dist/ProductsScreen-ALQYD7ID.cjs.map +0 -1
  55. package/dist/chunk-2RIDFKS3.cjs +0 -19
  56. package/dist/chunk-2RIDFKS3.cjs.map +0 -1
  57. package/dist/chunk-424PT5DM.js +0 -21
  58. package/dist/chunk-424PT5DM.js.map +0 -1
  59. package/dist/chunk-4LTH3NNT.js +0 -16
  60. package/dist/chunk-4LTH3NNT.js.map +0 -1
  61. package/dist/chunk-4PHR2M6A.js +0 -14
  62. package/dist/chunk-4PHR2M6A.js.map +0 -1
  63. package/dist/chunk-EKMZ4NIA.cjs +0 -19
  64. package/dist/chunk-EKMZ4NIA.cjs.map +0 -1
  65. package/dist/chunk-HDQ2JUQT.cjs +0 -24
  66. package/dist/chunk-HDQ2JUQT.cjs.map +0 -1
  67. package/dist/chunk-HFPPHLOO.cjs +0 -19
  68. package/dist/chunk-HFPPHLOO.cjs.map +0 -1
  69. package/dist/chunk-HMOWQQDX.cjs +0 -19
  70. package/dist/chunk-HMOWQQDX.cjs.map +0 -1
  71. package/dist/chunk-JXEED3FK.js +0 -16
  72. package/dist/chunk-JXEED3FK.js.map +0 -1
  73. package/dist/chunk-LU42Y4H3.cjs +0 -1597
  74. package/dist/chunk-LU42Y4H3.cjs.map +0 -1
  75. package/dist/chunk-NGOEPTWZ.js +0 -16
  76. package/dist/chunk-NGOEPTWZ.js.map +0 -1
  77. package/dist/chunk-NNZKBXNB.cjs +0 -16
  78. package/dist/chunk-NNZKBXNB.cjs.map +0 -1
  79. package/dist/chunk-SYZUEL6B.js +0 -1538
  80. package/dist/chunk-SYZUEL6B.js.map +0 -1
  81. package/dist/chunk-TB6OK3WH.js +0 -16
  82. package/dist/chunk-TB6OK3WH.js.map +0 -1
  83. package/dist/index.d.ts +0 -2138
  84. package/dist/index.js +0 -2536
  85. package/dist/index.js.map +0 -1
@@ -0,0 +1,2207 @@
1
+ import * as react from "react";
2
+ import React$1, { AnchorHTMLAttributes, ComponentProps, ComponentType, ReactNode } from "react";
3
+ import { QueryClient, UseQueryResult } from "@tanstack/react-query";
4
+ import { AUTH_CONSTANTS, DEFAULT_AUTH_URL, FluidAuthConfig, FluidAuthContextValue, JWTPayload, STORAGE_KEYS, TokenValidationResult, URL_PARAMS, USER_TYPES, UserType, cleanTokenFromUrl, clearTokens, createDefaultAuthRedirect, decodeToken, extractAllTokensFromUrl, extractCompanyTokenFromUrl, extractTokenFromUrl, getStoredToken, getTokenExpiration, getTokenTimeRemaining, hasStoredToken, hasTokenInUrl, isTokenExpired, isUserType, isValidToken, storeToken, validateToken } from "@fluid-app/auth";
5
+ import { RawApiTheme, RawApiTheme as RawApiTheme$1, buildThemeDefinition, getActiveThemeId, transformThemes } from "@fluid-app/rep-core/theme";
6
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
7
+ import { createScreen, createWidgetFromShareable, createWidgetRegistry, groupChildrenByColumn } from "@fluid-app/rep-core/widget-utils";
8
+ import { AlertWidget, AlertWidget as AlertWidget$1, CalendarWidget, CalendarWidget as CalendarWidget$1, CarouselWidget, CarouselWidget as CarouselWidget$1, CatchUpWidget, CatchUpWidget as CatchUpWidget$1, ChartWidget, ChartWidget as ChartWidget$1, ContainerWidget, ContainerWidget as ContainerWidget$1, EmbedWidget, EmbedWidget as EmbedWidget$1, ImageWidget, ImageWidget as ImageWidget$1, LayoutWidget, ListWidget, ListWidget as ListWidget$1, MySiteWidget, MySiteWidget as MySiteWidget$1, NestedWidget, NestedWidget as NestedWidget$1, QuickShareWidget, QuickShareWidget as QuickShareWidget$1, RecentActivityWidget, RecentActivityWidget as RecentActivityWidget$1, SpacerWidget, SpacerWidget as SpacerWidget$1, TableWidget, TableWidget as TableWidget$1, TextWidget, TextWidget as TextWidget$1, ToDoWidget, ToDoWidget as ToDoWidget$1, VideoWidget, VideoWidget as VideoWidget$1, alertWidgetPropertySchema, calendarWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, containerWidgetPropertySchema, embedWidgetPropertySchema, imageWidgetPropertySchema, layoutWidgetPropertySchema, listWidgetPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, spacerWidgetPropertySchema, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, videoWidgetPropertySchema, widgetPropertySchemas } from "@fluid-app/rep-widgets/widgets";
9
+ import * as _fluid_app_rep_core_types0 from "@fluid-app/rep-core/types";
10
+ import { AlignOptions, BackgroundType, BackgroundValue, BorderRadiusOptions, ButtonSizeOptions, ColorOptions, FontSizeOptions, GapOptions, NavigationItem, NavigationItem as NavigationItem$1, PaddingOptions, RepAppData, RepAppData as RepAppData$1, RepAppManifest, RepAppProfile, ResolvedTheme, ScreenDefinition as ScreenDefinition$1, SectionLayoutType, ShareableItem, ThemeColorInput, ThemeDefinition, ThemePayload, TypedWidgetSchema, WIDGET_TYPE_NAMES, WidgetPath, WidgetRegistry, WidgetSchema, WidgetSchema as WidgetSchema$1, WidgetType, WidgetTypeName, assertDefined, assertNever, isWidgetType, isWidgetTypeName, sectionLayoutConfig } from "@fluid-app/rep-core/types";
11
+ import { FileUploader, FileUploader as FileUploader$1, MessagingAuthContext, MessagingAuthContext as MessagingAuthContext$1, MessagingCurrentUser, UploadCallbacks, UploadResult } from "@fluid-app/messaging-core";
12
+ import { MessagingApiConfig } from "@fluid-app/messaging-api-client";
13
+ import * as _fluid_app_rep_core_registries0 from "@fluid-app/rep-core/registries";
14
+ import { PROPERTY_FIELD_TYPES, PropertyFieldSchema, PropertyFieldType, TabConfig, WidgetPropertySchema, gapValues, isPropertyFieldType } from "@fluid-app/rep-core/registries";
15
+ import { ThemeMode, ThemeModeProvider, getThemeModeAttribute, useThemeMode } from "@fluid-app/rep-core/shell/ThemeModeContext";
16
+
17
+ //#region src/types/rep.d.ts
18
+ /**
19
+ * Rep (sales representative) user profile
20
+ */
21
+ interface Rep {
22
+ readonly id: string;
23
+ email: string;
24
+ first_name: string;
25
+ last_name: string;
26
+ avatar_url?: string;
27
+ phone?: string;
28
+ readonly company_id: string;
29
+ readonly created_at: string;
30
+ readonly updated_at: string;
31
+ }
32
+ /**
33
+ * Data for updating a rep's profile
34
+ */
35
+ interface UpdateRepData {
36
+ first_name?: string;
37
+ last_name?: string;
38
+ avatar_url?: string;
39
+ phone?: string;
40
+ }
41
+ /**
42
+ * Current user profile from GET /api/me endpoint.
43
+ * Contains recipient_id needed for the messaging system.
44
+ * Field names match the Rails API response (snake_case).
45
+ */
46
+ interface UserMe {
47
+ readonly id: number;
48
+ readonly first_name: string | null;
49
+ readonly last_name: string | null;
50
+ readonly email: string;
51
+ readonly image_url: string | null;
52
+ readonly jwt: string;
53
+ readonly recipient_id: number | null;
54
+ readonly company_id?: number;
55
+ readonly affiliate_id: number | null;
56
+ }
57
+ //#endregion
58
+ //#region src/types/page-template.d.ts
59
+ /**
60
+ * Category for organizing page templates in the registry
61
+ */
62
+ interface PageCategory {
63
+ /** Unique identifier for the category */
64
+ readonly id: string;
65
+ /** Display label */
66
+ label: string;
67
+ /** Icon identifier (e.g., lucide icon name) */
68
+ icon?: string;
69
+ }
70
+ /**
71
+ * A reusable page template that can be shared across multiple navigations
72
+ */
73
+ interface PageTemplate {
74
+ /** Unique identifier for the template */
75
+ readonly id: string;
76
+ /** URL-friendly slug */
77
+ slug: string;
78
+ /** Display name */
79
+ name: string;
80
+ /** Description of the template's purpose */
81
+ description?: string;
82
+ /** Category ID for organization */
83
+ category: string;
84
+ /** Tags for filtering and search */
85
+ tags?: readonly string[];
86
+ /** The widget tree that defines the page content */
87
+ component_tree: readonly WidgetSchema[];
88
+ /** Semantic version of the template */
89
+ version: string;
90
+ /** Whether this is a core feature that cannot be removed */
91
+ isCore?: boolean;
92
+ /** Default prop values that can be customized */
93
+ defaultProps?: Readonly<Record<string, unknown>>;
94
+ /** Thumbnail image URL for UI display */
95
+ thumbnail?: string;
96
+ }
97
+ /**
98
+ * Reference to a shared page template within a navigation
99
+ */
100
+ interface PageReference {
101
+ /** ID of the page template being referenced */
102
+ page_template_id: string;
103
+ /** Screen ID to assign to this page in the navigation */
104
+ screen_id: number;
105
+ /** Optional prop overrides (only prop values, not widget structure) */
106
+ overrides?: readonly PageOverride[];
107
+ }
108
+ /**
109
+ * Override for a specific widget's props within a page template
110
+ */
111
+ interface PageOverride {
112
+ /** ID of the widget to override (must match WidgetSchema.id in the template) */
113
+ readonly widget_id: string;
114
+ /** Props to override (merged with original props) */
115
+ props: Readonly<Record<string, unknown>>;
116
+ }
117
+ /**
118
+ * Built-in page category IDs
119
+ */
120
+ declare const PAGE_CATEGORIES: {
121
+ readonly CORE: "core";
122
+ readonly COMMERCE: "commerce";
123
+ readonly COMMUNICATION: "communication";
124
+ readonly DATA: "data";
125
+ readonly CUSTOM: "custom";
126
+ };
127
+ type PageCategoryId = (typeof PAGE_CATEGORIES)[keyof typeof PAGE_CATEGORIES];
128
+ //#endregion
129
+ //#region src/types/navigation.d.ts
130
+ /**
131
+ * Screen definition with its component tree
132
+ */
133
+ interface ScreenDefinition {
134
+ readonly id: number;
135
+ slug: string;
136
+ name: string;
137
+ component_tree: WidgetSchema[];
138
+ }
139
+ /**
140
+ * Navigation configuration for the rep portal
141
+ */
142
+ interface Navigation {
143
+ readonly definition_id: number;
144
+ readonly id: number;
145
+ name: string;
146
+ navigation_items: _fluid_app_rep_core_types0.NavigationItem[];
147
+ /** Local screen definitions (for backwards compatibility and custom screens) */
148
+ screens: ScreenDefinition[];
149
+ /** References to shared page templates from the registry */
150
+ page_refs?: PageReference[];
151
+ }
152
+ //#endregion
153
+ //#region src/types/profile.d.ts
154
+ /**
155
+ * Rep portal profile containing themes and navigation configuration
156
+ */
157
+ interface Profile {
158
+ /** Profile name */
159
+ name: string;
160
+ /** Available themes for the portal */
161
+ themes: ThemeDefinition[];
162
+ /** Navigation structure and screens */
163
+ navigation: Navigation;
164
+ /** Portal definition ID */
165
+ readonly definition_id: number;
166
+ }
167
+ //#endregion
168
+ //#region src/types/permissions.d.ts
169
+ /**
170
+ * Standard permission action constants.
171
+ * Use these constants instead of string literals for type safety.
172
+ *
173
+ * @example
174
+ * ```ts
175
+ * if (permissions[PERMISSION_ACTIONS.view]) { ... }
176
+ * ```
177
+ */
178
+ declare const PERMISSION_ACTIONS: {
179
+ readonly view: "view";
180
+ readonly create: "create";
181
+ readonly update: "update";
182
+ readonly delete: "delete";
183
+ readonly settings: "settings";
184
+ readonly add: "add";
185
+ readonly manage: "manage";
186
+ readonly send: "send";
187
+ };
188
+ /**
189
+ * Union type of standard permission actions.
190
+ * Derived from PERMISSION_ACTIONS constant to avoid duplication.
191
+ */
192
+ type PermissionAction = (typeof PERMISSION_ACTIONS)[keyof typeof PERMISSION_ACTIONS];
193
+ /**
194
+ * Permission flags for a single resource.
195
+ * Known actions have explicit properties; index signature allows custom actions.
196
+ */
197
+ interface ResourcePermissions {
198
+ readonly view?: boolean;
199
+ readonly create?: boolean;
200
+ readonly update?: boolean;
201
+ readonly delete?: boolean;
202
+ readonly settings?: boolean;
203
+ readonly add?: boolean;
204
+ readonly manage?: boolean;
205
+ readonly send?: boolean;
206
+ /** Allow custom action keys beyond the standard set */
207
+ readonly [key: string]: boolean | undefined;
208
+ }
209
+ /**
210
+ * Map of resource names to their permissions
211
+ */
212
+ type Permissions = Record<string, ResourcePermissions>;
213
+ /**
214
+ * User's complete permission profile
215
+ */
216
+ interface UserPermissions {
217
+ /** Resource permission mappings */
218
+ permissions: Permissions;
219
+ /** User's assigned roles */
220
+ roles: readonly string[];
221
+ /** Super admin bypass flag */
222
+ is_super_admin: boolean;
223
+ }
224
+ //#endregion
225
+ //#region src/client/types.d.ts
226
+ /**
227
+ * HTTP methods supported by the API client.
228
+ * Use `as const` for literal type inference and type safety.
229
+ */
230
+ declare const HTTP_METHODS: {
231
+ readonly GET: "GET";
232
+ readonly POST: "POST";
233
+ readonly PUT: "PUT";
234
+ readonly PATCH: "PATCH";
235
+ readonly DELETE: "DELETE";
236
+ };
237
+ /**
238
+ * Union type of all supported HTTP methods.
239
+ * Derived from HTTP_METHODS constant to avoid duplication.
240
+ */
241
+ type HttpMethod = (typeof HTTP_METHODS)[keyof typeof HTTP_METHODS];
242
+ /**
243
+ * Configuration for the Fluid SDK client.
244
+ * Use Readonly<FluidSDKConfig> when the config should not be modified after creation.
245
+ */
246
+ interface FluidSDKConfig {
247
+ /**
248
+ * Base URL for API requests.
249
+ * Accepts either the domain root (e.g., "https://api.fluid.app") or
250
+ * with the /api path (e.g., "https://api.fluid.app/api").
251
+ * The SDK normalizes internally for each consumer.
252
+ */
253
+ readonly baseUrl: string;
254
+ /**
255
+ * Function to retrieve the authentication token
256
+ * Return null/undefined if no token is available
257
+ */
258
+ readonly getAuthToken?: () => string | null | Promise<string | null>;
259
+ /**
260
+ * Callback invoked when a 401 authentication error occurs
261
+ * Use this to trigger re-authentication flows
262
+ */
263
+ readonly onAuthError?: () => void;
264
+ /**
265
+ * Default headers to include in all requests
266
+ * Example: { "x-fluid-client": "rep-portal" }
267
+ */
268
+ readonly defaultHeaders?: Readonly<Record<string, string>>;
269
+ /**
270
+ * Filestack API key for messaging file uploads.
271
+ * If not provided, file attachments will be disabled in the messaging composer.
272
+ */
273
+ readonly filestackApiKey?: string;
274
+ /**
275
+ * Override WebSocket URL for real-time messaging.
276
+ * Default: derived from baseUrl by replacing trailing /api with /cable
277
+ */
278
+ readonly websocketUrl?: string;
279
+ }
280
+ /**
281
+ * Options for individual API requests.
282
+ * Uses HttpMethod type for method to ensure type safety.
283
+ */
284
+ interface RequestOptions {
285
+ readonly method?: HttpMethod;
286
+ readonly body?: unknown;
287
+ readonly params?: Readonly<Record<string, unknown>>;
288
+ readonly headers?: Readonly<Record<string, string>>;
289
+ readonly signal?: AbortSignal;
290
+ }
291
+ /**
292
+ * Pagination parameters for list endpoints
293
+ */
294
+ interface PaginationParams {
295
+ readonly page?: number;
296
+ readonly per_page?: number;
297
+ }
298
+ /**
299
+ * Sort order constant - single source of truth for sort direction values.
300
+ * Use SORT_ORDERS.asc instead of "asc" for type-safe comparisons.
301
+ */
302
+ declare const SORT_ORDERS: {
303
+ readonly asc: "asc";
304
+ readonly desc: "desc";
305
+ };
306
+ /**
307
+ * Union type of sort order values, derived from SORT_ORDERS constant.
308
+ * @see deriving-typeof-for-object-keys pattern
309
+ */
310
+ type SortOrder = (typeof SORT_ORDERS)[keyof typeof SORT_ORDERS];
311
+ /**
312
+ * Common filter parameters for list endpoints
313
+ */
314
+ interface BaseListParams extends PaginationParams {
315
+ readonly sort_by?: string;
316
+ readonly sort_order?: SortOrder;
317
+ readonly search?: string;
318
+ }
319
+ //#endregion
320
+ //#region src/transforms/screen-transforms.d.ts
321
+ /** Raw screen from the FluidOS API */
322
+ interface RawApiScreen {
323
+ id: number | string;
324
+ definition_id?: number | string;
325
+ name?: string | null;
326
+ slug?: string | null;
327
+ component_tree?: unknown;
328
+ }
329
+ /**
330
+ * Normalize component_tree to always be an array.
331
+ * The API stores component_tree as a hash (object), but the frontend expects an array.
332
+ */
333
+ declare function normalizeComponentTree(componentTree: unknown): WidgetSchema$1[];
334
+ /**
335
+ * Convert a raw FluidOS screen to ScreenDefinition.
336
+ * Normalizes component_tree and converts string IDs to numbers.
337
+ */
338
+ declare function toScreenDefinition(screen: RawApiScreen): ScreenDefinition$1;
339
+ //#endregion
340
+ //#region src/transforms/navigation-transforms.d.ts
341
+ /** Raw navigation item from the FluidOS API (derived from generated types) */
342
+ type RawApiNavigationItem = components["schemas"]["FluidOSNavigationItem"];
343
+ /**
344
+ * Convert a raw FluidOS navigation item to NavigationItem.
345
+ * Recursively transforms children and sorts by position.
346
+ */
347
+ declare function toNavigationItem(item: RawApiNavigationItem): NavigationItem$1;
348
+ //#endregion
349
+ //#region src/transforms/index.d.ts
350
+ /** Raw manifest shape from the `/fluid_os/definitions/active` API response */
351
+ interface RawManifestResponse {
352
+ manifest: {
353
+ definition_id: number;
354
+ published_version?: number;
355
+ screens?: RawApiScreen[];
356
+ profile?: {
357
+ name?: string;
358
+ definition_id: number;
359
+ themes?: RawApiTheme$1[];
360
+ navigation?: {
361
+ id: number;
362
+ name?: string;
363
+ definition_id: number;
364
+ navigation_items?: RawApiNavigationItem[];
365
+ };
366
+ mobile_navigation?: {
367
+ id: number;
368
+ name?: string;
369
+ definition_id: number;
370
+ navigation_items?: RawApiNavigationItem[];
371
+ };
372
+ };
373
+ };
374
+ }
375
+ /**
376
+ * Transform a raw FluidOS manifest API response into RepAppData.
377
+ *
378
+ * This is the top-level transform used by `FluidClient.app.get()`.
379
+ * It handles:
380
+ * - Theme transformation (legacy and new formats)
381
+ * - Screen normalization (component_tree array wrapping)
382
+ * - Navigation item transformation (recursive with position sorting)
383
+ */
384
+ declare function transformManifestToRepAppData(response: RawManifestResponse): RepAppData$1;
385
+ //#endregion
386
+ //#region src/client/fluid-client.d.ts
387
+ /**
388
+ * API Error class for structured error handling
389
+ */
390
+ declare class ApiError extends Error {
391
+ readonly status: number;
392
+ readonly data: unknown;
393
+ constructor(message: string, status: number, data?: unknown);
394
+ toJSON(): {
395
+ name: string;
396
+ message: string;
397
+ status: number;
398
+ data: unknown;
399
+ };
400
+ }
401
+ /**
402
+ * Type guard for ApiError
403
+ */
404
+ declare function isApiError(error: unknown): error is ApiError;
405
+ /**
406
+ * Discriminated union representing the result of an API call.
407
+ * Use `isApiSuccess` and `isApiFailure` type guards to narrow.
408
+ */
409
+ type ApiResult<T> = {
410
+ readonly success: true;
411
+ readonly data: T;
412
+ } | {
413
+ readonly success: false;
414
+ readonly error: ApiError;
415
+ };
416
+ interface Product {
417
+ readonly id: number;
418
+ readonly title: string;
419
+ readonly sku?: string | null;
420
+ readonly price: string | number;
421
+ readonly description?: string | null;
422
+ readonly image_url?: string;
423
+ readonly status?: string;
424
+ readonly active?: boolean;
425
+ readonly slug?: string;
426
+ readonly in_stock?: boolean;
427
+ readonly display_price?: string;
428
+ readonly currency_code?: string;
429
+ readonly updated_at?: string;
430
+ }
431
+ interface ProductListParams extends BaseListParams {
432
+ readonly search_query?: string;
433
+ readonly status?: readonly ("active" | "draft" | "archived" | "all")[];
434
+ readonly category_id?: string;
435
+ readonly category_ids?: readonly number[];
436
+ readonly collection_id?: string;
437
+ readonly collection_ids?: readonly number[];
438
+ readonly order_by?: readonly string[];
439
+ readonly country_code?: readonly string[];
440
+ readonly published_stores?: readonly ("retail" | "rep")[];
441
+ }
442
+ interface ProductsResponse {
443
+ readonly products: readonly Product[];
444
+ readonly meta: {
445
+ readonly request_id: string;
446
+ readonly timestamp: string;
447
+ readonly pagination?: {
448
+ readonly current_page: number;
449
+ readonly per_page: number;
450
+ readonly total_pages: number;
451
+ readonly total_count: number;
452
+ };
453
+ };
454
+ }
455
+ interface Order {
456
+ readonly id: string;
457
+ readonly order_number: string;
458
+ readonly status: string;
459
+ readonly total: number;
460
+ readonly customer_id: string;
461
+ readonly rep_id?: string;
462
+ readonly created_at: string;
463
+ readonly updated_at: string;
464
+ }
465
+ interface OrderListParams extends BaseListParams {
466
+ readonly status?: string;
467
+ readonly customer_id?: string;
468
+ readonly date_from?: string;
469
+ readonly date_to?: string;
470
+ }
471
+ interface CreateOrderData {
472
+ readonly customer_id: string;
473
+ readonly line_items: readonly OrderLineItem[];
474
+ readonly notes?: string;
475
+ }
476
+ interface OrderLineItem {
477
+ readonly product_id: string;
478
+ readonly quantity: number;
479
+ readonly price?: number;
480
+ }
481
+ interface DashboardData {
482
+ readonly total_sales: number;
483
+ readonly total_orders: number;
484
+ readonly total_customers: number;
485
+ readonly recent_orders: readonly Order[];
486
+ }
487
+ interface SalesParams {
488
+ readonly date_from?: string;
489
+ readonly date_to?: string;
490
+ readonly group_by?: "day" | "week" | "month";
491
+ }
492
+ interface SalesData {
493
+ readonly total: number;
494
+ readonly data: readonly SalesDataPoint[];
495
+ }
496
+ interface SalesDataPoint {
497
+ readonly date: string;
498
+ readonly amount: number;
499
+ readonly orders: number;
500
+ }
501
+ /**
502
+ * Creates a configured Fluid API client instance
503
+ */
504
+ declare function createFluidClient(config: FluidSDKConfig): {
505
+ fetchClient: {
506
+ request: <TResponse = unknown>(endpoint: string, options?: undefined) => Promise<TResponse>;
507
+ requestWithFormData: <TResponse = unknown>(endpoint: string, formData: FormData, options?: Omit<undefined, "body" | "params"> & {
508
+ method?: "POST" | "PUT" | "PATCH";
509
+ }) => Promise<TResponse>;
510
+ get: <TResponse = unknown>(endpoint: string, params?: Record<string, unknown>, options?: Omit<undefined, "method" | "params">) => Promise<TResponse>;
511
+ post: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<undefined, "method" | "body">) => Promise<TResponse>;
512
+ put: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<undefined, "method" | "body">) => Promise<TResponse>;
513
+ patch: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<undefined, "method" | "body">) => Promise<TResponse>;
514
+ delete: <TResponse = unknown>(endpoint: string, options?: Omit<undefined, "method">) => Promise<TResponse>;
515
+ };
516
+ request: <TResponse = unknown>(endpoint: string, options?: RequestOptions) => Promise<TResponse>;
517
+ requestNullable: <TResponse>(endpoint: string, options?: RequestOptions) => Promise<TResponse | null>;
518
+ safeRequest: <TResponse>(endpoint: string, options?: RequestOptions) => Promise<ApiResult<TResponse>>;
519
+ get: <TResponse = unknown, TParams extends object = Record<string, unknown>>(endpoint: string, params?: TParams, options?: Omit<RequestOptions, "method" | "params">) => Promise<TResponse>;
520
+ post: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
521
+ put: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
522
+ patch: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
523
+ delete: <TResponse = unknown>(endpoint: string, options?: Omit<RequestOptions, "method">) => Promise<TResponse>;
524
+ products: {
525
+ list: (params?: ProductListParams) => Promise<ProductsResponse>;
526
+ get: (id: string | number) => Promise<{
527
+ product: Product;
528
+ }>;
529
+ search: (query: string, params?: ProductListParams) => Promise<ProductsResponse>;
530
+ };
531
+ orders: {
532
+ list: (params?: OrderListParams) => Promise<Order[]>;
533
+ get: (id: string) => Promise<Order>;
534
+ create: (data: CreateOrderData) => Promise<Order>;
535
+ };
536
+ users: {
537
+ me: () => Promise<UserMe>;
538
+ };
539
+ reps: {
540
+ current: () => Promise<Rep>;
541
+ updateProfile: (data: UpdateRepData) => Promise<Rep>;
542
+ };
543
+ profile: {
544
+ get: () => Promise<Profile>;
545
+ };
546
+ app: {
547
+ /** Fetch the raw manifest (plain JSON, no Color objects). Cache-safe. */getRaw: () => Promise<RawManifestResponse>; /** Fetch the active app definition with full theme/screen/navigation transforms */
548
+ get: () => Promise<RepAppData$1>;
549
+ };
550
+ permissions: {
551
+ get: () => Promise<UserPermissions>;
552
+ };
553
+ analytics: {
554
+ dashboard: () => Promise<DashboardData>;
555
+ sales: (params?: SalesParams) => Promise<SalesData>;
556
+ };
557
+ };
558
+ type FluidClient = ReturnType<typeof createFluidClient>;
559
+ //#endregion
560
+ //#region src/providers/FluidProvider.d.ts
561
+ /**
562
+ * Context value for FluidProvider.
563
+ * All properties are readonly since context values should not be mutated by consumers.
564
+ */
565
+ interface FluidContextValue {
566
+ /** Configured API client instance */
567
+ readonly client: FluidClient;
568
+ /** SDK configuration */
569
+ readonly config: FluidSDKConfig;
570
+ }
571
+ interface FluidProviderProps {
572
+ /** SDK configuration (baseUrl, auth, etc.) */
573
+ config: FluidSDKConfig;
574
+ /** React children */
575
+ children: ReactNode;
576
+ /** Optional custom QueryClient instance */
577
+ queryClient?: QueryClient;
578
+ /** Optional initial theme */
579
+ initialTheme?: ThemeDefinition;
580
+ /** Optional container for scoped theme application */
581
+ themeContainer?: HTMLElement | null;
582
+ /** Optional custom widget registry (defaults to all built-in widgets) */
583
+ widgetRegistry?: Record<string, React.ComponentType<any>>;
584
+ /** Dynamic variables for data source endpoint path substitution (e.g., { rep_id: "123" }) */
585
+ variables?: Record<string, string>;
586
+ }
587
+ /**
588
+ * Main provider for the Fluid Rep SDK
589
+ *
590
+ * @example
591
+ * ```tsx
592
+ * import { FluidProvider } from "@fluid-app/rep-sdk";
593
+ *
594
+ * function App() {
595
+ * return (
596
+ * <FluidProvider
597
+ * config={{
598
+ * baseUrl: "https://api.fluid.app/api",
599
+ * getAuthToken: () => localStorage.getItem("token"),
600
+ * }}
601
+ * >
602
+ * <YourApp />
603
+ * </FluidProvider>
604
+ * );
605
+ * }
606
+ * ```
607
+ */
608
+ declare function FluidProvider({
609
+ config,
610
+ children,
611
+ queryClient,
612
+ initialTheme,
613
+ themeContainer,
614
+ widgetRegistry,
615
+ variables
616
+ }: FluidProviderProps): react_jsx_runtime0.JSX.Element;
617
+ /**
618
+ * Hook to access the Fluid context
619
+ * Must be used within a FluidProvider
620
+ */
621
+ declare function useFluidContext(): FluidContextValue;
622
+ //#endregion
623
+ //#region src/providers/FluidThemeProvider.d.ts
624
+ type ThemeMode$1 = "light" | "dark";
625
+ /**
626
+ * Context value for theme management.
627
+ * All properties are readonly since context values should not be mutated by consumers.
628
+ */
629
+ interface ThemeContextValue {
630
+ /** Currently active theme definition */
631
+ readonly currentTheme: ThemeDefinition | null;
632
+ /** Switch to a different theme */
633
+ readonly setTheme: (theme: ThemeDefinition) => void;
634
+ /** Switch between light and dark mode for the current theme */
635
+ readonly setThemeMode: (mode: ThemeMode$1) => void;
636
+ /** Current theme mode */
637
+ readonly mode: ThemeMode$1 | undefined;
638
+ }
639
+ interface FluidThemeProviderProps {
640
+ children: ReactNode;
641
+ /** Initial theme to apply */
642
+ initialTheme?: ThemeDefinition;
643
+ /** Container element for scoped theme application (defaults to document.documentElement) */
644
+ container?: HTMLElement | null;
645
+ }
646
+ declare function FluidThemeProvider({
647
+ children,
648
+ initialTheme,
649
+ container
650
+ }: FluidThemeProviderProps): react_jsx_runtime0.JSX.Element;
651
+ /**
652
+ * Hook to access theme context
653
+ * Must be used within a FluidThemeProvider
654
+ */
655
+ declare function useThemeContext(): ThemeContextValue;
656
+ //#endregion
657
+ //#region src/providers/FluidAuthProvider.d.ts
658
+ interface FluidAuthProviderProps {
659
+ /** React children to wrap with auth context */
660
+ children: ReactNode;
661
+ /** Auth configuration options */
662
+ config?: FluidAuthConfig;
663
+ }
664
+ /**
665
+ * Authentication provider for Fluid rep portal applications.
666
+ *
667
+ * On mount, this provider:
668
+ * 1. Checks for a token in the URL (passed from parent app)
669
+ * 2. Cleans token from URL immediately (security)
670
+ * 3. Falls back to stored token (cookie/localStorage)
671
+ * 4. Validates the token (checks expiration)
672
+ * 5. Stores valid tokens for future use
673
+ * 6. Calls onAuthFailure if no valid token found
674
+ *
675
+ * @example
676
+ * ```tsx
677
+ * import { FluidAuthProvider } from "@fluid-app/rep-sdk";
678
+ *
679
+ * function App() {
680
+ * return (
681
+ * <FluidAuthProvider
682
+ * config={{
683
+ * onAuthFailure: () => {
684
+ * window.location.href = "/login";
685
+ * },
686
+ * }}
687
+ * >
688
+ * <YourApp />
689
+ * </FluidAuthProvider>
690
+ * );
691
+ * }
692
+ * ```
693
+ */
694
+ declare function FluidAuthProvider({
695
+ children,
696
+ config
697
+ }: FluidAuthProviderProps): react_jsx_runtime0.JSX.Element;
698
+ /**
699
+ * Hook to access the auth context directly.
700
+ * Prefer using `useFluidAuth` for most use cases.
701
+ *
702
+ * @throws Error if used outside FluidAuthProvider
703
+ */
704
+ declare function useFluidAuthContext(): FluidAuthContextValue;
705
+ //#endregion
706
+ //#region src/types/screen-types.d.ts
707
+ /**
708
+ * Screen Types - Type definitions for core feature screens
709
+ *
710
+ * All status and type unions are derived from constants for single source of truth.
711
+ * Use the constants (e.g., CONVERSATION_STATUSES.active) for type-safe comparisons.
712
+ */
713
+ /**
714
+ * Conversation status constant - single source of truth.
715
+ */
716
+ declare const CONVERSATION_STATUSES: {
717
+ readonly active: "active";
718
+ readonly archived: "archived";
719
+ readonly muted: "muted";
720
+ };
721
+ /**
722
+ * Union type derived from CONVERSATION_STATUSES constant.
723
+ */
724
+ type ConversationStatus = (typeof CONVERSATION_STATUSES)[keyof typeof CONVERSATION_STATUSES];
725
+ /**
726
+ * Message type constant - single source of truth.
727
+ */
728
+ declare const MESSAGE_TYPES: {
729
+ readonly text: "text";
730
+ readonly image: "image";
731
+ readonly file: "file";
732
+ readonly system: "system";
733
+ };
734
+ /**
735
+ * Union type derived from MESSAGE_TYPES constant.
736
+ */
737
+ type MessageType = (typeof MESSAGE_TYPES)[keyof typeof MESSAGE_TYPES];
738
+ interface Participant {
739
+ readonly id: string;
740
+ readonly name: string;
741
+ readonly email: string;
742
+ readonly avatarUrl?: string;
743
+ readonly isOnline?: boolean;
744
+ }
745
+ /**
746
+ * Message attachment type - extracted for reusability and clarity.
747
+ */
748
+ interface MessageAttachment {
749
+ readonly id: string;
750
+ readonly name: string;
751
+ readonly url: string;
752
+ readonly type: string;
753
+ readonly size?: number;
754
+ }
755
+ interface Message {
756
+ readonly id: string;
757
+ readonly conversationId: string;
758
+ readonly senderId: string;
759
+ readonly senderName: string;
760
+ readonly senderAvatarUrl?: string;
761
+ readonly type: MessageType;
762
+ readonly content: string;
763
+ readonly timestamp: string;
764
+ readonly isRead: boolean;
765
+ readonly attachments?: readonly MessageAttachment[];
766
+ }
767
+ interface Conversation {
768
+ readonly id: string;
769
+ readonly title: string;
770
+ readonly participants: readonly Participant[];
771
+ readonly lastMessage?: Message;
772
+ readonly unreadCount: number;
773
+ readonly status: ConversationStatus;
774
+ readonly createdAt: string;
775
+ readonly updatedAt: string;
776
+ }
777
+ /**
778
+ * Contact status constant - single source of truth.
779
+ */
780
+ declare const CONTACT_STATUSES: {
781
+ readonly active: "active";
782
+ readonly inactive: "inactive";
783
+ readonly lead: "lead";
784
+ readonly prospect: "prospect";
785
+ };
786
+ /**
787
+ * Union type derived from CONTACT_STATUSES constant.
788
+ */
789
+ type ContactStatus = (typeof CONTACT_STATUSES)[keyof typeof CONTACT_STATUSES];
790
+ /**
791
+ * Contact type constant - single source of truth.
792
+ */
793
+ declare const CONTACT_TYPES: {
794
+ readonly individual: "individual";
795
+ readonly company: "company";
796
+ };
797
+ /**
798
+ * Union type derived from CONTACT_TYPES constant.
799
+ */
800
+ type ContactType = (typeof CONTACT_TYPES)[keyof typeof CONTACT_TYPES];
801
+ interface ContactAddress {
802
+ readonly street?: string;
803
+ readonly city?: string;
804
+ readonly state?: string;
805
+ readonly postalCode?: string;
806
+ readonly country?: string;
807
+ }
808
+ interface Contact {
809
+ readonly id: string;
810
+ readonly firstName: string;
811
+ readonly lastName: string;
812
+ readonly email: string;
813
+ readonly phone?: string;
814
+ readonly company?: string;
815
+ readonly jobTitle?: string;
816
+ readonly avatarUrl?: string;
817
+ readonly status: ContactStatus;
818
+ readonly type: ContactType;
819
+ readonly address?: ContactAddress;
820
+ readonly tags?: readonly string[];
821
+ readonly notes?: string;
822
+ readonly createdAt: string;
823
+ readonly updatedAt: string;
824
+ }
825
+ //#endregion
826
+ //#region src/providers/PageTemplateProvider.d.ts
827
+ /**
828
+ * Context value for page template resolution.
829
+ * All properties are readonly since context values should not be mutated by consumers.
830
+ */
831
+ interface PageTemplateContextValue {
832
+ /**
833
+ * Resolve a navigation's page_refs and screens into a unified screen list
834
+ */
835
+ readonly resolvePages: (navigation: Navigation) => ScreenDefinition[];
836
+ /**
837
+ * Get all available page templates
838
+ */
839
+ readonly listTemplates: () => PageTemplate[];
840
+ /**
841
+ * Get a specific template by ID
842
+ */
843
+ readonly getTemplate: (id: string) => PageTemplate | undefined;
844
+ /**
845
+ * Check if a template exists
846
+ */
847
+ readonly hasTemplate: (id: string) => boolean;
848
+ }
849
+ /**
850
+ * Props for PageTemplateProvider
851
+ */
852
+ interface PageTemplateProviderProps {
853
+ children: React$1.ReactNode;
854
+ /**
855
+ * Additional custom page templates to register.
856
+ * These are registered when the provider mounts and unregistered when it unmounts.
857
+ */
858
+ templates?: readonly PageTemplate[];
859
+ }
860
+ /**
861
+ * Provider for page template resolution.
862
+ *
863
+ * This provider:
864
+ * 1. Registers any custom templates passed via props
865
+ * 2. Provides methods for resolving navigation pages
866
+ * 3. Cleans up custom templates on unmount
867
+ *
868
+ * @example
869
+ * ```tsx
870
+ * // With custom templates
871
+ * const customTemplates: PageTemplate[] = [
872
+ * {
873
+ * id: 'custom-dashboard',
874
+ * slug: 'dashboard',
875
+ * name: 'Dashboard',
876
+ * category: 'custom',
877
+ * version: '1.0.0',
878
+ * component_tree: [{ type: 'TextWidget', props: { text: 'Custom Dashboard' } }],
879
+ * },
880
+ * ];
881
+ *
882
+ * <PageTemplateProvider templates={customTemplates}>
883
+ * <App />
884
+ * </PageTemplateProvider>
885
+ *
886
+ * // Without custom templates (uses only core templates)
887
+ * <PageTemplateProvider>
888
+ * <App />
889
+ * </PageTemplateProvider>
890
+ * ```
891
+ */
892
+ declare function PageTemplateProvider({
893
+ children,
894
+ templates
895
+ }: PageTemplateProviderProps): react_jsx_runtime0.JSX.Element;
896
+ /**
897
+ * Hook to access page template functionality.
898
+ *
899
+ * @throws Error if used outside of PageTemplateProvider
900
+ *
901
+ * @example
902
+ * ```tsx
903
+ * function NavigationRenderer({ navigation }: { navigation: Navigation }) {
904
+ * const { resolvePages } = usePageTemplates();
905
+ * const screens = resolvePages(navigation);
906
+ *
907
+ * return (
908
+ * <div>
909
+ * {screens.map((screen) => (
910
+ * <Screen key={screen.id} definition={screen} />
911
+ * ))}
912
+ * </div>
913
+ * );
914
+ * }
915
+ * ```
916
+ */
917
+ declare function usePageTemplates(): PageTemplateContextValue;
918
+ /**
919
+ * Hook to resolve navigation pages directly.
920
+ * Convenience wrapper around usePageTemplates().resolvePages.
921
+ *
922
+ * @param navigation - The navigation to resolve
923
+ * @returns Array of resolved screen definitions
924
+ */
925
+ declare function useResolvedPages(navigation: Navigation): ScreenDefinition[];
926
+ //#endregion
927
+ //#region src/hooks/use-fluid-api.d.ts
928
+ /**
929
+ * Hook to access the Fluid API client
930
+ *
931
+ * @example
932
+ * ```tsx
933
+ * function ProductList() {
934
+ * const api = useFluidApi();
935
+ *
936
+ * const { data: products } = useQuery({
937
+ * queryKey: ["products"],
938
+ * queryFn: () => api.products.list(),
939
+ * });
940
+ *
941
+ * return <ul>{products?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;
942
+ * }
943
+ * ```
944
+ */
945
+ declare function useFluidApi(): FluidClient;
946
+ //#endregion
947
+ //#region src/hooks/use-fluid-profile.d.ts
948
+ /**
949
+ * Query key for profile data
950
+ */
951
+ declare const PROFILE_QUERY_KEY: readonly ["fluid", "profile"];
952
+ /**
953
+ * Hook to fetch the rep portal profile (themes, navigation, screens)
954
+ *
955
+ * @example
956
+ * ```tsx
957
+ * function Navigation() {
958
+ * const { data: profile, isLoading } = useFluidProfile();
959
+ *
960
+ * if (isLoading) return <Spinner />;
961
+ *
962
+ * return (
963
+ * <nav>
964
+ * {profile?.navigation.navigation_items.map(item => (
965
+ * <NavItem key={item.id} item={item} />
966
+ * ))}
967
+ * </nav>
968
+ * );
969
+ * }
970
+ * ```
971
+ */
972
+ declare function useFluidProfile(): UseQueryResult<Profile>;
973
+ //#endregion
974
+ //#region src/hooks/use-fluid-app.d.ts
975
+ /**
976
+ * Query key for full app data (fluidos endpoint)
977
+ */
978
+ declare const APP_DATA_QUERY_KEY: readonly ["fluid", "app"];
979
+ /**
980
+ * Hook to fetch the full rep app data from the fluidos API.
981
+ *
982
+ * Returns a `RepAppData` object containing:
983
+ * - `screens` — all screen definitions with normalized component trees
984
+ * - `profile.themes` — fully-transformed ThemeDefinition[] (handles legacy + new formats)
985
+ * - `profile.activeThemeId` — the currently active theme ID
986
+ * - `profile.navigation.navigation_items` — sorted, recursive navigation tree
987
+ *
988
+ * Uses IndexedDB persistence so subsequent page loads hydrate instantly
989
+ * from cache while revalidating in the background. The raw API response
990
+ * (plain JSON) is cached; Color objects are recreated from cache via
991
+ * `select` on every restore — this is fast (CPU only, no network).
992
+ *
993
+ * @example
994
+ * ```tsx
995
+ * function App() {
996
+ * const { data: appData, isLoading } = useFluidApp();
997
+ *
998
+ * if (isLoading) return <Spinner />;
999
+ *
1000
+ * return (
1001
+ * <AppShell
1002
+ * appData={appData}
1003
+ * navigation={appData.profile.navigation.navigation_items}
1004
+ * />
1005
+ * );
1006
+ * }
1007
+ * ```
1008
+ */
1009
+ declare function useFluidApp(options?: {
1010
+ enabled?: boolean;
1011
+ }): UseQueryResult<RepAppData$1>;
1012
+ //#endregion
1013
+ //#region src/hooks/use-fluid-permissions.d.ts
1014
+ /**
1015
+ * Query key for permissions data
1016
+ */
1017
+ declare const PERMISSIONS_QUERY_KEY: readonly ["fluid", "permissions"];
1018
+ /**
1019
+ * Result of useFluidPermissions hook
1020
+ */
1021
+ interface UseFluidPermissionsResult {
1022
+ /** Raw permissions query result */
1023
+ query: UseQueryResult<UserPermissions>;
1024
+ /** Permissions data (alias for query.data) */
1025
+ permissions: UserPermissions | undefined;
1026
+ /** Check if user has a specific permission */
1027
+ can: (resource: string, action?: PermissionAction) => boolean;
1028
+ /** Check if user is a super admin */
1029
+ isSuperAdmin: boolean;
1030
+ }
1031
+ /**
1032
+ * Hook to fetch and check user permissions
1033
+ *
1034
+ * @example
1035
+ * ```tsx
1036
+ * function TeamSettings() {
1037
+ * const { can, isSuperAdmin } = useFluidPermissions();
1038
+ *
1039
+ * if (!can("team", "manage")) {
1040
+ * return <AccessDenied />;
1041
+ * }
1042
+ *
1043
+ * return <TeamSettingsForm canDelete={can("team", "delete")} />;
1044
+ * }
1045
+ * ```
1046
+ */
1047
+ declare function useFluidPermissions(): UseFluidPermissionsResult;
1048
+ //#endregion
1049
+ //#region src/hooks/use-fluid-theme.d.ts
1050
+ /**
1051
+ * Result of useFluidTheme hook
1052
+ */
1053
+ interface UseFluidThemeResult {
1054
+ /** Currently active theme */
1055
+ currentTheme: ThemeDefinition | null;
1056
+ /** Switch to a different theme */
1057
+ setTheme: (theme: ThemeDefinition) => void;
1058
+ /** Switch between light and dark mode */
1059
+ setThemeMode: (mode: "light" | "dark") => void;
1060
+ /** Current theme mode (convenience accessor) */
1061
+ mode: "light" | "dark" | undefined;
1062
+ }
1063
+ /**
1064
+ * Hook to access and control theme settings
1065
+ *
1066
+ * @example
1067
+ * ```tsx
1068
+ * function ThemeSwitcher({ themes }: { themes: ThemeDefinition[] }) {
1069
+ * const { currentTheme, setTheme, setThemeMode, mode } = useFluidTheme();
1070
+ *
1071
+ * return (
1072
+ * <div>
1073
+ * <select
1074
+ * value={currentTheme?.name}
1075
+ * onChange={(e) => {
1076
+ * const theme = themes.find(t => t.name === e.target.value);
1077
+ * if (theme) setTheme(theme);
1078
+ * }}
1079
+ * >
1080
+ * {themes.map(theme => (
1081
+ * <option key={theme.name} value={theme.name}>
1082
+ * {theme.name}
1083
+ * </option>
1084
+ * ))}
1085
+ * </select>
1086
+ *
1087
+ * <button onClick={() => setThemeMode(mode === "dark" ? "light" : "dark")}>
1088
+ * Toggle {mode === "dark" ? "Light" : "Dark"} Mode
1089
+ * </button>
1090
+ * </div>
1091
+ * );
1092
+ * }
1093
+ * ```
1094
+ */
1095
+ declare function useFluidTheme(): UseFluidThemeResult;
1096
+ //#endregion
1097
+ //#region src/hooks/use-current-rep.d.ts
1098
+ /**
1099
+ * Query key for current rep data
1100
+ */
1101
+ declare const CURRENT_REP_QUERY_KEY: readonly ["fluid", "currentRep"];
1102
+ /**
1103
+ * Hook to fetch the currently authenticated rep's profile
1104
+ *
1105
+ * @example
1106
+ * ```tsx
1107
+ * function RepHeader() {
1108
+ * const { data: rep, isLoading } = useCurrentRep();
1109
+ *
1110
+ * if (isLoading) return <Skeleton />;
1111
+ *
1112
+ * return (
1113
+ * <div>
1114
+ * <Avatar src={rep?.avatar_url} />
1115
+ * <span>{rep?.first_name} {rep?.last_name}</span>
1116
+ * </div>
1117
+ * );
1118
+ * }
1119
+ * ```
1120
+ */
1121
+ declare function useCurrentRep(): UseQueryResult<Rep>;
1122
+ //#endregion
1123
+ //#region src/hooks/use-fluid-auth.d.ts
1124
+ /**
1125
+ * Hook to access authentication state and utilities.
1126
+ *
1127
+ * Must be used within a `FluidAuthProvider`.
1128
+ *
1129
+ * @returns Authentication context with user info, loading state, and utilities
1130
+ * @throws Error if used outside FluidAuthProvider
1131
+ *
1132
+ * @example
1133
+ * ```tsx
1134
+ * function UserProfile() {
1135
+ * const { isAuthenticated, isLoading, user, clearAuth } = useFluidAuth();
1136
+ *
1137
+ * if (isLoading) {
1138
+ * return <Spinner />;
1139
+ * }
1140
+ *
1141
+ * if (!isAuthenticated) {
1142
+ * return <p>Please log in</p>;
1143
+ * }
1144
+ *
1145
+ * return (
1146
+ * <div>
1147
+ * <p>Welcome, {user.full_name}!</p>
1148
+ * <button onClick={clearAuth}>Log out</button>
1149
+ * </div>
1150
+ * );
1151
+ * }
1152
+ * ```
1153
+ */
1154
+ declare function useFluidAuth(): FluidAuthContextValue;
1155
+ //#endregion
1156
+ //#region src/hooks/hook-types.d.ts
1157
+ /**
1158
+ * Hook type utilities and type predicates.
1159
+ *
1160
+ * This module provides:
1161
+ * - Generic hook result types with default type parameters
1162
+ * - Type predicates for query state narrowing
1163
+ * - Reusable patterns for type-safe property access in hooks
1164
+ *
1165
+ * Following generics best practices:
1166
+ * - generics-default-type-parameters: Default E to Error for common case
1167
+ * - generics-type-predicates: Type predicates for result state narrowing
1168
+ * - generics-constrain-type-parameters: K extends keyof T for property access
1169
+ */
1170
+ /**
1171
+ * Base result type for query hooks with default error type.
1172
+ * Uses default type parameter for E (generics-default-type-parameters rule).
1173
+ *
1174
+ * @typeParam T - The data type
1175
+ * @typeParam E - The error type (defaults to Error)
1176
+ *
1177
+ * @example
1178
+ * // Error type defaults to Error
1179
+ * type UsersResult = QueryResult<User[]>;
1180
+ *
1181
+ * // Can override when needed
1182
+ * type CustomResult = QueryResult<User[], ApiError>;
1183
+ */
1184
+ interface QueryResult<T, E = Error> {
1185
+ readonly data: T;
1186
+ readonly isLoading: boolean;
1187
+ readonly isError: boolean;
1188
+ readonly error?: E | undefined;
1189
+ }
1190
+ /**
1191
+ * Result type for hooks that may not have data yet.
1192
+ * Extends QueryResult with nullable data.
1193
+ *
1194
+ * @typeParam T - The data type
1195
+ * @typeParam E - The error type (defaults to Error)
1196
+ */
1197
+ interface QueryResultNullable<T, E = Error> {
1198
+ readonly data: T | null | undefined;
1199
+ readonly isLoading: boolean;
1200
+ readonly isError: boolean;
1201
+ readonly error?: E | undefined;
1202
+ }
1203
+ /**
1204
+ * Result type for list/collection hooks with aggregates.
1205
+ *
1206
+ * @typeParam T - The item type in the array
1207
+ * @typeParam E - The error type (defaults to Error)
1208
+ */
1209
+ interface ListQueryResult<T, E = Error> extends QueryResult<T[], E> {
1210
+ readonly totalCount: number;
1211
+ }
1212
+ /**
1213
+ * Result type for list hooks with value aggregation (e.g., deals with total value).
1214
+ *
1215
+ * @typeParam T - The item type in the array
1216
+ * @typeParam E - The error type (defaults to Error)
1217
+ */
1218
+ interface ValueListQueryResult<T, E = Error> extends ListQueryResult<T, E> {
1219
+ readonly totalValue: number;
1220
+ }
1221
+ /**
1222
+ * Type predicate to check if a query result has successfully loaded data.
1223
+ * Narrows the data type from T | null | undefined to T.
1224
+ *
1225
+ * @example
1226
+ * const result = useContact(id);
1227
+ * if (hasData(result)) {
1228
+ * // TypeScript knows result.data is Contact, not Contact | null
1229
+ * console.log(result.data.name);
1230
+ * }
1231
+ */
1232
+ declare function hasData<T, E = Error>(result: QueryResultNullable<T, E>): result is QueryResultNullable<T, E> & {
1233
+ readonly data: T;
1234
+ };
1235
+ /**
1236
+ * Type predicate to check if a query result is in loading state.
1237
+ * Useful for conditional rendering.
1238
+ *
1239
+ * @example
1240
+ * if (isLoading(result)) {
1241
+ * return <Spinner />;
1242
+ * }
1243
+ */
1244
+ declare function isLoading<T, E = Error>(result: QueryResult<T, E> | QueryResultNullable<T, E>): boolean;
1245
+ /**
1246
+ * Type predicate to check if a query result has an error.
1247
+ * Narrows to include the error property.
1248
+ *
1249
+ * @example
1250
+ * if (isErrorResult(result)) {
1251
+ * console.error(result.error); // error is E, not undefined
1252
+ * }
1253
+ */
1254
+ declare function isErrorResult<T, E = Error>(result: QueryResult<T, E> | QueryResultNullable<T, E>): result is (QueryResult<T, E> | QueryResultNullable<T, E>) & {
1255
+ readonly isError: true;
1256
+ readonly error: E;
1257
+ };
1258
+ /**
1259
+ * Type predicate to check if a query result is in idle state (not loading, no error, has data).
1260
+ *
1261
+ * @example
1262
+ * if (isIdle(result)) {
1263
+ * // Safe to access and render data
1264
+ * }
1265
+ */
1266
+ declare function isIdle<T, E = Error>(result: QueryResult<T, E> | QueryResultNullable<T, E>): boolean;
1267
+ /**
1268
+ * Type-safe property selector for hook results.
1269
+ * Uses K extends keyof T constraint (generics-function-constraints rule).
1270
+ *
1271
+ * @typeParam T - The data object type
1272
+ * @typeParam K - Key of T (constrained to actual keys)
1273
+ *
1274
+ * @example
1275
+ * const users = [{ name: "Alice", age: 30 }];
1276
+ * const names = selectProperty(users, "name"); // string[]
1277
+ * const ages = selectProperty(users, "age"); // number[]
1278
+ * selectProperty(users, "invalid"); // Error: "invalid" not in "name" | "age"
1279
+ */
1280
+ declare function selectProperty<T, K extends keyof T>(items: readonly T[], key: K): T[K][];
1281
+ /**
1282
+ * Type-safe property getter for a single item.
1283
+ * Returns undefined if item is null/undefined.
1284
+ *
1285
+ * @typeParam T - The data object type
1286
+ * @typeParam K - Key of T (constrained to actual keys)
1287
+ */
1288
+ declare function getProperty<T, K extends keyof T>(item: T | null | undefined, key: K): T[K] | undefined;
1289
+ /**
1290
+ * Generic type for hooks that fetch a single resource by ID.
1291
+ * Useful for creating consistent API across different resource types.
1292
+ *
1293
+ * @typeParam T - The resource type
1294
+ * @typeParam E - The error type (defaults to Error)
1295
+ */
1296
+ type UseSingleResourceHook<T, E = Error> = (id: string) => QueryResultNullable<T, E>;
1297
+ /**
1298
+ * Generic type for hooks that fetch a list of resources with optional params.
1299
+ * Uses generics-default-type-parameters for the params type.
1300
+ *
1301
+ * @typeParam T - The item type
1302
+ * @typeParam P - The params type (defaults to empty object)
1303
+ * @typeParam E - The error type (defaults to Error)
1304
+ */
1305
+ type UseListResourceHook<T, P extends Record<string, unknown> = Record<string, never>, E = Error> = (params?: P) => ListQueryResult<T, E>;
1306
+ /**
1307
+ * Transforms a nullable result to a non-nullable one if data exists.
1308
+ * Useful when you've already checked hasData().
1309
+ */
1310
+ type WithData<R extends QueryResultNullable<unknown>> = R extends QueryResultNullable<infer T, infer E> ? QueryResultNullable<T, E> & {
1311
+ readonly data: T;
1312
+ } : never;
1313
+ /**
1314
+ * Activity slug constants as a const object.
1315
+ * Derive the ActivitySlug type from this single source of truth.
1316
+ */
1317
+ declare const ACTIVITY_SLUGS: {
1318
+ readonly abandonedCart: "abandoned_cart";
1319
+ readonly announcements: "announcements";
1320
+ readonly cartItemsAdded: "cart_items_added";
1321
+ readonly commentReply: "comment_reply";
1322
+ readonly directMessage: "direct_message";
1323
+ readonly fantasyPoint: "fantasy_point";
1324
+ readonly newLead: "new_lead";
1325
+ readonly orderPlaced: "order_placed";
1326
+ readonly pageViews: "page_views";
1327
+ readonly pageViewsContact: "page_views_contact";
1328
+ readonly tasks: "tasks";
1329
+ readonly upcomingEvent: "upcoming_event";
1330
+ readonly video: "video";
1331
+ readonly videoComplete: "video_complete";
1332
+ readonly videoCompleteContact: "video_complete_contact";
1333
+ readonly videoContact: "video_contact";
1334
+ readonly messageReceived: "message_received";
1335
+ readonly messageSent: "message_sent";
1336
+ readonly newCartItemsAdded: "new_cart_items_added";
1337
+ readonly smartLinkClicked: "smart_link_clicked";
1338
+ readonly reviewLeft: "review_left";
1339
+ };
1340
+ /** Activity slug union type derived from ACTIVITY_SLUGS constant. */
1341
+ type ActivitySlug = (typeof ACTIVITY_SLUGS)[keyof typeof ACTIVITY_SLUGS];
1342
+ /** Type predicate to check if a string is a valid ActivitySlug. */
1343
+ declare function isActivitySlug(value: string): value is ActivitySlug;
1344
+ /** Transformed activity for display. */
1345
+ interface Activity {
1346
+ readonly id: number;
1347
+ readonly userName: string;
1348
+ readonly avatarUrl: string | null;
1349
+ readonly activityType: string;
1350
+ readonly targetName: string;
1351
+ readonly timestamp: string;
1352
+ readonly slug: ActivitySlug;
1353
+ }
1354
+ /** Description/rich text metadata for a calendar event. */
1355
+ interface CalendarEventDescription {
1356
+ readonly id?: number | null;
1357
+ readonly name?: string | null;
1358
+ readonly body?: string | null;
1359
+ readonly record_type?: string | null;
1360
+ readonly record_id?: number | null;
1361
+ readonly created_at?: string | null;
1362
+ readonly updated_at?: string | null;
1363
+ readonly locale?: string | null;
1364
+ }
1365
+ /** Calendar event data from the API. */
1366
+ interface CalendarEvent {
1367
+ readonly id: number;
1368
+ readonly title: string;
1369
+ readonly description?: CalendarEventDescription | null;
1370
+ readonly color?: string | null;
1371
+ readonly url?: string | null;
1372
+ readonly start: string;
1373
+ readonly end: string;
1374
+ readonly active?: boolean | null;
1375
+ readonly time_zone?: string | null;
1376
+ readonly status?: string | null;
1377
+ readonly image_url?: string | null;
1378
+ readonly images?: readonly unknown[] | null;
1379
+ readonly venue?: string | null;
1380
+ readonly countries?: readonly string[] | null;
1381
+ readonly hasTomorrow?: boolean | null;
1382
+ readonly hasYesterday?: boolean | null;
1383
+ readonly isAllDay?: boolean;
1384
+ }
1385
+ /** Catch up suggestion data from the API. */
1386
+ interface CatchUp {
1387
+ readonly id: number;
1388
+ readonly suggestion_title: string;
1389
+ }
1390
+ /** MySite data returned by the hook. */
1391
+ interface MySiteData {
1392
+ readonly url: string | null;
1393
+ readonly views: number;
1394
+ readonly leads: number;
1395
+ readonly userName: string;
1396
+ }
1397
+ /** Transformed todo for display. */
1398
+ interface Todo {
1399
+ readonly id: number;
1400
+ readonly body: string;
1401
+ readonly dueAt: string | null;
1402
+ readonly completedAt: string | null;
1403
+ readonly createdAt: string;
1404
+ readonly contactName: string | null;
1405
+ }
1406
+ //#endregion
1407
+ //#region src/hooks/use-calendar-events.d.ts
1408
+ /**
1409
+ * Result type for useCalendarEvents hook.
1410
+ * Uses QueryResult<CalendarEvent[]> with default Error type.
1411
+ */
1412
+ type UseCalendarEventsResult = QueryResult<CalendarEvent[]>;
1413
+ /**
1414
+ * Hook to fetch calendar events.
1415
+ * This is a stub implementation - override with your own data fetching logic.
1416
+ */
1417
+ declare function useCalendarEvents(): UseCalendarEventsResult;
1418
+ //#endregion
1419
+ //#region src/hooks/use-todos.d.ts
1420
+ /**
1421
+ * Result type for useTodos hook.
1422
+ * Uses QueryResult<Todo[]> with default Error type.
1423
+ */
1424
+ type UseTodosResult = QueryResult<Todo[]>;
1425
+ /**
1426
+ * Hook to fetch todo items.
1427
+ * This is a stub implementation - override with your own data fetching logic.
1428
+ */
1429
+ declare function useTodos(): UseTodosResult;
1430
+ //#endregion
1431
+ //#region src/hooks/use-activities.d.ts
1432
+ /**
1433
+ * Result type for useActivities hook.
1434
+ * Uses QueryResult generic with Activity[] and default Error type.
1435
+ */
1436
+ type UseActivitiesResult = QueryResult<Activity[]>;
1437
+ /**
1438
+ * Hook to fetch recent activities.
1439
+ * This is a stub implementation - override with your own data fetching logic.
1440
+ */
1441
+ declare function useActivities(): UseActivitiesResult;
1442
+ //#endregion
1443
+ //#region src/hooks/use-catchups.d.ts
1444
+ /**
1445
+ * Result type for useCatchUps hook.
1446
+ * Uses QueryResult<CatchUp[]> with default Error type.
1447
+ */
1448
+ type UseCatchUpsResult = QueryResult<CatchUp[]>;
1449
+ /**
1450
+ * Hook to fetch catch up items.
1451
+ * This is a stub implementation - override with your own data fetching logic.
1452
+ */
1453
+ declare function useCatchUps(): UseCatchUpsResult;
1454
+ //#endregion
1455
+ //#region src/hooks/use-mysite.d.ts
1456
+ /**
1457
+ * Result type for useMySite hook.
1458
+ * Uses QueryResultNullable since MySite data may not be available.
1459
+ */
1460
+ type UseMySiteResult = QueryResultNullable<MySiteData>;
1461
+ /**
1462
+ * Hook to fetch MySite data.
1463
+ * This is a stub implementation - override with your own data fetching logic.
1464
+ */
1465
+ declare function useMySite(): UseMySiteResult;
1466
+ //#endregion
1467
+ //#region src/hooks/use-conversations.d.ts
1468
+ /**
1469
+ * Result type for useConversations hook.
1470
+ * Uses QueryResult<Conversation[]> with default Error type.
1471
+ */
1472
+ type UseConversationsResult = QueryResult<Conversation[]>;
1473
+ /**
1474
+ * Hook to fetch all conversations.
1475
+ * This is a stub implementation - override with your own data fetching logic.
1476
+ *
1477
+ * @returns UseConversationsResult with empty data array
1478
+ *
1479
+ * @example
1480
+ * ```tsx
1481
+ * const { data: conversations, isLoading, isError } = useConversations();
1482
+ *
1483
+ * if (isLoading) return <Loading />;
1484
+ * if (isError) return <Error />;
1485
+ *
1486
+ * return conversations.map(conv => <ConversationItem key={conv.id} {...conv} />);
1487
+ * ```
1488
+ */
1489
+ declare function useConversations(): UseConversationsResult;
1490
+ /**
1491
+ * Result type for useConversationMessages hook.
1492
+ * Uses QueryResult<Message[]> with default Error type.
1493
+ */
1494
+ type UseConversationMessagesResult = QueryResult<Message[]>;
1495
+ /**
1496
+ * Hook to fetch messages for a specific conversation.
1497
+ * This is a stub implementation - override with your own data fetching logic.
1498
+ *
1499
+ * @param conversationId - The ID of the conversation to fetch messages for
1500
+ * @returns UseConversationMessagesResult with empty data array
1501
+ *
1502
+ * @example
1503
+ * ```tsx
1504
+ * const { data: messages, isLoading, isError } = useConversationMessages(conversationId);
1505
+ *
1506
+ * if (isLoading) return <Loading />;
1507
+ * if (isError) return <Error />;
1508
+ *
1509
+ * return messages.map(msg => <MessageBubble key={msg.id} {...msg} />);
1510
+ * ```
1511
+ */
1512
+ declare function useConversationMessages(_conversationId: string): UseConversationMessagesResult;
1513
+ //#endregion
1514
+ //#region src/hooks/use-contacts.d.ts
1515
+ /**
1516
+ * Type predicate to check if a status string is a valid ContactStatus.
1517
+ * Enables runtime validation with type narrowing.
1518
+ */
1519
+ declare function isContactStatus(value: string): value is ContactStatus;
1520
+ /**
1521
+ * Parameters for filtering and paginating contacts.
1522
+ * Uses readonly properties and proper ContactStatus type for status.
1523
+ */
1524
+ interface UseContactsParams {
1525
+ /** Search query to filter contacts by name, email, or company */
1526
+ readonly search?: string;
1527
+ /** Filter contacts by status - uses ContactStatus union type for type safety */
1528
+ readonly status?: ContactStatus;
1529
+ /** Maximum number of contacts to return */
1530
+ readonly limit?: number;
1531
+ }
1532
+ /**
1533
+ * Result type for the useContacts hook.
1534
+ * Uses ListQueryResult<Contact> with totalCount and default Error type.
1535
+ */
1536
+ type UseContactsResult = ListQueryResult<Contact>;
1537
+ /**
1538
+ * Result type for the useContact hook.
1539
+ * Uses QueryResultNullable since a specific contact may not exist.
1540
+ */
1541
+ type UseContactResult = QueryResultNullable<Contact>;
1542
+ /**
1543
+ * Hook to fetch a list of contacts with optional filtering and pagination.
1544
+ * This is a stub implementation - override with your own data fetching logic.
1545
+ *
1546
+ * @param params - Optional parameters for filtering and pagination
1547
+ * @returns Object containing contacts data, loading state, error state, and total count
1548
+ *
1549
+ * @example
1550
+ * ```tsx
1551
+ * const { data: contacts, isLoading, totalCount } = useContacts({
1552
+ * search: 'john',
1553
+ * status: 'active',
1554
+ * limit: 20
1555
+ * });
1556
+ * ```
1557
+ */
1558
+ declare function useContacts(_params?: UseContactsParams): UseContactsResult;
1559
+ /**
1560
+ * Hook to fetch a single contact by ID.
1561
+ * This is a stub implementation - override with your own data fetching logic.
1562
+ *
1563
+ * @param contactId - The unique identifier of the contact to fetch
1564
+ * @returns Object containing contact data, loading state, and error state
1565
+ *
1566
+ * @example
1567
+ * ```tsx
1568
+ * const { data: contact, isLoading, isError } = useContact('contact-123');
1569
+ * ```
1570
+ */
1571
+ declare function useContact(_contactId: string): UseContactResult;
1572
+ //#endregion
1573
+ //#region src/components/RequireAuth.d.ts
1574
+ interface RequireAuthProps {
1575
+ /** Content to render when authenticated */
1576
+ children: ReactNode;
1577
+ /** Component to show while checking authentication (default: AuthLoading) */
1578
+ fallback?: ReactNode;
1579
+ /** Component to show when not authenticated (default: AuthError) */
1580
+ errorComponent?: ReactNode;
1581
+ }
1582
+ /**
1583
+ * Component that protects content requiring authentication.
1584
+ *
1585
+ * **Important:** This provides UX-level protection only. It prevents
1586
+ * unauthenticated users from seeing the UI, but the real security
1587
+ * boundary is the server-side API. Client-side auth can always be
1588
+ * bypassed by modifying browser state.
1589
+ *
1590
+ * For defense-in-depth, configure `jwksUrl` in `FluidAuthConfig`
1591
+ * to enable client-side JWT signature verification.
1592
+ *
1593
+ * Shows different states based on auth status:
1594
+ * - Loading: Shows fallback (spinner by default)
1595
+ * - Not authenticated: Shows errorComponent (AuthError by default)
1596
+ * - Authenticated: Shows children
1597
+ *
1598
+ * @example
1599
+ * ```tsx
1600
+ * // Basic usage - shows default loading/error states
1601
+ * <RequireAuth>
1602
+ * <ProtectedContent />
1603
+ * </RequireAuth>
1604
+ *
1605
+ * // Custom loading state
1606
+ * <RequireAuth fallback={<CustomSpinner />}>
1607
+ * <ProtectedContent />
1608
+ * </RequireAuth>
1609
+ *
1610
+ * // Custom error component
1611
+ * <RequireAuth errorComponent={<LoginPrompt />}>
1612
+ * <ProtectedContent />
1613
+ * </RequireAuth>
1614
+ *
1615
+ * // Both custom
1616
+ * <RequireAuth
1617
+ * fallback={<SkeletonLoader />}
1618
+ * errorComponent={<RedirectToLogin />}
1619
+ * >
1620
+ * <Dashboard />
1621
+ * </RequireAuth>
1622
+ * ```
1623
+ */
1624
+ declare function RequireAuth({
1625
+ children,
1626
+ fallback,
1627
+ errorComponent
1628
+ }: RequireAuthProps): react_jsx_runtime0.JSX.Element;
1629
+ //#endregion
1630
+ //#region src/components/AuthError.d.ts
1631
+ interface AuthErrorProps {
1632
+ /** Error message to display */
1633
+ message?: string;
1634
+ /** Optional title */
1635
+ title?: string;
1636
+ /** Optional children for custom content */
1637
+ children?: ReactNode;
1638
+ }
1639
+ /**
1640
+ * Default authentication error component.
1641
+ *
1642
+ * Displays a simple error message when authentication fails.
1643
+ * Can be customized via props or replaced entirely in RequireAuth.
1644
+ *
1645
+ * @example
1646
+ * ```tsx
1647
+ * // Use with default message
1648
+ * <AuthError />
1649
+ *
1650
+ * // Use with custom message
1651
+ * <AuthError message="Session expired. Please log in again." />
1652
+ *
1653
+ * // Use with custom content
1654
+ * <AuthError>
1655
+ * <CustomLoginButton />
1656
+ * </AuthError>
1657
+ * ```
1658
+ */
1659
+ declare function AuthError({
1660
+ message,
1661
+ title,
1662
+ children
1663
+ }: AuthErrorProps): react_jsx_runtime0.JSX.Element;
1664
+ /**
1665
+ * Simple loading spinner component for auth loading state.
1666
+ */
1667
+ declare function AuthLoading(): react_jsx_runtime0.JSX.Element;
1668
+ //#endregion
1669
+ //#region src/messaging/use-messaging-auth.d.ts
1670
+ declare function useMessagingAuth(): MessagingAuthContext$1;
1671
+ //#endregion
1672
+ //#region src/messaging/use-messaging-config.d.ts
1673
+ interface MessagingConfig {
1674
+ readonly apiConfig: MessagingApiConfig;
1675
+ readonly websocketUrl: string;
1676
+ readonly token: string | null;
1677
+ }
1678
+ declare function useMessagingConfig(): MessagingConfig;
1679
+ //#endregion
1680
+ //#region src/messaging/fluid-file-uploader.d.ts
1681
+ /**
1682
+ * Creates a FileUploader that uploads to Filestack using the REST API.
1683
+ *
1684
+ * @param apiKey - Filestack API key. If falsy, returns a noop uploader
1685
+ * that rejects uploads with a helpful error message.
1686
+ */
1687
+ declare function createFluidFileUploader(apiKey: string | undefined): FileUploader$1;
1688
+ import * as import__fluid_app_rep_core_theme from "@fluid-app/rep-core/theme";
1689
+ //#endregion
1690
+ //#region src/screens/MessagingScreen.d.ts
1691
+ type MessagingScreenProps = ComponentProps<"div"> & {
1692
+ background?: BackgroundValue;
1693
+ textColor?: ColorOptions;
1694
+ accentColor?: ColorOptions;
1695
+ padding?: PaddingOptions;
1696
+ borderRadius?: BorderRadiusOptions;
1697
+ onToast?: (message: string, type: "success" | "error") => void;
1698
+ filestackApiKey?: string;
1699
+ websocketUrl?: string;
1700
+ };
1701
+ declare function MessagingScreen({
1702
+ onToast,
1703
+ filestackApiKey,
1704
+ websocketUrl: websocketUrlOverride,
1705
+ background,
1706
+ textColor,
1707
+ accentColor,
1708
+ padding,
1709
+ borderRadius,
1710
+ ...divProps
1711
+ }: MessagingScreenProps): react_jsx_runtime0.JSX.Element;
1712
+ declare const messagingScreenPropertySchema: WidgetPropertySchema;
1713
+ //#endregion
1714
+ //#region src/screens/ContactsScreen.d.ts
1715
+ type ContactsScreenProps = ComponentProps<"div"> & {
1716
+ background?: BackgroundValue;
1717
+ textColor?: ColorOptions;
1718
+ accentColor?: ColorOptions;
1719
+ padding?: PaddingOptions;
1720
+ borderRadius?: BorderRadiusOptions;
1721
+ defaultViewMode?: "list" | "grid";
1722
+ onContactSelect?: (contactId: string) => void;
1723
+ onCreateContact?: () => void;
1724
+ };
1725
+ declare function ContactsScreen(_props: ContactsScreenProps): react_jsx_runtime0.JSX.Element;
1726
+ declare const contactsScreenPropertySchema: WidgetPropertySchema;
1727
+ //#endregion
1728
+ //#region src/screens/OrdersScreen.d.ts
1729
+ type OrdersScreenProps = ComponentProps<"div"> & {
1730
+ background?: BackgroundValue;
1731
+ textColor?: ColorOptions;
1732
+ accentColor?: ColorOptions;
1733
+ padding?: PaddingOptions;
1734
+ borderRadius?: BorderRadiusOptions;
1735
+ };
1736
+ declare function OrdersScreen(_props: OrdersScreenProps): react_jsx_runtime0.JSX.Element;
1737
+ declare const ordersScreenPropertySchema: WidgetPropertySchema;
1738
+ //#endregion
1739
+ //#region src/screens/CustomersScreen.d.ts
1740
+ type CustomersScreenProps = ComponentProps<"div"> & {
1741
+ background?: BackgroundValue;
1742
+ textColor?: ColorOptions;
1743
+ accentColor?: ColorOptions;
1744
+ padding?: PaddingOptions;
1745
+ borderRadius?: BorderRadiusOptions;
1746
+ };
1747
+ declare function CustomersScreen(_props: CustomersScreenProps): react_jsx_runtime0.JSX.Element;
1748
+ declare const customersScreenPropertySchema: WidgetPropertySchema;
1749
+ //#endregion
1750
+ //#region src/screens/ProductsScreen.d.ts
1751
+ type ProductsScreenProps = ComponentProps<"div"> & {
1752
+ background?: BackgroundValue;
1753
+ textColor?: ColorOptions;
1754
+ accentColor?: ColorOptions;
1755
+ padding?: PaddingOptions;
1756
+ borderRadius?: BorderRadiusOptions;
1757
+ };
1758
+ declare function ProductsScreen(_props: ProductsScreenProps): react_jsx_runtime0.JSX.Element;
1759
+ declare const productsScreenPropertySchema: WidgetPropertySchema;
1760
+ //#endregion
1761
+ //#region src/screens/index.d.ts
1762
+ declare const screenPropertySchemas: {
1763
+ MessagingScreen: () => Promise<_fluid_app_rep_core_registries0.WidgetPropertySchema>;
1764
+ ContactsScreen: () => Promise<_fluid_app_rep_core_registries0.WidgetPropertySchema>;
1765
+ OrdersScreen: () => Promise<_fluid_app_rep_core_registries0.WidgetPropertySchema>;
1766
+ CustomersScreen: () => Promise<_fluid_app_rep_core_registries0.WidgetPropertySchema>;
1767
+ ProductsScreen: () => Promise<_fluid_app_rep_core_registries0.WidgetPropertySchema>;
1768
+ };
1769
+ /**
1770
+ * Core page template IDs
1771
+ */
1772
+ declare const CORE_PAGE_IDS: {
1773
+ readonly MESSAGING: "core-messaging";
1774
+ readonly CONTACTS: "core-contacts";
1775
+ readonly ORDERS: "core-orders";
1776
+ readonly CUSTOMERS: "core-customers";
1777
+ readonly PRODUCTS: "core-products";
1778
+ };
1779
+ //#endregion
1780
+ //#region src/core/default-widget-registry.d.ts
1781
+ declare const DEFAULT_SDK_WIDGET_REGISTRY: {
1782
+ AlertWidget: typeof AlertWidget$1;
1783
+ CalendarWidget: typeof CalendarWidget$1;
1784
+ CarouselWidget: typeof CarouselWidget$1;
1785
+ CatchUpWidget: typeof CatchUpWidget$1;
1786
+ ChartWidget: typeof ChartWidget$1;
1787
+ ContainerWidget: typeof ContainerWidget$1;
1788
+ EmbedWidget: typeof EmbedWidget$1;
1789
+ ImageWidget: typeof ImageWidget$1;
1790
+ LayoutWidget: <T extends Record<string, react.ComponentType<any>>>({
1791
+ sectionLayout,
1792
+ gap,
1793
+ gapSize,
1794
+ background,
1795
+ padding,
1796
+ borderRadius,
1797
+ children,
1798
+ registry,
1799
+ className,
1800
+ minHeight
1801
+ }: {
1802
+ sectionLayout?: _fluid_app_rep_core_types0.SectionLayoutType;
1803
+ type?: "flex" | "grid";
1804
+ columns?: number;
1805
+ rows?: number;
1806
+ direction?: string;
1807
+ justify?: string;
1808
+ align?: string;
1809
+ wrap?: boolean;
1810
+ gap?: number;
1811
+ gapSize?: _fluid_app_rep_core_types0.GapOptions;
1812
+ background?: _fluid_app_rep_core_types0.BackgroundValue;
1813
+ padding?: _fluid_app_rep_core_types0.PaddingOptions;
1814
+ borderRadius?: _fluid_app_rep_core_types0.BorderRadiusOptions;
1815
+ children: (_fluid_app_rep_core_types0.WidgetSchema | null)[] | (_fluid_app_rep_core_types0.TypedWidgetSchema<T> | null)[];
1816
+ registry?: T | undefined;
1817
+ className?: string;
1818
+ minHeight?: number;
1819
+ }) => react_jsx_runtime0.JSX.Element;
1820
+ ListWidget: typeof ListWidget$1;
1821
+ MySiteWidget: typeof MySiteWidget$1;
1822
+ NestedWidget: typeof NestedWidget$1;
1823
+ QuickShareWidget: typeof QuickShareWidget$1;
1824
+ RecentActivityWidget: typeof RecentActivityWidget$1;
1825
+ SpacerWidget: typeof SpacerWidget$1;
1826
+ TableWidget: typeof TableWidget$1;
1827
+ TextWidget: typeof TextWidget$1;
1828
+ ToDoWidget: typeof ToDoWidget$1;
1829
+ VideoWidget: typeof VideoWidget$1;
1830
+ };
1831
+ //#endregion
1832
+ //#region src/core/resolve-pages.d.ts
1833
+ /**
1834
+ * Resolve all page references and local screens into a unified screen list.
1835
+ *
1836
+ * This function merges:
1837
+ * 1. Screen definitions from page_refs (shared templates)
1838
+ * 2. Local screen definitions (for backwards compatibility and custom screens)
1839
+ *
1840
+ * When a screen_id appears in both page_refs and screens, the local screen
1841
+ * takes precedence (allows local overrides of template pages).
1842
+ *
1843
+ * @param navigation - The navigation configuration
1844
+ * @returns A unified array of ScreenDefinition objects
1845
+ *
1846
+ * @example
1847
+ * ```ts
1848
+ * const navigation: Navigation = {
1849
+ * definition_id: 1,
1850
+ * id: 1,
1851
+ * name: "Main Nav",
1852
+ * navigation_items: [...],
1853
+ * screens: [
1854
+ * // Local custom screen
1855
+ * { id: 1, slug: "home", name: "Home", component_tree: [...] }
1856
+ * ],
1857
+ * page_refs: [
1858
+ * // Reference to shared messaging template
1859
+ * { page_template_id: "core-messaging", screen_id: 2 }
1860
+ * ],
1861
+ * };
1862
+ *
1863
+ * const allScreens = resolveNavigationPages(navigation);
1864
+ * // Returns: [home screen, messaging screen from template]
1865
+ * ```
1866
+ */
1867
+ declare function resolveNavigationPages(navigation: Readonly<Navigation>): ScreenDefinition[];
1868
+ /**
1869
+ * Get all available page templates for use in navigation.
1870
+ *
1871
+ * @returns Array of page templates from the registry
1872
+ */
1873
+ declare function getAvailablePageTemplates(): PageTemplate[];
1874
+ /**
1875
+ * Get core page templates that are required for basic functionality.
1876
+ *
1877
+ * @returns Array of core page templates
1878
+ */
1879
+ declare function getCorePageTemplates(): PageTemplate[];
1880
+ /**
1881
+ * Get optional page templates that can be added to navigation.
1882
+ *
1883
+ * @returns Array of optional (non-core) page templates
1884
+ */
1885
+ declare function getOptionalPageTemplates(): PageTemplate[];
1886
+ /**
1887
+ * Check if a navigation has all required core pages.
1888
+ *
1889
+ * @param navigation - The navigation to check
1890
+ * @returns Object with validation result and missing page IDs
1891
+ */
1892
+ declare function validateNavigationPages(navigation: Readonly<Navigation>): {
1893
+ readonly valid: boolean;
1894
+ readonly missingCorePages: readonly string[];
1895
+ };
1896
+ //#endregion
1897
+ //#region src/registries/page-template-registry.d.ts
1898
+ /**
1899
+ * Registry for managing reusable page templates.
1900
+ *
1901
+ * The registry provides a central store for page templates that can be
1902
+ * shared across multiple navigations. Core pages (like Messaging, Contacts)
1903
+ * are pre-registered and cannot be removed.
1904
+ *
1905
+ * @example
1906
+ * ```ts
1907
+ * // Register a custom page template
1908
+ * PageTemplateRegistry.register({
1909
+ * id: 'custom-dashboard',
1910
+ * slug: 'dashboard',
1911
+ * name: 'Custom Dashboard',
1912
+ * category: 'custom',
1913
+ * version: '1.0.0',
1914
+ * component_tree: [{ type: 'TextWidget', props: { text: 'Hello' } }],
1915
+ * });
1916
+ *
1917
+ * // Get a template by ID
1918
+ * const template = PageTemplateRegistry.get('custom-dashboard');
1919
+ *
1920
+ * // List all templates in a category
1921
+ * const corePages = PageTemplateRegistry.getByCategory('core');
1922
+ * ```
1923
+ */
1924
+ declare class PageTemplateRegistryImpl {
1925
+ private templates;
1926
+ private categories;
1927
+ constructor();
1928
+ /**
1929
+ * Register a new page template.
1930
+ * @throws Error if a template with the same ID already exists
1931
+ */
1932
+ register(template: PageTemplate): void;
1933
+ /**
1934
+ * Unregister a page template by ID.
1935
+ * Core templates cannot be unregistered.
1936
+ * @returns true if the template was removed, false if it didn't exist or is a core template
1937
+ */
1938
+ unregister(id: string): boolean;
1939
+ /**
1940
+ * Get a page template by ID.
1941
+ */
1942
+ get(id: string): PageTemplate | undefined;
1943
+ /**
1944
+ * Get all page templates in a specific category.
1945
+ */
1946
+ getByCategory(category: PageCategoryId | string): PageTemplate[];
1947
+ /**
1948
+ * List all registered page templates.
1949
+ */
1950
+ listAll(): PageTemplate[];
1951
+ /**
1952
+ * List all core page templates (isCore: true).
1953
+ */
1954
+ listCore(): PageTemplate[];
1955
+ /**
1956
+ * List all non-core page templates.
1957
+ */
1958
+ listOptional(): PageTemplate[];
1959
+ /**
1960
+ * List all registered categories.
1961
+ */
1962
+ listCategories(): PageCategory[];
1963
+ /**
1964
+ * Add a custom category.
1965
+ */
1966
+ addCategory(category: PageCategory): void;
1967
+ /**
1968
+ * Check if a template exists by ID.
1969
+ */
1970
+ has(id: string): boolean;
1971
+ /**
1972
+ * Get the count of registered templates.
1973
+ */
1974
+ get size(): number;
1975
+ /**
1976
+ * Clear all non-core templates.
1977
+ * Useful for testing or resetting the registry.
1978
+ */
1979
+ clearNonCore(): void;
1980
+ }
1981
+ /**
1982
+ * Global page template registry singleton.
1983
+ *
1984
+ * This registry is automatically populated with core page templates
1985
+ * (Messaging, Contacts) when the SDK is imported.
1986
+ */
1987
+ declare const PageTemplateRegistry: PageTemplateRegistryImpl;
1988
+ //#endregion
1989
+ //#region src/shell/AppShell.d.ts
1990
+ interface AppShellProps {
1991
+ /** Pre-fetched app data (skips internal useFluidApp call if provided) */
1992
+ appData?: RepAppData$1;
1993
+ /** Override navigation items (otherwise derived from appData/API) */
1994
+ navigation?: NavigationItem[];
1995
+ /** Custom page components keyed by slug */
1996
+ customPages?: Record<string, ComponentType<{
1997
+ slug?: string;
1998
+ params?: string;
1999
+ }>>;
2000
+ /** Base path for subpath deployments (e.g. "/portal"). Default: "/" */
2001
+ basePath?: string;
2002
+ /** Controlled current slug */
2003
+ currentSlug?: string;
2004
+ /** Navigation callback */
2005
+ onNavigate?: (slug: string) => void;
2006
+ /** Custom sidebar header slot */
2007
+ sidebarHeader?: ReactNode;
2008
+ /** Custom sidebar footer slot */
2009
+ sidebarFooter?: ReactNode;
2010
+ /** Render prop or static children for the content area */
2011
+ children?: ReactNode | ((props: {
2012
+ currentSlug: string;
2013
+ currentNavItem: NavigationItem | undefined;
2014
+ }) => ReactNode);
2015
+ }
2016
+ declare function AppShell({
2017
+ appData: appDataProp,
2018
+ navigation: navigationProp,
2019
+ customPages,
2020
+ basePath,
2021
+ currentSlug: controlledSlug,
2022
+ onNavigate: onNavigateProp,
2023
+ sidebarHeader,
2024
+ sidebarFooter,
2025
+ children
2026
+ }: AppShellProps): react_jsx_runtime0.JSX.Element;
2027
+ //#endregion
2028
+ //#region src/shell/BuilderScreenView.d.ts
2029
+ interface BuilderScreenViewProps {
2030
+ /** The screen definition to render */
2031
+ screen: ScreenDefinition$1;
2032
+ /** Additional CSS classes for the wrapper div */
2033
+ className?: string;
2034
+ }
2035
+ /**
2036
+ * Renders a builder screen's component_tree with full data source support.
2037
+ * Widgets with `dataSource` config are automatically wrapped with `DataAwareWidget`
2038
+ * which fetches data and merges it with static props before rendering.
2039
+ */
2040
+ declare function BuilderScreenViewImpl({
2041
+ screen,
2042
+ className
2043
+ }: BuilderScreenViewProps): react_jsx_runtime0.JSX.Element;
2044
+ declare const BuilderScreenView: react.MemoExoticComponent<typeof BuilderScreenViewImpl>;
2045
+ //#endregion
2046
+ //#region src/shell/SdkNavigation.d.ts
2047
+ interface SdkNavigationProps {
2048
+ navItems: NavigationItem[];
2049
+ currentSlug: string;
2050
+ onNavigate: (slug: string) => void;
2051
+ navSlugs: string[];
2052
+ }
2053
+ declare function SdkNavigation({
2054
+ navItems,
2055
+ currentSlug,
2056
+ onNavigate,
2057
+ navSlugs
2058
+ }: SdkNavigationProps): react_jsx_runtime0.JSX.Element;
2059
+ //#endregion
2060
+ //#region src/shell/SdkHeader.d.ts
2061
+ interface SdkHeaderProps {
2062
+ tabs: NavigationItem[];
2063
+ mobileTabs?: NavigationItem[];
2064
+ currentSlug: string;
2065
+ onNavigate: (slug: string) => void;
2066
+ navSlugs: string[];
2067
+ }
2068
+ declare function SdkHeader({
2069
+ tabs,
2070
+ mobileTabs,
2071
+ currentSlug,
2072
+ onNavigate,
2073
+ navSlugs
2074
+ }: SdkHeaderProps): react_jsx_runtime0.JSX.Element;
2075
+ //#endregion
2076
+ //#region src/shell/PageRouter.d.ts
2077
+ interface PageRouterProps {
2078
+ currentSlug: string;
2079
+ currentNavItem?: NavigationItem | undefined;
2080
+ customPages?: Record<string, ComponentType<{
2081
+ slug?: string;
2082
+ params?: string;
2083
+ }>> | undefined;
2084
+ /** Builder screen definitions (from fluidos API) */
2085
+ screens?: ScreenDefinition[] | undefined;
2086
+ baseSlug: string;
2087
+ restParams: string;
2088
+ }
2089
+ declare function PageRouter({
2090
+ currentSlug,
2091
+ currentNavItem,
2092
+ customPages,
2093
+ screens,
2094
+ baseSlug,
2095
+ restParams
2096
+ }: PageRouterProps): react_jsx_runtime0.JSX.Element;
2097
+ //#endregion
2098
+ //#region src/shell/QuickLinksDropdown.d.ts
2099
+ interface QuickLinksDropdownProps {
2100
+ onNavigate: (slug: string) => void;
2101
+ }
2102
+ declare function QuickLinksDropdown({
2103
+ onNavigate
2104
+ }: QuickLinksDropdownProps): react_jsx_runtime0.JSX.Element;
2105
+ //#endregion
2106
+ //#region src/shell/AppNavigationContext.d.ts
2107
+ interface AppNavigationContextValue {
2108
+ /** Current active slug (e.g. "contacts/123") */
2109
+ currentSlug: string;
2110
+ /** Base path for subpath deployments (e.g. "/portal"). Default: "/" */
2111
+ basePath: string;
2112
+ /** Navigate to a slug programmatically */
2113
+ navigate: (slug: string) => void;
2114
+ /** Build a full href for a slug (for use in <a> tags) */
2115
+ buildHref: (slug: string) => string;
2116
+ }
2117
+ interface AppNavigationProviderProps {
2118
+ currentSlug: string;
2119
+ basePath: string;
2120
+ navigate: (slug: string) => void;
2121
+ children: ReactNode;
2122
+ }
2123
+ declare function AppNavigationProvider({
2124
+ currentSlug,
2125
+ basePath,
2126
+ navigate,
2127
+ children
2128
+ }: AppNavigationProviderProps): react_jsx_runtime0.JSX.Element;
2129
+ declare function useAppNavigation(): AppNavigationContextValue;
2130
+ //#endregion
2131
+ //#region src/shell/AppLink.d.ts
2132
+ interface AppLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> {
2133
+ /** Slug to navigate to (e.g. "contacts/123") */
2134
+ to: string;
2135
+ }
2136
+ /**
2137
+ * SPA-aware link that renders a real `<a href>` for accessibility
2138
+ * (right-click, ctrl+click, screen readers) but intercepts normal
2139
+ * clicks for client-side navigation.
2140
+ */
2141
+ declare const AppLink: react.ForwardRefExoticComponent<AppLinkProps & react.RefAttributes<HTMLAnchorElement>>;
2142
+ //#endregion
2143
+ //#region src/shell/slug-utils.d.ts
2144
+ interface SlugMatch {
2145
+ matchedSlug: string;
2146
+ rest: string;
2147
+ }
2148
+ /**
2149
+ * Extract all slugs from a navigation tree, sorted by segment count descending.
2150
+ * Longest slugs first enables greedy prefix matching (e.g. "share/playlists"
2151
+ * is checked before "share").
2152
+ */
2153
+ declare function collectNavSlugs(items: NavigationItem[]): string[];
2154
+ /**
2155
+ * Find the longest registered nav slug that is a prefix of `fullSlug`.
2156
+ * Uses segment-boundary checking to prevent "shop" from matching "shopping".
2157
+ */
2158
+ declare function matchSlugPrefix(fullSlug: string, navSlugs: string[]): SlugMatch | undefined;
2159
+ /**
2160
+ * Extract the slug portion from a full pathname by stripping the basePath prefix.
2161
+ * Returns an empty string when the pathname equals the basePath exactly.
2162
+ *
2163
+ * Examples:
2164
+ * extractSlugFromPathname("/contacts/123", "/") → "contacts/123"
2165
+ * extractSlugFromPathname("/portal/contacts", "/portal") → "contacts"
2166
+ * extractSlugFromPathname("/portal", "/portal") → ""
2167
+ * extractSlugFromPathname("/", "/") → ""
2168
+ */
2169
+ declare function extractSlugFromPathname(pathname: string, basePath: string): string;
2170
+ declare function isSlugInSection(item: NavigationItem, currentSlug: string, navSlugs: string[]): boolean;
2171
+ type DEFAULT_COLORS = import__fluid_app_rep_core_theme.DEFAULT_COLORS;
2172
+ type DEFAULT_FONT_FAMILIES = import__fluid_app_rep_core_theme.DEFAULT_FONT_FAMILIES;
2173
+ type DEFAULT_FONT_SIZES = import__fluid_app_rep_core_theme.DEFAULT_FONT_SIZES;
2174
+ type DEFAULT_RADII = import__fluid_app_rep_core_theme.DEFAULT_RADII;
2175
+ type DEFAULT_SPACING = import__fluid_app_rep_core_theme.DEFAULT_SPACING;
2176
+ type DEFAULT_THEME_ID = import__fluid_app_rep_core_theme.DEFAULT_THEME_ID;
2177
+ type DEFAULT_THEME_NAME = import__fluid_app_rep_core_theme.DEFAULT_THEME_NAME;
2178
+ type FONT_FAMILY_KEYS = import__fluid_app_rep_core_theme.FONT_FAMILY_KEYS;
2179
+ type FONT_SIZE_KEYS = import__fluid_app_rep_core_theme.FONT_SIZE_KEYS;
2180
+ type FontFamilyKey = import__fluid_app_rep_core_theme.FontFamilyKey;
2181
+ type FontSizeKey = import__fluid_app_rep_core_theme.FontSizeKey;
2182
+ type GenerateThemeCSSOptions = import__fluid_app_rep_core_theme.GenerateThemeCSSOptions;
2183
+ type OklchPlain = import__fluid_app_rep_core_theme.OklchPlain;
2184
+ type RADIUS_KEYS = import__fluid_app_rep_core_theme.RADIUS_KEYS;
2185
+ type RadiusKey = import__fluid_app_rep_core_theme.RadiusKey;
2186
+ type ResolvedColorSet = import__fluid_app_rep_core_theme.ResolvedColorSet;
2187
+ type ResolvedSemanticColor = import__fluid_app_rep_core_theme.ResolvedSemanticColor;
2188
+ type SEMANTIC_COLOR_NAMES = import__fluid_app_rep_core_theme.SEMANTIC_COLOR_NAMES;
2189
+ type SHADE_STEPS = import__fluid_app_rep_core_theme.SHADE_STEPS;
2190
+ type SemanticColorName = import__fluid_app_rep_core_theme.SemanticColorName;
2191
+ type ShadeStep = import__fluid_app_rep_core_theme.ShadeStep;
2192
+ type ThemeColorPlain = import__fluid_app_rep_core_theme.ThemeColorPlain;
2193
+ type applyTheme = import__fluid_app_rep_core_theme.applyTheme;
2194
+ type deriveDarkVariant = import__fluid_app_rep_core_theme.deriveDarkVariant;
2195
+ type deserialiseTheme = import__fluid_app_rep_core_theme.deserialiseTheme;
2196
+ type generateShades = import__fluid_app_rep_core_theme.generateShades;
2197
+ type generateThemeCSS = import__fluid_app_rep_core_theme.generateThemeCSS;
2198
+ type getDefaultThemeDefinition = import__fluid_app_rep_core_theme.getDefaultThemeDefinition;
2199
+ type getForegroundColor = import__fluid_app_rep_core_theme.getForegroundColor;
2200
+ type mergeDarkOverrides = import__fluid_app_rep_core_theme.mergeDarkOverrides;
2201
+ type parseColor = import__fluid_app_rep_core_theme.parseColor;
2202
+ type removeAllThemes = import__fluid_app_rep_core_theme.removeAllThemes;
2203
+ type removeTheme = import__fluid_app_rep_core_theme.removeTheme;
2204
+ type resolveTheme = import__fluid_app_rep_core_theme.resolveTheme;
2205
+ type serialiseTheme = import__fluid_app_rep_core_theme.serialiseTheme;
2206
+ export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, AUTH_CONSTANTS, type Activity as ActivityItem, type ActivitySlug, AlertWidget, type AlignOptions, ApiError, AppLink, type AppLinkProps, type AppNavigationContextValue, AppNavigationProvider, type AppNavigationProviderProps, AppShell, type AppShellProps, AuthError, type AuthErrorProps, AuthLoading, type BackgroundType, type BackgroundValue, type BaseListParams, type BorderRadiusOptions, BuilderScreenView, type BuilderScreenViewProps, type ButtonSizeOptions, CORE_PAGE_IDS, CURRENT_REP_QUERY_KEY, type CalendarEvent, CalendarWidget, CarouselWidget, type CatchUp as CatchUpItem, CatchUpWidget, ChartWidget, type ColorOptions, type Contact, type ContactAddress, type ContactStatus, type ContactType, ContactsScreen, ContainerWidget, type Conversation, type ConversationStatus, type CreateOrderData, 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, type DashboardData, EmbedWidget, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, type FileUploader, type FluidAuthConfig, type FluidAuthContextValue, FluidAuthProvider, type FluidAuthProviderProps, type FluidClient, FluidProvider, type FluidProviderProps, type FluidSDKConfig, FluidThemeProvider, type FluidThemeProviderProps, type FontFamilyKey, type FontSizeKey, type FontSizeOptions, type GapOptions, type GenerateThemeCSSOptions, ImageWidget, type JWTPayload, LayoutWidget, type ListQueryResult, ListWidget, type Message, type MessageType, type MessagingAuthContext, type MessagingConfig, type MessagingCurrentUser, MessagingScreen, type MySiteData, MySiteWidget, type Navigation, type NavigationItem, NestedWidget, type OklchPlain, type Order, type OrderLineItem, type OrderListParams, OrdersScreen, PAGE_CATEGORIES, PERMISSIONS_QUERY_KEY, PROFILE_QUERY_KEY, PROPERTY_FIELD_TYPES, type PaddingOptions, type PageCategory, type PageCategoryId, type PageOverride, type PageReference, PageRouter, type PageRouterProps, type PageTemplate, PageTemplateProvider, PageTemplateRegistry, type PaginationParams, type Participant, type PermissionAction, type Permissions, type Product, type ProductListParams, ProductsScreen, type Profile, type PropertyFieldSchema, type PropertyFieldType, type QueryResult, type QueryResultNullable, QuickLinksDropdown, type QuickLinksDropdownProps, QuickShareWidget, RADIUS_KEYS, type RadiusKey, type RawApiNavigationItem, type RawApiScreen, type RawApiTheme, type RawManifestResponse, RecentActivityWidget, type Rep, type RepAppData, type RepAppManifest, type RepAppProfile, type RequestOptions, RequireAuth, type RequireAuthProps, type ResolvedColorSet, type ResolvedSemanticColor, type ResolvedTheme, type ResourcePermissions, SEMANTIC_COLOR_NAMES, SHADE_STEPS, STORAGE_KEYS, type SalesData, type SalesDataPoint, type SalesParams, type ScreenDefinition, SdkHeader, type SdkHeaderProps, SdkNavigation, type SdkNavigationProps, type SectionLayoutType, type SemanticColorName, type ShadeStep, type ShareableItem, type SlugMatch, SpacerWidget, type TabConfig, TableWidget, TextWidget, type ThemeColorInput, type ThemeColorPlain, type ThemeDefinition, type ThemeMode, ThemeModeProvider, type ThemePayload, ToDoWidget, type Todo as TodoItem, type TokenValidationResult, type TypedWidgetSchema, URL_PARAMS, USER_TYPES, type UpdateRepData, type UploadCallbacks, type UploadResult, type UseContactResult, type UseContactsParams, type UseContactsResult, type UseConversationMessagesResult, type UseConversationsResult, type UseFluidPermissionsResult, type UseFluidThemeResult, type UseListResourceHook, type UseSingleResourceHook, type UserMe, type UserPermissions, type UserType, type ValueListQueryResult, VideoWidget, WIDGET_TYPE_NAMES, type WidgetPath, type WidgetPropertySchema, type WidgetRegistry, type WidgetSchema, type WidgetType, type WidgetTypeName, type WithData, 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, useFluidApi, useFluidApp, useFluidAuth, useFluidAuthContext, useFluidContext, useFluidPermissions, useFluidProfile, useFluidTheme, useMessagingAuth, useMessagingConfig, useMySite, usePageTemplates, useResolvedPages, useThemeContext, useThemeMode, useTodos, validateNavigationPages, validateToken, videoWidgetPropertySchema, widgetPropertySchemas };
2207
+ //# sourceMappingURL=index.d.mts.map