@measured/puck-plugin-heading-analyzer 0.16.0-canary.abe8c52 → 0.16.0-canary.cad95b8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -51483,7 +51483,7 @@ var require_dist = __commonJS({
51483
51483
  var HostPortal = 4;
51484
51484
  var HostComponent = 5;
51485
51485
  var HostText = 6;
51486
- var Fragment19 = 7;
51486
+ var Fragment20 = 7;
51487
51487
  var Mode = 8;
51488
51488
  var ContextConsumer = 9;
51489
51489
  var ContextProvider = 10;
@@ -52639,7 +52639,7 @@ var require_dist = __commonJS({
52639
52639
  return "DehydratedFragment";
52640
52640
  case ForwardRef:
52641
52641
  return getWrappedName$1(type, type.render, "ForwardRef");
52642
- case Fragment19:
52642
+ case Fragment20:
52643
52643
  return "Fragment";
52644
52644
  case HostComponent:
52645
52645
  return type;
@@ -62290,7 +62290,7 @@ var require_dist = __commonJS({
62290
62290
  }
62291
62291
  }
62292
62292
  function updateFragment2(returnFiber, current2, fragment, lanes, key) {
62293
- if (current2 === null || current2.tag !== Fragment19) {
62293
+ if (current2 === null || current2.tag !== Fragment20) {
62294
62294
  var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
62295
62295
  created.return = returnFiber;
62296
62296
  return created;
@@ -62693,7 +62693,7 @@ var require_dist = __commonJS({
62693
62693
  if (child.key === key) {
62694
62694
  var elementType = element.type;
62695
62695
  if (elementType === REACT_FRAGMENT_TYPE) {
62696
- if (child.tag === Fragment19) {
62696
+ if (child.tag === Fragment20) {
62697
62697
  deleteRemainingChildren(returnFiber, child.sibling);
62698
62698
  var existing = useFiber(child, element.props.children);
62699
62699
  existing.return = returnFiber;
@@ -66868,7 +66868,7 @@ var require_dist = __commonJS({
66868
66868
  var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
66869
66869
  return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
66870
66870
  }
66871
- case Fragment19:
66871
+ case Fragment20:
66872
66872
  return updateFragment(current2, workInProgress2, renderLanes2);
66873
66873
  case Mode:
66874
66874
  return updateMode(current2, workInProgress2, renderLanes2);
@@ -67140,7 +67140,7 @@ var require_dist = __commonJS({
67140
67140
  case SimpleMemoComponent:
67141
67141
  case FunctionComponent:
67142
67142
  case ForwardRef:
67143
- case Fragment19:
67143
+ case Fragment20:
67144
67144
  case Mode:
67145
67145
  case Profiler:
67146
67146
  case ContextConsumer:
@@ -71391,7 +71391,7 @@ var require_dist = __commonJS({
71391
71391
  return fiber;
71392
71392
  }
71393
71393
  function createFiberFromFragment(elements, mode, lanes, key) {
71394
- var fiber = createFiber(Fragment19, elements, key, mode);
71394
+ var fiber = createFiber(Fragment20, elements, key, mode);
71395
71395
  fiber.lanes = lanes;
71396
71396
  return fiber;
71397
71397
  }
@@ -72510,6 +72510,8 @@ var require_dist = __commonJS({
72510
72510
  });
72511
72511
  var core_exports = {};
72512
72512
  __export2(core_exports, {
72513
+ Action: () => Action,
72514
+ ActionBar: () => ActionBar,
72513
72515
  AutoField: () => AutoField,
72514
72516
  AutoFieldPrivate: () => AutoFieldPrivate,
72515
72517
  Button: () => Button,
@@ -72564,12 +72566,30 @@ var require_dist = __commonJS({
72564
72566
  };
72565
72567
  var get_class_name_factory_default2 = getClassNameFactory2;
72566
72568
  init_react_import2();
72567
- var styles_module_default5 = { "Input": "_Input_3pq3z_1", "Input-label": "_Input-label_3pq3z_26", "Input-labelIcon": "_Input-labelIcon_3pq3z_35", "Input-disabledIcon": "_Input-disabledIcon_3pq3z_42", "Input-input": "_Input-input_3pq3z_47", "Input--readOnly": "_Input--readOnly_3pq3z_91", "Input-radioGroupItems": "_Input-radioGroupItems_3pq3z_102", "Input-radio": "_Input-radio_3pq3z_102", "Input-radioInner": "_Input-radioInner_3pq3z_119", "Input-radioInput": "_Input-radioInput_3pq3z_164" };
72569
+ var styles_module_default5 = { "ActionBarComponent": "_ActionBarComponent_8nyey_1", "ActionBarComponent-actionsLabel": "_ActionBarComponent-actionsLabel_8nyey_15", "ActionBarComponent-action": "_ActionBarComponent-action_8nyey_15" };
72570
+ var import_jsx_runtime9 = require("react/jsx-runtime");
72571
+ var getClassName6 = get_class_name_factory_default2("ActionBarComponent", styles_module_default5);
72572
+ var ActionBar = ({
72573
+ label,
72574
+ children
72575
+ }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: getClassName6(), children: [
72576
+ label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassName6("actionsLabel"), children: label }),
72577
+ children
72578
+ ] });
72579
+ var Action = ({
72580
+ children,
72581
+ label,
72582
+ onClick
72583
+ }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { className: getClassName6("action"), onClick, title: label, children });
72584
+ ActionBar.Action = Action;
72585
+ init_react_import2();
72586
+ init_react_import2();
72587
+ var styles_module_default22 = { "Input": "_Input_3pq3z_1", "Input-label": "_Input-label_3pq3z_26", "Input-labelIcon": "_Input-labelIcon_3pq3z_35", "Input-disabledIcon": "_Input-disabledIcon_3pq3z_42", "Input-input": "_Input-input_3pq3z_47", "Input--readOnly": "_Input--readOnly_3pq3z_91", "Input-radioGroupItems": "_Input-radioGroupItems_3pq3z_102", "Input-radio": "_Input-radio_3pq3z_102", "Input-radioInner": "_Input-radioInner_3pq3z_119", "Input-radioInput": "_Input-radioInput_3pq3z_164" };
72568
72588
  var import_react112 = require("react");
72569
72589
  init_react_import2();
72570
72590
  init_react_import2();
72571
72591
  init_react_import2();
72572
- var styles_module_default22 = { "ArrayField": "_ArrayField_1go19_5", "ArrayField--isDraggingFrom": "_ArrayField--isDraggingFrom_1go19_13", "ArrayField-addButton": "_ArrayField-addButton_1go19_18", "ArrayField--hasItems": "_ArrayField--hasItems_1go19_33", "ArrayFieldItem": "_ArrayFieldItem_1go19_63", "ArrayFieldItem--isDragging": "_ArrayFieldItem--isDragging_1go19_71", "ArrayFieldItem--isExpanded": "_ArrayFieldItem--isExpanded_1go19_81", "ArrayFieldItem-summary": "_ArrayFieldItem-summary_1go19_97", "ArrayField--addDisabled": "_ArrayField--addDisabled_1go19_128", "ArrayFieldItem-body": "_ArrayFieldItem-body_1go19_164", "ArrayFieldItem-fieldset": "_ArrayFieldItem-fieldset_1go19_173", "ArrayFieldItem-rhs": "_ArrayFieldItem-rhs_1go19_181", "ArrayFieldItem-actions": "_ArrayFieldItem-actions_1go19_187" };
72592
+ var styles_module_default32 = { "ArrayField": "_ArrayField_1go19_5", "ArrayField--isDraggingFrom": "_ArrayField--isDraggingFrom_1go19_13", "ArrayField-addButton": "_ArrayField-addButton_1go19_18", "ArrayField--hasItems": "_ArrayField--hasItems_1go19_33", "ArrayFieldItem": "_ArrayFieldItem_1go19_63", "ArrayFieldItem--isDragging": "_ArrayFieldItem--isDragging_1go19_71", "ArrayFieldItem--isExpanded": "_ArrayFieldItem--isExpanded_1go19_81", "ArrayFieldItem-summary": "_ArrayFieldItem-summary_1go19_97", "ArrayField--addDisabled": "_ArrayField--addDisabled_1go19_128", "ArrayFieldItem-body": "_ArrayFieldItem-body_1go19_164", "ArrayFieldItem-fieldset": "_ArrayFieldItem-fieldset_1go19_173", "ArrayFieldItem-rhs": "_ArrayFieldItem-rhs_1go19_181", "ArrayFieldItem-actions": "_ArrayFieldItem-actions_1go19_187" };
72573
72593
  init_react_import2();
72574
72594
  init_react_import2();
72575
72595
  var import_react22 = require("react");
@@ -72799,9 +72819,9 @@ var require_dist = __commonJS({
72799
72819
  return result;
72800
72820
  };
72801
72821
  init_react_import2();
72802
- var styles_module_default32 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
72803
- var import_jsx_runtime9 = require("react/jsx-runtime");
72804
- var getClassName6 = get_class_name_factory_default2("Loader", styles_module_default32);
72822
+ var styles_module_default42 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
72823
+ var import_jsx_runtime22 = require("react/jsx-runtime");
72824
+ var getClassName22 = get_class_name_factory_default2("Loader", styles_module_default42);
72805
72825
  var Loader2 = (_a3) => {
72806
72826
  var _b2 = _a3, {
72807
72827
  color,
@@ -72810,10 +72830,10 @@ var require_dist = __commonJS({
72810
72830
  "color",
72811
72831
  "size"
72812
72832
  ]);
72813
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
72833
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
72814
72834
  "span",
72815
72835
  __spreadValues2({
72816
- className: getClassName6(),
72836
+ className: getClassName22(),
72817
72837
  style: {
72818
72838
  width: size,
72819
72839
  height: size,
@@ -72823,8 +72843,8 @@ var require_dist = __commonJS({
72823
72843
  }, props)
72824
72844
  );
72825
72845
  };
72826
- var import_jsx_runtime22 = require("react/jsx-runtime");
72827
- var getClassName22 = get_class_name_factory_default2("IconButton", IconButton_module_default);
72846
+ var import_jsx_runtime32 = require("react/jsx-runtime");
72847
+ var getClassName32 = get_class_name_factory_default2("IconButton", IconButton_module_default);
72828
72848
  var IconButton = ({
72829
72849
  children,
72830
72850
  href,
@@ -72839,10 +72859,10 @@ var require_dist = __commonJS({
72839
72859
  }) => {
72840
72860
  const [loading, setLoading] = (0, import_react32.useState)(false);
72841
72861
  const ElementType = href ? "a" : "button";
72842
- const el = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
72862
+ const el = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
72843
72863
  ElementType,
72844
72864
  {
72845
- className: getClassName22({
72865
+ className: getClassName32({
72846
72866
  primary: variant === "primary",
72847
72867
  secondary: variant === "secondary",
72848
72868
  disabled,
@@ -72863,11 +72883,11 @@ var require_dist = __commonJS({
72863
72883
  href,
72864
72884
  title,
72865
72885
  children: [
72866
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: getClassName22("title"), children: title }),
72886
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: getClassName32("title"), children: title }),
72867
72887
  children,
72868
- loading && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
72888
+ loading && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
72869
72889
  "\xA0\xA0",
72870
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Loader2, { size: 14 })
72890
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Loader2, { size: 14 })
72871
72891
  ] })
72872
72892
  ]
72873
72893
  }
@@ -72906,7 +72926,7 @@ var require_dist = __commonJS({
72906
72926
  { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
72907
72927
  ];
72908
72928
  var import_ua_parser_js2 = require_ua_parser();
72909
- var import_jsx_runtime32 = require("react/jsx-runtime");
72929
+ var import_jsx_runtime42 = require("react/jsx-runtime");
72910
72930
  var defaultAppState2 = {
72911
72931
  data: { content: [], root: { props: {} } },
72912
72932
  ui: {
@@ -72946,7 +72966,8 @@ var require_dist = __commonJS({
72946
72966
  status: "LOADING",
72947
72967
  setStatus: () => null,
72948
72968
  iframe: {},
72949
- safariFallbackMode: false
72969
+ safariFallbackMode: false,
72970
+ globalPermissions: {}
72950
72971
  };
72951
72972
  var appContext2 = (0, import_react42.createContext)(defaultContext2);
72952
72973
  var AppProvider = ({
@@ -72976,7 +72997,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
72976
72997
  setSafariFallbackMode(true);
72977
72998
  }
72978
72999
  }, []);
72979
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
73000
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
72980
73001
  appContext2.Provider,
72981
73002
  {
72982
73003
  value: __spreadProps2(__spreadValues2({}, value), {
@@ -73005,7 +73026,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73005
73026
  }
73006
73027
  });
73007
73028
  }
73008
- var import_jsx_runtime42 = require("react/jsx-runtime");
73029
+ var import_jsx_runtime52 = require("react/jsx-runtime");
73009
73030
  var defaultProvided = {
73010
73031
  droppableProps: {
73011
73032
  "data-rfd-droppable-context-id": "",
@@ -73020,15 +73041,15 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73020
73041
  draggingFromThisWith: null,
73021
73042
  isUsingPlaceholder: false
73022
73043
  };
73023
- var DefaultDroppable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children: children(defaultProvided, defaultSnapshot) });
73044
+ var DefaultDroppable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: children(defaultProvided, defaultSnapshot) });
73024
73045
  var Droppable2 = (props) => {
73025
73046
  const { status } = useAppContext2();
73026
73047
  const El = status !== "LOADING" ? import_dnd.Droppable : DefaultDroppable;
73027
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(El, __spreadValues2({}, props));
73048
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(El, __spreadValues2({}, props));
73028
73049
  };
73029
73050
  init_react_import2();
73030
73051
  var import_dnd2 = (init_dnd_esm(), __toCommonJS(dnd_esm_exports));
73031
- var import_jsx_runtime52 = require("react/jsx-runtime");
73052
+ var import_jsx_runtime62 = require("react/jsx-runtime");
73032
73053
  var defaultProvided2 = {
73033
73054
  draggableProps: {
73034
73055
  "data-rfd-draggable-context-id": "",
@@ -73052,7 +73073,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73052
73073
  type: "",
73053
73074
  source: { droppableId: "", index: 0 }
73054
73075
  };
73055
- var DefaultDraggable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: children(defaultProvided2, defaultSnapshot2, defaultRubric) });
73076
+ var DefaultDraggable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_jsx_runtime62.Fragment, { children: children(defaultProvided2, defaultSnapshot2, defaultRubric) });
73056
73077
  var Draggable2 = ({
73057
73078
  className,
73058
73079
  children,
@@ -73064,22 +73085,23 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73064
73085
  }) => {
73065
73086
  const { status } = useAppContext2();
73066
73087
  const El = status !== "LOADING" ? import_dnd2.Draggable : DefaultDraggable;
73067
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(El, { draggableId: id, index, isDragDisabled, children: (provided, snapshot) => {
73088
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(El, { draggableId: id, index, isDragDisabled, children: (provided, snapshot) => {
73068
73089
  var _a3;
73069
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
73070
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
73090
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
73091
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
73071
73092
  "div",
73072
73093
  __spreadProps2(__spreadValues2(__spreadValues2({
73073
73094
  className: className && className(provided, snapshot),
73074
73095
  ref: provided.innerRef
73075
73096
  }, provided.draggableProps), provided.dragHandleProps), {
73076
73097
  style: __spreadProps2(__spreadValues2({}, provided.draggableProps.style), {
73077
- transform: snapshot.isDragging || !disableAnimations ? (_a3 = provided.draggableProps.style) == null ? void 0 : _a3.transform : "translate(0px, 0px)"
73098
+ transform: snapshot.isDragging || !disableAnimations ? (_a3 = provided.draggableProps.style) == null ? void 0 : _a3.transform : "translate(0px, 0px)",
73099
+ cursor: isDragDisabled ? "no-drop" : "grab"
73078
73100
  }),
73079
73101
  children: children(provided, snapshot)
73080
73102
  })
73081
73103
  ),
73082
- showShadow && snapshot.isDragging && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
73104
+ showShadow && snapshot.isDragging && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
73083
73105
  "div",
73084
73106
  {
73085
73107
  className: className && className(provided, snapshot),
@@ -73093,22 +73115,22 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73093
73115
  var import_react52 = require("react");
73094
73116
  init_react_import2();
73095
73117
  init_react_import2();
73096
- var styles_module_default42 = { "DragIcon": "_DragIcon_1p5wn_1" };
73097
- var import_jsx_runtime62 = require("react/jsx-runtime");
73098
- var getClassName32 = get_class_name_factory_default2("DragIcon", styles_module_default42);
73099
- var DragIcon = () => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: getClassName32(), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("svg", { viewBox: "0 0 20 20", width: "12", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime62.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" }) }) });
73118
+ var styles_module_default52 = { "DragIcon": "_DragIcon_17p8x_1", "DragIcon--disabled": "_DragIcon--disabled_17p8x_8" };
73119
+ var import_jsx_runtime72 = require("react/jsx-runtime");
73120
+ var getClassName42 = get_class_name_factory_default2("DragIcon", styles_module_default52);
73121
+ var DragIcon = ({ isDragDisabled }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: getClassName42({ disabled: isDragDisabled }), children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("svg", { viewBox: "0 0 20 20", width: "12", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime72.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" }) }) });
73100
73122
  init_react_import2();
73101
73123
  var import_dnd3 = (init_dnd_esm(), __toCommonJS(dnd_esm_exports));
73102
- var import_jsx_runtime72 = require("react/jsx-runtime");
73103
- var DefaultDragDropContext = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_jsx_runtime72.Fragment, { children });
73124
+ var import_jsx_runtime82 = require("react/jsx-runtime");
73125
+ var DefaultDragDropContext = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_jsx_runtime82.Fragment, { children });
73104
73126
  var DragDropContext2 = (props) => {
73105
73127
  const { status } = useAppContext2();
73106
73128
  const El = status !== "LOADING" ? import_dnd3.DragDropContext : DefaultDragDropContext;
73107
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(El, __spreadValues2({}, props));
73129
+ return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(El, __spreadValues2({}, props));
73108
73130
  };
73109
- var import_jsx_runtime82 = require("react/jsx-runtime");
73110
- var getClassName42 = get_class_name_factory_default2("ArrayField", styles_module_default22);
73111
- var getClassNameItem3 = get_class_name_factory_default2("ArrayFieldItem", styles_module_default22);
73131
+ var import_jsx_runtime92 = require("react/jsx-runtime");
73132
+ var getClassName52 = get_class_name_factory_default2("ArrayField", styles_module_default32);
73133
+ var getClassNameItem3 = get_class_name_factory_default2("ArrayFieldItem", styles_module_default32);
73112
73134
  var ArrayField = ({
73113
73135
  field,
73114
73136
  onChange,
@@ -73117,7 +73139,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73117
73139
  label,
73118
73140
  readOnly,
73119
73141
  id,
73120
- Label = (props) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", __spreadValues2({}, props))
73142
+ Label = (props) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", __spreadValues2({}, props))
73121
73143
  }) => {
73122
73144
  const { state, setUi, selectedItem } = useAppContext2();
73123
73145
  const readOnlyFields = (selectedItem == null ? void 0 : selectedItem.readOnly) || {};
@@ -73180,14 +73202,14 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73180
73202
  return null;
73181
73203
  }
73182
73204
  const addDisabled = field.max !== void 0 && localState.arrayState.items.length >= field.max || readOnly;
73183
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
73205
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
73184
73206
  Label,
73185
73207
  {
73186
73208
  label: label || name,
73187
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(List, { size: 16 }),
73209
+ icon: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(List, { size: 16 }),
73188
73210
  el: "div",
73189
73211
  readOnly,
73190
- children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
73212
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
73191
73213
  DragDropContext2,
73192
73214
  {
73193
73215
  onDragEnd: (event) => {
@@ -73214,12 +73236,12 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73214
73236
  });
73215
73237
  }
73216
73238
  },
73217
- children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Droppable2, { droppableId: "array", isDropDisabled: readOnly, children: (provided, snapshot) => {
73218
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
73239
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Droppable2, { droppableId: "array", isDropDisabled: readOnly, children: (provided, snapshot) => {
73240
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
73219
73241
  "div",
73220
73242
  __spreadProps2(__spreadValues2({}, provided.droppableProps), {
73221
73243
  ref: provided.innerRef,
73222
- className: getClassName42({
73244
+ className: getClassName52({
73223
73245
  isDraggingFrom: !!snapshot.draggingFromThisWith,
73224
73246
  hasItems: Array.isArray(value) && value.length > 0,
73225
73247
  addDisabled
@@ -73236,7 +73258,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73236
73258
  localState.arrayState.items.map((item, i2) => {
73237
73259
  const { _arrayId = `${id}-${i2}`, _originalIndex = i2 } = item;
73238
73260
  const data = Array.from(localState.value || [])[i2] || {};
73239
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
73261
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
73240
73262
  Draggable2,
73241
73263
  {
73242
73264
  id: _arrayId,
@@ -73247,8 +73269,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73247
73269
  readOnly
73248
73270
  }),
73249
73271
  isDragDisabled: readOnly || !hovering,
73250
- children: () => /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
73251
- /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
73272
+ children: () => /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
73273
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
73252
73274
  "div",
73253
73275
  {
73254
73276
  onClick: () => {
@@ -73269,8 +73291,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73269
73291
  className: getClassNameItem3("summary"),
73270
73292
  children: [
73271
73293
  field.getItemSummary ? field.getItemSummary(data, i2) : `Item #${_originalIndex}`,
73272
- /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: getClassNameItem3("rhs"), children: [
73273
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: getClassNameItem3("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: getClassNameItem3("action"), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
73294
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: getClassNameItem3("rhs"), children: [
73295
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getClassNameItem3("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getClassNameItem3("action"), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
73274
73296
  IconButton,
73275
73297
  {
73276
73298
  type: "button",
@@ -73293,20 +73315,20 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73293
73315
  );
73294
73316
  },
73295
73317
  title: "Delete",
73296
- children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Trash, { size: 16 })
73318
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Trash, { size: 16 })
73297
73319
  }
73298
73320
  ) }) }),
73299
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(DragIcon, {}) })
73321
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(DragIcon, {}) })
73300
73322
  ] })
73301
73323
  ]
73302
73324
  }
73303
73325
  ),
73304
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: getClassNameItem3("body"), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("fieldset", { className: getClassNameItem3("fieldset"), children: Object.keys(field.arrayFields).map(
73326
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getClassNameItem3("body"), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("fieldset", { className: getClassNameItem3("fieldset"), children: Object.keys(field.arrayFields).map(
73305
73327
  (fieldName) => {
73306
73328
  const subField = field.arrayFields[fieldName];
73307
73329
  const subFieldName = `${name}[${i2}].${fieldName}`;
73308
73330
  const wildcardFieldName = `${name}[*].${fieldName}`;
73309
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
73331
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
73310
73332
  AutoFieldPrivate,
73311
73333
  {
73312
73334
  name: subFieldName,
@@ -73334,11 +73356,11 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73334
73356
  );
73335
73357
  }),
73336
73358
  provided.placeholder,
73337
- !addDisabled && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
73359
+ !addDisabled && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
73338
73360
  "button",
73339
73361
  {
73340
73362
  type: "button",
73341
- className: getClassName42("addButton"),
73363
+ className: getClassName52("addButton"),
73342
73364
  onClick: () => {
73343
73365
  const existingValue = value || [];
73344
73366
  const newValue = [
@@ -73348,7 +73370,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73348
73370
  const newArrayState = regenerateArrayState(newValue);
73349
73371
  onChange(newValue, mapArrayStateToUi(newArrayState));
73350
73372
  },
73351
- children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Plus, { size: 21 })
73373
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Plus, { size: 21 })
73352
73374
  }
73353
73375
  )
73354
73376
  ]
@@ -73361,8 +73383,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73361
73383
  );
73362
73384
  };
73363
73385
  init_react_import2();
73364
- var import_jsx_runtime92 = require("react/jsx-runtime");
73365
- var getClassName52 = get_class_name_factory_default2("Input", styles_module_default5);
73386
+ var import_jsx_runtime10 = require("react/jsx-runtime");
73387
+ var getClassName62 = get_class_name_factory_default2("Input", styles_module_default22);
73366
73388
  var DefaultField = ({
73367
73389
  field,
73368
73390
  onChange,
@@ -73373,19 +73395,19 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73373
73395
  Label,
73374
73396
  id
73375
73397
  }) => {
73376
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
73398
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
73377
73399
  Label,
73378
73400
  {
73379
73401
  label: label || name,
73380
- icon: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
73381
- field.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Type, { size: 16 }),
73382
- field.type === "number" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Hash, { size: 16 })
73402
+ icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
73403
+ field.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Type, { size: 16 }),
73404
+ field.type === "number" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Hash, { size: 16 })
73383
73405
  ] }),
73384
73406
  readOnly,
73385
- children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
73407
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
73386
73408
  "input",
73387
73409
  {
73388
- className: getClassName52("input"),
73410
+ className: getClassName62("input"),
73389
73411
  autoComplete: "off",
73390
73412
  type: field.type,
73391
73413
  name,
@@ -73412,14 +73434,14 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73412
73434
  init_react_import2();
73413
73435
  var import_react82 = require("react");
73414
73436
  init_react_import2();
73415
- var styles_module_default52 = { "ExternalInput-actions": "_ExternalInput-actions_19obq_1", "ExternalInput-button": "_ExternalInput-button_19obq_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_19obq_25", "ExternalInput-detachButton": "_ExternalInput-detachButton_19obq_32", "ExternalInputModal": "_ExternalInputModal_19obq_74", "ExternalInputModal-grid": "_ExternalInputModal-grid_19obq_84", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_19obq_95", "ExternalInputModal-filters": "_ExternalInputModal-filters_19obq_100", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_19obq_119", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_19obq_128", "ExternalInputModal-table": "_ExternalInputModal-table_19obq_128", "ExternalInputModal-thead": "_ExternalInputModal-thead_19obq_144", "ExternalInputModal-th": "_ExternalInputModal-th_19obq_144", "ExternalInputModal-td": "_ExternalInputModal-td_19obq_159", "ExternalInputModal-tr": "_ExternalInputModal-tr_19obq_164", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_19obq_171", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_19obq_197", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_19obq_201", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_19obq_218", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_19obq_222", "ExternalInputModal-search": "_ExternalInputModal-search_19obq_222", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_19obq_259", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_19obq_284", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_19obq_294", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_19obq_308", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_19obq_321", "ExternalInputModal-footer": "_ExternalInputModal-footer_19obq_325" };
73437
+ var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_19obq_1", "ExternalInput-button": "_ExternalInput-button_19obq_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_19obq_25", "ExternalInput-detachButton": "_ExternalInput-detachButton_19obq_32", "ExternalInputModal": "_ExternalInputModal_19obq_74", "ExternalInputModal-grid": "_ExternalInputModal-grid_19obq_84", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_19obq_95", "ExternalInputModal-filters": "_ExternalInputModal-filters_19obq_100", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_19obq_119", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_19obq_128", "ExternalInputModal-table": "_ExternalInputModal-table_19obq_128", "ExternalInputModal-thead": "_ExternalInputModal-thead_19obq_144", "ExternalInputModal-th": "_ExternalInputModal-th_19obq_144", "ExternalInputModal-td": "_ExternalInputModal-td_19obq_159", "ExternalInputModal-tr": "_ExternalInputModal-tr_19obq_164", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_19obq_171", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_19obq_197", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_19obq_201", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_19obq_218", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_19obq_222", "ExternalInputModal-search": "_ExternalInputModal-search_19obq_222", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_19obq_259", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_19obq_284", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_19obq_294", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_19obq_308", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_19obq_321", "ExternalInputModal-footer": "_ExternalInputModal-footer_19obq_325" };
73416
73438
  init_react_import2();
73417
73439
  var import_react62 = require("react");
73418
73440
  init_react_import2();
73419
- var styles_module_default6 = { "Modal": "_Modal_ikbaj_1", "Modal--isOpen": "_Modal--isOpen_ikbaj_15", "Modal-inner": "_Modal-inner_ikbaj_19" };
73441
+ var styles_module_default7 = { "Modal": "_Modal_ikbaj_1", "Modal--isOpen": "_Modal--isOpen_ikbaj_15", "Modal-inner": "_Modal-inner_ikbaj_19" };
73420
73442
  var import_react_dom3 = __toESM2(require_react_dom2());
73421
- var import_jsx_runtime10 = require("react/jsx-runtime");
73422
- var getClassName62 = get_class_name_factory_default2("Modal", styles_module_default6);
73443
+ var import_jsx_runtime11 = require("react/jsx-runtime");
73444
+ var getClassName7 = get_class_name_factory_default2("Modal", styles_module_default7);
73423
73445
  var Modal = ({
73424
73446
  children,
73425
73447
  onClose,
@@ -73430,13 +73452,13 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73430
73452
  setRootEl(document.getElementById("puck-portal-root"));
73431
73453
  }, []);
73432
73454
  if (!rootEl) {
73433
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {});
73455
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", {});
73434
73456
  }
73435
73457
  return (0, import_react_dom3.createPortal)(
73436
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: getClassName62({ isOpen }), onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
73458
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: getClassName7({ isOpen }), onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
73437
73459
  "div",
73438
73460
  {
73439
- className: getClassName62("inner"),
73461
+ className: getClassName7("inner"),
73440
73462
  onClick: (e2) => e2.stopPropagation(),
73441
73463
  children
73442
73464
  }
@@ -73446,15 +73468,15 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73446
73468
  };
73447
73469
  init_react_import2();
73448
73470
  init_react_import2();
73449
- var styles_module_default7 = { "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" };
73450
- var import_jsx_runtime11 = require("react/jsx-runtime");
73451
- var getClassName7 = get_class_name_factory_default2("Heading", styles_module_default7);
73471
+ 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" };
73472
+ var import_jsx_runtime12 = require("react/jsx-runtime");
73473
+ var getClassName8 = get_class_name_factory_default2("Heading", styles_module_default8);
73452
73474
  var Heading2 = ({ children, rank, size = "m" }) => {
73453
73475
  const Tag = rank ? `h${rank}` : "span";
73454
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
73476
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
73455
73477
  Tag,
73456
73478
  {
73457
- className: getClassName7({
73479
+ className: getClassName8({
73458
73480
  [size]: true
73459
73481
  }),
73460
73482
  children
@@ -73466,8 +73488,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73466
73488
  var import_react72 = require("react");
73467
73489
  init_react_import2();
73468
73490
  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" };
73469
- var import_jsx_runtime12 = require("react/jsx-runtime");
73470
- var getClassName8 = get_class_name_factory_default2("Button", Button_module_default);
73491
+ var import_jsx_runtime13 = require("react/jsx-runtime");
73492
+ var getClassName9 = get_class_name_factory_default2("Button", Button_module_default);
73471
73493
  var Button = ({
73472
73494
  children,
73473
73495
  href,
@@ -73485,10 +73507,10 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73485
73507
  const [loading, setLoading] = (0, import_react72.useState)(loadingProp);
73486
73508
  (0, import_react72.useEffect)(() => setLoading(loadingProp), [loadingProp]);
73487
73509
  const ElementType = href ? "a" : type ? "button" : "span";
73488
- const el = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
73510
+ const el = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
73489
73511
  ElementType,
73490
73512
  {
73491
- className: getClassName8({
73513
+ className: getClassName9({
73492
73514
  primary: variant === "primary",
73493
73515
  secondary: variant === "secondary",
73494
73516
  disabled,
@@ -73509,17 +73531,17 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73509
73531
  rel: newTab ? "noreferrer" : void 0,
73510
73532
  href,
73511
73533
  children: [
73512
- icon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassName8("icon"), children: icon }),
73534
+ icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassName9("icon"), children: icon }),
73513
73535
  children,
73514
- loading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassName8("spinner"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Loader2, { size: 14 }) })
73536
+ loading && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassName9("spinner"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Loader2, { size: 14 }) })
73515
73537
  ]
73516
73538
  }
73517
73539
  );
73518
73540
  return el;
73519
73541
  };
73520
- var import_jsx_runtime13 = require("react/jsx-runtime");
73521
- var getClassName9 = get_class_name_factory_default2("ExternalInput", styles_module_default52);
73522
- var getClassNameModal = get_class_name_factory_default2("ExternalInputModal", styles_module_default52);
73542
+ var import_jsx_runtime14 = require("react/jsx-runtime");
73543
+ var getClassName10 = get_class_name_factory_default2("ExternalInput", styles_module_default6);
73544
+ var getClassNameModal = get_class_name_factory_default2("ExternalInputModal", styles_module_default6);
73523
73545
  var dataCache = {};
73524
73546
  var ExternalInput = ({
73525
73547
  field,
@@ -73570,40 +73592,40 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73570
73592
  (0, import_react82.useEffect)(() => {
73571
73593
  search(searchQuery, filters);
73572
73594
  }, []);
73573
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
73595
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
73574
73596
  "div",
73575
73597
  {
73576
- className: getClassName9({
73598
+ className: getClassName10({
73577
73599
  dataSelected: !!value,
73578
73600
  modalVisible: isOpen
73579
73601
  }),
73580
73602
  id,
73581
73603
  children: [
73582
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: getClassName9("actions"), children: [
73583
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
73604
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassName10("actions"), children: [
73605
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
73584
73606
  "button",
73585
73607
  {
73586
73608
  type: "button",
73587
73609
  onClick: () => setOpen(true),
73588
- className: getClassName9("button"),
73589
- children: value ? field.getItemSummary ? field.getItemSummary(value) : "External item" : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
73590
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Link, { size: "16" }),
73591
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: field.placeholder })
73610
+ className: getClassName10("button"),
73611
+ children: value ? field.getItemSummary ? field.getItemSummary(value) : "External item" : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
73612
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Link, { size: "16" }),
73613
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: field.placeholder })
73592
73614
  ] })
73593
73615
  }
73594
73616
  ),
73595
- value && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
73617
+ value && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
73596
73618
  "button",
73597
73619
  {
73598
- className: getClassName9("detachButton"),
73620
+ className: getClassName10("detachButton"),
73599
73621
  onClick: () => {
73600
73622
  onChange(null);
73601
73623
  },
73602
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Unlock, { size: 16 })
73624
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Unlock, { size: 16 })
73603
73625
  }
73604
73626
  )
73605
73627
  ] }),
73606
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Modal, { onClose: () => setOpen(false), isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
73628
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Modal, { onClose: () => setOpen(false), isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
73607
73629
  "form",
73608
73630
  {
73609
73631
  className: getClassNameModal({
@@ -73617,11 +73639,11 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73617
73639
  search(searchQuery, filters);
73618
73640
  },
73619
73641
  children: [
73620
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: getClassNameModal("searchForm"), children: [
73621
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: getClassNameModal("search"), children: [
73622
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
73623
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Search, { size: "18" }) }),
73624
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
73642
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("searchForm"), children: [
73643
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: getClassNameModal("search"), children: [
73644
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
73645
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Search, { size: "18" }) }),
73646
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
73625
73647
  "input",
73626
73648
  {
73627
73649
  className: getClassNameModal("searchInput"),
@@ -73636,9 +73658,9 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73636
73658
  }
73637
73659
  )
73638
73660
  ] }),
73639
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: getClassNameModal("searchActions"), children: [
73640
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: "Search" }),
73641
- hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
73661
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("searchActions"), children: [
73662
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: "Search" }),
73663
+ hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
73642
73664
  IconButton,
73643
73665
  {
73644
73666
  title: "Toggle filters",
@@ -73647,15 +73669,15 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73647
73669
  e2.stopPropagation();
73648
73670
  setFiltersToggled(!filtersToggled);
73649
73671
  },
73650
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SlidersHorizontal, { size: 20 })
73672
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SlidersHorizontal, { size: 20 })
73651
73673
  }
73652
73674
  ) })
73653
73675
  ] })
73654
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Heading2, { rank: 2, size: "xs", children: field.placeholder || "Select data" }) }),
73655
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: getClassNameModal("grid"), children: [
73656
- hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
73676
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading2, { rank: 2, size: "xs", children: field.placeholder || "Select data" }) }),
73677
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("grid"), children: [
73678
+ hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
73657
73679
  const filterField = filterFields[fieldName];
73658
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
73680
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
73659
73681
  AutoFieldPrivate,
73660
73682
  {
73661
73683
  field: filterField,
@@ -73672,9 +73694,9 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73672
73694
  fieldName
73673
73695
  );
73674
73696
  }) }),
73675
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
73676
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("table", { className: getClassNameModal("table"), children: [
73677
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("thead", { className: getClassNameModal("thead"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tr", { className: getClassNameModal("tr"), children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
73697
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
73698
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: getClassNameModal("table"), children: [
73699
+ /* @__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)(
73678
73700
  "th",
73679
73701
  {
73680
73702
  className: getClassNameModal("th"),
@@ -73683,8 +73705,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73683
73705
  },
73684
73706
  key
73685
73707
  )) }) }),
73686
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tbody", { className: getClassNameModal("tbody"), children: mappedData.map((item, i2) => {
73687
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
73708
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { className: getClassNameModal("tbody"), children: mappedData.map((item, i2) => {
73709
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
73688
73710
  "tr",
73689
73711
  {
73690
73712
  style: { whiteSpace: "nowrap" },
@@ -73693,16 +73715,16 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73693
73715
  onChange(mapProp(data[i2]));
73694
73716
  setOpen(false);
73695
73717
  },
73696
- children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
73718
+ children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
73697
73719
  },
73698
73720
  i2
73699
73721
  );
73700
73722
  }) })
73701
73723
  ] }),
73702
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Loader2, { size: 24 }) })
73724
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loader2, { size: 24 }) })
73703
73725
  ] })
73704
73726
  ] }),
73705
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: getClassNameModal("footer"), children: [
73727
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: getClassNameModal("footer"), children: [
73706
73728
  mappedData.length,
73707
73729
  " result",
73708
73730
  mappedData.length === 1 ? "" : "s"
@@ -73714,7 +73736,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73714
73736
  }
73715
73737
  );
73716
73738
  };
73717
- var import_jsx_runtime14 = require("react/jsx-runtime");
73739
+ var import_jsx_runtime15 = require("react/jsx-runtime");
73718
73740
  var ExternalField = ({
73719
73741
  field,
73720
73742
  onChange,
@@ -73737,7 +73759,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73737
73759
  if (field.type !== "external") {
73738
73760
  return null;
73739
73761
  }
73740
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Label, { label: label || name, icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Link, { size: 16 }), el: "div", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
73762
+ 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)(
73741
73763
  ExternalInput,
73742
73764
  {
73743
73765
  name,
@@ -73759,8 +73781,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73759
73781
  ) });
73760
73782
  };
73761
73783
  init_react_import2();
73762
- var import_jsx_runtime15 = require("react/jsx-runtime");
73763
- var getClassName10 = get_class_name_factory_default2("Input", styles_module_default5);
73784
+ var import_jsx_runtime16 = require("react/jsx-runtime");
73785
+ var getClassName11 = get_class_name_factory_default2("Input", styles_module_default22);
73764
73786
  var RadioField = ({
73765
73787
  field,
73766
73788
  onChange,
@@ -73774,23 +73796,23 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73774
73796
  if (field.type !== "radio" || !field.options) {
73775
73797
  return null;
73776
73798
  }
73777
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
73799
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
73778
73800
  Label,
73779
73801
  {
73780
- icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CheckCircle, { size: 16 }),
73802
+ icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CheckCircle, { size: 16 }),
73781
73803
  label: label || name,
73782
73804
  readOnly,
73783
73805
  el: "div",
73784
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassName10("radioGroupItems"), id, children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
73806
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: getClassName11("radioGroupItems"), id, children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
73785
73807
  "label",
73786
73808
  {
73787
- className: getClassName10("radio"),
73809
+ className: getClassName11("radio"),
73788
73810
  children: [
73789
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
73811
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
73790
73812
  "input",
73791
73813
  {
73792
73814
  type: "radio",
73793
- className: getClassName10("radioInput"),
73815
+ className: getClassName11("radioInput"),
73794
73816
  value: option.value,
73795
73817
  name,
73796
73818
  onChange: (e2) => {
@@ -73804,7 +73826,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73804
73826
  checked: value === option.value
73805
73827
  }
73806
73828
  ),
73807
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassName10("radioInner"), children: option.label || option.value })
73829
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: getClassName11("radioInner"), children: option.label || option.value })
73808
73830
  ]
73809
73831
  },
73810
73832
  option.label + option.value
@@ -73813,8 +73835,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73813
73835
  );
73814
73836
  };
73815
73837
  init_react_import2();
73816
- var import_jsx_runtime16 = require("react/jsx-runtime");
73817
- var getClassName11 = get_class_name_factory_default2("Input", styles_module_default5);
73838
+ var import_jsx_runtime17 = require("react/jsx-runtime");
73839
+ var getClassName12 = get_class_name_factory_default2("Input", styles_module_default22);
73818
73840
  var SelectField = ({
73819
73841
  field,
73820
73842
  onChange,
@@ -73828,17 +73850,17 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73828
73850
  if (field.type !== "select" || !field.options) {
73829
73851
  return null;
73830
73852
  }
73831
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
73853
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
73832
73854
  Label,
73833
73855
  {
73834
73856
  label: label || name,
73835
- icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ChevronDown, { size: 16 }),
73857
+ icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronDown, { size: 16 }),
73836
73858
  readOnly,
73837
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
73859
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
73838
73860
  "select",
73839
73861
  {
73840
73862
  id,
73841
- className: getClassName11("input"),
73863
+ className: getClassName12("input"),
73842
73864
  disabled: readOnly,
73843
73865
  onChange: (e2) => {
73844
73866
  if (e2.currentTarget.value === "true" || e2.currentTarget.value === "false") {
@@ -73848,7 +73870,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73848
73870
  onChange(e2.currentTarget.value);
73849
73871
  },
73850
73872
  value,
73851
- children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
73873
+ children: field.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
73852
73874
  "option",
73853
73875
  {
73854
73876
  label: option.label,
@@ -73862,8 +73884,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73862
73884
  );
73863
73885
  };
73864
73886
  init_react_import2();
73865
- var import_jsx_runtime17 = require("react/jsx-runtime");
73866
- var getClassName12 = get_class_name_factory_default2("Input", styles_module_default5);
73887
+ var import_jsx_runtime18 = require("react/jsx-runtime");
73888
+ var getClassName13 = get_class_name_factory_default2("Input", styles_module_default22);
73867
73889
  var TextareaField = ({
73868
73890
  onChange,
73869
73891
  readOnly,
@@ -73873,11 +73895,11 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73873
73895
  Label,
73874
73896
  id
73875
73897
  }) => {
73876
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Label, { label: label || name, icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Type, { size: 16 }), readOnly, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
73898
+ 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)(
73877
73899
  "textarea",
73878
73900
  {
73879
73901
  id,
73880
- className: getClassName12("input"),
73902
+ className: getClassName13("input"),
73881
73903
  autoComplete: "off",
73882
73904
  name,
73883
73905
  value: typeof value === "undefined" ? "" : value,
@@ -73891,9 +73913,9 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73891
73913
  var import_use_debounce = (init_index_module(), __toCommonJS(index_module_exports));
73892
73914
  init_react_import2();
73893
73915
  init_react_import2();
73894
- var styles_module_default8 = { "ObjectField": "_ObjectField_1ua3y_5", "ObjectField-fieldset": "_ObjectField-fieldset_1ua3y_13" };
73895
- var import_jsx_runtime18 = require("react/jsx-runtime");
73896
- var getClassName13 = get_class_name_factory_default2("ObjectField", styles_module_default8);
73916
+ var styles_module_default9 = { "ObjectField": "_ObjectField_1ua3y_5", "ObjectField-fieldset": "_ObjectField-fieldset_1ua3y_13" };
73917
+ var import_jsx_runtime19 = require("react/jsx-runtime");
73918
+ var getClassName14 = get_class_name_factory_default2("ObjectField", styles_module_default9);
73897
73919
  var ObjectField = ({
73898
73920
  field,
73899
73921
  onChange,
@@ -73910,18 +73932,18 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73910
73932
  }
73911
73933
  const readOnlyFields = (selectedItem == null ? void 0 : selectedItem.readOnly) || {};
73912
73934
  const data = value || {};
73913
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
73935
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
73914
73936
  Label,
73915
73937
  {
73916
73938
  label: label || name,
73917
- icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MoreVertical, { size: 16 }),
73939
+ icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MoreVertical, { size: 16 }),
73918
73940
  el: "div",
73919
73941
  readOnly,
73920
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: getClassName13(), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("fieldset", { className: getClassName13("fieldset"), children: Object.keys(field.objectFields).map((fieldName) => {
73942
+ 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) => {
73921
73943
  const subField = field.objectFields[fieldName];
73922
73944
  const subFieldName = `${name}.${fieldName}`;
73923
73945
  const wildcardFieldName = `${name}.${fieldName}`;
73924
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
73946
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
73925
73947
  AutoFieldPrivate,
73926
73948
  {
73927
73949
  name: subFieldName,
@@ -73957,8 +73979,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73957
73979
  const [id] = (0, import_react102.useState)(generateId());
73958
73980
  return id;
73959
73981
  };
73960
- var import_jsx_runtime19 = require("react/jsx-runtime");
73961
- var getClassName14 = get_class_name_factory_default2("Input", styles_module_default5);
73982
+ var import_jsx_runtime20 = require("react/jsx-runtime");
73983
+ var getClassName15 = get_class_name_factory_default2("Input", styles_module_default22);
73962
73984
  var FieldLabel = ({
73963
73985
  children,
73964
73986
  icon,
@@ -73968,11 +73990,11 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73968
73990
  className
73969
73991
  }) => {
73970
73992
  const El = el;
73971
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(El, { className, children: [
73972
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: getClassName14("label"), children: [
73973
- icon ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassName14("labelIcon"), children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, {}),
73993
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(El, { className, children: [
73994
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: getClassName15("label"), children: [
73995
+ icon ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName15("labelIcon"), children: icon }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, {}),
73974
73996
  label,
73975
- readOnly && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassName14("disabledIcon"), title: "Read-only", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Lock, { size: "12" }) })
73997
+ readOnly && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName15("disabledIcon"), title: "Read-only", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Lock, { size: "12" }) })
73976
73998
  ] }),
73977
73999
  children
73978
74000
  ] });
@@ -73990,14 +74012,14 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
73990
74012
  [overrides]
73991
74013
  );
73992
74014
  if (!label) {
73993
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children });
74015
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children });
73994
74016
  }
73995
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
74017
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
73996
74018
  Wrapper,
73997
74019
  {
73998
74020
  label,
73999
74021
  icon,
74000
- className: getClassName14({ readOnly }),
74022
+ className: getClassName15({ readOnly }),
74001
74023
  readOnly,
74002
74024
  el,
74003
74025
  children
@@ -74041,11 +74063,11 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74041
74063
  return null;
74042
74064
  }
74043
74065
  const CustomField = field.render;
74044
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getClassName14(), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CustomField, __spreadValues2({}, mergedProps)) });
74066
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassName15(), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CustomField, __spreadValues2({}, mergedProps)) });
74045
74067
  }
74046
74068
  const children = defaultFields[field.type](mergedProps);
74047
74069
  const Render2 = render[field.type];
74048
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Render2, __spreadProps2(__spreadValues2({}, mergedProps), { children }));
74070
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Render2, __spreadProps2(__spreadValues2({}, mergedProps), { children }));
74049
74071
  }
74050
74072
  function AutoFieldPrivate(props) {
74051
74073
  const { value, onChange } = props;
@@ -74068,55 +74090,68 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74068
74090
  value: localValue,
74069
74091
  onChange: onChangeLocal
74070
74092
  };
74071
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AutoFieldInternal, __spreadValues2(__spreadValues2({}, props), localProps));
74093
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutoFieldInternal, __spreadValues2(__spreadValues2({}, props), localProps));
74072
74094
  }
74073
- var DefaultLabel = (props) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", __spreadValues2({}, props));
74095
+ var DefaultLabel = (props) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", __spreadValues2({}, props));
74074
74096
  function AutoField(props) {
74075
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AutoFieldInternal, __spreadProps2(__spreadValues2({}, props), { Label: DefaultLabel }));
74097
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AutoFieldInternal, __spreadProps2(__spreadValues2({}, props), { Label: DefaultLabel }));
74076
74098
  }
74077
74099
  init_react_import2();
74078
74100
  init_react_import2();
74079
- var styles_module_default9 = { "Drawer": "_Drawer_6zh0b_1", "DrawerItem-default": "_DrawerItem-default_6zh0b_5", "DrawerItem-draggableWrapper": "_DrawerItem-draggableWrapper_6zh0b_5", "DrawerItem": "_DrawerItem_6zh0b_5", "DrawerItem-draggable": "_DrawerItem-draggable_6zh0b_5", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_6zh0b_31", "DrawerItem-name": "_DrawerItem-name_6zh0b_47" };
74101
+ var styles_module_default10 = { "Drawer": "_Drawer_4yfqn_1", "DrawerItem--disabled": "_DrawerItem--disabled_4yfqn_5", "DrawerItem-default": "_DrawerItem-default_4yfqn_11", "DrawerItem-draggableWrapper": "_DrawerItem-draggableWrapper_4yfqn_11", "DrawerItem": "_DrawerItem_4yfqn_5", "DrawerItem-draggable": "_DrawerItem-draggable_4yfqn_11", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_4yfqn_36", "DrawerItem-name": "_DrawerItem-name_4yfqn_54" };
74080
74102
  var import_react122 = require("react");
74081
- var import_jsx_runtime20 = require("react/jsx-runtime");
74082
- var getClassName15 = get_class_name_factory_default2("Drawer", styles_module_default9);
74083
- var getClassNameItem22 = get_class_name_factory_default2("DrawerItem", styles_module_default9);
74103
+ var import_jsx_runtime21 = require("react/jsx-runtime");
74104
+ var getClassName16 = get_class_name_factory_default2("Drawer", styles_module_default10);
74105
+ var getClassNameItem22 = get_class_name_factory_default2("DrawerItem", styles_module_default10);
74084
74106
  var drawerContext = (0, import_react122.createContext)({
74085
74107
  droppableId: ""
74086
74108
  });
74087
74109
  var DrawerDraggable = ({
74088
74110
  children,
74089
74111
  id,
74090
- index
74091
- }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
74092
- Draggable2,
74093
- {
74094
- id,
74095
- index,
74096
- showShadow: true,
74097
- disableAnimations: true,
74098
- className: () => getClassNameItem22(),
74099
- children: () => children
74100
- },
74101
- id
74102
- );
74112
+ index,
74113
+ isDragDisabled
74114
+ }) => {
74115
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
74116
+ Draggable2,
74117
+ {
74118
+ id,
74119
+ index,
74120
+ isDragDisabled,
74121
+ showShadow: true,
74122
+ disableAnimations: true,
74123
+ className: () => getClassNameItem22({ disabled: isDragDisabled }),
74124
+ children: () => children
74125
+ },
74126
+ id
74127
+ );
74128
+ };
74103
74129
  var DrawerItem = ({
74104
74130
  name,
74105
74131
  children,
74106
74132
  id,
74107
74133
  label,
74108
- index
74134
+ index,
74135
+ isDragDisabled
74109
74136
  }) => {
74110
74137
  const ctx = (0, import_react122.useContext)(drawerContext);
74111
74138
  const resolvedId = `${ctx.droppableId}::${id || name}`;
74112
74139
  const CustomInner = (0, import_react122.useMemo)(
74113
- () => children || (({ children: children2, name: name2 }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassNameItem22("default"), children: children2 })),
74140
+ () => children || (({ children: children2, name: name2 }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem22("default"), children: children2 })),
74114
74141
  [children]
74115
74142
  );
74116
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DrawerDraggable, { id: resolvedId, index, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CustomInner, { name, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassNameItem22("draggableWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: getClassNameItem22("draggable"), children: [
74117
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassNameItem22("name"), children: label != null ? label : name }),
74118
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getClassNameItem22("icon"), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DragIcon, {}) })
74119
- ] }) }) }) });
74143
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
74144
+ DrawerDraggable,
74145
+ {
74146
+ id: resolvedId,
74147
+ index,
74148
+ isDragDisabled,
74149
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CustomInner, { name, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem22("draggableWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: getClassNameItem22("draggable"), children: [
74150
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem22("name"), children: label != null ? label : name }),
74151
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassNameItem22("icon"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DragIcon, { isDragDisabled }) })
74152
+ ] }) }) })
74153
+ }
74154
+ );
74120
74155
  };
74121
74156
  var Drawer = ({
74122
74157
  children,
@@ -74124,28 +74159,28 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74124
74159
  direction = "vertical"
74125
74160
  }) => {
74126
74161
  const droppableId = `component-list:${_droppableId}`;
74127
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(drawerContext.Provider, { value: { droppableId }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Droppable2, { droppableId, isDropDisabled: true, direction, children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
74162
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(drawerContext.Provider, { value: { droppableId }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Droppable2, { droppableId, isDropDisabled: true, direction, children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
74128
74163
  "div",
74129
74164
  __spreadProps2(__spreadValues2({}, provided.droppableProps), {
74130
74165
  ref: provided.innerRef,
74131
- className: getClassName15({
74166
+ className: getClassName16({
74132
74167
  isDraggingFrom: !!snapshot.draggingFromThisWith
74133
74168
  }),
74134
74169
  children: [
74135
74170
  children,
74136
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: { display: "none" }, children: provided.placeholder })
74171
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { display: "none" }, children: provided.placeholder })
74137
74172
  ]
74138
74173
  })
74139
74174
  ) }) });
74140
74175
  };
74141
74176
  Drawer.Item = DrawerItem;
74142
74177
  init_react_import2();
74143
- var import_react16 = require("react");
74178
+ var import_react17 = require("react");
74144
74179
  init_react_import2();
74145
- var import_react14 = require("react");
74180
+ var import_react15 = require("react");
74146
74181
  var import_dnd4 = (init_dnd_esm(), __toCommonJS(dnd_esm_exports));
74147
74182
  init_react_import2();
74148
- var styles_module_default10 = { "DraggableComponent": "_DraggableComponent_59z7f_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_59z7f_11", "DraggableComponent-contents": "_DraggableComponent-contents_59z7f_16", "DraggableComponent-overlay": "_DraggableComponent-overlay_59z7f_29", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_59z7f_49", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_59z7f_65", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_59z7f_71", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_59z7f_76", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_59z7f_81", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_59z7f_97", "DraggableComponent-actions": "_DraggableComponent-actions_59z7f_97", "DraggableComponent-actionsLabel": "_DraggableComponent-actionsLabel_59z7f_127", "DraggableComponent-action": "_DraggableComponent-action_59z7f_97" };
74183
+ var styles_module_default11 = { "DraggableComponent": "_DraggableComponent_1bhad_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_1bhad_11", "DraggableComponent-contents": "_DraggableComponent-contents_1bhad_16", "DraggableComponent-overlay": "_DraggableComponent-overlay_1bhad_29", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_1bhad_49", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_1bhad_65", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_1bhad_71", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_1bhad_76", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_1bhad_81", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_1bhad_97", "DraggableComponent-actions": "_DraggableComponent-actions_1bhad_97" };
74149
74184
  init_react_import2();
74150
74185
  var import_react132 = require("react");
74151
74186
  var useModifierHeld = (modifier) => {
@@ -74180,12 +74215,81 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74180
74215
  "iPod"
74181
74216
  ].includes(navigator.platform) || // iPad on iOS 13 detection
74182
74217
  navigator.userAgent.includes("Mac") && "ontouchend" in document;
74183
- var import_jsx_runtime21 = require("react/jsx-runtime");
74184
- var getClassName16 = get_class_name_factory_default2("DraggableComponent", styles_module_default10);
74218
+ init_react_import2();
74219
+ var import_jsx_runtime222 = require("react/jsx-runtime");
74220
+ var DefaultOverride = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_jsx_runtime222.Fragment, { children });
74221
+ init_react_import2();
74222
+ var import_react14 = require("react");
74223
+ init_react_import2();
74224
+ var loadOverrides = ({
74225
+ overrides,
74226
+ plugins
74227
+ }) => {
74228
+ const collected = __spreadValues2({}, overrides);
74229
+ plugins.forEach((plugin) => {
74230
+ Object.keys(plugin.overrides).forEach((overridesType) => {
74231
+ if (overridesType === "fieldTypes") {
74232
+ const fieldTypes = plugin.overrides.fieldTypes;
74233
+ Object.keys(fieldTypes).forEach((fieldType) => {
74234
+ collected.fieldTypes = collected.fieldTypes || {};
74235
+ const childNode2 = collected.fieldTypes[fieldType];
74236
+ const Comp2 = (props) => fieldTypes[fieldType](__spreadProps2(__spreadValues2({}, props), {
74237
+ children: childNode2 ? childNode2(props) : props.children
74238
+ }));
74239
+ collected.fieldTypes[fieldType] = Comp2;
74240
+ });
74241
+ return;
74242
+ }
74243
+ const childNode = collected[overridesType];
74244
+ const Comp = (props) => plugin.overrides[overridesType](__spreadProps2(__spreadValues2({}, props), {
74245
+ children: childNode ? childNode(props) : props.children
74246
+ }));
74247
+ collected[overridesType] = Comp;
74248
+ });
74249
+ });
74250
+ return collected;
74251
+ };
74252
+ var useLoadedOverrides = ({
74253
+ overrides,
74254
+ plugins
74255
+ }) => {
74256
+ return (0, import_react14.useMemo)(() => {
74257
+ return loadOverrides({ overrides, plugins });
74258
+ }, [plugins, overrides]);
74259
+ };
74260
+ init_react_import2();
74261
+ var getPermissions = ({
74262
+ selectedItem,
74263
+ type,
74264
+ globalPermissions,
74265
+ config
74266
+ }) => {
74267
+ const componentType = type || selectedItem && selectedItem.type || "";
74268
+ let componentPermissions = getInitialPermissions({
74269
+ componentType,
74270
+ config,
74271
+ globalPermissions
74272
+ });
74273
+ return componentPermissions;
74274
+ };
74275
+ var getInitialPermissions = ({
74276
+ componentType,
74277
+ globalPermissions,
74278
+ config
74279
+ }) => {
74280
+ var _a3;
74281
+ return __spreadValues2(__spreadValues2({}, globalPermissions), (_a3 = config.components[componentType]) == null ? void 0 : _a3.permissions);
74282
+ };
74283
+ var import_jsx_runtime23 = require("react/jsx-runtime");
74284
+ var getClassName17 = get_class_name_factory_default2("DraggableComponent", styles_module_default11);
74185
74285
  var space2 = 8;
74186
74286
  var actionsOverlayTop = space2 * 6.5;
74187
74287
  var actionsTop = -(actionsOverlayTop - 8);
74188
74288
  var actionsRight = space2;
74289
+ var DefaultActionBar = ({
74290
+ label,
74291
+ children
74292
+ }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ActionBar, { label, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DefaultOverride, { children }) });
74189
74293
  var DraggableComponent = ({
74190
74294
  children,
74191
74295
  id,
@@ -74208,30 +74312,50 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74208
74312
  indicativeHover = false,
74209
74313
  style: style2
74210
74314
  }) => {
74211
- const { zoomConfig } = useAppContext2();
74315
+ const {
74316
+ zoomConfig,
74317
+ status,
74318
+ overrides,
74319
+ plugins,
74320
+ selectedItem,
74321
+ config,
74322
+ globalPermissions
74323
+ } = useAppContext2();
74212
74324
  const isModifierHeld = useModifierHeld("Alt");
74213
- const { status } = useAppContext2();
74214
74325
  const El = status !== "LOADING" ? import_dnd4.Draggable : DefaultDraggable;
74215
- (0, import_react14.useEffect)(onMount, []);
74216
- const [disableSecondaryAnimation, setDisableSecondaryAnimation] = (0, import_react14.useState)(false);
74217
- (0, import_react14.useEffect)(() => {
74326
+ (0, import_react15.useEffect)(onMount, []);
74327
+ const [disableSecondaryAnimation, setDisableSecondaryAnimation] = (0, import_react15.useState)(false);
74328
+ (0, import_react15.useEffect)(() => {
74218
74329
  if (isIos()) {
74219
74330
  setDisableSecondaryAnimation(true);
74220
74331
  }
74221
74332
  }, []);
74222
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
74333
+ const loadedOverrides = useLoadedOverrides({
74334
+ overrides,
74335
+ plugins
74336
+ });
74337
+ const CustomActionBar = (0, import_react15.useMemo)(
74338
+ () => loadedOverrides.actionBar || DefaultActionBar,
74339
+ [loadedOverrides]
74340
+ );
74341
+ const permissions = selectedItem && getPermissions({
74342
+ selectedItem,
74343
+ globalPermissions: globalPermissions || {},
74344
+ config
74345
+ });
74346
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74223
74347
  El,
74224
74348
  {
74225
74349
  draggableId: id,
74226
74350
  index,
74227
74351
  isDragDisabled,
74228
74352
  disableSecondaryAnimation,
74229
- children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
74353
+ children: (provided, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
74230
74354
  "div",
74231
74355
  __spreadProps2(__spreadValues2(__spreadValues2({
74232
74356
  ref: provided.innerRef
74233
74357
  }, provided.draggableProps), provided.dragHandleProps), {
74234
- className: getClassName16({
74358
+ className: getClassName17({
74235
74359
  isSelected,
74236
74360
  isModifierHeld,
74237
74361
  isDragging: snapshot.isDragging,
@@ -74240,7 +74364,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74240
74364
  indicativeHover
74241
74365
  }),
74242
74366
  style: __spreadProps2(__spreadValues2(__spreadValues2({}, style2), provided.draggableProps.style), {
74243
- cursor: isModifierHeld ? "initial" : "grab"
74367
+ cursor: isModifierHeld || isDragDisabled ? "initial" : "grab"
74244
74368
  }),
74245
74369
  onMouseOver,
74246
74370
  onMouseOut,
@@ -74249,34 +74373,33 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74249
74373
  onClick,
74250
74374
  children: [
74251
74375
  debug,
74252
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassName16("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Loader2, {}) }),
74253
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
74376
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loader2, {}) }),
74377
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74254
74378
  "div",
74255
74379
  {
74256
- className: getClassName16("actionsOverlay"),
74380
+ className: getClassName17("actionsOverlay"),
74257
74381
  style: {
74258
74382
  top: actionsOverlayTop / zoomConfig.zoom
74259
74383
  },
74260
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
74384
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74261
74385
  "div",
74262
74386
  {
74263
- className: getClassName16("actions"),
74387
+ className: getClassName17("actions"),
74264
74388
  style: {
74265
74389
  transform: `scale(${1 / zoomConfig.zoom}`,
74266
74390
  top: actionsTop / zoomConfig.zoom,
74267
74391
  right: actionsRight / zoomConfig.zoom
74268
74392
  },
74269
- children: [
74270
- label && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassName16("actionsLabel"), children: label }),
74271
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: getClassName16("action"), onClick: onDuplicate, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Copy, { size: 16 }) }),
74272
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: getClassName16("action"), onClick: onDelete, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Trash, { size: 16 }) })
74273
- ]
74393
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(CustomActionBar, { label, children: [
74394
+ permissions && permissions.duplicate && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ActionBar.Action, { onClick: onDuplicate, label: "Duplicate", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Copy, { size: 16 }) }),
74395
+ permissions && permissions.delete && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ActionBar.Action, { onClick: onDelete, label: "Delete", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Trash, { size: 16 }) })
74396
+ ] })
74274
74397
  }
74275
74398
  )
74276
74399
  }
74277
74400
  ),
74278
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassName16("overlay") }),
74279
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: getClassName16("contents"), children })
74401
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17("overlay") }),
74402
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17("contents"), children })
74280
74403
  ]
74281
74404
  })
74282
74405
  )
@@ -74285,9 +74408,9 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74285
74408
  );
74286
74409
  };
74287
74410
  init_react_import2();
74288
- var styles_module_default11 = { "DropZone": "_DropZone_djoti_1", "DropZone-content": "_DropZone-content_djoti_10", "DropZone--userIsDragging": "_DropZone--userIsDragging_djoti_15", "DropZone--draggingOverArea": "_DropZone--draggingOverArea_djoti_19", "DropZone--draggingNewComponent": "_DropZone--draggingNewComponent_djoti_20", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_djoti_26", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_djoti_27", "DropZone--isDisabled": "_DropZone--isDisabled_djoti_28", "DropZone--isRootZone": "_DropZone--isRootZone_djoti_29", "DropZone--hasChildren": "_DropZone--hasChildren_djoti_30", "DropZone--isDestination": "_DropZone--isDestination_djoti_40", "DropZone-item": "_DropZone-item_djoti_52", "DropZone-hitbox": "_DropZone-hitbox_djoti_56" };
74411
+ var styles_module_default12 = { "DropZone": "_DropZone_djoti_1", "DropZone-content": "_DropZone-content_djoti_10", "DropZone--userIsDragging": "_DropZone--userIsDragging_djoti_15", "DropZone--draggingOverArea": "_DropZone--draggingOverArea_djoti_19", "DropZone--draggingNewComponent": "_DropZone--draggingNewComponent_djoti_20", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_djoti_26", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_djoti_27", "DropZone--isDisabled": "_DropZone--isDisabled_djoti_28", "DropZone--isRootZone": "_DropZone--isRootZone_djoti_29", "DropZone--hasChildren": "_DropZone--hasChildren_djoti_30", "DropZone--isDestination": "_DropZone--isDestination_djoti_40", "DropZone-item": "_DropZone-item_djoti_52", "DropZone-hitbox": "_DropZone-hitbox_djoti_56" };
74289
74412
  init_react_import2();
74290
- var import_react15 = require("react");
74413
+ var import_react16 = require("react");
74291
74414
  var import_use_debounce2 = (init_index_module(), __toCommonJS(index_module_exports));
74292
74415
  init_react_import2();
74293
74416
  var getZoneId2 = (zoneCompound) => {
@@ -74299,30 +74422,30 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74299
74422
  }
74300
74423
  return [rootDroppableId2, zoneCompound];
74301
74424
  };
74302
- var import_jsx_runtime222 = require("react/jsx-runtime");
74303
- var dropZoneContext2 = (0, import_react15.createContext)(null);
74425
+ var import_jsx_runtime24 = require("react/jsx-runtime");
74426
+ var dropZoneContext2 = (0, import_react16.createContext)(null);
74304
74427
  var DropZoneProvider = ({
74305
74428
  children,
74306
74429
  value
74307
74430
  }) => {
74308
- const [hoveringArea, setHoveringArea] = (0, import_react15.useState)(null);
74309
- const [hoveringZone, setHoveringZone] = (0, import_react15.useState)(
74431
+ const [hoveringArea, setHoveringArea] = (0, import_react16.useState)(null);
74432
+ const [hoveringZone, setHoveringZone] = (0, import_react16.useState)(
74310
74433
  rootDroppableId2
74311
74434
  );
74312
- const [hoveringComponent, setHoveringComponent] = (0, import_react15.useState)();
74435
+ const [hoveringComponent, setHoveringComponent] = (0, import_react16.useState)();
74313
74436
  const [hoveringAreaDb] = (0, import_use_debounce2.useDebounce)(hoveringArea, 75, { leading: false });
74314
- const [areasWithZones, setAreasWithZones] = (0, import_react15.useState)(
74437
+ const [areasWithZones, setAreasWithZones] = (0, import_react16.useState)(
74315
74438
  {}
74316
74439
  );
74317
- const [activeZones, setActiveZones] = (0, import_react15.useState)({});
74440
+ const [activeZones, setActiveZones] = (0, import_react16.useState)({});
74318
74441
  const { dispatch = null } = value ? value : {};
74319
- const registerZoneArea = (0, import_react15.useCallback)(
74442
+ const registerZoneArea = (0, import_react16.useCallback)(
74320
74443
  (area) => {
74321
74444
  setAreasWithZones((latest) => __spreadProps2(__spreadValues2({}, latest), { [area]: true }));
74322
74445
  },
74323
74446
  [setAreasWithZones]
74324
74447
  );
74325
- const registerZone = (0, import_react15.useCallback)(
74448
+ const registerZone = (0, import_react16.useCallback)(
74326
74449
  (zoneCompound) => {
74327
74450
  if (!dispatch) {
74328
74451
  return;
@@ -74335,7 +74458,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74335
74458
  },
74336
74459
  [setActiveZones, dispatch]
74337
74460
  );
74338
- const unregisterZone = (0, import_react15.useCallback)(
74461
+ const unregisterZone = (0, import_react16.useCallback)(
74339
74462
  (zoneCompound) => {
74340
74463
  if (!dispatch) {
74341
74464
  return;
@@ -74350,8 +74473,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74350
74473
  },
74351
74474
  [setActiveZones, dispatch]
74352
74475
  );
74353
- const [pathData, setPathData] = (0, import_react15.useState)();
74354
- const registerPath = (0, import_react15.useCallback)(
74476
+ const [pathData, setPathData] = (0, import_react16.useState)();
74477
+ const registerPath = (0, import_react16.useCallback)(
74355
74478
  (selector) => {
74356
74479
  if (!(value == null ? void 0 : value.data)) {
74357
74480
  return;
@@ -74376,8 +74499,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74376
74499
  },
74377
74500
  [value, setPathData]
74378
74501
  );
74379
- const [zoneWillDrag, setZoneWillDrag] = (0, import_react15.useState)("");
74380
- return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_jsx_runtime222.Fragment, { children: value && /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
74502
+ const [zoneWillDrag, setZoneWillDrag] = (0, import_react16.useState)("");
74503
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: value && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
74381
74504
  dropZoneContext2.Provider,
74382
74505
  {
74383
74506
  value: __spreadValues2({
@@ -74401,12 +74524,12 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74401
74524
  }
74402
74525
  ) });
74403
74526
  };
74404
- var import_jsx_runtime23 = require("react/jsx-runtime");
74405
- var getClassName17 = get_class_name_factory_default2("DropZone", styles_module_default11);
74527
+ var import_jsx_runtime25 = require("react/jsx-runtime");
74528
+ var getClassName18 = get_class_name_factory_default2("DropZone", styles_module_default12);
74406
74529
  function DropZoneEdit({ zone, allow, disallow, style: style2 }) {
74407
74530
  var _a3;
74408
74531
  const appContext22 = useAppContext2();
74409
- const ctx = (0, import_react16.useContext)(dropZoneContext2);
74532
+ const ctx = (0, import_react17.useContext)(dropZoneContext2);
74410
74533
  const {
74411
74534
  // These all need setting via context
74412
74535
  data,
@@ -74425,12 +74548,12 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74425
74548
  } = ctx || {};
74426
74549
  let content = data.content || [];
74427
74550
  let zoneCompound = rootDroppableId2;
74428
- (0, import_react16.useEffect)(() => {
74551
+ (0, import_react17.useEffect)(() => {
74429
74552
  if (areaId && registerZoneArea) {
74430
74553
  registerZoneArea(areaId);
74431
74554
  }
74432
74555
  }, [areaId]);
74433
- (0, import_react16.useEffect)(() => {
74556
+ (0, import_react17.useEffect)(() => {
74434
74557
  if (ctx == null ? void 0 : ctx.registerZone) {
74435
74558
  ctx == null ? void 0 : ctx.registerZone(zoneCompound);
74436
74559
  }
@@ -74456,7 +74579,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74456
74579
  const draggingOverArea = userIsDragging && zoneArea === draggedSourceArea;
74457
74580
  const draggingNewComponent = draggedSourceId == null ? void 0 : draggedSourceId.startsWith("component-list");
74458
74581
  if (!(ctx == null ? void 0 : ctx.config) || !ctx.setHoveringArea || !ctx.setHoveringZone || !ctx.setHoveringComponent || !ctx.setItemSelector || !ctx.registerPath || !ctx.dispatch) {
74459
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { children: "DropZone requires context to work." });
74582
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { children: "DropZone requires context to work." });
74460
74583
  }
74461
74584
  const {
74462
74585
  hoveringArea = "root",
@@ -74497,10 +74620,10 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74497
74620
  }
74498
74621
  const selectedItem = itemSelector ? getItem2(itemSelector, data) : null;
74499
74622
  const isAreaSelected = selectedItem && zoneArea === selectedItem.props.id;
74500
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74623
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
74501
74624
  "div",
74502
74625
  {
74503
- className: getClassName17({
74626
+ className: getClassName18({
74504
74627
  isRootZone,
74505
74628
  userIsDragging,
74506
74629
  draggingOverArea,
@@ -74514,17 +74637,17 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74514
74637
  onMouseUp: () => {
74515
74638
  setZoneWillDrag("");
74516
74639
  },
74517
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74640
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
74518
74641
  Droppable2,
74519
74642
  {
74520
74643
  droppableId: zoneCompound,
74521
74644
  direction: "vertical",
74522
74645
  isDropDisabled: !isEnabled,
74523
74646
  children: (provided, snapshot) => {
74524
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
74647
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
74525
74648
  "div",
74526
74649
  __spreadProps2(__spreadValues2({}, (provided || { droppableProps: {} }).droppableProps), {
74527
- className: getClassName17("content"),
74650
+ className: getClassName18("content"),
74528
74651
  ref: provided == null ? void 0 : provided.innerRef,
74529
74652
  style: style2,
74530
74653
  id: zoneCompound,
@@ -74551,25 +74674,33 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74551
74674
  "draggable-"
74552
74675
  )[1] === componentId;
74553
74676
  const containsZone = areasWithZones ? areasWithZones[componentId] : false;
74554
- const Render2 = config.components[item.type] ? config.components[item.type].render : () => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { padding: 48, textAlign: "center" }, children: [
74677
+ const Render2 = config.components[item.type] ? config.components[item.type].render : () => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: { padding: 48, textAlign: "center" }, children: [
74555
74678
  "No configuration for ",
74556
74679
  item.type
74557
74680
  ] });
74558
74681
  const componentConfig = config.components[item.type];
74559
74682
  const label = (_b2 = componentConfig == null ? void 0 : componentConfig["label"]) != null ? _b2 : item.type.toString();
74560
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
74683
+ const canDrag = getPermissions({
74684
+ selectedItem: getItem2(
74685
+ { index: i2, zone: zoneCompound },
74686
+ appContext22.state.data
74687
+ ),
74688
+ config: appContext22.config,
74689
+ globalPermissions: appContext22.globalPermissions || {}
74690
+ }).drag;
74691
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
74561
74692
  "div",
74562
74693
  {
74563
- className: getClassName17("item"),
74694
+ className: getClassName18("item"),
74564
74695
  style: { zIndex: isDragging2 ? 1 : void 0 },
74565
74696
  children: [
74566
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74697
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
74567
74698
  DropZoneProvider,
74568
74699
  {
74569
74700
  value: __spreadProps2(__spreadValues2({}, ctx), {
74570
74701
  areaId: componentId
74571
74702
  }),
74572
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74703
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
74573
74704
  DraggableComponent,
74574
74705
  {
74575
74706
  label,
@@ -74578,6 +74709,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74578
74709
  isSelected,
74579
74710
  isLocked: userIsDragging,
74580
74711
  forceHover: hoveringComponent === componentId && !userIsDragging,
74712
+ isDragDisabled: !canDrag,
74581
74713
  indicativeHover: userIsDragging && containsZone && hoveringArea === componentId,
74582
74714
  isLoading: (_c = appContext22.componentState[componentId]) == null ? void 0 : _c.loading,
74583
74715
  onMount: () => {
@@ -74636,15 +74768,15 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74636
74768
  style: {
74637
74769
  pointerEvents: userIsDragging && draggingNewComponent ? "all" : void 0
74638
74770
  },
74639
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getClassName17("renderWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Render2, __spreadValues2({}, defaultedProps)) })
74771
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getClassName18("renderWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Render2, __spreadValues2({}, defaultedProps)) })
74640
74772
  }
74641
74773
  )
74642
74774
  }
74643
74775
  ),
74644
- userIsDragging && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74776
+ userIsDragging && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
74645
74777
  "div",
74646
74778
  {
74647
- className: getClassName17("hitbox"),
74779
+ className: getClassName18("hitbox"),
74648
74780
  onMouseOver: (e2) => {
74649
74781
  e2.stopPropagation();
74650
74782
  setHoveringArea(zoneArea);
@@ -74658,7 +74790,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74658
74790
  );
74659
74791
  }),
74660
74792
  provided == null ? void 0 : provided.placeholder,
74661
- (snapshot == null ? void 0 : snapshot.isDraggingOver) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74793
+ (snapshot == null ? void 0 : snapshot.isDraggingOver) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
74662
74794
  "div",
74663
74795
  {
74664
74796
  "data-puck-placeholder": true,
@@ -74679,7 +74811,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74679
74811
  );
74680
74812
  }
74681
74813
  function DropZoneRender({ zone }) {
74682
- const ctx = (0, import_react16.useContext)(dropZoneContext2);
74814
+ const ctx = (0, import_react17.useContext)(dropZoneContext2);
74683
74815
  const { data, areaId = "root", config } = ctx || {};
74684
74816
  let zoneCompound = rootDroppableId2;
74685
74817
  let content = (data == null ? void 0 : data.content) || [];
@@ -74690,14 +74822,14 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74690
74822
  zoneCompound = `${areaId}:${zone}`;
74691
74823
  content = setupZone2(data, zoneCompound).zones[zoneCompound];
74692
74824
  }
74693
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: content.map((item) => {
74825
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: content.map((item) => {
74694
74826
  const Component = config.components[item.type];
74695
74827
  if (Component) {
74696
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74828
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
74697
74829
  DropZoneProvider,
74698
74830
  {
74699
74831
  value: { data, config, areaId: item.props.id },
74700
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
74832
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
74701
74833
  Component.render,
74702
74834
  __spreadProps2(__spreadValues2({}, item.props), {
74703
74835
  puck: { renderDropZone: DropZone }
@@ -74711,16 +74843,16 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74711
74843
  }) });
74712
74844
  }
74713
74845
  function DropZone(props) {
74714
- const ctx = (0, import_react16.useContext)(dropZoneContext2);
74846
+ const ctx = (0, import_react17.useContext)(dropZoneContext2);
74715
74847
  if ((ctx == null ? void 0 : ctx.mode) === "edit") {
74716
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DropZoneEdit, __spreadValues2({}, props));
74848
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropZoneEdit, __spreadValues2({}, props));
74717
74849
  }
74718
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DropZoneRender, __spreadValues2({}, props));
74850
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropZoneRender, __spreadValues2({}, props));
74719
74851
  }
74720
74852
  init_react_import2();
74721
- var import_react30 = require("react");
74853
+ var import_react31 = require("react");
74722
74854
  init_react_import2();
74723
- var import_react17 = require("react");
74855
+ var import_react18 = require("react");
74724
74856
  init_react_import2();
74725
74857
  var getFrame3 = () => {
74726
74858
  let frame = document.querySelector("#preview-frame");
@@ -74731,7 +74863,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74731
74863
  };
74732
74864
  var usePlaceholderStyle = () => {
74733
74865
  const queryAttr = "data-rfd-drag-handle-draggable-id";
74734
- const [placeholderStyle, setPlaceholderStyle] = (0, import_react17.useState)();
74866
+ const [placeholderStyle, setPlaceholderStyle] = (0, import_react18.useState)();
74735
74867
  const onDragStartOrUpdate = (draggedItem) => {
74736
74868
  var _a3;
74737
74869
  const draggableId = draggedItem.draggableId;
@@ -74776,9 +74908,9 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74776
74908
  };
74777
74909
  init_react_import2();
74778
74910
  init_react_import2();
74779
- var styles_module_default12 = { "SidebarSection": "_SidebarSection_125qe_1", "SidebarSection-title": "_SidebarSection-title_125qe_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_125qe_20", "SidebarSection-content": "_SidebarSection-content_125qe_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_125qe_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_125qe_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_125qe_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_125qe_41", "SidebarSection-heading": "_SidebarSection-heading_125qe_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_125qe_86" };
74911
+ var styles_module_default13 = { "SidebarSection": "_SidebarSection_125qe_1", "SidebarSection-title": "_SidebarSection-title_125qe_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_125qe_20", "SidebarSection-content": "_SidebarSection-content_125qe_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_125qe_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_125qe_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_125qe_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_125qe_41", "SidebarSection-heading": "_SidebarSection-heading_125qe_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_125qe_86" };
74780
74912
  init_react_import2();
74781
- var import_react18 = require("react");
74913
+ var import_react19 = require("react");
74782
74914
  var convertPathDataToBreadcrumbs2 = (selectedItem, pathData, data) => {
74783
74915
  const id = selectedItem ? selectedItem == null ? void 0 : selectedItem.props.id : "";
74784
74916
  const currentPathData = pathData && id && pathData[id] ? __spreadValues2({}, pathData[id]) : { label: "Page", path: [] };
@@ -74828,8 +74960,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74828
74960
  state: { data },
74829
74961
  selectedItem
74830
74962
  } = useAppContext2();
74831
- const dzContext = (0, import_react18.useContext)(dropZoneContext2);
74832
- return (0, import_react18.useMemo)(() => {
74963
+ const dzContext = (0, import_react19.useContext)(dropZoneContext2);
74964
+ return (0, import_react19.useMemo)(() => {
74833
74965
  const breadcrumbs = convertPathDataToBreadcrumbs2(
74834
74966
  selectedItem,
74835
74967
  dzContext == null ? void 0 : dzContext.pathData,
@@ -74841,8 +74973,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74841
74973
  return breadcrumbs;
74842
74974
  }, [selectedItem, dzContext == null ? void 0 : dzContext.pathData, renderCount]);
74843
74975
  };
74844
- var import_jsx_runtime24 = require("react/jsx-runtime");
74845
- var getClassName18 = get_class_name_factory_default2("SidebarSection", styles_module_default12);
74976
+ var import_jsx_runtime26 = require("react/jsx-runtime");
74977
+ var getClassName19 = get_class_name_factory_default2("SidebarSection", styles_module_default13);
74846
74978
  var SidebarSection2 = ({
74847
74979
  children,
74848
74980
  title,
@@ -74854,28 +74986,28 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
74854
74986
  }) => {
74855
74987
  const { setUi } = useAppContext2();
74856
74988
  const breadcrumbs = useBreadcrumbs2(1);
74857
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
74989
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
74858
74990
  "div",
74859
74991
  {
74860
- className: getClassName18({ noBorderTop, noPadding }),
74992
+ className: getClassName19({ noBorderTop, noPadding }),
74861
74993
  style: { background },
74862
74994
  children: [
74863
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName18("title"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName18("breadcrumbs"), children: [
74864
- showBreadcrumbs ? breadcrumbs.map((breadcrumb, i2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName18("breadcrumb"), children: [
74865
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
74995
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("title"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: getClassName19("breadcrumbs"), children: [
74996
+ showBreadcrumbs ? breadcrumbs.map((breadcrumb, i2) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: getClassName19("breadcrumb"), children: [
74997
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
74866
74998
  "button",
74867
74999
  {
74868
- className: getClassName18("breadcrumbLabel"),
75000
+ className: getClassName19("breadcrumbLabel"),
74869
75001
  onClick: () => setUi({ itemSelector: breadcrumb.selector }),
74870
75002
  children: breadcrumb.label
74871
75003
  }
74872
75004
  ),
74873
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChevronRight2, { size: 16 })
75005
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronRight2, { size: 16 })
74874
75006
  ] }, i2)) : null,
74875
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName18("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Heading2, { rank: 2, size: "xs", children: title }) })
75007
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading2, { rank: 2, size: "xs", children: title }) })
74876
75008
  ] }) }),
74877
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName18("content"), children }),
74878
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName18("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Loader2, { size: 32 }) })
75009
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("content"), children }),
75010
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName19("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Loader2, { size: 32 }) })
74879
75011
  ]
74880
75012
  }
74881
75013
  );
@@ -75222,7 +75354,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75222
75354
  return appState;
75223
75355
  };
75224
75356
  init_react_import2();
75225
- var import_react19 = require("react");
75357
+ var import_react20 = require("react");
75226
75358
  init_react_import2();
75227
75359
  init_react_import2();
75228
75360
  var getChanged = (newItem, oldItem) => {
@@ -75319,13 +75451,13 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75319
75451
  return data.root;
75320
75452
  });
75321
75453
  var useResolvedData = (appState, config, dispatch) => {
75322
- const [{ resolverKey, newAppState }, setResolverState] = (0, import_react19.useState)({
75454
+ const [{ resolverKey, newAppState }, setResolverState] = (0, import_react20.useState)({
75323
75455
  resolverKey: 0,
75324
75456
  newAppState: appState
75325
75457
  });
75326
- const [componentState, setComponentState] = (0, import_react19.useState)({});
75458
+ const [componentState, setComponentState] = (0, import_react20.useState)({});
75327
75459
  const deferredSetStates = {};
75328
- const setComponentLoading = (0, import_react19.useCallback)(
75460
+ const setComponentLoading = (0, import_react20.useCallback)(
75329
75461
  (id, loading, defer2 = 0) => {
75330
75462
  if (deferredSetStates[id]) {
75331
75463
  clearTimeout(deferredSetStates[id]);
@@ -75395,10 +75527,10 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75395
75527
  });
75396
75528
  yield Promise.all(promises);
75397
75529
  });
75398
- (0, import_react19.useEffect)(() => {
75530
+ (0, import_react20.useEffect)(() => {
75399
75531
  runResolvers();
75400
75532
  }, [resolverKey]);
75401
- const resolveData = (0, import_react19.useCallback)((newAppState2 = appState) => {
75533
+ const resolveData = (0, import_react20.useCallback)((newAppState2 = appState) => {
75402
75534
  setResolverState((curr) => ({
75403
75535
  resolverKey: curr.resolverKey + 1,
75404
75536
  newAppState: newAppState2
@@ -75411,9 +75543,9 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75411
75543
  };
75412
75544
  init_react_import2();
75413
75545
  init_react_import2();
75414
- var styles_module_default13 = { "MenuBar": "_MenuBar_8pf8c_1", "MenuBar--menuOpen": "_MenuBar--menuOpen_8pf8c_14", "MenuBar-inner": "_MenuBar-inner_8pf8c_29", "MenuBar-history": "_MenuBar-history_8pf8c_45" };
75415
- var import_jsx_runtime25 = require("react/jsx-runtime");
75416
- var getClassName19 = get_class_name_factory_default2("MenuBar", styles_module_default13);
75546
+ 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" };
75547
+ var import_jsx_runtime27 = require("react/jsx-runtime");
75548
+ var getClassName20 = get_class_name_factory_default2("MenuBar", styles_module_default14);
75417
75549
  var MenuBar = ({
75418
75550
  appState,
75419
75551
  data = { content: [], root: {} },
@@ -75427,10 +75559,10 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75427
75559
  history: { back, forward, historyStore }
75428
75560
  } = useAppContext2();
75429
75561
  const { hasFuture = false, hasPast = false } = historyStore || {};
75430
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
75562
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
75431
75563
  "div",
75432
75564
  {
75433
- className: getClassName19({ menuOpen }),
75565
+ className: getClassName20({ menuOpen }),
75434
75566
  onClick: (event) => {
75435
75567
  var _a3;
75436
75568
  const element = event.target;
@@ -75441,12 +75573,12 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75441
75573
  setMenuOpen(false);
75442
75574
  }
75443
75575
  },
75444
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getClassName19("inner"), children: [
75445
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getClassName19("history"), children: [
75446
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Undo2, { size: 21 }) }),
75447
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Redo2, { size: 21 }) })
75576
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: getClassName20("inner"), children: [
75577
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: getClassName20("history"), children: [
75578
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Undo2, { size: 21 }) }),
75579
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Redo2, { size: 21 }) })
75448
75580
  ] }),
75449
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: renderHeaderActions && renderHeaderActions({
75581
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children: renderHeaderActions && renderHeaderActions({
75450
75582
  state: appState,
75451
75583
  dispatch
75452
75584
  }) })
@@ -75455,20 +75587,20 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75455
75587
  );
75456
75588
  };
75457
75589
  init_react_import2();
75458
- var styles_module_default14 = { "Puck": "_Puck_1g88c_19", "Puck-portal": "_Puck-portal_1g88c_24", "PuckLayout": "_PuckLayout_1g88c_31", "PuckLayout-inner": "_PuckLayout-inner_1g88c_39", "PuckLayout--mounted": "_PuckLayout--mounted_1g88c_51", "PuckLayout--leftSideBarVisible": "_PuckLayout--leftSideBarVisible_1g88c_55", "PuckLayout--rightSideBarVisible": "_PuckLayout--rightSideBarVisible_1g88c_61", "PuckLayout-mounted": "_PuckLayout-mounted_1g88c_75", "PuckLayout-header": "_PuckLayout-header_1g88c_116", "PuckLayout-headerInner": "_PuckLayout-headerInner_1g88c_125", "PuckLayout-headerToggle": "_PuckLayout-headerToggle_1g88c_135", "PuckLayout-rightSideBarToggle": "_PuckLayout-rightSideBarToggle_1g88c_142", "PuckLayout-leftSideBarToggle": "_PuckLayout-leftSideBarToggle_1g88c_143", "PuckLayout-headerTitle": "_PuckLayout-headerTitle_1g88c_147", "PuckLayout-headerPath": "_PuckLayout-headerPath_1g88c_151", "PuckLayout-headerTools": "_PuckLayout-headerTools_1g88c_158", "PuckLayout-menuButton": "_PuckLayout-menuButton_1g88c_164", "PuckLayout--menuOpen": "_PuckLayout--menuOpen_1g88c_169", "PuckLayout-leftSideBar": "_PuckLayout-leftSideBar_1g88c_143", "PuckLayout-rightSideBar": "_PuckLayout-rightSideBar_1g88c_142" };
75590
+ var styles_module_default15 = { "Puck": "_Puck_1g88c_19", "Puck-portal": "_Puck-portal_1g88c_24", "PuckLayout": "_PuckLayout_1g88c_31", "PuckLayout-inner": "_PuckLayout-inner_1g88c_39", "PuckLayout--mounted": "_PuckLayout--mounted_1g88c_51", "PuckLayout--leftSideBarVisible": "_PuckLayout--leftSideBarVisible_1g88c_55", "PuckLayout--rightSideBarVisible": "_PuckLayout--rightSideBarVisible_1g88c_61", "PuckLayout-mounted": "_PuckLayout-mounted_1g88c_75", "PuckLayout-header": "_PuckLayout-header_1g88c_116", "PuckLayout-headerInner": "_PuckLayout-headerInner_1g88c_125", "PuckLayout-headerToggle": "_PuckLayout-headerToggle_1g88c_135", "PuckLayout-rightSideBarToggle": "_PuckLayout-rightSideBarToggle_1g88c_142", "PuckLayout-leftSideBarToggle": "_PuckLayout-leftSideBarToggle_1g88c_143", "PuckLayout-headerTitle": "_PuckLayout-headerTitle_1g88c_147", "PuckLayout-headerPath": "_PuckLayout-headerPath_1g88c_151", "PuckLayout-headerTools": "_PuckLayout-headerTools_1g88c_158", "PuckLayout-menuButton": "_PuckLayout-menuButton_1g88c_164", "PuckLayout--menuOpen": "_PuckLayout--menuOpen_1g88c_169", "PuckLayout-leftSideBar": "_PuckLayout-leftSideBar_1g88c_143", "PuckLayout-rightSideBar": "_PuckLayout-rightSideBar_1g88c_142" };
75459
75591
  init_react_import2();
75460
75592
  init_react_import2();
75461
- var styles_module_default15 = { "PuckFields": "_PuckFields_jp3lw_1", "PuckFields--isLoading": "_PuckFields--isLoading_jp3lw_6", "PuckFields-loadingOverlay": "_PuckFields-loadingOverlay_jp3lw_10", "PuckFields-loadingOverlayInner": "_PuckFields-loadingOverlayInner_jp3lw_25" };
75462
- var import_react20 = require("react");
75463
- var import_jsx_runtime26 = require("react/jsx-runtime");
75464
- var getClassName20 = get_class_name_factory_default2("PuckFields", styles_module_default15);
75593
+ 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" };
75594
+ var import_react21 = require("react");
75595
+ var import_jsx_runtime28 = require("react/jsx-runtime");
75596
+ var getClassName21 = get_class_name_factory_default2("PuckFields", styles_module_default16);
75465
75597
  var defaultPageFields = {
75466
75598
  title: { type: "text" }
75467
75599
  };
75468
75600
  var DefaultFields = ({
75469
75601
  children
75470
75602
  }) => {
75471
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children });
75603
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children });
75472
75604
  };
75473
75605
  var useResolvedFields = () => {
75474
75606
  var _a3;
@@ -75478,14 +75610,14 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75478
75610
  const componentConfig = selectedItem ? config.components[selectedItem.type] : null;
75479
75611
  const defaultFields = selectedItem ? componentConfig == null ? void 0 : componentConfig.fields : rootFields;
75480
75612
  const rootProps = data.root.props || data.root;
75481
- const [lastSelectedData, setLastSelectedData] = (0, import_react20.useState)(
75613
+ const [lastSelectedData, setLastSelectedData] = (0, import_react21.useState)(
75482
75614
  {}
75483
75615
  );
75484
- const [resolvedFields, setResolvedFields] = (0, import_react20.useState)(defaultFields || {});
75485
- const [fieldsLoading, setFieldsLoading] = (0, import_react20.useState)(false);
75616
+ const [resolvedFields, setResolvedFields] = (0, import_react21.useState)(defaultFields || {});
75617
+ const [fieldsLoading, setFieldsLoading] = (0, import_react21.useState)(false);
75486
75618
  const defaultResolveFields = (_componentData, _params) => defaultFields;
75487
75619
  const componentData = selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly };
75488
- const resolveFields = (0, import_react20.useCallback)(
75620
+ const resolveFields = (0, import_react21.useCallback)(
75489
75621
  (..._0) => __async2(void 0, [..._0], function* (fields = {}) {
75490
75622
  var _a22, _b2, _c;
75491
75623
  const lastData = ((_a22 = lastSelectedData.props) == null ? void 0 : _a22.id) === componentData.props.id ? lastSelectedData : {};
@@ -75521,7 +75653,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75521
75653
  }),
75522
75654
  [data, config, componentData, selectedItem, resolvedFields, state]
75523
75655
  );
75524
- (0, import_react20.useEffect)(() => {
75656
+ (0, import_react21.useEffect)(() => {
75525
75657
  setFieldsLoading(true);
75526
75658
  resolveFields(defaultFields).then((fields) => {
75527
75659
  setResolvedFields(fields || {});
@@ -75539,7 +75671,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75539
75671
  config,
75540
75672
  resolveData,
75541
75673
  componentState,
75542
- overrides
75674
+ overrides,
75675
+ globalPermissions
75543
75676
  } = useAppContext2();
75544
75677
  const { data, ui } = state;
75545
75678
  const { itemSelector } = ui;
@@ -75547,16 +75680,16 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75547
75680
  const componentResolving = selectedItem ? (_a3 = componentState[selectedItem == null ? void 0 : selectedItem.props.id]) == null ? void 0 : _a3.loading : (_b2 = componentState["puck-root"]) == null ? void 0 : _b2.loading;
75548
75681
  const isLoading = fieldsResolving || componentResolving;
75549
75682
  const rootProps = data.root.props || data.root;
75550
- const Wrapper = (0, import_react20.useMemo)(() => overrides.fields || DefaultFields, [overrides]);
75551
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
75683
+ const Wrapper = (0, import_react21.useMemo)(() => overrides.fields || DefaultFields, [overrides]);
75684
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
75552
75685
  "form",
75553
75686
  {
75554
- className: getClassName20(),
75687
+ className: getClassName21(),
75555
75688
  onSubmit: (e2) => {
75556
75689
  e2.preventDefault();
75557
75690
  },
75558
75691
  children: [
75559
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Wrapper, { isLoading, itemSelector, children: Object.keys(fields).map((fieldName) => {
75692
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Wrapper, { isLoading, itemSelector, children: Object.keys(fields).map((fieldName) => {
75560
75693
  const field = fields[fieldName];
75561
75694
  if (!(field == null ? void 0 : field.type)) return null;
75562
75695
  const onChange = (value, updatedUi) => {
@@ -75623,13 +75756,18 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75623
75756
  };
75624
75757
  if (selectedItem && itemSelector) {
75625
75758
  const { readOnly = {} } = selectedItem;
75626
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
75759
+ const { edit } = getPermissions({
75760
+ selectedItem,
75761
+ config,
75762
+ globalPermissions: globalPermissions || {}
75763
+ });
75764
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
75627
75765
  AutoFieldPrivate,
75628
75766
  {
75629
75767
  field,
75630
75768
  name: fieldName,
75631
75769
  id: `${selectedItem.props.id}_${fieldName}`,
75632
- readOnly: readOnly[fieldName],
75770
+ readOnly: !edit || readOnly[fieldName],
75633
75771
  value: selectedItem.props[fieldName],
75634
75772
  onChange
75635
75773
  },
@@ -75637,7 +75775,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75637
75775
  );
75638
75776
  } else {
75639
75777
  const { readOnly = {} } = data.root;
75640
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
75778
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
75641
75779
  AutoFieldPrivate,
75642
75780
  {
75643
75781
  field,
@@ -75651,26 +75789,40 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75651
75789
  );
75652
75790
  }
75653
75791
  }) }),
75654
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName20("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getClassName20("loadingOverlayInner"), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Loader2, { size: 16 }) }) })
75792
+ 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)(Loader2, { size: 16 }) }) })
75655
75793
  ]
75656
75794
  }
75657
75795
  );
75658
75796
  };
75659
75797
  init_react_import2();
75660
75798
  init_react_import2();
75661
- var import_react21 = require("react");
75799
+ var import_react222 = require("react");
75662
75800
  init_react_import2();
75663
75801
  init_react_import2();
75664
- var styles_module_default16 = { "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" };
75665
- var import_jsx_runtime27 = require("react/jsx-runtime");
75666
- var getClassName21 = get_class_name_factory_default2("ComponentList", styles_module_default16);
75802
+ 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" };
75803
+ var import_jsx_runtime29 = require("react/jsx-runtime");
75804
+ var getClassName222 = get_class_name_factory_default2("ComponentList", styles_module_default17);
75667
75805
  var ComponentListItem = ({
75668
75806
  name,
75669
75807
  label,
75670
75808
  index
75671
75809
  }) => {
75672
- const { overrides } = useAppContext2();
75673
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Drawer.Item, { label, name, index, children: overrides.componentItem });
75810
+ const { overrides, config, globalPermissions } = useAppContext2();
75811
+ const canInsert = getPermissions({
75812
+ type: name,
75813
+ config,
75814
+ globalPermissions: globalPermissions || {}
75815
+ }).insert;
75816
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
75817
+ Drawer.Item,
75818
+ {
75819
+ label,
75820
+ name,
75821
+ index,
75822
+ isDragDisabled: !canInsert,
75823
+ children: overrides.componentItem
75824
+ }
75825
+ );
75674
75826
  };
75675
75827
  var ComponentList = ({
75676
75828
  children,
@@ -75679,11 +75831,11 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75679
75831
  }) => {
75680
75832
  const { config, state, setUi } = useAppContext2();
75681
75833
  const { expanded = true } = state.ui.componentList[id] || {};
75682
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: getClassName21({ isExpanded: expanded }), children: [
75683
- title && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
75834
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: getClassName222({ isExpanded: expanded }), children: [
75835
+ title && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
75684
75836
  "button",
75685
75837
  {
75686
- className: getClassName21("title"),
75838
+ className: getClassName222("title"),
75687
75839
  onClick: () => setUi({
75688
75840
  componentList: __spreadProps2(__spreadValues2({}, state.ui.componentList), {
75689
75841
  [id]: __spreadProps2(__spreadValues2({}, state.ui.componentList[id]), {
@@ -75693,14 +75845,14 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75693
75845
  }),
75694
75846
  title: expanded ? `Collapse${title ? ` ${title}` : ""}` : `Expand${title ? ` ${title}` : ""}`,
75695
75847
  children: [
75696
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: title }),
75697
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: getClassName21("titleIcon"), children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronUp, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ChevronDown, { size: 12 }) })
75848
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: title }),
75849
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: getClassName222("titleIcon"), children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronUp, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronDown, { size: 12 }) })
75698
75850
  ]
75699
75851
  }
75700
75852
  ),
75701
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: getClassName21("content"), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Drawer, { droppableId: title, children: children || Object.keys(config.components).map((componentKey, i2) => {
75853
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: getClassName222("content"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Drawer, { droppableId: title, children: children || Object.keys(config.components).map((componentKey, i2) => {
75702
75854
  var _a3;
75703
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
75855
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
75704
75856
  ComponentListItem,
75705
75857
  {
75706
75858
  label: (_a3 = config.components[componentKey]["label"]) != null ? _a3 : componentKey,
@@ -75713,10 +75865,10 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75713
75865
  ] });
75714
75866
  };
75715
75867
  ComponentList.Item = ComponentListItem;
75716
- var import_jsx_runtime28 = require("react/jsx-runtime");
75868
+ var import_jsx_runtime30 = require("react/jsx-runtime");
75717
75869
  var useComponentList = (config, ui) => {
75718
- const [componentList, setComponentList] = (0, import_react21.useState)();
75719
- (0, import_react21.useEffect)(() => {
75870
+ const [componentList, setComponentList] = (0, import_react222.useState)();
75871
+ (0, import_react222.useEffect)(() => {
75720
75872
  var _a3, _b2, _c;
75721
75873
  if (Object.keys(ui.componentList).length > 0) {
75722
75874
  const matchedComponents = [];
@@ -75726,7 +75878,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75726
75878
  if (category.visible === false || !category.components) {
75727
75879
  return null;
75728
75880
  }
75729
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
75881
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
75730
75882
  ComponentList,
75731
75883
  {
75732
75884
  id: categoryKey,
@@ -75735,7 +75887,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75735
75887
  var _a22;
75736
75888
  matchedComponents.push(componentName);
75737
75889
  const componentConf = config.components[componentName] || {};
75738
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
75890
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
75739
75891
  ComponentList.Item,
75740
75892
  {
75741
75893
  label: (_a22 = componentConf["label"]) != null ? _a22 : componentName,
@@ -75755,7 +75907,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75755
75907
  );
75756
75908
  if (remainingComponents.length > 0 && !((_a3 = ui.componentList.other) == null ? void 0 : _a3.components) && ((_b2 = ui.componentList.other) == null ? void 0 : _b2.visible) !== false) {
75757
75909
  _componentList.push(
75758
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
75910
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
75759
75911
  ComponentList,
75760
75912
  {
75761
75913
  id: "other",
@@ -75763,7 +75915,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75763
75915
  children: remainingComponents.map((componentName, i2) => {
75764
75916
  var _a22;
75765
75917
  const componentConf = config.components[componentName] || {};
75766
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
75918
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
75767
75919
  ComponentList.Item,
75768
75920
  {
75769
75921
  name: componentName,
@@ -75783,21 +75935,21 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75783
75935
  }, [config.categories, config.components, ui.componentList]);
75784
75936
  return componentList;
75785
75937
  };
75786
- var import_react222 = require("react");
75787
- var import_jsx_runtime29 = require("react/jsx-runtime");
75938
+ var import_react23 = require("react");
75939
+ var import_jsx_runtime31 = require("react/jsx-runtime");
75788
75940
  var Components = () => {
75789
75941
  const { config, state, overrides } = useAppContext2();
75790
75942
  const componentList = useComponentList(config, state.ui);
75791
- const Wrapper = (0, import_react222.useMemo)(() => overrides.components || "div", [overrides]);
75792
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ComponentList, { id: "all" }) });
75943
+ const Wrapper = (0, import_react23.useMemo)(() => overrides.components || "div", [overrides]);
75944
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ComponentList, { id: "all" }) });
75793
75945
  };
75794
75946
  init_react_import2();
75795
- var import_react24 = require("react");
75947
+ var import_react25 = require("react");
75796
75948
  init_react_import2();
75797
- var import_react23 = __toESM2(require("react"));
75949
+ var import_react24 = __toESM2(require("react"));
75798
75950
  var import_react_frame_component = __toESM2(require_lib());
75799
75951
  var import_object_hash = __toESM2(require_object_hash());
75800
- var import_jsx_runtime30 = require("react/jsx-runtime");
75952
+ var import_jsx_runtime322 = require("react/jsx-runtime");
75801
75953
  var styleSelector = 'style, link[rel="stylesheet"]';
75802
75954
  var collectStyles = (doc) => {
75803
75955
  const collected = [];
@@ -75840,7 +75992,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75840
75992
  onStylesLoaded = () => null
75841
75993
  }) => {
75842
75994
  const { document: doc, window: win } = (0, import_react_frame_component.useFrame)();
75843
- (0, import_react23.useEffect)(() => {
75995
+ (0, import_react24.useEffect)(() => {
75844
75996
  if (!win || !doc) {
75845
75997
  return () => {
75846
75998
  };
@@ -75997,23 +76149,23 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
75997
76149
  observer.disconnect();
75998
76150
  };
75999
76151
  }, []);
76000
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children });
76152
+ return /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(import_jsx_runtime322.Fragment, { children });
76001
76153
  };
76002
- var AutoFrameComponent = import_react23.default.forwardRef(
76154
+ var AutoFrameComponent = import_react24.default.forwardRef(
76003
76155
  function(_a3, ref2) {
76004
76156
  var _b2 = _a3, { children, debug, onStylesLoaded } = _b2, props = __objRest2(_b2, ["children", "debug", "onStylesLoaded"]);
76005
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_frame_component.default, __spreadProps2(__spreadValues2({}, props), { ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CopyHostStyles, { debug, onStylesLoaded, children }) }));
76157
+ return /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(import_react_frame_component.default, __spreadProps2(__spreadValues2({}, props), { ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(CopyHostStyles, { debug, onStylesLoaded, children }) }));
76006
76158
  }
76007
76159
  );
76008
76160
  AutoFrameComponent.displayName = "AutoFrameComponent";
76009
76161
  var AutoFrame_default = AutoFrameComponent;
76010
76162
  init_react_import2();
76011
- var styles_module_default17 = { "PuckPreview": "_PuckPreview_rxwlr_1", "PuckPreview-frame": "_PuckPreview-frame_rxwlr_5" };
76012
- var import_jsx_runtime31 = require("react/jsx-runtime");
76013
- var getClassName222 = get_class_name_factory_default2("PuckPreview", styles_module_default17);
76163
+ var styles_module_default18 = { "PuckPreview": "_PuckPreview_rxwlr_1", "PuckPreview-frame": "_PuckPreview-frame_rxwlr_5" };
76164
+ var import_jsx_runtime33 = require("react/jsx-runtime");
76165
+ var getClassName23 = get_class_name_factory_default2("PuckPreview", styles_module_default18);
76014
76166
  var Preview = ({ id = "puck-preview" }) => {
76015
76167
  const { config, dispatch, state, setStatus, iframe } = useAppContext2();
76016
- const Page = (0, import_react24.useCallback)(
76168
+ const Page = (0, import_react25.useCallback)(
76017
76169
  (pageProps) => {
76018
76170
  var _a3, _b2;
76019
76171
  return ((_a3 = config.root) == null ? void 0 : _a3.render) ? (_b2 = config.root) == null ? void 0 : _b2.render(__spreadProps2(__spreadValues2({
@@ -76022,33 +76174,33 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76022
76174
  editMode: true,
76023
76175
  // DEPRECATED
76024
76176
  puck: { renderDropZone: DropZone, isEditing: true }
76025
- })) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children: pageProps.children });
76177
+ })) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: pageProps.children });
76026
76178
  },
76027
76179
  [config.root]
76028
76180
  );
76029
76181
  const rootProps = state.data.root.props || state.data.root;
76030
- const ref2 = (0, import_react24.useRef)(null);
76031
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
76182
+ const ref2 = (0, import_react25.useRef)(null);
76183
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
76032
76184
  "div",
76033
76185
  {
76034
- className: getClassName222(),
76186
+ className: getClassName23(),
76035
76187
  id,
76036
76188
  onClick: () => {
76037
76189
  dispatch({ type: "setUi", ui: __spreadProps2(__spreadValues2({}, state.ui), { itemSelector: null }) });
76038
76190
  },
76039
- children: iframe.enabled ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
76191
+ children: iframe.enabled ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
76040
76192
  AutoFrame_default,
76041
76193
  {
76042
76194
  id: "preview-frame",
76043
- className: getClassName222("frame"),
76195
+ className: getClassName23("frame"),
76044
76196
  "data-rfd-iframe": true,
76045
76197
  ref: ref2,
76046
76198
  onStylesLoaded: () => {
76047
76199
  setStatus("READY");
76048
76200
  },
76049
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Page, __spreadProps2(__spreadValues2({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DropZone, { zone: rootDroppableId2 }) }))
76201
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Page, __spreadProps2(__spreadValues2({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DropZone, { zone: rootDroppableId2 }) }))
76050
76202
  }
76051
- ) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { id: "preview-frame", className: getClassName222("frame"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Page, __spreadProps2(__spreadValues2({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DropZone, { zone: rootDroppableId2 }) })) })
76203
+ ) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { id: "preview-frame", className: getClassName23("frame"), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Page, __spreadProps2(__spreadValues2({ dispatch, state }, rootProps), { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DropZone, { zone: rootDroppableId2 }) })) })
76052
76204
  }
76053
76205
  );
76054
76206
  };
@@ -76070,7 +76222,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76070
76222
  };
76071
76223
  init_react_import2();
76072
76224
  init_react_import2();
76073
- var styles_module_default18 = { "LayerTree": "_LayerTree_1pgw8_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_1pgw8_11", "LayerTree-helper": "_LayerTree-helper_1pgw8_17", "Layer": "_Layer_1pgw8_1", "Layer-inner": "_Layer-inner_1pgw8_29", "Layer--containsZone": "_Layer--containsZone_1pgw8_35", "Layer-clickable": "_Layer-clickable_1pgw8_39", "Layer--isSelected": "_Layer--isSelected_1pgw8_61", "Layer-chevron": "_Layer-chevron_1pgw8_77", "Layer--childIsSelected": "_Layer--childIsSelected_1pgw8_78", "Layer-zones": "_Layer-zones_1pgw8_82", "Layer-title": "_Layer-title_1pgw8_96", "Layer-name": "_Layer-name_1pgw8_105", "Layer-icon": "_Layer-icon_1pgw8_111", "Layer-zoneIcon": "_Layer-zoneIcon_1pgw8_116" };
76225
+ var styles_module_default19 = { "LayerTree": "_LayerTree_1pgw8_1", "LayerTree-zoneTitle": "_LayerTree-zoneTitle_1pgw8_11", "LayerTree-helper": "_LayerTree-helper_1pgw8_17", "Layer": "_Layer_1pgw8_1", "Layer-inner": "_Layer-inner_1pgw8_29", "Layer--containsZone": "_Layer--containsZone_1pgw8_35", "Layer-clickable": "_Layer-clickable_1pgw8_39", "Layer--isSelected": "_Layer--isSelected_1pgw8_61", "Layer-chevron": "_Layer-chevron_1pgw8_77", "Layer--childIsSelected": "_Layer--childIsSelected_1pgw8_78", "Layer-zones": "_Layer-zones_1pgw8_82", "Layer-title": "_Layer-title_1pgw8_96", "Layer-name": "_Layer-name_1pgw8_105", "Layer-icon": "_Layer-icon_1pgw8_111", "Layer-zoneIcon": "_Layer-zoneIcon_1pgw8_116" };
76074
76226
  init_react_import2();
76075
76227
  var scrollIntoView2 = (el) => {
76076
76228
  const oldStyle = __spreadValues2({}, el.style);
@@ -76080,7 +76232,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76080
76232
  el.style.scrollMargin = oldStyle.scrollMargin || "";
76081
76233
  }
76082
76234
  };
76083
- var import_react25 = require("react");
76235
+ var import_react26 = require("react");
76084
76236
  init_react_import2();
76085
76237
  var isChildOfZone = (item, maybeChild, ctx) => {
76086
76238
  var _a3;
@@ -76090,9 +76242,9 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76090
76242
  return area === item.props.id;
76091
76243
  })) : false;
76092
76244
  };
76093
- var import_jsx_runtime322 = require("react/jsx-runtime");
76094
- var getClassName23 = get_class_name_factory_default2("LayerTree", styles_module_default18);
76095
- var getClassNameLayer = get_class_name_factory_default2("Layer", styles_module_default18);
76245
+ var import_jsx_runtime34 = require("react/jsx-runtime");
76246
+ var getClassName24 = get_class_name_factory_default2("LayerTree", styles_module_default19);
76247
+ var getClassNameLayer = get_class_name_factory_default2("Layer", styles_module_default19);
76096
76248
  var LayerTree = ({
76097
76249
  data,
76098
76250
  config,
@@ -76103,15 +76255,15 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76103
76255
  label
76104
76256
  }) => {
76105
76257
  const zones = data.zones || {};
76106
- const ctx = (0, import_react25.useContext)(dropZoneContext2);
76107
- return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(import_jsx_runtime322.Fragment, { children: [
76108
- label && /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: getClassName23("zoneTitle"), children: [
76109
- /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: getClassName23("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Layers, { size: "16" }) }),
76258
+ const ctx = (0, import_react26.useContext)(dropZoneContext2);
76259
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
76260
+ label && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassName24("zoneTitle"), children: [
76261
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Layers, { size: "16" }) }),
76110
76262
  " ",
76111
76263
  label
76112
76264
  ] }),
76113
- /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("ul", { className: getClassName23(), children: [
76114
- zoneContent.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: getClassName23("helper"), children: "No items" }),
76265
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("ul", { className: getClassName24(), children: [
76266
+ zoneContent.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("helper"), children: "No items" }),
76115
76267
  zoneContent.map((item, i2) => {
76116
76268
  var _a3;
76117
76269
  const isSelected = (itemSelector == null ? void 0 : itemSelector.index) === i2 && (itemSelector.zone === zone || itemSelector.zone === rootDroppableId2 && !zone);
@@ -76129,7 +76281,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76129
76281
  const childIsSelected = isChildOfZone(item, selectedItem, ctx);
76130
76282
  const componentConfig = config.components[item.type];
76131
76283
  const label2 = (_a3 = componentConfig == null ? void 0 : componentConfig["label"]) != null ? _a3 : item.type.toString();
76132
- return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(
76284
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
76133
76285
  "li",
76134
76286
  {
76135
76287
  className: getClassNameLayer({
@@ -76139,7 +76291,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76139
76291
  childIsSelected
76140
76292
  }),
76141
76293
  children: [
76142
- /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(
76294
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("inner"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
76143
76295
  "button",
76144
76296
  {
76145
76297
  className: getClassNameLayer("clickable"),
@@ -76171,22 +76323,22 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76171
76323
  setHoveringComponent(null);
76172
76324
  },
76173
76325
  children: [
76174
- containsZone && /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
76326
+ containsZone && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
76175
76327
  "div",
76176
76328
  {
76177
76329
  className: getClassNameLayer("chevron"),
76178
76330
  title: isSelected ? "Collapse" : "Expand",
76179
- children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(ChevronDown, { size: "12" })
76331
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ChevronDown, { size: "12" })
76180
76332
  }
76181
76333
  ),
76182
- /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: getClassNameLayer("title"), children: [
76183
- /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: getClassNameLayer("icon"), children: item.type === "Text" || item.type === "Heading" ? /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Type, { size: "16" }) : /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(LayoutGrid, { size: "16" }) }),
76184
- /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: getClassNameLayer("name"), children: label2 })
76334
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassNameLayer("title"), children: [
76335
+ /* @__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" }) }),
76336
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("name"), children: label2 })
76185
76337
  ] })
76186
76338
  ]
76187
76339
  }
76188
76340
  ) }),
76189
- containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: getClassNameLayer("zones"), children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
76341
+ containsZone && Object.keys(zonesForItem).map((zoneKey, idx) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassNameLayer("zones"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
76190
76342
  LayerTree,
76191
76343
  {
76192
76344
  config,
@@ -76206,13 +76358,13 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76206
76358
  ] })
76207
76359
  ] });
76208
76360
  };
76209
- var import_react26 = require("react");
76210
- var import_jsx_runtime33 = require("react/jsx-runtime");
76361
+ var import_react27 = require("react");
76362
+ var import_jsx_runtime35 = require("react/jsx-runtime");
76211
76363
  var Outline = () => {
76212
76364
  const { dispatch, state, overrides, config } = useAppContext2();
76213
76365
  const { data, ui } = state;
76214
76366
  const { itemSelector } = ui;
76215
- const setItemSelector = (0, import_react26.useCallback)(
76367
+ const setItemSelector = (0, import_react27.useCallback)(
76216
76368
  (newItemSelector) => {
76217
76369
  dispatch({
76218
76370
  type: "setUi",
@@ -76221,9 +76373,9 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76221
76373
  },
76222
76374
  []
76223
76375
  );
76224
- const Wrapper = (0, import_react26.useMemo)(() => overrides.outline || "div", [overrides]);
76225
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(dropZoneContext2.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
76226
- (ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId2]) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
76376
+ const Wrapper = (0, import_react27.useMemo)(() => overrides.outline || "div", [overrides]);
76377
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(dropZoneContext2.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
76378
+ (ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId2]) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
76227
76379
  LayerTree,
76228
76380
  {
76229
76381
  config,
@@ -76236,7 +76388,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76236
76388
  ),
76237
76389
  Object.entries(findZonesForArea(data, "root")).map(
76238
76390
  ([zoneKey, zone]) => {
76239
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
76391
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
76240
76392
  LayerTree,
76241
76393
  {
76242
76394
  config,
@@ -76254,35 +76406,6 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76254
76406
  ] }) }) });
76255
76407
  };
76256
76408
  init_react_import2();
76257
- var loadOverrides = ({
76258
- overrides,
76259
- plugins
76260
- }) => {
76261
- const collected = __spreadValues2({}, overrides);
76262
- plugins.forEach((plugin) => {
76263
- Object.keys(plugin.overrides).forEach((overridesType) => {
76264
- if (overridesType === "fieldTypes") {
76265
- const fieldTypes = plugin.overrides.fieldTypes;
76266
- Object.keys(fieldTypes).forEach((fieldType) => {
76267
- collected.fieldTypes = collected.fieldTypes || {};
76268
- const childNode2 = collected.fieldTypes[fieldType];
76269
- const Comp2 = (props) => fieldTypes[fieldType](__spreadProps2(__spreadValues2({}, props), {
76270
- children: childNode2 ? childNode2(props) : props.children
76271
- }));
76272
- collected.fieldTypes[fieldType] = Comp2;
76273
- });
76274
- return;
76275
- }
76276
- const childNode = collected[overridesType];
76277
- const Comp = (props) => plugin.overrides[overridesType](__spreadProps2(__spreadValues2({}, props), {
76278
- children: childNode ? childNode(props) : props.children
76279
- }));
76280
- collected[overridesType] = Comp;
76281
- });
76282
- });
76283
- return collected;
76284
- };
76285
- init_react_import2();
76286
76409
  var import_react_hotkeys_hook = (init_react_hotkeys_hook_esm(), __toCommonJS(react_hotkeys_hook_esm_exports));
76287
76410
  function usePuckHistory({
76288
76411
  dispatch,
@@ -76335,19 +76458,19 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76335
76458
  };
76336
76459
  }
76337
76460
  init_react_import2();
76338
- var import_react27 = require("react");
76461
+ var import_react28 = require("react");
76339
76462
  var import_use_debounce3 = (init_index_module(), __toCommonJS(index_module_exports));
76340
76463
  var EMPTY_HISTORY_INDEX = -1;
76341
76464
  function useHistoryStore(initialHistory) {
76342
76465
  var _a3, _b2;
76343
- const [histories, setHistories] = (0, import_react27.useState)(
76466
+ const [histories, setHistories] = (0, import_react28.useState)(
76344
76467
  (_a3 = initialHistory == null ? void 0 : initialHistory.histories) != null ? _a3 : []
76345
76468
  );
76346
76469
  const updateHistories = (histories2) => {
76347
76470
  setHistories(histories2);
76348
76471
  setIndex(histories2.length - 1);
76349
76472
  };
76350
- const [index, setIndex] = (0, import_react27.useState)(
76473
+ const [index, setIndex] = (0, import_react28.useState)(
76351
76474
  (_b2 = initialHistory == null ? void 0 : initialHistory.index) != null ? _b2 : EMPTY_HISTORY_INDEX
76352
76475
  );
76353
76476
  const hasPast = index > EMPTY_HISTORY_INDEX;
@@ -76497,19 +76620,19 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76497
76620
  var styles = window.getComputedStyle(el);
76498
76621
  return calculateBox3(borderBox, styles);
76499
76622
  };
76500
- var import_react29 = require("react");
76623
+ var import_react30 = require("react");
76501
76624
  init_react_import2();
76502
- var import_react28 = require("react");
76625
+ var import_react29 = require("react");
76503
76626
  init_react_import2();
76504
- var styles_module_default19 = { "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" };
76505
- var import_jsx_runtime34 = require("react/jsx-runtime");
76627
+ 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" };
76628
+ var import_jsx_runtime36 = require("react/jsx-runtime");
76506
76629
  var icons = {
76507
- Smartphone: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Smartphone, { size: 16 }),
76508
- Tablet: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Tablet, { size: 16 }),
76509
- Monitor: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Monitor, { size: 16 })
76630
+ Smartphone: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Smartphone, { size: 16 }),
76631
+ Tablet: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Tablet, { size: 16 }),
76632
+ Monitor: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Monitor, { size: 16 })
76510
76633
  };
76511
- var getClassName24 = get_class_name_factory_default2("ViewportControls", styles_module_default19);
76512
- var getClassNameButton = get_class_name_factory_default2("ViewportButton", styles_module_default19);
76634
+ var getClassName25 = get_class_name_factory_default2("ViewportControls", styles_module_default20);
76635
+ var getClassNameButton = get_class_name_factory_default2("ViewportButton", styles_module_default20);
76513
76636
  var ViewportButton = ({
76514
76637
  children,
76515
76638
  height = "auto",
@@ -76518,11 +76641,11 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76518
76641
  onClick
76519
76642
  }) => {
76520
76643
  const { state } = useAppContext2();
76521
- const [isActive2, setIsActive] = (0, import_react28.useState)(false);
76522
- (0, import_react28.useEffect)(() => {
76644
+ const [isActive2, setIsActive] = (0, import_react29.useState)(false);
76645
+ (0, import_react29.useEffect)(() => {
76523
76646
  setIsActive(width === state.ui.viewports.current.width);
76524
76647
  }, [width, state.ui.viewports.current.width]);
76525
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: getClassNameButton({ isActive: isActive2 }), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
76648
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: getClassNameButton({ isActive: isActive2 }), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
76526
76649
  IconButton,
76527
76650
  {
76528
76651
  title,
@@ -76531,7 +76654,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76531
76654
  e2.stopPropagation();
76532
76655
  onClick({ width, height });
76533
76656
  },
76534
- children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: getClassNameButton("inner"), children })
76657
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: getClassNameButton("inner"), children })
76535
76658
  }
76536
76659
  ) });
76537
76660
  };
@@ -76555,7 +76678,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76555
76678
  const defaultsContainAutoZoom = defaultZoomOptions.find(
76556
76679
  (option) => option.value === autoZoom
76557
76680
  );
76558
- const zoomOptions = (0, import_react28.useMemo)(
76681
+ const zoomOptions = (0, import_react29.useMemo)(
76559
76682
  () => [
76560
76683
  ...defaultZoomOptions,
76561
76684
  ...defaultsContainAutoZoom ? [] : [
@@ -76567,8 +76690,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76567
76690
  ].filter((a2) => a2.value <= autoZoom).sort((a2, b) => a2.value > b.value ? 1 : -1),
76568
76691
  [autoZoom]
76569
76692
  );
76570
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassName24(), children: [
76571
- viewports.map((viewport, i2) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
76693
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: getClassName25(), children: [
76694
+ viewports.map((viewport, i2) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
76572
76695
  ViewportButton,
76573
76696
  {
76574
76697
  height: viewport.height,
@@ -76579,8 +76702,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76579
76702
  },
76580
76703
  i2
76581
76704
  )),
76582
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("divider") }),
76583
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
76705
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getClassName25("divider") }),
76706
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
76584
76707
  IconButton,
76585
76708
  {
76586
76709
  title: "Zoom viewport out",
@@ -76594,10 +76717,10 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76594
76717
  )].value
76595
76718
  );
76596
76719
  },
76597
- children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ZoomOut, { size: 16 })
76720
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ZoomOut, { size: 16 })
76598
76721
  }
76599
76722
  ),
76600
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
76723
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
76601
76724
  IconButton,
76602
76725
  {
76603
76726
  title: "Zoom viewport in",
@@ -76611,19 +76734,19 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76611
76734
  )].value
76612
76735
  );
76613
76736
  },
76614
- children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ZoomIn, { size: 16 })
76737
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ZoomIn, { size: 16 })
76615
76738
  }
76616
76739
  ),
76617
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("divider") }),
76618
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
76740
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getClassName25("divider") }),
76741
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
76619
76742
  "select",
76620
76743
  {
76621
- className: getClassName24("zoomSelect"),
76744
+ className: getClassName25("zoomSelect"),
76622
76745
  value: zoom.toString(),
76623
76746
  onChange: (e2) => {
76624
76747
  onZoom(parseFloat(e2.currentTarget.value));
76625
76748
  },
76626
- children: zoomOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
76749
+ children: zoomOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
76627
76750
  "option",
76628
76751
  {
76629
76752
  value: option.value,
@@ -76636,7 +76759,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76636
76759
  ] });
76637
76760
  };
76638
76761
  init_react_import2();
76639
- var styles_module_default20 = { "PuckCanvas": "_PuckCanvas_6zd4y_1", "PuckCanvas-controls": "_PuckCanvas-controls_6zd4y_16", "PuckCanvas-inner": "_PuckCanvas-inner_6zd4y_21", "PuckCanvas-root": "_PuckCanvas-root_6zd4y_32", "PuckCanvas--ready": "_PuckCanvas--ready_6zd4y_56" };
76762
+ var styles_module_default21 = { "PuckCanvas": "_PuckCanvas_6zd4y_1", "PuckCanvas-controls": "_PuckCanvas-controls_6zd4y_16", "PuckCanvas-inner": "_PuckCanvas-inner_6zd4y_21", "PuckCanvas-root": "_PuckCanvas-root_6zd4y_32", "PuckCanvas--ready": "_PuckCanvas--ready_6zd4y_56" };
76640
76763
  init_react_import2();
76641
76764
  var RESET_ZOOM_SMALLER_THAN_FRAME = true;
76642
76765
  var getZoomConfig = (uiViewport, frame, zoom) => {
@@ -76665,24 +76788,24 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76665
76788
  }
76666
76789
  return { autoZoom, rootHeight, zoom };
76667
76790
  };
76668
- var import_jsx_runtime35 = require("react/jsx-runtime");
76669
- var getClassName25 = get_class_name_factory_default2("PuckCanvas", styles_module_default20);
76791
+ var import_jsx_runtime37 = require("react/jsx-runtime");
76792
+ var getClassName26 = get_class_name_factory_default2("PuckCanvas", styles_module_default21);
76670
76793
  var ZOOM_ON_CHANGE = true;
76671
76794
  var Canvas = () => {
76672
76795
  const { status, iframe } = useAppContext2();
76673
76796
  const { dispatch, state, overrides, setUi, zoomConfig, setZoomConfig } = useAppContext2();
76674
76797
  const { ui } = state;
76675
- const frameRef = (0, import_react29.useRef)(null);
76676
- const [showTransition, setShowTransition] = (0, import_react29.useState)(false);
76677
- const defaultRender = (0, import_react29.useMemo)(() => {
76678
- const PuckDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children });
76798
+ const frameRef = (0, import_react30.useRef)(null);
76799
+ const [showTransition, setShowTransition] = (0, import_react30.useState)(false);
76800
+ const defaultRender = (0, import_react30.useMemo)(() => {
76801
+ const PuckDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children });
76679
76802
  return PuckDefault;
76680
76803
  }, []);
76681
- const CustomPreview = (0, import_react29.useMemo)(
76804
+ const CustomPreview = (0, import_react30.useMemo)(
76682
76805
  () => overrides.preview || defaultRender,
76683
76806
  [overrides]
76684
76807
  );
76685
- const getFrameDimensions = (0, import_react29.useCallback)(() => {
76808
+ const getFrameDimensions = (0, import_react30.useCallback)(() => {
76686
76809
  if (frameRef.current) {
76687
76810
  const frame = frameRef.current;
76688
76811
  const box = getBox3(frame);
@@ -76690,7 +76813,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76690
76813
  }
76691
76814
  return { width: 0, height: 0 };
76692
76815
  }, [frameRef]);
76693
- const resetAutoZoom = (0, import_react29.useCallback)(
76816
+ const resetAutoZoom = (0, import_react30.useCallback)(
76694
76817
  (ui2 = state.ui) => {
76695
76818
  if (frameRef.current) {
76696
76819
  setZoomConfig(
@@ -76700,11 +76823,11 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76700
76823
  },
76701
76824
  [frameRef, zoomConfig, state.ui]
76702
76825
  );
76703
- (0, import_react29.useEffect)(() => {
76826
+ (0, import_react30.useEffect)(() => {
76704
76827
  setShowTransition(false);
76705
76828
  resetAutoZoom();
76706
76829
  }, [frameRef, ui.leftSideBarVisible, ui.rightSideBarVisible]);
76707
- (0, import_react29.useEffect)(() => {
76830
+ (0, import_react30.useEffect)(() => {
76708
76831
  const { height: frameHeight } = getFrameDimensions();
76709
76832
  if (ui.viewports.current.height === "auto") {
76710
76833
  setZoomConfig(__spreadProps2(__spreadValues2({}, zoomConfig), {
@@ -76712,7 +76835,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76712
76835
  }));
76713
76836
  }
76714
76837
  }, [zoomConfig.zoom]);
76715
- (0, import_react29.useEffect)(() => {
76838
+ (0, import_react30.useEffect)(() => {
76716
76839
  const observer = new ResizeObserver(() => {
76717
76840
  setShowTransition(false);
76718
76841
  resetAutoZoom();
@@ -76724,10 +76847,10 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76724
76847
  observer.disconnect();
76725
76848
  };
76726
76849
  }, []);
76727
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
76850
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
76728
76851
  "div",
76729
76852
  {
76730
- className: getClassName25({
76853
+ className: getClassName26({
76731
76854
  ready: status === "READY" || !iframe.enabled
76732
76855
  }),
76733
76856
  onClick: () => dispatch({
@@ -76736,7 +76859,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76736
76859
  recordHistory: true
76737
76860
  }),
76738
76861
  children: [
76739
- ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getClassName25("controls"), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
76862
+ ui.viewports.controlsVisible && iframe.enabled && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getClassName26("controls"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
76740
76863
  ViewportControls,
76741
76864
  {
76742
76865
  autoZoom: zoomConfig.autoZoom,
@@ -76761,10 +76884,10 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76761
76884
  }
76762
76885
  }
76763
76886
  ) }),
76764
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getClassName25("inner"), ref: frameRef, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
76887
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: getClassName26("inner"), ref: frameRef, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
76765
76888
  "div",
76766
76889
  {
76767
- className: getClassName25("root"),
76890
+ className: getClassName26("root"),
76768
76891
  style: {
76769
76892
  width: iframe.enabled ? ui.viewports.current.width : "100%",
76770
76893
  height: zoomConfig.rootHeight,
@@ -76773,7 +76896,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76773
76896
  overflow: iframe.enabled ? void 0 : "auto"
76774
76897
  },
76775
76898
  suppressHydrationWarning: true,
76776
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Preview, {}) })
76899
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Preview, {}) })
76777
76900
  }
76778
76901
  ) })
76779
76902
  ]
@@ -76810,9 +76933,9 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76810
76933
  ui: __spreadProps2(__spreadValues2({}, state.ui), { itemSelector })
76811
76934
  });
76812
76935
  };
76813
- var import_jsx_runtime36 = require("react/jsx-runtime");
76814
- var getClassName26 = get_class_name_factory_default2("Puck", styles_module_default14);
76815
- var getLayoutClassName = get_class_name_factory_default2("PuckLayout", styles_module_default14);
76936
+ var import_jsx_runtime38 = require("react/jsx-runtime");
76937
+ var getClassName27 = get_class_name_factory_default2("Puck", styles_module_default15);
76938
+ var getLayoutClassName = get_class_name_factory_default2("PuckLayout", styles_module_default15);
76816
76939
  function Puck({
76817
76940
  children,
76818
76941
  config,
@@ -76821,6 +76944,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76821
76944
  onChange,
76822
76945
  onPublish,
76823
76946
  onAction,
76947
+ permissions = {},
76824
76948
  plugins = [],
76825
76949
  overrides = {},
76826
76950
  renderHeader,
@@ -76836,10 +76960,10 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76836
76960
  }) {
76837
76961
  var _a3;
76838
76962
  const historyStore = useHistoryStore(initialHistory);
76839
- const [reducer2] = (0, import_react30.useState)(
76963
+ const [reducer2] = (0, import_react31.useState)(
76840
76964
  () => createReducer({ config, record: historyStore.record, onAction })
76841
76965
  );
76842
- const [initialAppState] = (0, import_react30.useState)(() => {
76966
+ const [initialAppState] = (0, import_react31.useState)(() => {
76843
76967
  var _a22, _b2, _c, _d, _e, _f, _g;
76844
76968
  const initial = __spreadValues2(__spreadValues2({}, defaultAppState2.ui), initialUi);
76845
76969
  let clientUiState = {};
@@ -76897,7 +77021,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76897
77021
  })
76898
77022
  });
76899
77023
  });
76900
- const [appState, dispatch] = (0, import_react30.useReducer)(
77024
+ const [appState, dispatch] = (0, import_react31.useReducer)(
76901
77025
  reducer2,
76902
77026
  flushZones(initialAppState)
76903
77027
  );
@@ -76908,9 +77032,9 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76908
77032
  config,
76909
77033
  dispatch
76910
77034
  );
76911
- const [menuOpen, setMenuOpen] = (0, import_react30.useState)(false);
77035
+ const [menuOpen, setMenuOpen] = (0, import_react31.useState)(false);
76912
77036
  const { itemSelector, leftSideBarVisible, rightSideBarVisible } = ui;
76913
- const setItemSelector = (0, import_react30.useCallback)(
77037
+ const setItemSelector = (0, import_react31.useCallback)(
76914
77038
  (newItemSelector) => {
76915
77039
  if (newItemSelector === itemSelector) return;
76916
77040
  dispatch({
@@ -76922,13 +77046,13 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76922
77046
  [itemSelector]
76923
77047
  );
76924
77048
  const selectedItem = itemSelector ? getItem2(itemSelector, data) : null;
76925
- (0, import_react30.useEffect)(() => {
77049
+ (0, import_react31.useEffect)(() => {
76926
77050
  if (onChange) onChange(data);
76927
77051
  }, [data]);
76928
77052
  const { onDragStartOrUpdate, placeholderStyle } = usePlaceholderStyle();
76929
- const [draggedItem, setDraggedItem] = (0, import_react30.useState)();
77053
+ const [draggedItem, setDraggedItem] = (0, import_react31.useState)();
76930
77054
  const rootProps = data.root.props || data.root;
76931
- const toggleSidebars = (0, import_react30.useCallback)(
77055
+ const toggleSidebars = (0, import_react31.useCallback)(
76932
77056
  (sidebar) => {
76933
77057
  const widerViewport = window.matchMedia("(min-width: 638px)").matches;
76934
77058
  const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
@@ -76942,7 +77066,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76942
77066
  },
76943
77067
  [dispatch, leftSideBarVisible, rightSideBarVisible]
76944
77068
  );
76945
- (0, import_react30.useEffect)(() => {
77069
+ (0, import_react31.useEffect)(() => {
76946
77070
  if (!window.matchMedia("(min-width: 638px)").matches) {
76947
77071
  dispatch({
76948
77072
  type: "setUi",
@@ -76965,11 +77089,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76965
77089
  window.removeEventListener("resize", handleResize);
76966
77090
  };
76967
77091
  }, []);
76968
- const defaultRender = (0, import_react30.useMemo)(() => {
76969
- const PuckDefault = ({ children: children2 }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_jsx_runtime36.Fragment, { children: children2 });
76970
- return PuckDefault;
76971
- }, []);
76972
- const defaultHeaderRender = (0, import_react30.useMemo)(() => {
77092
+ const defaultHeaderRender = (0, import_react31.useMemo)(() => {
76973
77093
  if (renderHeader) {
76974
77094
  console.warn(
76975
77095
  "`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
@@ -76977,48 +77097,49 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
76977
77097
  const RenderHeader = (_a22) => {
76978
77098
  var _b2 = _a22, { actions } = _b2, props = __objRest2(_b2, ["actions"]);
76979
77099
  const Comp = renderHeader;
76980
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Comp, __spreadProps2(__spreadValues2({}, props), { dispatch, state: appState, children: actions }));
77100
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, __spreadProps2(__spreadValues2({}, props), { dispatch, state: appState, children: actions }));
76981
77101
  };
76982
77102
  return RenderHeader;
76983
77103
  }
76984
- return defaultRender;
77104
+ return DefaultOverride;
76985
77105
  }, [renderHeader]);
76986
- const defaultHeaderActionsRender = (0, import_react30.useMemo)(() => {
77106
+ const defaultHeaderActionsRender = (0, import_react31.useMemo)(() => {
76987
77107
  if (renderHeaderActions) {
76988
77108
  console.warn(
76989
77109
  "`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
76990
77110
  );
76991
77111
  const RenderHeader = (props) => {
76992
77112
  const Comp = renderHeaderActions;
76993
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Comp, __spreadProps2(__spreadValues2({}, props), { dispatch, state: appState }));
77113
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Comp, __spreadProps2(__spreadValues2({}, props), { dispatch, state: appState }));
76994
77114
  };
76995
77115
  return RenderHeader;
76996
77116
  }
76997
- return defaultRender;
77117
+ return DefaultOverride;
76998
77118
  }, [renderHeader]);
76999
- const loadedOverrides = (0, import_react30.useMemo)(() => {
77000
- return loadOverrides({ overrides, plugins });
77001
- }, [plugins]);
77002
- const CustomPuck = (0, import_react30.useMemo)(
77003
- () => loadedOverrides.puck || defaultRender,
77119
+ const loadedOverrides = useLoadedOverrides({
77120
+ overrides,
77121
+ plugins
77122
+ });
77123
+ const CustomPuck = (0, import_react31.useMemo)(
77124
+ () => loadedOverrides.puck || DefaultOverride,
77004
77125
  [loadedOverrides]
77005
77126
  );
77006
- const CustomHeader = (0, import_react30.useMemo)(
77127
+ const CustomHeader = (0, import_react31.useMemo)(
77007
77128
  () => loadedOverrides.header || defaultHeaderRender,
77008
77129
  [loadedOverrides]
77009
77130
  );
77010
- const CustomHeaderActions = (0, import_react30.useMemo)(
77131
+ const CustomHeaderActions = (0, import_react31.useMemo)(
77011
77132
  () => loadedOverrides.headerActions || defaultHeaderActionsRender,
77012
77133
  [loadedOverrides]
77013
77134
  );
77014
- const [mounted, setMounted] = (0, import_react30.useState)(false);
77015
- (0, import_react30.useEffect)(() => {
77135
+ const [mounted, setMounted] = (0, import_react31.useState)(false);
77136
+ (0, import_react31.useEffect)(() => {
77016
77137
  setMounted(true);
77017
77138
  }, []);
77018
77139
  const selectedComponentConfig = selectedItem && config.components[selectedItem.type];
77019
77140
  const selectedComponentLabel = selectedItem ? (_a3 = selectedComponentConfig == null ? void 0 : selectedComponentConfig["label"]) != null ? _a3 : selectedItem.type.toString() : "";
77020
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: `Puck ${getClassName26()}`, children: [
77021
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77141
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: `Puck ${getClassName27()}`, children: [
77142
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77022
77143
  AppProvider,
77023
77144
  {
77024
77145
  value: {
@@ -77031,9 +77152,16 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77031
77152
  overrides: loadedOverrides,
77032
77153
  history,
77033
77154
  viewports,
77034
- iframe
77155
+ iframe,
77156
+ globalPermissions: __spreadValues2({
77157
+ delete: true,
77158
+ drag: true,
77159
+ duplicate: true,
77160
+ insert: true,
77161
+ edit: true
77162
+ }, permissions)
77035
77163
  },
77036
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77164
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77037
77165
  DragDropContext2,
77038
77166
  {
77039
77167
  autoScrollerOptions: { disabled: dnd == null ? void 0 : dnd.disableAutoScroll },
@@ -77085,7 +77213,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77085
77213
  });
77086
77214
  }
77087
77215
  },
77088
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77216
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77089
77217
  DropZoneProvider,
77090
77218
  {
77091
77219
  value: {
@@ -77099,7 +77227,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77099
77227
  mode: "edit",
77100
77228
  areaId: "root"
77101
77229
  },
77102
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77230
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77103
77231
  "div",
77104
77232
  {
77105
77233
  className: getLayoutClassName({
@@ -77108,64 +77236,64 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77108
77236
  mounted,
77109
77237
  rightSideBarVisible
77110
77238
  }),
77111
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: getLayoutClassName("inner"), children: [
77112
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77239
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("inner"), children: [
77240
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77113
77241
  CustomHeader,
77114
77242
  {
77115
- actions: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_jsx_runtime36.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77243
+ 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)(
77116
77244
  Button,
77117
77245
  {
77118
77246
  onClick: () => {
77119
77247
  onPublish && onPublish(data);
77120
77248
  },
77121
- icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Globe, { size: "14px" }),
77249
+ icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Globe, { size: "14px" }),
77122
77250
  children: "Publish"
77123
77251
  }
77124
77252
  ) }) }),
77125
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("header", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: getLayoutClassName("headerInner"), children: [
77126
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: getLayoutClassName("headerToggle"), children: [
77127
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77253
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("header", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("headerInner"), children: [
77254
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("headerToggle"), children: [
77255
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77128
77256
  "div",
77129
77257
  {
77130
77258
  className: getLayoutClassName(
77131
77259
  "leftSideBarToggle"
77132
77260
  ),
77133
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77261
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77134
77262
  IconButton,
77135
77263
  {
77136
77264
  onClick: () => {
77137
77265
  toggleSidebars("left");
77138
77266
  },
77139
77267
  title: "Toggle left sidebar",
77140
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PanelLeft, { focusable: "false" })
77268
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelLeft, { focusable: "false" })
77141
77269
  }
77142
77270
  )
77143
77271
  }
77144
77272
  ),
77145
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77273
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77146
77274
  "div",
77147
77275
  {
77148
77276
  className: getLayoutClassName(
77149
77277
  "rightSideBarToggle"
77150
77278
  ),
77151
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77279
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77152
77280
  IconButton,
77153
77281
  {
77154
77282
  onClick: () => {
77155
77283
  toggleSidebars("right");
77156
77284
  },
77157
77285
  title: "Toggle right sidebar",
77158
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PanelRight, { focusable: "false" })
77286
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelRight, { focusable: "false" })
77159
77287
  }
77160
77288
  )
77161
77289
  }
77162
77290
  )
77163
77291
  ] }),
77164
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getLayoutClassName("headerTitle"), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Heading2, { rank: 2, size: "xs", children: [
77292
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getLayoutClassName("headerTitle"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Heading2, { rank: 2, size: "xs", children: [
77165
77293
  headerTitle || rootProps.title || "Page",
77166
- headerPath && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
77294
+ headerPath && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
77167
77295
  " ",
77168
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77296
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77169
77297
  "code",
77170
77298
  {
77171
77299
  className: getLayoutClassName("headerPath"),
@@ -77174,18 +77302,18 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77174
77302
  )
77175
77303
  ] })
77176
77304
  ] }) }),
77177
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: getLayoutClassName("headerTools"), children: [
77178
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getLayoutClassName("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77305
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("headerTools"), children: [
77306
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getLayoutClassName("menuButton"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77179
77307
  IconButton,
77180
77308
  {
77181
77309
  onClick: () => {
77182
77310
  return setMenuOpen(!menuOpen);
77183
77311
  },
77184
77312
  title: "Toggle menu bar",
77185
- children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronDown, { focusable: "false" })
77313
+ children: menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronUp, { focusable: "false" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChevronDown, { focusable: "false" })
77186
77314
  }
77187
77315
  ) }),
77188
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77316
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77189
77317
  MenuBar,
77190
77318
  {
77191
77319
  appState,
@@ -77193,13 +77321,13 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77193
77321
  dispatch,
77194
77322
  onPublish,
77195
77323
  menuOpen,
77196
- renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77324
+ renderHeaderActions: () => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77197
77325
  Button,
77198
77326
  {
77199
77327
  onClick: () => {
77200
77328
  onPublish && onPublish(data);
77201
77329
  },
77202
- icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Globe, { size: "14px" }),
77330
+ icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Globe, { size: "14px" }),
77203
77331
  children: "Publish"
77204
77332
  }
77205
77333
  ) }),
@@ -77210,19 +77338,19 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77210
77338
  ] }) })
77211
77339
  }
77212
77340
  ),
77213
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: getLayoutClassName("leftSideBar"), children: [
77214
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SidebarSection2, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Components, {}) }),
77215
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SidebarSection2, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Outline, {}) })
77341
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getLayoutClassName("leftSideBar"), children: [
77342
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SidebarSection2, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Components, {}) }),
77343
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SidebarSection2, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Outline, {}) })
77216
77344
  ] }),
77217
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Canvas, {}),
77218
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getLayoutClassName("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
77345
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Canvas, {}),
77346
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getLayoutClassName("rightSideBar"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
77219
77347
  SidebarSection2,
77220
77348
  {
77221
77349
  noPadding: true,
77222
77350
  noBorderTop: true,
77223
77351
  showBreadcrumbs: true,
77224
77352
  title: selectedItem ? selectedComponentLabel : "Page",
77225
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Fields, {})
77353
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Fields, {})
77226
77354
  }
77227
77355
  ) })
77228
77356
  ] })
@@ -77234,7 +77362,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77234
77362
  )
77235
77363
  }
77236
77364
  ),
77237
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { id: "puck-portal-root", className: getClassName26("portal") })
77365
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { id: "puck-portal-root", className: getClassName27("portal") })
77238
77366
  ] });
77239
77367
  }
77240
77368
  Puck.Components = Components;
@@ -77242,7 +77370,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77242
77370
  Puck.Outline = Outline;
77243
77371
  Puck.Preview = Preview;
77244
77372
  init_react_import2();
77245
- var import_jsx_runtime37 = require("react/jsx-runtime");
77373
+ var import_jsx_runtime39 = require("react/jsx-runtime");
77246
77374
  function Render({
77247
77375
  config,
77248
77376
  data
@@ -77255,7 +77383,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77255
77383
  const rootProps = defaultedData.root.props || defaultedData.root;
77256
77384
  const title = (rootProps == null ? void 0 : rootProps.title) || "";
77257
77385
  if ((_a3 = config.root) == null ? void 0 : _a3.render) {
77258
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
77386
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
77259
77387
  config.root.render,
77260
77388
  __spreadProps2(__spreadValues2({}, rootProps), {
77261
77389
  puck: {
@@ -77265,11 +77393,11 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77265
77393
  title,
77266
77394
  editMode: false,
77267
77395
  id: "puck-root",
77268
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropZone, { zone: rootDroppableId2 })
77396
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZone, { zone: rootDroppableId2 })
77269
77397
  })
77270
77398
  ) });
77271
77399
  }
77272
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DropZone, { zone: rootDroppableId2 }) });
77400
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZoneProvider, { value: { data: defaultedData, config, mode: "render" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DropZone, { zone: rootDroppableId2 }) });
77273
77401
  }
77274
77402
  init_react_import2();
77275
77403
  var migrations = [
@@ -77365,12 +77493,24 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77365
77493
  config,
77366
77494
  history,
77367
77495
  dispatch,
77368
- selectedItem
77496
+ selectedItem: currentItem,
77497
+ globalPermissions
77369
77498
  } = useAppContext2();
77370
77499
  return {
77371
77500
  appState,
77372
77501
  config,
77373
77502
  dispatch,
77503
+ getPermissions: ({
77504
+ item,
77505
+ type
77506
+ } = {}) => {
77507
+ return getPermissions({
77508
+ selectedItem: item || currentItem,
77509
+ type,
77510
+ globalPermissions: globalPermissions || {},
77511
+ config
77512
+ });
77513
+ },
77374
77514
  history: {
77375
77515
  back: history.back,
77376
77516
  forward: history.forward,
@@ -77382,7 +77522,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
77382
77522
  index: history.historyStore.index,
77383
77523
  historyStore: history.historyStore
77384
77524
  },
77385
- selectedItem: selectedItem || null
77525
+ selectedItem: currentItem || null
77386
77526
  };
77387
77527
  };
77388
77528
  }
@@ -77683,7 +77823,8 @@ var defaultContext = {
77683
77823
  status: "LOADING",
77684
77824
  setStatus: () => null,
77685
77825
  iframe: {},
77686
- safariFallbackMode: false
77826
+ safariFallbackMode: false,
77827
+ globalPermissions: {}
77687
77828
  };
77688
77829
  var appContext = (0, import_react10.createContext)(defaultContext);
77689
77830
  function useAppContext() {