@fluid-app/portal-sdk 0.1.159 → 0.1.161

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 (78) hide show
  1. package/README.md +2 -196
  2. package/dist/{FluidProvider-Cqf2kmUc.mjs → FluidProvider-B00jTGTH.mjs} +1510 -1624
  3. package/dist/FluidProvider-B00jTGTH.mjs.map +1 -0
  4. package/dist/{FluidProvider-Bc-3uN7M.cjs → FluidProvider-BtGi2jJt.cjs} +1458 -1614
  5. package/dist/FluidProvider-BtGi2jJt.cjs.map +1 -0
  6. package/dist/{MessagingScreen-BGqIn-c2.cjs → MessagingScreen-BRCUJDDZ.cjs} +2 -2
  7. package/dist/{MessagingScreen-CbmuvlH6.mjs → MessagingScreen-BWpSXB8Q.mjs} +2 -2
  8. package/dist/{MessagingScreen-CbmuvlH6.mjs.map → MessagingScreen-BWpSXB8Q.mjs.map} +1 -1
  9. package/dist/{MessagingScreen-CBPjP4du.cjs → MessagingScreen-C_OLIWCC.cjs} +2 -2
  10. package/dist/{MessagingScreen-CBPjP4du.cjs.map → MessagingScreen-C_OLIWCC.cjs.map} +1 -1
  11. package/dist/{MySiteScreen-DSDLDnCN.cjs → MySiteScreen-B90qzZPe.cjs} +2 -2
  12. package/dist/{MySiteScreen-Cl6nuU99.cjs → MySiteScreen-DLuHDXB1.cjs} +2 -2
  13. package/dist/{MySiteScreen-Cl6nuU99.cjs.map → MySiteScreen-DLuHDXB1.cjs.map} +1 -1
  14. package/dist/{MySiteScreen-BT1PBPsH.mjs → MySiteScreen-VaOB-vWk.mjs} +2 -2
  15. package/dist/{MySiteScreen-BT1PBPsH.mjs.map → MySiteScreen-VaOB-vWk.mjs.map} +1 -1
  16. package/dist/ProductsScreen-B8OynxlP.cjs +13 -0
  17. package/dist/{ProductsScreen-4WRrJcvw.mjs → ProductsScreen-CbVSNv1l.mjs} +3 -5
  18. package/dist/ProductsScreen-CbVSNv1l.mjs.map +1 -0
  19. package/dist/{ProductsScreen-BCs3YKVk.cjs → ProductsScreen-D1bw4ZIH.cjs} +3 -5
  20. package/dist/ProductsScreen-D1bw4ZIH.cjs.map +1 -0
  21. package/dist/ProductsScreen-Pq3j09nI.mjs +11 -0
  22. package/dist/{ProfileScreen-BgyrIQdL.mjs → ProfileScreen-BCHljkWD.mjs} +2 -2
  23. package/dist/{ProfileScreen-BgyrIQdL.mjs.map → ProfileScreen-BCHljkWD.mjs.map} +1 -1
  24. package/dist/{ProfileScreen-B0KNWXpV.cjs → ProfileScreen-Bf-lYNzz.cjs} +2 -2
  25. package/dist/{ProfileScreen-DLLLRNB2.cjs → ProfileScreen-ksdtbydb.cjs} +2 -2
  26. package/dist/{ProfileScreen-DLLLRNB2.cjs.map → ProfileScreen-ksdtbydb.cjs.map} +1 -1
  27. package/dist/{ShareablesScreen-ySSwCVSI.cjs → ShareablesScreen-6wgiwi_9.cjs} +3 -5
  28. package/dist/ShareablesScreen-6wgiwi_9.cjs.map +1 -0
  29. package/dist/{ShareablesScreen-B8cmh8JC.mjs → ShareablesScreen-BLCukNTk.mjs} +3 -5
  30. package/dist/{ShareablesScreen-B8cmh8JC.mjs.map → ShareablesScreen-BLCukNTk.mjs.map} +1 -1
  31. package/dist/ShareablesScreen-CM9OH-Nx.mjs +11 -0
  32. package/dist/ShareablesScreen-rmLcUhbL.cjs +13 -0
  33. package/dist/{ShopScreen-DhMo8bvP.cjs → ShopScreen-8KKwwjka.cjs} +3 -3
  34. package/dist/{ShopScreen-DhMo8bvP.cjs.map → ShopScreen-8KKwwjka.cjs.map} +1 -1
  35. package/dist/{ShopScreen-BkvyW0pE.cjs → ShopScreen-CjEbB3Q7.cjs} +2 -2
  36. package/dist/{ShopScreen-BFFGYwdV.mjs → ShopScreen-Dn5LwwYD.mjs} +3 -3
  37. package/dist/{ShopScreen-BFFGYwdV.mjs.map → ShopScreen-Dn5LwwYD.mjs.map} +1 -1
  38. package/dist/{SubscriptionsScreen-RScBCcY0.cjs → SubscriptionsScreen-B16wPAoA.cjs} +2 -2
  39. package/dist/SubscriptionsScreen-B16wPAoA.cjs.map +1 -0
  40. package/dist/{SubscriptionsScreen-CiNR7JUC.mjs → SubscriptionsScreen-B4cTlgDU.mjs} +2 -2
  41. package/dist/SubscriptionsScreen-B4cTlgDU.mjs.map +1 -0
  42. package/dist/{SubscriptionsScreen-DMh-GE6n.cjs → SubscriptionsScreen-nRUMdnx7.cjs} +1 -1
  43. package/dist/{dist-Bg8UyHyM.cjs → dist-lO2OG0T5.cjs} +1 -1
  44. package/dist/{dist-Bg8UyHyM.cjs.map → dist-lO2OG0T5.cjs.map} +1 -1
  45. package/dist/index.cjs +134 -143
  46. package/dist/index.cjs.map +1 -1
  47. package/dist/index.d.cts +444 -655
  48. package/dist/index.d.cts.map +1 -1
  49. package/dist/index.d.mts +444 -655
  50. package/dist/index.d.mts.map +1 -1
  51. package/dist/index.mjs +127 -130
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/{sortable.esm-Cz-CP2N8.mjs → sortable.esm-DSrWP4x9.mjs} +1 -1
  54. package/dist/{sortable.esm-Cz-CP2N8.mjs.map → sortable.esm-DSrWP4x9.mjs.map} +1 -1
  55. package/dist/{use-portal-products-client-BmlUixy4.cjs → use-portal-products-client-BHSBT64s.cjs} +2 -2
  56. package/dist/use-portal-products-client-BHSBT64s.cjs.map +1 -0
  57. package/dist/{use-portal-products-client-DQK9nFxT.mjs → use-portal-products-client-tbqk6XUq.mjs} +2 -2
  58. package/dist/use-portal-products-client-tbqk6XUq.mjs.map +1 -0
  59. package/dist/{use-portal-shareables-api-KVPj0Jfr.mjs → use-portal-shareables-api-B9B4XTjw.mjs} +107 -201
  60. package/dist/use-portal-shareables-api-B9B4XTjw.mjs.map +1 -0
  61. package/dist/{use-portal-shareables-api-D5D6uIJy.cjs → use-portal-shareables-api-MBl0d0eQ.cjs} +106 -206
  62. package/dist/use-portal-shareables-api-MBl0d0eQ.cjs.map +1 -0
  63. package/package.json +13 -13
  64. package/dist/FluidProvider-Bc-3uN7M.cjs.map +0 -1
  65. package/dist/FluidProvider-Cqf2kmUc.mjs.map +0 -1
  66. package/dist/ProductsScreen-4WRrJcvw.mjs.map +0 -1
  67. package/dist/ProductsScreen-BCs3YKVk.cjs.map +0 -1
  68. package/dist/ProductsScreen-BR9TN4So.cjs +0 -48
  69. package/dist/ProductsScreen-Da6eWJ_c.mjs +0 -46
  70. package/dist/ShareablesScreen-DW0wCYOj.mjs +0 -46
  71. package/dist/ShareablesScreen-DbPJOtCF.cjs +0 -48
  72. package/dist/ShareablesScreen-ySSwCVSI.cjs.map +0 -1
  73. package/dist/SubscriptionsScreen-CiNR7JUC.mjs.map +0 -1
  74. package/dist/SubscriptionsScreen-RScBCcY0.cjs.map +0 -1
  75. package/dist/use-portal-products-client-BmlUixy4.cjs.map +0 -1
  76. package/dist/use-portal-products-client-DQK9nFxT.mjs.map +0 -1
  77. package/dist/use-portal-shareables-api-D5D6uIJy.cjs.map +0 -1
  78. package/dist/use-portal-shareables-api-KVPj0Jfr.mjs.map +0 -1
package/dist/index.d.mts CHANGED
@@ -4,87 +4,206 @@ import Color from "colorjs.io";
4
4
  import { LucideIcon } from "lucide-react";
5
5
  import { z } from "zod";
6
6
 
7
- //#region src/types/rep.d.ts
7
+ //#region ../../platform/api-client-core/src/fetch-client.d.ts
8
+ interface RequestOptions$1 {
9
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
10
+ headers?: Record<string, string>;
11
+ params?: Record<string, unknown>;
12
+ body?: unknown;
13
+ signal?: AbortSignal;
14
+ }
15
+ interface FetchClientInstance {
16
+ request: <TResponse = unknown>(endpoint: string, options?: RequestOptions$1) => Promise<TResponse>;
17
+ requestWithFormData: <TResponse = unknown>(endpoint: string, formData: FormData, options?: Omit<RequestOptions$1, "body" | "params"> & {
18
+ method?: "POST" | "PUT" | "PATCH";
19
+ }) => Promise<TResponse>;
20
+ get: <TResponse = unknown>(endpoint: string, params?: Record<string, unknown>, options?: Omit<RequestOptions$1, "method" | "params">) => Promise<TResponse>;
21
+ post: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions$1, "method" | "body">) => Promise<TResponse>;
22
+ put: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions$1, "method" | "body">) => Promise<TResponse>;
23
+ patch: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions$1, "method" | "body">) => Promise<TResponse>;
24
+ delete: <TResponse = unknown>(endpoint: string, options?: Omit<RequestOptions$1, "method">) => Promise<TResponse>;
25
+ }
26
+ type FetchClient = FetchClientInstance;
27
+ //#endregion
28
+ //#region src/client/types.d.ts
8
29
  /**
9
- * Rep (sales representative) user profile
30
+ * HTTP methods supported by the API client.
31
+ * Use `as const` for literal type inference and type safety.
10
32
  */
11
- interface Rep {
12
- readonly id: string;
13
- email: string;
14
- first_name: string;
15
- last_name: string;
16
- avatar_url?: string;
17
- phone?: string;
18
- readonly company_id: string;
19
- readonly created_at: string;
20
- readonly updated_at: string;
33
+ declare const HTTP_METHODS: {
34
+ readonly GET: "GET";
35
+ readonly POST: "POST";
36
+ readonly PUT: "PUT";
37
+ readonly PATCH: "PATCH";
38
+ readonly DELETE: "DELETE";
39
+ };
40
+ /**
41
+ * Union type of all supported HTTP methods.
42
+ * Derived from HTTP_METHODS constant to avoid duplication.
43
+ */
44
+ type HttpMethod = (typeof HTTP_METHODS)[keyof typeof HTTP_METHODS];
45
+ /**
46
+ * Configuration for the Fluid SDK client.
47
+ * Use Readonly<FluidSDKConfig> when the config should not be modified after creation.
48
+ */
49
+ interface FluidSDKConfig {
50
+ /**
51
+ * Base URL for the Fluid API domain (e.g., "https://api.fluid.app").
52
+ * Endpoints include their full path from root (e.g., "/api/reps/me").
53
+ */
54
+ readonly baseUrl: string;
55
+ /**
56
+ * Optional token getter for contexts where session cookies are unavailable
57
+ * (e.g., the cross-origin builder preview iframe). Not used in normal
58
+ * portal operation — auth is handled by session cookies via `credentials: 'include'`.
59
+ */
60
+ readonly getAuthToken?: () => string | null | Promise<string | null>;
61
+ /**
62
+ * Callback invoked when a 401 authentication error occurs
63
+ * Use this to trigger re-authentication flows
64
+ */
65
+ readonly onAuthError?: () => void;
66
+ /**
67
+ * Default headers to include in all requests
68
+ * Example: { "x-fluid-client": "portal" }
69
+ */
70
+ readonly defaultHeaders?: Readonly<Record<string, string>>;
71
+ /**
72
+ * Filestack API key for messaging file uploads.
73
+ * If not provided, file attachments will be disabled in the messaging composer.
74
+ */
75
+ readonly filestackApiKey?: string;
76
+ /**
77
+ * Override WebSocket URL for real-time messaging.
78
+ * Default: derived from baseUrl by replacing trailing /api with /cable
79
+ */
80
+ readonly websocketUrl?: string;
81
+ /**
82
+ * ISO country code for the store/merchant (e.g., "US", "CA", "GB").
83
+ * Used to fetch country-specific payment methods.
84
+ * @default "US"
85
+ */
86
+ readonly countryIso?: string;
87
+ }
88
+ /**
89
+ * Options for individual API requests.
90
+ * Uses HttpMethod type for method to ensure type safety.
91
+ */
92
+ interface RequestOptions {
93
+ readonly method?: HttpMethod;
94
+ readonly body?: unknown;
95
+ readonly params?: Readonly<Record<string, unknown>>;
96
+ readonly headers?: Readonly<Record<string, string>>;
97
+ readonly signal?: AbortSignal;
98
+ }
99
+ /**
100
+ * Cursor-based pagination parameters for list endpoints.
101
+ * Sent as query params `page[cursor]` and `page[limit]`.
102
+ */
103
+ interface PaginationParams {
104
+ readonly page?: {
105
+ readonly cursor?: string;
106
+ readonly limit?: number;
107
+ };
21
108
  }
22
109
  /**
23
- * Data for updating a rep's profile
110
+ * Sort order constant - single source of truth for sort direction values.
111
+ * Use SORT_ORDERS.asc instead of "asc" for type-safe comparisons.
112
+ */
113
+ declare const SORT_ORDERS: {
114
+ readonly asc: "asc";
115
+ readonly desc: "desc";
116
+ };
117
+ /**
118
+ * Union type of sort order values, derived from SORT_ORDERS constant.
119
+ * @see deriving-typeof-for-object-keys pattern
120
+ */
121
+ type SortOrder = (typeof SORT_ORDERS)[keyof typeof SORT_ORDERS];
122
+ /**
123
+ * Common filter parameters for list endpoints
24
124
  */
25
- interface UpdateRepData {
26
- first_name?: string;
27
- last_name?: string;
28
- avatar_url?: string;
29
- phone?: string;
125
+ interface BaseListParams extends PaginationParams {
126
+ readonly sort_by?: string;
127
+ readonly sort_order?: SortOrder;
128
+ readonly search?: string;
30
129
  }
31
130
  //#endregion
32
- //#region src/types/permissions.d.ts
131
+ //#region src/client/fluid-client.d.ts
33
132
  /**
34
- * Standard permission action constants.
35
- * Use these constants instead of string literals for type safety.
36
- *
37
- * @example
38
- * ```ts
39
- * if (permissions[PERMISSION_ACTIONS.view]) { ... }
40
- * ```
133
+ * API Error class for structured error handling
134
+ */
135
+ declare class ApiError extends Error {
136
+ readonly status: number;
137
+ readonly data: unknown;
138
+ constructor(message: string, status: number, data?: unknown);
139
+ toJSON(): {
140
+ name: string;
141
+ message: string;
142
+ status: number;
143
+ data: unknown;
144
+ };
145
+ }
146
+ /**
147
+ * Type guard for ApiError
148
+ */
149
+ declare function isApiError(error: unknown): error is ApiError;
150
+ /**
151
+ * Discriminated union representing the result of an API call.
152
+ * Use `isApiSuccess` and `isApiFailure` type guards to narrow.
41
153
  */
42
- declare const PERMISSION_ACTIONS: {
43
- readonly view: "view";
44
- readonly create: "create";
45
- readonly update: "update";
46
- readonly delete: "delete";
47
- readonly settings: "settings";
48
- readonly add: "add";
49
- readonly manage: "manage";
50
- readonly send: "send";
154
+ type ApiResult<T> = {
155
+ readonly success: true;
156
+ readonly data: T;
157
+ } | {
158
+ readonly success: false;
159
+ readonly error: ApiError;
51
160
  };
52
161
  /**
53
- * Union type of standard permission actions.
54
- * Derived from PERMISSION_ACTIONS constant to avoid duplication.
162
+ * Metadata included in every API envelope response.
55
163
  */
56
- type PermissionAction = (typeof PERMISSION_ACTIONS)[keyof typeof PERMISSION_ACTIONS];
164
+ interface EnvelopeMeta {
165
+ readonly request_id: string | null;
166
+ readonly timestamp: string;
167
+ readonly pagination?: CursorPagination;
168
+ }
57
169
  /**
58
- * Permission flags for a single resource.
59
- * Known actions have explicit properties; index signature allows custom actions.
170
+ * Cursor-based pagination metadata returned in the envelope `meta`.
60
171
  */
61
- interface ResourcePermissions {
62
- readonly view?: boolean;
63
- readonly create?: boolean;
64
- readonly update?: boolean;
65
- readonly delete?: boolean;
66
- readonly settings?: boolean;
67
- readonly add?: boolean;
68
- readonly manage?: boolean;
69
- readonly send?: boolean;
70
- /** Allow custom action keys beyond the standard set */
71
- readonly [key: string]: boolean | undefined;
172
+ interface CursorPagination {
173
+ readonly cursor: string | null;
174
+ readonly limit: number;
175
+ readonly next_cursor: string | null;
176
+ readonly prev_cursor: string | null;
72
177
  }
73
178
  /**
74
- * Map of resource names to their permissions
179
+ * Result type for paginated list endpoints.
180
+ * Includes both the unwrapped data and cursor-based pagination metadata.
75
181
  */
76
- type Permissions = Record<string, ResourcePermissions>;
182
+ interface PaginatedResult<T> {
183
+ readonly data: T;
184
+ readonly pagination: CursorPagination | undefined;
185
+ }
77
186
  /**
78
- * User's complete permission profile
187
+ * The shape returned by `createFluidClient`.
188
+ * Generic helper methods preserve their type parameters so callers
189
+ * can specify response types at each call site.
79
190
  */
80
- interface UserPermissions {
81
- /** Resource permission mappings */
82
- permissions: Permissions;
83
- /** User's assigned roles */
84
- roles: readonly string[];
85
- /** Super admin bypass flag */
86
- is_super_admin: boolean;
191
+ interface FluidClientReturn {
192
+ readonly fetchClient: FetchClient;
193
+ readonly request: <TResponse = unknown>(endpoint: string, options?: RequestOptions) => Promise<TResponse>;
194
+ readonly requestNullable: <TResponse>(endpoint: string, options?: RequestOptions) => Promise<TResponse | null>;
195
+ readonly safeRequest: <TResponse>(endpoint: string, options?: RequestOptions) => Promise<ApiResult<TResponse>>;
196
+ readonly get: <TResponse = unknown, TParams extends object = Record<string, unknown>>(endpoint: string, params?: TParams, options?: Omit<RequestOptions, "method" | "params">) => Promise<TResponse>;
197
+ readonly post: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
198
+ readonly put: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
199
+ readonly patch: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
200
+ readonly delete: <TResponse = unknown>(endpoint: string, options?: Omit<RequestOptions, "method">) => Promise<TResponse>;
87
201
  }
202
+ /**
203
+ * Creates a configured Fluid API client instance
204
+ */
205
+ declare function createFluidClient(config: FluidSDKConfig): FluidClientReturn;
206
+ type FluidClient = ReturnType<typeof createFluidClient>;
88
207
  //#endregion
89
208
  //#region ../core/src/data-sources/types.d.ts
90
209
  type StaticSourceType = "collections" | "categories" | "tags";
@@ -653,516 +772,50 @@ declare const sectionLayoutConfig: typeof SECTION_LAYOUT_CONFIG;
653
772
  //#region ../core/src/types/index.d.ts
654
773
  type StrictOmit<T, K extends keyof T> = Omit<T, K>;
655
774
  //#endregion
656
- //#region ../../platform/api-client-core/src/fetch-client.d.ts
657
- interface RequestOptions$1 {
658
- method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
659
- headers?: Record<string, string>;
660
- params?: Record<string, unknown>;
661
- body?: unknown;
662
- signal?: AbortSignal;
775
+ //#region src/providers/FluidProvider.d.ts
776
+ /**
777
+ * Context value for FluidProvider.
778
+ * All properties are readonly since context values should not be mutated by consumers.
779
+ */
780
+ interface FluidContextValue {
781
+ /** Configured API client instance */
782
+ readonly client: FluidClient;
783
+ /** SDK configuration */
784
+ readonly config: FluidSDKConfig;
663
785
  }
664
- interface FetchClientInstance {
665
- request: <TResponse = unknown>(endpoint: string, options?: RequestOptions$1) => Promise<TResponse>;
666
- requestWithFormData: <TResponse = unknown>(endpoint: string, formData: FormData, options?: Omit<RequestOptions$1, "body" | "params"> & {
667
- method?: "POST" | "PUT" | "PATCH";
668
- }) => Promise<TResponse>;
669
- get: <TResponse = unknown>(endpoint: string, params?: Record<string, unknown>, options?: Omit<RequestOptions$1, "method" | "params">) => Promise<TResponse>;
670
- post: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions$1, "method" | "body">) => Promise<TResponse>;
671
- put: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions$1, "method" | "body">) => Promise<TResponse>;
672
- patch: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions$1, "method" | "body">) => Promise<TResponse>;
673
- delete: <TResponse = unknown>(endpoint: string, options?: Omit<RequestOptions$1, "method">) => Promise<TResponse>;
786
+ interface FluidProviderProps {
787
+ /** SDK configuration (baseUrl, auth, etc.) */
788
+ config: FluidSDKConfig;
789
+ /** React children */
790
+ children: ReactNode;
791
+ /** Optional custom QueryClient instance */
792
+ queryClient?: QueryClient;
793
+ /** Optional initial theme */
794
+ initialTheme?: ThemeDefinition;
795
+ /** Optional container for scoped theme application */
796
+ themeContainer?: HTMLElement | null;
797
+ /** Optional custom widget registry (defaults to all built-in widgets) */
798
+ widgetRegistry?: Record<string, React.ComponentType<any>>;
799
+ /** Dynamic variables for data source endpoint path substitution (e.g., { rep_id: "123" }) */
800
+ variables?: Record<string, string>;
674
801
  }
675
- type FetchClient = FetchClientInstance;
676
- //#endregion
677
- //#region src/client/types.d.ts
678
802
  /**
679
- * HTTP methods supported by the API client.
680
- * Use `as const` for literal type inference and type safety.
681
- */
682
- declare const HTTP_METHODS: {
683
- readonly GET: "GET";
684
- readonly POST: "POST";
685
- readonly PUT: "PUT";
686
- readonly PATCH: "PATCH";
687
- readonly DELETE: "DELETE";
688
- };
689
- /**
690
- * Union type of all supported HTTP methods.
691
- * Derived from HTTP_METHODS constant to avoid duplication.
692
- */
693
- type HttpMethod = (typeof HTTP_METHODS)[keyof typeof HTTP_METHODS];
694
- /**
695
- * Configuration for the Fluid SDK client.
696
- * Use Readonly<FluidSDKConfig> when the config should not be modified after creation.
697
- */
698
- interface FluidSDKConfig {
699
- /**
700
- * Base URL for the Fluid API domain (e.g., "https://api.fluid.app").
701
- * Endpoints include their full path from root (e.g., "/api/reps/me").
702
- */
703
- readonly baseUrl: string;
704
- /**
705
- * Optional token getter for contexts where session cookies are unavailable
706
- * (e.g., the cross-origin builder preview iframe). Not used in normal
707
- * portal operation — auth is handled by session cookies via `credentials: 'include'`.
708
- */
709
- readonly getAuthToken?: () => string | null | Promise<string | null>;
710
- /**
711
- * Callback invoked when a 401 authentication error occurs
712
- * Use this to trigger re-authentication flows
713
- */
714
- readonly onAuthError?: () => void;
715
- /**
716
- * Default headers to include in all requests
717
- * Example: { "x-fluid-client": "portal" }
718
- */
719
- readonly defaultHeaders?: Readonly<Record<string, string>>;
720
- /**
721
- * Filestack API key for messaging file uploads.
722
- * If not provided, file attachments will be disabled in the messaging composer.
723
- */
724
- readonly filestackApiKey?: string;
725
- /**
726
- * Override WebSocket URL for real-time messaging.
727
- * Default: derived from baseUrl by replacing trailing /api with /cable
728
- */
729
- readonly websocketUrl?: string;
730
- /**
731
- * ISO country code for the store/merchant (e.g., "US", "CA", "GB").
732
- * Used to fetch country-specific payment methods.
733
- * @default "US"
734
- */
735
- readonly countryIso?: string;
736
- }
737
- /**
738
- * Options for individual API requests.
739
- * Uses HttpMethod type for method to ensure type safety.
740
- */
741
- interface RequestOptions {
742
- readonly method?: HttpMethod;
743
- readonly body?: unknown;
744
- readonly params?: Readonly<Record<string, unknown>>;
745
- readonly headers?: Readonly<Record<string, string>>;
746
- readonly signal?: AbortSignal;
747
- }
748
- /**
749
- * Cursor-based pagination parameters for list endpoints.
750
- * Sent as query params `page[cursor]` and `page[limit]`.
751
- */
752
- interface PaginationParams {
753
- readonly page?: {
754
- readonly cursor?: string;
755
- readonly limit?: number;
756
- };
757
- }
758
- /**
759
- * Sort order constant - single source of truth for sort direction values.
760
- * Use SORT_ORDERS.asc instead of "asc" for type-safe comparisons.
761
- */
762
- declare const SORT_ORDERS: {
763
- readonly asc: "asc";
764
- readonly desc: "desc";
765
- };
766
- /**
767
- * Union type of sort order values, derived from SORT_ORDERS constant.
768
- * @see deriving-typeof-for-object-keys pattern
769
- */
770
- type SortOrder = (typeof SORT_ORDERS)[keyof typeof SORT_ORDERS];
771
- /**
772
- * Common filter parameters for list endpoints
773
- */
774
- interface BaseListParams extends PaginationParams {
775
- readonly sort_by?: string;
776
- readonly sort_order?: SortOrder;
777
- readonly search?: string;
778
- }
779
- //#endregion
780
- //#region ../core/src/theme/color-engine.d.ts
781
- /**
782
- * Attempt to convert any string into a Color using colorjs.io.
783
- * If the string is exactly 6 characters it is assumed to be a bare hex value
784
- * (e.g. "3b82f6") and a "#" prefix is added before parsing.
785
- *
786
- * @returns the parsed Color, or a neutral gray (`oklch(0.5 0 0)`) on failure
787
- */
788
- declare function parseColor(value: string): Color;
789
- /**
790
- * Returns either the original foreground or a corrected lightness variant,
791
- * whichever provides better contrast against `color`.
792
- * Inversion triggers when the APCA contrast is below 50.
793
- */
794
- declare function getForegroundColor(foreground: Color, color: Color): Color;
795
- /**
796
- * Generate a 100–900 shade ramp from a base color.
797
- * Base anchors at 500. Light shades (100–400) step toward white,
798
- * dark shades (600–900) step toward black. Dark steps use an asymmetric
799
- * multiplier (1.6×, 1.875×, 3×, 4× of `darkStep`) for a more gradual
800
- * initial descent. Chroma is nudged per step for perceptually natural ramps.
801
- */
802
- declare function generateShades(base: Color): Record<ShadeStep, Color>;
803
- /**
804
- * Derive a dark-mode ThemeColorInput from its light-mode counterpart.
805
- */
806
- declare function deriveDarkVariant(name: SemanticColorName, light: ThemeColorInput): ThemeColorInput;
807
- /**
808
- * Merge auto-derived dark colors with any user-specified overrides.
809
- * For each semantic color, if the user has fully overridden both base and
810
- * foreground those are used; otherwise the missing channels are derived.
811
- */
812
- declare function mergeDarkOverrides(def: ThemeDefinition): Record<SemanticColorName, ThemeColorInput>;
813
- /**
814
- * Resolve a ThemeDefinition into a complete ResolvedTheme.
815
- * Dark mode colors are derived from light where not overridden.
816
- */
817
- declare function resolveTheme(def: ThemeDefinition): ResolvedTheme;
818
- //#endregion
819
- //#region ../core/src/theme/css-generator.d.ts
820
- interface GenerateThemeCSSOptions {
821
- /** Whether or not to allow prefers-color-scheme to choose the theme mode */
822
- disableAutoTheme?: boolean;
823
- /** Whether to emit Tailwind built-in color overrides (default true) */
824
- mapTailwindColors?: boolean;
825
- }
826
- /**
827
- * Generate a complete CSS string for a resolved theme.
828
- * Outputs 2–3 blocks: light default, dark explicit via `[data-theme-mode="dark"]`,
829
- * and (unless `disableAutoTheme`) a `prefers-color-scheme: dark` media query block.
830
- */
831
- declare function generateThemeCSS(theme: ResolvedTheme, options?: GenerateThemeCSSOptions): string;
832
- //#endregion
833
- //#region ../core/src/theme/serialisation.d.ts
834
- /**
835
- * Serialise a ThemeDefinition (with Color objects) to a plain JSON payload
836
- * suitable for backend storage.
837
- */
838
- declare function serialiseTheme(def: ThemeDefinition): ThemePayload;
839
- /**
840
- * Deserialise a backend payload into a ThemeDefinition with Color objects.
841
- * Accepts `Record<string, unknown>` because API data is untyped at the boundary.
842
- * Falls back to default colors for any missing light-mode entries.
843
- */
844
- declare function deserialiseTheme(payload: Record<string, unknown>): ThemeDefinition;
845
- //#endregion
846
- //#region ../core/src/theme/transforms.d.ts
847
- /** Shape of a raw theme from the FluidOS API */
848
- interface RawApiTheme {
849
- id: number;
850
- config?: Record<string, unknown> | null;
851
- active?: boolean | null;
852
- name?: string | null;
853
- }
854
- /**
855
- * Build a ThemeDefinition from a single API theme object.
856
- * Handles both new structured format and legacy flat format.
857
- */
858
- declare function buildThemeDefinition(theme: RawApiTheme): ThemeDefinition;
859
- /**
860
- * Transform raw API themes to ThemeDefinition[].
861
- * Catches and logs errors per theme (graceful degradation).
862
- */
863
- declare function transformThemes(themes: RawApiTheme[]): ThemeDefinition[];
864
- /**
865
- * Get the active theme ID from a list of raw API themes.
866
- * Falls back to the first theme if none is marked active.
867
- */
868
- declare function getActiveThemeId(themes: RawApiTheme[]): string | undefined;
869
- //#endregion
870
- //#region ../core/src/theme/theme-applicator.d.ts
871
- /**
872
- * Inject or update a `<style>` element in `<head>` for the given theme.
873
- * The element ID is deterministic (`theme-style-{themeId}`) so repeated calls
874
- * for the same theme are idempotent — the existing element is updated in place.
875
- * Also loads Google Fonts referenced by the theme's font families.
876
- * No-op when `document` is unavailable (SSR).
877
- */
878
- declare function applyTheme(theme: ResolvedTheme, options?: GenerateThemeCSSOptions): void;
879
- /** Remove an injected theme stylesheet and clean up font link ownership. No-op during SSR. */
880
- declare function removeTheme(themeId: string): void;
881
- /** Remove all injected theme stylesheets and font links. No-op during SSR. */
882
- declare function removeAllThemes(): void;
883
- //#endregion
884
- //#region ../core/src/theme/defaults.d.ts
885
- declare const DEFAULT_FONT_SIZES: Record<FontSizeKey, string>;
886
- declare const DEFAULT_FONT_FAMILIES: Record<FontFamilyKey, string>;
887
- declare const DEFAULT_SPACING = "0.25rem";
888
- declare const DEFAULT_RADII: Record<RadiusKey, string>;
889
- declare const DEFAULT_COLORS: {
890
- readonly background: "#ffffff";
891
- readonly foreground: "#1a1a1a";
892
- readonly primary: "#3b82f6";
893
- readonly secondary: "#6b7280";
894
- readonly accent: "#10b981";
895
- readonly muted: "#f3f4f6";
896
- readonly destructive: "#ef4444";
897
- readonly mutedForeground: "#6b7280";
898
- };
899
- declare const DEFAULT_THEME_ID = "default";
900
- declare const DEFAULT_THEME_NAME = "Default Theme";
901
- /**
902
- * Build a fresh ThemeDefinition populated with all defaults.
903
- * Returns a new object each call because Color instances are mutable — do not cache the result.
904
- */
905
- declare function getDefaultThemeDefinition(): ThemeDefinition;
906
- //#endregion
907
- //#region src/transforms/screen-transforms.d.ts
908
- /** Raw screen from the FluidOS API */
909
- interface RawApiScreen {
910
- id: number | string;
911
- definition_id?: number | string;
912
- name?: string | null;
913
- slug?: string | null;
914
- component_tree?: unknown;
915
- }
916
- /**
917
- * Normalize component_tree to always be an array.
918
- * The API stores component_tree as a hash (object), but the frontend expects an array.
919
- */
920
- declare function normalizeComponentTree(componentTree: unknown): WidgetSchema[];
921
- /**
922
- * Convert a raw FluidOS screen to ScreenDefinition.
923
- * Normalizes component_tree and converts string IDs to numbers.
924
- */
925
- declare function toScreenDefinition(screen: RawApiScreen): ScreenDefinition$1;
926
- //#endregion
927
- //#region ../core/src/types/fluidos-api.d.ts
928
- interface ResponseMeta {
929
- request_id?: string;
930
- timestamp?: string;
931
- }
932
- /** Raw FluidOS navigation item as returned by the API. */
933
- interface FluidOsApiNavigationItem {
934
- id: number;
935
- icon?: string | null;
936
- label?: string | null;
937
- parent_id?: number | null;
938
- position?: number | null;
939
- screen_id?: number | null;
940
- slug?: string | null;
941
- /** @enum {string} */
942
- source: "user" | "system" | "code";
943
- children: FluidOsApiNavigationItem[];
944
- }
945
- //#endregion
946
- //#region src/transforms/navigation-transforms.d.ts
947
- /** Raw navigation item from the FluidOS API. */
948
- type RawApiNavigationItem = FluidOsApiNavigationItem;
949
- /**
950
- * Convert a raw FluidOS navigation item to NavigationItem.
951
- * Recursively transforms children and sorts by position.
952
- */
953
- declare function toNavigationItem(item: RawApiNavigationItem): NavigationItem;
954
- //#endregion
955
- //#region src/transforms/index.d.ts
956
- /** Raw manifest shape from the `/fluid_os/definitions/active` API response */
957
- interface RawManifestResponse {
958
- manifest: {
959
- definition_id: number;
960
- published_version?: number;
961
- screens?: RawApiScreen[];
962
- profile?: {
963
- name?: string;
964
- definition_id: number;
965
- themes?: RawApiTheme[];
966
- navigation?: {
967
- id: number;
968
- name?: string;
969
- definition_id: number;
970
- navigation_items?: RawApiNavigationItem[];
971
- };
972
- mobile_navigation?: {
973
- id: number;
974
- name?: string;
975
- definition_id: number;
976
- navigation_items?: RawApiNavigationItem[];
977
- };
978
- };
979
- };
980
- }
981
- /**
982
- * Convert a raw FluidOS API response to RawManifestResponse.
983
- *
984
- * The wire format includes `navigation_items` and full theme objects,
985
- * but the generated OpenAPI types differ (e.g. `navigation_tree`, `themes: number[]`).
986
- * This function bridges that gap so callers avoid `as unknown as` casts.
987
- */
988
- declare function toRawManifest<T extends {
989
- manifest?: object;
990
- }>(raw: T): RawManifestResponse;
991
- /**
992
- * Transform a raw FluidOS manifest API response into RepAppData.
993
- *
994
- * This is the top-level transform used by `FluidClient.app.get()`.
995
- * It handles:
996
- * - Theme transformation (legacy and new formats)
997
- * - Screen normalization (component_tree array wrapping)
998
- * - Navigation item transformation (recursive with position sorting)
999
- */
1000
- declare function transformManifestToRepAppData(response: RawManifestResponse): RepAppData;
1001
- //#endregion
1002
- //#region src/client/fluid-client.d.ts
1003
- /**
1004
- * API Error class for structured error handling
1005
- */
1006
- declare class ApiError extends Error {
1007
- readonly status: number;
1008
- readonly data: unknown;
1009
- constructor(message: string, status: number, data?: unknown);
1010
- toJSON(): {
1011
- name: string;
1012
- message: string;
1013
- status: number;
1014
- data: unknown;
1015
- };
1016
- }
1017
- /**
1018
- * Type guard for ApiError
1019
- */
1020
- declare function isApiError(error: unknown): error is ApiError;
1021
- /**
1022
- * Discriminated union representing the result of an API call.
1023
- * Use `isApiSuccess` and `isApiFailure` type guards to narrow.
1024
- */
1025
- type ApiResult<T> = {
1026
- readonly success: true;
1027
- readonly data: T;
1028
- } | {
1029
- readonly success: false;
1030
- readonly error: ApiError;
1031
- };
1032
- /**
1033
- * Metadata included in every API envelope response.
1034
- */
1035
- interface EnvelopeMeta {
1036
- readonly request_id: string | null;
1037
- readonly timestamp: string;
1038
- readonly pagination?: CursorPagination;
1039
- }
1040
- /**
1041
- * Cursor-based pagination metadata returned in the envelope `meta`.
1042
- */
1043
- interface CursorPagination {
1044
- readonly cursor: string | null;
1045
- readonly limit: number;
1046
- readonly next_cursor: string | null;
1047
- readonly prev_cursor: string | null;
1048
- }
1049
- /**
1050
- * Result type for paginated list endpoints.
1051
- * Includes both the unwrapped data and cursor-based pagination metadata.
1052
- */
1053
- interface PaginatedResult<T> {
1054
- readonly data: T;
1055
- readonly pagination: CursorPagination | undefined;
1056
- }
1057
- /** Minimal order shape returned by the analytics dashboard endpoint. */
1058
- interface DashboardOrder {
1059
- readonly id: string;
1060
- readonly order_number: string;
1061
- readonly status: string;
1062
- readonly total: number;
1063
- readonly created_at: string;
1064
- }
1065
- interface DashboardData {
1066
- readonly total_sales: number;
1067
- readonly total_orders: number;
1068
- readonly total_customers: number;
1069
- readonly recent_orders: readonly DashboardOrder[];
1070
- }
1071
- interface SalesParams {
1072
- readonly date_from?: string;
1073
- readonly date_to?: string;
1074
- readonly group_by?: "day" | "week" | "month";
1075
- }
1076
- interface SalesData {
1077
- readonly total: number;
1078
- readonly data: readonly SalesDataPoint[];
1079
- }
1080
- interface SalesDataPoint {
1081
- readonly date: string;
1082
- readonly amount: number;
1083
- readonly orders: number;
1084
- }
1085
- /**
1086
- * The shape returned by `createFluidClient`.
1087
- * Generic helper methods preserve their type parameters so callers
1088
- * can specify response types at each call site.
1089
- */
1090
- interface FluidClientReturn {
1091
- readonly fetchClient: FetchClient;
1092
- readonly request: <TResponse = unknown>(endpoint: string, options?: RequestOptions) => Promise<TResponse>;
1093
- readonly requestNullable: <TResponse>(endpoint: string, options?: RequestOptions) => Promise<TResponse | null>;
1094
- readonly safeRequest: <TResponse>(endpoint: string, options?: RequestOptions) => Promise<ApiResult<TResponse>>;
1095
- readonly get: <TResponse = unknown, TParams extends object = Record<string, unknown>>(endpoint: string, params?: TParams, options?: Omit<RequestOptions, "method" | "params">) => Promise<TResponse>;
1096
- readonly post: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
1097
- readonly put: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
1098
- readonly patch: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
1099
- readonly delete: <TResponse = unknown>(endpoint: string, options?: Omit<RequestOptions, "method">) => Promise<TResponse>;
1100
- readonly reps: {
1101
- readonly current: () => Promise<Rep>;
1102
- readonly updateProfile: (data: UpdateRepData) => Promise<Rep>;
1103
- };
1104
- readonly app: {
1105
- readonly getRaw: () => Promise<RawManifestResponse>;
1106
- readonly get: () => Promise<RepAppData>;
1107
- };
1108
- readonly permissions: {
1109
- readonly get: () => Promise<UserPermissions>;
1110
- };
1111
- readonly analytics: {
1112
- readonly dashboard: () => Promise<DashboardData>;
1113
- readonly sales: (params?: SalesParams) => Promise<SalesData>;
1114
- };
1115
- }
1116
- /**
1117
- * Creates a configured Fluid API client instance
1118
- */
1119
- declare function createFluidClient(config: FluidSDKConfig): FluidClientReturn;
1120
- type FluidClient = ReturnType<typeof createFluidClient>;
1121
- //#endregion
1122
- //#region src/providers/FluidProvider.d.ts
1123
- /**
1124
- * Context value for FluidProvider.
1125
- * All properties are readonly since context values should not be mutated by consumers.
1126
- */
1127
- interface FluidContextValue {
1128
- /** Configured API client instance */
1129
- readonly client: FluidClient;
1130
- /** SDK configuration */
1131
- readonly config: FluidSDKConfig;
1132
- }
1133
- interface FluidProviderProps {
1134
- /** SDK configuration (baseUrl, auth, etc.) */
1135
- config: FluidSDKConfig;
1136
- /** React children */
1137
- children: ReactNode;
1138
- /** Optional custom QueryClient instance */
1139
- queryClient?: QueryClient;
1140
- /** Optional initial theme */
1141
- initialTheme?: ThemeDefinition;
1142
- /** Optional container for scoped theme application */
1143
- themeContainer?: HTMLElement | null;
1144
- /** Optional custom widget registry (defaults to all built-in widgets) */
1145
- widgetRegistry?: Record<string, React.ComponentType<any>>;
1146
- /** Dynamic variables for data source endpoint path substitution (e.g., { rep_id: "123" }) */
1147
- variables?: Record<string, string>;
1148
- }
1149
- /**
1150
- * Main provider for the Fluid Portal SDK
1151
- *
1152
- * @example
1153
- * ```tsx
1154
- * import { FluidProvider } from "@fluid-app/portal-sdk";
1155
- *
1156
- * function App() {
1157
- * return (
1158
- * <FluidProvider
1159
- * config={{ baseUrl: "" }}
1160
- * >
1161
- * <YourApp />
1162
- * </FluidProvider>
1163
- * );
1164
- * }
1165
- * ```
803
+ * Main provider for the Fluid Portal SDK
804
+ *
805
+ * @example
806
+ * ```tsx
807
+ * import { FluidProvider } from "@fluid-app/portal-sdk";
808
+ *
809
+ * function App() {
810
+ * return (
811
+ * <FluidProvider
812
+ * config={{ baseUrl: "" }}
813
+ * >
814
+ * <YourApp />
815
+ * </FluidProvider>
816
+ * );
817
+ * }
818
+ * ```
1166
819
  */
1167
820
  declare function FluidProvider({
1168
821
  config,
@@ -1220,6 +873,25 @@ declare function useThemeContext(): ThemeContextValue;
1220
873
  */
1221
874
  declare function usePortalTenantClient(): FetchClient;
1222
875
  //#endregion
876
+ //#region ../core/src/fluidos-api.d.ts
877
+ interface ResponseMeta {
878
+ request_id?: string;
879
+ timestamp?: string;
880
+ }
881
+ /** Raw FluidOS navigation item as returned by the API. */
882
+ interface FluidOsApiNavigationItem {
883
+ id: number;
884
+ icon?: string | null;
885
+ label?: string | null;
886
+ parent_id?: number | null;
887
+ position?: number | null;
888
+ screen_id?: number | null;
889
+ slug?: string | null;
890
+ /** @enum {string} */
891
+ source: "user" | "system" | "code";
892
+ children: FluidOsApiNavigationItem[];
893
+ }
894
+ //#endregion
1223
895
  //#region ../core/src/app-definition-types.d.ts
1224
896
  interface AppFluidOsDefinition {
1225
897
  id: number;
@@ -2112,26 +1784,6 @@ declare function createPortal(config?: PortalConfig): void;
2112
1784
  */
2113
1785
  declare function createDefaultFluidConfig(overrides?: Partial<FluidSDKConfig>): FluidSDKConfig;
2114
1786
  //#endregion
2115
- //#region src/hooks/use-fluid-api.d.ts
2116
- /**
2117
- * Hook to access the Fluid API client
2118
- *
2119
- * @example
2120
- * ```tsx
2121
- * function RepProfile() {
2122
- * const api = useFluidApi();
2123
- *
2124
- * const { data: rep } = useQuery({
2125
- * queryKey: ["rep"],
2126
- * queryFn: () => api.reps.current(),
2127
- * });
2128
- *
2129
- * return <p>Hello, {rep?.first_name}</p>;
2130
- * }
2131
- * ```
2132
- */
2133
- declare function useFluidApi(): FluidClient;
2134
- //#endregion
2135
1787
  //#region src/hooks/use-fluid-profile.d.ts
2136
1788
  /**
2137
1789
  * Base query key for profile data.
@@ -2170,6 +1822,209 @@ declare const PROFILE_QUERY_KEY: readonly ["fluid", "profile"];
2170
1822
  */
2171
1823
  declare function useFluidProfile(): UseQueryResult<Profile>;
2172
1824
  //#endregion
1825
+ //#region ../core/src/theme/color-engine.d.ts
1826
+ /**
1827
+ * Attempt to convert any string into a Color using colorjs.io.
1828
+ * If the string is exactly 6 characters it is assumed to be a bare hex value
1829
+ * (e.g. "3b82f6") and a "#" prefix is added before parsing.
1830
+ *
1831
+ * @returns the parsed Color, or a neutral gray (`oklch(0.5 0 0)`) on failure
1832
+ */
1833
+ declare function parseColor(value: string): Color;
1834
+ /**
1835
+ * Returns either the original foreground or a corrected lightness variant,
1836
+ * whichever provides better contrast against `color`.
1837
+ * Inversion triggers when the APCA contrast is below 50.
1838
+ */
1839
+ declare function getForegroundColor(foreground: Color, color: Color): Color;
1840
+ /**
1841
+ * Generate a 100–900 shade ramp from a base color.
1842
+ * Base anchors at 500. Light shades (100–400) step toward white,
1843
+ * dark shades (600–900) step toward black. Dark steps use an asymmetric
1844
+ * multiplier (1.6×, 1.875×, 3×, 4× of `darkStep`) for a more gradual
1845
+ * initial descent. Chroma is nudged per step for perceptually natural ramps.
1846
+ */
1847
+ declare function generateShades(base: Color): Record<ShadeStep, Color>;
1848
+ /**
1849
+ * Derive a dark-mode ThemeColorInput from its light-mode counterpart.
1850
+ */
1851
+ declare function deriveDarkVariant(name: SemanticColorName, light: ThemeColorInput): ThemeColorInput;
1852
+ /**
1853
+ * Merge auto-derived dark colors with any user-specified overrides.
1854
+ * For each semantic color, if the user has fully overridden both base and
1855
+ * foreground those are used; otherwise the missing channels are derived.
1856
+ */
1857
+ declare function mergeDarkOverrides(def: ThemeDefinition): Record<SemanticColorName, ThemeColorInput>;
1858
+ /**
1859
+ * Resolve a ThemeDefinition into a complete ResolvedTheme.
1860
+ * Dark mode colors are derived from light where not overridden.
1861
+ */
1862
+ declare function resolveTheme(def: ThemeDefinition): ResolvedTheme;
1863
+ //#endregion
1864
+ //#region ../core/src/theme/css-generator.d.ts
1865
+ interface GenerateThemeCSSOptions {
1866
+ /** Whether or not to allow prefers-color-scheme to choose the theme mode */
1867
+ disableAutoTheme?: boolean;
1868
+ /** Whether to emit Tailwind built-in color overrides (default true) */
1869
+ mapTailwindColors?: boolean;
1870
+ }
1871
+ /**
1872
+ * Generate a complete CSS string for a resolved theme.
1873
+ * Outputs 2–3 blocks: light default, dark explicit via `[data-theme-mode="dark"]`,
1874
+ * and (unless `disableAutoTheme`) a `prefers-color-scheme: dark` media query block.
1875
+ */
1876
+ declare function generateThemeCSS(theme: ResolvedTheme, options?: GenerateThemeCSSOptions): string;
1877
+ //#endregion
1878
+ //#region ../core/src/theme/serialisation.d.ts
1879
+ /**
1880
+ * Serialise a ThemeDefinition (with Color objects) to a plain JSON payload
1881
+ * suitable for backend storage.
1882
+ */
1883
+ declare function serialiseTheme(def: ThemeDefinition): ThemePayload;
1884
+ /**
1885
+ * Deserialise a backend payload into a ThemeDefinition with Color objects.
1886
+ * Accepts `Record<string, unknown>` because API data is untyped at the boundary.
1887
+ * Falls back to default colors for any missing light-mode entries.
1888
+ */
1889
+ declare function deserialiseTheme(payload: Record<string, unknown>): ThemeDefinition;
1890
+ //#endregion
1891
+ //#region ../core/src/theme/transforms.d.ts
1892
+ /** Shape of a raw theme from the FluidOS API */
1893
+ interface RawApiTheme {
1894
+ id: number;
1895
+ config?: Record<string, unknown> | null;
1896
+ active?: boolean | null;
1897
+ name?: string | null;
1898
+ }
1899
+ /**
1900
+ * Build a ThemeDefinition from a single API theme object.
1901
+ * Handles both new structured format and legacy flat format.
1902
+ */
1903
+ declare function buildThemeDefinition(theme: RawApiTheme): ThemeDefinition;
1904
+ /**
1905
+ * Transform raw API themes to ThemeDefinition[].
1906
+ * Catches and logs errors per theme (graceful degradation).
1907
+ */
1908
+ declare function transformThemes(themes: RawApiTheme[]): ThemeDefinition[];
1909
+ /**
1910
+ * Get the active theme ID from a list of raw API themes.
1911
+ * Falls back to the first theme if none is marked active.
1912
+ */
1913
+ declare function getActiveThemeId(themes: RawApiTheme[]): string | undefined;
1914
+ //#endregion
1915
+ //#region ../core/src/theme/theme-applicator.d.ts
1916
+ /**
1917
+ * Inject or update a `<style>` element in `<head>` for the given theme.
1918
+ * The element ID is deterministic (`theme-style-{themeId}`) so repeated calls
1919
+ * for the same theme are idempotent — the existing element is updated in place.
1920
+ * Also loads Google Fonts referenced by the theme's font families.
1921
+ * No-op when `document` is unavailable (SSR).
1922
+ */
1923
+ declare function applyTheme(theme: ResolvedTheme, options?: GenerateThemeCSSOptions): void;
1924
+ /** Remove an injected theme stylesheet and clean up font link ownership. No-op during SSR. */
1925
+ declare function removeTheme(themeId: string): void;
1926
+ /** Remove all injected theme stylesheets and font links. No-op during SSR. */
1927
+ declare function removeAllThemes(): void;
1928
+ //#endregion
1929
+ //#region ../core/src/theme/defaults.d.ts
1930
+ declare const DEFAULT_FONT_SIZES: Record<FontSizeKey, string>;
1931
+ declare const DEFAULT_FONT_FAMILIES: Record<FontFamilyKey, string>;
1932
+ declare const DEFAULT_SPACING = "0.25rem";
1933
+ declare const DEFAULT_RADII: Record<RadiusKey, string>;
1934
+ declare const DEFAULT_COLORS: {
1935
+ readonly background: "#ffffff";
1936
+ readonly foreground: "#1a1a1a";
1937
+ readonly primary: "#3b82f6";
1938
+ readonly secondary: "#6b7280";
1939
+ readonly accent: "#10b981";
1940
+ readonly muted: "#f3f4f6";
1941
+ readonly destructive: "#ef4444";
1942
+ readonly mutedForeground: "#6b7280";
1943
+ };
1944
+ declare const DEFAULT_THEME_ID = "default";
1945
+ declare const DEFAULT_THEME_NAME = "Default Theme";
1946
+ /**
1947
+ * Build a fresh ThemeDefinition populated with all defaults.
1948
+ * Returns a new object each call because Color instances are mutable — do not cache the result.
1949
+ */
1950
+ declare function getDefaultThemeDefinition(): ThemeDefinition;
1951
+ //#endregion
1952
+ //#region src/transforms/screen-transforms.d.ts
1953
+ /** Raw screen from the FluidOS API */
1954
+ interface RawApiScreen {
1955
+ id: number | string;
1956
+ definition_id?: number | string;
1957
+ name?: string | null;
1958
+ slug?: string | null;
1959
+ component_tree?: unknown;
1960
+ }
1961
+ /**
1962
+ * Normalize component_tree to always be an array.
1963
+ * The API stores component_tree as a hash (object), but the frontend expects an array.
1964
+ */
1965
+ declare function normalizeComponentTree(componentTree: unknown): WidgetSchema[];
1966
+ /**
1967
+ * Convert a raw FluidOS screen to ScreenDefinition.
1968
+ * Normalizes component_tree and converts string IDs to numbers.
1969
+ */
1970
+ declare function toScreenDefinition(screen: RawApiScreen): ScreenDefinition$1;
1971
+ //#endregion
1972
+ //#region src/transforms/navigation-transforms.d.ts
1973
+ /** Raw navigation item from the FluidOS API. */
1974
+ type RawApiNavigationItem = FluidOsApiNavigationItem;
1975
+ /**
1976
+ * Convert a raw FluidOS navigation item to NavigationItem.
1977
+ * Recursively transforms children and sorts by position.
1978
+ */
1979
+ declare function toNavigationItem(item: RawApiNavigationItem): NavigationItem;
1980
+ //#endregion
1981
+ //#region src/transforms/index.d.ts
1982
+ /** Raw manifest shape from the `/fluid_os/definitions/active` API response */
1983
+ interface RawManifestResponse {
1984
+ manifest: {
1985
+ definition_id: number;
1986
+ published_version?: number;
1987
+ screens?: RawApiScreen[];
1988
+ profile?: {
1989
+ name?: string;
1990
+ definition_id: number;
1991
+ themes?: RawApiTheme[];
1992
+ navigation?: {
1993
+ id: number;
1994
+ name?: string;
1995
+ definition_id: number;
1996
+ navigation_items?: RawApiNavigationItem[];
1997
+ };
1998
+ mobile_navigation?: {
1999
+ id: number;
2000
+ name?: string;
2001
+ definition_id: number;
2002
+ navigation_items?: RawApiNavigationItem[];
2003
+ };
2004
+ };
2005
+ };
2006
+ }
2007
+ /**
2008
+ * Convert a raw FluidOS API response to RawManifestResponse.
2009
+ *
2010
+ * The wire format includes `navigation_items` and full theme objects,
2011
+ * but the generated OpenAPI types differ (e.g. `navigation_tree`, `themes: number[]`).
2012
+ * This function bridges that gap so callers avoid `as unknown as` casts.
2013
+ */
2014
+ declare function toRawManifest<T extends {
2015
+ manifest?: object;
2016
+ }>(raw: T): RawManifestResponse;
2017
+ /**
2018
+ * Transform a raw FluidOS manifest API response into RepAppData.
2019
+ *
2020
+ * This is the top-level transform used by `useFluidApp` and `useFluidProfile`.
2021
+ * It handles:
2022
+ * - Theme transformation (legacy and new formats)
2023
+ * - Screen normalization (component_tree array wrapping)
2024
+ * - Navigation item transformation (recursive with position sorting)
2025
+ */
2026
+ declare function transformManifestToRepAppData(response: RawManifestResponse): RepAppData;
2027
+ //#endregion
2173
2028
  //#region src/hooks/use-fluid-app.d.ts
2174
2029
  /**
2175
2030
  * Base query key for full app data (fluidos endpoint).
@@ -2235,44 +2090,6 @@ declare function useAppDefinition(options?: {
2235
2090
  enabled?: boolean;
2236
2091
  }): UseQueryResult<AppDefinitionResponse>;
2237
2092
  //#endregion
2238
- //#region src/hooks/use-fluid-permissions.d.ts
2239
- /**
2240
- * Base query key for permissions data.
2241
- * Kept for backwards compatibility — the runtime key used by the hook
2242
- * includes a company prefix via {@link useCompanyScopedQueryKey}.
2243
- */
2244
- declare const PERMISSIONS_QUERY_KEY: readonly ["fluid", "permissions"];
2245
- /**
2246
- * Result of useFluidPermissions hook
2247
- */
2248
- interface UseFluidPermissionsResult {
2249
- /** Raw permissions query result */
2250
- query: UseQueryResult<UserPermissions>;
2251
- /** Permissions data (alias for query.data) */
2252
- permissions: UserPermissions | undefined;
2253
- /** Check if user has a specific permission */
2254
- can: (resource: string, action?: PermissionAction) => boolean;
2255
- /** Check if user is a super admin */
2256
- isSuperAdmin: boolean;
2257
- }
2258
- /**
2259
- * Hook to fetch and check user permissions
2260
- *
2261
- * @example
2262
- * ```tsx
2263
- * function TeamSettings() {
2264
- * const { can, isSuperAdmin } = useFluidPermissions();
2265
- *
2266
- * if (!can("team", "manage")) {
2267
- * return <AccessDenied />;
2268
- * }
2269
- *
2270
- * return <TeamSettingsForm canDelete={can("team", "delete")} />;
2271
- * }
2272
- * ```
2273
- */
2274
- declare function useFluidPermissions(): UseFluidPermissionsResult;
2275
- //#endregion
2276
2093
  //#region src/hooks/use-fluid-theme.d.ts
2277
2094
  /**
2278
2095
  * Result of useFluidTheme hook
@@ -2321,34 +2138,6 @@ interface UseFluidThemeResult {
2321
2138
  */
2322
2139
  declare function useFluidTheme(): UseFluidThemeResult;
2323
2140
  //#endregion
2324
- //#region src/hooks/use-current-rep.d.ts
2325
- /**
2326
- * Base query key for current rep data.
2327
- * Kept for backwards compatibility — the runtime key used by the hook
2328
- * includes a company prefix via {@link useCompanyScopedQueryKey}.
2329
- */
2330
- declare const CURRENT_REP_QUERY_KEY: readonly ["fluid", "currentRep"];
2331
- /**
2332
- * Hook to fetch the currently authenticated rep's profile
2333
- *
2334
- * @example
2335
- * ```tsx
2336
- * function RepHeader() {
2337
- * const { data: rep, isLoading } = useCurrentRep();
2338
- *
2339
- * if (isLoading) return <Skeleton />;
2340
- *
2341
- * return (
2342
- * <div>
2343
- * <Avatar src={rep?.avatar_url} />
2344
- * <span>{rep?.first_name} {rep?.last_name}</span>
2345
- * </div>
2346
- * );
2347
- * }
2348
- * ```
2349
- */
2350
- declare function useCurrentRep(): UseQueryResult<Rep>;
2351
- //#endregion
2352
2141
  //#region src/hooks/query-keys.d.ts
2353
2142
  /**
2354
2143
  * Create a company-scoped query key by prepending ["company", companyId].
@@ -4953,5 +4742,5 @@ declare function useThemeMode(): ThemeModeContextValue;
4953
4742
  /** Maps a ThemeMode to the value for `data-theme-mode`. Returns undefined for "auto". */
4954
4743
  declare function getThemeModeAttribute(mode: ThemeMode): string | undefined;
4955
4744
  //#endregion
4956
- export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, APP_DEFINITION_QUERY_KEY, type Activity as ActivityItem, type ActivitySlug, AlertWidget, type AlignOptions, ApiError, type AppDefinitionApi, type AppDefinitionResponse, type AppFluidOsDefinition, AppLink, type AppLinkProps, type AppNavigationContextValue, AppNavigationProvider, type AppNavigationProviderProps, AppShell, type AppShellProps, type BackgroundType, type BackgroundValue, type BaseListParams, type BorderRadiusOptions, BuilderScreenView, type BuilderScreenViewProps, BulletListWidget, type ButtonSizeOptions, CORE_PAGE_IDS, CURRENT_REP_QUERY_KEY, type CalendarEvent, CalendarWidget, CardWidget, CarouselWidget, type CatchUp as CatchUpItem, CatchUpWidget, ChartWidget, type ColorOptions, type Contact, type ContactAddress, type ContactStatus, type ContactType, ContactsScreen, ContainerWidget, type Conversation, type ConversationStatus, type CursorPagination, CustomersScreen, DEFAULT_COLORS, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_RADII, DEFAULT_SDK_WIDGET_REGISTRY, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_THEME_NAME, type DashboardData, type DashboardOrder, EmbedWidget, type EnvelopeMeta, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, type FileCategory, type FileUploader, type FluidClient, FluidProvider, type FluidProviderProps, type FluidSDKConfig, FluidThemeProvider, type FluidThemeProviderProps, type FontFamilyKey, type FontSizeKey, type FontSizeOptions, type GapOptions, type GenerateThemeCSSOptions, ImageWidget, LayoutWidget, LinkWidget, type ListQueryResult, ListWidget, type ManifestEntry, type Message, type MessageType, type MessagingAuthContext, type MessagingConfig, type MessagingCurrentUser, MessagingScreen, type MySiteData, MySiteScreen, MySiteWidget, type Navigation, type NavigationItem, NestedWidget, type OklchPlain, 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 PaginatedResult, type PaginationParams, type Participant, type PermissionAction, type Permissions, PointsWidget, type PortalConfig, type FetchClient as PortalTenantFetchClient, ProductsScreen, type Profile, ProfileScreen, 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, type ResolvedColorSet, type ResolvedSemanticColor, type ResolvedTheme, type ResourcePermissions, SCAFFOLD_MANIFEST, SEMANTIC_COLOR_NAMES, SHADE_STEPS, type SalesData, type SalesDataPoint, type SalesParams, type ScaffoldFile, type ScreenDefinition, SdkCompanySwitcher, SdkHeader, type SdkHeaderProps, SdkNavigation, type SdkNavigationProps, type SectionLayoutType, type SemanticColorName, SeparatorWidget, type ShadeStep, type ShareableItem, ShareablesScreen, ShopScreen, type SlugMatch, SpacerWidget, SubscriptionsScreen, type TabConfig, TableWidget, TextWidget, type ThemeColorInput, type ThemeColorPlain, type ThemeDefinition, type ThemeMode, ThemeModeProvider, type ThemePayload, ToDoWidget, type Todo as TodoItem, type TypedWidgetSchema, USER_TYPES, type UpdateRepData, type UploadCallbacks, type UploadResult, type UseCompanySwitchOptions, type UseContactResult, type UseContactsParams, type UseContactsResult, type UseConversationMessagesResult, type UseConversationsResult, type UseFluidPermissionsResult, type UseFluidThemeResult, type UseListResourceHook, type UseLogoutOptions, type UseSingleResourceHook, 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, buildWidgetRegistry, bulletListWidgetPropertySchema, calendarWidgetPropertySchema, cardWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, collectNavSlugs, contactsScreenPropertySchema, containerWidgetPropertySchema, createCompanyQueryKey, createDefaultFluidConfig, createFluidClient, createFluidFileUploader, createPortal, createScreen, createWidgetFromShareable, createWidgetRegistry, customersScreenPropertySchema, deriveDarkVariant, deserialiseTheme, embedWidgetPropertySchema, extractSlugFromPathname, filterRepOnlyNavItems, gapValues, generateShades, generateThemeCSS, getActiveThemeId, getAvailablePageTemplates, getCorePageTemplates, getDefaultThemeDefinition, getForegroundColor, getOptionalPageTemplates, getProperty, getThemeModeAttribute, groupChildrenByColumn, hasData, imageWidgetPropertySchema, isActivitySlug, isApiError, isContactStatus, isErrorResult, isIdle, isLoading, isPropertyFieldType, isSlugInSection, isUserType, isWidgetType, isWidgetTypeName, layoutWidgetPropertySchema, linkWidgetPropertySchema, listWidgetPropertySchema, matchSlugPrefix, mergeDarkOverrides, messagingScreenPropertySchema, mySiteScreenPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, normalizeComponentTree, ordersScreenPropertySchema, parseColor, pointsWidgetPropertySchema, productsScreenPropertySchema, profileScreenPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, removeAllThemes, removeTheme, resolveNavigationPages, resolveTheme, screenPropertySchemas, sectionLayoutConfig, selectProperty, separatorWidgetPropertySchema, serialiseTheme, shareablesScreenPropertySchema, shopScreenPropertySchema, spacerWidgetPropertySchema, subscriptionsScreenPropertySchema, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, toNavigationItem, toRawManifest, toScreenDefinition, transformManifestToRepAppData, transformThemes, useActivities, useAppDefinition, useAppDefinitionApi, useAppNavigation, useCalendarEvents, useCatchUps, useCompanyScopedQueryKey, useCompanySwitch, useContact, useContacts, useConversationMessages, useConversations, useCurrentRep, useFluidApi, useFluidApp, useFluidContext, useFluidPermissions, useFluidProfile, useFluidTheme, useLogout, useMessagingAuth, useMessagingConfig, useMySite, usePageTemplates, usePortalTenantClient, useResolvedPages, useThemeContext, useThemeMode, useTodos, validateNavigationPages, videoWidgetPropertySchema, widgetPropertySchemas };
4745
+ export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, APP_DEFINITION_QUERY_KEY, type Activity as ActivityItem, type ActivitySlug, AlertWidget, type AlignOptions, ApiError, type AppDefinitionApi, type AppDefinitionResponse, type AppFluidOsDefinition, AppLink, type AppLinkProps, type AppNavigationContextValue, AppNavigationProvider, type AppNavigationProviderProps, AppShell, type AppShellProps, type BackgroundType, type BackgroundValue, type BaseListParams, type BorderRadiusOptions, BuilderScreenView, type BuilderScreenViewProps, BulletListWidget, type ButtonSizeOptions, CORE_PAGE_IDS, type CalendarEvent, CalendarWidget, CardWidget, CarouselWidget, type CatchUp as CatchUpItem, CatchUpWidget, ChartWidget, type ColorOptions, type Contact, type ContactAddress, type ContactStatus, type ContactType, ContactsScreen, ContainerWidget, type Conversation, type ConversationStatus, type CursorPagination, CustomersScreen, DEFAULT_COLORS, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_RADII, DEFAULT_SDK_WIDGET_REGISTRY, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_THEME_NAME, EmbedWidget, type EnvelopeMeta, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, type FileCategory, type FileUploader, FluidProvider, type FluidProviderProps, type FluidSDKConfig, FluidThemeProvider, type FluidThemeProviderProps, type FontFamilyKey, type FontSizeKey, type FontSizeOptions, type GapOptions, type GenerateThemeCSSOptions, ImageWidget, LayoutWidget, LinkWidget, type ListQueryResult, ListWidget, type ManifestEntry, type Message, type MessageType, type MessagingAuthContext, type MessagingConfig, type MessagingCurrentUser, MessagingScreen, type MySiteData, MySiteScreen, MySiteWidget, type Navigation, type NavigationItem, NestedWidget, type OklchPlain, OrdersScreen, PAGE_CATEGORIES, PROFILE_QUERY_KEY, PROPERTY_FIELD_TYPES, type PaddingOptions, type PageCategory, type PageCategoryId, type PageOverride, type PageReference, PageRouter, type PageRouterProps, type PageTemplate, PageTemplateProvider, PageTemplateRegistry, type PaginatedResult, type PaginationParams, type Participant, PointsWidget, type PortalConfig, type FetchClient as PortalTenantFetchClient, ProductsScreen, type Profile, ProfileScreen, 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 RepAppData, type RepAppManifest, type RepAppProfile, type RequestOptions, type ResolvedColorSet, type ResolvedSemanticColor, type ResolvedTheme, SCAFFOLD_MANIFEST, SEMANTIC_COLOR_NAMES, SHADE_STEPS, type ScaffoldFile, type ScreenDefinition, SdkCompanySwitcher, SdkHeader, type SdkHeaderProps, SdkNavigation, type SdkNavigationProps, type SectionLayoutType, type SemanticColorName, SeparatorWidget, type ShadeStep, type ShareableItem, ShareablesScreen, ShopScreen, type SlugMatch, SpacerWidget, SubscriptionsScreen, type TabConfig, TableWidget, TextWidget, type ThemeColorInput, type ThemeColorPlain, type ThemeDefinition, type ThemeMode, ThemeModeProvider, type ThemePayload, ToDoWidget, type Todo as TodoItem, type TypedWidgetSchema, USER_TYPES, type UploadCallbacks, type UploadResult, type UseCompanySwitchOptions, type UseContactResult, type UseContactsParams, type UseContactsResult, type UseConversationMessagesResult, type UseConversationsResult, type UseFluidThemeResult, type UseListResourceHook, type UseLogoutOptions, type UseSingleResourceHook, 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, buildWidgetRegistry, bulletListWidgetPropertySchema, calendarWidgetPropertySchema, cardWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, collectNavSlugs, contactsScreenPropertySchema, containerWidgetPropertySchema, createCompanyQueryKey, createDefaultFluidConfig, createFluidFileUploader, createPortal, createScreen, createWidgetFromShareable, createWidgetRegistry, customersScreenPropertySchema, deriveDarkVariant, deserialiseTheme, embedWidgetPropertySchema, extractSlugFromPathname, filterRepOnlyNavItems, gapValues, generateShades, generateThemeCSS, getActiveThemeId, getAvailablePageTemplates, getCorePageTemplates, getDefaultThemeDefinition, getForegroundColor, getOptionalPageTemplates, getProperty, getThemeModeAttribute, groupChildrenByColumn, hasData, imageWidgetPropertySchema, isActivitySlug, isApiError, isContactStatus, isErrorResult, isIdle, isLoading, isPropertyFieldType, isSlugInSection, isUserType, isWidgetType, isWidgetTypeName, layoutWidgetPropertySchema, linkWidgetPropertySchema, listWidgetPropertySchema, matchSlugPrefix, mergeDarkOverrides, messagingScreenPropertySchema, mySiteScreenPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, normalizeComponentTree, ordersScreenPropertySchema, parseColor, pointsWidgetPropertySchema, productsScreenPropertySchema, profileScreenPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, removeAllThemes, removeTheme, resolveNavigationPages, resolveTheme, screenPropertySchemas, sectionLayoutConfig, selectProperty, separatorWidgetPropertySchema, serialiseTheme, shareablesScreenPropertySchema, shopScreenPropertySchema, spacerWidgetPropertySchema, subscriptionsScreenPropertySchema, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, toNavigationItem, toRawManifest, toScreenDefinition, transformManifestToRepAppData, transformThemes, useActivities, useAppDefinition, useAppDefinitionApi, useAppNavigation, useCalendarEvents, useCatchUps, useCompanyScopedQueryKey, useCompanySwitch, useContact, useContacts, useConversationMessages, useConversations, useFluidApp, useFluidContext, useFluidProfile, useFluidTheme, useLogout, useMessagingAuth, useMessagingConfig, useMySite, usePageTemplates, usePortalTenantClient, useResolvedPages, useThemeContext, useThemeMode, useTodos, validateNavigationPages, videoWidgetPropertySchema, widgetPropertySchemas };
4957
4746
  //# sourceMappingURL=index.d.mts.map