@fluid-app/rep-core 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-sources/DataAwareWidget.cjs.map +1 -1
- package/dist/data-sources/DataAwareWidget.d.cts +6 -20
- package/dist/data-sources/DataAwareWidget.d.cts.map +1 -1
- package/dist/data-sources/DataAwareWidget.d.mts +6 -20
- package/dist/data-sources/DataAwareWidget.d.mts.map +1 -1
- package/dist/data-sources/DataAwareWidget.mjs.map +1 -1
- package/dist/data-sources/ErrorState.cjs.map +1 -1
- package/dist/data-sources/ErrorState.d.cts +2 -2
- package/dist/data-sources/ErrorState.d.cts.map +1 -1
- package/dist/data-sources/ErrorState.d.mts +2 -2
- package/dist/data-sources/ErrorState.d.mts.map +1 -1
- package/dist/data-sources/ErrorState.mjs.map +1 -1
- package/dist/data-sources/context.cjs.map +1 -1
- package/dist/data-sources/context.d.cts +2 -3
- package/dist/data-sources/context.d.cts.map +1 -1
- package/dist/data-sources/context.d.mts +2 -3
- package/dist/data-sources/context.d.mts.map +1 -1
- package/dist/data-sources/context.mjs.map +1 -1
- package/dist/data-sources/fetchers/api.d.cts +3 -3
- package/dist/data-sources/fetchers/api.d.mts +3 -3
- package/dist/data-sources/fetchers/custom.d.cts +10 -10
- package/dist/data-sources/fetchers/custom.d.mts +10 -10
- package/dist/data-sources/fetchers/static.d.cts +20 -20
- package/dist/data-sources/fetchers/static.d.cts.map +1 -1
- package/dist/data-sources/fetchers/static.d.mts +20 -20
- package/dist/data-sources/fetchers/static.d.mts.map +1 -1
- package/dist/data-sources/preview-context.cjs.map +1 -1
- package/dist/data-sources/preview-context.d.cts +1 -3
- package/dist/data-sources/preview-context.d.cts.map +1 -1
- package/dist/data-sources/preview-context.d.mts +1 -3
- package/dist/data-sources/preview-context.d.mts.map +1 -1
- package/dist/data-sources/preview-context.mjs.map +1 -1
- package/dist/data-sources/registry-context.cjs.map +1 -1
- package/dist/data-sources/registry-context.d.cts +14 -15
- package/dist/data-sources/registry-context.d.cts.map +1 -1
- package/dist/data-sources/registry-context.d.mts +14 -15
- package/dist/data-sources/registry-context.d.mts.map +1 -1
- package/dist/data-sources/registry-context.mjs.map +1 -1
- package/dist/data-sources/registry.cjs.map +1 -1
- package/dist/data-sources/registry.d.cts +4 -4
- package/dist/data-sources/registry.d.cts.map +1 -1
- package/dist/data-sources/registry.d.mts +4 -4
- package/dist/data-sources/registry.d.mts.map +1 -1
- package/dist/data-sources/registry.mjs.map +1 -1
- package/dist/data-sources/transformers.d.cts +3 -3
- package/dist/data-sources/transformers.d.mts +3 -3
- package/dist/data-sources/types.d.cts +1 -1
- package/dist/data-sources/types.d.mts +1 -1
- package/dist/data-sources/use-widget-data.d.cts +4 -4
- package/dist/data-sources/use-widget-data.d.cts.map +1 -1
- package/dist/data-sources/use-widget-data.d.mts +4 -4
- package/dist/data-sources/use-widget-data.d.mts.map +1 -1
- package/dist/{index-Bxe_LIi8.d.cts → index-Bgv8HUpo.d.cts} +36 -77
- package/dist/index-Bgv8HUpo.d.cts.map +1 -0
- package/dist/{index-CCAu2n19.d.mts → index-Ka_HOwpb.d.mts} +36 -77
- package/dist/index-Ka_HOwpb.d.mts.map +1 -0
- package/dist/registries/index.cjs.map +1 -1
- package/dist/registries/index.d.cts +86 -86
- package/dist/registries/index.d.cts.map +1 -1
- package/dist/registries/index.d.mts +86 -86
- package/dist/registries/index.d.mts.map +1 -1
- package/dist/registries/index.mjs.map +1 -1
- package/dist/shell/AppShellLayout.cjs.map +1 -1
- package/dist/shell/AppShellLayout.d.cts +15 -16
- package/dist/shell/AppShellLayout.d.cts.map +1 -1
- package/dist/shell/AppShellLayout.d.mts +15 -16
- package/dist/shell/AppShellLayout.d.mts.map +1 -1
- package/dist/shell/AppShellLayout.mjs.map +1 -1
- package/dist/shell/ScreenHeader.cjs.map +1 -1
- package/dist/shell/ScreenHeader.d.cts +2 -2
- package/dist/shell/ScreenHeader.d.cts.map +1 -1
- package/dist/shell/ScreenHeader.d.mts +2 -2
- package/dist/shell/ScreenHeader.d.mts.map +1 -1
- package/dist/shell/ScreenHeader.mjs.map +1 -1
- package/dist/shell/ScreenHeaderContext.cjs.map +1 -1
- package/dist/shell/ScreenHeaderContext.d.cts +17 -18
- package/dist/shell/ScreenHeaderContext.d.cts.map +1 -1
- package/dist/shell/ScreenHeaderContext.d.mts +17 -18
- package/dist/shell/ScreenHeaderContext.d.mts.map +1 -1
- package/dist/shell/ScreenHeaderContext.mjs.map +1 -1
- package/dist/shell/ThemeModeContext.cjs.map +1 -1
- package/dist/shell/ThemeModeContext.d.cts +2 -3
- package/dist/shell/ThemeModeContext.d.cts.map +1 -1
- package/dist/shell/ThemeModeContext.d.mts +2 -3
- package/dist/shell/ThemeModeContext.d.mts.map +1 -1
- package/dist/shell/ThemeModeContext.mjs.map +1 -1
- package/dist/shell/sidebar.cjs.map +1 -1
- package/dist/shell/sidebar.d.cts +47 -37
- package/dist/shell/sidebar.d.cts.map +1 -1
- package/dist/shell/sidebar.d.mts +47 -37
- package/dist/shell/sidebar.d.mts.map +1 -1
- package/dist/shell/sidebar.mjs +32 -32
- package/dist/shell/sidebar.mjs.map +1 -1
- package/dist/shell/use-mobile.cjs.map +1 -1
- package/dist/shell/use-mobile.mjs.map +1 -1
- package/dist/theme/index.d.cts +54 -54
- package/dist/theme/index.d.cts.map +1 -1
- package/dist/theme/index.d.mts +54 -54
- package/dist/theme/index.d.mts.map +1 -1
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.mts +3 -3
- package/dist/{types-ByG6Xy3C.d.mts → types-27AHMek-.d.cts} +4 -4
- package/dist/{types-ByG6Xy3C.d.mts.map → types-27AHMek-.d.cts.map} +1 -1
- package/dist/types-BXFX9bXp.cjs.map +1 -1
- package/dist/types-Bjmd7Fdx.mjs.map +1 -1
- package/dist/{types-BIXtQlHB.d.cts → types-C5Zs5V3E.d.mts} +29 -29
- package/dist/types-C5Zs5V3E.d.mts.map +1 -0
- package/dist/{types-Ctu-Zio6.d.cts → types-CeCPKvOv.d.mts} +4 -4
- package/dist/{types-Ctu-Zio6.d.cts.map → types-CeCPKvOv.d.mts.map} +1 -1
- package/dist/{types-C5OFJy-O.d.mts → types-DrzvahW8.d.cts} +29 -29
- package/dist/types-DrzvahW8.d.cts.map +1 -0
- package/dist/{widget-schema--PY1uMWx.d.cts → widget-schema-BKZgsNG7.d.mts} +59 -59
- package/dist/widget-schema-BKZgsNG7.d.mts.map +1 -0
- package/dist/{widget-schema-YkD5p3v4.d.mts → widget-schema-BSX2fVhW.d.cts} +59 -59
- package/dist/widget-schema-BSX2fVhW.d.cts.map +1 -0
- package/dist/widget-utils/index.d.cts +20 -20
- package/dist/widget-utils/index.d.mts +20 -20
- package/package.json +2 -2
- package/src/styles/globals.css +1 -0
- package/dist/index-Bxe_LIi8.d.cts.map +0 -1
- package/dist/index-CCAu2n19.d.mts.map +0 -1
- package/dist/types-BIXtQlHB.d.cts.map +0 -1
- package/dist/types-C5OFJy-O.d.mts.map +0 -1
- package/dist/widget-schema--PY1uMWx.d.cts.map +0 -1
- package/dist/widget-schema-YkD5p3v4.d.mts.map +0 -1
- package/styles/globals.css +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as WidgetSchema, o as WidgetType } from "../widget-schema-
|
|
2
|
-
import { c as BorderRadiusOptions, d as ColorOptions, h as GapOptions, l as ButtonSizeOptions, n as AlignOptions, p as FontSizeOptions, t as StrictOmit, x as SectionLayoutType, y as PaddingOptions } from "../index-
|
|
1
|
+
import { a as WidgetSchema, o as WidgetType } from "../widget-schema-BKZgsNG7.mjs";
|
|
2
|
+
import { c as BorderRadiusOptions, d as ColorOptions, h as GapOptions, l as ButtonSizeOptions, n as AlignOptions, p as FontSizeOptions, t as StrictOmit, x as SectionLayoutType, y as PaddingOptions } from "../index-Ka_HOwpb.mjs";
|
|
3
3
|
import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
|
4
4
|
|
|
5
5
|
//#region src/registries/property-schema-types.d.ts
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
* Tab configuration for organizing properties
|
|
8
|
+
*/
|
|
9
9
|
interface TabConfig {
|
|
10
10
|
/** Unique identifier for the tab */
|
|
11
11
|
id: string;
|
|
@@ -13,9 +13,9 @@ interface TabConfig {
|
|
|
13
13
|
label: string;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
* Property field type constant - single source of truth for field types.
|
|
17
|
+
* Use PROPERTY_FIELD_TYPES.text instead of "text" for type-safe comparisons.
|
|
18
|
+
*/
|
|
19
19
|
declare const PROPERTY_FIELD_TYPES: {
|
|
20
20
|
readonly text: "text";
|
|
21
21
|
readonly textarea: "textarea";
|
|
@@ -41,19 +41,19 @@ declare const PROPERTY_FIELD_TYPES: {
|
|
|
41
41
|
readonly cssUnit: "cssUnit";
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
* Union type of all property field types, derived from PROPERTY_FIELD_TYPES constant.
|
|
45
|
+
* @see deriving-typeof-for-object-keys pattern
|
|
46
|
+
*/
|
|
47
47
|
type PropertyFieldType = (typeof PROPERTY_FIELD_TYPES)[keyof typeof PROPERTY_FIELD_TYPES];
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
* Runtime validation for property field types.
|
|
50
|
+
* @param value - The value to check
|
|
51
|
+
* @returns true if value is a valid PropertyFieldType
|
|
52
|
+
*/
|
|
53
53
|
declare function isPropertyFieldType(value: string): value is PropertyFieldType;
|
|
54
54
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
* Base schema for a property field
|
|
56
|
+
*/
|
|
57
57
|
interface PropertyFieldSchema {
|
|
58
58
|
/** Property key in the widget props */
|
|
59
59
|
key: string;
|
|
@@ -70,8 +70,8 @@ interface PropertyFieldSchema {
|
|
|
70
70
|
/** Optional group for organizing fields within a tab */
|
|
71
71
|
group?: string;
|
|
72
72
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
* @deprecated Use requiresKeyValue instead
|
|
74
|
+
*/
|
|
75
75
|
requiresKeyToBeTrue?: string;
|
|
76
76
|
/** Optional requires a specific key to have a specific value */
|
|
77
77
|
requiresKeyValue?: {
|
|
@@ -80,16 +80,16 @@ interface PropertyFieldSchema {
|
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
* Text field schema
|
|
84
|
+
*/
|
|
85
85
|
interface TextFieldSchema extends PropertyFieldSchema {
|
|
86
86
|
type: "text";
|
|
87
87
|
placeholder?: string;
|
|
88
88
|
maxLength?: number;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
* Textarea field schema
|
|
92
|
+
*/
|
|
93
93
|
interface TextareaFieldSchema extends PropertyFieldSchema {
|
|
94
94
|
type: "textarea";
|
|
95
95
|
placeholder?: string;
|
|
@@ -97,8 +97,8 @@ interface TextareaFieldSchema extends PropertyFieldSchema {
|
|
|
97
97
|
maxLength?: number;
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
* Number field schema
|
|
101
|
+
*/
|
|
102
102
|
interface NumberFieldSchema extends PropertyFieldSchema {
|
|
103
103
|
type: "number";
|
|
104
104
|
min?: number;
|
|
@@ -106,15 +106,15 @@ interface NumberFieldSchema extends PropertyFieldSchema {
|
|
|
106
106
|
step?: number;
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
* Boolean field schema
|
|
110
|
+
*/
|
|
111
111
|
interface BooleanFieldSchema extends PropertyFieldSchema {
|
|
112
112
|
type: "boolean";
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
* Select field schema with type-safe option values.
|
|
116
|
+
* Uses StrictOmit to ensure "defaultValue" key exists on PropertyFieldSchema.
|
|
117
|
+
*/
|
|
118
118
|
interface SelectFieldSchema<T extends string | number = string | number> extends StrictOmit<PropertyFieldSchema, "defaultValue"> {
|
|
119
119
|
type: "select";
|
|
120
120
|
options: Array<{
|
|
@@ -124,14 +124,14 @@ interface SelectFieldSchema<T extends string | number = string | number> extends
|
|
|
124
124
|
defaultValue?: T;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
* Color field schema
|
|
128
|
+
*/
|
|
129
129
|
interface ColorFieldSchema extends PropertyFieldSchema {
|
|
130
130
|
type: "color";
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
* Range slider field schema
|
|
134
|
+
*/
|
|
135
135
|
interface RangeFieldSchema extends PropertyFieldSchema {
|
|
136
136
|
type: "range";
|
|
137
137
|
min: number;
|
|
@@ -139,28 +139,28 @@ interface RangeFieldSchema extends PropertyFieldSchema {
|
|
|
139
139
|
step?: number;
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
* Data source field schema for configuring widget data sources
|
|
143
|
+
*/
|
|
144
144
|
interface DataSourceFieldSchema extends PropertyFieldSchema {
|
|
145
145
|
type: "dataSource";
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
* Resource field schema for selecting a single resource from the selection modal
|
|
149
|
+
*/
|
|
150
150
|
interface ResourceFieldSchema extends PropertyFieldSchema {
|
|
151
151
|
type: "resource";
|
|
152
152
|
/** Optional filter to specific shareable types */
|
|
153
153
|
allowedTypes?: string[];
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
* Image field schema for selecting a single image from the image picker
|
|
157
|
+
*/
|
|
158
158
|
interface ImageFieldSchema extends PropertyFieldSchema {
|
|
159
159
|
type: "image";
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
* Alignment field schema
|
|
163
|
+
*/
|
|
164
164
|
interface AlignmentFieldSchema extends PropertyFieldSchema {
|
|
165
165
|
type: "alignment";
|
|
166
166
|
options: {
|
|
@@ -170,8 +170,8 @@ interface AlignmentFieldSchema extends PropertyFieldSchema {
|
|
|
170
170
|
defaultValue?: AlignOptions;
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
* Slider field schema with optional unit suffix (e.g., "rem", "px")
|
|
174
|
+
*/
|
|
175
175
|
interface SliderFieldSchema extends PropertyFieldSchema {
|
|
176
176
|
type: "slider";
|
|
177
177
|
min: number;
|
|
@@ -180,29 +180,29 @@ interface SliderFieldSchema extends PropertyFieldSchema {
|
|
|
180
180
|
unit?: string;
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
* Color picker field schema with optional swatches
|
|
184
|
+
*/
|
|
185
185
|
interface ColorPickerFieldSchema extends PropertyFieldSchema {
|
|
186
186
|
type: "colorPicker";
|
|
187
187
|
swatches?: string[];
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
* Section header field schema for visual grouping
|
|
191
|
+
*/
|
|
192
192
|
interface SectionHeaderFieldSchema extends PropertyFieldSchema {
|
|
193
193
|
type: "sectionHeader";
|
|
194
194
|
subtitle?: string;
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
* Separator field schema for visual separation
|
|
198
|
+
*/
|
|
199
199
|
interface SeparatorFieldSchema extends PropertyFieldSchema {
|
|
200
200
|
type: "separator";
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
* Button group field schema.
|
|
204
|
+
* Uses StrictOmit to ensure "defaultValue" key exists on PropertyFieldSchema.
|
|
205
|
+
*/
|
|
206
206
|
interface ButtonGroupFieldSchema<T extends string | number = string | number> extends StrictOmit<PropertyFieldSchema, "defaultValue"> {
|
|
207
207
|
type: "buttonGroup";
|
|
208
208
|
options: Array<{
|
|
@@ -213,47 +213,47 @@ interface ButtonGroupFieldSchema<T extends string | number = string | number> ex
|
|
|
213
213
|
defaultValue?: T;
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
* Color select field schema
|
|
217
|
+
*/
|
|
218
218
|
interface ColorSelectFieldSchema extends PropertyFieldSchema {
|
|
219
219
|
type: "colorSelect";
|
|
220
220
|
defaultValue?: ColorOptions;
|
|
221
221
|
}
|
|
222
222
|
/**
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
* Section layout select field schema for visual masonry layout selector
|
|
224
|
+
*/
|
|
225
225
|
interface SectionLayoutSelectFieldSchema extends PropertyFieldSchema {
|
|
226
226
|
type: "sectionLayoutSelect";
|
|
227
227
|
defaultValue?: SectionLayoutType;
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
* Background field combines resource selection and color properties.
|
|
231
|
+
* Uses StrictOmit to exclude conflicting "type" discriminant from parents.
|
|
232
|
+
*/
|
|
233
233
|
interface BackgroundFieldSchema extends StrictOmit<ResourceFieldSchema, "type">, StrictOmit<ColorFieldSchema, "type"> {
|
|
234
234
|
type: "background";
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
* Content position field schema for 3x3 grid position picker
|
|
238
|
+
*/
|
|
239
239
|
interface ContentPositionFieldSchema extends PropertyFieldSchema {
|
|
240
240
|
type: "contentPosition";
|
|
241
241
|
defaultValue?: string;
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
* Text size select field schema for visual font size selector
|
|
245
|
+
*/
|
|
246
246
|
interface TextSizeSelectFieldSchema extends PropertyFieldSchema {
|
|
247
247
|
type: "textSizeSelect";
|
|
248
248
|
defaultValue?: FontSizeOptions;
|
|
249
249
|
}
|
|
250
250
|
/**
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
* CSS unit type for height/width fields
|
|
252
|
+
*/
|
|
253
253
|
type CssUnit = "px" | "rem" | "vh";
|
|
254
254
|
/**
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
* CSS unit field schema for numeric values with selectable units (px, rem, vh)
|
|
256
|
+
*/
|
|
257
257
|
interface CssUnitFieldSchema extends PropertyFieldSchema {
|
|
258
258
|
type: "cssUnit";
|
|
259
259
|
min?: number;
|
|
@@ -263,14 +263,14 @@ interface CssUnitFieldSchema extends PropertyFieldSchema {
|
|
|
263
263
|
defaultUnit?: CssUnit;
|
|
264
264
|
}
|
|
265
265
|
/**
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
* Union of all field schema types
|
|
267
|
+
*/
|
|
268
268
|
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;
|
|
269
269
|
/**
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
270
|
+
* Schema for per-item configuration in custom data sources.
|
|
271
|
+
* Widgets can define this to allow users to configure widget-specific
|
|
272
|
+
* settings for each selected item (e.g., title, description, button).
|
|
273
|
+
*/
|
|
274
274
|
interface ItemConfigSchema {
|
|
275
275
|
/** Fields available for per-item configuration */
|
|
276
276
|
fields: PropertyField[];
|
|
@@ -278,8 +278,8 @@ interface ItemConfigSchema {
|
|
|
278
278
|
description?: string;
|
|
279
279
|
}
|
|
280
280
|
/**
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
* Schema for a widget's editable properties
|
|
282
|
+
*/
|
|
283
283
|
interface WidgetPropertySchema {
|
|
284
284
|
/** Widget type this schema applies to */
|
|
285
285
|
widgetType: WidgetType;
|
|
@@ -297,20 +297,20 @@ interface WidgetPropertySchema {
|
|
|
297
297
|
itemConfigSchema?: ItemConfigSchema;
|
|
298
298
|
}
|
|
299
299
|
/**
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
* Registry mapping widget types to their property schemas
|
|
301
|
+
*/
|
|
302
302
|
type PropertySchemaRegistry = Record<WidgetType, WidgetPropertySchema>;
|
|
303
303
|
/**
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
* Group property fields by their group property
|
|
305
|
+
*/
|
|
306
306
|
declare function groupPropertyFields(fields: readonly PropertyField[]): Record<string, PropertyField[]>;
|
|
307
307
|
/**
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
* Extract current values from widget props based on property fields
|
|
309
|
+
*/
|
|
310
310
|
declare function extractPropertyValues(widget: Readonly<WidgetSchema>, fields: readonly PropertyField[]): Record<string, unknown>;
|
|
311
311
|
/**
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
* Apply property values to widget props
|
|
313
|
+
*/
|
|
314
314
|
declare function applyPropertyValues(widget: Readonly<WidgetSchema>, values: Readonly<Record<string, unknown>>): WidgetSchema;
|
|
315
315
|
//#endregion
|
|
316
316
|
//#region src/registries/field-helpers.d.ts
|
|
@@ -322,9 +322,9 @@ declare const getFontSizeField: (props: Readonly<Omit<TextSizeSelectFieldSchema,
|
|
|
322
322
|
declare const getGapField: (props: Readonly<Omit<ButtonGroupFieldSchema<GapOptions>, "options" | "type">>) => ButtonGroupFieldSchema<GapOptions>;
|
|
323
323
|
declare const getHeightField: (props: Readonly<Omit<CssUnitFieldSchema, "type">>) => CssUnitFieldSchema;
|
|
324
324
|
/**
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
325
|
+
* Gap value mapping - use `as const satisfies` for compile-time validation
|
|
326
|
+
* with literal type preservation.
|
|
327
|
+
*/
|
|
328
328
|
declare const gapValues: {
|
|
329
329
|
readonly none: 0;
|
|
330
330
|
readonly xs: 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/registries/property-schema-types.ts","../../src/registries/field-helpers.ts"],"mappings":";;;;;;;;UAciB,SAAA;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/registries/property-schema-types.ts","../../src/registries/field-helpers.ts"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/registries/property-schema-types.ts","../../src/registries/field-helpers.ts"],"sourcesContent":["import type { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport type {\n WidgetType,\n WidgetSchema,\n AlignOptions,\n ColorOptions,\n FontSizeOptions,\n SectionLayoutType,\n StrictOmit,\n} from \"../types\";\n\n/**\n * Tab configuration for organizing properties\n */\nexport interface TabConfig {\n /** Unique identifier for the tab */\n id: string;\n /** Display label for the tab */\n label: string;\n}\n\n// ============================================================================\n// Property Field Types - Derive from constant for single source of truth\n// ============================================================================\n\n/**\n * Property field type constant - single source of truth for field types.\n * Use PROPERTY_FIELD_TYPES.text instead of \"text\" for type-safe comparisons.\n */\nexport const PROPERTY_FIELD_TYPES = {\n text: \"text\",\n textarea: \"textarea\",\n number: \"number\",\n boolean: \"boolean\",\n select: \"select\",\n color: \"color\",\n range: \"range\",\n dataSource: \"dataSource\",\n resource: \"resource\",\n image: \"image\",\n alignment: \"alignment\",\n slider: \"slider\",\n colorPicker: \"colorPicker\",\n sectionHeader: \"sectionHeader\",\n separator: \"separator\",\n buttonGroup: \"buttonGroup\",\n colorSelect: \"colorSelect\",\n sectionLayoutSelect: \"sectionLayoutSelect\",\n background: \"background\",\n contentPosition: \"contentPosition\",\n textSizeSelect: \"textSizeSelect\",\n cssUnit: \"cssUnit\",\n} as const;\n\n/**\n * Union type of all property field types, derived from PROPERTY_FIELD_TYPES constant.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type PropertyFieldType =\n (typeof PROPERTY_FIELD_TYPES)[keyof typeof PROPERTY_FIELD_TYPES];\n\n/**\n * Runtime validation for property field types.\n * @param value - The value to check\n * @returns true if value is a valid PropertyFieldType\n */\nexport function isPropertyFieldType(value: string): value is PropertyFieldType {\n return Object.values(PROPERTY_FIELD_TYPES).includes(\n value as PropertyFieldType,\n );\n}\n\n/**\n * Base schema for a property field\n */\nexport interface PropertyFieldSchema {\n /** Property key in the widget props */\n key: string;\n /** Display label for the field */\n label: string;\n /** Field type determines the input control */\n type: PropertyFieldType;\n /** Optional description/help text */\n description?: string;\n /** Optional default value */\n defaultValue?: unknown;\n /** Optional tab ID (must match a TabConfig id if widget has tabsConfig) */\n tab?: string;\n /** Optional group for organizing fields within a tab */\n group?: string;\n /**\n * @deprecated Use requiresKeyValue instead\n */\n requiresKeyToBeTrue?: string;\n /** Optional requires a specific key to have a specific value */\n requiresKeyValue?: { key: string; value: unknown };\n}\n\n/**\n * Text field schema\n */\nexport interface TextFieldSchema extends PropertyFieldSchema {\n type: \"text\";\n placeholder?: string;\n maxLength?: number;\n}\n\n/**\n * Textarea field schema\n */\nexport interface TextareaFieldSchema extends PropertyFieldSchema {\n type: \"textarea\";\n placeholder?: string;\n rows?: number;\n maxLength?: number;\n}\n\n/**\n * Number field schema\n */\nexport interface NumberFieldSchema extends PropertyFieldSchema {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number;\n}\n\n/**\n * Boolean field schema\n */\nexport interface BooleanFieldSchema extends PropertyFieldSchema {\n type: \"boolean\";\n}\n\n/**\n * Select field schema with type-safe option values.\n * Uses StrictOmit to ensure \"defaultValue\" key exists on PropertyFieldSchema.\n */\nexport interface SelectFieldSchema<\n T extends string | number = string | number,\n> extends StrictOmit<PropertyFieldSchema, \"defaultValue\"> {\n type: \"select\";\n options: Array<{ label: string; value: T }>;\n defaultValue?: T;\n}\n\n/**\n * Color field schema\n */\nexport interface ColorFieldSchema extends PropertyFieldSchema {\n type: \"color\";\n}\n\n/**\n * Range slider field schema\n */\nexport interface RangeFieldSchema extends PropertyFieldSchema {\n type: \"range\";\n min: number;\n max: number;\n step?: number;\n}\n\n/**\n * Data source field schema for configuring widget data sources\n */\nexport interface DataSourceFieldSchema extends PropertyFieldSchema {\n type: \"dataSource\";\n}\n\n/**\n * Resource field schema for selecting a single resource from the selection modal\n */\nexport interface ResourceFieldSchema extends PropertyFieldSchema {\n type: \"resource\";\n /** Optional filter to specific shareable types */\n allowedTypes?: string[];\n}\n\n/**\n * Image field schema for selecting a single image from the image picker\n */\nexport interface ImageFieldSchema extends PropertyFieldSchema {\n type: \"image\";\n}\n\n/**\n * Alignment field schema\n */\nexport interface AlignmentFieldSchema extends PropertyFieldSchema {\n type: \"alignment\";\n options: {\n verticalEnabled: boolean;\n horizontalEnabled: boolean;\n };\n defaultValue?: AlignOptions;\n}\n\n/**\n * Slider field schema with optional unit suffix (e.g., \"rem\", \"px\")\n */\nexport interface SliderFieldSchema extends PropertyFieldSchema {\n type: \"slider\";\n min: number;\n max: number;\n step?: number;\n unit?: string;\n}\n\n/**\n * Color picker field schema with optional swatches\n */\nexport interface ColorPickerFieldSchema extends PropertyFieldSchema {\n type: \"colorPicker\";\n swatches?: string[];\n}\n\n/**\n * Section header field schema for visual grouping\n */\nexport interface SectionHeaderFieldSchema extends PropertyFieldSchema {\n type: \"sectionHeader\";\n subtitle?: string;\n}\n\n/**\n * Separator field schema for visual separation\n */\nexport interface SeparatorFieldSchema extends PropertyFieldSchema {\n type: \"separator\";\n}\n\n/**\n * Button group field schema.\n * Uses StrictOmit to ensure \"defaultValue\" key exists on PropertyFieldSchema.\n */\nexport interface ButtonGroupFieldSchema<\n T extends string | number = string | number,\n> extends StrictOmit<PropertyFieldSchema, \"defaultValue\"> {\n type: \"buttonGroup\";\n options: Array<{ label?: string; icon?: IconDefinition; value: T }>;\n defaultValue?: T;\n}\n\n/**\n * Color select field schema\n */\nexport interface ColorSelectFieldSchema extends PropertyFieldSchema {\n type: \"colorSelect\";\n defaultValue?: ColorOptions;\n}\n\n/**\n * Section layout select field schema for visual masonry layout selector\n */\nexport interface SectionLayoutSelectFieldSchema extends PropertyFieldSchema {\n type: \"sectionLayoutSelect\";\n defaultValue?: SectionLayoutType;\n}\n\n/**\n * Background field combines resource selection and color properties.\n * Uses StrictOmit to exclude conflicting \"type\" discriminant from parents.\n */\nexport interface BackgroundFieldSchema\n extends\n StrictOmit<ResourceFieldSchema, \"type\">,\n StrictOmit<ColorFieldSchema, \"type\"> {\n type: \"background\";\n}\n\n/**\n * Content position field schema for 3x3 grid position picker\n */\nexport interface ContentPositionFieldSchema extends PropertyFieldSchema {\n type: \"contentPosition\";\n defaultValue?: string;\n}\n\n/**\n * Text size select field schema for visual font size selector\n */\nexport interface TextSizeSelectFieldSchema extends PropertyFieldSchema {\n type: \"textSizeSelect\";\n defaultValue?: FontSizeOptions;\n}\n\n/**\n * CSS unit type for height/width fields\n */\nexport type CssUnit = \"px\" | \"rem\" | \"vh\";\n\n/**\n * CSS unit field schema for numeric values with selectable units (px, rem, vh)\n */\nexport interface CssUnitFieldSchema extends PropertyFieldSchema {\n type: \"cssUnit\";\n min?: number;\n max?: number;\n step?: number;\n allowedUnits?: CssUnit[];\n defaultUnit?: CssUnit;\n}\n\n/**\n * Union of all field schema types\n */\nexport type PropertyField =\n | TextFieldSchema\n | TextareaFieldSchema\n | NumberFieldSchema\n | BooleanFieldSchema\n | SelectFieldSchema<string | number>\n | ColorFieldSchema\n | RangeFieldSchema\n | DataSourceFieldSchema\n | ResourceFieldSchema\n | ImageFieldSchema\n | AlignmentFieldSchema\n | SliderFieldSchema\n | ColorPickerFieldSchema\n | SectionHeaderFieldSchema\n | SeparatorFieldSchema\n | ButtonGroupFieldSchema<string | number>\n | ColorSelectFieldSchema\n | SectionLayoutSelectFieldSchema\n | BackgroundFieldSchema\n | ContentPositionFieldSchema\n | TextSizeSelectFieldSchema\n | CssUnitFieldSchema;\n\n/**\n * Schema for per-item configuration in custom data sources.\n * Widgets can define this to allow users to configure widget-specific\n * settings for each selected item (e.g., title, description, button).\n */\nexport interface ItemConfigSchema {\n /** Fields available for per-item configuration */\n fields: PropertyField[];\n /** Optional description shown at top of item config panel */\n description?: string;\n}\n\n/**\n * Schema for a widget's editable properties\n */\nexport interface WidgetPropertySchema {\n /** Widget type this schema applies to */\n widgetType: WidgetType;\n /** Display name for the widget */\n displayName: string;\n /** Optional tab configuration - if present, tabs are enabled */\n tabsConfig?: TabConfig[];\n /** Editable property fields */\n fields: PropertyField[];\n /** Optional custom validator function */\n validate?: (props: Record<string, unknown>) => string | null;\n /** Props that can be populated from data sources */\n dataSourceTargetProps?: string[];\n /** Optional schema for per-item configurations in custom data sources */\n itemConfigSchema?: ItemConfigSchema;\n}\n\n/**\n * Registry mapping widget types to their property schemas\n */\nexport type PropertySchemaRegistry = Record<WidgetType, WidgetPropertySchema>;\n\n/**\n * Group property fields by their group property\n */\nexport function groupPropertyFields(\n fields: readonly PropertyField[],\n): Record<string, PropertyField[]> {\n const grouped: Record<string, PropertyField[]> = {};\n\n fields.forEach((field) => {\n const group = field.group || \"General\";\n if (!grouped[group]) {\n grouped[group] = [];\n }\n grouped[group].push(field);\n });\n\n return grouped;\n}\n\n/**\n * Extract current values from widget props based on property fields\n */\nexport function extractPropertyValues(\n widget: Readonly<WidgetSchema>,\n fields: readonly PropertyField[],\n): Record<string, unknown> {\n const values: Record<string, unknown> = {};\n\n fields.forEach((field) => {\n const value = widget.props[field.key];\n values[field.key] = value !== undefined ? value : field.defaultValue;\n });\n\n return values;\n}\n\n/**\n * Apply property values to widget props\n */\nexport function applyPropertyValues(\n widget: Readonly<WidgetSchema>,\n values: Readonly<Record<string, unknown>>,\n): WidgetSchema {\n return {\n ...widget,\n props: {\n ...widget.props,\n ...values,\n },\n };\n}\n","import type {\n ButtonGroupFieldSchema,\n ColorSelectFieldSchema,\n CssUnitFieldSchema,\n TextSizeSelectFieldSchema,\n} from \"./property-schema-types\";\nimport type {\n BorderRadiusOptions,\n PaddingOptions,\n ButtonSizeOptions,\n GapOptions,\n} from \"../types\";\nimport { faBan } from \"@fortawesome/pro-regular-svg-icons\";\n\nexport const getColorField = (\n props: Readonly<Omit<ColorSelectFieldSchema, \"type\">>,\n): ColorSelectFieldSchema => {\n return {\n ...props,\n type: \"colorSelect\",\n };\n};\n\nexport const getBorderRadiusField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<BorderRadiusOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<BorderRadiusOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: \"none\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n { label: \"FULL\", value: \"full\" },\n ],\n };\n};\n\nexport const getPaddingField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<PaddingOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<PaddingOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: 0 },\n { label: \"SM\", value: 2 },\n { label: \"MD\", value: 4 },\n { label: \"LG\", value: 6 },\n { label: \"XL\", value: 8 },\n { label: \"FULL\", value: 10 },\n ],\n };\n};\n\nexport const getButtonSizeField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<ButtonSizeOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<ButtonSizeOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"default\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n ],\n };\n};\n\nexport const getFontSizeField = (\n props: Readonly<Omit<TextSizeSelectFieldSchema, \"type\">>,\n): TextSizeSelectFieldSchema => {\n return {\n ...props,\n type: \"textSizeSelect\",\n };\n};\n\nexport const getGapField = (\n props: Readonly<Omit<ButtonGroupFieldSchema<GapOptions>, \"options\" | \"type\">>,\n): ButtonGroupFieldSchema<GapOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: \"none\" },\n { label: \"XS\", value: \"xs\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n ],\n };\n};\n\nexport const getHeightField = (\n props: Readonly<Omit<CssUnitFieldSchema, \"type\">>,\n): CssUnitFieldSchema => {\n return {\n ...props,\n type: \"cssUnit\",\n };\n};\n\n/**\n * Gap value mapping - use `as const satisfies` for compile-time validation\n * with literal type preservation.\n */\nexport const gapValues = {\n none: 0,\n xs: 1,\n sm: 2,\n md: 4,\n lg: 6,\n xl: 8,\n} as const satisfies Record<GapOptions, number>;\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/registries/property-schema-types.ts","../../src/registries/field-helpers.ts"],"sourcesContent":["import type { IconDefinition } from \"@fortawesome/fontawesome-svg-core\";\nimport type {\n WidgetType,\n WidgetSchema,\n AlignOptions,\n ColorOptions,\n FontSizeOptions,\n SectionLayoutType,\n StrictOmit,\n} from \"../types\";\n\n/**\n * Tab configuration for organizing properties\n */\nexport interface TabConfig {\n /** Unique identifier for the tab */\n id: string;\n /** Display label for the tab */\n label: string;\n}\n\n// ============================================================================\n// Property Field Types - Derive from constant for single source of truth\n// ============================================================================\n\n/**\n * Property field type constant - single source of truth for field types.\n * Use PROPERTY_FIELD_TYPES.text instead of \"text\" for type-safe comparisons.\n */\nexport const PROPERTY_FIELD_TYPES = {\n text: \"text\",\n textarea: \"textarea\",\n number: \"number\",\n boolean: \"boolean\",\n select: \"select\",\n color: \"color\",\n range: \"range\",\n dataSource: \"dataSource\",\n resource: \"resource\",\n image: \"image\",\n alignment: \"alignment\",\n slider: \"slider\",\n colorPicker: \"colorPicker\",\n sectionHeader: \"sectionHeader\",\n separator: \"separator\",\n buttonGroup: \"buttonGroup\",\n colorSelect: \"colorSelect\",\n sectionLayoutSelect: \"sectionLayoutSelect\",\n background: \"background\",\n contentPosition: \"contentPosition\",\n textSizeSelect: \"textSizeSelect\",\n cssUnit: \"cssUnit\",\n} as const;\n\n/**\n * Union type of all property field types, derived from PROPERTY_FIELD_TYPES constant.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type PropertyFieldType =\n (typeof PROPERTY_FIELD_TYPES)[keyof typeof PROPERTY_FIELD_TYPES];\n\n/**\n * Runtime validation for property field types.\n * @param value - The value to check\n * @returns true if value is a valid PropertyFieldType\n */\nexport function isPropertyFieldType(value: string): value is PropertyFieldType {\n return Object.values(PROPERTY_FIELD_TYPES).includes(\n value as PropertyFieldType,\n );\n}\n\n/**\n * Base schema for a property field\n */\nexport interface PropertyFieldSchema {\n /** Property key in the widget props */\n key: string;\n /** Display label for the field */\n label: string;\n /** Field type determines the input control */\n type: PropertyFieldType;\n /** Optional description/help text */\n description?: string;\n /** Optional default value */\n defaultValue?: unknown;\n /** Optional tab ID (must match a TabConfig id if widget has tabsConfig) */\n tab?: string;\n /** Optional group for organizing fields within a tab */\n group?: string;\n /**\n * @deprecated Use requiresKeyValue instead\n */\n requiresKeyToBeTrue?: string;\n /** Optional requires a specific key to have a specific value */\n requiresKeyValue?: { key: string; value: unknown };\n}\n\n/**\n * Text field schema\n */\nexport interface TextFieldSchema extends PropertyFieldSchema {\n type: \"text\";\n placeholder?: string;\n maxLength?: number;\n}\n\n/**\n * Textarea field schema\n */\nexport interface TextareaFieldSchema extends PropertyFieldSchema {\n type: \"textarea\";\n placeholder?: string;\n rows?: number;\n maxLength?: number;\n}\n\n/**\n * Number field schema\n */\nexport interface NumberFieldSchema extends PropertyFieldSchema {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number;\n}\n\n/**\n * Boolean field schema\n */\nexport interface BooleanFieldSchema extends PropertyFieldSchema {\n type: \"boolean\";\n}\n\n/**\n * Select field schema with type-safe option values.\n * Uses StrictOmit to ensure \"defaultValue\" key exists on PropertyFieldSchema.\n */\nexport interface SelectFieldSchema<\n T extends string | number = string | number,\n> extends StrictOmit<PropertyFieldSchema, \"defaultValue\"> {\n type: \"select\";\n options: Array<{ label: string; value: T }>;\n defaultValue?: T;\n}\n\n/**\n * Color field schema\n */\nexport interface ColorFieldSchema extends PropertyFieldSchema {\n type: \"color\";\n}\n\n/**\n * Range slider field schema\n */\nexport interface RangeFieldSchema extends PropertyFieldSchema {\n type: \"range\";\n min: number;\n max: number;\n step?: number;\n}\n\n/**\n * Data source field schema for configuring widget data sources\n */\nexport interface DataSourceFieldSchema extends PropertyFieldSchema {\n type: \"dataSource\";\n}\n\n/**\n * Resource field schema for selecting a single resource from the selection modal\n */\nexport interface ResourceFieldSchema extends PropertyFieldSchema {\n type: \"resource\";\n /** Optional filter to specific shareable types */\n allowedTypes?: string[];\n}\n\n/**\n * Image field schema for selecting a single image from the image picker\n */\nexport interface ImageFieldSchema extends PropertyFieldSchema {\n type: \"image\";\n}\n\n/**\n * Alignment field schema\n */\nexport interface AlignmentFieldSchema extends PropertyFieldSchema {\n type: \"alignment\";\n options: {\n verticalEnabled: boolean;\n horizontalEnabled: boolean;\n };\n defaultValue?: AlignOptions;\n}\n\n/**\n * Slider field schema with optional unit suffix (e.g., \"rem\", \"px\")\n */\nexport interface SliderFieldSchema extends PropertyFieldSchema {\n type: \"slider\";\n min: number;\n max: number;\n step?: number;\n unit?: string;\n}\n\n/**\n * Color picker field schema with optional swatches\n */\nexport interface ColorPickerFieldSchema extends PropertyFieldSchema {\n type: \"colorPicker\";\n swatches?: string[];\n}\n\n/**\n * Section header field schema for visual grouping\n */\nexport interface SectionHeaderFieldSchema extends PropertyFieldSchema {\n type: \"sectionHeader\";\n subtitle?: string;\n}\n\n/**\n * Separator field schema for visual separation\n */\nexport interface SeparatorFieldSchema extends PropertyFieldSchema {\n type: \"separator\";\n}\n\n/**\n * Button group field schema.\n * Uses StrictOmit to ensure \"defaultValue\" key exists on PropertyFieldSchema.\n */\nexport interface ButtonGroupFieldSchema<\n T extends string | number = string | number,\n> extends StrictOmit<PropertyFieldSchema, \"defaultValue\"> {\n type: \"buttonGroup\";\n options: Array<{ label?: string; icon?: IconDefinition; value: T }>;\n defaultValue?: T;\n}\n\n/**\n * Color select field schema\n */\nexport interface ColorSelectFieldSchema extends PropertyFieldSchema {\n type: \"colorSelect\";\n defaultValue?: ColorOptions;\n}\n\n/**\n * Section layout select field schema for visual masonry layout selector\n */\nexport interface SectionLayoutSelectFieldSchema extends PropertyFieldSchema {\n type: \"sectionLayoutSelect\";\n defaultValue?: SectionLayoutType;\n}\n\n/**\n * Background field combines resource selection and color properties.\n * Uses StrictOmit to exclude conflicting \"type\" discriminant from parents.\n */\nexport interface BackgroundFieldSchema\n extends\n StrictOmit<ResourceFieldSchema, \"type\">,\n StrictOmit<ColorFieldSchema, \"type\"> {\n type: \"background\";\n}\n\n/**\n * Content position field schema for 3x3 grid position picker\n */\nexport interface ContentPositionFieldSchema extends PropertyFieldSchema {\n type: \"contentPosition\";\n defaultValue?: string;\n}\n\n/**\n * Text size select field schema for visual font size selector\n */\nexport interface TextSizeSelectFieldSchema extends PropertyFieldSchema {\n type: \"textSizeSelect\";\n defaultValue?: FontSizeOptions;\n}\n\n/**\n * CSS unit type for height/width fields\n */\nexport type CssUnit = \"px\" | \"rem\" | \"vh\";\n\n/**\n * CSS unit field schema for numeric values with selectable units (px, rem, vh)\n */\nexport interface CssUnitFieldSchema extends PropertyFieldSchema {\n type: \"cssUnit\";\n min?: number;\n max?: number;\n step?: number;\n allowedUnits?: CssUnit[];\n defaultUnit?: CssUnit;\n}\n\n/**\n * Union of all field schema types\n */\nexport type PropertyField =\n | TextFieldSchema\n | TextareaFieldSchema\n | NumberFieldSchema\n | BooleanFieldSchema\n | SelectFieldSchema<string | number>\n | ColorFieldSchema\n | RangeFieldSchema\n | DataSourceFieldSchema\n | ResourceFieldSchema\n | ImageFieldSchema\n | AlignmentFieldSchema\n | SliderFieldSchema\n | ColorPickerFieldSchema\n | SectionHeaderFieldSchema\n | SeparatorFieldSchema\n | ButtonGroupFieldSchema<string | number>\n | ColorSelectFieldSchema\n | SectionLayoutSelectFieldSchema\n | BackgroundFieldSchema\n | ContentPositionFieldSchema\n | TextSizeSelectFieldSchema\n | CssUnitFieldSchema;\n\n/**\n * Schema for per-item configuration in custom data sources.\n * Widgets can define this to allow users to configure widget-specific\n * settings for each selected item (e.g., title, description, button).\n */\nexport interface ItemConfigSchema {\n /** Fields available for per-item configuration */\n fields: PropertyField[];\n /** Optional description shown at top of item config panel */\n description?: string;\n}\n\n/**\n * Schema for a widget's editable properties\n */\nexport interface WidgetPropertySchema {\n /** Widget type this schema applies to */\n widgetType: WidgetType;\n /** Display name for the widget */\n displayName: string;\n /** Optional tab configuration - if present, tabs are enabled */\n tabsConfig?: TabConfig[];\n /** Editable property fields */\n fields: PropertyField[];\n /** Optional custom validator function */\n validate?: (props: Record<string, unknown>) => string | null;\n /** Props that can be populated from data sources */\n dataSourceTargetProps?: string[];\n /** Optional schema for per-item configurations in custom data sources */\n itemConfigSchema?: ItemConfigSchema;\n}\n\n/**\n * Registry mapping widget types to their property schemas\n */\nexport type PropertySchemaRegistry = Record<WidgetType, WidgetPropertySchema>;\n\n/**\n * Group property fields by their group property\n */\nexport function groupPropertyFields(\n fields: readonly PropertyField[],\n): Record<string, PropertyField[]> {\n const grouped: Record<string, PropertyField[]> = {};\n\n fields.forEach((field) => {\n const group = field.group || \"General\";\n if (!grouped[group]) {\n grouped[group] = [];\n }\n grouped[group].push(field);\n });\n\n return grouped;\n}\n\n/**\n * Extract current values from widget props based on property fields\n */\nexport function extractPropertyValues(\n widget: Readonly<WidgetSchema>,\n fields: readonly PropertyField[],\n): Record<string, unknown> {\n const values: Record<string, unknown> = {};\n\n fields.forEach((field) => {\n const value = widget.props[field.key];\n values[field.key] = value !== undefined ? value : field.defaultValue;\n });\n\n return values;\n}\n\n/**\n * Apply property values to widget props\n */\nexport function applyPropertyValues(\n widget: Readonly<WidgetSchema>,\n values: Readonly<Record<string, unknown>>,\n): WidgetSchema {\n return {\n ...widget,\n props: {\n ...widget.props,\n ...values,\n },\n };\n}\n","import type {\n ButtonGroupFieldSchema,\n ColorSelectFieldSchema,\n CssUnitFieldSchema,\n TextSizeSelectFieldSchema,\n} from \"./property-schema-types\";\nimport type {\n BorderRadiusOptions,\n PaddingOptions,\n ButtonSizeOptions,\n GapOptions,\n} from \"../types\";\nimport { faBan } from \"@fortawesome/pro-regular-svg-icons\";\n\nexport const getColorField = (\n props: Readonly<Omit<ColorSelectFieldSchema, \"type\">>,\n): ColorSelectFieldSchema => {\n return {\n ...props,\n type: \"colorSelect\",\n };\n};\n\nexport const getBorderRadiusField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<BorderRadiusOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<BorderRadiusOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: \"none\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n { label: \"FULL\", value: \"full\" },\n ],\n };\n};\n\nexport const getPaddingField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<PaddingOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<PaddingOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: 0 },\n { label: \"SM\", value: 2 },\n { label: \"MD\", value: 4 },\n { label: \"LG\", value: 6 },\n { label: \"XL\", value: 8 },\n { label: \"FULL\", value: 10 },\n ],\n };\n};\n\nexport const getButtonSizeField = (\n props: Readonly<\n Omit<ButtonGroupFieldSchema<ButtonSizeOptions>, \"options\" | \"type\">\n >,\n): ButtonGroupFieldSchema<ButtonSizeOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"default\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n ],\n };\n};\n\nexport const getFontSizeField = (\n props: Readonly<Omit<TextSizeSelectFieldSchema, \"type\">>,\n): TextSizeSelectFieldSchema => {\n return {\n ...props,\n type: \"textSizeSelect\",\n };\n};\n\nexport const getGapField = (\n props: Readonly<Omit<ButtonGroupFieldSchema<GapOptions>, \"options\" | \"type\">>,\n): ButtonGroupFieldSchema<GapOptions> => {\n return {\n ...props,\n type: \"buttonGroup\",\n options: [\n { icon: faBan, value: \"none\" },\n { label: \"XS\", value: \"xs\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n ],\n };\n};\n\nexport const getHeightField = (\n props: Readonly<Omit<CssUnitFieldSchema, \"type\">>,\n): CssUnitFieldSchema => {\n return {\n ...props,\n type: \"cssUnit\",\n };\n};\n\n/**\n * Gap value mapping - use `as const satisfies` for compile-time validation\n * with literal type preservation.\n */\nexport const gapValues: {\n readonly none: 0;\n readonly xs: 1;\n readonly sm: 2;\n readonly md: 4;\n readonly lg: 6;\n readonly xl: 8;\n} = {\n none: 0,\n xs: 1,\n sm: 2,\n md: 4,\n lg: 6,\n xl: 8,\n} as const satisfies Record<GapOptions, number>;\n"],"mappings":";;;;;;AA6BA,MAAa,uBAAuB;CAClC,MAAM;CACN,UAAU;CACV,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,OAAO;CACP,OAAO;CACP,YAAY;CACZ,UAAU;CACV,OAAO;CACP,WAAW;CACX,QAAQ;CACR,aAAa;CACb,eAAe;CACf,WAAW;CACX,aAAa;CACb,aAAa;CACb,qBAAqB;CACrB,YAAY;CACZ,iBAAiB;CACjB,gBAAgB;CAChB,SAAS;CACV;;;;;;AAcD,SAAgB,oBAAoB,OAA2C;AAC7E,QAAO,OAAO,OAAO,qBAAqB,CAAC,SACzC,MACD;;;;;AA8SH,SAAgB,oBACd,QACiC;CACjC,MAAM,UAA2C,EAAE;AAEnD,QAAO,SAAS,UAAU;EACxB,MAAM,QAAQ,MAAM,SAAS;AAC7B,MAAI,CAAC,QAAQ,OACX,SAAQ,SAAS,EAAE;AAErB,UAAQ,OAAO,KAAK,MAAM;GAC1B;AAEF,QAAO;;;;;AAMT,SAAgB,sBACd,QACA,QACyB;CACzB,MAAM,SAAkC,EAAE;AAE1C,QAAO,SAAS,UAAU;EACxB,MAAM,QAAQ,OAAO,MAAM,MAAM;AACjC,SAAO,MAAM,OAAO,UAAU,KAAA,IAAY,QAAQ,MAAM;GACxD;AAEF,QAAO;;;;;AAMT,SAAgB,oBACd,QACA,QACc;AACd,QAAO;EACL,GAAG;EACH,OAAO;GACL,GAAG,OAAO;GACV,GAAG;GACJ;EACF;;;;ACnZH,MAAa,iBACX,UAC2B;AAC3B,QAAO;EACL,GAAG;EACH,MAAM;EACP;;AAGH,MAAa,wBACX,UAGgD;AAChD,QAAO;EACL,GAAG;EACH,MAAM;EACN,SAAS;GACP;IAAE,MAAM;IAAO,OAAO;IAAQ;GAC9B;IAAE,OAAO;IAAM,OAAO;IAAM;GAC5B;IAAE,OAAO;IAAM,OAAO;IAAM;GAC5B;IAAE,OAAO;IAAM,OAAO;IAAM;GAC5B;IAAE,OAAO;IAAM,OAAO;IAAM;GAC5B;IAAE,OAAO;IAAQ,OAAO;IAAQ;GACjC;EACF;;AAGH,MAAa,mBACX,UAG2C;AAC3C,QAAO;EACL,GAAG;EACH,MAAM;EACN,SAAS;GACP;IAAE,MAAM;IAAO,OAAO;IAAG;GACzB;IAAE,OAAO;IAAM,OAAO;IAAG;GACzB;IAAE,OAAO;IAAM,OAAO;IAAG;GACzB;IAAE,OAAO;IAAM,OAAO;IAAG;GACzB;IAAE,OAAO;IAAM,OAAO;IAAG;GACzB;IAAE,OAAO;IAAQ,OAAO;IAAI;GAC7B;EACF;;AAGH,MAAa,sBACX,UAG8C;AAC9C,QAAO;EACL,GAAG;EACH,MAAM;EACN,SAAS;GACP;IAAE,OAAO;IAAM,OAAO;IAAM;GAC5B;IAAE,OAAO;IAAM,OAAO;IAAW;GACjC;IAAE,OAAO;IAAM,OAAO;IAAM;GAC5B;IAAE,OAAO;IAAM,OAAO;IAAM;GAC7B;EACF;;AAGH,MAAa,oBACX,UAC8B;AAC9B,QAAO;EACL,GAAG;EACH,MAAM;EACP;;AAGH,MAAa,eACX,UACuC;AACvC,QAAO;EACL,GAAG;EACH,MAAM;EACN,SAAS;GACP;IAAE,MAAM;IAAO,OAAO;IAAQ;GAC9B;IAAE,OAAO;IAAM,OAAO;IAAM;GAC5B;IAAE,OAAO;IAAM,OAAO;IAAM;GAC5B;IAAE,OAAO;IAAM,OAAO;IAAM;GAC5B;IAAE,OAAO;IAAM,OAAO;IAAM;GAC5B;IAAE,OAAO;IAAM,OAAO;IAAM;GAC7B;EACF;;AAGH,MAAa,kBACX,UACuB;AACvB,QAAO;EACL,GAAG;EACH,MAAM;EACP;;;;;;AAOH,MAAa,YAOT;CACF,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellLayout.cjs","names":["SidebarProvider","Sidebar","SidebarHeader","SidebarContent","SidebarFooter","SidebarInset"],"sources":["../../src/shell/AppShellLayout.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarInset,\n SidebarProvider,\n} from \"./sidebar\";\n\nexport interface AppShellLayoutProps {\n /** Navigation content rendered inside the sidebar's scrollable area */\n sidebarContent: React.ReactNode;\n /** Header content rendered above the main content area */\n headerContent: React.ReactNode;\n /** Main page content */\n children: React.ReactNode;\n /** Optional slot at the top of the sidebar (e.g. logo, search) */\n sidebarHeader?: React.ReactNode;\n /** Optional slot at the bottom of the sidebar (e.g. user info) */\n sidebarFooter?: React.ReactNode;\n /** Content rendered after SidebarInset (e.g. MobileBottomNav) */\n afterContent?: React.ReactNode;\n /** Enable bottom nav mode (hides sidebar on mobile, adds bottom padding) */\n useBottomNav?: boolean;\n}\n\n/**\n * Pure visual frame that replicates the RepApp layout:\n * - 13rem collapsible sidebar\n * - 52px header area\n * - rounded-xl bg-background shadow-lg content area with bg-muted gutters\n *\n * This component handles zero business logic — it simply provides the visual shell.\n */\nexport function AppShellLayout({\n sidebarContent,\n headerContent,\n children,\n sidebarHeader,\n sidebarFooter,\n afterContent,\n useBottomNav = false,\n}: AppShellLayoutProps) {\n return (\n <SidebarProvider useBottomNav={useBottomNav}>\n <div className=\"bg-muted relative flex max-h-dvh w-full overflow-hidden\">\n {/* Navigation Sidebar */}\n <Sidebar>\n {sidebarHeader && <SidebarHeader>{sidebarHeader}</SidebarHeader>}\n <SidebarContent className=\"p-4\">{sidebarContent}</SidebarContent>\n {sidebarFooter && <SidebarFooter>{sidebarFooter}</SidebarFooter>}\n </Sidebar>\n\n {/* Main Content Area */}\n <SidebarInset className=\"flex flex-1 flex-col overflow-hidden\">\n {/* Header */}\n {headerContent}\n\n {/* Screen Content */}\n <div\n className={`bg-muted flex-1 overflow-hidden md:pr-4 md:pb-4 ${useBottomNav ? \"max-md:pb-[calc(4rem+env(safe-area-inset-bottom))]\" : \"\"}`}\n >\n <div className=\"scrollbar-none bg-background text-foreground h-full overflow-auto rounded-xl shadow-lg\">\n {children}\n </div>\n </div>\n </SidebarInset>\n\n {/* After content (e.g. MobileBottomNav) */}\n {afterContent}\n </div>\n </SidebarProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAgB,eAAe,EAC7B,gBACA,eACA,UACA,eACA,eACA,cACA,eAAe,
|
|
1
|
+
{"version":3,"file":"AppShellLayout.cjs","names":["SidebarProvider","Sidebar","SidebarHeader","SidebarContent","SidebarFooter","SidebarInset"],"sources":["../../src/shell/AppShellLayout.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarInset,\n SidebarProvider,\n} from \"./sidebar\";\n\nexport interface AppShellLayoutProps {\n /** Navigation content rendered inside the sidebar's scrollable area */\n sidebarContent: React.ReactNode;\n /** Header content rendered above the main content area */\n headerContent: React.ReactNode;\n /** Main page content */\n children: React.ReactNode;\n /** Optional slot at the top of the sidebar (e.g. logo, search) */\n sidebarHeader?: React.ReactNode;\n /** Optional slot at the bottom of the sidebar (e.g. user info) */\n sidebarFooter?: React.ReactNode;\n /** Content rendered after SidebarInset (e.g. MobileBottomNav) */\n afterContent?: React.ReactNode;\n /** Enable bottom nav mode (hides sidebar on mobile, adds bottom padding) */\n useBottomNav?: boolean;\n}\n\n/**\n * Pure visual frame that replicates the RepApp layout:\n * - 13rem collapsible sidebar\n * - 52px header area\n * - rounded-xl bg-background shadow-lg content area with bg-muted gutters\n *\n * This component handles zero business logic — it simply provides the visual shell.\n */\nexport function AppShellLayout({\n sidebarContent,\n headerContent,\n children,\n sidebarHeader,\n sidebarFooter,\n afterContent,\n useBottomNav = false,\n}: AppShellLayoutProps): React.JSX.Element {\n return (\n <SidebarProvider useBottomNav={useBottomNav}>\n <div className=\"bg-muted relative flex max-h-dvh w-full overflow-hidden\">\n {/* Navigation Sidebar */}\n <Sidebar>\n {sidebarHeader && <SidebarHeader>{sidebarHeader}</SidebarHeader>}\n <SidebarContent className=\"p-4\">{sidebarContent}</SidebarContent>\n {sidebarFooter && <SidebarFooter>{sidebarFooter}</SidebarFooter>}\n </Sidebar>\n\n {/* Main Content Area */}\n <SidebarInset className=\"flex flex-1 flex-col overflow-hidden\">\n {/* Header */}\n {headerContent}\n\n {/* Screen Content */}\n <div\n className={`bg-muted flex-1 overflow-hidden md:pr-4 md:pb-4 ${useBottomNav ? \"max-md:pb-[calc(4rem+env(safe-area-inset-bottom))]\" : \"\"}`}\n >\n <div className=\"scrollbar-none bg-background text-foreground h-full overflow-auto rounded-xl shadow-lg\">\n {children}\n </div>\n </div>\n </SidebarInset>\n\n {/* After content (e.g. MobileBottomNav) */}\n {afterContent}\n </div>\n </SidebarProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAgB,eAAe,EAC7B,gBACA,eACA,UACA,eACA,eACA,cACA,eAAe,SAC0B;AACzC,QACE,iBAAA,GAAA,kBAAA,KAACA,sBAAAA,iBAAD;EAA+B;YAC7B,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAU;aAAf;IAEE,iBAAA,GAAA,kBAAA,MAACC,sBAAAA,SAAD,EAAA,UAAA;KACG,iBAAiB,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,eAAD,EAAA,UAAgB,eAA8B,CAAA;KAChE,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,gBAAD;MAAgB,WAAU;gBAAO;MAAgC,CAAA;KAChE,iBAAiB,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,eAAD,EAAA,UAAgB,eAA8B,CAAA;KACxD,EAAA,CAAA;IAGV,iBAAA,GAAA,kBAAA,MAACC,sBAAAA,cAAD;KAAc,WAAU;eAAxB,CAEG,eAGD,iBAAA,GAAA,kBAAA,KAAC,OAAD;MACE,WAAW,mDAAmD,eAAe,uDAAuD;gBAEpI,iBAAA,GAAA,kBAAA,KAAC,OAAD;OAAK,WAAU;OACZ;OACG,CAAA;MACF,CAAA,CACO;;IAGd;IACG;;EACU,CAAA"}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
3
2
|
|
|
4
3
|
//#region src/shell/AppShellLayout.d.ts
|
|
5
4
|
interface AppShellLayoutProps {
|
|
6
5
|
/** Navigation content rendered inside the sidebar's scrollable area */
|
|
7
|
-
sidebarContent: React.ReactNode;
|
|
6
|
+
sidebarContent: React$1.ReactNode;
|
|
8
7
|
/** Header content rendered above the main content area */
|
|
9
|
-
headerContent: React.ReactNode;
|
|
8
|
+
headerContent: React$1.ReactNode;
|
|
10
9
|
/** Main page content */
|
|
11
|
-
children: React.ReactNode;
|
|
10
|
+
children: React$1.ReactNode;
|
|
12
11
|
/** Optional slot at the top of the sidebar (e.g. logo, search) */
|
|
13
|
-
sidebarHeader?: React.ReactNode;
|
|
12
|
+
sidebarHeader?: React$1.ReactNode;
|
|
14
13
|
/** Optional slot at the bottom of the sidebar (e.g. user info) */
|
|
15
|
-
sidebarFooter?: React.ReactNode;
|
|
14
|
+
sidebarFooter?: React$1.ReactNode;
|
|
16
15
|
/** Content rendered after SidebarInset (e.g. MobileBottomNav) */
|
|
17
|
-
afterContent?: React.ReactNode;
|
|
16
|
+
afterContent?: React$1.ReactNode;
|
|
18
17
|
/** Enable bottom nav mode (hides sidebar on mobile, adds bottom padding) */
|
|
19
18
|
useBottomNav?: boolean;
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
* Pure visual frame that replicates the RepApp layout:
|
|
22
|
+
* - 13rem collapsible sidebar
|
|
23
|
+
* - 52px header area
|
|
24
|
+
* - rounded-xl bg-background shadow-lg content area with bg-muted gutters
|
|
25
|
+
*
|
|
26
|
+
* This component handles zero business logic — it simply provides the visual shell.
|
|
27
|
+
*/
|
|
29
28
|
declare function AppShellLayout({
|
|
30
29
|
sidebarContent,
|
|
31
30
|
headerContent,
|
|
@@ -34,7 +33,7 @@ declare function AppShellLayout({
|
|
|
34
33
|
sidebarFooter,
|
|
35
34
|
afterContent,
|
|
36
35
|
useBottomNav
|
|
37
|
-
}: AppShellLayoutProps):
|
|
36
|
+
}: AppShellLayoutProps): React$1.JSX.Element;
|
|
38
37
|
//#endregion
|
|
39
38
|
export { AppShellLayout, AppShellLayoutProps };
|
|
40
39
|
//# sourceMappingURL=AppShellLayout.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellLayout.d.cts","names":[],"sources":["../../src/shell/AppShellLayout.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppShellLayout.d.cts","names":[],"sources":["../../src/shell/AppShellLayout.tsx"],"mappings":";;;UAYiB,mBAAA;;EAEf,cAAA,EAAgB,OAAA,CAAM,SAAA;EAFP;EAIf,aAAA,EAAe,OAAA,CAAM,SAAA;;EAErB,QAAA,EAAU,OAAA,CAAM,SAAA;;EAEhB,aAAA,GAAgB,OAAA,CAAM,SAAA;;EAEtB,aAAA,GAAgB,OAAA,CAAM,SAAA;;EAEtB,YAAA,GAAe,OAAA,CAAM,SAAA;;EAErB,YAAA;AAAA;;;;;;;;;iBAWc,cAAA,CAAA;EACd,cAAA;EACA,aAAA;EACA,QAAA;EACA,aAAA;EACA,aAAA;EACA,YAAA;EACA;AAAA,GACC,mBAAA,GAAsB,OAAA,CAAM,GAAA,CAAI,OAAA"}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import * as React$1 from "react";
|
|
3
2
|
|
|
4
3
|
//#region src/shell/AppShellLayout.d.ts
|
|
5
4
|
interface AppShellLayoutProps {
|
|
6
5
|
/** Navigation content rendered inside the sidebar's scrollable area */
|
|
7
|
-
sidebarContent: React.ReactNode;
|
|
6
|
+
sidebarContent: React$1.ReactNode;
|
|
8
7
|
/** Header content rendered above the main content area */
|
|
9
|
-
headerContent: React.ReactNode;
|
|
8
|
+
headerContent: React$1.ReactNode;
|
|
10
9
|
/** Main page content */
|
|
11
|
-
children: React.ReactNode;
|
|
10
|
+
children: React$1.ReactNode;
|
|
12
11
|
/** Optional slot at the top of the sidebar (e.g. logo, search) */
|
|
13
|
-
sidebarHeader?: React.ReactNode;
|
|
12
|
+
sidebarHeader?: React$1.ReactNode;
|
|
14
13
|
/** Optional slot at the bottom of the sidebar (e.g. user info) */
|
|
15
|
-
sidebarFooter?: React.ReactNode;
|
|
14
|
+
sidebarFooter?: React$1.ReactNode;
|
|
16
15
|
/** Content rendered after SidebarInset (e.g. MobileBottomNav) */
|
|
17
|
-
afterContent?: React.ReactNode;
|
|
16
|
+
afterContent?: React$1.ReactNode;
|
|
18
17
|
/** Enable bottom nav mode (hides sidebar on mobile, adds bottom padding) */
|
|
19
18
|
useBottomNav?: boolean;
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
* Pure visual frame that replicates the RepApp layout:
|
|
22
|
+
* - 13rem collapsible sidebar
|
|
23
|
+
* - 52px header area
|
|
24
|
+
* - rounded-xl bg-background shadow-lg content area with bg-muted gutters
|
|
25
|
+
*
|
|
26
|
+
* This component handles zero business logic — it simply provides the visual shell.
|
|
27
|
+
*/
|
|
29
28
|
declare function AppShellLayout({
|
|
30
29
|
sidebarContent,
|
|
31
30
|
headerContent,
|
|
@@ -34,7 +33,7 @@ declare function AppShellLayout({
|
|
|
34
33
|
sidebarFooter,
|
|
35
34
|
afterContent,
|
|
36
35
|
useBottomNav
|
|
37
|
-
}: AppShellLayoutProps):
|
|
36
|
+
}: AppShellLayoutProps): React$1.JSX.Element;
|
|
38
37
|
//#endregion
|
|
39
38
|
export { AppShellLayout, AppShellLayoutProps };
|
|
40
39
|
//# sourceMappingURL=AppShellLayout.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellLayout.d.mts","names":[],"sources":["../../src/shell/AppShellLayout.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppShellLayout.d.mts","names":[],"sources":["../../src/shell/AppShellLayout.tsx"],"mappings":";;;UAYiB,mBAAA;;EAEf,cAAA,EAAgB,OAAA,CAAM,SAAA;EAFP;EAIf,aAAA,EAAe,OAAA,CAAM,SAAA;;EAErB,QAAA,EAAU,OAAA,CAAM,SAAA;;EAEhB,aAAA,GAAgB,OAAA,CAAM,SAAA;;EAEtB,aAAA,GAAgB,OAAA,CAAM,SAAA;;EAEtB,YAAA,GAAe,OAAA,CAAM,SAAA;;EAErB,YAAA;AAAA;;;;;;;;;iBAWc,cAAA,CAAA;EACd,cAAA;EACA,aAAA;EACA,QAAA;EACA,aAAA;EACA,aAAA;EACA,YAAA;EACA;AAAA,GACC,mBAAA,GAAsB,OAAA,CAAM,GAAA,CAAI,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellLayout.mjs","names":[],"sources":["../../src/shell/AppShellLayout.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarInset,\n SidebarProvider,\n} from \"./sidebar\";\n\nexport interface AppShellLayoutProps {\n /** Navigation content rendered inside the sidebar's scrollable area */\n sidebarContent: React.ReactNode;\n /** Header content rendered above the main content area */\n headerContent: React.ReactNode;\n /** Main page content */\n children: React.ReactNode;\n /** Optional slot at the top of the sidebar (e.g. logo, search) */\n sidebarHeader?: React.ReactNode;\n /** Optional slot at the bottom of the sidebar (e.g. user info) */\n sidebarFooter?: React.ReactNode;\n /** Content rendered after SidebarInset (e.g. MobileBottomNav) */\n afterContent?: React.ReactNode;\n /** Enable bottom nav mode (hides sidebar on mobile, adds bottom padding) */\n useBottomNav?: boolean;\n}\n\n/**\n * Pure visual frame that replicates the RepApp layout:\n * - 13rem collapsible sidebar\n * - 52px header area\n * - rounded-xl bg-background shadow-lg content area with bg-muted gutters\n *\n * This component handles zero business logic — it simply provides the visual shell.\n */\nexport function AppShellLayout({\n sidebarContent,\n headerContent,\n children,\n sidebarHeader,\n sidebarFooter,\n afterContent,\n useBottomNav = false,\n}: AppShellLayoutProps) {\n return (\n <SidebarProvider useBottomNav={useBottomNav}>\n <div className=\"bg-muted relative flex max-h-dvh w-full overflow-hidden\">\n {/* Navigation Sidebar */}\n <Sidebar>\n {sidebarHeader && <SidebarHeader>{sidebarHeader}</SidebarHeader>}\n <SidebarContent className=\"p-4\">{sidebarContent}</SidebarContent>\n {sidebarFooter && <SidebarFooter>{sidebarFooter}</SidebarFooter>}\n </Sidebar>\n\n {/* Main Content Area */}\n <SidebarInset className=\"flex flex-1 flex-col overflow-hidden\">\n {/* Header */}\n {headerContent}\n\n {/* Screen Content */}\n <div\n className={`bg-muted flex-1 overflow-hidden md:pr-4 md:pb-4 ${useBottomNav ? \"max-md:pb-[calc(4rem+env(safe-area-inset-bottom))]\" : \"\"}`}\n >\n <div className=\"scrollbar-none bg-background text-foreground h-full overflow-auto rounded-xl shadow-lg\">\n {children}\n </div>\n </div>\n </SidebarInset>\n\n {/* After content (e.g. MobileBottomNav) */}\n {afterContent}\n </div>\n </SidebarProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAqCA,SAAgB,eAAe,EAC7B,gBACA,eACA,UACA,eACA,eACA,cACA,eAAe,
|
|
1
|
+
{"version":3,"file":"AppShellLayout.mjs","names":[],"sources":["../../src/shell/AppShellLayout.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarInset,\n SidebarProvider,\n} from \"./sidebar\";\n\nexport interface AppShellLayoutProps {\n /** Navigation content rendered inside the sidebar's scrollable area */\n sidebarContent: React.ReactNode;\n /** Header content rendered above the main content area */\n headerContent: React.ReactNode;\n /** Main page content */\n children: React.ReactNode;\n /** Optional slot at the top of the sidebar (e.g. logo, search) */\n sidebarHeader?: React.ReactNode;\n /** Optional slot at the bottom of the sidebar (e.g. user info) */\n sidebarFooter?: React.ReactNode;\n /** Content rendered after SidebarInset (e.g. MobileBottomNav) */\n afterContent?: React.ReactNode;\n /** Enable bottom nav mode (hides sidebar on mobile, adds bottom padding) */\n useBottomNav?: boolean;\n}\n\n/**\n * Pure visual frame that replicates the RepApp layout:\n * - 13rem collapsible sidebar\n * - 52px header area\n * - rounded-xl bg-background shadow-lg content area with bg-muted gutters\n *\n * This component handles zero business logic — it simply provides the visual shell.\n */\nexport function AppShellLayout({\n sidebarContent,\n headerContent,\n children,\n sidebarHeader,\n sidebarFooter,\n afterContent,\n useBottomNav = false,\n}: AppShellLayoutProps): React.JSX.Element {\n return (\n <SidebarProvider useBottomNav={useBottomNav}>\n <div className=\"bg-muted relative flex max-h-dvh w-full overflow-hidden\">\n {/* Navigation Sidebar */}\n <Sidebar>\n {sidebarHeader && <SidebarHeader>{sidebarHeader}</SidebarHeader>}\n <SidebarContent className=\"p-4\">{sidebarContent}</SidebarContent>\n {sidebarFooter && <SidebarFooter>{sidebarFooter}</SidebarFooter>}\n </Sidebar>\n\n {/* Main Content Area */}\n <SidebarInset className=\"flex flex-1 flex-col overflow-hidden\">\n {/* Header */}\n {headerContent}\n\n {/* Screen Content */}\n <div\n className={`bg-muted flex-1 overflow-hidden md:pr-4 md:pb-4 ${useBottomNav ? \"max-md:pb-[calc(4rem+env(safe-area-inset-bottom))]\" : \"\"}`}\n >\n <div className=\"scrollbar-none bg-background text-foreground h-full overflow-auto rounded-xl shadow-lg\">\n {children}\n </div>\n </div>\n </SidebarInset>\n\n {/* After content (e.g. MobileBottomNav) */}\n {afterContent}\n </div>\n </SidebarProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAqCA,SAAgB,eAAe,EAC7B,gBACA,eACA,UACA,eACA,eACA,cACA,eAAe,SAC0B;AACzC,QACE,oBAAC,iBAAD;EAA+B;YAC7B,qBAAC,OAAD;GAAK,WAAU;aAAf;IAEE,qBAAC,SAAD,EAAA,UAAA;KACG,iBAAiB,oBAAC,eAAD,EAAA,UAAgB,eAA8B,CAAA;KAChE,oBAAC,gBAAD;MAAgB,WAAU;gBAAO;MAAgC,CAAA;KAChE,iBAAiB,oBAAC,eAAD,EAAA,UAAgB,eAA8B,CAAA;KACxD,EAAA,CAAA;IAGV,qBAAC,cAAD;KAAc,WAAU;eAAxB,CAEG,eAGD,oBAAC,OAAD;MACE,WAAW,mDAAmD,eAAe,uDAAuD;gBAEpI,oBAAC,OAAD;OAAK,WAAU;OACZ;OACG,CAAA;MACF,CAAA,CACO;;IAGd;IACG;;EACU,CAAA"}
|