@measured/puck 0.17.2-canary.f323610 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -289,7 +289,7 @@ init_react_import();
289
289
  var styles_module_default2 = { "InputWrapper": "_InputWrapper_1l5m8_1", "Input": "_Input_1l5m8_1", "Input-label": "_Input-label_1l5m8_26", "Input-labelIcon": "_Input-labelIcon_1l5m8_35", "Input-disabledIcon": "_Input-disabledIcon_1l5m8_42", "Input-input": "_Input-input_1l5m8_47", "Input--readOnly": "_Input--readOnly_1l5m8_91", "Input-radioGroupItems": "_Input-radioGroupItems_1l5m8_102", "Input-radio": "_Input-radio_1l5m8_102", "Input-radioInner": "_Input-radioInner_1l5m8_119", "Input-radioInput": "_Input-radioInput_1l5m8_164" };
290
290
 
291
291
  // components/AutoField/index.tsx
292
- var import_react16 = require("react");
292
+ var import_react17 = require("react");
293
293
 
294
294
  // components/AutoField/fields/index.tsx
295
295
  init_react_import();
@@ -951,13 +951,11 @@ var resolveComponentData = (item, config, onResolveStart, onResolveEnd) => __asy
951
951
  onResolveStart(item);
952
952
  }
953
953
  const { props: resolvedProps, readOnly = {} } = yield configForItem.resolveData(item, { changed, lastData: oldItem });
954
- const { readOnly: existingReadOnly = {} } = item || {};
955
- const newReadOnly = __spreadValues(__spreadValues({}, existingReadOnly), readOnly);
956
954
  const resolvedItem = __spreadProps(__spreadValues({}, item), {
957
955
  props: __spreadValues(__spreadValues({}, item.props), resolvedProps)
958
956
  });
959
- if (Object.keys(newReadOnly).length) {
960
- resolvedItem.readOnly = newReadOnly;
957
+ if (Object.keys(readOnly).length) {
958
+ resolvedItem.readOnly = readOnly;
961
959
  }
962
960
  cache.lastChange[item.props.id] = {
963
961
  item,
@@ -1352,7 +1350,7 @@ var Draggable = ({
1352
1350
  };
1353
1351
 
1354
1352
  // components/AutoField/fields/ArrayField/index.tsx
1355
- var import_react8 = require("react");
1353
+ var import_react9 = require("react");
1356
1354
 
1357
1355
  // components/DragIcon/index.tsx
1358
1356
  init_react_import();
@@ -1366,19 +1364,64 @@ var import_jsx_runtime7 = require("react/jsx-runtime");
1366
1364
  var getClassName4 = get_class_name_factory_default("DragIcon", styles_module_default5);
1367
1365
  var DragIcon = ({ isDragDisabled }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassName4({ disabled: isDragDisabled }), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { viewBox: "0 0 20 20", width: "12", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z" }) }) });
1368
1366
 
1367
+ // components/AutoField/context.tsx
1368
+ init_react_import();
1369
+ var import_react8 = require("react");
1370
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1371
+ var NestedFieldContext = (0, import_react8.createContext)({});
1372
+ var useNestedFieldContext = () => {
1373
+ const context = (0, import_react8.useContext)(NestedFieldContext);
1374
+ return __spreadProps(__spreadValues({}, context), {
1375
+ readOnlyFields: context.readOnlyFields || {}
1376
+ });
1377
+ };
1378
+ var NestedFieldProvider = ({
1379
+ children,
1380
+ name,
1381
+ subName,
1382
+ wildcardName = name,
1383
+ readOnlyFields
1384
+ }) => {
1385
+ const subPath = `${name}.${subName}`;
1386
+ const wildcardSubPath = `${wildcardName}.${subName}`;
1387
+ const subReadOnlyFields = (0, import_react8.useMemo)(
1388
+ () => Object.keys(readOnlyFields).reduce((acc, readOnlyKey) => {
1389
+ const isLocal = readOnlyKey.indexOf(subPath) > -1 || readOnlyKey.indexOf(wildcardSubPath) > -1;
1390
+ if (isLocal) {
1391
+ const subPathPattern = new RegExp(
1392
+ `^(${name}|${wildcardName}).`.replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\./g, "\\.").replace(/\*/g, "\\*")
1393
+ );
1394
+ const localName = readOnlyKey.replace(subPathPattern, "");
1395
+ return __spreadProps(__spreadValues({}, acc), {
1396
+ [localName]: readOnlyFields[readOnlyKey]
1397
+ });
1398
+ }
1399
+ return acc;
1400
+ }, {}),
1401
+ [name, subName, wildcardName, readOnlyFields]
1402
+ );
1403
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1404
+ NestedFieldContext.Provider,
1405
+ {
1406
+ value: { readOnlyFields: subReadOnlyFields, localName: subName },
1407
+ children
1408
+ }
1409
+ );
1410
+ };
1411
+
1369
1412
  // components/DragDropContext/index.tsx
1370
1413
  init_react_import();
1371
1414
  var import_dnd3 = require("@measured/dnd");
1372
- var import_jsx_runtime8 = require("react/jsx-runtime");
1373
- var DefaultDragDropContext = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
1415
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1416
+ var DefaultDragDropContext = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
1374
1417
  var DragDropContext = (props) => {
1375
1418
  const { status } = useAppContext();
1376
1419
  const El = status !== "LOADING" ? import_dnd3.DragDropContext : DefaultDragDropContext;
1377
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(El, __spreadValues({}, props));
1420
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(El, __spreadValues({}, props));
1378
1421
  };
1379
1422
 
1380
1423
  // components/AutoField/fields/ArrayField/index.tsx
1381
- var import_jsx_runtime9 = require("react/jsx-runtime");
1424
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1382
1425
  var getClassName5 = get_class_name_factory_default("ArrayField", styles_module_default3);
1383
1426
  var getClassNameItem = get_class_name_factory_default("ArrayFieldItem", styles_module_default3);
1384
1427
  var ArrayField = ({
@@ -1389,10 +1432,10 @@ var ArrayField = ({
1389
1432
  label,
1390
1433
  readOnly,
1391
1434
  id,
1392
- Label = (props) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", __spreadValues({}, props))
1435
+ Label = (props) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", __spreadValues({}, props))
1393
1436
  }) => {
1394
1437
  const { state, setUi, selectedItem, getPermissions } = useAppContext();
1395
- const readOnlyFields = (selectedItem == null ? void 0 : selectedItem.readOnly) || {};
1438
+ const { readOnlyFields, localName = name } = useNestedFieldContext();
1396
1439
  const value = _value;
1397
1440
  const arrayState = state.ui.arrayState[id] || {
1398
1441
  items: Array.from(value || []).map((item, idx) => {
@@ -1403,11 +1446,11 @@ var ArrayField = ({
1403
1446
  }),
1404
1447
  openId: ""
1405
1448
  };
1406
- const [localState, setLocalState] = (0, import_react8.useState)({ arrayState, value });
1407
- (0, import_react8.useEffect)(() => {
1449
+ const [localState, setLocalState] = (0, import_react9.useState)({ arrayState, value });
1450
+ (0, import_react9.useEffect)(() => {
1408
1451
  setLocalState({ arrayState, value });
1409
1452
  }, [value, state.ui.arrayState[id]]);
1410
- const mapArrayStateToUi = (0, import_react8.useCallback)(
1453
+ const mapArrayStateToUi = (0, import_react9.useCallback)(
1411
1454
  (partialArrayState) => {
1412
1455
  return {
1413
1456
  arrayState: __spreadProps(__spreadValues({}, state.ui.arrayState), {
@@ -1417,13 +1460,13 @@ var ArrayField = ({
1417
1460
  },
1418
1461
  [arrayState]
1419
1462
  );
1420
- const getHighestIndex = (0, import_react8.useCallback)(() => {
1463
+ const getHighestIndex = (0, import_react9.useCallback)(() => {
1421
1464
  return arrayState.items.reduce(
1422
1465
  (acc, item) => item._originalIndex > acc ? item._originalIndex : acc,
1423
1466
  -1
1424
1467
  );
1425
1468
  }, [arrayState]);
1426
- const regenerateArrayState = (0, import_react8.useCallback)(
1469
+ const regenerateArrayState = (0, import_react9.useCallback)(
1427
1470
  (value2) => {
1428
1471
  let highestIndex = getHighestIndex();
1429
1472
  const newItems = Array.from(value2 || []).map((item, idx) => {
@@ -1442,25 +1485,25 @@ var ArrayField = ({
1442
1485
  },
1443
1486
  [arrayState]
1444
1487
  );
1445
- (0, import_react8.useEffect)(() => {
1488
+ (0, import_react9.useEffect)(() => {
1446
1489
  if (arrayState.items.length > 0) {
1447
1490
  setUi(mapArrayStateToUi(arrayState));
1448
1491
  }
1449
1492
  }, []);
1450
- const [hovering, setHovering] = (0, import_react8.useState)(false);
1493
+ const [hovering, setHovering] = (0, import_react9.useState)(false);
1451
1494
  const forceReadOnly = getPermissions({ item: selectedItem }).edit === false;
1452
1495
  if (field.type !== "array" || !field.arrayFields) {
1453
1496
  return null;
1454
1497
  }
1455
1498
  const addDisabled = field.max !== void 0 && localState.arrayState.items.length >= field.max || readOnly;
1456
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1499
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1457
1500
  Label,
1458
1501
  {
1459
1502
  label: label || name,
1460
- icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(List, { size: 16 }),
1503
+ icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(List, { size: 16 }),
1461
1504
  el: "div",
1462
1505
  readOnly,
1463
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1506
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1464
1507
  DragDropContext,
1465
1508
  {
1466
1509
  onDragEnd: (event) => {
@@ -1489,8 +1532,8 @@ var ArrayField = ({
1489
1532
  });
1490
1533
  }
1491
1534
  },
1492
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Droppable, { droppableId: "array", isDropDisabled: readOnly, children: (provided, snapshot) => {
1493
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1535
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Droppable, { droppableId: "array", isDropDisabled: readOnly, children: (provided, snapshot) => {
1536
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1494
1537
  "div",
1495
1538
  __spreadProps(__spreadValues({}, provided.droppableProps), {
1496
1539
  ref: provided.innerRef,
@@ -1514,7 +1557,7 @@ var ArrayField = ({
1514
1557
  localState.arrayState.items.map((item, i) => {
1515
1558
  const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
1516
1559
  const data = Array.from(localState.value || [])[i] || {};
1517
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1560
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1518
1561
  Draggable,
1519
1562
  {
1520
1563
  id: _arrayId,
@@ -1525,8 +1568,8 @@ var ArrayField = ({
1525
1568
  readOnly
1526
1569
  }),
1527
1570
  isDragDisabled: readOnly || !hovering,
1528
- children: () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1529
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1571
+ children: () => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1572
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1530
1573
  "div",
1531
1574
  {
1532
1575
  onClick: () => {
@@ -1547,9 +1590,9 @@ var ArrayField = ({
1547
1590
  className: getClassNameItem("summary"),
1548
1591
  children: [
1549
1592
  field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
1550
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: getClassNameItem("rhs"), children: [
1551
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: getClassNameItem("actions"), children: [
1552
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1593
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: getClassNameItem("rhs"), children: [
1594
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: getClassNameItem("actions"), children: [
1595
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1553
1596
  IconButton,
1554
1597
  {
1555
1598
  type: "button",
@@ -1572,10 +1615,10 @@ var ArrayField = ({
1572
1615
  );
1573
1616
  },
1574
1617
  title: "Duplicate",
1575
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Copy, { size: 16 })
1618
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Copy, { size: 16 })
1576
1619
  }
1577
1620
  ) }),
1578
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1621
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1579
1622
  IconButton,
1580
1623
  {
1581
1624
  type: "button",
@@ -1598,40 +1641,57 @@ var ArrayField = ({
1598
1641
  );
1599
1642
  },
1600
1643
  title: "Delete",
1601
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Trash, { size: 16 })
1644
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Trash, { size: 16 })
1602
1645
  }
1603
1646
  ) })
1604
1647
  ] }),
1605
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DragIcon, {}) })
1648
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DragIcon, {}) })
1606
1649
  ] })
1607
1650
  ]
1608
1651
  }
1609
1652
  ),
1610
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map(
1611
- (fieldName) => {
1612
- const subField = field.arrayFields[fieldName];
1613
- const subFieldName = `${name}[${i}].${fieldName}`;
1614
- const wildcardFieldName = `${name}[*].${fieldName}`;
1615
- const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subFieldName] !== "undefined" ? readOnlyFields[subFieldName] : readOnlyFields[wildcardFieldName];
1616
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1617
- AutoFieldPrivate,
1653
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map(
1654
+ (subName) => {
1655
+ const subField = field.arrayFields[subName];
1656
+ const indexName = `${name}[${i}]`;
1657
+ const subPath = `${indexName}.${subName}`;
1658
+ const localIndexName = `${localName}[${i}]`;
1659
+ const localWildcardName = `${localName}[*]`;
1660
+ const localSubPath = `${localIndexName}.${subName}`;
1661
+ const localWildcardSubPath = `${localWildcardName}.${subName}`;
1662
+ const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
1663
+ const label2 = subField.label || subName;
1664
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1665
+ NestedFieldProvider,
1618
1666
  {
1619
- name: subFieldName,
1620
- label: subField.label || fieldName,
1621
- id: `${_arrayId}_${fieldName}`,
1622
- readOnly: subReadOnly,
1623
- field: subField,
1624
- value: data[fieldName],
1625
- onChange: (val, ui) => {
1626
- onChange(
1627
- replace(value, i, __spreadProps(__spreadValues({}, data), {
1628
- [fieldName]: val
1629
- })),
1630
- ui
1631
- );
1632
- }
1667
+ name: localIndexName,
1668
+ wildcardName: localWildcardName,
1669
+ subName,
1670
+ readOnlyFields,
1671
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1672
+ AutoFieldPrivate,
1673
+ {
1674
+ name: subPath,
1675
+ label: label2,
1676
+ id: `${_arrayId}_${subName}`,
1677
+ readOnly: subReadOnly,
1678
+ field: __spreadProps(__spreadValues({}, subField), {
1679
+ label: label2
1680
+ // May be used by custom fields
1681
+ }),
1682
+ value: data[subName],
1683
+ onChange: (val, ui) => {
1684
+ onChange(
1685
+ replace(value, i, __spreadProps(__spreadValues({}, data), {
1686
+ [subName]: val
1687
+ })),
1688
+ ui
1689
+ );
1690
+ }
1691
+ }
1692
+ )
1633
1693
  },
1634
- subFieldName
1694
+ subPath
1635
1695
  );
1636
1696
  }
1637
1697
  ) }) })
@@ -1641,7 +1701,7 @@ var ArrayField = ({
1641
1701
  );
1642
1702
  }),
1643
1703
  provided.placeholder,
1644
- !addDisabled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1704
+ !addDisabled && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1645
1705
  "button",
1646
1706
  {
1647
1707
  type: "button",
@@ -1655,7 +1715,7 @@ var ArrayField = ({
1655
1715
  const newArrayState = regenerateArrayState(newValue);
1656
1716
  onChange(newValue, mapArrayStateToUi(newArrayState));
1657
1717
  },
1658
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Plus, { size: 21 })
1718
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Plus, { size: 21 })
1659
1719
  }
1660
1720
  )
1661
1721
  ]
@@ -1670,7 +1730,7 @@ var ArrayField = ({
1670
1730
 
1671
1731
  // components/AutoField/fields/DefaultField/index.tsx
1672
1732
  init_react_import();
1673
- var import_jsx_runtime10 = require("react/jsx-runtime");
1733
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1674
1734
  var getClassName6 = get_class_name_factory_default("Input", styles_module_default2);
1675
1735
  var DefaultField = ({
1676
1736
  field,
@@ -1682,16 +1742,16 @@ var DefaultField = ({
1682
1742
  Label,
1683
1743
  id
1684
1744
  }) => {
1685
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1745
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1686
1746
  Label,
1687
1747
  {
1688
1748
  label: label || name,
1689
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1690
- field.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Type, { size: 16 }),
1691
- field.type === "number" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Hash, { size: 16 })
1749
+ icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1750
+ field.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Type, { size: 16 }),
1751
+ field.type === "number" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Hash, { size: 16 })
1692
1752
  ] }),
1693
1753
  readOnly,
1694
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1754
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1695
1755
  "input",
1696
1756
  {
1697
1757
  className: getClassName6("input"),
@@ -1702,7 +1762,14 @@ var DefaultField = ({
1702
1762
  value: typeof value === "undefined" ? "" : value.toString(),
1703
1763
  onChange: (e) => {
1704
1764
  if (field.type === "number") {
1705
- onChange(Number(e.currentTarget.value));
1765
+ const numberValue = Number(e.currentTarget.value);
1766
+ if (typeof field.min !== "undefined" && numberValue < field.min) {
1767
+ return;
1768
+ }
1769
+ if (typeof field.max !== "undefined" && numberValue > field.max) {
1770
+ return;
1771
+ }
1772
+ onChange(numberValue);
1706
1773
  } else {
1707
1774
  onChange(e.currentTarget.value);
1708
1775
  }
@@ -1720,11 +1787,11 @@ var DefaultField = ({
1720
1787
 
1721
1788
  // components/AutoField/fields/ExternalField/index.tsx
1722
1789
  init_react_import();
1723
- var import_react12 = require("react");
1790
+ var import_react13 = require("react");
1724
1791
 
1725
1792
  // components/ExternalInput/index.tsx
1726
1793
  init_react_import();
1727
- var import_react11 = require("react");
1794
+ var import_react12 = require("react");
1728
1795
 
1729
1796
  // css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
1730
1797
  init_react_import();
@@ -1732,7 +1799,7 @@ var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_
1732
1799
 
1733
1800
  // components/Modal/index.tsx
1734
1801
  init_react_import();
1735
- var import_react9 = require("react");
1802
+ var import_react10 = require("react");
1736
1803
 
1737
1804
  // css-module:/home/runner/work/puck/puck/packages/core/components/Modal/styles.module.css#css-module
1738
1805
  init_react_import();
@@ -1740,22 +1807,22 @@ var styles_module_default7 = { "Modal": "_Modal_ikbaj_1", "Modal--isOpen": "_Mod
1740
1807
 
1741
1808
  // components/Modal/index.tsx
1742
1809
  var import_react_dom = require("react-dom");
1743
- var import_jsx_runtime11 = require("react/jsx-runtime");
1810
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1744
1811
  var getClassName7 = get_class_name_factory_default("Modal", styles_module_default7);
1745
1812
  var Modal = ({
1746
1813
  children,
1747
1814
  onClose,
1748
1815
  isOpen
1749
1816
  }) => {
1750
- const [rootEl, setRootEl] = (0, import_react9.useState)(null);
1751
- (0, import_react9.useEffect)(() => {
1817
+ const [rootEl, setRootEl] = (0, import_react10.useState)(null);
1818
+ (0, import_react10.useEffect)(() => {
1752
1819
  setRootEl(document.getElementById("puck-portal-root"));
1753
1820
  }, []);
1754
1821
  if (!rootEl) {
1755
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", {});
1822
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", {});
1756
1823
  }
1757
1824
  return (0, import_react_dom.createPortal)(
1758
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: getClassName7({ isOpen }), onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1825
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassName7({ isOpen }), onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1759
1826
  "div",
1760
1827
  {
1761
1828
  className: getClassName7("inner"),
@@ -1775,11 +1842,11 @@ init_react_import();
1775
1842
  var styles_module_default8 = { "Heading": "_Heading_qxrry_1", "Heading--xxxxl": "_Heading--xxxxl_qxrry_12", "Heading--xxxl": "_Heading--xxxl_qxrry_18", "Heading--xxl": "_Heading--xxl_qxrry_22", "Heading--xl": "_Heading--xl_qxrry_26", "Heading--l": "_Heading--l_qxrry_30", "Heading--m": "_Heading--m_qxrry_34", "Heading--s": "_Heading--s_qxrry_38", "Heading--xs": "_Heading--xs_qxrry_42" };
1776
1843
 
1777
1844
  // components/Heading/index.tsx
1778
- var import_jsx_runtime12 = require("react/jsx-runtime");
1845
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1779
1846
  var getClassName8 = get_class_name_factory_default("Heading", styles_module_default8);
1780
1847
  var Heading = ({ children, rank, size = "m" }) => {
1781
1848
  const Tag = rank ? `h${rank}` : "span";
1782
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1849
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1783
1850
  Tag,
1784
1851
  {
1785
1852
  className: getClassName8({
@@ -1795,63 +1862,35 @@ init_react_import();
1795
1862
 
1796
1863
  // components/Button/Button.tsx
1797
1864
  init_react_import();
1798
- var import_react10 = require("react");
1865
+ var import_react11 = require("react");
1799
1866
 
1800
1867
  // css-module:/home/runner/work/puck/puck/packages/core/components/Button/Button.module.css#css-module
1801
1868
  init_react_import();
1802
1869
  var Button_module_default = { "Button": "_Button_1t64k_1", "Button--medium": "_Button--medium_1t64k_29", "Button--large": "_Button--large_1t64k_37", "Button-icon": "_Button-icon_1t64k_44", "Button--primary": "_Button--primary_1t64k_48", "Button--secondary": "_Button--secondary_1t64k_67", "Button--flush": "_Button--flush_1t64k_84", "Button--disabled": "_Button--disabled_1t64k_88", "Button--fullWidth": "_Button--fullWidth_1t64k_95", "Button-spinner": "_Button-spinner_1t64k_100" };
1803
1870
 
1804
- // lib/filter-data-attrs.ts
1805
- init_react_import();
1806
- var dataAttrRe = /^(data-.*)$/;
1807
- var filterDataAttrs = (props) => {
1808
- let filteredProps = {};
1809
- for (const prop in props) {
1810
- if (Object.prototype.hasOwnProperty.call(props, prop) && dataAttrRe.test(prop)) {
1811
- filteredProps[prop] = props[prop];
1812
- }
1813
- }
1814
- return filteredProps;
1815
- };
1816
-
1817
1871
  // components/Button/Button.tsx
1818
- var import_jsx_runtime13 = require("react/jsx-runtime");
1872
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1819
1873
  var getClassName9 = get_class_name_factory_default("Button", Button_module_default);
1820
- var Button = (_a) => {
1821
- var _b = _a, {
1822
- children,
1823
- href,
1824
- onClick,
1825
- variant = "primary",
1826
- type,
1827
- disabled,
1828
- tabIndex,
1829
- newTab,
1830
- fullWidth,
1831
- icon,
1832
- size = "medium",
1833
- loading: loadingProp = false
1834
- } = _b, props = __objRest(_b, [
1835
- "children",
1836
- "href",
1837
- "onClick",
1838
- "variant",
1839
- "type",
1840
- "disabled",
1841
- "tabIndex",
1842
- "newTab",
1843
- "fullWidth",
1844
- "icon",
1845
- "size",
1846
- "loading"
1847
- ]);
1848
- const [loading, setLoading] = (0, import_react10.useState)(loadingProp);
1849
- (0, import_react10.useEffect)(() => setLoading(loadingProp), [loadingProp]);
1874
+ var Button = ({
1875
+ children,
1876
+ href,
1877
+ onClick,
1878
+ variant = "primary",
1879
+ type,
1880
+ disabled,
1881
+ tabIndex,
1882
+ newTab,
1883
+ fullWidth,
1884
+ icon,
1885
+ size = "medium",
1886
+ loading: loadingProp = false
1887
+ }) => {
1888
+ const [loading, setLoading] = (0, import_react11.useState)(loadingProp);
1889
+ (0, import_react11.useEffect)(() => setLoading(loadingProp), [loadingProp]);
1850
1890
  const ElementType = href ? "a" : type ? "button" : "span";
1851
- const dataAttrs = filterDataAttrs(props);
1852
- const el = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1891
+ const el = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1853
1892
  ElementType,
1854
- __spreadProps(__spreadValues({
1893
+ {
1855
1894
  className: getClassName9({
1856
1895
  primary: variant === "primary",
1857
1896
  secondary: variant === "secondary",
@@ -1871,20 +1910,19 @@ var Button = (_a) => {
1871
1910
  tabIndex,
1872
1911
  target: newTab ? "_blank" : void 0,
1873
1912
  rel: newTab ? "noreferrer" : void 0,
1874
- href
1875
- }, dataAttrs), {
1913
+ href,
1876
1914
  children: [
1877
- icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassName9("icon"), children: icon }),
1915
+ icon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassName9("icon"), children: icon }),
1878
1916
  children,
1879
- loading && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassName9("spinner"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Loader, { size: 14 }) })
1917
+ loading && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassName9("spinner"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loader, { size: 14 }) })
1880
1918
  ]
1881
- })
1919
+ }
1882
1920
  );
1883
1921
  return el;
1884
1922
  };
1885
1923
 
1886
1924
  // components/ExternalInput/index.tsx
1887
- var import_jsx_runtime14 = require("react/jsx-runtime");
1925
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1888
1926
  var getClassName10 = get_class_name_factory_default("ExternalInput", styles_module_default6);
1889
1927
  var getClassNameModal = get_class_name_factory_default("ExternalInputModal", styles_module_default6);
1890
1928
  var dataCache = {};
@@ -1901,28 +1939,28 @@ var ExternalInput = ({
1901
1939
  mapRow = (val) => val,
1902
1940
  filterFields
1903
1941
  } = field || {};
1904
- const [data, setData] = (0, import_react11.useState)([]);
1905
- const [isOpen, setOpen] = (0, import_react11.useState)(false);
1906
- const [isLoading, setIsLoading] = (0, import_react11.useState)(true);
1942
+ const [data, setData] = (0, import_react12.useState)([]);
1943
+ const [isOpen, setOpen] = (0, import_react12.useState)(false);
1944
+ const [isLoading, setIsLoading] = (0, import_react12.useState)(true);
1907
1945
  const hasFilterFields = !!filterFields;
1908
- const [filters, setFilters] = (0, import_react11.useState)(field.initialFilters || {});
1909
- const [filtersToggled, setFiltersToggled] = (0, import_react11.useState)(hasFilterFields);
1910
- const mappedData = (0, import_react11.useMemo)(() => {
1946
+ const [filters, setFilters] = (0, import_react12.useState)(field.initialFilters || {});
1947
+ const [filtersToggled, setFiltersToggled] = (0, import_react12.useState)(hasFilterFields);
1948
+ const mappedData = (0, import_react12.useMemo)(() => {
1911
1949
  return data.map(mapRow);
1912
1950
  }, [data]);
1913
- const keys = (0, import_react11.useMemo)(() => {
1951
+ const keys = (0, import_react12.useMemo)(() => {
1914
1952
  const validKeys = /* @__PURE__ */ new Set();
1915
1953
  for (const item of mappedData) {
1916
1954
  for (const key of Object.keys(item)) {
1917
- if (typeof item[key] === "string" || typeof item[key] === "number" || (0, import_react11.isValidElement)(item[key])) {
1955
+ if (typeof item[key] === "string" || typeof item[key] === "number" || (0, import_react12.isValidElement)(item[key])) {
1918
1956
  validKeys.add(key);
1919
1957
  }
1920
1958
  }
1921
1959
  }
1922
1960
  return Array.from(validKeys);
1923
1961
  }, [mappedData]);
1924
- const [searchQuery, setSearchQuery] = (0, import_react11.useState)(field.initialQuery || "");
1925
- const search = (0, import_react11.useCallback)(
1962
+ const [searchQuery, setSearchQuery] = (0, import_react12.useState)(field.initialQuery || "");
1963
+ const search = (0, import_react12.useCallback)(
1926
1964
  (query, filters2) => __async(void 0, null, function* () {
1927
1965
  setIsLoading(true);
1928
1966
  const cacheKey = `${id}-${query}-${JSON.stringify(filters2)}`;
@@ -1935,18 +1973,18 @@ var ExternalInput = ({
1935
1973
  }),
1936
1974
  [id, field]
1937
1975
  );
1938
- const Footer = (0, import_react11.useCallback)(
1939
- (props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: getClassNameModal("footer"), children: [
1976
+ const Footer = (0, import_react12.useCallback)(
1977
+ (props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: getClassNameModal("footer"), children: [
1940
1978
  props.items.length,
1941
1979
  " result",
1942
1980
  props.items.length === 1 ? "" : "s"
1943
1981
  ] }),
1944
1982
  [field.renderFooter]
1945
1983
  );
1946
- (0, import_react11.useEffect)(() => {
1984
+ (0, import_react12.useEffect)(() => {
1947
1985
  search(searchQuery, filters);
1948
1986
  }, []);
1949
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1987
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1950
1988
  "div",
1951
1989
  {
1952
1990
  className: getClassName10({
@@ -1956,21 +1994,21 @@ var ExternalInput = ({
1956
1994
  }),
1957
1995
  id,
1958
1996
  children: [
1959
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassName10("actions"), children: [
1960
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1997
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassName10("actions"), children: [
1998
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1961
1999
  "button",
1962
2000
  {
1963
2001
  type: "button",
1964
2002
  onClick: () => setOpen(true),
1965
2003
  className: getClassName10("button"),
1966
2004
  disabled: readOnly,
1967
- children: value ? field.getItemSummary ? field.getItemSummary(value) : "External item" : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
1968
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Link, { size: "16" }),
1969
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: field.placeholder })
2005
+ children: value ? field.getItemSummary ? field.getItemSummary(value) : "External item" : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2006
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Link, { size: "16" }),
2007
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: field.placeholder })
1970
2008
  ] })
1971
2009
  }
1972
2010
  ),
1973
- value && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2011
+ value && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1974
2012
  "button",
1975
2013
  {
1976
2014
  type: "button",
@@ -1979,11 +2017,11 @@ var ExternalInput = ({
1979
2017
  onChange(null);
1980
2018
  },
1981
2019
  disabled: readOnly,
1982
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LockOpen, { size: 16 })
2020
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LockOpen, { size: 16 })
1983
2021
  }
1984
2022
  )
1985
2023
  ] }),
1986
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Modal, { onClose: () => setOpen(false), isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2024
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Modal, { onClose: () => setOpen(false), isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1987
2025
  "form",
1988
2026
  {
1989
2027
  className: getClassNameModal({
@@ -1997,11 +2035,11 @@ var ExternalInput = ({
1997
2035
  search(searchQuery, filters);
1998
2036
  },
1999
2037
  children: [
2000
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("searchForm"), children: [
2001
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: getClassNameModal("search"), children: [
2002
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
2003
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Search, { size: "18" }) }),
2004
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2038
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("searchForm"), children: [
2039
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: getClassNameModal("search"), children: [
2040
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
2041
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Search, { size: "18" }) }),
2042
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2005
2043
  "input",
2006
2044
  {
2007
2045
  className: getClassNameModal("searchInput"),
@@ -2016,9 +2054,9 @@ var ExternalInput = ({
2016
2054
  }
2017
2055
  )
2018
2056
  ] }),
2019
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("searchActions"), children: [
2020
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: "Search" }),
2021
- hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2057
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("searchActions"), children: [
2058
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: "Search" }),
2059
+ hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2022
2060
  IconButton,
2023
2061
  {
2024
2062
  title: "Toggle filters",
@@ -2027,15 +2065,15 @@ var ExternalInput = ({
2027
2065
  e.stopPropagation();
2028
2066
  setFiltersToggled(!filtersToggled);
2029
2067
  },
2030
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SlidersHorizontal, { size: 20 })
2068
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SlidersHorizontal, { size: 20 })
2031
2069
  }
2032
2070
  ) })
2033
2071
  ] })
2034
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading, { rank: "2", size: "xs", children: field.placeholder || "Select data" }) }),
2035
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("grid"), children: [
2036
- hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
2072
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Heading, { rank: "2", size: "xs", children: field.placeholder || "Select data" }) }),
2073
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("grid"), children: [
2074
+ hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
2037
2075
  const filterField = filterFields[fieldName];
2038
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2076
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2039
2077
  AutoFieldPrivate,
2040
2078
  {
2041
2079
  field: filterField,
@@ -2052,9 +2090,9 @@ var ExternalInput = ({
2052
2090
  fieldName
2053
2091
  );
2054
2092
  }) }),
2055
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
2056
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: getClassNameModal("table"), children: [
2057
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { className: getClassNameModal("thead"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { className: getClassNameModal("tr"), children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2093
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
2094
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("table", { className: getClassNameModal("table"), children: [
2095
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: getClassNameModal("thead"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { className: getClassNameModal("tr"), children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2058
2096
  "th",
2059
2097
  {
2060
2098
  className: getClassNameModal("th"),
@@ -2063,8 +2101,8 @@ var ExternalInput = ({
2063
2101
  },
2064
2102
  key
2065
2103
  )) }) }),
2066
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { className: getClassNameModal("tbody"), children: mappedData.map((item, i) => {
2067
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2104
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tbody", { className: getClassNameModal("tbody"), children: mappedData.map((item, i) => {
2105
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2068
2106
  "tr",
2069
2107
  {
2070
2108
  style: { whiteSpace: "nowrap" },
@@ -2073,16 +2111,16 @@ var ExternalInput = ({
2073
2111
  onChange(mapProp(data[i]));
2074
2112
  setOpen(false);
2075
2113
  },
2076
- children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
2114
+ children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
2077
2115
  },
2078
2116
  i
2079
2117
  );
2080
2118
  }) })
2081
2119
  ] }),
2082
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loader, { size: 24 }) })
2120
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Loader, { size: 24 }) })
2083
2121
  ] })
2084
2122
  ] }),
2085
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("footerContainer"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Footer, { items: mappedData }) })
2123
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("footerContainer"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Footer, { items: mappedData }) })
2086
2124
  ]
2087
2125
  }
2088
2126
  ) })
@@ -2092,7 +2130,7 @@ var ExternalInput = ({
2092
2130
  };
2093
2131
 
2094
2132
  // components/AutoField/fields/ExternalField/index.tsx
2095
- var import_jsx_runtime15 = require("react/jsx-runtime");
2133
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2096
2134
  var ExternalField = ({
2097
2135
  field,
2098
2136
  onChange,
@@ -2106,7 +2144,7 @@ var ExternalField = ({
2106
2144
  var _a, _b, _c;
2107
2145
  const validField = field;
2108
2146
  const deprecatedField = field;
2109
- (0, import_react12.useEffect)(() => {
2147
+ (0, import_react13.useEffect)(() => {
2110
2148
  if (deprecatedField.adaptor) {
2111
2149
  console.error(
2112
2150
  "Warning: The `adaptor` API is deprecated. Please use updated APIs on the `external` field instead. This will be a breaking change in a future release."
@@ -2116,7 +2154,7 @@ var ExternalField = ({
2116
2154
  if (field.type !== "external") {
2117
2155
  return null;
2118
2156
  }
2119
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Label, { label: label || name, icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Link, { size: 16 }), el: "div", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2157
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Label, { label: label || name, icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Link, { size: 16 }), el: "div", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2120
2158
  ExternalInput,
2121
2159
  {
2122
2160
  name,
@@ -2141,7 +2179,7 @@ var ExternalField = ({
2141
2179
 
2142
2180
  // components/AutoField/fields/RadioField/index.tsx
2143
2181
  init_react_import();
2144
- var import_react13 = require("react");
2182
+ var import_react14 = require("react");
2145
2183
 
2146
2184
  // lib/safe-json-parse.ts
2147
2185
  init_react_import();
@@ -2155,7 +2193,7 @@ var safeJsonParse = (str) => {
2155
2193
  };
2156
2194
 
2157
2195
  // components/AutoField/fields/RadioField/index.tsx
2158
- var import_jsx_runtime16 = require("react/jsx-runtime");
2196
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2159
2197
  var getClassName11 = get_class_name_factory_default("Input", styles_module_default2);
2160
2198
  var RadioField = ({
2161
2199
  field,
@@ -2167,26 +2205,26 @@ var RadioField = ({
2167
2205
  label,
2168
2206
  Label
2169
2207
  }) => {
2170
- const flatOptions = (0, import_react13.useMemo)(
2208
+ const flatOptions = (0, import_react14.useMemo)(
2171
2209
  () => field.type === "radio" ? field.options.map(({ value: value2 }) => value2) : [],
2172
2210
  [field]
2173
2211
  );
2174
2212
  if (field.type !== "radio" || !field.options) {
2175
2213
  return null;
2176
2214
  }
2177
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2215
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2178
2216
  Label,
2179
2217
  {
2180
- icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CircleCheckBig, { size: 16 }),
2218
+ icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CircleCheckBig, { size: 16 }),
2181
2219
  label: label || name,
2182
2220
  readOnly,
2183
2221
  el: "div",
2184
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: getClassName11("radioGroupItems"), id, children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2222
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: getClassName11("radioGroupItems"), id, children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2185
2223
  "label",
2186
2224
  {
2187
2225
  className: getClassName11("radio"),
2188
2226
  children: [
2189
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2227
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2190
2228
  "input",
2191
2229
  {
2192
2230
  type: "radio",
@@ -2206,7 +2244,7 @@ var RadioField = ({
2206
2244
  checked: value === option.value
2207
2245
  }
2208
2246
  ),
2209
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: getClassName11("radioInner"), children: option.label || option.value })
2247
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: getClassName11("radioInner"), children: option.label || option.value })
2210
2248
  ]
2211
2249
  },
2212
2250
  option.label + option.value
@@ -2217,8 +2255,8 @@ var RadioField = ({
2217
2255
 
2218
2256
  // components/AutoField/fields/SelectField/index.tsx
2219
2257
  init_react_import();
2220
- var import_react14 = require("react");
2221
- var import_jsx_runtime17 = require("react/jsx-runtime");
2258
+ var import_react15 = require("react");
2259
+ var import_jsx_runtime18 = require("react/jsx-runtime");
2222
2260
  var getClassName12 = get_class_name_factory_default("Input", styles_module_default2);
2223
2261
  var SelectField = ({
2224
2262
  field,
@@ -2230,20 +2268,20 @@ var SelectField = ({
2230
2268
  readOnly,
2231
2269
  id
2232
2270
  }) => {
2233
- const flatOptions = (0, import_react14.useMemo)(
2271
+ const flatOptions = (0, import_react15.useMemo)(
2234
2272
  () => field.type === "select" ? field.options.map(({ value: value2 }) => value2) : [],
2235
2273
  [field]
2236
2274
  );
2237
2275
  if (field.type !== "select" || !field.options) {
2238
2276
  return null;
2239
2277
  }
2240
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2278
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2241
2279
  Label,
2242
2280
  {
2243
2281
  label: label || name,
2244
- icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronDown, { size: 16 }),
2282
+ icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChevronDown, { size: 16 }),
2245
2283
  readOnly,
2246
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2284
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2247
2285
  "select",
2248
2286
  {
2249
2287
  id,
@@ -2260,7 +2298,7 @@ var SelectField = ({
2260
2298
  }
2261
2299
  },
2262
2300
  value,
2263
- children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2301
+ children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2264
2302
  "option",
2265
2303
  {
2266
2304
  label: option.label,
@@ -2276,7 +2314,7 @@ var SelectField = ({
2276
2314
 
2277
2315
  // components/AutoField/fields/TextareaField/index.tsx
2278
2316
  init_react_import();
2279
- var import_jsx_runtime18 = require("react/jsx-runtime");
2317
+ var import_jsx_runtime19 = require("react/jsx-runtime");
2280
2318
  var getClassName13 = get_class_name_factory_default("Input", styles_module_default2);
2281
2319
  var TextareaField = ({
2282
2320
  onChange,
@@ -2287,7 +2325,7 @@ var TextareaField = ({
2287
2325
  Label,
2288
2326
  id
2289
2327
  }) => {
2290
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Label, { label: label || name, icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Type, { size: 16 }), readOnly, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2328
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Label, { label: label || name, icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Type, { size: 16 }), readOnly, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2291
2329
  "textarea",
2292
2330
  {
2293
2331
  id,
@@ -2314,7 +2352,7 @@ init_react_import();
2314
2352
  var styles_module_default9 = { "ObjectField": "_ObjectField_1ua3y_5", "ObjectField-fieldset": "_ObjectField-fieldset_1ua3y_13" };
2315
2353
 
2316
2354
  // components/AutoField/fields/ObjectField/index.tsx
2317
- var import_jsx_runtime19 = require("react/jsx-runtime");
2355
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2318
2356
  var getClassName14 = get_class_name_factory_default("ObjectField", styles_module_default9);
2319
2357
  var ObjectField = ({
2320
2358
  field,
@@ -2326,43 +2364,54 @@ var ObjectField = ({
2326
2364
  readOnly,
2327
2365
  id
2328
2366
  }) => {
2329
- const { selectedItem } = useAppContext();
2367
+ const { readOnlyFields, localName = name } = useNestedFieldContext();
2330
2368
  if (field.type !== "object" || !field.objectFields) {
2331
2369
  return null;
2332
2370
  }
2333
- const readOnlyFields = (selectedItem == null ? void 0 : selectedItem.readOnly) || {};
2334
2371
  const data = value || {};
2335
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2372
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2336
2373
  Label,
2337
2374
  {
2338
2375
  label: label || name,
2339
- icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(EllipsisVertical, { size: 16 }),
2376
+ icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(EllipsisVertical, { size: 16 }),
2340
2377
  el: "div",
2341
2378
  readOnly,
2342
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassName14(), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("fieldset", { className: getClassName14("fieldset"), children: Object.keys(field.objectFields).map((fieldName) => {
2343
- const subField = field.objectFields[fieldName];
2344
- const subFieldName = `${name}.${fieldName}`;
2345
- const wildcardFieldName = `${name}.${fieldName}`;
2346
- const subReadOnly = readOnly ? readOnly : typeof readOnlyFields[subFieldName] !== "undefined" ? readOnlyFields[subFieldName] : readOnlyFields[wildcardFieldName];
2347
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2348
- AutoFieldPrivate,
2379
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName14(), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("fieldset", { className: getClassName14("fieldset"), children: Object.keys(field.objectFields).map((subName) => {
2380
+ const subField = field.objectFields[subName];
2381
+ const subPath = `${name}.${subName}`;
2382
+ const localSubPath = `${localName || name}.${subName}`;
2383
+ const subReadOnly = readOnly ? readOnly : readOnlyFields[localSubPath];
2384
+ const label2 = subField.label || subName;
2385
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2386
+ NestedFieldProvider,
2349
2387
  {
2350
- name: subFieldName,
2351
- label: subField.label || fieldName,
2352
- id: `${id}_${fieldName}`,
2353
- readOnly: subReadOnly,
2354
- field: subField,
2355
- value: data[fieldName],
2356
- onChange: (val, ui) => {
2357
- onChange(
2358
- __spreadProps(__spreadValues({}, data), {
2359
- [fieldName]: val
2388
+ name: localName || id,
2389
+ subName,
2390
+ readOnlyFields,
2391
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2392
+ AutoFieldPrivate,
2393
+ {
2394
+ name: subPath,
2395
+ label: subPath,
2396
+ id: `${id}_${subName}`,
2397
+ readOnly: subReadOnly,
2398
+ field: __spreadProps(__spreadValues({}, subField), {
2399
+ label: label2
2400
+ // May be used by custom fields
2360
2401
  }),
2361
- ui
2362
- );
2363
- }
2402
+ value: data[subName],
2403
+ onChange: (val, ui) => {
2404
+ onChange(
2405
+ __spreadProps(__spreadValues({}, data), {
2406
+ [subName]: val
2407
+ }),
2408
+ ui
2409
+ );
2410
+ }
2411
+ }
2412
+ )
2364
2413
  },
2365
- subFieldName
2414
+ subPath
2366
2415
  );
2367
2416
  }) }) })
2368
2417
  }
@@ -2371,7 +2420,7 @@ var ObjectField = ({
2371
2420
 
2372
2421
  // lib/use-safe-id.ts
2373
2422
  init_react_import();
2374
- var import_react15 = __toESM(require("react"));
2423
+ var import_react16 = __toESM(require("react"));
2375
2424
 
2376
2425
  // lib/generate-id.ts
2377
2426
  init_react_import();
@@ -2380,15 +2429,15 @@ var generateId = (type) => type ? `${type}-${(0, import_uuid.v4)()}` : (0, impor
2380
2429
 
2381
2430
  // lib/use-safe-id.ts
2382
2431
  var useSafeId = () => {
2383
- if (typeof import_react15.default.useId !== "undefined") {
2384
- return import_react15.default.useId();
2432
+ if (typeof import_react16.default.useId !== "undefined") {
2433
+ return import_react16.default.useId();
2385
2434
  }
2386
- const [id] = (0, import_react15.useState)(generateId());
2435
+ const [id] = (0, import_react16.useState)(generateId());
2387
2436
  return id;
2388
2437
  };
2389
2438
 
2390
2439
  // components/AutoField/index.tsx
2391
- var import_jsx_runtime20 = require("react/jsx-runtime");
2440
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2392
2441
  var getClassName15 = get_class_name_factory_default("Input", styles_module_default2);
2393
2442
  var getClassNameWrapper = get_class_name_factory_default("InputWrapper", styles_module_default2);
2394
2443
  var FieldLabel = ({
@@ -2400,16 +2449,16 @@ var FieldLabel = ({
2400
2449
  className
2401
2450
  }) => {
2402
2451
  const El = el;
2403
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(El, { className, children: [
2404
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: getClassName15("label"), children: [
2405
- icon ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName15("labelIcon"), children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, {}),
2452
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(El, { className, children: [
2453
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: getClassName15("label"), children: [
2454
+ icon ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassName15("labelIcon"), children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, {}),
2406
2455
  label,
2407
- readOnly && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName15("disabledIcon"), title: "Read-only", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Lock, { size: "12" }) })
2456
+ readOnly && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassName15("disabledIcon"), title: "Read-only", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Lock, { size: "12" }) })
2408
2457
  ] }),
2409
2458
  children
2410
2459
  ] });
2411
2460
  };
2412
- var FieldLabelInternal2 = ({
2461
+ var FieldLabelInternal = ({
2413
2462
  children,
2414
2463
  icon,
2415
2464
  label,
@@ -2417,14 +2466,14 @@ var FieldLabelInternal2 = ({
2417
2466
  readOnly
2418
2467
  }) => {
2419
2468
  const { overrides } = useAppContext();
2420
- const Wrapper = (0, import_react16.useMemo)(
2469
+ const Wrapper = (0, import_react17.useMemo)(
2421
2470
  () => overrides.fieldLabel || FieldLabel,
2422
2471
  [overrides]
2423
2472
  );
2424
2473
  if (!label) {
2425
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children });
2474
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children });
2426
2475
  }
2427
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2476
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2428
2477
  Wrapper,
2429
2478
  {
2430
2479
  label,
@@ -2438,8 +2487,9 @@ var FieldLabelInternal2 = ({
2438
2487
  };
2439
2488
  function AutoFieldInternal(props) {
2440
2489
  var _a, _b, _c, _d, _e, _f, _g, _h;
2441
- const { dispatch, overrides } = useAppContext();
2442
- const { id, Label = FieldLabelInternal2 } = props;
2490
+ const { dispatch, overrides, selectedItem } = useAppContext();
2491
+ const nestedFieldContext = (0, import_react17.useContext)(NestedFieldContext);
2492
+ const { id, Label = FieldLabelInternal } = props;
2443
2493
  const field = props.field;
2444
2494
  const label = field.label;
2445
2495
  const defaultId = useSafeId();
@@ -2470,7 +2520,7 @@ function AutoFieldInternal(props) {
2470
2520
  Label,
2471
2521
  id: resolvedId
2472
2522
  });
2473
- const onFocus = (0, import_react16.useCallback)(
2523
+ const onFocus = (0, import_react17.useCallback)(
2474
2524
  (e) => {
2475
2525
  if (mergedProps.name && e.target.nodeName === "INPUT") {
2476
2526
  e.stopPropagation();
@@ -2484,7 +2534,7 @@ function AutoFieldInternal(props) {
2484
2534
  },
2485
2535
  [mergedProps.name]
2486
2536
  );
2487
- const onBlur = (0, import_react16.useCallback)((e) => {
2537
+ const onBlur = (0, import_react17.useCallback)((e) => {
2488
2538
  if ("name" in e.target) {
2489
2539
  dispatch({
2490
2540
  type: "setUi",
@@ -2499,27 +2549,36 @@ function AutoFieldInternal(props) {
2499
2549
  return null;
2500
2550
  }
2501
2551
  const CustomField = field.render;
2502
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassNameWrapper(), onFocus, onBlur, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName15(), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CustomField, __spreadValues({}, mergedProps)) }) });
2552
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameWrapper(), onFocus, onBlur, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassName15(), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomField, __spreadValues({}, mergedProps)) }) });
2503
2553
  }
2504
2554
  const children = defaultFields[field.type](mergedProps);
2505
2555
  const Render2 = render[field.type];
2506
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2507
- "div",
2556
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2557
+ NestedFieldContext.Provider,
2508
2558
  {
2509
- className: getClassNameWrapper(),
2510
- onFocus,
2511
- onBlur,
2512
- onClick: (e) => {
2513
- e.stopPropagation();
2559
+ value: {
2560
+ readOnlyFields: nestedFieldContext.readOnlyFields || (selectedItem == null ? void 0 : selectedItem.readOnly) || {},
2561
+ localName: nestedFieldContext.localName
2514
2562
  },
2515
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Render2, __spreadProps(__spreadValues({}, mergedProps), { children }))
2563
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2564
+ "div",
2565
+ {
2566
+ className: getClassNameWrapper(),
2567
+ onFocus,
2568
+ onBlur,
2569
+ onClick: (e) => {
2570
+ e.stopPropagation();
2571
+ },
2572
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Render2, __spreadProps(__spreadValues({}, mergedProps), { children }))
2573
+ }
2574
+ )
2516
2575
  }
2517
2576
  );
2518
2577
  }
2519
2578
  function AutoFieldPrivate(props) {
2520
2579
  const { state } = useAppContext();
2521
2580
  const { value, onChange } = props;
2522
- const [localValue, setLocalValue] = (0, import_react16.useState)(value);
2581
+ const [localValue, setLocalValue] = (0, import_react17.useState)(value);
2523
2582
  const onChangeDb = (0, import_use_debounce.useDebouncedCallback)(
2524
2583
  (val, ui) => {
2525
2584
  onChange(val, ui);
@@ -2527,11 +2586,11 @@ function AutoFieldPrivate(props) {
2527
2586
  50,
2528
2587
  { leading: true }
2529
2588
  );
2530
- const onChangeLocal = (0, import_react16.useCallback)((val, ui) => {
2589
+ const onChangeLocal = (0, import_react17.useCallback)((val, ui) => {
2531
2590
  setLocalValue(val);
2532
2591
  onChangeDb(val, ui);
2533
2592
  }, []);
2534
- (0, import_react16.useEffect)(() => {
2593
+ (0, import_react17.useEffect)(() => {
2535
2594
  if (state.ui.field.focus !== props.name) {
2536
2595
  setLocalValue(value);
2537
2596
  }
@@ -2540,11 +2599,11 @@ function AutoFieldPrivate(props) {
2540
2599
  value: localValue,
2541
2600
  onChange: onChangeLocal
2542
2601
  };
2543
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutoFieldInternal, __spreadValues(__spreadValues({}, props), localProps));
2602
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AutoFieldInternal, __spreadValues(__spreadValues({}, props), localProps));
2544
2603
  }
2545
2604
  function AutoField(props) {
2546
- const DefaultLabel = (0, import_react16.useMemo)(() => {
2547
- const DefaultLabel2 = (labelProps) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2605
+ const DefaultLabel = (0, import_react17.useMemo)(() => {
2606
+ const DefaultLabel2 = (labelProps) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2548
2607
  "div",
2549
2608
  __spreadProps(__spreadValues({}, labelProps), {
2550
2609
  className: getClassName15({ readOnly: props.readOnly })
@@ -2552,7 +2611,7 @@ function AutoField(props) {
2552
2611
  );
2553
2612
  return DefaultLabel2;
2554
2613
  }, [props.readOnly]);
2555
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutoFieldInternal, __spreadProps(__spreadValues({}, props), { Label: DefaultLabel }));
2614
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AutoFieldInternal, __spreadProps(__spreadValues({}, props), { Label: DefaultLabel }));
2556
2615
  }
2557
2616
 
2558
2617
  // components/Drawer/index.tsx
@@ -2563,11 +2622,11 @@ init_react_import();
2563
2622
  var styles_module_default10 = { "Drawer": "_Drawer_1oa7v_1", "DrawerItem--disabled": "_DrawerItem--disabled_1oa7v_5", "DrawerItem-draggable": "_DrawerItem-draggable_1oa7v_5", "DrawerItem-default": "_DrawerItem-default_1oa7v_11", "DrawerItem-draggableWrapper": "_DrawerItem-draggableWrapper_1oa7v_11", "DrawerItem": "_DrawerItem_1oa7v_5", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_1oa7v_36", "DrawerItem-name": "_DrawerItem-name_1oa7v_54" };
2564
2623
 
2565
2624
  // components/Drawer/index.tsx
2566
- var import_react17 = require("react");
2567
- var import_jsx_runtime21 = require("react/jsx-runtime");
2625
+ var import_react18 = require("react");
2626
+ var import_jsx_runtime22 = require("react/jsx-runtime");
2568
2627
  var getClassName16 = get_class_name_factory_default("Drawer", styles_module_default10);
2569
2628
  var getClassNameItem2 = get_class_name_factory_default("DrawerItem", styles_module_default10);
2570
- var drawerContext = (0, import_react17.createContext)({
2629
+ var drawerContext = (0, import_react18.createContext)({
2571
2630
  droppableId: ""
2572
2631
  });
2573
2632
  var DrawerDraggable = ({
@@ -2576,7 +2635,7 @@ var DrawerDraggable = ({
2576
2635
  index,
2577
2636
  isDragDisabled
2578
2637
  }) => {
2579
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2638
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2580
2639
  Draggable,
2581
2640
  {
2582
2641
  id,
@@ -2598,21 +2657,21 @@ var DrawerItem = ({
2598
2657
  index,
2599
2658
  isDragDisabled
2600
2659
  }) => {
2601
- const ctx = (0, import_react17.useContext)(drawerContext);
2660
+ const ctx = (0, import_react18.useContext)(drawerContext);
2602
2661
  const resolvedId = `${ctx.droppableId}::${id || name}`;
2603
- const CustomInner = (0, import_react17.useMemo)(
2604
- () => children || (({ children: children2, name: name2 }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem2("default"), children: children2 })),
2662
+ const CustomInner = (0, import_react18.useMemo)(
2663
+ () => children || (({ children: children2, name: name2 }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: getClassNameItem2("default"), children: children2 })),
2605
2664
  [children]
2606
2665
  );
2607
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2666
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2608
2667
  DrawerDraggable,
2609
2668
  {
2610
2669
  id: resolvedId,
2611
2670
  index,
2612
2671
  isDragDisabled,
2613
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomInner, { name, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem2("draggableWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: getClassNameItem2("draggable"), children: [
2614
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem2("name"), children: label != null ? label : name }),
2615
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem2("icon"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DragIcon, { isDragDisabled }) })
2672
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CustomInner, { name, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: getClassNameItem2("draggableWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: getClassNameItem2("draggable"), children: [
2673
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: getClassNameItem2("name"), children: label != null ? label : name }),
2674
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: getClassNameItem2("icon"), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DragIcon, { isDragDisabled }) })
2616
2675
  ] }) }) })
2617
2676
  }
2618
2677
  );
@@ -2623,7 +2682,7 @@ var Drawer = ({
2623
2682
  direction = "vertical"
2624
2683
  }) => {
2625
2684
  const droppableId = `component-list:${_droppableId}`;
2626
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(drawerContext.Provider, { value: { droppableId }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Droppable, { droppableId, isDropDisabled: true, direction, children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2685
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(drawerContext.Provider, { value: { droppableId }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Droppable, { droppableId, isDropDisabled: true, direction, children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2627
2686
  "div",
2628
2687
  __spreadProps(__spreadValues({}, provided.droppableProps), {
2629
2688
  ref: provided.innerRef,
@@ -2632,7 +2691,7 @@ var Drawer = ({
2632
2691
  }),
2633
2692
  children: [
2634
2693
  children,
2635
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { display: "none" }, children: provided.placeholder })
2694
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { display: "none" }, children: provided.placeholder })
2636
2695
  ]
2637
2696
  })
2638
2697
  ) }) });
@@ -2641,11 +2700,11 @@ Drawer.Item = DrawerItem;
2641
2700
 
2642
2701
  // components/DropZone/index.tsx
2643
2702
  init_react_import();
2644
- var import_react21 = require("react");
2703
+ var import_react22 = require("react");
2645
2704
 
2646
2705
  // components/DraggableComponent/index.tsx
2647
2706
  init_react_import();
2648
- var import_react19 = require("react");
2707
+ var import_react20 = require("react");
2649
2708
  var import_dnd4 = require("@measured/dnd");
2650
2709
 
2651
2710
  // css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css#css-module
@@ -2654,10 +2713,10 @@ var styles_module_default11 = { "DraggableComponent": "_DraggableComponent_1bhad
2654
2713
 
2655
2714
  // lib/use-modifier-held.ts
2656
2715
  init_react_import();
2657
- var import_react18 = require("react");
2716
+ var import_react19 = require("react");
2658
2717
  var useModifierHeld = (modifier) => {
2659
- const [modifierHeld, setModifierHeld] = (0, import_react18.useState)(false);
2660
- (0, import_react18.useEffect)(() => {
2718
+ const [modifierHeld, setModifierHeld] = (0, import_react19.useState)(false);
2719
+ (0, import_react19.useEffect)(() => {
2661
2720
  function downHandler({ key }) {
2662
2721
  if (key === modifier) {
2663
2722
  setModifierHeld(true);
@@ -2691,7 +2750,7 @@ var isIos = () => [
2691
2750
  navigator.userAgent.includes("Mac") && "ontouchend" in document;
2692
2751
 
2693
2752
  // components/DraggableComponent/index.tsx
2694
- var import_jsx_runtime22 = require("react/jsx-runtime");
2753
+ var import_jsx_runtime23 = require("react/jsx-runtime");
2695
2754
  var getClassName17 = get_class_name_factory_default("DraggableComponent", styles_module_default11);
2696
2755
  var space = 8;
2697
2756
  var actionsOverlayTop = space * 6.5;
@@ -2700,7 +2759,7 @@ var actionsRight = space;
2700
2759
  var DefaultActionBar = ({
2701
2760
  label,
2702
2761
  children
2703
- }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ActionBar, { label, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ActionBar.Group, { children }) });
2762
+ }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ActionBar, { label, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ActionBar.Group, { children }) });
2704
2763
  var DraggableComponent = ({
2705
2764
  children,
2706
2765
  id,
@@ -2726,28 +2785,28 @@ var DraggableComponent = ({
2726
2785
  const { zoomConfig, status, overrides, selectedItem, getPermissions } = useAppContext();
2727
2786
  const isModifierHeld = useModifierHeld("Alt");
2728
2787
  const El = status !== "LOADING" ? import_dnd4.Draggable : DefaultDraggable;
2729
- (0, import_react19.useEffect)(onMount, []);
2730
- const [disableSecondaryAnimation, setDisableSecondaryAnimation] = (0, import_react19.useState)(false);
2731
- (0, import_react19.useEffect)(() => {
2788
+ (0, import_react20.useEffect)(onMount, []);
2789
+ const [disableSecondaryAnimation, setDisableSecondaryAnimation] = (0, import_react20.useState)(false);
2790
+ (0, import_react20.useEffect)(() => {
2732
2791
  if (isIos()) {
2733
2792
  setDisableSecondaryAnimation(true);
2734
2793
  }
2735
2794
  }, []);
2736
- const CustomActionBar = (0, import_react19.useMemo)(
2795
+ const CustomActionBar = (0, import_react20.useMemo)(
2737
2796
  () => overrides.actionBar || DefaultActionBar,
2738
2797
  [overrides.actionBar]
2739
2798
  );
2740
2799
  const permissions = getPermissions({
2741
2800
  item: selectedItem
2742
2801
  });
2743
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2802
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2744
2803
  El,
2745
2804
  {
2746
2805
  draggableId: id,
2747
2806
  index,
2748
2807
  isDragDisabled,
2749
2808
  disableSecondaryAnimation,
2750
- children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2809
+ children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2751
2810
  "div",
2752
2811
  __spreadProps(__spreadValues(__spreadValues({
2753
2812
  ref: provided.innerRef
@@ -2770,15 +2829,15 @@ var DraggableComponent = ({
2770
2829
  onClick,
2771
2830
  children: [
2772
2831
  debug,
2773
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: getClassName17("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Loader, {}) }),
2774
- isSelected && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2832
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loader, {}) }),
2833
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2775
2834
  "div",
2776
2835
  {
2777
2836
  className: getClassName17("actionsOverlay"),
2778
2837
  style: {
2779
2838
  top: actionsOverlayTop / zoomConfig.zoom
2780
2839
  },
2781
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2840
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2782
2841
  "div",
2783
2842
  {
2784
2843
  className: getClassName17("actions"),
@@ -2787,16 +2846,16 @@ var DraggableComponent = ({
2787
2846
  top: actionsTop / zoomConfig.zoom,
2788
2847
  right: actionsRight / zoomConfig.zoom
2789
2848
  },
2790
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(CustomActionBar, { label, children: [
2791
- permissions.duplicate && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ActionBar.Action, { onClick: onDuplicate, label: "Duplicate", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Copy, { size: 16 }) }),
2792
- permissions.delete && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ActionBar.Action, { onClick: onDelete, label: "Delete", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Trash, { size: 16 }) })
2849
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(CustomActionBar, { label, children: [
2850
+ permissions.duplicate && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ActionBar.Action, { onClick: onDuplicate, label: "Duplicate", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Copy, { size: 16 }) }),
2851
+ permissions.delete && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ActionBar.Action, { onClick: onDelete, label: "Delete", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Trash, { size: 16 }) })
2793
2852
  ] })
2794
2853
  }
2795
2854
  )
2796
2855
  }
2797
2856
  ),
2798
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: getClassName17("overlay") }),
2799
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: getClassName17("contents"), children })
2857
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17("overlay") }),
2858
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17("contents"), children })
2800
2859
  ]
2801
2860
  })
2802
2861
  )
@@ -2811,7 +2870,7 @@ var styles_module_default12 = { "DropZone": "_DropZone_djoti_1", "DropZone-conte
2811
2870
 
2812
2871
  // components/DropZone/context.tsx
2813
2872
  init_react_import();
2814
- var import_react20 = require("react");
2873
+ var import_react21 = require("react");
2815
2874
  var import_use_debounce2 = require("use-debounce");
2816
2875
 
2817
2876
  // lib/get-zone-id.ts
@@ -2827,30 +2886,30 @@ var getZoneId = (zoneCompound) => {
2827
2886
  };
2828
2887
 
2829
2888
  // components/DropZone/context.tsx
2830
- var import_jsx_runtime23 = require("react/jsx-runtime");
2831
- var dropZoneContext = (0, import_react20.createContext)(null);
2889
+ var import_jsx_runtime24 = require("react/jsx-runtime");
2890
+ var dropZoneContext = (0, import_react21.createContext)(null);
2832
2891
  var DropZoneProvider = ({
2833
2892
  children,
2834
2893
  value
2835
2894
  }) => {
2836
- const [hoveringArea, setHoveringArea] = (0, import_react20.useState)(null);
2837
- const [hoveringZone, setHoveringZone] = (0, import_react20.useState)(
2895
+ const [hoveringArea, setHoveringArea] = (0, import_react21.useState)(null);
2896
+ const [hoveringZone, setHoveringZone] = (0, import_react21.useState)(
2838
2897
  rootDroppableId
2839
2898
  );
2840
- const [hoveringComponent, setHoveringComponent] = (0, import_react20.useState)();
2899
+ const [hoveringComponent, setHoveringComponent] = (0, import_react21.useState)();
2841
2900
  const [hoveringAreaDb] = (0, import_use_debounce2.useDebounce)(hoveringArea, 75, { leading: false });
2842
- const [areasWithZones, setAreasWithZones] = (0, import_react20.useState)(
2901
+ const [areasWithZones, setAreasWithZones] = (0, import_react21.useState)(
2843
2902
  {}
2844
2903
  );
2845
- const [activeZones, setActiveZones] = (0, import_react20.useState)({});
2904
+ const [activeZones, setActiveZones] = (0, import_react21.useState)({});
2846
2905
  const { dispatch = null } = value ? value : {};
2847
- const registerZoneArea = (0, import_react20.useCallback)(
2906
+ const registerZoneArea = (0, import_react21.useCallback)(
2848
2907
  (area) => {
2849
2908
  setAreasWithZones((latest) => __spreadProps(__spreadValues({}, latest), { [area]: true }));
2850
2909
  },
2851
2910
  [setAreasWithZones]
2852
2911
  );
2853
- const registerZone = (0, import_react20.useCallback)(
2912
+ const registerZone = (0, import_react21.useCallback)(
2854
2913
  (zoneCompound) => {
2855
2914
  if (!dispatch) {
2856
2915
  return;
@@ -2863,7 +2922,7 @@ var DropZoneProvider = ({
2863
2922
  },
2864
2923
  [setActiveZones, dispatch]
2865
2924
  );
2866
- const unregisterZone = (0, import_react20.useCallback)(
2925
+ const unregisterZone = (0, import_react21.useCallback)(
2867
2926
  (zoneCompound) => {
2868
2927
  if (!dispatch) {
2869
2928
  return;
@@ -2878,8 +2937,8 @@ var DropZoneProvider = ({
2878
2937
  },
2879
2938
  [setActiveZones, dispatch]
2880
2939
  );
2881
- const [pathData, setPathData] = (0, import_react20.useState)();
2882
- const registerPath = (0, import_react20.useCallback)(
2940
+ const [pathData, setPathData] = (0, import_react21.useState)();
2941
+ const registerPath = (0, import_react21.useCallback)(
2883
2942
  (selector) => {
2884
2943
  if (!(value == null ? void 0 : value.data)) {
2885
2944
  return;
@@ -2904,8 +2963,8 @@ var DropZoneProvider = ({
2904
2963
  },
2905
2964
  [value, setPathData]
2906
2965
  );
2907
- const [zoneWillDrag, setZoneWillDrag] = (0, import_react20.useState)("");
2908
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: value && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2966
+ const [zoneWillDrag, setZoneWillDrag] = (0, import_react21.useState)("");
2967
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: value && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2909
2968
  dropZoneContext.Provider,
2910
2969
  {
2911
2970
  value: __spreadValues({
@@ -2931,12 +2990,12 @@ var DropZoneProvider = ({
2931
2990
  };
2932
2991
 
2933
2992
  // components/DropZone/index.tsx
2934
- var import_jsx_runtime24 = require("react/jsx-runtime");
2993
+ var import_jsx_runtime25 = require("react/jsx-runtime");
2935
2994
  var getClassName18 = get_class_name_factory_default("DropZone", styles_module_default12);
2936
2995
  function DropZoneEdit({ zone, allow, disallow, style }) {
2937
2996
  var _a;
2938
2997
  const appContext2 = useAppContext();
2939
- const ctx = (0, import_react21.useContext)(dropZoneContext);
2998
+ const ctx = (0, import_react22.useContext)(dropZoneContext);
2940
2999
  const {
2941
3000
  // These all need setting via context
2942
3001
  data,
@@ -2955,12 +3014,12 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
2955
3014
  } = ctx || {};
2956
3015
  let content = data.content || [];
2957
3016
  let zoneCompound = rootDroppableId;
2958
- (0, import_react21.useEffect)(() => {
3017
+ (0, import_react22.useEffect)(() => {
2959
3018
  if (areaId && registerZoneArea) {
2960
3019
  registerZoneArea(areaId);
2961
3020
  }
2962
3021
  }, [areaId]);
2963
- (0, import_react21.useEffect)(() => {
3022
+ (0, import_react22.useEffect)(() => {
2964
3023
  if (ctx == null ? void 0 : ctx.registerZone) {
2965
3024
  ctx == null ? void 0 : ctx.registerZone(zoneCompound);
2966
3025
  }
@@ -2986,7 +3045,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
2986
3045
  const draggingOverArea = userIsDragging && zoneArea === draggedSourceArea;
2987
3046
  const draggingNewComponent = draggedSourceId == null ? void 0 : draggedSourceId.startsWith("component-list");
2988
3047
  if (!(ctx == null ? void 0 : ctx.config) || !ctx.setHoveringArea || !ctx.setHoveringZone || !ctx.setHoveringComponent || !ctx.setItemSelector || !ctx.registerPath || !ctx.dispatch) {
2989
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: "DropZone requires context to work." });
3048
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { children: "DropZone requires context to work." });
2990
3049
  }
2991
3050
  const {
2992
3051
  hoveringArea = "root",
@@ -3027,7 +3086,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
3027
3086
  }
3028
3087
  const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
3029
3088
  const isAreaSelected = selectedItem && zoneArea === selectedItem.props.id;
3030
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3089
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3031
3090
  "div",
3032
3091
  {
3033
3092
  className: getClassName18({
@@ -3044,14 +3103,14 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
3044
3103
  onMouseUp: () => {
3045
3104
  setZoneWillDrag("");
3046
3105
  },
3047
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3106
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3048
3107
  Droppable,
3049
3108
  {
3050
3109
  droppableId: zoneCompound,
3051
3110
  direction: "vertical",
3052
3111
  isDropDisabled: !isEnabled,
3053
3112
  children: (provided, snapshot) => {
3054
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3113
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3055
3114
  "div",
3056
3115
  __spreadProps(__spreadValues({}, (provided || { droppableProps: {} }).droppableProps), {
3057
3116
  className: getClassName18("content"),
@@ -3081,7 +3140,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
3081
3140
  "draggable-"
3082
3141
  )[1] === componentId;
3083
3142
  const containsZone = areasWithZones ? areasWithZones[componentId] : false;
3084
- const Render2 = config.components[item.type] ? config.components[item.type].render : () => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { padding: 48, textAlign: "center" }, children: [
3143
+ const Render2 = config.components[item.type] ? config.components[item.type].render : () => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { padding: 48, textAlign: "center" }, children: [
3085
3144
  "No configuration for ",
3086
3145
  item.type
3087
3146
  ] });
@@ -3093,19 +3152,19 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
3093
3152
  appContext2.state.data
3094
3153
  )
3095
3154
  }).drag;
3096
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3155
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3097
3156
  "div",
3098
3157
  {
3099
3158
  className: getClassName18("item"),
3100
3159
  style: { zIndex: isDragging ? 1 : void 0 },
3101
3160
  children: [
3102
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3161
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3103
3162
  DropZoneProvider,
3104
3163
  {
3105
3164
  value: __spreadProps(__spreadValues({}, ctx), {
3106
3165
  areaId: componentId
3107
3166
  }),
3108
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3167
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3109
3168
  DraggableComponent,
3110
3169
  {
3111
3170
  label,
@@ -3173,12 +3232,12 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
3173
3232
  style: {
3174
3233
  pointerEvents: userIsDragging && draggingNewComponent ? "all" : void 0
3175
3234
  },
3176
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName18("renderWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Render2, __spreadValues({}, defaultedProps)) })
3235
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getClassName18("renderWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Render2, __spreadValues({}, defaultedProps)) })
3177
3236
  }
3178
3237
  )
3179
3238
  }
3180
3239
  ),
3181
- userIsDragging && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3240
+ userIsDragging && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3182
3241
  "div",
3183
3242
  {
3184
3243
  className: getClassName18("hitbox"),
@@ -3195,7 +3254,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
3195
3254
  );
3196
3255
  }),
3197
3256
  provided == null ? void 0 : provided.placeholder,
3198
- (snapshot == null ? void 0 : snapshot.isDraggingOver) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3257
+ (snapshot == null ? void 0 : snapshot.isDraggingOver) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3199
3258
  "div",
3200
3259
  {
3201
3260
  "data-puck-placeholder": true,
@@ -3216,7 +3275,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
3216
3275
  );
3217
3276
  }
3218
3277
  function DropZoneRender({ zone }) {
3219
- const ctx = (0, import_react21.useContext)(dropZoneContext);
3278
+ const ctx = (0, import_react22.useContext)(dropZoneContext);
3220
3279
  const { data, areaId = "root", config } = ctx || {};
3221
3280
  let zoneCompound = rootDroppableId;
3222
3281
  let content = (data == null ? void 0 : data.content) || [];
@@ -3227,14 +3286,14 @@ function DropZoneRender({ zone }) {
3227
3286
  zoneCompound = `${areaId}:${zone}`;
3228
3287
  content = setupZone(data, zoneCompound).zones[zoneCompound];
3229
3288
  }
3230
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: content.map((item) => {
3289
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: content.map((item) => {
3231
3290
  const Component = config.components[item.type];
3232
3291
  if (Component) {
3233
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3292
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3234
3293
  DropZoneProvider,
3235
3294
  {
3236
3295
  value: { data, config, areaId: item.props.id },
3237
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3296
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3238
3297
  Component.render,
3239
3298
  __spreadProps(__spreadValues({}, item.props), {
3240
3299
  puck: { renderDropZone: DropZone }
@@ -3248,35 +3307,36 @@ function DropZoneRender({ zone }) {
3248
3307
  }) });
3249
3308
  }
3250
3309
  function DropZone(props) {
3251
- const ctx = (0, import_react21.useContext)(dropZoneContext);
3310
+ const ctx = (0, import_react22.useContext)(dropZoneContext);
3252
3311
  if ((ctx == null ? void 0 : ctx.mode) === "edit") {
3253
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropZoneEdit, __spreadValues({}, props));
3312
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropZoneEdit, __spreadValues({}, props));
3254
3313
  }
3255
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropZoneRender, __spreadValues({}, props));
3314
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropZoneRender, __spreadValues({}, props));
3256
3315
  }
3257
3316
 
3258
3317
  // components/Puck/index.tsx
3259
3318
  init_react_import();
3260
- var import_react36 = require("react");
3319
+ var import_react37 = require("react");
3261
3320
 
3262
3321
  // lib/use-placeholder-style.ts
3263
3322
  init_react_import();
3264
- var import_react22 = require("react");
3323
+ var import_react23 = require("react");
3265
3324
 
3266
3325
  // lib/get-frame.ts
3267
3326
  init_react_import();
3268
3327
  var getFrame = () => {
3269
- let frame = document.querySelector("#preview-frame");
3270
- if ((frame == null ? void 0 : frame.tagName) === "IFRAME") {
3271
- frame = frame.contentDocument;
3328
+ if (typeof window === "undefined") return;
3329
+ let frameEl = document.querySelector("#preview-frame");
3330
+ if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
3331
+ return frameEl.contentDocument || document;
3272
3332
  }
3273
- return frame;
3333
+ return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
3274
3334
  };
3275
3335
 
3276
3336
  // lib/use-placeholder-style.ts
3277
3337
  var usePlaceholderStyle = () => {
3278
3338
  const queryAttr = "data-rfd-drag-handle-draggable-id";
3279
- const [placeholderStyle, setPlaceholderStyle] = (0, import_react22.useState)();
3339
+ const [placeholderStyle, setPlaceholderStyle] = (0, import_react23.useState)();
3280
3340
  const onDragStartOrUpdate = (draggedItem) => {
3281
3341
  var _a;
3282
3342
  const draggableId = draggedItem.draggableId;
@@ -3329,7 +3389,7 @@ var styles_module_default13 = { "SidebarSection": "_SidebarSection_125qe_1", "Si
3329
3389
 
3330
3390
  // lib/use-breadcrumbs.ts
3331
3391
  init_react_import();
3332
- var import_react23 = require("react");
3392
+ var import_react24 = require("react");
3333
3393
  var convertPathDataToBreadcrumbs = (selectedItem, pathData, data) => {
3334
3394
  const id = selectedItem ? selectedItem == null ? void 0 : selectedItem.props.id : "";
3335
3395
  const currentPathData = pathData && id && pathData[id] ? __spreadValues({}, pathData[id]) : { label: "Page", path: [] };
@@ -3379,8 +3439,8 @@ var useBreadcrumbs = (renderCount) => {
3379
3439
  state: { data },
3380
3440
  selectedItem
3381
3441
  } = useAppContext();
3382
- const dzContext = (0, import_react23.useContext)(dropZoneContext);
3383
- return (0, import_react23.useMemo)(() => {
3442
+ const dzContext = (0, import_react24.useContext)(dropZoneContext);
3443
+ return (0, import_react24.useMemo)(() => {
3384
3444
  const breadcrumbs = convertPathDataToBreadcrumbs(
3385
3445
  selectedItem,
3386
3446
  dzContext == null ? void 0 : dzContext.pathData,
@@ -3394,7 +3454,7 @@ var useBreadcrumbs = (renderCount) => {
3394
3454
  };
3395
3455
 
3396
3456
  // components/SidebarSection/index.tsx
3397
- var import_jsx_runtime25 = require("react/jsx-runtime");
3457
+ var import_jsx_runtime26 = require("react/jsx-runtime");
3398
3458
  var getClassName19 = get_class_name_factory_default("SidebarSection", styles_module_default13);
3399
3459
  var SidebarSection = ({
3400
3460
  children,
@@ -3407,15 +3467,15 @@ var SidebarSection = ({
3407
3467
  }) => {
3408
3468
  const { setUi } = useAppContext();
3409
3469
  const breadcrumbs = useBreadcrumbs(1);
3410
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3470
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3411
3471
  "div",
3412
3472
  {
3413
3473
  className: getClassName19({ noBorderTop, noPadding }),
3414
3474
  style: { background },
3415
3475
  children: [
3416
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getClassName19("title"), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getClassName19("breadcrumbs"), children: [
3417
- showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getClassName19("breadcrumb"), children: [
3418
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3476
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("title"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: getClassName19("breadcrumbs"), children: [
3477
+ showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: getClassName19("breadcrumb"), children: [
3478
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3419
3479
  "button",
3420
3480
  {
3421
3481
  type: "button",
@@ -3424,12 +3484,12 @@ var SidebarSection = ({
3424
3484
  children: breadcrumb.label
3425
3485
  }
3426
3486
  ),
3427
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronRight, { size: 16 })
3487
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronRight, { size: 16 })
3428
3488
  ] }, i)) : null,
3429
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getClassName19("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Heading, { rank: "2", size: "xs", children: title }) })
3489
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading, { rank: "2", size: "xs", children: title }) })
3430
3490
  ] }) }),
3431
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getClassName19("content"), children }),
3432
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getClassName19("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Loader, { size: 32 }) })
3491
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("content"), children }),
3492
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Loader, { size: 32 }) })
3433
3493
  ]
3434
3494
  }
3435
3495
  );
@@ -3632,6 +3692,9 @@ function reduceData(data, action, config) {
3632
3692
  });
3633
3693
  }
3634
3694
  if (action.type === "move") {
3695
+ if (action.sourceZone === action.destinationZone && action.sourceIndex === action.destinationIndex) {
3696
+ return data;
3697
+ }
3635
3698
  const newData = setupZone(
3636
3699
  setupZone(data, action.sourceZone),
3637
3700
  action.destinationZone
@@ -3810,7 +3873,7 @@ init_react_import();
3810
3873
  var styles_module_default14 = { "MenuBar": "_MenuBar_8pf8c_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_8pf8c_14", "MenuBar-inner": "_MenuBar-inner_8pf8c_29", "MenuBar-history": "_MenuBar-history_8pf8c_45" };
3811
3874
 
3812
3875
  // components/MenuBar/index.tsx
3813
- var import_jsx_runtime26 = require("react/jsx-runtime");
3876
+ var import_jsx_runtime27 = require("react/jsx-runtime");
3814
3877
  var getClassName20 = get_class_name_factory_default("MenuBar", styles_module_default14);
3815
3878
  function MenuBar({
3816
3879
  appState,
@@ -3824,7 +3887,7 @@ function MenuBar({
3824
3887
  history: { back, forward, historyStore }
3825
3888
  } = useAppContext();
3826
3889
  const { hasFuture = false, hasPast = false } = historyStore || {};
3827
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3890
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3828
3891
  "div",
3829
3892
  {
3830
3893
  className: getClassName20({ menuOpen }),
@@ -3838,12 +3901,12 @@ function MenuBar({
3838
3901
  setMenuOpen(false);
3839
3902
  }
3840
3903
  },
3841
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: getClassName20("inner"), children: [
3842
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: getClassName20("history"), children: [
3843
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Undo2, { size: 21 }) }),
3844
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Redo2, { size: 21 }) })
3904
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: getClassName20("inner"), children: [
3905
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: getClassName20("history"), children: [
3906
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Undo2, { size: 21 }) }),
3907
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Redo2, { size: 21 }) })
3845
3908
  ] }),
3846
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: renderHeaderActions && renderHeaderActions({
3909
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children: renderHeaderActions && renderHeaderActions({
3847
3910
  state: appState,
3848
3911
  dispatch
3849
3912
  }) })
@@ -3864,15 +3927,15 @@ init_react_import();
3864
3927
  var styles_module_default16 = { "PuckFields": "_PuckFields_jp3lw_1", "PuckFields--isLoading": "_PuckFields--isLoading_jp3lw_6", "PuckFields-loadingOverlay": "_PuckFields-loadingOverlay_jp3lw_10", "PuckFields-loadingOverlayInner": "_PuckFields-loadingOverlayInner_jp3lw_25" };
3865
3928
 
3866
3929
  // components/Puck/components/Fields/index.tsx
3867
- var import_react25 = require("react");
3930
+ var import_react26 = require("react");
3868
3931
 
3869
3932
  // lib/use-parent.ts
3870
3933
  init_react_import();
3871
- var import_react24 = require("react");
3934
+ var import_react25 = require("react");
3872
3935
  var useParent = (itemSelector) => {
3873
3936
  var _a;
3874
3937
  const { selectedItem, state } = useAppContext();
3875
- const { pathData } = (0, import_react24.useContext)(dropZoneContext) || {};
3938
+ const { pathData } = (0, import_react25.useContext)(dropZoneContext) || {};
3876
3939
  const item = itemSelector ? getItem(itemSelector, state.data) : selectedItem;
3877
3940
  const breadcrumbs = convertPathDataToBreadcrumbs(item, pathData, state.data);
3878
3941
  const lastItem = breadcrumbs[breadcrumbs.length - 1];
@@ -3881,7 +3944,7 @@ var useParent = (itemSelector) => {
3881
3944
  };
3882
3945
 
3883
3946
  // components/Puck/components/Fields/index.tsx
3884
- var import_jsx_runtime27 = require("react/jsx-runtime");
3947
+ var import_jsx_runtime28 = require("react/jsx-runtime");
3885
3948
  var getClassName21 = get_class_name_factory_default("PuckFields", styles_module_default16);
3886
3949
  var defaultPageFields = {
3887
3950
  title: { type: "text" }
@@ -3889,7 +3952,7 @@ var defaultPageFields = {
3889
3952
  var DefaultFields = ({
3890
3953
  children
3891
3954
  }) => {
3892
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children });
3955
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children });
3893
3956
  };
3894
3957
  var useResolvedFields = () => {
3895
3958
  var _a, _b;
@@ -3898,20 +3961,20 @@ var useResolvedFields = () => {
3898
3961
  const { data } = state;
3899
3962
  const rootFields = ((_a = config.root) == null ? void 0 : _a.fields) || defaultPageFields;
3900
3963
  const componentConfig = selectedItem ? config.components[selectedItem.type] : null;
3901
- const defaultFields = (0, import_react25.useMemo)(
3964
+ const defaultFields = (0, import_react26.useMemo)(
3902
3965
  () => (selectedItem ? componentConfig == null ? void 0 : componentConfig.fields : rootFields) || {},
3903
3966
  [selectedItem, rootFields, componentConfig == null ? void 0 : componentConfig.fields]
3904
3967
  );
3905
3968
  const rootProps = data.root.props || data.root;
3906
- const [lastSelectedData, setLastSelectedData] = (0, import_react25.useState)({});
3907
- const [resolvedFields, setResolvedFields] = (0, import_react25.useState)(defaultFields);
3908
- const [fieldsLoading, setFieldsLoading] = (0, import_react25.useState)(false);
3969
+ const [lastSelectedData, setLastSelectedData] = (0, import_react26.useState)({});
3970
+ const [resolvedFields, setResolvedFields] = (0, import_react26.useState)(defaultFields);
3971
+ const [fieldsLoading, setFieldsLoading] = (0, import_react26.useState)(false);
3909
3972
  const defaultResolveFields = (_componentData, _params) => defaultFields;
3910
3973
  const componentData = selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly };
3911
3974
  const hasComponentResolver = selectedItem && (componentConfig == null ? void 0 : componentConfig.resolveFields);
3912
3975
  const hasRootResolver = !selectedItem && ((_b = config.root) == null ? void 0 : _b.resolveFields);
3913
3976
  const hasResolver = hasComponentResolver || hasRootResolver;
3914
- const resolveFields = (0, import_react25.useCallback)(
3977
+ const resolveFields = (0, import_react26.useCallback)(
3915
3978
  (..._0) => __async(void 0, [..._0], function* (fields = {}) {
3916
3979
  var _a2;
3917
3980
  const lastData = ((_a2 = lastSelectedData.props) == null ? void 0 : _a2.id) === componentData.props.id ? lastSelectedData : null;
@@ -3947,19 +4010,33 @@ var useResolvedFields = () => {
3947
4010
  lastData
3948
4011
  });
3949
4012
  }),
3950
- [data, config, componentData, selectedItem, resolvedFields, state]
4013
+ [data, config, componentData, selectedItem, resolvedFields, state, parent]
3951
4014
  );
3952
- (0, import_react25.useEffect)(() => {
3953
- if (hasResolver) {
3954
- setFieldsLoading(true);
3955
- resolveFields(defaultFields).then((fields) => {
3956
- setResolvedFields(fields || {});
3957
- setFieldsLoading(false);
3958
- });
3959
- } else {
3960
- setResolvedFields(defaultFields);
4015
+ const [hasParent, setHasParent] = (0, import_react26.useState)(false);
4016
+ (0, import_react26.useEffect)(() => {
4017
+ setHasParent(!!parent);
4018
+ }, [parent]);
4019
+ (0, import_react26.useEffect)(() => {
4020
+ var _a2;
4021
+ if (!((_a2 = state.ui.itemSelector) == null ? void 0 : _a2.zone) || hasParent) {
4022
+ if (hasResolver) {
4023
+ setFieldsLoading(true);
4024
+ resolveFields(defaultFields).then((fields) => {
4025
+ setResolvedFields(fields || {});
4026
+ setFieldsLoading(false);
4027
+ });
4028
+ } else {
4029
+ setResolvedFields(defaultFields);
4030
+ }
3961
4031
  }
3962
- }, [data, defaultFields, selectedItem, hasResolver]);
4032
+ }, [
4033
+ data,
4034
+ defaultFields,
4035
+ state.ui.itemSelector,
4036
+ selectedItem,
4037
+ hasResolver,
4038
+ hasParent
4039
+ ]);
3963
4040
  return [resolvedFields, fieldsLoading];
3964
4041
  };
3965
4042
  var Fields = () => {
@@ -3980,8 +4057,8 @@ var Fields = () => {
3980
4057
  const componentResolving = selectedItem ? ((_a = componentState[selectedItem == null ? void 0 : selectedItem.props.id]) == null ? void 0 : _a.loadingCount) > 0 : ((_b = componentState["puck-root"]) == null ? void 0 : _b.loadingCount) > 0;
3981
4058
  const isLoading = fieldsResolving || componentResolving;
3982
4059
  const rootProps = data.root.props || data.root;
3983
- const Wrapper = (0, import_react25.useMemo)(() => overrides.fields || DefaultFields, [overrides]);
3984
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4060
+ const Wrapper = (0, import_react26.useMemo)(() => overrides.fields || DefaultFields, [overrides]);
4061
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3985
4062
  "form",
3986
4063
  {
3987
4064
  className: getClassName21(),
@@ -3989,7 +4066,7 @@ var Fields = () => {
3989
4066
  e.preventDefault();
3990
4067
  },
3991
4068
  children: [
3992
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Wrapper, { isLoading, itemSelector, children: Object.keys(fields).map((fieldName) => {
4069
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Wrapper, { isLoading, itemSelector, children: Object.keys(fields).map((fieldName) => {
3993
4070
  const field = fields[fieldName];
3994
4071
  if (!(field == null ? void 0 : field.type)) return null;
3995
4072
  const onChange = (value, updatedUi) => {
@@ -4060,7 +4137,7 @@ var Fields = () => {
4060
4137
  item: selectedItem
4061
4138
  });
4062
4139
  const id = `${selectedItem.props.id}_${field.type}_${fieldName}`;
4063
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4140
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4064
4141
  AutoFieldPrivate,
4065
4142
  {
4066
4143
  field,
@@ -4078,7 +4155,7 @@ var Fields = () => {
4078
4155
  root: true
4079
4156
  });
4080
4157
  const id = `root_${field.type}_${fieldName}`;
4081
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4158
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4082
4159
  AutoFieldPrivate,
4083
4160
  {
4084
4161
  field,
@@ -4092,7 +4169,7 @@ var Fields = () => {
4092
4169
  );
4093
4170
  }
4094
4171
  }) }),
4095
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: getClassName21("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: getClassName21("loadingOverlayInner"), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Loader, { size: 16 }) }) })
4172
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: getClassName21("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: getClassName21("loadingOverlayInner"), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Loader, { size: 16 }) }) })
4096
4173
  ]
4097
4174
  }
4098
4175
  );
@@ -4103,7 +4180,7 @@ init_react_import();
4103
4180
 
4104
4181
  // lib/use-component-list.tsx
4105
4182
  init_react_import();
4106
- var import_react26 = require("react");
4183
+ var import_react27 = require("react");
4107
4184
 
4108
4185
  // components/ComponentList/index.tsx
4109
4186
  init_react_import();
@@ -4113,7 +4190,7 @@ init_react_import();
4113
4190
  var styles_module_default17 = { "ComponentList": "_ComponentList_odh9d_1", "ComponentList--isExpanded": "_ComponentList--isExpanded_odh9d_5", "ComponentList-content": "_ComponentList-content_odh9d_9", "ComponentList-title": "_ComponentList-title_odh9d_17", "ComponentList-titleIcon": "_ComponentList-titleIcon_odh9d_53" };
4114
4191
 
4115
4192
  // components/ComponentList/index.tsx
4116
- var import_jsx_runtime28 = require("react/jsx-runtime");
4193
+ var import_jsx_runtime29 = require("react/jsx-runtime");
4117
4194
  var getClassName22 = get_class_name_factory_default("ComponentList", styles_module_default17);
4118
4195
  var ComponentListItem = ({
4119
4196
  name,
@@ -4124,7 +4201,7 @@ var ComponentListItem = ({
4124
4201
  const canInsert = getPermissions({
4125
4202
  type: name
4126
4203
  }).insert;
4127
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4204
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4128
4205
  Drawer.Item,
4129
4206
  {
4130
4207
  label,
@@ -4142,8 +4219,8 @@ var ComponentList = ({
4142
4219
  }) => {
4143
4220
  const { config, state, setUi } = useAppContext();
4144
4221
  const { expanded = true } = state.ui.componentList[id] || {};
4145
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: getClassName22({ isExpanded: expanded }), children: [
4146
- title && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4222
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: getClassName22({ isExpanded: expanded }), children: [
4223
+ title && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4147
4224
  "button",
4148
4225
  {
4149
4226
  type: "button",
@@ -4157,14 +4234,14 @@ var ComponentList = ({
4157
4234
  }),
4158
4235
  title: expanded ? `Collapse${title ? ` ${title}` : ""}` : `Expand${title ? ` ${title}` : ""}`,
4159
4236
  children: [
4160
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { children: title }),
4161
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: getClassName22("titleIcon"), children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronUp, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronDown, { size: 12 }) })
4237
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: title }),
4238
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: getClassName22("titleIcon"), children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronUp, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronDown, { size: 12 }) })
4162
4239
  ]
4163
4240
  }
4164
4241
  ),
4165
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: getClassName22("content"), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Drawer, { droppableId: title, children: children || Object.keys(config.components).map((componentKey, i) => {
4242
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: getClassName22("content"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Drawer, { droppableId: title, children: children || Object.keys(config.components).map((componentKey, i) => {
4166
4243
  var _a;
4167
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4244
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4168
4245
  ComponentListItem,
4169
4246
  {
4170
4247
  label: (_a = config.components[componentKey]["label"]) != null ? _a : componentKey,
@@ -4179,10 +4256,10 @@ var ComponentList = ({
4179
4256
  ComponentList.Item = ComponentListItem;
4180
4257
 
4181
4258
  // lib/use-component-list.tsx
4182
- var import_jsx_runtime29 = require("react/jsx-runtime");
4259
+ var import_jsx_runtime30 = require("react/jsx-runtime");
4183
4260
  var useComponentList = (config, ui) => {
4184
- const [componentList, setComponentList] = (0, import_react26.useState)();
4185
- (0, import_react26.useEffect)(() => {
4261
+ const [componentList, setComponentList] = (0, import_react27.useState)();
4262
+ (0, import_react27.useEffect)(() => {
4186
4263
  var _a, _b, _c;
4187
4264
  if (Object.keys(ui.componentList).length > 0) {
4188
4265
  const matchedComponents = [];
@@ -4192,7 +4269,7 @@ var useComponentList = (config, ui) => {
4192
4269
  if (category.visible === false || !category.components) {
4193
4270
  return null;
4194
4271
  }
4195
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4272
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4196
4273
  ComponentList,
4197
4274
  {
4198
4275
  id: categoryKey,
@@ -4201,7 +4278,7 @@ var useComponentList = (config, ui) => {
4201
4278
  var _a2;
4202
4279
  matchedComponents.push(componentName);
4203
4280
  const componentConf = config.components[componentName] || {};
4204
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4281
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4205
4282
  ComponentList.Item,
4206
4283
  {
4207
4284
  label: (_a2 = componentConf["label"]) != null ? _a2 : componentName,
@@ -4221,7 +4298,7 @@ var useComponentList = (config, ui) => {
4221
4298
  );
4222
4299
  if (remainingComponents.length > 0 && !((_a = ui.componentList.other) == null ? void 0 : _a.components) && ((_b = ui.componentList.other) == null ? void 0 : _b.visible) !== false) {
4223
4300
  _componentList.push(
4224
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4301
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4225
4302
  ComponentList,
4226
4303
  {
4227
4304
  id: "other",
@@ -4229,7 +4306,7 @@ var useComponentList = (config, ui) => {
4229
4306
  children: remainingComponents.map((componentName, i) => {
4230
4307
  var _a2;
4231
4308
  const componentConf = config.components[componentName] || {};
4232
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4309
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4233
4310
  ComponentList.Item,
4234
4311
  {
4235
4312
  name: componentName,
@@ -4251,25 +4328,25 @@ var useComponentList = (config, ui) => {
4251
4328
  };
4252
4329
 
4253
4330
  // components/Puck/components/Components/index.tsx
4254
- var import_react27 = require("react");
4255
- var import_jsx_runtime30 = require("react/jsx-runtime");
4331
+ var import_react28 = require("react");
4332
+ var import_jsx_runtime31 = require("react/jsx-runtime");
4256
4333
  var Components = () => {
4257
4334
  const { config, state, overrides } = useAppContext();
4258
4335
  const componentList = useComponentList(config, state.ui);
4259
- const Wrapper = (0, import_react27.useMemo)(() => overrides.components || "div", [overrides]);
4260
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ComponentList, { id: "all" }) });
4336
+ const Wrapper = (0, import_react28.useMemo)(() => overrides.components || "div", [overrides]);
4337
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ComponentList, { id: "all" }) });
4261
4338
  };
4262
4339
 
4263
4340
  // components/Puck/components/Preview/index.tsx
4264
4341
  init_react_import();
4265
- var import_react29 = require("react");
4342
+ var import_react30 = require("react");
4266
4343
 
4267
4344
  // components/AutoFrame/index.tsx
4268
4345
  init_react_import();
4269
- var import_react28 = require("react");
4346
+ var import_react29 = require("react");
4270
4347
  var import_object_hash = __toESM(require("object-hash"));
4271
4348
  var import_react_dom2 = require("react-dom");
4272
- var import_jsx_runtime31 = require("react/jsx-runtime");
4349
+ var import_jsx_runtime32 = require("react/jsx-runtime");
4273
4350
  var styleSelector = 'style, link[rel="stylesheet"]';
4274
4351
  var collectStyles = (doc) => {
4275
4352
  const collected = [];
@@ -4312,7 +4389,7 @@ var CopyHostStyles = ({
4312
4389
  onStylesLoaded = () => null
4313
4390
  }) => {
4314
4391
  const { document: doc, window: win } = useFrame();
4315
- (0, import_react28.useEffect)(() => {
4392
+ (0, import_react29.useEffect)(() => {
4316
4393
  if (!win || !doc) {
4317
4394
  return () => {
4318
4395
  };
@@ -4469,10 +4546,10 @@ var CopyHostStyles = ({
4469
4546
  observer.disconnect();
4470
4547
  };
4471
4548
  }, []);
4472
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children });
4549
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
4473
4550
  };
4474
- var autoFrameContext = (0, import_react28.createContext)({});
4475
- var useFrame = () => (0, import_react28.useContext)(autoFrameContext);
4551
+ var autoFrameContext = (0, import_react29.createContext)({});
4552
+ var useFrame = () => (0, import_react29.useContext)(autoFrameContext);
4476
4553
  function AutoFrame(_a) {
4477
4554
  var _b = _a, {
4478
4555
  children,
@@ -4487,11 +4564,11 @@ function AutoFrame(_a) {
4487
4564
  "id",
4488
4565
  "onStylesLoaded"
4489
4566
  ]);
4490
- const [loaded, setLoaded] = (0, import_react28.useState)(false);
4491
- const [ctx, setCtx] = (0, import_react28.useState)({});
4492
- const ref = (0, import_react28.useRef)(null);
4493
- const [mountTarget, setMountTarget] = (0, import_react28.useState)();
4494
- (0, import_react28.useEffect)(() => {
4567
+ const [loaded, setLoaded] = (0, import_react29.useState)(false);
4568
+ const [ctx, setCtx] = (0, import_react29.useState)({});
4569
+ const ref = (0, import_react29.useRef)(null);
4570
+ const [mountTarget, setMountTarget] = (0, import_react29.useState)();
4571
+ (0, import_react29.useEffect)(() => {
4495
4572
  var _a2;
4496
4573
  if (ref.current) {
4497
4574
  setCtx({
@@ -4501,7 +4578,7 @@ function AutoFrame(_a) {
4501
4578
  setMountTarget((_a2 = ref.current.contentDocument) == null ? void 0 : _a2.getElementById("frame-root"));
4502
4579
  }
4503
4580
  }, [ref, loaded]);
4504
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4581
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4505
4582
  "iframe",
4506
4583
  __spreadProps(__spreadValues({}, props), {
4507
4584
  className,
@@ -4511,7 +4588,7 @@ function AutoFrame(_a) {
4511
4588
  onLoad: () => {
4512
4589
  setLoaded(true);
4513
4590
  },
4514
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(autoFrameContext.Provider, { value: ctx, children: loaded && mountTarget && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CopyHostStyles, { debug, onStylesLoaded, children: (0, import_react_dom2.createPortal)(children, mountTarget) }) })
4591
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(autoFrameContext.Provider, { value: ctx, children: loaded && mountTarget && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CopyHostStyles, { debug, onStylesLoaded, children: (0, import_react_dom2.createPortal)(children, mountTarget) }) })
4515
4592
  })
4516
4593
  );
4517
4594
  }
@@ -4523,22 +4600,22 @@ init_react_import();
4523
4600
  var styles_module_default18 = { "PuckPreview": "_PuckPreview_rxwlr_1", "PuckPreview-frame": "_PuckPreview-frame_rxwlr_5" };
4524
4601
 
4525
4602
  // components/Puck/components/Preview/index.tsx
4526
- var import_jsx_runtime32 = require("react/jsx-runtime");
4603
+ var import_jsx_runtime33 = require("react/jsx-runtime");
4527
4604
  var getClassName23 = get_class_name_factory_default("PuckPreview", styles_module_default18);
4528
4605
  var Preview = ({ id = "puck-preview" }) => {
4529
4606
  const { config, dispatch, state, setStatus, iframe, overrides } = useAppContext();
4530
- const Page = (0, import_react29.useCallback)(
4607
+ const Page = (0, import_react30.useCallback)(
4531
4608
  (pageProps) => {
4532
4609
  var _a, _b;
4533
4610
  return ((_a = config.root) == null ? void 0 : _a.render) ? (_b = config.root) == null ? void 0 : _b.render(__spreadValues({
4534
4611
  id: "puck-root"
4535
- }, pageProps)) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children: pageProps.children });
4612
+ }, pageProps)) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: pageProps.children });
4536
4613
  },
4537
4614
  [config.root]
4538
4615
  );
4539
- const Frame = (0, import_react29.useMemo)(() => overrides.iframe, [overrides]);
4616
+ const Frame = (0, import_react30.useMemo)(() => overrides.iframe, [overrides]);
4540
4617
  const rootProps = state.data.root.props || state.data.root;
4541
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4618
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4542
4619
  "div",
4543
4620
  {
4544
4621
  className: getClassName23(),
@@ -4546,7 +4623,7 @@ var Preview = ({ id = "puck-preview" }) => {
4546
4623
  onClick: () => {
4547
4624
  dispatch({ type: "setUi", ui: __spreadProps(__spreadValues({}, state.ui), { itemSelector: null }) });
4548
4625
  },
4549
- children: iframe.enabled ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4626
+ children: iframe.enabled ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4550
4627
  AutoFrame_default,
4551
4628
  {
4552
4629
  id: "preview-frame",
@@ -4555,27 +4632,27 @@ var Preview = ({ id = "puck-preview" }) => {
4555
4632
  onStylesLoaded: () => {
4556
4633
  setStatus("READY");
4557
4634
  },
4558
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(autoFrameContext.Consumer, { children: ({ document: document2 }) => {
4559
- const inner = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4635
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(autoFrameContext.Consumer, { children: ({ document: document2 }) => {
4636
+ const inner = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4560
4637
  Page,
4561
4638
  __spreadProps(__spreadValues({}, rootProps), {
4562
4639
  puck: { renderDropZone: DropZone, isEditing: true },
4563
4640
  editMode: true,
4564
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DropZone, { zone: rootDroppableId })
4641
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DropZone, { zone: rootDroppableId })
4565
4642
  })
4566
4643
  );
4567
4644
  if (Frame) {
4568
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Frame, { document: document2, children: inner });
4645
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Frame, { document: document2, children: inner });
4569
4646
  }
4570
4647
  return inner;
4571
4648
  } })
4572
4649
  }
4573
- ) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { id: "preview-frame", className: getClassName23("frame"), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4650
+ ) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { id: "preview-frame", className: getClassName23("frame"), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4574
4651
  Page,
4575
4652
  __spreadProps(__spreadValues({}, rootProps), {
4576
4653
  puck: { renderDropZone: DropZone, isEditing: true },
4577
4654
  editMode: true,
4578
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DropZone, { zone: rootDroppableId })
4655
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DropZone, { zone: rootDroppableId })
4579
4656
  })
4580
4657
  ) })
4581
4658
  }
@@ -4625,7 +4702,7 @@ var scrollIntoView = (el) => {
4625
4702
  };
4626
4703
 
4627
4704
  // components/LayerTree/index.tsx
4628
- var import_react30 = require("react");
4705
+ var import_react31 = require("react");
4629
4706
 
4630
4707
  // lib/is-child-of-zone.ts
4631
4708
  init_react_import();
@@ -4639,7 +4716,7 @@ var isChildOfZone = (item, maybeChild, ctx) => {
4639
4716
  };
4640
4717
 
4641
4718
  // components/LayerTree/index.tsx
4642
- var import_jsx_runtime33 = require("react/jsx-runtime");
4719
+ var import_jsx_runtime34 = require("react/jsx-runtime");
4643
4720
  var getClassName24 = get_class_name_factory_default("LayerTree", styles_module_default19);
4644
4721
  var getClassNameLayer = get_class_name_factory_default("Layer", styles_module_default19);
4645
4722
  var LayerTree = ({
@@ -4652,15 +4729,15 @@ var LayerTree = ({
4652
4729
  label
4653
4730
  }) => {
4654
4731
  const zones = data.zones || {};
4655
- const ctx = (0, import_react30.useContext)(dropZoneContext);
4656
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
4657
- label && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: getClassName24("zoneTitle"), children: [
4658
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: getClassName24("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Layers, { size: "16" }) }),
4732
+ const ctx = (0, import_react31.useContext)(dropZoneContext);
4733
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
4734
+ label && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassName24("zoneTitle"), children: [
4735
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Layers, { size: "16" }) }),
4659
4736
  " ",
4660
4737
  label
4661
4738
  ] }),
4662
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("ul", { className: getClassName24(), children: [
4663
- zoneContent.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: getClassName24("helper"), children: "No items" }),
4739
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("ul", { className: getClassName24(), children: [
4740
+ zoneContent.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("helper"), children: "No items" }),
4664
4741
  zoneContent.map((item, i) => {
4665
4742
  var _a;
4666
4743
  const isSelected = (itemSelector == null ? void 0 : itemSelector.index) === i && (itemSelector.zone === zone || itemSelector.zone === rootDroppableId && !zone);
@@ -4678,7 +4755,7 @@ var LayerTree = ({
4678
4755
  const childIsSelected = isChildOfZone(item, selectedItem, ctx);
4679
4756
  const componentConfig = config.components[item.type];
4680
4757
  const label2 = (_a = componentConfig == null ? void 0 : componentConfig["label"]) != null ? _a : item.type.toString();
4681
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4758
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
4682
4759
  "li",
4683
4760
  {
4684
4761
  className: getClassNameLayer({
@@ -4688,7 +4765,7 @@ var LayerTree = ({
4688
4765
  childIsSelected
4689
4766
  }),
4690
4767
  children: [
4691
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4768
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
4692
4769
  "button",
4693
4770
  {
4694
4771
  type: "button",
@@ -4721,22 +4798,22 @@ var LayerTree = ({
4721
4798
  setHoveringComponent(null);
4722
4799
  },
4723
4800
  children: [
4724
- containsZone && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4801
+ containsZone && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4725
4802
  "div",
4726
4803
  {
4727
4804
  className: getClassNameLayer("chevron"),
4728
4805
  title: isSelected ? "Collapse" : "Expand",
4729
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevronDown, { size: "12" })
4806
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronDown, { size: "12" })
4730
4807
  }
4731
4808
  ),
4732
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: getClassNameLayer("title"), children: [
4733
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: getClassNameLayer("icon"), children: item.type === "Text" || item.type === "Heading" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Type, { size: "16" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(LayoutGrid, { size: "16" }) }),
4734
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: getClassNameLayer("name"), children: label2 })
4809
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassNameLayer("title"), children: [
4810
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("icon"), children: item.type === "Text" || item.type === "Heading" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Type, { size: "16" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LayoutGrid, { size: "16" }) }),
4811
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("name"), children: label2 })
4735
4812
  ] })
4736
4813
  ]
4737
4814
  }
4738
4815
  ) }),
4739
- containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: getClassNameLayer("zones"), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4816
+ containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("zones"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4740
4817
  LayerTree,
4741
4818
  {
4742
4819
  config,
@@ -4758,13 +4835,13 @@ var LayerTree = ({
4758
4835
  };
4759
4836
 
4760
4837
  // components/Puck/components/Outline/index.tsx
4761
- var import_react31 = require("react");
4762
- var import_jsx_runtime34 = require("react/jsx-runtime");
4838
+ var import_react32 = require("react");
4839
+ var import_jsx_runtime35 = require("react/jsx-runtime");
4763
4840
  var Outline = () => {
4764
4841
  const { dispatch, state, overrides, config } = useAppContext();
4765
4842
  const { data, ui } = state;
4766
4843
  const { itemSelector } = ui;
4767
- const setItemSelector = (0, import_react31.useCallback)(
4844
+ const setItemSelector = (0, import_react32.useCallback)(
4768
4845
  (newItemSelector) => {
4769
4846
  dispatch({
4770
4847
  type: "setUi",
@@ -4773,9 +4850,9 @@ var Outline = () => {
4773
4850
  },
4774
4851
  []
4775
4852
  );
4776
- const Wrapper = (0, import_react31.useMemo)(() => overrides.outline || "div", [overrides]);
4777
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(dropZoneContext.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
4778
- (ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4853
+ const Wrapper = (0, import_react32.useMemo)(() => overrides.outline || "div", [overrides]);
4854
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(dropZoneContext.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
4855
+ (ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4779
4856
  LayerTree,
4780
4857
  {
4781
4858
  config,
@@ -4788,7 +4865,7 @@ var Outline = () => {
4788
4865
  ),
4789
4866
  Object.entries(findZonesForArea(data, "root")).map(
4790
4867
  ([zoneKey, zone]) => {
4791
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4868
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4792
4869
  LayerTree,
4793
4870
  {
4794
4871
  config,
@@ -4812,7 +4889,8 @@ var import_react_hotkeys_hook = require("react-hotkeys-hook");
4812
4889
  function usePuckHistory({
4813
4890
  dispatch,
4814
4891
  initialAppState,
4815
- historyStore
4892
+ historyStore,
4893
+ iframeEnabled
4816
4894
  }) {
4817
4895
  const back = () => {
4818
4896
  var _a;
@@ -4830,6 +4908,16 @@ function usePuckHistory({
4830
4908
  historyStore.forward();
4831
4909
  }
4832
4910
  };
4911
+ const backIframe = () => {
4912
+ if (iframeEnabled) {
4913
+ back();
4914
+ }
4915
+ };
4916
+ const forwardIframe = () => {
4917
+ if (iframeEnabled) {
4918
+ forward();
4919
+ }
4920
+ };
4833
4921
  const setHistories = (histories) => {
4834
4922
  var _a;
4835
4923
  dispatch({
@@ -4848,9 +4936,23 @@ function usePuckHistory({
4848
4936
  historyStore.setHistoryIndex(index);
4849
4937
  }
4850
4938
  };
4939
+ const frame = getFrame();
4940
+ const resolvedFrame = typeof window !== "undefined" && frame !== document ? frame : void 0;
4851
4941
  (0, import_react_hotkeys_hook.useHotkeys)("meta+z", back, { preventDefault: true });
4852
4942
  (0, import_react_hotkeys_hook.useHotkeys)("meta+shift+z", forward, { preventDefault: true });
4853
4943
  (0, import_react_hotkeys_hook.useHotkeys)("meta+y", forward, { preventDefault: true });
4944
+ (0, import_react_hotkeys_hook.useHotkeys)("meta+z", backIframe, {
4945
+ preventDefault: true,
4946
+ document: resolvedFrame
4947
+ });
4948
+ (0, import_react_hotkeys_hook.useHotkeys)("meta+shift+z", forwardIframe, {
4949
+ preventDefault: true,
4950
+ document: resolvedFrame
4951
+ });
4952
+ (0, import_react_hotkeys_hook.useHotkeys)("meta+y", forwardIframe, {
4953
+ preventDefault: true,
4954
+ document: resolvedFrame
4955
+ });
4854
4956
  return {
4855
4957
  back,
4856
4958
  forward,
@@ -4862,19 +4964,19 @@ function usePuckHistory({
4862
4964
 
4863
4965
  // lib/use-history-store.ts
4864
4966
  init_react_import();
4865
- var import_react32 = require("react");
4967
+ var import_react33 = require("react");
4866
4968
  var import_use_debounce3 = require("use-debounce");
4867
4969
  var EMPTY_HISTORY_INDEX = 0;
4868
4970
  function useHistoryStore(initialHistory) {
4869
4971
  var _a, _b;
4870
- const [histories, setHistories] = (0, import_react32.useState)(
4972
+ const [histories, setHistories] = (0, import_react33.useState)(
4871
4973
  (_a = initialHistory == null ? void 0 : initialHistory.histories) != null ? _a : []
4872
4974
  );
4873
4975
  const updateHistories = (histories2) => {
4874
4976
  setHistories(histories2);
4875
4977
  setIndex(histories2.length - 1);
4876
4978
  };
4877
- const [index, setIndex] = (0, import_react32.useState)(
4979
+ const [index, setIndex] = (0, import_react33.useState)(
4878
4980
  (_b = initialHistory == null ? void 0 : initialHistory.index) != null ? _b : EMPTY_HISTORY_INDEX
4879
4981
  );
4880
4982
  const hasPast = index > EMPTY_HISTORY_INDEX;
@@ -5034,22 +5136,22 @@ var getBox = function getBox2(el) {
5034
5136
  };
5035
5137
 
5036
5138
  // components/Puck/components/Canvas/index.tsx
5037
- var import_react34 = require("react");
5139
+ var import_react35 = require("react");
5038
5140
 
5039
5141
  // components/ViewportControls/index.tsx
5040
5142
  init_react_import();
5041
- var import_react33 = require("react");
5143
+ var import_react34 = require("react");
5042
5144
 
5043
5145
  // css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
5044
5146
  init_react_import();
5045
5147
  var styles_module_default20 = { "ViewportControls": "_ViewportControls_g1wgg_1", "ViewportControls-divider": "_ViewportControls-divider_g1wgg_15", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_g1wgg_21", "ViewportButton--isActive": "_ViewportButton--isActive_g1wgg_34", "ViewportButton-inner": "_ViewportButton-inner_g1wgg_34" };
5046
5148
 
5047
5149
  // components/ViewportControls/index.tsx
5048
- var import_jsx_runtime35 = require("react/jsx-runtime");
5150
+ var import_jsx_runtime36 = require("react/jsx-runtime");
5049
5151
  var icons = {
5050
- Smartphone: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Smartphone, { size: 16 }),
5051
- Tablet: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Tablet, { size: 16 }),
5052
- Monitor: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Monitor, { size: 16 })
5152
+ Smartphone: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Smartphone, { size: 16 }),
5153
+ Tablet: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Tablet, { size: 16 }),
5154
+ Monitor: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Monitor, { size: 16 })
5053
5155
  };
5054
5156
  var getClassName25 = get_class_name_factory_default("ViewportControls", styles_module_default20);
5055
5157
  var getClassNameButton = get_class_name_factory_default("ViewportButton", styles_module_default20);
@@ -5061,11 +5163,11 @@ var ViewportButton = ({
5061
5163
  onClick
5062
5164
  }) => {
5063
5165
  const { state } = useAppContext();
5064
- const [isActive, setIsActive] = (0, import_react33.useState)(false);
5065
- (0, import_react33.useEffect)(() => {
5166
+ const [isActive, setIsActive] = (0, import_react34.useState)(false);
5167
+ (0, import_react34.useEffect)(() => {
5066
5168
  setIsActive(width === state.ui.viewports.current.width);
5067
5169
  }, [width, state.ui.viewports.current.width]);
5068
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: getClassNameButton({ isActive }), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5170
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: getClassNameButton({ isActive }), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5069
5171
  IconButton,
5070
5172
  {
5071
5173
  title,
@@ -5074,7 +5176,7 @@ var ViewportButton = ({
5074
5176
  e.stopPropagation();
5075
5177
  onClick({ width, height });
5076
5178
  },
5077
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: getClassNameButton("inner"), children })
5179
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: getClassNameButton("inner"), children })
5078
5180
  }
5079
5181
  ) });
5080
5182
  };
@@ -5098,7 +5200,7 @@ var ViewportControls = ({
5098
5200
  const defaultsContainAutoZoom = defaultZoomOptions.find(
5099
5201
  (option) => option.value === autoZoom
5100
5202
  );
5101
- const zoomOptions = (0, import_react33.useMemo)(
5203
+ const zoomOptions = (0, import_react34.useMemo)(
5102
5204
  () => [
5103
5205
  ...defaultZoomOptions,
5104
5206
  ...defaultsContainAutoZoom ? [] : [
@@ -5110,8 +5212,8 @@ var ViewportControls = ({
5110
5212
  ].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
5111
5213
  [autoZoom]
5112
5214
  );
5113
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: getClassName25(), children: [
5114
- viewports.map((viewport, i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5215
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: getClassName25(), children: [
5216
+ viewports.map((viewport, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5115
5217
  ViewportButton,
5116
5218
  {
5117
5219
  height: viewport.height,
@@ -5122,8 +5224,8 @@ var ViewportControls = ({
5122
5224
  },
5123
5225
  i
5124
5226
  )),
5125
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getClassName25("divider") }),
5126
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5227
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getClassName25("divider") }),
5228
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5127
5229
  IconButton,
5128
5230
  {
5129
5231
  title: "Zoom viewport out",
@@ -5137,10 +5239,10 @@ var ViewportControls = ({
5137
5239
  )].value
5138
5240
  );
5139
5241
  },
5140
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ZoomOut, { size: 16 })
5242
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ZoomOut, { size: 16 })
5141
5243
  }
5142
5244
  ),
5143
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5245
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5144
5246
  IconButton,
5145
5247
  {
5146
5248
  title: "Zoom viewport in",
@@ -5154,11 +5256,11 @@ var ViewportControls = ({
5154
5256
  )].value
5155
5257
  );
5156
5258
  },
5157
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ZoomIn, { size: 16 })
5259
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ZoomIn, { size: 16 })
5158
5260
  }
5159
5261
  ),
5160
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getClassName25("divider") }),
5161
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5262
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getClassName25("divider") }),
5263
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5162
5264
  "select",
5163
5265
  {
5164
5266
  className: getClassName25("zoomSelect"),
@@ -5166,7 +5268,7 @@ var ViewportControls = ({
5166
5268
  onChange: (e) => {
5167
5269
  onZoom(parseFloat(e.currentTarget.value));
5168
5270
  },
5169
- children: zoomOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5271
+ children: zoomOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5170
5272
  "option",
5171
5273
  {
5172
5274
  value: option.value,
@@ -5181,7 +5283,7 @@ var ViewportControls = ({
5181
5283
 
5182
5284
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css#css-module
5183
5285
  init_react_import();
5184
- var styles_module_default21 = { "PuckCanvas": "_PuckCanvas_avf1c_1", "PuckCanvas-controls": "_PuckCanvas-controls_avf1c_16", "PuckCanvas-inner": "_PuckCanvas-inner_avf1c_21", "PuckCanvas-root": "_PuckCanvas-root_avf1c_32", "PuckCanvas--ready": "_PuckCanvas--ready_avf1c_57", "PuckCanvas-loader": "_PuckCanvas-loader_avf1c_62", "PuckCanvas--showLoader": "_PuckCanvas--showLoader_avf1c_72" };
5286
+ var styles_module_default21 = { "PuckCanvas": "_PuckCanvas_18jay_1", "PuckCanvas-controls": "_PuckCanvas-controls_18jay_16", "PuckCanvas-inner": "_PuckCanvas-inner_18jay_21", "PuckCanvas-root": "_PuckCanvas-root_18jay_30", "PuckCanvas--ready": "_PuckCanvas--ready_18jay_55", "PuckCanvas-loader": "_PuckCanvas-loader_18jay_60", "PuckCanvas--showLoader": "_PuckCanvas--showLoader_18jay_70" };
5185
5287
 
5186
5288
  // lib/get-zoom-config.ts
5187
5289
  init_react_import();
@@ -5214,24 +5316,24 @@ var getZoomConfig = (uiViewport, frame, zoom) => {
5214
5316
  };
5215
5317
 
5216
5318
  // components/Puck/components/Canvas/index.tsx
5217
- var import_jsx_runtime36 = require("react/jsx-runtime");
5319
+ var import_jsx_runtime37 = require("react/jsx-runtime");
5218
5320
  var getClassName26 = get_class_name_factory_default("PuckCanvas", styles_module_default21);
5219
5321
  var ZOOM_ON_CHANGE = true;
5220
5322
  var Canvas = () => {
5221
5323
  const { status, iframe } = useAppContext();
5222
5324
  const { dispatch, state, overrides, setUi, zoomConfig, setZoomConfig } = useAppContext();
5223
5325
  const { ui } = state;
5224
- const frameRef = (0, import_react34.useRef)(null);
5225
- const [showTransition, setShowTransition] = (0, import_react34.useState)(false);
5226
- const defaultRender = (0, import_react34.useMemo)(() => {
5227
- const PuckDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_jsx_runtime36.Fragment, { children });
5326
+ const frameRef = (0, import_react35.useRef)(null);
5327
+ const [showTransition, setShowTransition] = (0, import_react35.useState)(false);
5328
+ const defaultRender = (0, import_react35.useMemo)(() => {
5329
+ const PuckDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children });
5228
5330
  return PuckDefault;
5229
5331
  }, []);
5230
- const CustomPreview = (0, import_react34.useMemo)(
5332
+ const CustomPreview = (0, import_react35.useMemo)(
5231
5333
  () => overrides.preview || defaultRender,
5232
5334
  [overrides]
5233
5335
  );
5234
- const getFrameDimensions = (0, import_react34.useCallback)(() => {
5336
+ const getFrameDimensions = (0, import_react35.useCallback)(() => {
5235
5337
  if (frameRef.current) {
5236
5338
  const frame = frameRef.current;
5237
5339
  const box = getBox(frame);
@@ -5239,7 +5341,7 @@ var Canvas = () => {
5239
5341
  }
5240
5342
  return { width: 0, height: 0 };
5241
5343
  }, [frameRef]);
5242
- const resetAutoZoom = (0, import_react34.useCallback)(
5344
+ const resetAutoZoom = (0, import_react35.useCallback)(
5243
5345
  (ui2 = state.ui) => {
5244
5346
  if (frameRef.current) {
5245
5347
  setZoomConfig(
@@ -5249,11 +5351,11 @@ var Canvas = () => {
5249
5351
  },
5250
5352
  [frameRef, zoomConfig, state.ui]
5251
5353
  );
5252
- (0, import_react34.useEffect)(() => {
5354
+ (0, import_react35.useEffect)(() => {
5253
5355
  setShowTransition(false);
5254
5356
  resetAutoZoom();
5255
5357
  }, [frameRef, ui.leftSideBarVisible, ui.rightSideBarVisible]);
5256
- (0, import_react34.useEffect)(() => {
5358
+ (0, import_react35.useEffect)(() => {
5257
5359
  const { height: frameHeight } = getFrameDimensions();
5258
5360
  if (ui.viewports.current.height === "auto") {
5259
5361
  setZoomConfig(__spreadProps(__spreadValues({}, zoomConfig), {
@@ -5261,13 +5363,13 @@ var Canvas = () => {
5261
5363
  }));
5262
5364
  }
5263
5365
  }, [zoomConfig.zoom]);
5264
- (0, import_react34.useEffect)(() => {
5366
+ (0, import_react35.useEffect)(() => {
5265
5367
  if (ZOOM_ON_CHANGE) {
5266
5368
  setShowTransition(true);
5267
5369
  resetAutoZoom(ui);
5268
5370
  }
5269
5371
  }, [ui.viewports.current.width]);
5270
- (0, import_react34.useEffect)(() => {
5372
+ (0, import_react35.useEffect)(() => {
5271
5373
  const observer = new ResizeObserver(() => {
5272
5374
  setShowTransition(false);
5273
5375
  resetAutoZoom();
@@ -5279,13 +5381,13 @@ var Canvas = () => {
5279
5381
  observer.disconnect();
5280
5382
  };
5281
5383
  }, []);
5282
- const [showLoader, setShowLoader] = (0, import_react34.useState)(false);
5283
- (0, import_react34.useEffect)(() => {
5384
+ const [showLoader, setShowLoader] = (0, import_react35.useState)(false);
5385
+ (0, import_react35.useEffect)(() => {
5284
5386
  setTimeout(() => {
5285
5387
  setShowLoader(true);
5286
5388
  }, 500);
5287
5389
  }, []);
5288
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
5390
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
5289
5391
  "div",
5290
5392
  {
5291
5393
  className: getClassName26({
@@ -5298,7 +5400,7 @@ var Canvas = () => {
5298
5400
  recordHistory: true
5299
5401
  }),
5300
5402
  children: [
5301
- ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getClassName26("controls"), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5403
+ ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getClassName26("controls"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5302
5404
  ViewportControls,
5303
5405
  {
5304
5406
  autoZoom: zoomConfig.autoZoom,
@@ -5323,8 +5425,8 @@ var Canvas = () => {
5323
5425
  }
5324
5426
  }
5325
5427
  ) }),
5326
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: getClassName26("inner"), ref: frameRef, children: [
5327
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5428
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getClassName26("inner"), ref: frameRef, children: [
5429
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5328
5430
  "div",
5329
5431
  {
5330
5432
  className: getClassName26("root"),
@@ -5336,10 +5438,10 @@ var Canvas = () => {
5336
5438
  overflow: iframe.enabled ? void 0 : "auto"
5337
5439
  },
5338
5440
  suppressHydrationWarning: true,
5339
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Preview, {}) })
5441
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Preview, {}) })
5340
5442
  }
5341
5443
  ),
5342
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getClassName26("loader"), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Loader, { size: 24 }) })
5444
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getClassName26("loader"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Loader, { size: 24 }) })
5343
5445
  ] })
5344
5446
  ]
5345
5447
  }
@@ -5383,7 +5485,7 @@ var insertComponent = (componentType, zone, index, {
5383
5485
 
5384
5486
  // lib/use-loaded-overrides.ts
5385
5487
  init_react_import();
5386
- var import_react35 = require("react");
5488
+ var import_react36 = require("react");
5387
5489
 
5388
5490
  // lib/load-overrides.ts
5389
5491
  init_react_import();
@@ -5422,18 +5524,18 @@ var useLoadedOverrides = ({
5422
5524
  overrides,
5423
5525
  plugins
5424
5526
  }) => {
5425
- return (0, import_react35.useMemo)(() => {
5527
+ return (0, import_react36.useMemo)(() => {
5426
5528
  return loadOverrides({ overrides, plugins });
5427
5529
  }, [plugins, overrides]);
5428
5530
  };
5429
5531
 
5430
5532
  // components/DefaultOverride/index.tsx
5431
5533
  init_react_import();
5432
- var import_jsx_runtime37 = require("react/jsx-runtime");
5433
- var DefaultOverride = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children });
5534
+ var import_jsx_runtime38 = require("react/jsx-runtime");
5535
+ var DefaultOverride = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children });
5434
5536
 
5435
5537
  // components/Puck/index.tsx
5436
- var import_jsx_runtime38 = require("react/jsx-runtime");
5538
+ var import_jsx_runtime39 = require("react/jsx-runtime");
5437
5539
  var getClassName27 = get_class_name_factory_default("Puck", styles_module_default15);
5438
5540
  var getLayoutClassName = get_class_name_factory_default("PuckLayout", styles_module_default15);
5439
5541
  function Puck({
@@ -5456,13 +5558,13 @@ function Puck({
5456
5558
  dnd,
5457
5559
  initialHistory: _initialHistory
5458
5560
  }) {
5459
- var _a;
5561
+ var _a, _b;
5460
5562
  const iframe = __spreadValues({
5461
5563
  enabled: true,
5462
5564
  waitForStyles: true
5463
5565
  }, _iframe);
5464
- const [generatedAppState] = (0, import_react36.useState)(() => {
5465
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
5566
+ const [generatedAppState] = (0, import_react37.useState)(() => {
5567
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
5466
5568
  const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
5467
5569
  let clientUiState = {};
5468
5570
  if (typeof window !== "undefined") {
@@ -5482,7 +5584,7 @@ function Puck({
5482
5584
  clientUiState = __spreadProps(__spreadValues({}, clientUiState), {
5483
5585
  viewports: __spreadProps(__spreadValues({}, initial.viewports), {
5484
5586
  current: __spreadProps(__spreadValues({}, initial.viewports.current), {
5485
- height: ((_b = (_a2 = initialUi == null ? void 0 : initialUi.viewports) == null ? void 0 : _a2.current) == null ? void 0 : _b.height) || ((_c = viewports[closestViewport]) == null ? void 0 : _c.height) || "auto",
5587
+ height: ((_b2 = (_a2 = initialUi == null ? void 0 : initialUi.viewports) == null ? void 0 : _a2.current) == null ? void 0 : _b2.height) || ((_c = viewports[closestViewport]) == null ? void 0 : _c.height) || "auto",
5486
5588
  width: ((_e = (_d = initialUi == null ? void 0 : initialUi.viewports) == null ? void 0 : _d.current) == null ? void 0 : _e.width) || ((_f = viewports[closestViewport]) == null ? void 0 : _f.width)
5487
5589
  })
5488
5590
  })
@@ -5533,22 +5635,27 @@ function Puck({
5533
5635
  histories,
5534
5636
  index: initialHistoryIndex
5535
5637
  });
5536
- const [reducer] = (0, import_react36.useState)(
5638
+ const [reducer] = (0, import_react37.useState)(
5537
5639
  () => createReducer({
5538
5640
  config,
5539
5641
  record: historyStore.record,
5540
5642
  onAction
5541
5643
  })
5542
5644
  );
5543
- const [appState, dispatch] = (0, import_react36.useReducer)(
5645
+ const [appState, dispatch] = (0, import_react37.useReducer)(
5544
5646
  reducer,
5545
5647
  flushZones(initialAppState)
5546
5648
  );
5547
5649
  const { data, ui } = appState;
5548
- const history = usePuckHistory({ dispatch, initialAppState, historyStore });
5549
- const [menuOpen, setMenuOpen] = (0, import_react36.useState)(false);
5650
+ const history = usePuckHistory({
5651
+ dispatch,
5652
+ initialAppState,
5653
+ historyStore,
5654
+ iframeEnabled: (_a = _iframe == null ? void 0 : _iframe.enabled) != null ? _a : true
5655
+ });
5656
+ const [menuOpen, setMenuOpen] = (0, import_react37.useState)(false);
5550
5657
  const { itemSelector, leftSideBarVisible, rightSideBarVisible } = ui;
5551
- const setItemSelector = (0, import_react36.useCallback)(
5658
+ const setItemSelector = (0, import_react37.useCallback)(
5552
5659
  (newItemSelector) => {
5553
5660
  if (newItemSelector === itemSelector) return;
5554
5661
  dispatch({
@@ -5560,13 +5667,13 @@ function Puck({
5560
5667
  [itemSelector]
5561
5668
  );
5562
5669
  const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
5563
- (0, import_react36.useEffect)(() => {
5670
+ (0, import_react37.useEffect)(() => {
5564
5671
  if (onChange) onChange(data);
5565
5672
  }, [data]);
5566
5673
  const { onDragStartOrUpdate, placeholderStyle } = usePlaceholderStyle();
5567
- const [draggedItem, setDraggedItem] = (0, import_react36.useState)();
5674
+ const [draggedItem, setDraggedItem] = (0, import_react37.useState)();
5568
5675
  const rootProps = data.root.props || data.root;
5569
- const toggleSidebars = (0, import_react36.useCallback)(
5676
+ const toggleSidebars = (0, import_react37.useCallback)(
5570
5677
  (sidebar) => {
5571
5678
  const widerViewport = window.matchMedia("(min-width: 638px)").matches;
5572
5679
  const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
@@ -5580,7 +5687,7 @@ function Puck({
5580
5687
  },
5581
5688
  [dispatch, leftSideBarVisible, rightSideBarVisible]
5582
5689
  );
5583
- (0, import_react36.useEffect)(() => {
5690
+ (0, import_react37.useEffect)(() => {
5584
5691
  if (!window.matchMedia("(min-width: 638px)").matches) {
5585
5692
  dispatch({
5586
5693
  type: "setUi",
@@ -5603,28 +5710,28 @@ function Puck({
5603
5710
  window.removeEventListener("resize", handleResize);
5604
5711
  };
5605
5712
  }, []);
5606
- const defaultHeaderRender = (0, import_react36.useMemo)(() => {
5713
+ const defaultHeaderRender = (0, import_react37.useMemo)(() => {
5607
5714
  if (renderHeader) {
5608
5715
  console.warn(
5609
5716
  "`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
5610
5717
  );
5611
5718
  const RenderHeader = (_a2) => {
5612
- var _b = _a2, { actions } = _b, props = __objRest(_b, ["actions"]);
5719
+ var _b2 = _a2, { actions } = _b2, props = __objRest(_b2, ["actions"]);
5613
5720
  const Comp = renderHeader;
5614
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState, children: actions }));
5721
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState, children: actions }));
5615
5722
  };
5616
5723
  return RenderHeader;
5617
5724
  }
5618
5725
  return DefaultOverride;
5619
5726
  }, [renderHeader]);
5620
- const defaultHeaderActionsRender = (0, import_react36.useMemo)(() => {
5727
+ const defaultHeaderActionsRender = (0, import_react37.useMemo)(() => {
5621
5728
  if (renderHeaderActions) {
5622
5729
  console.warn(
5623
5730
  "`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
5624
5731
  );
5625
5732
  const RenderHeader = (props) => {
5626
5733
  const Comp = renderHeaderActions;
5627
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState }));
5734
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Comp, __spreadProps(__spreadValues({}, props), { dispatch, state: appState }));
5628
5735
  };
5629
5736
  return RenderHeader;
5630
5737
  }
@@ -5634,26 +5741,26 @@ function Puck({
5634
5741
  overrides,
5635
5742
  plugins
5636
5743
  });
5637
- const CustomPuck = (0, import_react36.useMemo)(
5744
+ const CustomPuck = (0, import_react37.useMemo)(
5638
5745
  () => loadedOverrides.puck || DefaultOverride,
5639
5746
  [loadedOverrides]
5640
5747
  );
5641
- const CustomHeader = (0, import_react36.useMemo)(
5748
+ const CustomHeader = (0, import_react37.useMemo)(
5642
5749
  () => loadedOverrides.header || defaultHeaderRender,
5643
5750
  [loadedOverrides]
5644
5751
  );
5645
- const CustomHeaderActions = (0, import_react36.useMemo)(
5752
+ const CustomHeaderActions = (0, import_react37.useMemo)(
5646
5753
  () => loadedOverrides.headerActions || defaultHeaderActionsRender,
5647
5754
  [loadedOverrides]
5648
5755
  );
5649
- const [mounted, setMounted] = (0, import_react36.useState)(false);
5650
- (0, import_react36.useEffect)(() => {
5756
+ const [mounted, setMounted] = (0, import_react37.useState)(false);
5757
+ (0, import_react37.useEffect)(() => {
5651
5758
  setMounted(true);
5652
5759
  }, []);
5653
5760
  const selectedComponentConfig = selectedItem && config.components[selectedItem.type];
5654
- const selectedComponentLabel = selectedItem ? (_a = selectedComponentConfig == null ? void 0 : selectedComponentConfig["label"]) != null ? _a : selectedItem.type.toString() : "";
5655
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: `Puck ${getClassName27()}`, children: [
5656
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5761
+ const selectedComponentLabel = selectedItem ? (_b = selectedComponentConfig == null ? void 0 : selectedComponentConfig["label"]) != null ? _b : selectedItem.type.toString() : "";
5762
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: `Puck ${getClassName27()}`, children: [
5763
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5657
5764
  AppProvider,
5658
5765
  {
5659
5766
  value: {
@@ -5675,7 +5782,7 @@ function Puck({
5675
5782
  getPermissions: () => ({}),
5676
5783
  refreshPermissions: () => null
5677
5784
  },
5678
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(appContext.Consumer, { children: ({ resolveData }) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5785
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(appContext.Consumer, { children: ({ resolveData }) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5679
5786
  DragDropContext,
5680
5787
  {
5681
5788
  autoScrollerOptions: { disabled: dnd == null ? void 0 : dnd.disableAutoScroll },
@@ -5727,7 +5834,7 @@ function Puck({
5727
5834
  });
5728
5835
  }
5729
5836
  },
5730
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5837
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5731
5838
  DropZoneProvider,
5732
5839
  {
5733
5840
  value: {
@@ -5741,7 +5848,7 @@ function Puck({
5741
5848
  mode: "edit",
5742
5849
  areaId: "root"
5743
5850
  },
5744
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5851
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5745
5852
  "div",
5746
5853
  {
5747
5854
  className: getLayoutClassName({
@@ -5750,58 +5857,58 @@ function Puck({
5750
5857
  mounted,
5751
5858
  rightSideBarVisible
5752
5859
  }),
5753
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("inner"), children: [
5754
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5860
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: getLayoutClassName("inner"), children: [
5861
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5755
5862
  CustomHeader,
5756
5863
  {
5757
- actions: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5864
+ actions: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5758
5865
  Button,
5759
5866
  {
5760
5867
  onClick: () => {
5761
5868
  onPublish && onPublish(data);
5762
5869
  },
5763
- icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Globe, { size: "14px" }),
5870
+ icon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Globe, { size: "14px" }),
5764
5871
  children: "Publish"
5765
5872
  }
5766
5873
  ) }) }),
5767
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("header", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("headerInner"), children: [
5768
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
5874
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("header", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: getLayoutClassName("headerInner"), children: [
5875
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
5769
5876
  "div",
5770
5877
  {
5771
5878
  className: getLayoutClassName("headerToggle"),
5772
5879
  children: [
5773
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5880
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5774
5881
  "div",
5775
5882
  {
5776
5883
  className: getLayoutClassName(
5777
5884
  "leftSideBarToggle"
5778
5885
  ),
5779
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5886
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5780
5887
  IconButton,
5781
5888
  {
5782
5889
  onClick: () => {
5783
5890
  toggleSidebars("left");
5784
5891
  },
5785
5892
  title: "Toggle left sidebar",
5786
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelLeft, { focusable: "false" })
5893
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PanelLeft, { focusable: "false" })
5787
5894
  }
5788
5895
  )
5789
5896
  }
5790
5897
  ),
5791
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5898
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5792
5899
  "div",
5793
5900
  {
5794
5901
  className: getLayoutClassName(
5795
5902
  "rightSideBarToggle"
5796
5903
  ),
5797
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5904
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5798
5905
  IconButton,
5799
5906
  {
5800
5907
  onClick: () => {
5801
5908
  toggleSidebars("right");
5802
5909
  },
5803
5910
  title: "Toggle right sidebar",
5804
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelRight, { focusable: "false" })
5911
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PanelRight, { focusable: "false" })
5805
5912
  }
5806
5913
  )
5807
5914
  }
@@ -5809,15 +5916,15 @@ function Puck({
5809
5916
  ]
5810
5917
  }
5811
5918
  ),
5812
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5919
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5813
5920
  "div",
5814
5921
  {
5815
5922
  className: getLayoutClassName("headerTitle"),
5816
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Heading, { rank: "2", size: "xs", children: [
5923
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Heading, { rank: "2", size: "xs", children: [
5817
5924
  headerTitle || rootProps.title || "Page",
5818
- headerPath && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
5925
+ headerPath && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
5819
5926
  " ",
5820
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5927
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5821
5928
  "code",
5822
5929
  {
5823
5930
  className: getLayoutClassName(
@@ -5830,41 +5937,41 @@ function Puck({
5830
5937
  ] })
5831
5938
  }
5832
5939
  ),
5833
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
5940
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
5834
5941
  "div",
5835
5942
  {
5836
5943
  className: getLayoutClassName("headerTools"),
5837
5944
  children: [
5838
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5945
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5839
5946
  "div",
5840
5947
  {
5841
5948
  className: getLayoutClassName("menuButton"),
5842
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5949
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5843
5950
  IconButton,
5844
5951
  {
5845
5952
  onClick: () => {
5846
5953
  return setMenuOpen(!menuOpen);
5847
5954
  },
5848
5955
  title: "Toggle menu bar",
5849
- children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronDown, { focusable: "false" })
5956
+ children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChevronDown, { focusable: "false" })
5850
5957
  }
5851
5958
  )
5852
5959
  }
5853
5960
  ),
5854
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5961
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5855
5962
  MenuBar,
5856
5963
  {
5857
5964
  appState,
5858
5965
  dispatch,
5859
5966
  onPublish,
5860
5967
  menuOpen,
5861
- renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5968
+ renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5862
5969
  Button,
5863
5970
  {
5864
5971
  onClick: () => {
5865
5972
  onPublish && onPublish(data);
5866
5973
  },
5867
- icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Globe, { size: "14px" }),
5974
+ icon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Globe, { size: "14px" }),
5868
5975
  children: "Publish"
5869
5976
  }
5870
5977
  ) }),
@@ -5877,19 +5984,19 @@ function Puck({
5877
5984
  ] }) })
5878
5985
  }
5879
5986
  ),
5880
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("leftSideBar"), children: [
5881
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Components, {}) }),
5882
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SidebarSection, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Outline, {}) })
5987
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: getLayoutClassName("leftSideBar"), children: [
5988
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Components, {}) }),
5989
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SidebarSection, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Outline, {}) })
5883
5990
  ] }),
5884
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Canvas, {}),
5885
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getLayoutClassName("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5991
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Canvas, {}),
5992
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: getLayoutClassName("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5886
5993
  SidebarSection,
5887
5994
  {
5888
5995
  noPadding: true,
5889
5996
  noBorderTop: true,
5890
5997
  showBreadcrumbs: true,
5891
5998
  title: selectedItem ? selectedComponentLabel : "Page",
5892
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Fields, {})
5999
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Fields, {})
5893
6000
  }
5894
6001
  ) })
5895
6002
  ] })
@@ -5901,7 +6008,7 @@ function Puck({
5901
6008
  ) })
5902
6009
  }
5903
6010
  ),
5904
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { id: "puck-portal-root", className: getClassName27("portal") })
6011
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { id: "puck-portal-root", className: getClassName27("portal") })
5905
6012
  ] });
5906
6013
  }
5907
6014
  Puck.Components = Components;
@@ -5911,7 +6018,7 @@ Puck.Preview = Preview;
5911
6018
 
5912
6019
  // components/Render/index.tsx
5913
6020
  init_react_import();
5914
- var import_jsx_runtime39 = require("react/jsx-runtime");
6021
+ var import_jsx_runtime40 = require("react/jsx-runtime");
5915
6022
  function Render({
5916
6023
  config,
5917
6024
  data
@@ -5924,7 +6031,7 @@ function Render({
5924
6031
  const rootProps = defaultedData.root.props || defaultedData.root;
5925
6032
  const title = (rootProps == null ? void 0 : rootProps.title) || "";
5926
6033
  if ((_a = config.root) == null ? void 0 : _a.render) {
5927
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6034
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
5928
6035
  config.root.render,
5929
6036
  __spreadProps(__spreadValues({}, rootProps), {
5930
6037
  puck: {
@@ -5934,11 +6041,11 @@ function Render({
5934
6041
  title,
5935
6042
  editMode: false,
5936
6043
  id: "puck-root",
5937
- children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZone, { zone: rootDroppableId })
6044
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DropZone, { zone: rootDroppableId })
5938
6045
  })
5939
6046
  ) });
5940
6047
  }
5941
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZone, { zone: rootDroppableId }) });
6048
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DropZone, { zone: rootDroppableId }) });
5942
6049
  }
5943
6050
 
5944
6051
  // lib/migrate.ts