@meetelise/studio-components 0.0.14 → 0.0.16
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/componentSchema.json +91 -22
- package/dist/components/DataProvider.d.ts +4 -3
- package/dist/components/DataProvider.d.ts.map +1 -1
- package/dist/components/DataProvider.js +5 -4
- package/dist/components/DataProvider.js.map +1 -1
- package/dist/components/Repeat.d.ts +25 -0
- package/dist/components/Repeat.d.ts.map +1 -0
- package/dist/components/Repeat.js +102 -0
- package/dist/components/Repeat.js.map +1 -0
- package/dist/components/registry.d.ts.map +1 -1
- package/dist/components/registry.js +3 -0
- package/dist/components/registry.js.map +1 -1
- package/dist/hooks/useDataContext.d.ts +13 -1
- package/dist/hooks/useDataContext.d.ts.map +1 -1
- package/dist/hooks/useDataContext.js +14 -0
- package/dist/hooks/useDataContext.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/schema/componentSchema.d.ts +15 -3
- package/dist/schema/componentSchema.d.ts.map +1 -1
- package/dist/schema/componentSchema.js +70 -16
- package/dist/schema/componentSchema.js.map +1 -1
- package/dist/utils/resolveBindings.d.ts +16 -0
- package/dist/utils/resolveBindings.d.ts.map +1 -0
- package/dist/utils/resolveBindings.js +57 -0
- package/dist/utils/resolveBindings.js.map +1 -0
- package/dist/utils/resolveConfig.d.ts.map +1 -1
- package/dist/utils/resolveConfig.js +39 -6
- package/dist/utils/resolveConfig.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
2
|
+
"schemaVersion": 2,
|
|
3
3
|
"components": {
|
|
4
4
|
"Text": {
|
|
5
|
+
"kind": "element",
|
|
5
6
|
"category": "Text & Typography",
|
|
6
7
|
"description": "Semantic text with multiple heading/body variants and theme fonts",
|
|
7
8
|
"acceptsChildren": false,
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
}
|
|
30
31
|
},
|
|
31
32
|
"Button": {
|
|
33
|
+
"kind": "element",
|
|
32
34
|
"category": "Text & Typography",
|
|
33
35
|
"description": "Interactive button with navigation, scroll, and modal actions",
|
|
34
36
|
"acceptsChildren": false,
|
|
@@ -64,6 +66,7 @@
|
|
|
64
66
|
}
|
|
65
67
|
},
|
|
66
68
|
"Icon": {
|
|
69
|
+
"kind": "element",
|
|
67
70
|
"category": "Text & Typography",
|
|
68
71
|
"description": "SVG icons for amenities and features",
|
|
69
72
|
"acceptsChildren": false,
|
|
@@ -98,6 +101,7 @@
|
|
|
98
101
|
}
|
|
99
102
|
},
|
|
100
103
|
"Badge": {
|
|
104
|
+
"kind": "element",
|
|
101
105
|
"category": "Text & Typography",
|
|
102
106
|
"description": "Small pill labels for status, tags, and highlights",
|
|
103
107
|
"acceptsChildren": false,
|
|
@@ -129,6 +133,7 @@
|
|
|
129
133
|
}
|
|
130
134
|
},
|
|
131
135
|
"Stat": {
|
|
136
|
+
"kind": "element",
|
|
132
137
|
"category": "Text & Typography",
|
|
133
138
|
"description": "Big number + label for statistics and highlights",
|
|
134
139
|
"acceptsChildren": false,
|
|
@@ -163,6 +168,7 @@
|
|
|
163
168
|
}
|
|
164
169
|
},
|
|
165
170
|
"Divider": {
|
|
171
|
+
"kind": "element",
|
|
166
172
|
"category": "Text & Typography",
|
|
167
173
|
"description": "Visual separator with optional label",
|
|
168
174
|
"acceptsChildren": false,
|
|
@@ -183,6 +189,7 @@
|
|
|
183
189
|
}
|
|
184
190
|
},
|
|
185
191
|
"Stack": {
|
|
192
|
+
"kind": "frame",
|
|
186
193
|
"category": "Layout",
|
|
187
194
|
"description": "Flexbox container for vertical or horizontal layouts",
|
|
188
195
|
"acceptsChildren": true,
|
|
@@ -229,6 +236,7 @@
|
|
|
229
236
|
}
|
|
230
237
|
},
|
|
231
238
|
"Grid": {
|
|
239
|
+
"kind": "frame",
|
|
232
240
|
"category": "Layout",
|
|
233
241
|
"description": "Responsive CSS Grid with 1-4 columns",
|
|
234
242
|
"acceptsChildren": true,
|
|
@@ -257,6 +265,7 @@
|
|
|
257
265
|
}
|
|
258
266
|
},
|
|
259
267
|
"Container": {
|
|
268
|
+
"kind": "frame",
|
|
260
269
|
"category": "Layout",
|
|
261
270
|
"description": "Padded wrapper with background color/image and max-width",
|
|
262
271
|
"acceptsChildren": true,
|
|
@@ -298,6 +307,7 @@
|
|
|
298
307
|
}
|
|
299
308
|
},
|
|
300
309
|
"ScrollReveal": {
|
|
310
|
+
"kind": "frame",
|
|
301
311
|
"category": "Layout",
|
|
302
312
|
"description": "Animate children on scroll using IntersectionObserver",
|
|
303
313
|
"acceptsChildren": true,
|
|
@@ -336,12 +346,14 @@
|
|
|
336
346
|
}
|
|
337
347
|
},
|
|
338
348
|
"Section": {
|
|
349
|
+
"kind": "frame",
|
|
339
350
|
"category": "Layout",
|
|
340
351
|
"description": "Centered max-width content section wrapper",
|
|
341
352
|
"acceptsChildren": true,
|
|
342
353
|
"props": {}
|
|
343
354
|
},
|
|
344
355
|
"VideoHero": {
|
|
356
|
+
"kind": "elise-component",
|
|
345
357
|
"category": "Heroes & Media",
|
|
346
358
|
"description": "Full-width video/image background with overlay content",
|
|
347
359
|
"acceptsChildren": true,
|
|
@@ -367,6 +379,7 @@
|
|
|
367
379
|
}
|
|
368
380
|
},
|
|
369
381
|
"Gallery": {
|
|
382
|
+
"kind": "elise-component",
|
|
370
383
|
"category": "Heroes & Media",
|
|
371
384
|
"description": "Photo grid or carousel with lightbox, category filters, and API integration",
|
|
372
385
|
"needsApi": true,
|
|
@@ -413,6 +426,7 @@
|
|
|
413
426
|
}
|
|
414
427
|
},
|
|
415
428
|
"VideoPlayer": {
|
|
429
|
+
"kind": "elise-component",
|
|
416
430
|
"category": "Heroes & Media",
|
|
417
431
|
"description": "Responsive video player with controls and aspect ratio options",
|
|
418
432
|
"acceptsChildren": false,
|
|
@@ -446,6 +460,7 @@
|
|
|
446
460
|
}
|
|
447
461
|
},
|
|
448
462
|
"Image": {
|
|
463
|
+
"kind": "element",
|
|
449
464
|
"category": "Heroes & Media",
|
|
450
465
|
"description": "Basic responsive image",
|
|
451
466
|
"acceptsChildren": false,
|
|
@@ -461,6 +476,7 @@
|
|
|
461
476
|
}
|
|
462
477
|
},
|
|
463
478
|
"MapEmbed": {
|
|
479
|
+
"kind": "elise-component",
|
|
464
480
|
"category": "Heroes & Media",
|
|
465
481
|
"description": "Google Maps embed with lat/lng coordinates",
|
|
466
482
|
"acceptsChildren": false,
|
|
@@ -488,6 +504,7 @@
|
|
|
488
504
|
}
|
|
489
505
|
},
|
|
490
506
|
"VirtualTourEmbed": {
|
|
507
|
+
"kind": "elise-component",
|
|
491
508
|
"category": "Heroes & Media",
|
|
492
509
|
"description": "Matterport / 3D tour iframe wrapper",
|
|
493
510
|
"acceptsChildren": false,
|
|
@@ -508,6 +525,7 @@
|
|
|
508
525
|
}
|
|
509
526
|
},
|
|
510
527
|
"FeatureCard": {
|
|
528
|
+
"kind": "elise-component",
|
|
511
529
|
"category": "Content Cards",
|
|
512
530
|
"description": "Image + text card with link, multiple image positions",
|
|
513
531
|
"acceptsChildren": false,
|
|
@@ -551,6 +569,7 @@
|
|
|
551
569
|
}
|
|
552
570
|
},
|
|
553
571
|
"Testimonial": {
|
|
572
|
+
"kind": "elise-component",
|
|
554
573
|
"category": "Content Cards",
|
|
555
574
|
"description": "Quote card with author, role, and star rating",
|
|
556
575
|
"acceptsChildren": false,
|
|
@@ -579,6 +598,7 @@
|
|
|
579
598
|
}
|
|
580
599
|
},
|
|
581
600
|
"CTABanner": {
|
|
601
|
+
"kind": "elise-component",
|
|
582
602
|
"category": "Content Cards",
|
|
583
603
|
"description": "Full-width call-to-action section with gradient background",
|
|
584
604
|
"acceptsChildren": true,
|
|
@@ -590,6 +610,7 @@
|
|
|
590
610
|
}
|
|
591
611
|
},
|
|
592
612
|
"AddressBlock": {
|
|
613
|
+
"kind": "elise-component",
|
|
593
614
|
"category": "Content Cards",
|
|
594
615
|
"description": "Address + phone + Get Directions link",
|
|
595
616
|
"acceptsChildren": false,
|
|
@@ -635,6 +656,7 @@
|
|
|
635
656
|
}
|
|
636
657
|
},
|
|
637
658
|
"Nav": {
|
|
659
|
+
"kind": "elise-component",
|
|
638
660
|
"category": "Navigation",
|
|
639
661
|
"description": "Sticky/static navbar with logo, links, and mobile menu",
|
|
640
662
|
"acceptsChildren": false,
|
|
@@ -668,6 +690,7 @@
|
|
|
668
690
|
}
|
|
669
691
|
},
|
|
670
692
|
"Footer": {
|
|
693
|
+
"kind": "elise-component",
|
|
671
694
|
"category": "Navigation",
|
|
672
695
|
"description": "Footer with column links and copyright",
|
|
673
696
|
"acceptsChildren": false,
|
|
@@ -710,6 +733,7 @@
|
|
|
710
733
|
}
|
|
711
734
|
},
|
|
712
735
|
"Accordion": {
|
|
736
|
+
"kind": "elise-component",
|
|
713
737
|
"category": "Navigation",
|
|
714
738
|
"description": "Collapsible sections for FAQs and categorized content",
|
|
715
739
|
"acceptsChildren": false,
|
|
@@ -753,6 +777,7 @@
|
|
|
753
777
|
}
|
|
754
778
|
},
|
|
755
779
|
"Link": {
|
|
780
|
+
"kind": "element",
|
|
756
781
|
"category": "Navigation",
|
|
757
782
|
"description": "Inline navigation link (client-side routing)",
|
|
758
783
|
"acceptsChildren": false,
|
|
@@ -771,6 +796,7 @@
|
|
|
771
796
|
}
|
|
772
797
|
},
|
|
773
798
|
"Modal": {
|
|
799
|
+
"kind": "elise-component",
|
|
774
800
|
"category": "Navigation",
|
|
775
801
|
"description": "Overlay dialog opened by id via Button modal actions",
|
|
776
802
|
"acceptsChildren": true,
|
|
@@ -787,6 +813,7 @@
|
|
|
787
813
|
}
|
|
788
814
|
},
|
|
789
815
|
"AmenityList": {
|
|
816
|
+
"kind": "elise-component",
|
|
790
817
|
"category": "Data & Amenities",
|
|
791
818
|
"description": "Amenity display with icon grid, categorized accordion, or simple list",
|
|
792
819
|
"needsApi": true,
|
|
@@ -847,6 +874,7 @@
|
|
|
847
874
|
}
|
|
848
875
|
},
|
|
849
876
|
"UnitExplorer": {
|
|
877
|
+
"kind": "elise-component",
|
|
850
878
|
"category": "Units & Floor Plans",
|
|
851
879
|
"description": "Searchable, filterable unit listing with grid/list views, tabs, and sorting",
|
|
852
880
|
"needsApi": true,
|
|
@@ -982,6 +1010,7 @@
|
|
|
982
1010
|
}
|
|
983
1011
|
},
|
|
984
1012
|
"FloorplanExplorer": {
|
|
1013
|
+
"kind": "elise-component",
|
|
985
1014
|
"category": "Units & Floor Plans",
|
|
986
1015
|
"description": "Floor plan listing with media, rent ranges, and unit previews",
|
|
987
1016
|
"needsApi": true,
|
|
@@ -1037,6 +1066,7 @@
|
|
|
1037
1066
|
}
|
|
1038
1067
|
},
|
|
1039
1068
|
"UnitPage": {
|
|
1069
|
+
"kind": "elise-component",
|
|
1040
1070
|
"category": "Units & Floor Plans",
|
|
1041
1071
|
"description": "Single-unit detail page (media, pricing matrix, fees) — bound to /units/:unitId",
|
|
1042
1072
|
"needsApi": true,
|
|
@@ -1053,6 +1083,7 @@
|
|
|
1053
1083
|
}
|
|
1054
1084
|
},
|
|
1055
1085
|
"ContactForm": {
|
|
1086
|
+
"kind": "elise-component",
|
|
1056
1087
|
"category": "Forms",
|
|
1057
1088
|
"description": "Lead capture form that POSTs to /v1/prospect",
|
|
1058
1089
|
"needsApi": true,
|
|
@@ -1060,6 +1091,7 @@
|
|
|
1060
1091
|
"props": {}
|
|
1061
1092
|
},
|
|
1062
1093
|
"ScheduleTour": {
|
|
1094
|
+
"kind": "elise-component",
|
|
1063
1095
|
"category": "Forms",
|
|
1064
1096
|
"description": "Two-step tour booking with date/time picker and contact form",
|
|
1065
1097
|
"needsApi": true,
|
|
@@ -1067,6 +1099,7 @@
|
|
|
1067
1099
|
"props": {}
|
|
1068
1100
|
},
|
|
1069
1101
|
"EliseChat": {
|
|
1102
|
+
"kind": "elise-component",
|
|
1070
1103
|
"category": "Forms",
|
|
1071
1104
|
"description": "Embeds the Elise chat widget for a building",
|
|
1072
1105
|
"acceptsChildren": false,
|
|
@@ -1082,18 +1115,21 @@
|
|
|
1082
1115
|
}
|
|
1083
1116
|
},
|
|
1084
1117
|
"ComponentBrowser": {
|
|
1118
|
+
"kind": "system",
|
|
1085
1119
|
"category": "Developer",
|
|
1086
1120
|
"description": "Dev-only component browser/gallery (not used in authored sites)",
|
|
1087
1121
|
"acceptsChildren": false,
|
|
1088
1122
|
"props": {}
|
|
1089
1123
|
},
|
|
1090
1124
|
"ComponentShowcase": {
|
|
1125
|
+
"kind": "system",
|
|
1091
1126
|
"category": "Developer",
|
|
1092
1127
|
"description": "Dev-only single-component showcase with prop controls (not used in authored sites)",
|
|
1093
1128
|
"acceptsChildren": false,
|
|
1094
1129
|
"props": {}
|
|
1095
1130
|
},
|
|
1096
1131
|
"DataProvider": {
|
|
1132
|
+
"kind": "system",
|
|
1097
1133
|
"category": "System",
|
|
1098
1134
|
"description": "Provides per-building/per-record data scope (propertyId, record) to descendants; injected by the resolver for a compile-time Repeat and by the runtime Repeat. Not user-insertable.",
|
|
1099
1135
|
"acceptsChildren": true,
|
|
@@ -1109,6 +1145,7 @@
|
|
|
1109
1145
|
}
|
|
1110
1146
|
},
|
|
1111
1147
|
"ThemeScope": {
|
|
1148
|
+
"kind": "system",
|
|
1112
1149
|
"category": "System",
|
|
1113
1150
|
"description": "Overlays a theme mode (e.g. per-building tokens) onto a subtree; injected by the resolver for a compile-time Repeat. Not user-insertable.",
|
|
1114
1151
|
"acceptsChildren": true,
|
|
@@ -1120,12 +1157,63 @@
|
|
|
1120
1157
|
}
|
|
1121
1158
|
},
|
|
1122
1159
|
"Fragment": {
|
|
1160
|
+
"kind": "system",
|
|
1123
1161
|
"category": "System",
|
|
1124
1162
|
"description": "Layout-neutral grouping wrapper (renders children with no DOM); used by the resolver to splice repeated subtrees inline. Not user-insertable.",
|
|
1125
1163
|
"acceptsChildren": true,
|
|
1126
1164
|
"props": {}
|
|
1127
1165
|
},
|
|
1166
|
+
"Repeat": {
|
|
1167
|
+
"kind": "system",
|
|
1168
|
+
"category": "Data",
|
|
1169
|
+
"description": "Renders `template` once per record of a live dataset (dataset mode:runtime over api.* data), fetched client-side and scoped to the nearest DataProvider propertyId. A compile-time Repeat over site.buildings is expanded away by the resolver and never reaches the rendered tree, so the surviving Repeat is always runtime.",
|
|
1170
|
+
"acceptsChildren": false,
|
|
1171
|
+
"needsApi": true,
|
|
1172
|
+
"props": {
|
|
1173
|
+
"dataset": {
|
|
1174
|
+
"kind": "object",
|
|
1175
|
+
"required": true,
|
|
1176
|
+
"label": "Dataset",
|
|
1177
|
+
"subFields": {
|
|
1178
|
+
"source": {
|
|
1179
|
+
"kind": "string",
|
|
1180
|
+
"label": "Source"
|
|
1181
|
+
},
|
|
1182
|
+
"mode": {
|
|
1183
|
+
"kind": "string",
|
|
1184
|
+
"label": "Mode"
|
|
1185
|
+
},
|
|
1186
|
+
"sort": {
|
|
1187
|
+
"kind": "string",
|
|
1188
|
+
"label": "Sort"
|
|
1189
|
+
},
|
|
1190
|
+
"limit": {
|
|
1191
|
+
"kind": "number",
|
|
1192
|
+
"label": "Limit"
|
|
1193
|
+
},
|
|
1194
|
+
"record": {
|
|
1195
|
+
"kind": "string",
|
|
1196
|
+
"label": "Record type"
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
"as": {
|
|
1201
|
+
"kind": "string",
|
|
1202
|
+
"required": true,
|
|
1203
|
+
"label": "Record alias"
|
|
1204
|
+
},
|
|
1205
|
+
"template": {
|
|
1206
|
+
"kind": "node",
|
|
1207
|
+
"label": "Per-record template"
|
|
1208
|
+
},
|
|
1209
|
+
"emptyState": {
|
|
1210
|
+
"kind": "node",
|
|
1211
|
+
"label": "Empty state"
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
},
|
|
1128
1215
|
"Slot": {
|
|
1216
|
+
"kind": "directive",
|
|
1129
1217
|
"category": "Directive",
|
|
1130
1218
|
"description": "Layout placeholder replaced with the page tree at resolve time (renders children as fallback)",
|
|
1131
1219
|
"isDirective": true,
|
|
@@ -1138,6 +1226,7 @@
|
|
|
1138
1226
|
}
|
|
1139
1227
|
},
|
|
1140
1228
|
"BuildingSlice": {
|
|
1229
|
+
"kind": "directive",
|
|
1141
1230
|
"category": "Directive",
|
|
1142
1231
|
"description": "Compile-time expansion of a template subtree once per building (wrapped in a Grid)",
|
|
1143
1232
|
"isDirective": true,
|
|
@@ -1145,6 +1234,7 @@
|
|
|
1145
1234
|
"props": {}
|
|
1146
1235
|
},
|
|
1147
1236
|
"Symbol": {
|
|
1237
|
+
"kind": "directive",
|
|
1148
1238
|
"category": "Directive",
|
|
1149
1239
|
"description": "Reusable named subtree instance, expanded at compile time by the resolver (forwards props, fills named slots)",
|
|
1150
1240
|
"isDirective": true,
|
|
@@ -1156,27 +1246,6 @@
|
|
|
1156
1246
|
"label": "Symbol name"
|
|
1157
1247
|
}
|
|
1158
1248
|
}
|
|
1159
|
-
},
|
|
1160
|
-
"Repeat": {
|
|
1161
|
-
"category": "Directive",
|
|
1162
|
-
"description": "Repeat a child subtree over a dataset. Compile-time (dataset mode:compile over site.buildings) expands at resolve time into per-building subtrees; runtime (mode:runtime over live API data) renders client-side (P4b).",
|
|
1163
|
-
"isDirective": true,
|
|
1164
|
-
"acceptsChildren": true,
|
|
1165
|
-
"props": {
|
|
1166
|
-
"dataset": {
|
|
1167
|
-
"kind": "string",
|
|
1168
|
-
"required": true,
|
|
1169
|
-
"label": "Dataset name"
|
|
1170
|
-
},
|
|
1171
|
-
"as": {
|
|
1172
|
-
"kind": "string",
|
|
1173
|
-
"label": "Record alias"
|
|
1174
|
-
},
|
|
1175
|
-
"emptyState": {
|
|
1176
|
-
"kind": "node",
|
|
1177
|
-
"label": "Empty state"
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
1249
|
}
|
|
1181
1250
|
}
|
|
1182
1251
|
}
|
|
@@ -3,9 +3,10 @@ interface DataProviderProps extends DataContextValue {
|
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* Provides a per-building
|
|
7
|
-
*
|
|
6
|
+
* Provides a data scope to its subtree: a per-building `propertyId` (D8, injected by a
|
|
7
|
+
* compile-time Repeat) and/or a runtime record bound to `as` plus the accumulated `records`
|
|
8
|
+
* map (injected per record by the runtime Repeat). Passthrough render.
|
|
8
9
|
*/
|
|
9
|
-
export declare function DataProvider({ propertyId, as, record, children }: DataProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function DataProvider({ propertyId, as, record, records, children }: DataProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=DataProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataProvider.d.ts","sourceRoot":"","sources":["../../src/components/DataProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAErF,UAAU,iBAAkB,SAAQ,gBAAgB;IAClD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED
|
|
1
|
+
{"version":3,"file":"DataProvider.d.ts","sourceRoot":"","sources":["../../src/components/DataProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAErF,UAAU,iBAAkB,SAAQ,gBAAgB;IAClD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAM5F"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { DataContextProvider } from "../hooks/useDataContext";
|
|
3
3
|
/**
|
|
4
|
-
* Provides a per-building
|
|
5
|
-
*
|
|
4
|
+
* Provides a data scope to its subtree: a per-building `propertyId` (D8, injected by a
|
|
5
|
+
* compile-time Repeat) and/or a runtime record bound to `as` plus the accumulated `records`
|
|
6
|
+
* map (injected per record by the runtime Repeat). Passthrough render.
|
|
6
7
|
*/
|
|
7
|
-
export function DataProvider({ propertyId, as, record, children }) {
|
|
8
|
-
return (_jsx(DataContextProvider, { value: { propertyId, as, record }, children: children }));
|
|
8
|
+
export function DataProvider({ propertyId, as, record, records, children }) {
|
|
9
|
+
return (_jsx(DataContextProvider, { value: { propertyId, as, record, records }, children: children }));
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=DataProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataProvider.js","sourceRoot":"","sources":["../../src/components/DataProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAyB,MAAM,yBAAyB,CAAC;AAMrF
|
|
1
|
+
{"version":3,"file":"DataProvider.js","sourceRoot":"","sources":["../../src/components/DataProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAyB,MAAM,yBAAyB,CAAC;AAMrF;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAqB;IAC3F,OAAO,CACL,KAAC,mBAAmB,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAC5D,QAAQ,GACW,CACvB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SiteNode } from "../types";
|
|
2
|
+
/** A resolved (inlined) dataset def — the resolver bakes this into the runtime Repeat's props. */
|
|
3
|
+
interface ResolvedDatasetDef {
|
|
4
|
+
source: string;
|
|
5
|
+
mode: string;
|
|
6
|
+
filter?: Record<string, unknown>;
|
|
7
|
+
sort?: string;
|
|
8
|
+
limit?: number;
|
|
9
|
+
record?: string;
|
|
10
|
+
}
|
|
11
|
+
interface RepeatProps {
|
|
12
|
+
dataset: ResolvedDatasetDef;
|
|
13
|
+
as: string;
|
|
14
|
+
template: SiteNode;
|
|
15
|
+
emptyState?: SiteNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Runtime `Repeat`: fetches a live dataset (scoped to the nearest `DataProvider` propertyId,
|
|
19
|
+
* falling back to the site property) and renders `template` once per record, each wrapped in a
|
|
20
|
+
* `DataProvider` that exposes the record under `as` with `{$data}` bindings resolved per record.
|
|
21
|
+
* One SWR fetch per (property, dataset URL) is shared across instances, so data is fetched once.
|
|
22
|
+
*/
|
|
23
|
+
export declare function Repeat({ dataset, as, template, emptyState }: RepeatProps): import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=Repeat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Repeat.d.ts","sourceRoot":"","sources":["../../src/components/Repeat.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,kGAAkG;AAClG,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,WAAW;IACnB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,CAAC,EAAE,QAAQ,CAAC;CACvB;AA6DD;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,WAAW,kDAoDxE"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import useSWR from "swr";
|
|
4
|
+
import { renderNode } from "../renderer";
|
|
5
|
+
import { DataProvider } from "./DataProvider";
|
|
6
|
+
import { useDataContext, usePropertyScope } from "../hooks/useDataContext";
|
|
7
|
+
import { useSiteConfig } from "../hooks/useSiteConfig";
|
|
8
|
+
import { useAuth } from "../hooks/useAuth";
|
|
9
|
+
import { resolveBindings } from "../utils/resolveBindings";
|
|
10
|
+
// Runtime source → property sub-path (null = the property object itself, a single record).
|
|
11
|
+
const SOURCE_PATHS = {
|
|
12
|
+
"api.units": "units",
|
|
13
|
+
"api.floorplans": "floorplans",
|
|
14
|
+
"api.fees": "fees",
|
|
15
|
+
"api.specials": "specials",
|
|
16
|
+
"api.property": null,
|
|
17
|
+
};
|
|
18
|
+
const PAGINATED = new Set(["api.units", "api.floorplans"]);
|
|
19
|
+
const DEFAULT_LIMIT = 24;
|
|
20
|
+
const MAX_LIMIT = 100;
|
|
21
|
+
/** Build the public-API URL for a dataset scoped to `propertyId`, or null for an unknown source. */
|
|
22
|
+
function buildDatasetUrl(apiBaseUrl, propertyId, dataset) {
|
|
23
|
+
if (!(dataset.source in SOURCE_PATHS))
|
|
24
|
+
return null;
|
|
25
|
+
const sub = SOURCE_PATHS[dataset.source];
|
|
26
|
+
const base = `${apiBaseUrl}/v1/properties/${propertyId}`;
|
|
27
|
+
const params = new URLSearchParams();
|
|
28
|
+
if (dataset.source === "api.units") {
|
|
29
|
+
// Include the floorplan so {$data:"<as>.floorplan.*"} bindings resolve.
|
|
30
|
+
params.set("include_floorplan", "true");
|
|
31
|
+
if (dataset.sort)
|
|
32
|
+
params.set("sort_by", dataset.sort);
|
|
33
|
+
}
|
|
34
|
+
if (PAGINATED.has(dataset.source)) {
|
|
35
|
+
// Single page only: send an explicit clamped `limit` rather than following `data.cursor`
|
|
36
|
+
// (cursor-following via useSWRInfinite is a follow-up).
|
|
37
|
+
const lim = typeof dataset.limit === "number"
|
|
38
|
+
? Math.min(Math.max(1, Math.floor(dataset.limit)), MAX_LIMIT)
|
|
39
|
+
: DEFAULT_LIMIT;
|
|
40
|
+
params.set("limit", String(lim));
|
|
41
|
+
}
|
|
42
|
+
if (dataset.filter && typeof dataset.filter === "object") {
|
|
43
|
+
for (const [k, v] of Object.entries(dataset.filter)) {
|
|
44
|
+
// Skip empties and any leftover binding object (a {$data} can't be a fetch param).
|
|
45
|
+
if (v == null || v === "" || typeof v === "object")
|
|
46
|
+
continue;
|
|
47
|
+
params.set(k, String(v));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const qs = params.toString();
|
|
51
|
+
if (sub === null)
|
|
52
|
+
return qs ? `${base}?${qs}` : base;
|
|
53
|
+
return `${base}/${sub}${qs ? `?${qs}` : ""}`;
|
|
54
|
+
}
|
|
55
|
+
/** Pull the record list out of a dataset response (`api.property` is a single record). */
|
|
56
|
+
function extractRecords(dataset, data) {
|
|
57
|
+
if (dataset.source === "api.property") {
|
|
58
|
+
return data && typeof data === "object" ? [data] : [];
|
|
59
|
+
}
|
|
60
|
+
const items = data?.items;
|
|
61
|
+
return Array.isArray(items) ? items : [];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Runtime `Repeat`: fetches a live dataset (scoped to the nearest `DataProvider` propertyId,
|
|
65
|
+
* falling back to the site property) and renders `template` once per record, each wrapped in a
|
|
66
|
+
* `DataProvider` that exposes the record under `as` with `{$data}` bindings resolved per record.
|
|
67
|
+
* One SWR fetch per (property, dataset URL) is shared across instances, so data is fetched once.
|
|
68
|
+
*/
|
|
69
|
+
export function Repeat({ dataset, as, template, emptyState }) {
|
|
70
|
+
const config = useSiteConfig();
|
|
71
|
+
const { authenticatedFetch } = useAuth();
|
|
72
|
+
const scopePropertyId = usePropertyScope() ?? config.property?.propertyId ?? null;
|
|
73
|
+
const parentRecords = useDataContext()?.records ?? {};
|
|
74
|
+
const apiBaseUrl = config.property?.apiBaseUrl ?? "";
|
|
75
|
+
const url = scopePropertyId ? buildDatasetUrl(apiBaseUrl, scopePropertyId, dataset) : null;
|
|
76
|
+
const fetcher = useCallback((u) => authenticatedFetch(u).then((res) => {
|
|
77
|
+
if (!res.ok)
|
|
78
|
+
throw new Error(`Repeat dataset fetch failed: ${res.status}`);
|
|
79
|
+
return res.json();
|
|
80
|
+
}), [authenticatedFetch]);
|
|
81
|
+
// A null key disables the fetch (no property scope / unknown source).
|
|
82
|
+
const { data, error } = useSWR(url, fetcher);
|
|
83
|
+
if (!url)
|
|
84
|
+
return emptyState ? _jsx(_Fragment, { children: renderNode(emptyState) }) : null;
|
|
85
|
+
// Warn on fetch failure so it isn't indistinguishable from an empty result.
|
|
86
|
+
if (error) {
|
|
87
|
+
console.warn(`Repeat dataset fetch failed for ${url}:`, error);
|
|
88
|
+
return emptyState ? _jsx(_Fragment, { children: renderNode(emptyState) }) : null;
|
|
89
|
+
}
|
|
90
|
+
if (data === undefined)
|
|
91
|
+
return null; // loading
|
|
92
|
+
const records = extractRecords(dataset, data);
|
|
93
|
+
if (records.length === 0)
|
|
94
|
+
return emptyState ? _jsx(_Fragment, { children: renderNode(emptyState) }) : null;
|
|
95
|
+
return (_jsx(_Fragment, { children: records.map((record, i) => {
|
|
96
|
+
const recordsForThis = { ...parentRecords, [as]: record };
|
|
97
|
+
const resolved = resolveBindings(template, recordsForThis);
|
|
98
|
+
const key = String(record.id ?? record.unit_number ?? i);
|
|
99
|
+
return (_jsx(DataProvider, { propertyId: scopePropertyId ?? undefined, as: as, record: record, records: recordsForThis, children: renderNode(resolved) }, key));
|
|
100
|
+
}) }));
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=Repeat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;YACzD,OAAO,CACL,KAAC,YAAY,IAEX,UAAU,EAAE,eAAe,IAAI,SAAS,EACxC,EAAE,EAAE,EAAE,EACN,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,YAEtB,UAAU,CAAC,QAAQ,CAAC,IANhB,GAAG,CAOK,CAChB,CAAC;QACJ,CAAC,CAAC,GACD,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/components/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/components/registry.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CA2CtE,CAAC"}
|
|
@@ -36,6 +36,7 @@ import { ComponentBrowser } from "./browser/ComponentBrowser";
|
|
|
36
36
|
import { ComponentShowcase } from "./browser/ComponentShowcase";
|
|
37
37
|
import { DataProvider } from "./DataProvider";
|
|
38
38
|
import { Fragment } from "./Fragment";
|
|
39
|
+
import { Repeat } from "./Repeat";
|
|
39
40
|
import { ThemeScope } from "./ThemeProvider";
|
|
40
41
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
42
|
export const componentRegistry = {
|
|
@@ -79,5 +80,7 @@ export const componentRegistry = {
|
|
|
79
80
|
DataProvider,
|
|
80
81
|
ThemeScope,
|
|
81
82
|
Fragment,
|
|
83
|
+
// Runtime Repeat over live API data (P4b) — a real render component, not a directive.
|
|
84
|
+
Repeat,
|
|
82
85
|
};
|
|
83
86
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/components/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,Q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J,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,kFAAkF;IAClF,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,sFAAsF;IACtF,MAAM;CACP,CAAC"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Data scope for a subtree, set by `DataProvider`. A compile-time Repeat injects the
|
|
3
|
-
* per-building `propertyId`;
|
|
3
|
+
* per-building `propertyId`; a runtime Repeat injects the current record under `as` and the
|
|
4
|
+
* accumulated `records` map. Consumers default to the site property when `propertyId` is unset.
|
|
4
5
|
*/
|
|
5
6
|
export interface DataContextValue {
|
|
6
7
|
propertyId?: string;
|
|
7
8
|
as?: string;
|
|
8
9
|
record?: Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Alias→record map accumulated down nested runtime `Repeat`s, so `{$data:"alias.field"}`
|
|
12
|
+
* resolves against the right record even when an inner Repeat shadows an outer one.
|
|
13
|
+
*/
|
|
14
|
+
records?: Record<string, unknown>;
|
|
9
15
|
}
|
|
10
16
|
export declare function DataContextProvider({ value, children, }: {
|
|
11
17
|
value: DataContextValue;
|
|
@@ -14,4 +20,10 @@ export declare function DataContextProvider({ value, children, }: {
|
|
|
14
20
|
export declare function useDataContext(): DataContextValue | null;
|
|
15
21
|
/** The nearest provider's propertyId, or null — the D8 per-building scope seam. */
|
|
16
22
|
export declare function usePropertyScope(): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* The record bound to `as` by the nearest enclosing runtime `Repeat`, or undefined.
|
|
25
|
+
* Prefers the accumulated `records` map (so an outer Repeat's record is still reachable from an
|
|
26
|
+
* inner one); falls back to the nearest provider's singular `record`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useRecord(as: string): Record<string, unknown> | undefined;
|
|
17
29
|
//# sourceMappingURL=useDataContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDataContext.d.ts","sourceRoot":"","sources":["../../src/hooks/useDataContext.tsx"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"useDataContext.d.ts","sourceRoot":"","sources":["../../src/hooks/useDataContext.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAID,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAEA;AAED,wBAAgB,cAAc,IAAI,gBAAgB,GAAG,IAAI,CAExD;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAOzE"}
|