@fluid-app/portal-sdk 0.1.469 → 0.1.470

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 (135) hide show
  1. package/authoring/portal-api/api.md +227 -0
  2. package/authoring/widget-api/api.md +6 -0
  3. package/authoring/widget-api/core/src/registries/property-schema-types.md +3769 -0
  4. package/authoring/widget-api/sdk/src/widgets/worker.md +3683 -0
  5. package/dist/{CarouselWidget-CnjImV4p.cjs → CarouselWidget-B9_YaBRd.cjs} +7 -3
  6. package/dist/{CarouselWidget-CnjImV4p.cjs.map → CarouselWidget-B9_YaBRd.cjs.map} +1 -1
  7. package/dist/{CarouselWidget-xVj0Nl_1.cjs → CarouselWidget-BEPWgTCi.cjs} +1 -1
  8. package/dist/{CarouselWidget-DcoqH7YF.mjs → CarouselWidget-u58GTUD2.mjs} +7 -3
  9. package/dist/{CarouselWidget-DcoqH7YF.mjs.map → CarouselWidget-u58GTUD2.mjs.map} +1 -1
  10. package/dist/{ChartWidget-DhH_Q0e9.cjs → ChartWidget-C6hsftO9.cjs} +1 -1
  11. package/dist/{ChartWidget-CFyWkbfl.mjs → ChartWidget-J_JLCsug.mjs} +9 -2
  12. package/dist/{ChartWidget-CFyWkbfl.mjs.map → ChartWidget-J_JLCsug.mjs.map} +1 -1
  13. package/dist/{ChartWidget-DF-KE_5t.cjs → ChartWidget-q9yjk-79.cjs} +9 -2
  14. package/dist/{ChartWidget-DF-KE_5t.cjs.map → ChartWidget-q9yjk-79.cjs.map} +1 -1
  15. package/dist/{FluidProvider-CHo5kVRs.cjs → FluidProvider-DD1pE8b6.cjs} +2 -2
  16. package/dist/{FluidProvider-CHo5kVRs.cjs.map → FluidProvider-DD1pE8b6.cjs.map} +1 -1
  17. package/dist/{FluidProvider-BUV8QY8z.mjs → FluidProvider-DoJ-j6H-.mjs} +2 -2
  18. package/dist/{FluidProvider-BUV8QY8z.mjs.map → FluidProvider-DoJ-j6H-.mjs.map} +1 -1
  19. package/dist/{ImageWidget-BK_f_L0T.mjs → ImageWidget-B2SfenSC.mjs} +2 -2
  20. package/dist/{ImageWidget-BK_f_L0T.mjs.map → ImageWidget-B2SfenSC.mjs.map} +1 -1
  21. package/dist/{ImageWidget-8WfRzR60.cjs → ImageWidget-BFyfpxLg.cjs} +1 -1
  22. package/dist/{ImageWidget-C9PCTFpZ.cjs → ImageWidget-C7U9t7a3.cjs} +2 -2
  23. package/dist/{ImageWidget-C9PCTFpZ.cjs.map → ImageWidget-C7U9t7a3.cjs.map} +1 -1
  24. package/dist/{LinkWidget-DRMzQhQz.cjs → LinkWidget-Cjzrpnzd.cjs} +4 -1
  25. package/dist/LinkWidget-Cjzrpnzd.cjs.map +1 -0
  26. package/dist/{LinkWidget-BqLCMzfY.cjs → LinkWidget-D3acO4R8.cjs} +1 -1
  27. package/dist/{LinkWidget-C3HRFueg.mjs → LinkWidget-Dlw2rzK6.mjs} +4 -1
  28. package/dist/LinkWidget-Dlw2rzK6.mjs.map +1 -0
  29. package/dist/{ListWidget-BiBx02S8.cjs → ListWidget-DWAtSTK6.cjs} +1 -1
  30. package/dist/{ListWidget-D7Ws1bMu.mjs → ListWidget-W5Tm4mWy.mjs} +7 -3
  31. package/dist/{ListWidget-D7Ws1bMu.mjs.map → ListWidget-W5Tm4mWy.mjs.map} +1 -1
  32. package/dist/{ListWidget-Ge83X2-d.cjs → ListWidget-YrcH5_Ez.cjs} +7 -3
  33. package/dist/{ListWidget-Ge83X2-d.cjs.map → ListWidget-YrcH5_Ez.cjs.map} +1 -1
  34. package/dist/{MessagingScreen-KYbF9U2N.cjs → MessagingScreen-B8Bcy-2V.cjs} +2 -2
  35. package/dist/{MessagingScreen-KYbF9U2N.cjs.map → MessagingScreen-B8Bcy-2V.cjs.map} +1 -1
  36. package/dist/{MessagingScreen-r40mXBJR.mjs → MessagingScreen-BBoYyLPj.mjs} +11 -11
  37. package/dist/{MessagingScreen-CC2FSdcv.cjs → MessagingScreen-BJ7NTczB.cjs} +11 -11
  38. package/dist/{MessagingScreen-B9LmuGG4.mjs → MessagingScreen-vaNfWYeM.mjs} +2 -2
  39. package/dist/{MessagingScreen-B9LmuGG4.mjs.map → MessagingScreen-vaNfWYeM.mjs.map} +1 -1
  40. package/dist/{NestedWidget-nWK5H1NG.cjs → NestedWidget-B5iyFylx.cjs} +6 -2
  41. package/dist/{NestedWidget-nWK5H1NG.cjs.map → NestedWidget-B5iyFylx.cjs.map} +1 -1
  42. package/dist/{NestedWidget-J8fPrBNA.mjs → NestedWidget-Bdll8TLQ.mjs} +6 -2
  43. package/dist/{NestedWidget-J8fPrBNA.mjs.map → NestedWidget-Bdll8TLQ.mjs.map} +1 -1
  44. package/dist/{NestedWidget-Bhltm3Db.cjs → NestedWidget-CBYJ_Qw7.cjs} +1 -1
  45. package/dist/{OrdersScreen-jhkTEp5y.cjs → OrdersScreen-BdtVN1wl.cjs} +11 -11
  46. package/dist/{OrdersScreen-BMslkiOK.mjs → OrdersScreen-ClB_Yor-.mjs} +2 -2
  47. package/dist/{OrdersScreen-BMslkiOK.mjs.map → OrdersScreen-ClB_Yor-.mjs.map} +1 -1
  48. package/dist/{OrdersScreen-CHt2QwB7.mjs → OrdersScreen-D2cymJtp.mjs} +11 -11
  49. package/dist/{OrdersScreen-DkRte66f.cjs → OrdersScreen-DnJa329w.cjs} +2 -2
  50. package/dist/{OrdersScreen-DkRte66f.cjs.map → OrdersScreen-DnJa329w.cjs.map} +1 -1
  51. package/dist/{ProfileScreen-Cw1hajhU.mjs → ProfileScreen-3ki8yPFt.mjs} +3 -3
  52. package/dist/{ProfileScreen-Cw1hajhU.mjs.map → ProfileScreen-3ki8yPFt.mjs.map} +1 -1
  53. package/dist/{ProfileScreen-BP5KEyW0.mjs → ProfileScreen-DY5leCsw.mjs} +12 -12
  54. package/dist/{ProfileScreen-Ba8B0_Bm.cjs → ProfileScreen-G3cmyl0b.cjs} +3 -3
  55. package/dist/{ProfileScreen-Ba8B0_Bm.cjs.map → ProfileScreen-G3cmyl0b.cjs.map} +1 -1
  56. package/dist/{ProfileScreen-BAbxbpdQ.cjs → ProfileScreen-ouDvR1F7.cjs} +12 -12
  57. package/dist/{ShopWidget-jQ-osGyn.mjs → ShopWidget-BH0Pcepg.mjs} +6 -2
  58. package/dist/{ShopWidget-jQ-osGyn.mjs.map → ShopWidget-BH0Pcepg.mjs.map} +1 -1
  59. package/dist/{ShopWidget-Dc3fH_tP.cjs → ShopWidget-RfF5ZRv2.cjs} +6 -2
  60. package/dist/{ShopWidget-Dc3fH_tP.cjs.map → ShopWidget-RfF5ZRv2.cjs.map} +1 -1
  61. package/dist/{ShopWidget-gc_BbyrJ.cjs → ShopWidget-ecp3h54J.cjs} +1 -1
  62. package/dist/{SubscriptionsScreen-BscwpAw8.cjs → SubscriptionsScreen-BiNmEFLP.cjs} +4 -4
  63. package/dist/{SubscriptionsScreen-BscwpAw8.cjs.map → SubscriptionsScreen-BiNmEFLP.cjs.map} +1 -1
  64. package/dist/{SubscriptionsScreen-D2uyJGIE.mjs → SubscriptionsScreen-NCU2I079.mjs} +4 -4
  65. package/dist/{SubscriptionsScreen-D2uyJGIE.mjs.map → SubscriptionsScreen-NCU2I079.mjs.map} +1 -1
  66. package/dist/{SubscriptionsScreen-Nfbt2u5r.cjs → SubscriptionsScreen-cuw6yk56.cjs} +12 -12
  67. package/dist/{SubscriptionsScreen-DU5AKlfR.mjs → SubscriptionsScreen-fv_xxA9j.mjs} +12 -12
  68. package/dist/{TableWidget-B4rGem0e.cjs → TableWidget-B8axD206.cjs} +1 -1
  69. package/dist/{TableWidget-LolaiYXA.mjs → TableWidget-C861T_Ac.mjs} +8 -1
  70. package/dist/{TableWidget-LolaiYXA.mjs.map → TableWidget-C861T_Ac.mjs.map} +1 -1
  71. package/dist/{TableWidget-Dfzx5jaI.cjs → TableWidget-CAgARK2Y.cjs} +8 -1
  72. package/dist/{TableWidget-Dfzx5jaI.cjs.map → TableWidget-CAgARK2Y.cjs.map} +1 -1
  73. package/dist/build-remote-widget-plugin-manifests-BDGS5t6k.d.mts +87 -0
  74. package/dist/build-remote-widget-plugin-manifests-BDGS5t6k.d.mts.map +1 -0
  75. package/dist/build-remote-widget-plugin-manifests-BS2FjZRV.d.cts +87 -0
  76. package/dist/build-remote-widget-plugin-manifests-BS2FjZRV.d.cts.map +1 -0
  77. package/dist/{build-widget-registry-BwiPIMcu.d.mts → build-widget-registry-ByUJk3-B.d.mts} +2 -2
  78. package/dist/{build-widget-registry-BwiPIMcu.d.mts.map → build-widget-registry-ByUJk3-B.d.mts.map} +1 -1
  79. package/dist/{build-widget-registry-BmU54VJb.cjs → build-widget-registry-CCmtBo8w.cjs} +17 -17
  80. package/dist/build-widget-registry-CCmtBo8w.cjs.map +1 -0
  81. package/dist/{build-widget-registry-DSE7CmVe.d.cts → build-widget-registry-Dsp9P8gq.d.cts} +2 -2
  82. package/dist/{build-widget-registry-DSE7CmVe.d.cts.map → build-widget-registry-Dsp9P8gq.d.cts.map} +1 -1
  83. package/dist/{build-widget-registry-Bimd6Pxq.mjs → build-widget-registry-DvCtfn9d.mjs} +17 -17
  84. package/dist/build-widget-registry-DvCtfn9d.mjs.map +1 -0
  85. package/dist/index.cjs +29 -24
  86. package/dist/index.cjs.map +1 -1
  87. package/dist/index.d.cts +40 -13
  88. package/dist/index.d.cts.map +1 -1
  89. package/dist/index.d.mts +40 -13
  90. package/dist/index.d.mts.map +1 -1
  91. package/dist/index.mjs +29 -24
  92. package/dist/index.mjs.map +1 -1
  93. package/dist/{link-type-schema-fields-DJBFdG7t.mjs → link-type-schema-fields-CncR6GKa.mjs} +3 -1
  94. package/dist/link-type-schema-fields-CncR6GKa.mjs.map +1 -0
  95. package/dist/{link-type-schema-fields-CQXXgSqn.cjs → link-type-schema-fields-DvSzjbwD.cjs} +3 -1
  96. package/dist/link-type-schema-fields-DvSzjbwD.cjs.map +1 -0
  97. package/dist/{build-remote-widget-plugin-manifests-CFmLot7p.d.cts → portal-function-DYWFgeRx.d.cts} +826 -796
  98. package/dist/portal-function-DYWFgeRx.d.cts.map +1 -0
  99. package/dist/{build-remote-widget-plugin-manifests-BsgLYqar.d.mts → portal-function-DgqXwF13.d.mts} +932 -902
  100. package/dist/portal-function-DgqXwF13.d.mts.map +1 -0
  101. package/dist/registries-DgzzKX8_.cjs.map +1 -1
  102. package/dist/registries-Dvq4M6wO.mjs.map +1 -1
  103. package/dist/{use-portal-card-add-3ds-flow-BE4p2zYl.cjs → use-portal-card-add-3ds-flow-CRiGY6e0.cjs} +3 -3
  104. package/dist/{use-portal-card-add-3ds-flow-BE4p2zYl.cjs.map → use-portal-card-add-3ds-flow-CRiGY6e0.cjs.map} +1 -1
  105. package/dist/{use-portal-card-add-3ds-flow-DzhPOYGn.mjs → use-portal-card-add-3ds-flow-DjeKiZvQ.mjs} +3 -3
  106. package/dist/{use-portal-card-add-3ds-flow-DzhPOYGn.mjs.map → use-portal-card-add-3ds-flow-DjeKiZvQ.mjs.map} +1 -1
  107. package/dist/utils/build-remote-widget-plugin-manifests.cjs +9 -9
  108. package/dist/utils/build-remote-widget-plugin-manifests.d.cts +1 -1
  109. package/dist/utils/build-remote-widget-plugin-manifests.d.mts +1 -1
  110. package/dist/utils/build-remote-widget-plugin-manifests.mjs +9 -9
  111. package/dist/utils/build-widget-registry.cjs +9 -9
  112. package/dist/utils/build-widget-registry.d.cts +1 -1
  113. package/dist/utils/build-widget-registry.d.mts +1 -1
  114. package/dist/utils/build-widget-registry.mjs +9 -9
  115. package/dist/widgets/worker.cjs +20 -1
  116. package/dist/widgets/worker.cjs.map +1 -1
  117. package/dist/widgets/worker.d.cts +67 -4
  118. package/dist/widgets/worker.d.cts.map +1 -1
  119. package/dist/widgets/worker.d.mts +67 -4
  120. package/dist/widgets/worker.d.mts.map +1 -1
  121. package/dist/widgets/worker.mjs +20 -1
  122. package/dist/widgets/worker.mjs.map +1 -1
  123. package/package.json +18 -17
  124. package/dist/LinkWidget-C3HRFueg.mjs.map +0 -1
  125. package/dist/LinkWidget-DRMzQhQz.cjs.map +0 -1
  126. package/dist/build-remote-widget-plugin-manifests-BsgLYqar.d.mts.map +0 -1
  127. package/dist/build-remote-widget-plugin-manifests-CFmLot7p.d.cts.map +0 -1
  128. package/dist/build-widget-registry-Bimd6Pxq.mjs.map +0 -1
  129. package/dist/build-widget-registry-BmU54VJb.cjs.map +0 -1
  130. package/dist/link-type-schema-fields-CQXXgSqn.cjs.map +0 -1
  131. package/dist/link-type-schema-fields-DJBFdG7t.mjs.map +0 -1
  132. package/dist/portal-function-85qUlAVz.d.mts +0 -76
  133. package/dist/portal-function-85qUlAVz.d.mts.map +0 -1
  134. package/dist/portal-function-CW3U6P5p.d.cts +0 -76
  135. package/dist/portal-function-CW3U6P5p.d.cts.map +0 -1
@@ -1,7 +1,6 @@
1
- import { m as RemoteDomWidgetPackageDescriptor } from "./portal-function-CW3U6P5p.cjs";
2
- import { r as WidgetRegistryWarningSink, t as RemoteDomWidgetRegistryOptions } from "./build-widget-registry-DSE7CmVe.cjs";
3
- import Color from "colorjs.io";
4
1
  import { LucideIcon } from "lucide-react";
2
+ import Color from "colorjs.io";
3
+ import { RemoteDomSerializableValue } from "@fluid-app/widget-runtime/worker";
5
4
 
6
5
  //#region ../core/src/data-sources/types.d.ts
7
6
  type StaticSourceType = "collections" | "categories" | "tags";
@@ -116,939 +115,970 @@ interface DataSourceConfig {
116
115
  };
117
116
  }
118
117
  //#endregion
119
- //#region ../core/src/remote-widget-network-access.d.ts
120
- interface RemoteWidgetNetworkAccessGrant {
121
- readonly packageId: string;
122
- readonly packageVersion: string;
123
- readonly capabilityVersion: string;
124
- }
125
- interface RemoteWidgetCapabilityGrants {
126
- readonly networkAccess?: RemoteWidgetNetworkAccessGrant;
127
- }
128
- //#endregion
129
- //#region ../core/src/types/widget-schema.d.ts
118
+ //#region ../core/src/registries/property-schema-types.d.ts
130
119
  /**
131
- * Generic component type — avoids React dependency in core.
132
- * Accepts both function components and class component constructors.
120
+ * Tab configuration for organizing properties
133
121
  */
134
- type AnyComponent = ((props: any) => any) | (new (props: any) => any);
122
+ interface TabConfig {
123
+ /** Unique identifier for the tab */
124
+ id: string;
125
+ /** Display label for the tab */
126
+ label: string;
127
+ }
135
128
  /**
136
- * Widget type names as a const object.
137
- * This serves as the single source of truth for widget discriminants.
138
- * Use `as const` for literal type inference (safety-as-const-deep-readonly rule).
129
+ * Property field type constant - single source of truth for field types.
130
+ * Use PROPERTY_FIELD_TYPES.text instead of "text" for type-safe comparisons.
139
131
  */
140
- declare const WIDGET_TYPE_NAMES: {
141
- readonly Alert: "AlertWidget";
142
- readonly BulletList: "BulletListWidget";
143
- readonly Calendar: "CalendarWidget";
144
- readonly Card: "CardWidget";
145
- readonly Carousel: "CarouselWidget";
146
- readonly CatchUp: "CatchUpWidget";
147
- readonly Chart: "ChartWidget";
148
- readonly Container: "ContainerWidget";
149
- readonly Embed: "EmbedWidget";
150
- readonly Image: "ImageWidget";
151
- readonly Layout: "LayoutWidget";
152
- readonly Link: "LinkWidget";
153
- readonly List: "ListWidget";
154
- readonly MySite: "MySiteWidget";
155
- readonly Nested: "NestedWidget";
156
- readonly Points: "PointsWidget";
157
- readonly QuickLinks: "QuickLinksWidget";
158
- readonly QuickShare: "QuickShareWidget";
159
- readonly RecentActivity: "RecentActivityWidget";
160
- readonly Separator: "SeparatorWidget";
161
- readonly Shop: "ShopWidget";
162
- readonly Spacer: "SpacerWidget";
163
- readonly Table: "TableWidget";
164
- readonly Text: "TextWidget";
165
- readonly ToDo: "ToDoWidget";
166
- readonly Video: "VideoWidget";
132
+ declare const PROPERTY_FIELD_TYPES: {
133
+ readonly text: "text";
134
+ readonly textarea: "textarea";
135
+ readonly number: "number";
136
+ readonly boolean: "boolean";
137
+ readonly select: "select"; /** @deprecated Use `colorSelect` for semantic portal-theme colors. */
138
+ readonly color: "color";
139
+ readonly range: "range";
140
+ readonly dataSource: "dataSource";
141
+ readonly resource: "resource";
142
+ readonly image: "image";
143
+ readonly alignment: "alignment";
144
+ readonly slider: "slider";
145
+ readonly colorPicker: "colorPicker";
146
+ readonly sectionHeader: "sectionHeader";
147
+ readonly separator: "separator";
148
+ readonly buttonGroup: "buttonGroup";
149
+ readonly colorSelect: "colorSelect";
150
+ readonly sectionLayoutSelect: "sectionLayoutSelect";
151
+ readonly background: "background";
152
+ readonly contentPosition: "contentPosition";
153
+ readonly textSizeSelect: "textSizeSelect";
154
+ readonly cssUnit: "cssUnit";
155
+ readonly fontPicker: "fontPicker";
156
+ readonly stringArray: "stringArray";
157
+ readonly borderRadius: "borderRadius";
158
+ readonly screenPicker: "screenPicker";
167
159
  };
168
160
  /**
169
- * Union of all known widget type names.
170
- * Derived from WIDGET_TYPE_NAMES to avoid duplication (deriving-typeof-for-object-keys rule).
161
+ * Union type of all property field types, derived from PROPERTY_FIELD_TYPES constant.
162
+ * @see deriving-typeof-for-object-keys pattern
171
163
  */
172
- type WidgetTypeName = (typeof WIDGET_TYPE_NAMES)[keyof typeof WIDGET_TYPE_NAMES];
164
+ type PropertyFieldType = (typeof PROPERTY_FIELD_TYPES)[keyof typeof PROPERTY_FIELD_TYPES];
173
165
  /**
174
- * Legacy alias for backwards compatibility.
175
- * Prefer using WidgetTypeName for new code when you need the union type.
166
+ * Runtime validation for property field types.
167
+ * @param value - The value to check
168
+ * @returns true if value is a valid PropertyFieldType
176
169
  */
177
- type WidgetType = string;
178
- type WidgetRegistry = Record<WidgetType, AnyComponent>;
170
+ declare function isPropertyFieldType(value: string): value is PropertyFieldType;
179
171
  /**
180
- * Base widget schema with loose typing for runtime data.
181
- * Use TypedWidgetSchema<T> when you have a known registry for better type safety.
172
+ * Base schema for a property field
182
173
  */
183
- type WidgetSchema = {
184
- readonly type: WidgetType;
185
- readonly props: Readonly<Record<string, unknown>>;
186
- readonly id?: string; /** Optional data source configuration for data-bound widgets */
187
- readonly dataSource?: DataSourceConfig | undefined; /** Column index for masonry layouts (0-indexed) */
188
- readonly columnIndex?: number; /** Host-approved capabilities for a specific remote widget package version. */
189
- readonly capabilityGrants?: RemoteWidgetCapabilityGrants;
190
- };
174
+ interface PropertyFieldSchema {
175
+ /** Property key in the widget props */
176
+ key: string;
177
+ /** Display label for the field */
178
+ label: string;
179
+ /** Field type determines the input control */
180
+ type: PropertyFieldType;
181
+ /** Optional description/help text */
182
+ description?: string;
183
+ /** Optional default value */
184
+ defaultValue?: unknown;
185
+ /** Optional tab ID (must match a TabConfig id if widget has tabsConfig) */
186
+ tab?: string;
187
+ /** Optional group for organizing fields within a tab */
188
+ group?: string;
189
+ /**
190
+ * When true, this field is treated as an override of a value that can
191
+ * otherwise be inherited from the active theme (e.g. border radius,
192
+ * padding, border width). Advanced fields are automatically bucketed
193
+ * into the `CUSTOM_STYLING_GROUP` at the bottom of their tab and
194
+ * rendered collapsed by default so the default surface area stays
195
+ * minimal.
196
+ */
197
+ advanced?: boolean;
198
+ /**
199
+ * @deprecated Use requiresKeyValue instead
200
+ */
201
+ requiresKeyToBeTrue?: string;
202
+ /** Optional requires a specific key to have a specific value. Supports single condition or array (AND logic). */
203
+ requiresKeyValue?: {
204
+ key: string;
205
+ value: unknown;
206
+ } | Array<{
207
+ key: string;
208
+ value: unknown;
209
+ }>;
210
+ }
191
211
  /**
192
- * Type-safe widget schema based on registry.
193
- * Uses discriminated unions - the `type` field serves as discriminant.
194
- * When narrowed (e.g., `if (widget.type === "AlertWidget")`),
195
- * TypeScript automatically knows the correct props type.
212
+ * Text field schema
196
213
  */
197
- type TypedWidgetSchema<T extends Record<string, AnyComponent>> = { [K in keyof T]: {
198
- readonly type: K;
199
- readonly props: Readonly<T[K] extends ((props: infer P) => any) ? P : T[K] extends (new (props: infer P) => any) ? P : never>;
200
- readonly id?: string;
201
- readonly dataSource?: DataSourceConfig | undefined; /** Column index for masonry layouts (0-indexed) */
202
- readonly columnIndex?: number;
203
- readonly capabilityGrants?: RemoteWidgetCapabilityGrants;
204
- } }[keyof T];
214
+ interface TextFieldSchema extends PropertyFieldSchema {
215
+ type: "text";
216
+ placeholder?: string;
217
+ maxLength?: number;
218
+ /**
219
+ * Optional quick-insert chips rendered below the input. Clicking a chip
220
+ * inserts `{{value}}` at the caret. Used for URL template tokens
221
+ * (e.g. `{{username}}`, `{{replicated_url || /signup}}`) so admins
222
+ * don't have to remember the exact spelling.
223
+ */
224
+ tokenSuggestions?: ReadonlyArray<{
225
+ /** Chip label shown to the admin (e.g. `username`). */label: string; /** Token body inserted between `{{` and `}}` (e.g. `username || /signup`). */
226
+ value: string;
227
+ }>;
228
+ }
205
229
  /**
206
- * Widget path in the tree - array of indices.
207
- * Readonly tuple to prevent accidental mutation.
230
+ * Textarea field schema
208
231
  */
209
- type WidgetPath = readonly number[];
232
+ interface TextareaFieldSchema extends PropertyFieldSchema {
233
+ type: "textarea";
234
+ placeholder?: string;
235
+ rows?: number;
236
+ maxLength?: number;
237
+ }
210
238
  /**
211
- * Type predicate to check if a string is a known widget type name.
212
- * Use for runtime validation of widget types.
213
- *
214
- * @example
215
- * if (isWidgetTypeName(widget.type)) {
216
- * // TypeScript knows widget.type is WidgetTypeName
217
- * }
239
+ * Number field schema
218
240
  */
219
- declare function isWidgetTypeName(type: string): type is WidgetTypeName;
241
+ interface NumberFieldSchema extends PropertyFieldSchema {
242
+ type: "number";
243
+ min?: number;
244
+ max?: number;
245
+ step?: number;
246
+ }
220
247
  /**
221
- * Type predicate to check if a widget has a specific type.
222
- * Enables type-safe widget narrowing without `as` assertions.
223
- *
224
- * @example
225
- * if (isWidgetType(widget, "LayoutWidget")) {
226
- * // TypeScript knows widget.type === "LayoutWidget"
227
- * // and widget.props is LayoutWidget props
228
- * }
248
+ * Boolean field schema
229
249
  */
230
- declare function isWidgetType<T extends WidgetTypeName>(widget: WidgetSchema | null | undefined, typeName: T): widget is WidgetSchema & {
231
- readonly type: T;
232
- };
250
+ interface BooleanFieldSchema extends PropertyFieldSchema {
251
+ type: "boolean";
252
+ }
233
253
  /**
234
- * Helper for exhaustive switch statements on widget types.
235
- * Use in the default case to ensure all widget types are handled.
236
- *
237
- * @example
238
- * switch (widget.type) {
239
- * case "AlertWidget": return handleAlert();
240
- * case "TextWidget": return handleText();
241
- * // ... all other widget types
242
- * default: return assertNever(widget.type, "widget type");
243
- * }
254
+ * Select field schema with type-safe option values.
255
+ * Uses StrictOmit to ensure "defaultValue" key exists on PropertyFieldSchema.
244
256
  */
245
- declare function assertNever(value: never, context?: string): never;
257
+ interface SelectFieldSchema<T extends string | number = string | number> extends StrictOmit<PropertyFieldSchema, "defaultValue"> {
258
+ type: "select";
259
+ options: Array<{
260
+ label: string;
261
+ value: T;
262
+ }>;
263
+ defaultValue?: T;
264
+ }
246
265
  /**
247
- * Assertion function that throws if value is undefined.
248
- * Narrows the type to exclude undefined.
266
+ * Legacy free-form color field schema.
249
267
  *
250
- * @example
251
- * const widget = screen[0];
252
- * assertDefined(widget, "widget at index 0");
253
- * // TypeScript knows widget is defined here
268
+ * @deprecated Use {@link ColorSelectFieldSchema} (`type: "colorSelect"`) so
269
+ * widget authors select a semantic color token supplied by the portal theme.
254
270
  */
255
- declare function assertDefined<T>(value: T | undefined | null, name?: string): asserts value is T;
256
- //#endregion
257
- //#region ../../platform/theme-engine/src/types.d.ts
258
- declare const SEMANTIC_COLOR_NAMES: readonly ["background", "foreground", "primary", "secondary", "accent", "muted", "destructive"];
259
- type SemanticColorName = (typeof SEMANTIC_COLOR_NAMES)[number];
260
- declare const FONT_SIZE_KEYS: readonly ["extraSmall", "small", "regular", "large", "extraLarge", "giant"];
261
- type FontSizeKey = (typeof FONT_SIZE_KEYS)[number];
262
- declare const FONT_FAMILY_KEYS: readonly ["header", "body"];
263
- type FontFamilyKey = (typeof FONT_FAMILY_KEYS)[number];
264
- declare const RADIUS_KEYS: readonly ["small", "medium", "large", "extraLarge"];
265
- type RadiusKey = (typeof RADIUS_KEYS)[number];
266
- /** Author-time color input (what the user configures) */
267
- interface ThemeColorInput {
268
- base: Color;
269
- foreground: Color;
271
+ interface ColorFieldSchema extends PropertyFieldSchema {
272
+ type: "color";
270
273
  }
271
- /** Complete theme definition — stored in-memory with Color objects */
272
- interface ThemeDefinition {
273
- id: string;
274
- name: string;
275
- /** Light mode — always fully specified */
276
- light: Record<SemanticColorName, ThemeColorInput>;
277
- /**
278
- * Dark mode — only user-overridden colors.
279
- * Missing keys are auto-derived from `light` at resolve time.
280
- */
281
- dark: Partial<Record<SemanticColorName, Partial<ThemeColorInput>>>;
282
- fontSizes: Record<FontSizeKey, string>;
283
- fontFamilies: Record<FontFamilyKey, string>;
284
- spacing: string;
285
- radii: Record<RadiusKey, string>;
286
- /** When true, theme colors are re-derived from brand guidelines on every load */
287
- syncWithBrandColors?: boolean;
274
+ /**
275
+ * Range slider field schema
276
+ */
277
+ interface RangeFieldSchema extends PropertyFieldSchema {
278
+ type: "range";
279
+ min: number;
280
+ max: number;
281
+ step?: number;
288
282
  }
289
- /** Resolved semantic color */
290
- interface ResolvedSemanticColor {
291
- base: Color;
292
- foreground: Color;
283
+ /**
284
+ * Data source field schema for configuring widget data sources
285
+ */
286
+ interface DataSourceFieldSchema extends PropertyFieldSchema {
287
+ /** Identifies this field as the data-source editor. */
288
+ type: "dataSource";
289
+ /** Widget props that this data-source editor can populate. */
290
+ targetProps?: ReadonlyArray<{
291
+ /** Widget prop key populated with the resolved data-source result. */key: string; /** Description emitted for this prop in the portal JSON Schema and types. */
292
+ description: string;
293
+ }>;
293
294
  }
294
- /** Complete resolved color set for one mode */
295
- type ResolvedColorSet = Record<SemanticColorName, ResolvedSemanticColor>;
296
- /** Fully resolved theme — all colors materialised for both modes */
297
- interface ResolvedTheme {
298
- id: string;
299
- name: string;
300
- light: ResolvedColorSet;
301
- dark: ResolvedColorSet;
302
- fontSizes: ThemeDefinition["fontSizes"];
303
- fontFamilies: ThemeDefinition["fontFamilies"];
304
- spacing: string;
305
- radii: ThemeDefinition["radii"];
295
+ /**
296
+ * Resource field schema for selecting a single resource from the selection modal
297
+ */
298
+ interface ResourceFieldSchema extends PropertyFieldSchema {
299
+ type: "resource";
300
+ /** Optional filter to specific shareable types */
301
+ allowedTypes?: string[];
306
302
  }
307
- /** Plain OKLCH triplet for JSON serialisation (no Color dependency) */
308
- interface OklchPlain {
309
- l: number;
310
- c: number;
311
- h: number;
303
+ /**
304
+ * Image field schema for selecting a single asset (image or video) from the
305
+ * image picker. Despite the legacy "image" name, this field supports video
306
+ * picking via the `accept` parameter — `VideoWidget`, `ListWidget` Featured
307
+ * Asset, and `NestedWidget` Primary Media all use it for video-or-mixed
308
+ * content.
309
+ */
310
+ interface ImageFieldSchema extends PropertyFieldSchema {
311
+ type: "image";
312
+ /**
313
+ * Restricts which MIME categories the picker offers. Defaults to "image".
314
+ */
315
+ accept?: "image" | "video" | "any";
312
316
  }
313
- /** Serialised color pair as stored in the backend payload */
314
- interface ThemeColorPlain {
315
- base: OklchPlain;
316
- foreground: OklchPlain;
317
+ /**
318
+ * Alignment field schema
319
+ */
320
+ interface AlignmentFieldSchema extends PropertyFieldSchema {
321
+ type: "alignment";
322
+ options: {
323
+ verticalEnabled: boolean;
324
+ horizontalEnabled: boolean;
325
+ };
326
+ defaultValue?: AlignOptions;
317
327
  }
318
- /** Backend payload — plain JSON, no Color objects */
319
- interface ThemePayload {
320
- [key: string]: unknown;
321
- id: string;
322
- name: string;
323
- light: Record<SemanticColorName, ThemeColorPlain>;
324
- dark: Partial<Record<SemanticColorName, {
325
- base?: OklchPlain;
326
- foreground?: OklchPlain;
327
- }>>;
328
- fontSizes: Record<FontSizeKey, string>;
329
- fontFamilies: Record<FontFamilyKey, string>;
330
- spacing: string;
331
- radii: Record<RadiusKey, string>;
332
- syncWithBrandColors?: boolean;
328
+ /**
329
+ * Slider field schema with optional unit suffix (e.g., "rem", "px")
330
+ */
331
+ interface SliderFieldSchema extends PropertyFieldSchema {
332
+ type: "slider";
333
+ min: number;
334
+ max: number;
335
+ step?: number;
336
+ unit?: string;
333
337
  }
334
- //#endregion
335
- //#region ../core/src/types/navigation.d.ts
336
338
  /**
337
- * Navigation item in the sidebar/menu structure.
338
- *
339
- * Field types match the FluidOS API schema (`FluidOSNavigationItem`).
340
- * Differences from the raw API type:
341
- * - `id` is optional (system/default items may not have one)
342
- * - `label` is required (transforms default null to "Untitled")
343
- * - `section` is a frontend-only extension (not in API)
344
- * - Nullable fields use `undefined` instead of `null` (except `parent_id`)
339
+ * Color picker field schema with optional swatches
345
340
  */
346
- interface NavigationItem {
347
- /** Database-generated identifier — optional because system/default items may not have one */
348
- readonly id?: number;
349
- /** URL slug for routing (`| undefined` for exactOptionalPropertyTypes compat) */
350
- slug?: string | undefined;
351
- /** Display label — required; transforms default null API values to "Untitled" */
352
- label: string;
353
- /** Icon identifier (e.g., FontAwesome name) */
354
- icon?: string | undefined;
355
- /** Section grouping for quick links (frontend-only, not in API) */
356
- section?: string;
357
- /** Associated screen ID */
358
- screen_id?: number | undefined;
359
- /** Sort order */
360
- position?: number | undefined;
361
- /** Parent navigation item ID (null for root items) */
362
- parent_id?: number | null;
363
- /** Origin of this navigation item */
364
- source?: "user" | "system" | "code";
365
- /** Nested navigation items */
366
- children: NavigationItem[];
341
+ interface ColorPickerFieldSchema extends PropertyFieldSchema {
342
+ type: "colorPicker";
343
+ swatches?: string[];
367
344
  }
368
345
  /**
369
- * Screen definition with its component tree
346
+ * Section header field schema for visual grouping
370
347
  */
371
- interface ScreenDefinition {
372
- readonly id: number;
373
- slug: string;
374
- name: string;
375
- component_tree: WidgetSchema[];
348
+ interface SectionHeaderFieldSchema extends PropertyFieldSchema {
349
+ type: "sectionHeader";
350
+ subtitle?: string;
376
351
  }
377
352
  /**
378
- * Navigation configuration for the portal
353
+ * Separator field schema for visual separation
379
354
  */
380
- interface Navigation {
381
- readonly definition_id: number;
382
- readonly id: number;
383
- name: string;
384
- navigation_items: NavigationItem[];
385
- screens: ScreenDefinition[];
355
+ interface SeparatorFieldSchema extends PropertyFieldSchema {
356
+ type: "separator";
386
357
  }
387
- /** A portal app profile — themes, navigation, and definition reference. */
388
- interface RepAppProfile {
389
- name: string;
390
- themes: ThemeDefinition[];
391
- activeThemeId?: string;
392
- navigation: Navigation;
393
- mobile_navigation?: Navigation;
394
- definition_id: number;
358
+ /**
359
+ * Button group field schema.
360
+ * Uses StrictOmit to ensure "defaultValue" key exists on PropertyFieldSchema.
361
+ */
362
+ interface ButtonGroupFieldSchema<T extends string | number = string | number> extends StrictOmit<PropertyFieldSchema, "defaultValue"> {
363
+ type: "buttonGroup";
364
+ options: Array<{
365
+ label?: string;
366
+ ariaLabel?: string;
367
+ icon?: LucideIcon;
368
+ value: T;
369
+ }>;
370
+ defaultValue?: T;
395
371
  }
396
- /** Full portal app data returned by the fluidos API or builder preview. */
397
- interface RepAppData {
398
- definition_id: number;
399
- published_version: number;
400
- screens: ScreenDefinition[];
401
- profile: RepAppProfile;
372
+ /**
373
+ * Semantic theme-color token selector. Prefer this field over free-form color
374
+ * controls so widgets continue to work across portal themes and color modes.
375
+ */
376
+ interface ColorSelectFieldSchema extends PropertyFieldSchema {
377
+ type: "colorSelect";
378
+ defaultValue?: ColorOptions;
379
+ excludeColors?: ColorOptions[];
402
380
  }
403
- /** Wrapper for the `/fluid_os/definitions/active` API response. */
404
- interface RepAppManifest {
405
- manifest: RepAppData;
381
+ /**
382
+ * Section layout select field schema for visual masonry layout selector
383
+ */
384
+ interface SectionLayoutSelectFieldSchema extends PropertyFieldSchema {
385
+ type: "sectionLayoutSelect";
386
+ defaultValue?: SectionLayoutType;
406
387
  }
407
- //#endregion
408
- //#region ../core/src/types/shareable-item.d.ts
409
388
  /**
410
- * Base props for a shareable item.
411
- * Uses structural typing to be compatible with various modal implementations.
412
- * The index signature allows additional properties from consuming apps.
389
+ * Background field combines resource selection and color properties.
390
+ * Uses StrictOmit to exclude conflicting "type" discriminant from parents.
413
391
  */
414
- interface ShareableItem {
415
- id: string | number;
416
- title?: string | null;
417
- image_url?: string | null;
418
- imageUrl?: string | null;
419
- kind?: string | null;
420
- type?: string | null;
421
- shareableType?: string | null;
422
- share_link?: string | null;
423
- videoUrl?: string;
424
- price?: string | number | null;
425
- display_price?: string | null;
426
- [key: string]: unknown;
392
+ interface BackgroundFieldSchema extends StrictOmit<ResourceFieldSchema, "type">, StrictOmit<ColorFieldSchema, "type"> {
393
+ type: "background";
427
394
  }
428
- //#endregion
429
- //#region ../core/src/types/field-types.d.ts
430
395
  /**
431
- * Color options constant - single source of truth for color values.
432
- * Use COLOR_OPTIONS.primary instead of "primary" for type-safe comparisons.
396
+ * Content position field schema for 3x3 grid position picker
433
397
  */
434
- declare const COLOR_OPTIONS: {
435
- readonly background: "background";
436
- readonly foreground: "foreground";
437
- readonly primary: "primary";
438
- readonly secondary: "secondary";
439
- readonly accent: "accent";
440
- readonly muted: "muted";
441
- readonly border: "border";
442
- readonly destructive: "destructive";
443
- readonly transparent: "transparent";
444
- };
398
+ interface ContentPositionFieldSchema extends PropertyFieldSchema {
399
+ type: "contentPosition";
400
+ defaultValue?: string;
401
+ }
445
402
  /**
446
- * Union type of all color options, derived from COLOR_OPTIONS constant.
447
- * @see deriving-typeof-for-object-keys pattern
403
+ * Text size select field schema for visual font size selector
448
404
  */
449
- type ColorOptions = (typeof COLOR_OPTIONS)[keyof typeof COLOR_OPTIONS];
450
- declare const FONT_SIZE_OPTIONS: {
451
- readonly "2xl": "2xl";
452
- readonly xl: "xl";
453
- readonly lg: "lg";
454
- readonly md: "md";
455
- readonly sm: "sm";
456
- readonly xs: "xs";
457
- };
458
- type FontSizeOptions = (typeof FONT_SIZE_OPTIONS)[keyof typeof FONT_SIZE_OPTIONS];
459
- declare const FONT_WEIGHT_OPTIONS: {
460
- readonly normal: "normal";
461
- readonly medium: "medium";
462
- readonly semibold: "semibold";
463
- readonly bold: "bold";
464
- };
465
- type FontWeightOptions = (typeof FONT_WEIGHT_OPTIONS)[keyof typeof FONT_WEIGHT_OPTIONS];
466
- declare const BORDER_RADIUS_OPTIONS: {
467
- readonly none: "none";
468
- readonly sm: "sm";
469
- readonly md: "md";
470
- readonly lg: "lg";
471
- readonly xl: "xl";
472
- readonly full: "full";
473
- };
474
- type BorderRadiusOptions = (typeof BORDER_RADIUS_OPTIONS)[keyof typeof BORDER_RADIUS_OPTIONS];
475
- declare const BORDER_WIDTH_OPTIONS: {
476
- readonly none: "none";
477
- readonly thin: "thin";
478
- readonly medium: "medium";
479
- readonly thick: "thick";
480
- };
481
- type BorderWidthOptions = (typeof BORDER_WIDTH_OPTIONS)[keyof typeof BORDER_WIDTH_OPTIONS];
482
- /** Padding values - numeric, so we use a tuple for derivation */
483
- declare const PADDING_VALUES: readonly [0, 2, 4, 6, 8, 10];
484
- type PaddingOptions = (typeof PADDING_VALUES)[number];
485
- declare const BUTTON_SIZE_OPTIONS: {
486
- readonly sm: "sm";
487
- readonly default: "default";
488
- readonly lg: "lg";
489
- readonly xl: "xl";
490
- };
491
- type ButtonSizeOptions = (typeof BUTTON_SIZE_OPTIONS)[keyof typeof BUTTON_SIZE_OPTIONS];
492
- declare const GAP_OPTIONS: {
493
- readonly none: "none";
494
- readonly xs: "xs";
495
- readonly sm: "sm";
496
- readonly md: "md";
497
- readonly lg: "lg";
498
- readonly xl: "xl";
499
- };
500
- type GapOptions = (typeof GAP_OPTIONS)[keyof typeof GAP_OPTIONS];
501
- declare const VERTICAL_ALIGN_OPTIONS: {
502
- readonly top: "top";
503
- readonly center: "center";
504
- readonly bottom: "bottom";
505
- };
506
- type VerticalAlign = (typeof VERTICAL_ALIGN_OPTIONS)[keyof typeof VERTICAL_ALIGN_OPTIONS];
507
- declare const HORIZONTAL_ALIGN_OPTIONS: {
508
- readonly left: "left";
509
- readonly center: "center";
510
- readonly right: "right";
511
- };
512
- type HorizontalAlign = (typeof HORIZONTAL_ALIGN_OPTIONS)[keyof typeof HORIZONTAL_ALIGN_OPTIONS];
513
- type AlignOptions = {
514
- vertical?: VerticalAlign;
515
- horizontal?: HorizontalAlign;
516
- };
517
- declare const BACKGROUND_TYPES: {
518
- readonly solid: "solid";
519
- readonly image: "image";
520
- };
521
- type BackgroundType = (typeof BACKGROUND_TYPES)[keyof typeof BACKGROUND_TYPES];
522
- interface BackgroundValue {
523
- type: BackgroundType;
524
- color?: ColorOptions;
525
- resource?: ShareableItem;
405
+ interface TextSizeSelectFieldSchema extends PropertyFieldSchema {
406
+ type: "textSizeSelect";
407
+ defaultValue?: FontSizeOptions;
526
408
  }
527
409
  /**
528
- * Section layout configuration - single source of truth for layout types.
529
- * SectionLayoutType is derived from these keys to prevent drift.
530
- */
531
- declare const SECTION_LAYOUT_CONFIG: {
532
- readonly "single-column": {
533
- readonly columns: 1;
534
- readonly widths: readonly ["1fr"];
535
- readonly gridClasses: "";
536
- };
537
- readonly "2c-equal": {
538
- readonly columns: 2;
539
- readonly widths: readonly ["1fr", "1fr"];
540
- readonly gridClasses: "@md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]";
541
- };
542
- readonly "2c-left-wider": {
543
- readonly columns: 2;
544
- readonly widths: readonly ["2fr", "1fr"];
545
- readonly gridClasses: "@md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]";
546
- };
547
- readonly "2c-right-wider": {
548
- readonly columns: 2;
549
- readonly widths: readonly ["1fr", "2fr"];
550
- readonly gridClasses: "@md:grid-cols-[minmax(0,1fr)_minmax(0,2fr)]";
551
- };
552
- readonly "2c-left-narrow": {
553
- readonly columns: 2;
554
- readonly widths: readonly ["1fr", "3fr"];
555
- readonly gridClasses: "@md:grid-cols-[minmax(0,1fr)_minmax(0,3fr)]";
556
- };
557
- readonly "2c-right-narrow": {
558
- readonly columns: 2;
559
- readonly widths: readonly ["3fr", "1fr"];
560
- readonly gridClasses: "@md:grid-cols-[minmax(0,3fr)_minmax(0,1fr)]";
561
- };
562
- readonly "3c-equal": {
563
- readonly columns: 3;
564
- readonly widths: readonly ["1fr", "1fr", "1fr"];
565
- readonly gridClasses: "@md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)]";
566
- };
567
- readonly "3c-middle-wider": {
568
- readonly columns: 3;
569
- readonly widths: readonly ["1fr", "2fr", "1fr"];
570
- readonly gridClasses: "@md:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_minmax(0,1fr)]";
571
- };
572
- };
573
- /**
574
- * Union type of all section layout types, derived from SECTION_LAYOUT_CONFIG keys.
575
- * @see deriving-typeof-for-object-keys pattern
410
+ * CSS unit type for height/width fields
576
411
  */
577
- type SectionLayoutType = keyof typeof SECTION_LAYOUT_CONFIG;
578
- /** @deprecated Use SECTION_LAYOUT_CONFIG instead */
579
- declare const sectionLayoutConfig: typeof SECTION_LAYOUT_CONFIG;
580
- //#endregion
581
- //#region ../core/src/types/index.d.ts
582
- type StrictOmit<T, K extends keyof T> = Omit<T, K>;
583
- //#endregion
584
- //#region ../core/src/registries/property-schema-types.d.ts
412
+ type CssUnit = "px" | "rem" | "vh" | "%";
585
413
  /**
586
- * Tab configuration for organizing properties
414
+ * CSS unit field schema for numeric values with selectable units (px, rem, vh, %)
587
415
  */
588
- interface TabConfig {
589
- /** Unique identifier for the tab */
590
- id: string;
591
- /** Display label for the tab */
592
- label: string;
416
+ interface CssUnitFieldSchema extends PropertyFieldSchema {
417
+ type: "cssUnit";
418
+ minByUnit?: Partial<Record<CssUnit, number>>;
419
+ maxByUnit?: Partial<Record<CssUnit, number>>;
420
+ stepByUnit?: Partial<Record<CssUnit, number>>;
421
+ allowedUnits?: CssUnit[];
422
+ defaultUnit?: CssUnit;
593
423
  }
594
424
  /**
595
- * Property field type constant - single source of truth for field types.
596
- * Use PROPERTY_FIELD_TYPES.text instead of "text" for type-safe comparisons.
597
- */
598
- declare const PROPERTY_FIELD_TYPES: {
599
- readonly text: "text";
600
- readonly textarea: "textarea";
601
- readonly number: "number";
602
- readonly boolean: "boolean";
603
- readonly select: "select";
604
- readonly color: "color";
605
- readonly range: "range";
606
- readonly dataSource: "dataSource";
607
- readonly resource: "resource";
608
- readonly image: "image";
609
- readonly alignment: "alignment";
610
- readonly slider: "slider";
611
- readonly colorPicker: "colorPicker";
612
- readonly sectionHeader: "sectionHeader";
613
- readonly separator: "separator";
614
- readonly buttonGroup: "buttonGroup";
615
- readonly colorSelect: "colorSelect";
616
- readonly sectionLayoutSelect: "sectionLayoutSelect";
617
- readonly background: "background";
618
- readonly contentPosition: "contentPosition";
619
- readonly textSizeSelect: "textSizeSelect";
620
- readonly cssUnit: "cssUnit";
621
- readonly fontPicker: "fontPicker";
622
- readonly stringArray: "stringArray";
623
- readonly borderRadius: "borderRadius";
624
- readonly screenPicker: "screenPicker";
625
- };
626
- /**
627
- * Union type of all property field types, derived from PROPERTY_FIELD_TYPES constant.
628
- * @see deriving-typeof-for-object-keys pattern
629
- */
630
- type PropertyFieldType = (typeof PROPERTY_FIELD_TYPES)[keyof typeof PROPERTY_FIELD_TYPES];
631
- /**
632
- * Runtime validation for property field types.
633
- * @param value - The value to check
634
- * @returns true if value is a valid PropertyFieldType
635
- */
636
- declare function isPropertyFieldType(value: string): value is PropertyFieldType;
637
- /**
638
- * Base schema for a property field
425
+ * Font picker field schema for Google Fonts selection
639
426
  */
640
- interface PropertyFieldSchema {
641
- /** Property key in the widget props */
642
- key: string;
643
- /** Display label for the field */
644
- label: string;
645
- /** Field type determines the input control */
646
- type: PropertyFieldType;
647
- /** Optional description/help text */
648
- description?: string;
649
- /** Optional default value */
650
- defaultValue?: unknown;
651
- /** Optional tab ID (must match a TabConfig id if widget has tabsConfig) */
652
- tab?: string;
653
- /** Optional group for organizing fields within a tab */
654
- group?: string;
655
- /**
656
- * When true, this field is treated as an override of a value that can
657
- * otherwise be inherited from the active theme (e.g. border radius,
658
- * padding, border width). Advanced fields are automatically bucketed
659
- * into the `CUSTOM_STYLING_GROUP` at the bottom of their tab and
660
- * rendered collapsed by default so the default surface area stays
661
- * minimal.
662
- */
663
- advanced?: boolean;
664
- /**
665
- * @deprecated Use requiresKeyValue instead
666
- */
667
- requiresKeyToBeTrue?: string;
668
- /** Optional requires a specific key to have a specific value. Supports single condition or array (AND logic). */
669
- requiresKeyValue?: {
670
- key: string;
671
- value: unknown;
672
- } | Array<{
673
- key: string;
674
- value: unknown;
675
- }>;
427
+ interface FontPickerFieldSchema extends PropertyFieldSchema {
428
+ type: "fontPicker";
429
+ placeholder?: string;
676
430
  }
677
431
  /**
678
- * Text field schema
432
+ * String array field schema for managing lists of text items
679
433
  */
680
- interface TextFieldSchema extends PropertyFieldSchema {
681
- type: "text";
434
+ interface StringArrayFieldSchema extends PropertyFieldSchema {
435
+ type: "stringArray";
682
436
  placeholder?: string;
683
- maxLength?: number;
684
- /**
685
- * Optional quick-insert chips rendered below the input. Clicking a chip
686
- * inserts `{{value}}` at the caret. Used for URL template tokens
687
- * (e.g. `{{username}}`, `{{replicated_url || /signup}}`) so admins
688
- * don't have to remember the exact spelling.
689
- */
690
- tokenSuggestions?: ReadonlyArray<{
691
- /** Chip label shown to the admin (e.g. `username`). */label: string; /** Token body inserted between `{{` and `}}` (e.g. `username || /signup`). */
692
- value: string;
693
- }>;
437
+ defaultValue?: string[];
694
438
  }
695
439
  /**
696
- * Textarea field schema
440
+ * Border radius composite field schema for controlling 4 corners with a single field.
441
+ * Maps to 4 individual widget prop keys (topLeft, topRight, bottomLeft, bottomRight).
697
442
  */
698
- interface TextareaFieldSchema extends PropertyFieldSchema {
699
- type: "textarea";
700
- placeholder?: string;
701
- rows?: number;
702
- maxLength?: number;
443
+ interface BorderRadiusFieldSchema extends PropertyFieldSchema {
444
+ type: "borderRadius";
445
+ keys: {
446
+ topLeft: string;
447
+ topRight: string;
448
+ bottomLeft: string;
449
+ bottomRight: string;
450
+ };
451
+ defaultValue?: BorderRadiusOptions;
703
452
  }
704
453
  /**
705
- * Number field schema
454
+ * Screen picker field schema for selecting a portal screen (navigation, system, or available)
706
455
  */
707
- interface NumberFieldSchema extends PropertyFieldSchema {
708
- type: "number";
709
- min?: number;
710
- max?: number;
711
- step?: number;
456
+ interface ScreenPickerFieldSchema extends PropertyFieldSchema {
457
+ type: "screenPicker";
458
+ /** Whether to include system navigation items in the picker */
459
+ includeSystemItems?: boolean;
712
460
  }
713
461
  /**
714
- * Boolean field schema
462
+ * Union of all field schema types
715
463
  */
716
- interface BooleanFieldSchema extends PropertyFieldSchema {
717
- type: "boolean";
718
- }
464
+ type PropertyField = TextFieldSchema | TextareaFieldSchema | NumberFieldSchema | BooleanFieldSchema | SelectFieldSchema<string | number> | ColorFieldSchema | RangeFieldSchema | DataSourceFieldSchema | ResourceFieldSchema | ImageFieldSchema | AlignmentFieldSchema | SliderFieldSchema | ColorPickerFieldSchema | SectionHeaderFieldSchema | SeparatorFieldSchema | ButtonGroupFieldSchema<string | number> | ColorSelectFieldSchema | SectionLayoutSelectFieldSchema | BackgroundFieldSchema | ContentPositionFieldSchema | TextSizeSelectFieldSchema | CssUnitFieldSchema | FontPickerFieldSchema | StringArrayFieldSchema | BorderRadiusFieldSchema | ScreenPickerFieldSchema;
719
465
  /**
720
- * Select field schema with type-safe option values.
721
- * Uses StrictOmit to ensure "defaultValue" key exists on PropertyFieldSchema.
466
+ * Schema for per-item configuration in custom data sources.
467
+ * Widgets can define this to allow users to configure widget-specific
468
+ * settings for each selected item (e.g., title, description, button).
722
469
  */
723
- interface SelectFieldSchema<T extends string | number = string | number> extends StrictOmit<PropertyFieldSchema, "defaultValue"> {
724
- type: "select";
725
- options: Array<{
726
- label: string;
727
- value: T;
728
- }>;
729
- defaultValue?: T;
470
+ interface ItemConfigSchema {
471
+ /** Fields available for per-item configuration */
472
+ fields: PropertyField[];
473
+ /** Optional description shown at top of item config panel */
474
+ description?: string;
730
475
  }
731
476
  /**
732
- * Color field schema
477
+ * Schema for a widget's editable properties
733
478
  */
734
- interface ColorFieldSchema extends PropertyFieldSchema {
735
- type: "color";
479
+ interface WidgetPropertySchema {
480
+ /** Widget type this schema applies to */
481
+ widgetType: WidgetType;
482
+ /** Display name for the widget */
483
+ displayName: string;
484
+ /** Optional tab configuration - if present, tabs are enabled */
485
+ tabsConfig?: TabConfig[];
486
+ /** Editable property fields */
487
+ fields: PropertyField[];
488
+ /** Optional custom validator function */
489
+ validate?: (props: Record<string, unknown>) => string | null;
490
+ /** Props that can be populated from data sources */
491
+ dataSourceTargetProps?: string[];
492
+ /** Optional schema for per-item configurations in custom data sources */
493
+ itemConfigSchema?: ItemConfigSchema;
736
494
  }
737
495
  /**
738
- * Range slider field schema
496
+ * Group property fields by their group property.
497
+ *
498
+ * Fields flagged with `advanced: true` are collected into the
499
+ * `CUSTOM_STYLING_GROUP` bucket regardless of their declared `group`,
500
+ * and that bucket is always placed last so it renders at the bottom of
501
+ * the tab. Non-advanced fields keep their author-declared group and
502
+ * their relative insertion order, including fields that explicitly use
503
+ * `CUSTOM_STYLING_GROUP`.
739
504
  */
740
- interface RangeFieldSchema extends PropertyFieldSchema {
741
- type: "range";
742
- min: number;
743
- max: number;
744
- step?: number;
745
- }
505
+ declare function groupPropertyFields(fields: readonly PropertyField[]): Record<string, PropertyField[]>;
746
506
  /**
747
- * Data source field schema for configuring widget data sources
507
+ * Extract current values from widget props based on property fields
748
508
  */
749
- interface DataSourceFieldSchema extends PropertyFieldSchema {
750
- type: "dataSource";
751
- }
509
+ declare function extractPropertyValues(widget: Readonly<WidgetSchema>, fields: readonly PropertyField[]): Record<string, unknown>;
752
510
  /**
753
- * Resource field schema for selecting a single resource from the selection modal
511
+ * Apply property values to widget props
754
512
  */
755
- interface ResourceFieldSchema extends PropertyFieldSchema {
756
- type: "resource";
757
- /** Optional filter to specific shareable types */
758
- allowedTypes?: string[];
513
+ declare function applyPropertyValues(widget: Readonly<WidgetSchema>, values: Readonly<Record<string, unknown>>): WidgetSchema;
514
+ //#endregion
515
+ //#region ../core/src/remote-dom-widget-package.d.ts
516
+ declare const REMOTE_DOM_WIDGET_MANIFEST_VERSION: 1;
517
+ declare const REMOTE_DOM_WIDGET_RUNTIME: "remote-dom";
518
+ type JsonPrimitive = string | number | boolean | null;
519
+ type JsonValue = JsonPrimitive | readonly JsonValue[] | JsonObject;
520
+ interface JsonObject {
521
+ readonly [key: string]: JsonValue;
759
522
  }
523
+ type SerializableValue<Value> = unknown extends Value ? JsonValue : Value extends JsonValue ? Value : Value extends readonly (infer Item)[] ? readonly SerializableValue<Item>[] : Value extends object ? { readonly [Key in keyof Value as NonNullable<Value[Key]> extends ((...args: never[]) => unknown) ? never : Key]: SerializableValue<Value[Key]> } : never;
760
524
  /**
761
- * Image field schema for selecting a single asset (image or video) from the
762
- * image picker. Despite the legacy "image" name, this field supports video
763
- * picking via the `accept` parameter — `VideoWidget`, `ListWidget` Featured
764
- * Asset, and `NestedWidget` Primary Media all use it for video-or-mixed
765
- * content.
525
+ * A property field that can be included in published widget metadata.
526
+ *
527
+ * The legacy `color` field is deprecated. Use `colorSelect` so the value is a
528
+ * semantic color token supplied by the portal theme.
766
529
  */
767
- interface ImageFieldSchema extends PropertyFieldSchema {
768
- type: "image";
769
- /**
770
- * Restricts which MIME categories the picker offers. Defaults to "image".
771
- */
772
- accept?: "image" | "video" | "any";
773
- }
530
+ type WidgetSourcePropertyField = PropertyField extends infer Field ? Field extends ButtonGroupFieldSchema ? Omit<SerializableValue<Field>, "options"> & {
531
+ /** Serializable button choices. Runtime icon components are not supported. */readonly options: readonly {
532
+ readonly label?: string;
533
+ readonly ariaLabel?: string;
534
+ readonly value: string | number;
535
+ }[];
536
+ } : SerializableValue<Field> : never;
774
537
  /**
775
- * Alignment field schema
538
+ * JSON-serializable property editor schema accepted by widget source metadata.
539
+ * The build adds `widgetType`; authors must not supply it.
776
540
  */
777
- interface AlignmentFieldSchema extends PropertyFieldSchema {
778
- type: "alignment";
779
- options: {
780
- verticalEnabled: boolean;
781
- horizontalEnabled: boolean;
541
+ interface WidgetSourcePropertySchema {
542
+ /** Optional tabs used to organize the property editor. */
543
+ readonly tabsConfig?: SerializableValue<NonNullable<WidgetPropertySchema["tabsConfig"]>>;
544
+ /** Editable fields shown in the property editor. */
545
+ readonly fields: readonly WidgetSourcePropertyField[];
546
+ /** Widget props that data sources can populate. */
547
+ readonly dataSourceTargetProps?: readonly string[];
548
+ /** Optional per-item fields for custom data-source selections. */
549
+ readonly itemConfigSchema?: {
550
+ /** Fields available for each selected item. */readonly fields: readonly WidgetSourcePropertyField[]; /** Help text shown above the per-item editor. */
551
+ readonly description?: string;
782
552
  };
783
- defaultValue?: AlignOptions;
553
+ }
554
+ interface RemoteDomWidgetCapabilityDeclaration {
555
+ readonly name: string;
556
+ readonly version: string;
557
+ }
558
+ interface RemoteDomWidgetDefinition {
559
+ readonly type: string;
560
+ readonly displayName: string;
561
+ readonly description: string;
562
+ readonly icon: string;
563
+ readonly category: string;
564
+ readonly propertySchema: JsonObject;
565
+ readonly defaultProps: JsonObject;
566
+ readonly container: "inline" | "block" | "card" | "fullscreen";
567
+ readonly resizable: boolean | "horizontal" | "vertical" | "both";
568
+ readonly minSdkVersion: string;
569
+ readonly capabilities: readonly RemoteDomWidgetCapabilityDeclaration[];
784
570
  }
785
571
  /**
786
- * Slider field schema with optional unit suffix (e.g., "rem", "px")
572
+ * Canonical package contract shared by the CLI, catalog APIs, and portal hosts.
573
+ * Catalog producers resolve every artifact to its public URL before returning
574
+ * this descriptor; consumers do not translate legacy manifest shapes.
787
575
  */
788
- interface SliderFieldSchema extends PropertyFieldSchema {
789
- type: "slider";
790
- min: number;
791
- max: number;
792
- step?: number;
793
- unit?: string;
576
+ interface RemoteDomWidgetPackageDescriptor {
577
+ readonly manifestVersion: typeof REMOTE_DOM_WIDGET_MANIFEST_VERSION;
578
+ readonly runtime: typeof REMOTE_DOM_WIDGET_RUNTIME;
579
+ readonly packageId: string;
580
+ readonly source: "company" | "droplet";
581
+ readonly version: string;
582
+ readonly workerEntryUrl: string;
583
+ readonly cssUrls: readonly string[];
584
+ readonly assetUrls: readonly string[];
585
+ readonly widgets: readonly RemoteDomWidgetDefinition[];
586
+ }
587
+ //#endregion
588
+ //#region ../core/src/remote-widget-network-access.d.ts
589
+ interface RemoteWidgetNetworkAccessGrant {
590
+ readonly packageId: string;
591
+ readonly packageVersion: string;
592
+ readonly capabilityVersion: string;
794
593
  }
594
+ interface RemoteWidgetCapabilityGrants {
595
+ readonly networkAccess?: RemoteWidgetNetworkAccessGrant;
596
+ }
597
+ //#endregion
598
+ //#region ../core/src/types/widget-schema.d.ts
795
599
  /**
796
- * Color picker field schema with optional swatches
600
+ * Generic component type — avoids React dependency in core.
601
+ * Accepts both function components and class component constructors.
797
602
  */
798
- interface ColorPickerFieldSchema extends PropertyFieldSchema {
799
- type: "colorPicker";
800
- swatches?: string[];
801
- }
603
+ type AnyComponent = ((props: any) => any) | (new (props: any) => any);
802
604
  /**
803
- * Section header field schema for visual grouping
605
+ * Widget type names as a const object.
606
+ * This serves as the single source of truth for widget discriminants.
607
+ * Use `as const` for literal type inference (safety-as-const-deep-readonly rule).
804
608
  */
805
- interface SectionHeaderFieldSchema extends PropertyFieldSchema {
806
- type: "sectionHeader";
807
- subtitle?: string;
808
- }
609
+ declare const WIDGET_TYPE_NAMES: {
610
+ readonly Alert: "AlertWidget";
611
+ readonly BulletList: "BulletListWidget";
612
+ readonly Calendar: "CalendarWidget";
613
+ readonly Card: "CardWidget";
614
+ readonly Carousel: "CarouselWidget";
615
+ readonly CatchUp: "CatchUpWidget";
616
+ readonly Chart: "ChartWidget";
617
+ readonly Container: "ContainerWidget";
618
+ readonly Embed: "EmbedWidget";
619
+ readonly Image: "ImageWidget";
620
+ readonly Layout: "LayoutWidget";
621
+ readonly Link: "LinkWidget";
622
+ readonly List: "ListWidget";
623
+ readonly MySite: "MySiteWidget";
624
+ readonly Nested: "NestedWidget";
625
+ readonly Points: "PointsWidget";
626
+ readonly QuickLinks: "QuickLinksWidget";
627
+ readonly QuickShare: "QuickShareWidget";
628
+ readonly RecentActivity: "RecentActivityWidget";
629
+ readonly Separator: "SeparatorWidget";
630
+ readonly Shop: "ShopWidget";
631
+ readonly Spacer: "SpacerWidget";
632
+ readonly Table: "TableWidget";
633
+ readonly Text: "TextWidget";
634
+ readonly ToDo: "ToDoWidget";
635
+ readonly Video: "VideoWidget";
636
+ };
809
637
  /**
810
- * Separator field schema for visual separation
638
+ * Union of all known widget type names.
639
+ * Derived from WIDGET_TYPE_NAMES to avoid duplication (deriving-typeof-for-object-keys rule).
811
640
  */
812
- interface SeparatorFieldSchema extends PropertyFieldSchema {
813
- type: "separator";
814
- }
641
+ type WidgetTypeName = (typeof WIDGET_TYPE_NAMES)[keyof typeof WIDGET_TYPE_NAMES];
815
642
  /**
816
- * Button group field schema.
817
- * Uses StrictOmit to ensure "defaultValue" key exists on PropertyFieldSchema.
643
+ * Legacy alias for backwards compatibility.
644
+ * Prefer using WidgetTypeName for new code when you need the union type.
818
645
  */
819
- interface ButtonGroupFieldSchema<T extends string | number = string | number> extends StrictOmit<PropertyFieldSchema, "defaultValue"> {
820
- type: "buttonGroup";
821
- options: Array<{
822
- label?: string;
823
- ariaLabel?: string;
824
- icon?: LucideIcon;
825
- value: T;
826
- }>;
827
- defaultValue?: T;
828
- }
646
+ type WidgetType = string;
647
+ type WidgetRegistry = Record<WidgetType, AnyComponent>;
829
648
  /**
830
- * Color select field schema
649
+ * Base widget schema with loose typing for runtime data.
650
+ * Use TypedWidgetSchema<T> when you have a known registry for better type safety.
831
651
  */
832
- interface ColorSelectFieldSchema extends PropertyFieldSchema {
833
- type: "colorSelect";
834
- defaultValue?: ColorOptions;
835
- excludeColors?: ColorOptions[];
836
- }
652
+ type WidgetSchema = {
653
+ readonly type: WidgetType;
654
+ readonly props: Readonly<Record<string, unknown>>;
655
+ readonly id?: string; /** Optional data source configuration for data-bound widgets */
656
+ readonly dataSource?: DataSourceConfig | undefined; /** Column index for masonry layouts (0-indexed) */
657
+ readonly columnIndex?: number; /** Host-approved capabilities for a specific remote widget package version. */
658
+ readonly capabilityGrants?: RemoteWidgetCapabilityGrants;
659
+ };
837
660
  /**
838
- * Section layout select field schema for visual masonry layout selector
661
+ * Type-safe widget schema based on registry.
662
+ * Uses discriminated unions - the `type` field serves as discriminant.
663
+ * When narrowed (e.g., `if (widget.type === "AlertWidget")`),
664
+ * TypeScript automatically knows the correct props type.
839
665
  */
840
- interface SectionLayoutSelectFieldSchema extends PropertyFieldSchema {
841
- type: "sectionLayoutSelect";
842
- defaultValue?: SectionLayoutType;
843
- }
666
+ type TypedWidgetSchema<T extends Record<string, AnyComponent>> = { [K in keyof T]: {
667
+ readonly type: K;
668
+ readonly props: Readonly<T[K] extends ((props: infer P) => any) ? P : T[K] extends (new (props: infer P) => any) ? P : never>;
669
+ readonly id?: string;
670
+ readonly dataSource?: DataSourceConfig | undefined; /** Column index for masonry layouts (0-indexed) */
671
+ readonly columnIndex?: number;
672
+ readonly capabilityGrants?: RemoteWidgetCapabilityGrants;
673
+ } }[keyof T];
844
674
  /**
845
- * Background field combines resource selection and color properties.
846
- * Uses StrictOmit to exclude conflicting "type" discriminant from parents.
675
+ * Widget path in the tree - array of indices.
676
+ * Readonly tuple to prevent accidental mutation.
847
677
  */
848
- interface BackgroundFieldSchema extends StrictOmit<ResourceFieldSchema, "type">, StrictOmit<ColorFieldSchema, "type"> {
849
- type: "background";
850
- }
678
+ type WidgetPath = readonly number[];
851
679
  /**
852
- * Content position field schema for 3x3 grid position picker
680
+ * Type predicate to check if a string is a known widget type name.
681
+ * Use for runtime validation of widget types.
682
+ *
683
+ * @example
684
+ * if (isWidgetTypeName(widget.type)) {
685
+ * // TypeScript knows widget.type is WidgetTypeName
686
+ * }
853
687
  */
854
- interface ContentPositionFieldSchema extends PropertyFieldSchema {
855
- type: "contentPosition";
856
- defaultValue?: string;
857
- }
688
+ declare function isWidgetTypeName(type: string): type is WidgetTypeName;
858
689
  /**
859
- * Text size select field schema for visual font size selector
690
+ * Type predicate to check if a widget has a specific type.
691
+ * Enables type-safe widget narrowing without `as` assertions.
692
+ *
693
+ * @example
694
+ * if (isWidgetType(widget, "LayoutWidget")) {
695
+ * // TypeScript knows widget.type === "LayoutWidget"
696
+ * // and widget.props is LayoutWidget props
697
+ * }
860
698
  */
861
- interface TextSizeSelectFieldSchema extends PropertyFieldSchema {
862
- type: "textSizeSelect";
863
- defaultValue?: FontSizeOptions;
864
- }
699
+ declare function isWidgetType<T extends WidgetTypeName>(widget: WidgetSchema | null | undefined, typeName: T): widget is WidgetSchema & {
700
+ readonly type: T;
701
+ };
865
702
  /**
866
- * CSS unit type for height/width fields
703
+ * Helper for exhaustive switch statements on widget types.
704
+ * Use in the default case to ensure all widget types are handled.
705
+ *
706
+ * @example
707
+ * switch (widget.type) {
708
+ * case "AlertWidget": return handleAlert();
709
+ * case "TextWidget": return handleText();
710
+ * // ... all other widget types
711
+ * default: return assertNever(widget.type, "widget type");
712
+ * }
867
713
  */
868
- type CssUnit = "px" | "rem" | "vh" | "%";
714
+ declare function assertNever(value: never, context?: string): never;
869
715
  /**
870
- * CSS unit field schema for numeric values with selectable units (px, rem, vh, %)
716
+ * Assertion function that throws if value is undefined.
717
+ * Narrows the type to exclude undefined.
718
+ *
719
+ * @example
720
+ * const widget = screen[0];
721
+ * assertDefined(widget, "widget at index 0");
722
+ * // TypeScript knows widget is defined here
871
723
  */
872
- interface CssUnitFieldSchema extends PropertyFieldSchema {
873
- type: "cssUnit";
874
- minByUnit?: Partial<Record<CssUnit, number>>;
875
- maxByUnit?: Partial<Record<CssUnit, number>>;
876
- stepByUnit?: Partial<Record<CssUnit, number>>;
877
- allowedUnits?: CssUnit[];
878
- defaultUnit?: CssUnit;
724
+ declare function assertDefined<T>(value: T | undefined | null, name?: string): asserts value is T;
725
+ //#endregion
726
+ //#region ../../platform/theme-engine/src/types.d.ts
727
+ declare const SEMANTIC_COLOR_NAMES: readonly ["background", "foreground", "primary", "secondary", "accent", "muted", "destructive"];
728
+ type SemanticColorName = (typeof SEMANTIC_COLOR_NAMES)[number];
729
+ declare const FONT_SIZE_KEYS: readonly ["extraSmall", "small", "regular", "large", "extraLarge", "giant"];
730
+ type FontSizeKey = (typeof FONT_SIZE_KEYS)[number];
731
+ declare const FONT_FAMILY_KEYS: readonly ["header", "body"];
732
+ type FontFamilyKey = (typeof FONT_FAMILY_KEYS)[number];
733
+ declare const RADIUS_KEYS: readonly ["small", "medium", "large", "extraLarge"];
734
+ type RadiusKey = (typeof RADIUS_KEYS)[number];
735
+ /** Author-time color input (what the user configures) */
736
+ interface ThemeColorInput {
737
+ base: Color;
738
+ foreground: Color;
879
739
  }
880
- /**
881
- * Font picker field schema for Google Fonts selection
882
- */
883
- interface FontPickerFieldSchema extends PropertyFieldSchema {
884
- type: "fontPicker";
885
- placeholder?: string;
740
+ /** Complete theme definition — stored in-memory with Color objects */
741
+ interface ThemeDefinition {
742
+ id: string;
743
+ name: string;
744
+ /** Light mode — always fully specified */
745
+ light: Record<SemanticColorName, ThemeColorInput>;
746
+ /**
747
+ * Dark mode — only user-overridden colors.
748
+ * Missing keys are auto-derived from `light` at resolve time.
749
+ */
750
+ dark: Partial<Record<SemanticColorName, Partial<ThemeColorInput>>>;
751
+ fontSizes: Record<FontSizeKey, string>;
752
+ fontFamilies: Record<FontFamilyKey, string>;
753
+ spacing: string;
754
+ radii: Record<RadiusKey, string>;
755
+ /** When true, theme colors are re-derived from brand guidelines on every load */
756
+ syncWithBrandColors?: boolean;
886
757
  }
887
- /**
888
- * String array field schema for managing lists of text items
889
- */
890
- interface StringArrayFieldSchema extends PropertyFieldSchema {
891
- type: "stringArray";
892
- placeholder?: string;
893
- defaultValue?: string[];
758
+ /** Resolved semantic color */
759
+ interface ResolvedSemanticColor {
760
+ base: Color;
761
+ foreground: Color;
762
+ }
763
+ /** Complete resolved color set for one mode */
764
+ type ResolvedColorSet = Record<SemanticColorName, ResolvedSemanticColor>;
765
+ /** Fully resolved theme — all colors materialised for both modes */
766
+ interface ResolvedTheme {
767
+ id: string;
768
+ name: string;
769
+ light: ResolvedColorSet;
770
+ dark: ResolvedColorSet;
771
+ fontSizes: ThemeDefinition["fontSizes"];
772
+ fontFamilies: ThemeDefinition["fontFamilies"];
773
+ spacing: string;
774
+ radii: ThemeDefinition["radii"];
775
+ }
776
+ /** Plain OKLCH triplet for JSON serialisation (no Color dependency) */
777
+ interface OklchPlain {
778
+ l: number;
779
+ c: number;
780
+ h: number;
781
+ }
782
+ /** Serialised color pair as stored in the backend payload */
783
+ interface ThemeColorPlain {
784
+ base: OklchPlain;
785
+ foreground: OklchPlain;
786
+ }
787
+ /** Backend payload — plain JSON, no Color objects */
788
+ interface ThemePayload {
789
+ [key: string]: unknown;
790
+ id: string;
791
+ name: string;
792
+ light: Record<SemanticColorName, ThemeColorPlain>;
793
+ dark: Partial<Record<SemanticColorName, {
794
+ base?: OklchPlain;
795
+ foreground?: OklchPlain;
796
+ }>>;
797
+ fontSizes: Record<FontSizeKey, string>;
798
+ fontFamilies: Record<FontFamilyKey, string>;
799
+ spacing: string;
800
+ radii: Record<RadiusKey, string>;
801
+ syncWithBrandColors?: boolean;
894
802
  }
803
+ //#endregion
804
+ //#region ../core/src/types/navigation.d.ts
895
805
  /**
896
- * Border radius composite field schema for controlling 4 corners with a single field.
897
- * Maps to 4 individual widget prop keys (topLeft, topRight, bottomLeft, bottomRight).
806
+ * Navigation item in the sidebar/menu structure.
807
+ *
808
+ * Field types match the FluidOS API schema (`FluidOSNavigationItem`).
809
+ * Differences from the raw API type:
810
+ * - `id` is optional (system/default items may not have one)
811
+ * - `label` is required (transforms default null to "Untitled")
812
+ * - `section` is a frontend-only extension (not in API)
813
+ * - Nullable fields use `undefined` instead of `null` (except `parent_id`)
898
814
  */
899
- interface BorderRadiusFieldSchema extends PropertyFieldSchema {
900
- type: "borderRadius";
901
- keys: {
902
- topLeft: string;
903
- topRight: string;
904
- bottomLeft: string;
905
- bottomRight: string;
906
- };
907
- defaultValue?: BorderRadiusOptions;
815
+ interface NavigationItem {
816
+ /** Database-generated identifier — optional because system/default items may not have one */
817
+ readonly id?: number;
818
+ /** URL slug for routing (`| undefined` for exactOptionalPropertyTypes compat) */
819
+ slug?: string | undefined;
820
+ /** Display label — required; transforms default null API values to "Untitled" */
821
+ label: string;
822
+ /** Icon identifier (e.g., FontAwesome name) */
823
+ icon?: string | undefined;
824
+ /** Section grouping for quick links (frontend-only, not in API) */
825
+ section?: string;
826
+ /** Associated screen ID */
827
+ screen_id?: number | undefined;
828
+ /** Sort order */
829
+ position?: number | undefined;
830
+ /** Parent navigation item ID (null for root items) */
831
+ parent_id?: number | null;
832
+ /** Origin of this navigation item */
833
+ source?: "user" | "system" | "code";
834
+ /** Nested navigation items */
835
+ children: NavigationItem[];
908
836
  }
909
837
  /**
910
- * Screen picker field schema for selecting a portal screen (navigation, system, or available)
838
+ * Screen definition with its component tree
911
839
  */
912
- interface ScreenPickerFieldSchema extends PropertyFieldSchema {
913
- type: "screenPicker";
914
- /** Whether to include system navigation items in the picker */
915
- includeSystemItems?: boolean;
840
+ interface ScreenDefinition {
841
+ readonly id: number;
842
+ slug: string;
843
+ name: string;
844
+ component_tree: WidgetSchema[];
916
845
  }
917
846
  /**
918
- * Union of all field schema types
919
- */
920
- type PropertyField = TextFieldSchema | TextareaFieldSchema | NumberFieldSchema | BooleanFieldSchema | SelectFieldSchema<string | number> | ColorFieldSchema | RangeFieldSchema | DataSourceFieldSchema | ResourceFieldSchema | ImageFieldSchema | AlignmentFieldSchema | SliderFieldSchema | ColorPickerFieldSchema | SectionHeaderFieldSchema | SeparatorFieldSchema | ButtonGroupFieldSchema<string | number> | ColorSelectFieldSchema | SectionLayoutSelectFieldSchema | BackgroundFieldSchema | ContentPositionFieldSchema | TextSizeSelectFieldSchema | CssUnitFieldSchema | FontPickerFieldSchema | StringArrayFieldSchema | BorderRadiusFieldSchema | ScreenPickerFieldSchema;
921
- /**
922
- * Schema for per-item configuration in custom data sources.
923
- * Widgets can define this to allow users to configure widget-specific
924
- * settings for each selected item (e.g., title, description, button).
847
+ * Navigation configuration for the portal
925
848
  */
926
- interface ItemConfigSchema {
927
- /** Fields available for per-item configuration */
928
- fields: PropertyField[];
929
- /** Optional description shown at top of item config panel */
930
- description?: string;
849
+ interface Navigation {
850
+ readonly definition_id: number;
851
+ readonly id: number;
852
+ name: string;
853
+ navigation_items: NavigationItem[];
854
+ screens: ScreenDefinition[];
931
855
  }
932
- /**
933
- * Schema for a widget's editable properties
934
- */
935
- interface WidgetPropertySchema {
936
- /** Widget type this schema applies to */
937
- widgetType: WidgetType;
938
- /** Display name for the widget */
939
- displayName: string;
940
- /** Optional tab configuration - if present, tabs are enabled */
941
- tabsConfig?: TabConfig[];
942
- /** Editable property fields */
943
- fields: PropertyField[];
944
- /** Optional custom validator function */
945
- validate?: (props: Record<string, unknown>) => string | null;
946
- /** Props that can be populated from data sources */
947
- dataSourceTargetProps?: string[];
948
- /** Optional schema for per-item configurations in custom data sources */
949
- itemConfigSchema?: ItemConfigSchema;
856
+ /** A portal app profile — themes, navigation, and definition reference. */
857
+ interface RepAppProfile {
858
+ name: string;
859
+ themes: ThemeDefinition[];
860
+ activeThemeId?: string;
861
+ navigation: Navigation;
862
+ mobile_navigation?: Navigation;
863
+ definition_id: number;
950
864
  }
865
+ /** Full portal app data returned by the fluidos API or builder preview. */
866
+ interface RepAppData {
867
+ definition_id: number;
868
+ published_version: number;
869
+ screens: ScreenDefinition[];
870
+ profile: RepAppProfile;
871
+ }
872
+ /** Wrapper for the `/fluid_os/definitions/active` API response. */
873
+ interface RepAppManifest {
874
+ manifest: RepAppData;
875
+ }
876
+ //#endregion
877
+ //#region ../core/src/types/shareable-item.d.ts
951
878
  /**
952
- * Group property fields by their group property.
953
- *
954
- * Fields flagged with `advanced: true` are collected into the
955
- * `CUSTOM_STYLING_GROUP` bucket regardless of their declared `group`,
956
- * and that bucket is always placed last so it renders at the bottom of
957
- * the tab. Non-advanced fields keep their author-declared group and
958
- * their relative insertion order, including fields that explicitly use
959
- * `CUSTOM_STYLING_GROUP`.
960
- */
961
- declare function groupPropertyFields(fields: readonly PropertyField[]): Record<string, PropertyField[]>;
962
- /**
963
- * Extract current values from widget props based on property fields
964
- */
965
- declare function extractPropertyValues(widget: Readonly<WidgetSchema>, fields: readonly PropertyField[]): Record<string, unknown>;
966
- /**
967
- * Apply property values to widget props
879
+ * Base props for a shareable item.
880
+ * Uses structural typing to be compatible with various modal implementations.
881
+ * The index signature allows additional properties from consuming apps.
968
882
  */
969
- declare function applyPropertyValues(widget: Readonly<WidgetSchema>, values: Readonly<Record<string, unknown>>): WidgetSchema;
883
+ interface ShareableItem {
884
+ id: string | number;
885
+ title?: string | null;
886
+ image_url?: string | null;
887
+ imageUrl?: string | null;
888
+ kind?: string | null;
889
+ type?: string | null;
890
+ shareableType?: string | null;
891
+ share_link?: string | null;
892
+ videoUrl?: string;
893
+ price?: string | number | null;
894
+ display_price?: string | null;
895
+ [key: string]: unknown;
896
+ }
970
897
  //#endregion
971
- //#region ../core/src/registries/field-helpers.d.ts
898
+ //#region ../core/src/types/field-types.d.ts
972
899
  /**
973
- * Gap value mapping - use `as const satisfies` for compile-time validation
974
- * with literal type preservation.
900
+ * Color options constant - single source of truth for color values.
901
+ * Use COLOR_OPTIONS.primary instead of "primary" for type-safe comparisons.
975
902
  */
976
- declare const gapValues: {
977
- readonly none: 0;
978
- readonly xs: 1;
979
- readonly sm: 2;
980
- readonly md: 4;
981
- readonly lg: 6;
982
- readonly xl: 8;
903
+ declare const COLOR_OPTIONS: {
904
+ readonly background: "background";
905
+ readonly foreground: "foreground";
906
+ readonly primary: "primary";
907
+ readonly secondary: "secondary";
908
+ readonly accent: "accent";
909
+ readonly muted: "muted";
910
+ readonly border: "border";
911
+ readonly destructive: "destructive";
912
+ readonly transparent: "transparent";
983
913
  };
984
- //#endregion
985
- //#region ../core/src/registries/container-types.d.ts
986
914
  /**
987
- * Interface for container widget behavior.
988
- * Container widgets can hold and manage child widgets.
989
- * Note: Children can be null for sparse arrays (e.g., grid layouts with empty cells)
915
+ * Union type of all color options, derived from COLOR_OPTIONS constant.
916
+ * @see deriving-typeof-for-object-keys pattern
990
917
  */
991
- interface ContainerWidgetBehavior {
992
- /** Identifies this widget type as a container */
993
- isContainer: true;
994
- /** Gets children from the widget's props */
995
- getChildren: (props: Record<string, unknown>) => (WidgetSchema | null)[];
996
- /** Creates new props with updated children */
997
- setChildren: (props: Record<string, unknown>, children: (WidgetSchema | null)[]) => Record<string, unknown>;
998
- /** Optional: Check if this container accepts a specific widget type */
999
- canAcceptChild?: (childType: string) => boolean;
918
+ type ColorOptions = (typeof COLOR_OPTIONS)[keyof typeof COLOR_OPTIONS];
919
+ declare const FONT_SIZE_OPTIONS: {
920
+ readonly "2xl": "2xl";
921
+ readonly xl: "xl";
922
+ readonly lg: "lg";
923
+ readonly md: "md";
924
+ readonly sm: "sm";
925
+ readonly xs: "xs";
926
+ };
927
+ type FontSizeOptions = (typeof FONT_SIZE_OPTIONS)[keyof typeof FONT_SIZE_OPTIONS];
928
+ declare const FONT_WEIGHT_OPTIONS: {
929
+ readonly normal: "normal";
930
+ readonly medium: "medium";
931
+ readonly semibold: "semibold";
932
+ readonly bold: "bold";
933
+ };
934
+ type FontWeightOptions = (typeof FONT_WEIGHT_OPTIONS)[keyof typeof FONT_WEIGHT_OPTIONS];
935
+ declare const BORDER_RADIUS_OPTIONS: {
936
+ readonly none: "none";
937
+ readonly sm: "sm";
938
+ readonly md: "md";
939
+ readonly lg: "lg";
940
+ readonly xl: "xl";
941
+ readonly full: "full";
942
+ };
943
+ type BorderRadiusOptions = (typeof BORDER_RADIUS_OPTIONS)[keyof typeof BORDER_RADIUS_OPTIONS];
944
+ declare const BORDER_WIDTH_OPTIONS: {
945
+ readonly none: "none";
946
+ readonly thin: "thin";
947
+ readonly medium: "medium";
948
+ readonly thick: "thick";
949
+ };
950
+ type BorderWidthOptions = (typeof BORDER_WIDTH_OPTIONS)[keyof typeof BORDER_WIDTH_OPTIONS];
951
+ /** Padding values - numeric, so we use a tuple for derivation */
952
+ declare const PADDING_VALUES: readonly [0, 2, 4, 6, 8, 10];
953
+ type PaddingOptions = (typeof PADDING_VALUES)[number];
954
+ declare const BUTTON_SIZE_OPTIONS: {
955
+ readonly sm: "sm";
956
+ readonly default: "default";
957
+ readonly lg: "lg";
958
+ readonly xl: "xl";
959
+ };
960
+ type ButtonSizeOptions = (typeof BUTTON_SIZE_OPTIONS)[keyof typeof BUTTON_SIZE_OPTIONS];
961
+ declare const GAP_OPTIONS: {
962
+ readonly none: "none";
963
+ readonly xs: "xs";
964
+ readonly sm: "sm";
965
+ readonly md: "md";
966
+ readonly lg: "lg";
967
+ readonly xl: "xl";
968
+ };
969
+ type GapOptions = (typeof GAP_OPTIONS)[keyof typeof GAP_OPTIONS];
970
+ declare const VERTICAL_ALIGN_OPTIONS: {
971
+ readonly top: "top";
972
+ readonly center: "center";
973
+ readonly bottom: "bottom";
974
+ };
975
+ type VerticalAlign = (typeof VERTICAL_ALIGN_OPTIONS)[keyof typeof VERTICAL_ALIGN_OPTIONS];
976
+ declare const HORIZONTAL_ALIGN_OPTIONS: {
977
+ readonly left: "left";
978
+ readonly center: "center";
979
+ readonly right: "right";
980
+ };
981
+ type HorizontalAlign = (typeof HORIZONTAL_ALIGN_OPTIONS)[keyof typeof HORIZONTAL_ALIGN_OPTIONS];
982
+ type AlignOptions = {
983
+ vertical?: VerticalAlign;
984
+ horizontal?: HorizontalAlign;
985
+ };
986
+ declare const BACKGROUND_TYPES: {
987
+ readonly solid: "solid";
988
+ readonly image: "image";
989
+ };
990
+ type BackgroundType = (typeof BACKGROUND_TYPES)[keyof typeof BACKGROUND_TYPES];
991
+ interface BackgroundValue {
992
+ type: BackgroundType;
993
+ color?: ColorOptions;
994
+ resource?: ShareableItem;
1000
995
  }
1001
- //#endregion
1002
- //#region ../core/src/registries/widget-manifest.d.ts
1003
996
  /**
1004
- * The manifest a plugin author provides to register a custom widget.
1005
- * Required fields ensure the widget works in both builder and SDK contexts.
1006
- * Optional fields enable advanced behavior (containers, min SDK version).
997
+ * Section layout configuration - single source of truth for layout types.
998
+ * SectionLayoutType is derived from these keys to prevent drift.
1007
999
  */
1008
- interface WidgetManifest {
1009
- /** Schema version for forward compatibility. Currently must be 1. */
1010
- manifestVersion: number;
1011
- /** Unique widget type identifier (e.g., "StockTickerWidget"). */
1012
- type: string;
1013
- /** The React component that renders this widget. */
1014
- component: AnyComponent;
1015
- /** Human-readable name shown in the builder palette. */
1016
- displayName: string;
1017
- /** Brief description shown in the builder palette. */
1018
- description: string;
1019
- /** Icon identifier for the builder palette (e.g., "chart-line"). */
1020
- icon: string;
1021
- /** Category ID for palette grouping (e.g., "components", "blocks", "utility"). */
1022
- category: string;
1023
- /** Property schema defining editable fields in the builder's property panel. */
1024
- propertySchema: WidgetPropertySchema;
1025
- /** Default prop values when the widget is first created. */
1026
- defaultProps: Record<string, unknown>;
1027
- /** Container behavior — only if this widget can hold child widgets. */
1028
- container?: ContainerWidgetBehavior;
1029
- /** Minimum SDK version required (e.g., "1.0.0"). */
1030
- minSdkVersion?: string;
1031
- /** Resizable configuration. */
1032
- resizable?: {
1033
- horizontal?: boolean;
1034
- vertical?: boolean;
1035
- minWidth?: number;
1036
- minHeight?: number;
1000
+ declare const SECTION_LAYOUT_CONFIG: {
1001
+ readonly "single-column": {
1002
+ readonly columns: 1;
1003
+ readonly widths: readonly ["1fr"];
1004
+ readonly gridClasses: "";
1037
1005
  };
1038
- /** Exact grant the host must approve before this remote widget is added. */
1039
- networkAccessGrant?: RemoteWidgetNetworkAccessGrant;
1040
- }
1041
- //#endregion
1042
- //#region src/utils/build-remote-widget-plugin-manifests.d.ts
1043
- interface RemoteWidgetPluginHostOptions extends RemoteDomWidgetRegistryOptions {
1044
- readonly warningSink?: WidgetRegistryWarningSink;
1045
- }
1006
+ readonly "2c-equal": {
1007
+ readonly columns: 2;
1008
+ readonly widths: readonly ["1fr", "1fr"];
1009
+ readonly gridClasses: "@md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]";
1010
+ };
1011
+ readonly "2c-left-wider": {
1012
+ readonly columns: 2;
1013
+ readonly widths: readonly ["2fr", "1fr"];
1014
+ readonly gridClasses: "@md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]";
1015
+ };
1016
+ readonly "2c-right-wider": {
1017
+ readonly columns: 2;
1018
+ readonly widths: readonly ["1fr", "2fr"];
1019
+ readonly gridClasses: "@md:grid-cols-[minmax(0,1fr)_minmax(0,2fr)]";
1020
+ };
1021
+ readonly "2c-left-narrow": {
1022
+ readonly columns: 2;
1023
+ readonly widths: readonly ["1fr", "3fr"];
1024
+ readonly gridClasses: "@md:grid-cols-[minmax(0,1fr)_minmax(0,3fr)]";
1025
+ };
1026
+ readonly "2c-right-narrow": {
1027
+ readonly columns: 2;
1028
+ readonly widths: readonly ["3fr", "1fr"];
1029
+ readonly gridClasses: "@md:grid-cols-[minmax(0,3fr)_minmax(0,1fr)]";
1030
+ };
1031
+ readonly "3c-equal": {
1032
+ readonly columns: 3;
1033
+ readonly widths: readonly ["1fr", "1fr", "1fr"];
1034
+ readonly gridClasses: "@md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)]";
1035
+ };
1036
+ readonly "3c-middle-wider": {
1037
+ readonly columns: 3;
1038
+ readonly widths: readonly ["1fr", "2fr", "1fr"];
1039
+ readonly gridClasses: "@md:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_minmax(0,1fr)]";
1040
+ };
1041
+ };
1046
1042
  /**
1047
- * Projects accepted canonical packages into builder manifests using the same
1048
- * package-atomic acceptance pass as the runtime registry.
1043
+ * Union type of all section layout types, derived from SECTION_LAYOUT_CONFIG keys.
1044
+ * @see deriving-typeof-for-object-keys pattern
1049
1045
  */
1050
- declare function buildRemoteWidgetPluginManifests(packages: readonly RemoteDomWidgetPackageDescriptor[], hostOptions?: RemoteWidgetPluginHostOptions): WidgetManifest[];
1051
- declare function getRemoteWidgetPackageCategoryId(remotePackage: Pick<RemoteDomWidgetPackageDescriptor, "packageId" | "source">): string;
1046
+ type SectionLayoutType = keyof typeof SECTION_LAYOUT_CONFIG;
1047
+ /** @deprecated Use SECTION_LAYOUT_CONFIG instead */
1048
+ declare const sectionLayoutConfig: typeof SECTION_LAYOUT_CONFIG;
1049
+ //#endregion
1050
+ //#region ../core/src/types/index.d.ts
1051
+ type StrictOmit<T, K extends keyof T> = Omit<T, K>;
1052
+ //#endregion
1053
+ //#region src/widgets/remote/contract/portal-function.d.ts
1054
+ type PortalFunctionJsonValue = RemoteDomSerializableValue;
1055
+ type PortalFunctionJsonPrimitive = null | boolean | number | string;
1056
+ type IsAny<Value> = 0 extends 1 & Value ? true : false;
1057
+ type IsPortalFunctionJsonBranch<Value, Seen> = Value extends PortalFunctionJsonPrimitive ? true : Value extends readonly (infer Item)[] ? IsPortalFunctionJsonValue<Item, Seen> : Value extends ((...args: never[]) => unknown) ? false : Value extends object ? Extract<keyof Value, symbol> extends never ? false extends { [Key in keyof Value]-?: IsPortalFunctionJsonValue<Required<Value>[Key], Seen | Value> }[keyof Value] ? false : true : false : false;
1058
+ type IsPortalFunctionJsonValue<Value, Seen = never> = IsAny<Value> extends true ? false : [Value] extends [never] ? false : [Value] extends [Seen] ? true : false extends (Value extends unknown ? IsPortalFunctionJsonBranch<Value, Seen> : never) ? false : true;
1059
+ type IsExactlyVoid<Value> = [Value] extends [void] ? [void] extends [Value] ? true : false : false;
1060
+ type PortalFunctionContractErrors<Output, Input> = IsPortalFunctionJsonValue<Output> extends true ? IsExactlyVoid<Input> extends true ? [] : IsPortalFunctionJsonValue<Input> extends true ? [] : [error: "Portal function input must contain only JSON values"] : [error: "Portal function output must contain only JSON values"];
1061
+ type PortalFunctionErrorCode = "NOT_MOUNTED" | "NOT_DECLARED" | "INVALID_ARGUMENT" | "UNAVAILABLE" | "UNSUPPORTED" | "HOST_FAILURE" | "INVALID_RESPONSE";
1062
+ /** A stable, serializable failure reported by a Portal function call. */
1063
+ declare class PortalFunctionError extends Error {
1064
+ readonly code: PortalFunctionErrorCode;
1065
+ constructor(code: PortalFunctionErrorCode, message: string);
1066
+ }
1067
+ interface PortalFunctionDefinition {
1068
+ readonly capability: string;
1069
+ readonly version: string;
1070
+ readonly method: string;
1071
+ }
1072
+ type PortalFunction<Output, Input = void> = [Input] extends [void] ? () => Promise<Output> : (input: Input) => Promise<Output>;
1073
+ type AnyPortalFunction = (...args: never[]) => Promise<unknown>;
1074
+ type PortalFunctionHandler<Output, Input = void> = [Input] extends [void] ? () => Output | Promise<Output> : (input: Input) => Output | Promise<Output>;
1075
+ interface PortalFunctionImplementation {
1076
+ readonly definition: PortalFunctionDefinition;
1077
+ readonly portalFunction: AnyPortalFunction;
1078
+ readonly handler: (...args: never[]) => unknown | Promise<unknown>;
1079
+ }
1080
+ declare function definePortalFunction<Output, Input = void>(definition: PortalFunctionDefinition, ..._contractErrors: PortalFunctionContractErrors<Output, Input>): PortalFunction<Output, Input>;
1081
+ declare function implementPortalFunction<Output, Input = void>(portalFunction: PortalFunction<Output, Input>, handler: PortalFunctionHandler<NoInfer<Output>, NoInfer<Input>>): PortalFunctionImplementation;
1052
1082
  //#endregion
1053
- export { WidgetPath as $, RepAppData as A, RadiusKey as B, FontWeightOptions as C, sectionLayoutConfig as D, SectionLayoutType as E, FONT_SIZE_KEYS as F, SemanticColorName as G, ResolvedSemanticColor as H, FontFamilyKey as I, ThemeDefinition as J, ThemeColorInput as K, FontSizeKey as L, RepAppProfile as M, ScreenDefinition as N, ShareableItem as O, FONT_FAMILY_KEYS as P, WIDGET_TYPE_NAMES as Q, OklchPlain as R, FontSizeOptions as S, PaddingOptions as T, ResolvedTheme as U, ResolvedColorSet as V, SEMANTIC_COLOR_NAMES as W, AnyComponent as X, ThemePayload as Y, TypedWidgetSchema as Z, BackgroundValue as _, gapValues as a, assertNever as at, ButtonSizeOptions as b, PropertyFieldType as c, applyPropertyValues as d, WidgetRegistry as et, extractPropertyValues as f, BackgroundType as g, AlignOptions as h, WidgetManifest as i, assertDefined as it, RepAppManifest as j, NavigationItem as k, TabConfig as l, isPropertyFieldType as m, buildRemoteWidgetPluginManifests as n, WidgetType as nt, PROPERTY_FIELD_TYPES as o, isWidgetType as ot, groupPropertyFields as p, ThemeColorPlain as q, getRemoteWidgetPackageCategoryId as r, WidgetTypeName as rt, PropertyFieldSchema as s, isWidgetTypeName as st, RemoteWidgetPluginHostOptions as t, WidgetSchema as tt, WidgetPropertySchema as u, BorderRadiusOptions as v, GapOptions as w, ColorOptions as x, BorderWidthOptions as y, RADIUS_KEYS as z };
1054
- //# sourceMappingURL=build-remote-widget-plugin-manifests-CFmLot7p.d.cts.map
1083
+ export { WidgetTypeName as $, FONT_FAMILY_KEYS as A, SEMANTIC_COLOR_NAMES as B, sectionLayoutConfig as C, RepAppManifest as D, RepAppData as E, RADIUS_KEYS as F, ThemePayload as G, ThemeColorInput as H, RadiusKey as I, WIDGET_TYPE_NAMES as J, AnyComponent as K, ResolvedColorSet as L, FontFamilyKey as M, FontSizeKey as N, RepAppProfile as O, OklchPlain as P, WidgetType as Q, ResolvedSemanticColor as R, SectionLayoutType as S, NavigationItem as T, ThemeColorPlain as U, SemanticColorName as V, ThemeDefinition as W, WidgetRegistry as X, WidgetPath as Y, WidgetSchema as Z, ColorOptions as _, groupPropertyFields as _t, PortalFunctionErrorCode as a, JsonValue as at, GapOptions as b, PortalFunctionJsonValue as c, WidgetSourcePropertyField as ct, AlignOptions as d, PropertyFieldSchema as dt, assertDefined as et, BackgroundType as f, PropertyFieldType as ft, ButtonSizeOptions as g, extractPropertyValues as gt, BorderWidthOptions as h, applyPropertyValues as ht, PortalFunctionError as i, RemoteWidgetNetworkAccessGrant as it, FONT_SIZE_KEYS as j, ScreenDefinition as k, definePortalFunction as l, WidgetSourcePropertySchema as lt, BorderRadiusOptions as m, WidgetPropertySchema as mt, PortalFunction as n, isWidgetType as nt, PortalFunctionHandler as o, RemoteDomWidgetDefinition as ot, BackgroundValue as p, TabConfig as pt, TypedWidgetSchema as q, PortalFunctionDefinition as r, isWidgetTypeName as rt, PortalFunctionImplementation as s, RemoteDomWidgetPackageDescriptor as st, AnyPortalFunction as t, assertNever as tt, implementPortalFunction as u, PROPERTY_FIELD_TYPES as ut, FontSizeOptions as v, isPropertyFieldType as vt, ShareableItem as w, PaddingOptions as x, FontWeightOptions as y, ResolvedTheme as z };
1084
+ //# sourceMappingURL=portal-function-DYWFgeRx.d.cts.map