@measured/puck 0.21.0-canary.77444503 → 0.21.0-canary.7c2f9283

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{Editor-O447AVCX.mjs → Editor-32UYWE6W.mjs} +10 -10
  2. package/dist/{Editor-F2LSS6SE.css → Editor-IQP25PUX.css} +28 -27
  3. package/dist/{Render-QEMDIDQC.css → Render-3OV4N4MT.css} +28 -27
  4. package/dist/{Render-OFE6QLI2.mjs → Render-FXZX6NFH.mjs} +1 -1
  5. package/dist/{actions-ONhOkrvf.d.mts → actions-BkBoKAc5.d.mts} +26 -10
  6. package/dist/{actions-ONhOkrvf.d.ts → actions-BkBoKAc5.d.ts} +26 -10
  7. package/dist/{chunk-QAWJTCV5.mjs → chunk-3VQHXASI.mjs} +1 -1
  8. package/dist/{chunk-BSDEIOEK.mjs → chunk-6KNQXLQR.mjs} +10 -8
  9. package/dist/{chunk-CSSRLPHM.mjs → chunk-AOEDIUVK.mjs} +1 -1
  10. package/dist/{chunk-4277WLKB.mjs → chunk-FCCNEDWR.mjs} +4373 -3687
  11. package/dist/{chunk-PLXSMBAA.mjs → chunk-GVKHZNTR.mjs} +1 -1
  12. package/dist/{chunk-DAQLMM2T.mjs → chunk-K562SEXI.mjs} +97 -6
  13. package/dist/{chunk-QBGM4ELA.mjs → chunk-KN3XDS7U.mjs} +1 -1
  14. package/dist/{chunk-62AAYNXG.mjs → chunk-MEL7FUSF.mjs} +1 -1
  15. package/dist/{chunk-Y656T6AQ.mjs → chunk-NYGQH27S.mjs} +100 -74
  16. package/dist/{chunk-NLUHDYVR.mjs → chunk-Q3TJ2VYO.mjs} +23 -3
  17. package/dist/{chunk-T3WX7XJ6.mjs → chunk-REWRIUGR.mjs} +33 -9
  18. package/dist/{chunk-2Q4PACDA.mjs → chunk-V2IQTPPK.mjs} +4 -4
  19. package/dist/{full-BEMDJKDS.mjs → full-4OS3O57Y.mjs} +8 -8
  20. package/dist/{index-BEoNHRI1.d.ts → index-bqD1SEOb.d.mts} +3 -1
  21. package/dist/{index-DfxZ7tZF.d.mts → index-lt1zf5WR.d.ts} +3 -1
  22. package/dist/index.css +732 -341
  23. package/dist/index.d.mts +28 -9
  24. package/dist/index.d.ts +28 -9
  25. package/dist/index.js +3340 -2427
  26. package/dist/index.mjs +21 -18
  27. package/dist/internal.d.mts +2 -2
  28. package/dist/internal.d.ts +2 -2
  29. package/dist/internal.js +22 -3
  30. package/dist/internal.mjs +2 -2
  31. package/dist/{loaded-JU3A7Y4L.mjs → loaded-DCQVLO7I.mjs} +5 -5
  32. package/dist/{loaded-N3FYGF2Y.mjs → loaded-JGRO7BH7.mjs} +5 -5
  33. package/dist/{loaded-OBY7OMS6.mjs → loaded-KKVJE5KH.mjs} +5 -5
  34. package/dist/no-external.css +870 -475
  35. package/dist/no-external.d.mts +4 -4
  36. package/dist/no-external.d.ts +4 -4
  37. package/dist/no-external.js +3347 -2431
  38. package/dist/no-external.mjs +20 -12
  39. package/dist/rsc.css +28 -27
  40. package/dist/rsc.d.mts +2 -2
  41. package/dist/rsc.d.ts +2 -2
  42. package/dist/rsc.js +146 -83
  43. package/dist/rsc.mjs +4 -4
  44. package/dist/{walk-tree-CdriEzFJ.d.mts → walk-tree-CRRDqx6_.d.mts} +1 -1
  45. package/dist/{walk-tree-DHbAZ4wF.d.ts → walk-tree-CS7sEpfG.d.ts} +1 -1
  46. package/package.json +1 -1
@@ -3,7 +3,7 @@ import {
3
3
  AlignJustify,
4
4
  AlignLeft,
5
5
  AlignRight
6
- } from "./chunk-DAQLMM2T.mjs";
6
+ } from "./chunk-K562SEXI.mjs";
7
7
  import {
8
8
  init_react_import
9
9
  } from "./chunk-M6W7YEVX.mjs";
@@ -3,19 +3,19 @@ import {
3
3
  generateId,
4
4
  getItem,
5
5
  makeStatePublic
6
- } from "./chunk-QBGM4ELA.mjs";
6
+ } from "./chunk-KN3XDS7U.mjs";
7
7
  import {
8
8
  defaultAppState,
9
9
  defaultViewports,
10
10
  getChanged,
11
11
  resolveComponentData
12
- } from "./chunk-T3WX7XJ6.mjs";
12
+ } from "./chunk-REWRIUGR.mjs";
13
13
  import {
14
14
  get_class_name_factory_default
15
15
  } from "./chunk-Y2EFNT5P.mjs";
16
16
  import {
17
17
  walkAppState
18
- } from "./chunk-NLUHDYVR.mjs";
18
+ } from "./chunk-Q3TJ2VYO.mjs";
19
19
  import {
20
20
  __async,
21
21
  __objRest,
@@ -225,6 +225,15 @@ var EllipsisVertical = createLucideIcon("EllipsisVertical", [
225
225
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
226
226
  ]);
227
227
 
228
+ // ../../node_modules/lucide-react/dist/esm/icons/expand.js
229
+ init_react_import();
230
+ var Expand = createLucideIcon("Expand", [
231
+ ["path", { d: "m21 21-6-6m6 6v-4.8m0 4.8h-4.8", key: "1c15vz" }],
232
+ ["path", { d: "M3 16.2V21m0 0h4.8M3 21l6-6", key: "1fsnz2" }],
233
+ ["path", { d: "M21 7.8V3m0 0h-4.8M21 3l-6 6", key: "hawz9i" }],
234
+ ["path", { d: "M3 7.8V3m0 0h4.8M3 3l6 6", key: "u9ee12" }]
235
+ ]);
236
+
228
237
  // ../../node_modules/lucide-react/dist/esm/icons/globe.js
229
238
  init_react_import();
230
239
  var Globe = createLucideIcon("Globe", [
@@ -233,6 +242,20 @@ var Globe = createLucideIcon("Globe", [
233
242
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
234
243
  ]);
235
244
 
245
+ // ../../node_modules/lucide-react/dist/esm/icons/hammer.js
246
+ init_react_import();
247
+ var Hammer = createLucideIcon("Hammer", [
248
+ ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
249
+ ["path", { d: "m18 15 4-4", key: "16gjal" }],
250
+ [
251
+ "path",
252
+ {
253
+ d: "m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",
254
+ key: "b7pghm"
255
+ }
256
+ ]
257
+ ]);
258
+
236
259
  // ../../node_modules/lucide-react/dist/esm/icons/hash.js
237
260
  init_react_import();
238
261
  var Hash = createLucideIcon("Hash", [
@@ -378,6 +401,24 @@ var Lock = createLucideIcon("Lock", [
378
401
  ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
379
402
  ]);
380
403
 
404
+ // ../../node_modules/lucide-react/dist/esm/icons/maximize-2.js
405
+ init_react_import();
406
+ var Maximize2 = createLucideIcon("Maximize2", [
407
+ ["polyline", { points: "15 3 21 3 21 9", key: "mznyad" }],
408
+ ["polyline", { points: "9 21 3 21 3 15", key: "1avn1i" }],
409
+ ["line", { x1: "21", x2: "14", y1: "3", y2: "10", key: "ota7mn" }],
410
+ ["line", { x1: "3", x2: "10", y1: "21", y2: "14", key: "1atl0r" }]
411
+ ]);
412
+
413
+ // ../../node_modules/lucide-react/dist/esm/icons/minimize-2.js
414
+ init_react_import();
415
+ var Minimize2 = createLucideIcon("Minimize2", [
416
+ ["polyline", { points: "4 14 10 14 10 20", key: "11kfnr" }],
417
+ ["polyline", { points: "20 10 14 10 14 4", key: "rlmsce" }],
418
+ ["line", { x1: "14", x2: "21", y1: "10", y2: "3", key: "o5lafz" }],
419
+ ["line", { x1: "3", x2: "10", y1: "21", y2: "14", key: "1atl0r" }]
420
+ ]);
421
+
381
422
  // ../../node_modules/lucide-react/dist/esm/icons/minus.js
382
423
  init_react_import();
383
424
  var Minus = createLucideIcon("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
@@ -430,6 +471,15 @@ var Quote = createLucideIcon("Quote", [
430
471
  ]
431
472
  ]);
432
473
 
474
+ // ../../node_modules/lucide-react/dist/esm/icons/rectangle-ellipsis.js
475
+ init_react_import();
476
+ var RectangleEllipsis = createLucideIcon("RectangleEllipsis", [
477
+ ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }],
478
+ ["path", { d: "M12 12h.01", key: "1mp3jc" }],
479
+ ["path", { d: "M17 12h.01", key: "1m0b6t" }],
480
+ ["path", { d: "M7 12h.01", key: "eqddd0" }]
481
+ ]);
482
+
433
483
  // ../../node_modules/lucide-react/dist/esm/icons/redo-2.js
434
484
  init_react_import();
435
485
  var Redo2 = createLucideIcon("Redo2", [
@@ -488,6 +538,14 @@ var Tablet = createLucideIcon("Tablet", [
488
538
  ["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
489
539
  ]);
490
540
 
541
+ // ../../node_modules/lucide-react/dist/esm/icons/toy-brick.js
542
+ init_react_import();
543
+ var ToyBrick = createLucideIcon("ToyBrick", [
544
+ ["rect", { width: "18", height: "12", x: "3", y: "8", rx: "1", key: "158fvp" }],
545
+ ["path", { d: "M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3", key: "s0042v" }],
546
+ ["path", { d: "M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3", key: "9wmeh2" }]
547
+ ]);
548
+
491
549
  // ../../node_modules/lucide-react/dist/esm/icons/trash.js
492
550
  init_react_import();
493
551
  var Trash = createLucideIcon("Trash", [
@@ -518,6 +576,13 @@ var Undo2 = createLucideIcon("Undo2", [
518
576
  ["path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11", key: "f3b9sd" }]
519
577
  ]);
520
578
 
579
+ // ../../node_modules/lucide-react/dist/esm/icons/x.js
580
+ init_react_import();
581
+ var X = createLucideIcon("X", [
582
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
583
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
584
+ ]);
585
+
521
586
  // ../../node_modules/lucide-react/dist/esm/icons/zoom-in.js
522
587
  init_react_import();
523
588
  var ZoomIn = createLucideIcon("ZoomIn", [
@@ -1094,6 +1159,7 @@ var createAppStore = (initialAppStore) => create2()(
1094
1159
  subscribeWithSelector2((set, get) => {
1095
1160
  var _a, _b;
1096
1161
  return __spreadProps(__spreadValues({
1162
+ instanceId: generateId(),
1097
1163
  state: defaultAppState,
1098
1164
  config: { components: {} },
1099
1165
  componentState: {},
@@ -1114,6 +1180,11 @@ var createAppStore = (initialAppStore) => create2()(
1114
1180
  history: createHistorySlice(set, get),
1115
1181
  nodes: createNodesSlice(set, get),
1116
1182
  permissions: createPermissionsSlice(set, get),
1183
+ getCurrentData: () => {
1184
+ var _a2;
1185
+ const s = get();
1186
+ return (_a2 = s.selectedItem) != null ? _a2 : s.state.data.root;
1187
+ },
1117
1188
  getComponentConfig: (type) => {
1118
1189
  var _a2;
1119
1190
  const { config, selectedItem } = get();
@@ -1203,7 +1274,12 @@ var createAppStore = (initialAppStore) => create2()(
1203
1274
  return __spreadProps(__spreadValues({}, s), { state, selectedItem });
1204
1275
  }),
1205
1276
  resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
1206
- const { config, metadata, setComponentLoading, permissions } = get();
1277
+ var _a2, _b2;
1278
+ const { config, metadata, setComponentLoading, permissions, state } = get();
1279
+ const componentId = "id" in componentData.props ? componentData.props.id : "root";
1280
+ const parentId = (_a2 = state.indexes.nodes[componentId]) == null ? void 0 : _a2.parentId;
1281
+ const parentNode = parentId ? state.indexes.nodes[parentId] : null;
1282
+ const parentData = (_b2 = parentNode == null ? void 0 : parentNode.data) != null ? _b2 : null;
1207
1283
  const timeouts = {};
1208
1284
  return yield resolveComponentData(
1209
1285
  componentData,
@@ -1222,7 +1298,8 @@ var createAppStore = (initialAppStore) => create2()(
1222
1298
  }
1223
1299
  timeouts[id]();
1224
1300
  }),
1225
- trigger
1301
+ trigger,
1302
+ parentData
1226
1303
  );
1227
1304
  }),
1228
1305
  resolveAndCommitData: () => __async(null, null, function* () {
@@ -1457,7 +1534,7 @@ var getZoomConfig = (uiViewport, frame, zoom) => {
1457
1534
  const viewportHeight = uiViewport.height === "auto" ? frameHeight : uiViewport.height;
1458
1535
  let rootHeight = 0;
1459
1536
  let autoZoom = 1;
1460
- if (uiViewport.width > frameWidth || viewportHeight > frameHeight) {
1537
+ if (typeof uiViewport.width === "number" && (uiViewport.width > frameWidth || viewportHeight > frameHeight)) {
1461
1538
  const widthZoom = Math.min(frameWidth / uiViewport.width, 1);
1462
1539
  const heightZoom = Math.min(frameHeight / viewportHeight, 1);
1463
1540
  zoom = widthZoom;
@@ -1603,7 +1680,9 @@ export {
1603
1680
  Copy,
1604
1681
  CornerLeftUp,
1605
1682
  EllipsisVertical,
1683
+ Expand,
1606
1684
  Globe,
1685
+ Hammer,
1607
1686
  Hash,
1608
1687
  Heading1,
1609
1688
  Heading2,
@@ -1620,12 +1699,15 @@ export {
1620
1699
  List,
1621
1700
  LockOpen,
1622
1701
  Lock,
1702
+ Maximize2,
1703
+ Minimize2,
1623
1704
  Minus,
1624
1705
  Monitor,
1625
1706
  PanelLeft,
1626
1707
  PanelRight,
1627
1708
  Plus,
1628
1709
  Quote,
1710
+ RectangleEllipsis,
1629
1711
  Redo2,
1630
1712
  Search,
1631
1713
  SlidersHorizontal,
@@ -1633,10 +1715,12 @@ export {
1633
1715
  SquareCode,
1634
1716
  Strikethrough,
1635
1717
  Tablet,
1718
+ ToyBrick,
1636
1719
  Trash,
1637
1720
  Type,
1638
1721
  Underline,
1639
1722
  Undo2,
1723
+ X,
1640
1724
  ZoomIn,
1641
1725
  ZoomOut,
1642
1726
  reorder,
@@ -1678,7 +1762,9 @@ lucide-react/dist/esm/icons/code.js:
1678
1762
  lucide-react/dist/esm/icons/copy.js:
1679
1763
  lucide-react/dist/esm/icons/corner-left-up.js:
1680
1764
  lucide-react/dist/esm/icons/ellipsis-vertical.js:
1765
+ lucide-react/dist/esm/icons/expand.js:
1681
1766
  lucide-react/dist/esm/icons/globe.js:
1767
+ lucide-react/dist/esm/icons/hammer.js:
1682
1768
  lucide-react/dist/esm/icons/hash.js:
1683
1769
  lucide-react/dist/esm/icons/heading-1.js:
1684
1770
  lucide-react/dist/esm/icons/heading-2.js:
@@ -1693,12 +1779,15 @@ lucide-react/dist/esm/icons/link.js:
1693
1779
  lucide-react/dist/esm/icons/list-ordered.js:
1694
1780
  lucide-react/dist/esm/icons/lock-open.js:
1695
1781
  lucide-react/dist/esm/icons/lock.js:
1782
+ lucide-react/dist/esm/icons/maximize-2.js:
1783
+ lucide-react/dist/esm/icons/minimize-2.js:
1696
1784
  lucide-react/dist/esm/icons/minus.js:
1697
1785
  lucide-react/dist/esm/icons/monitor.js:
1698
1786
  lucide-react/dist/esm/icons/panel-left.js:
1699
1787
  lucide-react/dist/esm/icons/panel-right.js:
1700
1788
  lucide-react/dist/esm/icons/plus.js:
1701
1789
  lucide-react/dist/esm/icons/quote.js:
1790
+ lucide-react/dist/esm/icons/rectangle-ellipsis.js:
1702
1791
  lucide-react/dist/esm/icons/redo-2.js:
1703
1792
  lucide-react/dist/esm/icons/search.js:
1704
1793
  lucide-react/dist/esm/icons/sliders-horizontal.js:
@@ -1706,10 +1795,12 @@ lucide-react/dist/esm/icons/smartphone.js:
1706
1795
  lucide-react/dist/esm/icons/square-code.js:
1707
1796
  lucide-react/dist/esm/icons/strikethrough.js:
1708
1797
  lucide-react/dist/esm/icons/tablet.js:
1798
+ lucide-react/dist/esm/icons/toy-brick.js:
1709
1799
  lucide-react/dist/esm/icons/trash.js:
1710
1800
  lucide-react/dist/esm/icons/type.js:
1711
1801
  lucide-react/dist/esm/icons/underline.js:
1712
1802
  lucide-react/dist/esm/icons/undo-2.js:
1803
+ lucide-react/dist/esm/icons/x.js:
1713
1804
  lucide-react/dist/esm/icons/zoom-in.js:
1714
1805
  lucide-react/dist/esm/icons/zoom-out.js:
1715
1806
  lucide-react/dist/esm/lucide-react.js:
@@ -3,7 +3,7 @@ import {
3
3
  setupZone,
4
4
  walkAppState,
5
5
  walkTree
6
- } from "./chunk-NLUHDYVR.mjs";
6
+ } from "./chunk-Q3TJ2VYO.mjs";
7
7
  import {
8
8
  __spreadProps,
9
9
  __spreadValues,
@@ -5,7 +5,7 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-DAQLMM2T.mjs";
8
+ } from "./chunk-K562SEXI.mjs";
9
9
  import {
10
10
  init_react_import
11
11
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,18 +1,20 @@
1
1
  import {
2
2
  styles_module_default
3
- } from "./chunk-CSSRLPHM.mjs";
3
+ } from "./chunk-AOEDIUVK.mjs";
4
4
  import {
5
5
  defaultAppState,
6
- resolveComponentData
7
- } from "./chunk-T3WX7XJ6.mjs";
6
+ resolveComponentData,
7
+ toComponent
8
+ } from "./chunk-REWRIUGR.mjs";
8
9
  import {
9
10
  get_class_name_factory_default
10
11
  } from "./chunk-Y2EFNT5P.mjs";
11
12
  import {
13
+ getZoneId,
12
14
  mapFields,
13
15
  walkAppState,
14
16
  walkTree
15
- } from "./chunk-NLUHDYVR.mjs";
17
+ } from "./chunk-Q3TJ2VYO.mjs";
16
18
  import {
17
19
  __async,
18
20
  __objRest,
@@ -186,21 +188,29 @@ function transformProps(data, propTransforms, config = { components: {} }) {
186
188
  // lib/resolve-all-data.ts
187
189
  init_react_import();
188
190
 
189
- // lib/data/to-component.ts
191
+ // lib/group-zones-by-component.ts
190
192
  init_react_import();
191
- var toComponent = (item) => {
192
- return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
193
- props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
194
- type: "root"
195
- });
193
+ var groupZonesByComponent = (data) => {
194
+ var _a;
195
+ const zoneEntries = Object.entries((_a = data.zones) != null ? _a : {});
196
+ return zoneEntries.reduce((acc, [zoneCompound, zoneContent]) => {
197
+ const [componentId, zoneName] = getZoneId(zoneCompound);
198
+ if (!componentId.length || !zoneName.length) return acc;
199
+ if (!acc[componentId]) {
200
+ acc[componentId] = [];
201
+ }
202
+ acc[componentId].push({ zoneCompound, content: zoneContent });
203
+ return acc;
204
+ }, {});
196
205
  };
197
206
 
198
207
  // lib/resolve-all-data.ts
199
208
  function resolveAllData(_0, _1) {
200
209
  return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
201
- var _a;
202
210
  const defaultedData = defaultData(data);
203
- const resolveNode = (_node) => __async(null, null, function* () {
211
+ const zonesByComponent = groupZonesByComponent(defaultedData);
212
+ let resolvedZones = {};
213
+ const resolveNode = (_node, parent) => __async(null, null, function* () {
204
214
  const node = toComponent(_node);
205
215
  onResolveStart == null ? void 0 : onResolveStart(node);
206
216
  const resolved = (yield resolveComponentData(
@@ -211,76 +221,47 @@ function resolveAllData(_0, _1) {
211
221
  },
212
222
  () => {
213
223
  },
214
- "force"
224
+ "force",
225
+ parent
215
226
  )).node;
216
- const resolvedDeep = yield mapFields(
227
+ const resolvedAsComponent = toComponent(resolved);
228
+ const resolvedDeepPromise = mapFields(
217
229
  resolved,
218
- { slot: ({ value }) => processContent(value) },
230
+ {
231
+ slot: ({ value }) => processContent(value, resolvedAsComponent)
232
+ },
219
233
  config
220
234
  );
235
+ let resolveZonePromises = [];
236
+ if (zonesByComponent[resolvedAsComponent.props.id]) {
237
+ resolveZonePromises = zonesByComponent[resolvedAsComponent.props.id].map(
238
+ (_02) => __async(null, [_02], function* ({ zoneCompound, content }) {
239
+ resolvedZones[zoneCompound] = yield processContent(
240
+ content,
241
+ resolvedAsComponent
242
+ );
243
+ })
244
+ );
245
+ }
246
+ const resolvedDeep = yield resolvedDeepPromise;
247
+ yield Promise.all(resolveZonePromises);
221
248
  onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
222
249
  return resolvedDeep;
223
250
  });
224
- const processContent = (content) => __async(null, null, function* () {
225
- return Promise.all(content.map(resolveNode));
226
- });
227
- const processZones = () => __async(null, null, function* () {
228
- var _a2;
229
- const zones = (_a2 = data.zones) != null ? _a2 : {};
230
- Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
231
- zones[zoneKey] = yield Promise.all(content.map(resolveNode));
232
- }));
233
- return zones;
251
+ const processContent = (content, parent) => __async(null, null, function* () {
252
+ return Promise.all(content.map((item) => resolveNode(item, parent)));
234
253
  });
235
- const dynamic = {
236
- root: yield resolveNode(defaultedData.root),
237
- content: yield processContent(defaultedData.content),
238
- zones: yield processZones()
239
- };
240
- Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
241
- const content = defaultedData.zones[zoneKey];
242
- dynamic.zones[zoneKey] = yield processContent(content);
243
- }), {});
244
- return dynamic;
254
+ const result = defaultData({});
255
+ result.root = yield resolveNode(defaultedData.root, null);
256
+ result.content = yield processContent(
257
+ defaultedData.content,
258
+ toComponent(result.root)
259
+ );
260
+ result.zones = resolvedZones;
261
+ return result;
245
262
  });
246
263
  }
247
264
 
248
- // lib/field-transforms/use-field-transforms.tsx
249
- init_react_import();
250
- import { useMemo } from "react";
251
- function useFieldTransforms(config, item, transforms, readOnly, forceReadOnly) {
252
- const mappers = useMemo(() => {
253
- return Object.keys(transforms).reduce((acc, _fieldType) => {
254
- const fieldType = _fieldType;
255
- return __spreadProps(__spreadValues({}, acc), {
256
- [fieldType]: (_a) => {
257
- var _b = _a, {
258
- parentId
259
- } = _b, params = __objRest(_b, [
260
- "parentId"
261
- ]);
262
- const wildcardPath = params.propPath.replace(/\[\d+\]/g, "[*]");
263
- const isReadOnly = (readOnly == null ? void 0 : readOnly[params.propPath]) || (readOnly == null ? void 0 : readOnly[wildcardPath]) || forceReadOnly || false;
264
- const fn = transforms[fieldType];
265
- return fn == null ? void 0 : fn(__spreadProps(__spreadValues({}, params), {
266
- isReadOnly,
267
- componentId: parentId
268
- }));
269
- }
270
- });
271
- }, {});
272
- }, [transforms, readOnly, forceReadOnly]);
273
- const transformedProps = useMemo(() => {
274
- const mapped = mapFields(item, mappers, config).props;
275
- return mapped;
276
- }, [config, item, mappers]);
277
- const mergedProps = useMemo(
278
- () => __spreadValues(__spreadValues({}, item.props), transformedProps),
279
- [item.props, transformedProps]
280
- );
281
- return mergedProps;
282
- }
283
-
284
265
  // lib/field-transforms/default-transforms/slot-transform.tsx
285
266
  init_react_import();
286
267
  var getSlotTransform = (renderSlotEdit, renderSlotRender = renderSlotEdit) => ({
@@ -299,6 +280,52 @@ var getSlotTransform = (renderSlotEdit, renderSlotRender = renderSlotEdit) => ({
299
280
 
300
281
  // lib/use-slots.tsx
301
282
  init_react_import();
283
+
284
+ // lib/field-transforms/use-field-transforms.tsx
285
+ init_react_import();
286
+ import { useMemo } from "react";
287
+
288
+ // lib/field-transforms/build-mappers.ts
289
+ init_react_import();
290
+ function buildMappers(transforms, readOnly, forceReadOnly) {
291
+ return Object.keys(transforms).reduce((acc, _fieldType) => {
292
+ const fieldType = _fieldType;
293
+ return __spreadProps(__spreadValues({}, acc), {
294
+ [fieldType]: (_a) => {
295
+ var _b = _a, {
296
+ parentId
297
+ } = _b, params = __objRest(_b, [
298
+ "parentId"
299
+ ]);
300
+ const wildcardPath = params.propPath.replace(/\[\d+\]/g, "[*]");
301
+ const isReadOnly = (readOnly == null ? void 0 : readOnly[params.propPath]) || (readOnly == null ? void 0 : readOnly[wildcardPath]) || forceReadOnly || false;
302
+ const fn = transforms[fieldType];
303
+ return fn == null ? void 0 : fn(__spreadProps(__spreadValues({}, params), {
304
+ isReadOnly,
305
+ componentId: parentId
306
+ }));
307
+ }
308
+ });
309
+ }, {});
310
+ }
311
+
312
+ // lib/field-transforms/use-field-transforms.tsx
313
+ function useFieldTransforms(config, item, transforms, readOnly, forceReadOnly) {
314
+ const mappers = useMemo(
315
+ () => buildMappers(transforms, readOnly, forceReadOnly),
316
+ [transforms, readOnly, forceReadOnly]
317
+ );
318
+ const transformedProps = useMemo(() => {
319
+ return mapFields(item, mappers, config).props;
320
+ }, [config, item, mappers]);
321
+ const mergedProps = useMemo(
322
+ () => __spreadValues(__spreadValues({}, item.props), transformedProps),
323
+ [item.props, transformedProps]
324
+ );
325
+ return mergedProps;
326
+ }
327
+
328
+ // lib/use-slots.tsx
302
329
  function useSlots(config, item, renderSlotEdit, renderSlotRender = renderSlotEdit, readOnly, forceReadOnly) {
303
330
  return useFieldTransforms(
304
331
  config,
@@ -344,7 +371,7 @@ function useRichtextProps(fields, props) {
344
371
  const richtextProps = useMemo2(() => {
345
372
  if (!(richtextKeys == null ? void 0 : richtextKeys.length)) return {};
346
373
  const RichTextRender = lazy(
347
- () => import("./Render-OFE6QLI2.mjs").then((m) => ({
374
+ () => import("./Render-FXZX6NFH.mjs").then((m) => ({
348
375
  default: m.RichTextRender
349
376
  }))
350
377
  );
@@ -405,14 +432,13 @@ var SlotRender = forwardRef(
405
432
  );
406
433
 
407
434
  export {
408
- useFieldTransforms,
435
+ buildMappers,
409
436
  getSlotTransform,
410
437
  useSlots,
411
438
  RichTextRenderFallback,
412
439
  useRichtextProps,
413
440
  SlotRenderPure,
414
441
  SlotRender,
415
- toComponent,
416
442
  migrate,
417
443
  transformProps,
418
444
  resolveAllData
@@ -143,12 +143,12 @@ var walkObject = ({
143
143
  }
144
144
  return flatten(newProps);
145
145
  };
146
- function mapFields(item, mappers, config, recurseSlots = false) {
146
+ function mapFields(item, mappers, config, recurseSlots = false, shouldDefaultSlots = true) {
147
147
  var _a, _b, _c, _d, _e;
148
148
  const itemType = "type" in item ? item.type : "root";
149
149
  const componentConfig = itemType === "root" ? config.root : (_a = config.components) == null ? void 0 : _a[itemType];
150
150
  const newProps = walkObject({
151
- value: defaultSlots((_b = item.props) != null ? _b : {}, (_c = componentConfig == null ? void 0 : componentConfig.fields) != null ? _c : {}),
151
+ value: shouldDefaultSlots ? defaultSlots((_b = item.props) != null ? _b : {}, (_c = componentConfig == null ? void 0 : componentConfig.fields) != null ? _c : {}) : item.props,
152
152
  fields: (_d = componentConfig == null ? void 0 : componentConfig.fields) != null ? _d : {},
153
153
  mappers,
154
154
  id: item.props ? (_e = item.props.id) != null ? _e : "root" : "root",
@@ -222,9 +222,28 @@ var stripSlots = (data, config) => {
222
222
 
223
223
  // lib/data/flatten-node.ts
224
224
  var { flatten: flatten2, unflatten } = flat;
225
+ function isEmptyArrayOrObject(val) {
226
+ if (Array.isArray(val)) {
227
+ return val.length === 0;
228
+ }
229
+ if (val != null && Object.prototype.toString.call(val) === "[object Object]") {
230
+ return Object.keys(val).length === 0;
231
+ }
232
+ return false;
233
+ }
234
+ function stripEmptyObjects(props) {
235
+ const result = {};
236
+ for (const key in props) {
237
+ if (!Object.prototype.hasOwnProperty.call(props, key)) continue;
238
+ const val = props[key];
239
+ if (isEmptyArrayOrObject(val)) continue;
240
+ result[key] = val;
241
+ }
242
+ return result;
243
+ }
225
244
  var flattenNode = (node, config) => {
226
245
  return __spreadProps(__spreadValues({}, node), {
227
- props: flatten2(stripSlots(node, config).props)
246
+ props: stripEmptyObjects(flatten2(stripSlots(node, config).props))
228
247
  });
229
248
  };
230
249
  var expandNode = (node) => {
@@ -406,6 +425,7 @@ export {
406
425
  rootAreaId,
407
426
  rootZone,
408
427
  rootDroppableId,
428
+ getZoneId,
409
429
  defaultSlots,
410
430
  walkField,
411
431
  mapFields,