@measured/puck 0.18.3-canary.78bb71d → 0.18.3-canary.98ad734

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
@@ -309,7 +309,7 @@ init_react_import();
309
309
  var styles_module_default2 = { "InputWrapper": "_InputWrapper_g5w3n_1", "Input-label": "_Input-label_g5w3n_5", "Input-labelIcon": "_Input-labelIcon_g5w3n_14", "Input-disabledIcon": "_Input-disabledIcon_g5w3n_21", "Input-input": "_Input-input_g5w3n_26", "Input": "_Input_g5w3n_1", "Input--readOnly": "_Input--readOnly_g5w3n_74", "Input-radioGroupItems": "_Input-radioGroupItems_g5w3n_85", "Input-radio": "_Input-radio_g5w3n_85", "Input-radioInner": "_Input-radioInner_g5w3n_102", "Input-radioInput": "_Input-radioInput_g5w3n_147" };
310
310
 
311
311
  // components/AutoField/index.tsx
312
- var import_react21 = require("react");
312
+ var import_react20 = require("react");
313
313
 
314
314
  // components/AutoField/fields/index.tsx
315
315
  init_react_import();
@@ -769,7 +769,7 @@ var IconButton = ({
769
769
  };
770
770
 
771
771
  // components/AutoField/fields/ArrayField/index.tsx
772
- var import_react13 = require("react");
772
+ var import_react12 = require("react");
773
773
 
774
774
  // components/DragIcon/index.tsx
775
775
  init_react_import();
@@ -1278,7 +1278,6 @@ function useAppContext() {
1278
1278
  // components/Sortable/index.tsx
1279
1279
  init_react_import();
1280
1280
  var import_react10 = require("@dnd-kit/react");
1281
- var import_react11 = require("react");
1282
1281
 
1283
1282
  // lib/dnd/dnd-kit/safe.ts
1284
1283
  init_react_import();
@@ -1939,16 +1938,13 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input
1939
1938
  };
1940
1939
 
1941
1940
  // components/Sortable/index.tsx
1942
- var import_modifiers = require("@dnd-kit/dom/modifiers");
1943
1941
  var import_jsx_runtime6 = require("react/jsx-runtime");
1944
1942
  var SortableProvider = ({
1945
- container,
1946
1943
  children,
1947
1944
  onDragStart,
1948
1945
  onDragEnd,
1949
1946
  onMove
1950
1947
  }) => {
1951
- const [move, setMove] = (0, import_react11.useState)({ source: -1, target: -1 });
1952
1948
  const sensors = useSensors({
1953
1949
  mouse: { distance: { value: 5 } }
1954
1950
  });
@@ -1956,16 +1952,13 @@ var SortableProvider = ({
1956
1952
  import_react10.DragDropProvider,
1957
1953
  {
1958
1954
  sensors,
1959
- modifiers: [
1960
- import_modifiers.RestrictToElement.configure({
1961
- element() {
1962
- return container.current;
1963
- }
1964
- })
1965
- ],
1966
- onDragStart,
1955
+ onDragStart: (event) => {
1956
+ var _a, _b;
1957
+ return onDragStart((_b = (_a = event.operation.source) == null ? void 0 : _a.id.toString()) != null ? _b : "");
1958
+ },
1967
1959
  onDragOver: (event, manager) => {
1968
1960
  var _a, _b;
1961
+ event.preventDefault();
1969
1962
  const { operation } = event;
1970
1963
  const { source, target } = operation;
1971
1964
  if (!source || !target) return;
@@ -1973,14 +1966,14 @@ var SortableProvider = ({
1973
1966
  let targetIndex = target.data.index;
1974
1967
  const collisionData = (_b = (_a = manager.dragOperation.data) == null ? void 0 : _a.collisionMap) == null ? void 0 : _b[target.id];
1975
1968
  if (sourceIndex !== targetIndex && source.id !== target.id) {
1976
- const collisionPosition = (collisionData == null ? void 0 : collisionData.direction) === "up" ? "before" : "after";
1969
+ const collisionPosition = collisionData.direction === "up" ? "before" : "after";
1977
1970
  if (targetIndex >= sourceIndex) {
1978
1971
  targetIndex = targetIndex - 1;
1979
1972
  }
1980
1973
  if (collisionPosition === "after") {
1981
1974
  targetIndex = targetIndex + 1;
1982
1975
  }
1983
- setMove({
1976
+ onMove({
1984
1977
  source: sourceIndex,
1985
1978
  target: targetIndex
1986
1979
  });
@@ -1988,12 +1981,8 @@ var SortableProvider = ({
1988
1981
  },
1989
1982
  onDragEnd: () => {
1990
1983
  setTimeout(() => {
1991
- if (move.source !== -1 && move.target !== -1) {
1992
- onMove(move);
1993
- }
1994
1984
  onDragEnd();
1995
1985
  }, 250);
1996
- setMove({ source: -1, target: -1 });
1997
1986
  },
1998
1987
  children
1999
1988
  }
@@ -2023,11 +2012,11 @@ var Sortable = ({
2023
2012
 
2024
2013
  // components/AutoField/context.tsx
2025
2014
  init_react_import();
2026
- var import_react12 = require("react");
2015
+ var import_react11 = require("react");
2027
2016
  var import_jsx_runtime7 = require("react/jsx-runtime");
2028
- var NestedFieldContext = (0, import_react12.createContext)({});
2017
+ var NestedFieldContext = (0, import_react11.createContext)({});
2029
2018
  var useNestedFieldContext = () => {
2030
- const context = (0, import_react12.useContext)(NestedFieldContext);
2019
+ const context = (0, import_react11.useContext)(NestedFieldContext);
2031
2020
  return __spreadProps(__spreadValues({}, context), {
2032
2021
  readOnlyFields: context.readOnlyFields || {}
2033
2022
  });
@@ -2041,7 +2030,7 @@ var NestedFieldProvider = ({
2041
2030
  }) => {
2042
2031
  const subPath = `${name}.${subName}`;
2043
2032
  const wildcardSubPath = `${wildcardName}.${subName}`;
2044
- const subReadOnlyFields = (0, import_react12.useMemo)(
2033
+ const subReadOnlyFields = (0, import_react11.useMemo)(
2045
2034
  () => Object.keys(readOnlyFields).reduce((acc, readOnlyKey) => {
2046
2035
  const isLocal = readOnlyKey.indexOf(subPath) > -1 || readOnlyKey.indexOf(wildcardSubPath) > -1;
2047
2036
  if (isLocal) {
@@ -2092,11 +2081,17 @@ var ArrayField = ({
2092
2081
  }),
2093
2082
  openId: ""
2094
2083
  };
2095
- const [localState, setLocalState] = (0, import_react13.useState)({ arrayState, value });
2096
- (0, import_react13.useEffect)(() => {
2097
- setLocalState({ arrayState, value });
2098
- }, [value, state.ui.arrayState[id]]);
2099
- const mapArrayStateToUi = (0, import_react13.useCallback)(
2084
+ const [localState, setLocalState] = (0, import_react12.useState)({ arrayState, value });
2085
+ const updateLocalState = (0, import_react12.useCallback)(
2086
+ (value2) => {
2087
+ setLocalState({ arrayState, value: value2 });
2088
+ },
2089
+ [arrayState]
2090
+ );
2091
+ (0, import_react12.useEffect)(() => {
2092
+ updateLocalState(value);
2093
+ }, [value]);
2094
+ const mapArrayStateToUi = (0, import_react12.useCallback)(
2100
2095
  (partialArrayState) => {
2101
2096
  return {
2102
2097
  arrayState: __spreadProps(__spreadValues({}, state.ui.arrayState), {
@@ -2106,13 +2101,13 @@ var ArrayField = ({
2106
2101
  },
2107
2102
  [arrayState]
2108
2103
  );
2109
- const getHighestIndex = (0, import_react13.useCallback)(() => {
2104
+ const getHighestIndex = (0, import_react12.useCallback)(() => {
2110
2105
  return arrayState.items.reduce(
2111
2106
  (acc, item) => item._originalIndex > acc ? item._originalIndex : acc,
2112
2107
  -1
2113
2108
  );
2114
2109
  }, [arrayState]);
2115
- const regenerateArrayState = (0, import_react13.useCallback)(
2110
+ const regenerateArrayState = (0, import_react12.useCallback)(
2116
2111
  (value2) => {
2117
2112
  let highestIndex = getHighestIndex();
2118
2113
  const newItems = Array.from(value2 || []).map((item, idx) => {
@@ -2131,13 +2126,13 @@ var ArrayField = ({
2131
2126
  },
2132
2127
  [arrayState]
2133
2128
  );
2134
- (0, import_react13.useEffect)(() => {
2129
+ (0, import_react12.useEffect)(() => {
2135
2130
  if (arrayState.items.length > 0) {
2136
2131
  setUi(mapArrayStateToUi(arrayState));
2137
2132
  }
2138
2133
  }, []);
2139
- const [isDragging, setIsDragging] = (0, import_react13.useState)(false);
2140
- const dndContainerRef = (0, import_react13.useRef)(null);
2134
+ const [draggedItem, setDraggedItem] = (0, import_react12.useState)("");
2135
+ const isDragging = !!draggedItem;
2141
2136
  const forceReadOnly = getPermissions({ item: selectedItem }).edit === false;
2142
2137
  if (field.type !== "array" || !field.arrayFields) {
2143
2138
  return null;
@@ -2153,11 +2148,17 @@ var ArrayField = ({
2153
2148
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2154
2149
  SortableProvider,
2155
2150
  {
2156
- container: dndContainerRef,
2157
- onDragStart: () => setIsDragging(true),
2158
- onDragEnd: () => setIsDragging(false),
2151
+ onDragStart: (id2) => setDraggedItem(id2),
2152
+ onDragEnd: () => {
2153
+ setDraggedItem("");
2154
+ onChange(localState.value);
2155
+ },
2159
2156
  onMove: (move) => {
2160
- const newValue = reorder(value, move.source, move.target);
2157
+ var _a;
2158
+ if (((_a = arrayState.items[move.source]) == null ? void 0 : _a._arrayId) !== draggedItem) {
2159
+ return;
2160
+ }
2161
+ const newValue = reorder(localState.value, move.source, move.target);
2161
2162
  const newArrayStateItems = reorder(
2162
2163
  arrayState.items,
2163
2164
  move.source,
@@ -2169,7 +2170,6 @@ var ArrayField = ({
2169
2170
  })
2170
2171
  };
2171
2172
  setUi(newUi, false);
2172
- onChange(newValue, newUi);
2173
2173
  setLocalState({
2174
2174
  value: newValue,
2175
2175
  arrayState: __spreadProps(__spreadValues({}, arrayState), { items: newArrayStateItems })
@@ -2183,164 +2183,154 @@ var ArrayField = ({
2183
2183
  addDisabled
2184
2184
  }),
2185
2185
  children: [
2186
- localState.arrayState.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2187
- "div",
2188
- {
2189
- ref: dndContainerRef,
2190
- className: getClassName5("inner"),
2191
- "data-dnd-container": true,
2192
- children: localState.arrayState.items.map((item, i) => {
2193
- const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
2194
- const data = Array.from(localState.value || [])[i] || {};
2195
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2196
- Sortable,
2186
+ localState.arrayState.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: getClassName5("inner"), "data-dnd-container": true, children: localState.arrayState.items.map((item, i) => {
2187
+ const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
2188
+ const data = Array.from(localState.value || [])[i] || {};
2189
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2190
+ Sortable,
2191
+ {
2192
+ id: _arrayId,
2193
+ index: i,
2194
+ disabled: readOnly,
2195
+ children: ({ status, ref, handleRef }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2196
+ "div",
2197
2197
  {
2198
- id: _arrayId,
2199
- index: i,
2200
- disabled: readOnly,
2201
- children: ({ status, ref, handleRef }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2202
- "div",
2203
- {
2204
- ref,
2205
- className: getClassNameItem({
2206
- isExpanded: arrayState.openId === _arrayId,
2207
- isDragging: status === "dragging",
2208
- readOnly
2209
- }),
2210
- children: [
2211
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2212
- "div",
2213
- {
2214
- ref: handleRef,
2215
- onClick: (e) => {
2216
- if (isDragging) return;
2217
- e.preventDefault();
2218
- e.stopPropagation();
2219
- if (arrayState.openId === _arrayId) {
2220
- setUi(
2221
- mapArrayStateToUi({
2222
- openId: ""
2223
- })
2224
- );
2225
- } else {
2226
- setUi(
2227
- mapArrayStateToUi({
2228
- openId: _arrayId
2229
- })
2230
- );
2231
- }
2232
- },
2233
- className: getClassNameItem("summary"),
2234
- children: [
2235
- field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
2236
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: getClassNameItem("rhs"), children: [
2237
- !readOnly && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: getClassNameItem("actions"), children: [
2238
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2239
- IconButton,
2240
- {
2241
- type: "button",
2242
- disabled: !!addDisabled,
2243
- onClick: (e) => {
2244
- e.stopPropagation();
2245
- const existingValue = [...value || []];
2246
- existingValue.splice(
2247
- i,
2248
- 0,
2249
- existingValue[i]
2250
- );
2251
- onChange(
2252
- existingValue,
2253
- mapArrayStateToUi(
2254
- regenerateArrayState(existingValue)
2255
- )
2256
- );
2257
- },
2258
- title: "Duplicate",
2259
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Copy, { size: 16 })
2260
- }
2261
- ) }),
2262
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2263
- IconButton,
2264
- {
2265
- type: "button",
2266
- disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
2267
- onClick: (e) => {
2268
- e.stopPropagation();
2269
- const existingValue = [...value || []];
2270
- const existingItems = [
2271
- ...arrayState.items || []
2272
- ];
2273
- existingValue.splice(i, 1);
2274
- existingItems.splice(i, 1);
2275
- onChange(
2276
- existingValue,
2277
- mapArrayStateToUi({
2278
- items: existingItems
2279
- })
2280
- );
2281
- },
2282
- title: "Delete",
2283
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Trash, { size: 16 })
2284
- }
2285
- ) })
2286
- ] }),
2287
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DragIcon, {}) })
2288
- ] })
2289
- ]
2198
+ ref,
2199
+ className: getClassNameItem({
2200
+ isExpanded: arrayState.openId === _arrayId,
2201
+ isDragging: status === "dragging",
2202
+ readOnly
2203
+ }),
2204
+ children: [
2205
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2206
+ "div",
2207
+ {
2208
+ ref: handleRef,
2209
+ onClick: (e) => {
2210
+ if (isDragging) return;
2211
+ e.preventDefault();
2212
+ e.stopPropagation();
2213
+ if (arrayState.openId === _arrayId) {
2214
+ setUi(
2215
+ mapArrayStateToUi({
2216
+ openId: ""
2217
+ })
2218
+ );
2219
+ } else {
2220
+ setUi(
2221
+ mapArrayStateToUi({
2222
+ openId: _arrayId
2223
+ })
2224
+ );
2290
2225
  }
2291
- ),
2292
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
2293
- const subField = field.arrayFields[subName];
2294
- const indexName = `${name}[${i}]`;
2295
- const subPath = `${indexName}.${subName}`;
2296
- const localIndexName = `${localName}[${i}]`;
2297
- const localWildcardName = `${localName}[*]`;
2298
- const localSubPath = `${localIndexName}.${subName}`;
2299
- const localWildcardSubPath = `${localWildcardName}.${subName}`;
2300
- const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
2301
- const label2 = subField.label || subName;
2302
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2303
- NestedFieldProvider,
2304
- {
2305
- name: localIndexName,
2306
- wildcardName: localWildcardName,
2307
- subName,
2308
- readOnlyFields,
2309
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2310
- AutoFieldPrivate,
2226
+ },
2227
+ className: getClassNameItem("summary"),
2228
+ children: [
2229
+ field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
2230
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: getClassNameItem("rhs"), children: [
2231
+ !readOnly && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: getClassNameItem("actions"), children: [
2232
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2233
+ IconButton,
2311
2234
  {
2312
- name: subPath,
2313
- label: label2,
2314
- id: `${_arrayId}_${subName}`,
2315
- readOnly: subReadOnly,
2316
- field: __spreadProps(__spreadValues({}, subField), {
2317
- label: label2
2318
- // May be used by custom fields
2319
- }),
2320
- value: data[subName],
2321
- onChange: (val, ui) => {
2322
- onChange(
2323
- replace(value, i, __spreadProps(__spreadValues({}, data), {
2324
- [subName]: val
2325
- })),
2326
- ui
2235
+ type: "button",
2236
+ disabled: !!addDisabled,
2237
+ onClick: (e) => {
2238
+ e.stopPropagation();
2239
+ const existingValue = [...value || []];
2240
+ existingValue.splice(
2241
+ i,
2242
+ 0,
2243
+ existingValue[i]
2327
2244
  );
2328
- }
2245
+ const newUi = mapArrayStateToUi(
2246
+ regenerateArrayState(existingValue)
2247
+ );
2248
+ setUi(newUi, false);
2249
+ onChange(existingValue, newUi);
2250
+ },
2251
+ title: "Duplicate",
2252
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Copy, { size: 16 })
2329
2253
  }
2330
- )
2331
- },
2332
- subPath
2333
- );
2334
- }) }) })
2335
- ]
2336
- }
2337
- )
2338
- },
2339
- _arrayId
2340
- );
2341
- })
2342
- }
2343
- ),
2254
+ ) }),
2255
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2256
+ IconButton,
2257
+ {
2258
+ type: "button",
2259
+ disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
2260
+ onClick: (e) => {
2261
+ e.stopPropagation();
2262
+ const existingValue = [...value || []];
2263
+ const existingItems = [
2264
+ ...arrayState.items || []
2265
+ ];
2266
+ existingValue.splice(i, 1);
2267
+ existingItems.splice(i, 1);
2268
+ const newUi = mapArrayStateToUi({
2269
+ items: existingItems
2270
+ });
2271
+ setUi(newUi, false);
2272
+ onChange(existingValue, newUi);
2273
+ },
2274
+ title: "Delete",
2275
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Trash, { size: 16 })
2276
+ }
2277
+ ) })
2278
+ ] }),
2279
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DragIcon, {}) })
2280
+ ] })
2281
+ ]
2282
+ }
2283
+ ),
2284
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
2285
+ const subField = field.arrayFields[subName];
2286
+ const indexName = `${name}[${i}]`;
2287
+ const subPath = `${indexName}.${subName}`;
2288
+ const localIndexName = `${localName}[${i}]`;
2289
+ const localWildcardName = `${localName}[*]`;
2290
+ const localSubPath = `${localIndexName}.${subName}`;
2291
+ const localWildcardSubPath = `${localWildcardName}.${subName}`;
2292
+ const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
2293
+ const label2 = subField.label || subName;
2294
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2295
+ NestedFieldProvider,
2296
+ {
2297
+ name: localIndexName,
2298
+ wildcardName: localWildcardName,
2299
+ subName,
2300
+ readOnlyFields,
2301
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2302
+ AutoFieldPrivate,
2303
+ {
2304
+ name: subPath,
2305
+ label: label2,
2306
+ id: `${_arrayId}_${subName}`,
2307
+ readOnly: subReadOnly,
2308
+ field: __spreadProps(__spreadValues({}, subField), {
2309
+ label: label2
2310
+ // May be used by custom fields
2311
+ }),
2312
+ value: data[subName],
2313
+ onChange: (val, ui) => {
2314
+ onChange(
2315
+ replace(value, i, __spreadProps(__spreadValues({}, data), {
2316
+ [subName]: val
2317
+ })),
2318
+ ui
2319
+ );
2320
+ }
2321
+ }
2322
+ )
2323
+ },
2324
+ subPath
2325
+ );
2326
+ }) }) })
2327
+ ]
2328
+ }
2329
+ )
2330
+ },
2331
+ _arrayId
2332
+ );
2333
+ }) }),
2344
2334
  !addDisabled && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2345
2335
  "button",
2346
2336
  {
@@ -2354,7 +2344,9 @@ var ArrayField = ({
2354
2344
  field.defaultItemProps || {}
2355
2345
  ];
2356
2346
  const newArrayState = regenerateArrayState(newValue);
2357
- onChange(newValue, mapArrayStateToUi(newArrayState));
2347
+ const newUi = mapArrayStateToUi(newArrayState);
2348
+ setUi(newUi, false);
2349
+ onChange(newValue, newUi);
2358
2350
  },
2359
2351
  children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Plus, { size: 21 })
2360
2352
  }
@@ -2428,11 +2420,11 @@ var DefaultField = ({
2428
2420
 
2429
2421
  // components/AutoField/fields/ExternalField/index.tsx
2430
2422
  init_react_import();
2431
- var import_react17 = require("react");
2423
+ var import_react16 = require("react");
2432
2424
 
2433
2425
  // components/ExternalInput/index.tsx
2434
2426
  init_react_import();
2435
- var import_react16 = require("react");
2427
+ var import_react15 = require("react");
2436
2428
 
2437
2429
  // css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
2438
2430
  init_react_import();
@@ -2440,7 +2432,7 @@ var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_
2440
2432
 
2441
2433
  // components/Modal/index.tsx
2442
2434
  init_react_import();
2443
- var import_react14 = require("react");
2435
+ var import_react13 = require("react");
2444
2436
 
2445
2437
  // css-module:/home/runner/work/puck/puck/packages/core/components/Modal/styles.module.css#css-module
2446
2438
  init_react_import();
@@ -2455,8 +2447,8 @@ var Modal = ({
2455
2447
  onClose,
2456
2448
  isOpen
2457
2449
  }) => {
2458
- const [rootEl, setRootEl] = (0, import_react14.useState)(null);
2459
- (0, import_react14.useEffect)(() => {
2450
+ const [rootEl, setRootEl] = (0, import_react13.useState)(null);
2451
+ (0, import_react13.useEffect)(() => {
2460
2452
  setRootEl(document.getElementById("puck-portal-root"));
2461
2453
  }, []);
2462
2454
  if (!rootEl) {
@@ -2503,7 +2495,7 @@ init_react_import();
2503
2495
 
2504
2496
  // components/Button/Button.tsx
2505
2497
  init_react_import();
2506
- var import_react15 = require("react");
2498
+ var import_react14 = require("react");
2507
2499
 
2508
2500
  // css-module:/home/runner/work/puck/puck/packages/core/components/Button/Button.module.css#css-module
2509
2501
  init_react_import();
@@ -2553,8 +2545,8 @@ var Button = (_a) => {
2553
2545
  "size",
2554
2546
  "loading"
2555
2547
  ]);
2556
- const [loading, setLoading] = (0, import_react15.useState)(loadingProp);
2557
- (0, import_react15.useEffect)(() => setLoading(loadingProp), [loadingProp]);
2548
+ const [loading, setLoading] = (0, import_react14.useState)(loadingProp);
2549
+ (0, import_react14.useEffect)(() => setLoading(loadingProp), [loadingProp]);
2558
2550
  const ElementType = href ? "a" : type ? "button" : "span";
2559
2551
  const dataAttrs = filterDataAttrs(props);
2560
2552
  const el = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
@@ -2609,28 +2601,28 @@ var ExternalInput = ({
2609
2601
  mapRow = (val) => val,
2610
2602
  filterFields
2611
2603
  } = field || {};
2612
- const [data, setData] = (0, import_react16.useState)([]);
2613
- const [isOpen, setOpen] = (0, import_react16.useState)(false);
2614
- const [isLoading, setIsLoading] = (0, import_react16.useState)(true);
2604
+ const [data, setData] = (0, import_react15.useState)([]);
2605
+ const [isOpen, setOpen] = (0, import_react15.useState)(false);
2606
+ const [isLoading, setIsLoading] = (0, import_react15.useState)(true);
2615
2607
  const hasFilterFields = !!filterFields;
2616
- const [filters, setFilters] = (0, import_react16.useState)(field.initialFilters || {});
2617
- const [filtersToggled, setFiltersToggled] = (0, import_react16.useState)(hasFilterFields);
2618
- const mappedData = (0, import_react16.useMemo)(() => {
2608
+ const [filters, setFilters] = (0, import_react15.useState)(field.initialFilters || {});
2609
+ const [filtersToggled, setFiltersToggled] = (0, import_react15.useState)(hasFilterFields);
2610
+ const mappedData = (0, import_react15.useMemo)(() => {
2619
2611
  return data.map(mapRow);
2620
2612
  }, [data]);
2621
- const keys = (0, import_react16.useMemo)(() => {
2613
+ const keys = (0, import_react15.useMemo)(() => {
2622
2614
  const validKeys = /* @__PURE__ */ new Set();
2623
2615
  for (const item of mappedData) {
2624
2616
  for (const key of Object.keys(item)) {
2625
- if (typeof item[key] === "string" || typeof item[key] === "number" || (0, import_react16.isValidElement)(item[key])) {
2617
+ if (typeof item[key] === "string" || typeof item[key] === "number" || (0, import_react15.isValidElement)(item[key])) {
2626
2618
  validKeys.add(key);
2627
2619
  }
2628
2620
  }
2629
2621
  }
2630
2622
  return Array.from(validKeys);
2631
2623
  }, [mappedData]);
2632
- const [searchQuery, setSearchQuery] = (0, import_react16.useState)(field.initialQuery || "");
2633
- const search = (0, import_react16.useCallback)(
2624
+ const [searchQuery, setSearchQuery] = (0, import_react15.useState)(field.initialQuery || "");
2625
+ const search = (0, import_react15.useCallback)(
2634
2626
  (query, filters2) => __async(void 0, null, function* () {
2635
2627
  setIsLoading(true);
2636
2628
  const cacheKey = `${id}-${query}-${JSON.stringify(filters2)}`;
@@ -2643,7 +2635,7 @@ var ExternalInput = ({
2643
2635
  }),
2644
2636
  [id, field]
2645
2637
  );
2646
- const Footer = (0, import_react16.useCallback)(
2638
+ const Footer = (0, import_react15.useCallback)(
2647
2639
  (props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: getClassNameModal("footer"), children: [
2648
2640
  props.items.length,
2649
2641
  " result",
@@ -2651,7 +2643,7 @@ var ExternalInput = ({
2651
2643
  ] }),
2652
2644
  [field.renderFooter]
2653
2645
  );
2654
- (0, import_react16.useEffect)(() => {
2646
+ (0, import_react15.useEffect)(() => {
2655
2647
  search(searchQuery, filters);
2656
2648
  }, []);
2657
2649
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
@@ -2822,7 +2814,7 @@ var ExternalField = ({
2822
2814
  var _a, _b, _c;
2823
2815
  const validField = field;
2824
2816
  const deprecatedField = field;
2825
- (0, import_react17.useEffect)(() => {
2817
+ (0, import_react16.useEffect)(() => {
2826
2818
  if (deprecatedField.adaptor) {
2827
2819
  console.error(
2828
2820
  "Warning: The `adaptor` API is deprecated. Please use updated APIs on the `external` field instead. This will be a breaking change in a future release."
@@ -2857,7 +2849,7 @@ var ExternalField = ({
2857
2849
 
2858
2850
  // components/AutoField/fields/RadioField/index.tsx
2859
2851
  init_react_import();
2860
- var import_react18 = require("react");
2852
+ var import_react17 = require("react");
2861
2853
 
2862
2854
  // lib/safe-json-parse.ts
2863
2855
  init_react_import();
@@ -2883,7 +2875,7 @@ var RadioField = ({
2883
2875
  label,
2884
2876
  Label: Label2
2885
2877
  }) => {
2886
- const flatOptions = (0, import_react18.useMemo)(
2878
+ const flatOptions = (0, import_react17.useMemo)(
2887
2879
  () => field.type === "radio" ? field.options.map(({ value: value2 }) => value2) : [],
2888
2880
  [field]
2889
2881
  );
@@ -2933,7 +2925,7 @@ var RadioField = ({
2933
2925
 
2934
2926
  // components/AutoField/fields/SelectField/index.tsx
2935
2927
  init_react_import();
2936
- var import_react19 = require("react");
2928
+ var import_react18 = require("react");
2937
2929
  var import_jsx_runtime16 = require("react/jsx-runtime");
2938
2930
  var getClassName12 = get_class_name_factory_default("Input", styles_module_default2);
2939
2931
  var SelectField = ({
@@ -2946,7 +2938,7 @@ var SelectField = ({
2946
2938
  readOnly,
2947
2939
  id
2948
2940
  }) => {
2949
- const flatOptions = (0, import_react19.useMemo)(
2941
+ const flatOptions = (0, import_react18.useMemo)(
2950
2942
  () => field.type === "select" ? field.options.map(({ value: value2 }) => value2) : [],
2951
2943
  [field]
2952
2944
  );
@@ -3098,7 +3090,7 @@ var ObjectField = ({
3098
3090
 
3099
3091
  // lib/use-safe-id.ts
3100
3092
  init_react_import();
3101
- var import_react20 = __toESM(require("react"));
3093
+ var import_react19 = __toESM(require("react"));
3102
3094
 
3103
3095
  // lib/generate-id.ts
3104
3096
  init_react_import();
@@ -3107,10 +3099,10 @@ var generateId = (type) => type ? `${type}-${(0, import_uuid.v4)()}` : (0, impor
3107
3099
 
3108
3100
  // lib/use-safe-id.ts
3109
3101
  var useSafeId = () => {
3110
- if (typeof import_react20.default.useId !== "undefined") {
3111
- return import_react20.default.useId();
3102
+ if (typeof import_react19.default.useId !== "undefined") {
3103
+ return import_react19.default.useId();
3112
3104
  }
3113
- const [id] = (0, import_react20.useState)(generateId());
3105
+ const [id] = (0, import_react19.useState)(generateId());
3114
3106
  return id;
3115
3107
  };
3116
3108
 
@@ -3144,7 +3136,7 @@ var FieldLabelInternal = ({
3144
3136
  readOnly
3145
3137
  }) => {
3146
3138
  const { overrides } = useAppContext();
3147
- const Wrapper = (0, import_react21.useMemo)(
3139
+ const Wrapper = (0, import_react20.useMemo)(
3148
3140
  () => overrides.fieldLabel || FieldLabel,
3149
3141
  [overrides]
3150
3142
  );
@@ -3166,7 +3158,7 @@ var FieldLabelInternal = ({
3166
3158
  function AutoFieldInternal(props) {
3167
3159
  var _a, _b, _c, _d, _e, _f, _g, _h;
3168
3160
  const { dispatch, overrides, selectedItem } = useAppContext();
3169
- const nestedFieldContext = (0, import_react21.useContext)(NestedFieldContext);
3161
+ const nestedFieldContext = (0, import_react20.useContext)(NestedFieldContext);
3170
3162
  const { id, Label: Label2 = FieldLabelInternal } = props;
3171
3163
  const field = props.field;
3172
3164
  const label = field.label;
@@ -3198,7 +3190,7 @@ function AutoFieldInternal(props) {
3198
3190
  Label: Label2,
3199
3191
  id: resolvedId
3200
3192
  });
3201
- const onFocus = (0, import_react21.useCallback)(
3193
+ const onFocus = (0, import_react20.useCallback)(
3202
3194
  (e) => {
3203
3195
  if (mergedProps.name && (e.target.nodeName === "INPUT" || e.target.nodeName === "TEXTAREA")) {
3204
3196
  e.stopPropagation();
@@ -3212,7 +3204,7 @@ function AutoFieldInternal(props) {
3212
3204
  },
3213
3205
  [mergedProps.name]
3214
3206
  );
3215
- const onBlur = (0, import_react21.useCallback)((e) => {
3207
+ const onBlur = (0, import_react20.useCallback)((e) => {
3216
3208
  if ("name" in e.target) {
3217
3209
  dispatch({
3218
3210
  type: "setUi",
@@ -3256,7 +3248,7 @@ function AutoFieldInternal(props) {
3256
3248
  function AutoFieldPrivate(props) {
3257
3249
  const { state } = useAppContext();
3258
3250
  const { value, onChange } = props;
3259
- const [localValue, setLocalValue] = (0, import_react21.useState)(value);
3251
+ const [localValue, setLocalValue] = (0, import_react20.useState)(value);
3260
3252
  const onChangeDb = (0, import_use_debounce.useDebouncedCallback)(
3261
3253
  (val, ui) => {
3262
3254
  onChange(val, ui);
@@ -3264,14 +3256,14 @@ function AutoFieldPrivate(props) {
3264
3256
  50,
3265
3257
  { leading: true }
3266
3258
  );
3267
- const onChangeLocal = (0, import_react21.useCallback)(
3259
+ const onChangeLocal = (0, import_react20.useCallback)(
3268
3260
  (val, ui) => {
3269
3261
  setLocalValue(val);
3270
3262
  onChangeDb(val, ui);
3271
3263
  },
3272
3264
  [onChange]
3273
3265
  );
3274
- (0, import_react21.useEffect)(() => {
3266
+ (0, import_react20.useEffect)(() => {
3275
3267
  if (state.ui.field.focus !== props.name) {
3276
3268
  setLocalValue(value);
3277
3269
  }
@@ -3283,7 +3275,7 @@ function AutoFieldPrivate(props) {
3283
3275
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AutoFieldInternal, __spreadValues(__spreadValues({}, props), localProps));
3284
3276
  }
3285
3277
  function AutoField(props) {
3286
- const DefaultLabel = (0, import_react21.useMemo)(() => {
3278
+ const DefaultLabel = (0, import_react20.useMemo)(() => {
3287
3279
  const DefaultLabel2 = (labelProps) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3288
3280
  "div",
3289
3281
  __spreadProps(__spreadValues({}, labelProps), {
@@ -3303,21 +3295,21 @@ init_react_import();
3303
3295
  var styles_module_default10 = { "Drawer": "_Drawer_fkqfo_1", "Drawer-draggable": "_Drawer-draggable_fkqfo_8", "Drawer-draggableBg": "_Drawer-draggableBg_fkqfo_12", "Drawer-draggableFg": "_Drawer-draggableFg_fkqfo_21", "DrawerItem-draggable": "_DrawerItem-draggable_fkqfo_25", "DrawerItem--disabled": "_DrawerItem--disabled_fkqfo_38", "DrawerItem": "_DrawerItem_fkqfo_25", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_fkqfo_48", "DrawerItem-name": "_DrawerItem-name_fkqfo_66" };
3304
3296
 
3305
3297
  // components/Drawer/index.tsx
3306
- var import_react33 = require("react");
3298
+ var import_react32 = require("react");
3307
3299
 
3308
3300
  // components/DragDropContext/index.tsx
3309
3301
  init_react_import();
3310
- var import_react31 = require("@dnd-kit/react");
3311
- var import_react32 = require("react");
3302
+ var import_react30 = require("@dnd-kit/react");
3303
+ var import_react31 = require("react");
3312
3304
  var import_dom = require("@dnd-kit/dom");
3313
3305
 
3314
3306
  // components/DropZone/index.tsx
3315
3307
  init_react_import();
3316
- var import_react30 = require("react");
3308
+ var import_react29 = require("react");
3317
3309
 
3318
3310
  // components/DraggableComponent/index.tsx
3319
3311
  init_react_import();
3320
- var import_react24 = require("react");
3312
+ var import_react23 = require("react");
3321
3313
 
3322
3314
  // css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css#css-module
3323
3315
  init_react_import();
@@ -3347,11 +3339,11 @@ function getDeepScrollPosition(element) {
3347
3339
 
3348
3340
  // components/DropZone/context.tsx
3349
3341
  init_react_import();
3350
- var import_react22 = require("react");
3342
+ var import_react21 = require("react");
3351
3343
  var import_zustand = require("zustand");
3352
3344
  var import_jsx_runtime20 = require("react/jsx-runtime");
3353
- var dropZoneContext = (0, import_react22.createContext)(null);
3354
- var ZoneStoreContext = (0, import_react22.createContext)(
3345
+ var dropZoneContext = (0, import_react21.createContext)(null);
3346
+ var ZoneStoreContext = (0, import_react21.createContext)(
3355
3347
  (0, import_zustand.createStore)(() => ({
3356
3348
  zoneDepthIndex: {},
3357
3349
  nextZoneDepthIndex: {},
@@ -3371,19 +3363,19 @@ var DropZoneProvider = ({
3371
3363
  children,
3372
3364
  value
3373
3365
  }) => {
3374
- const [hoveringComponent, setHoveringComponent] = (0, import_react22.useState)();
3375
- const [areasWithZones, setAreasWithZones] = (0, import_react22.useState)(
3366
+ const [hoveringComponent, setHoveringComponent] = (0, import_react21.useState)();
3367
+ const [areasWithZones, setAreasWithZones] = (0, import_react21.useState)(
3376
3368
  {}
3377
3369
  );
3378
- const [activeZones, setActiveZones] = (0, import_react22.useState)({});
3370
+ const [activeZones, setActiveZones] = (0, import_react21.useState)({});
3379
3371
  const { dispatch } = useAppContext();
3380
- const registerZoneArea = (0, import_react22.useCallback)(
3372
+ const registerZoneArea = (0, import_react21.useCallback)(
3381
3373
  (area) => {
3382
3374
  setAreasWithZones((latest) => __spreadProps(__spreadValues({}, latest), { [area]: true }));
3383
3375
  },
3384
3376
  [setAreasWithZones]
3385
3377
  );
3386
- const registerZone = (0, import_react22.useCallback)(
3378
+ const registerZone = (0, import_react21.useCallback)(
3387
3379
  (zoneCompound) => {
3388
3380
  if (!dispatch) {
3389
3381
  return;
@@ -3396,7 +3388,7 @@ var DropZoneProvider = ({
3396
3388
  },
3397
3389
  [setActiveZones, dispatch]
3398
3390
  );
3399
- const unregisterZone = (0, import_react22.useCallback)(
3391
+ const unregisterZone = (0, import_react21.useCallback)(
3400
3392
  (zoneCompound) => {
3401
3393
  if (!dispatch) {
3402
3394
  return;
@@ -3411,7 +3403,7 @@ var DropZoneProvider = ({
3411
3403
  },
3412
3404
  [setActiveZones, dispatch]
3413
3405
  );
3414
- const memoValue = (0, import_react22.useMemo)(
3406
+ const memoValue = (0, import_react21.useMemo)(
3415
3407
  () => __spreadValues({
3416
3408
  hoveringComponent,
3417
3409
  setHoveringComponent,
@@ -3428,11 +3420,11 @@ var DropZoneProvider = ({
3428
3420
 
3429
3421
  // lib/use-context-store.ts
3430
3422
  init_react_import();
3431
- var import_react23 = require("react");
3423
+ var import_react22 = require("react");
3432
3424
  var import_zustand2 = require("zustand");
3433
3425
  var import_shallow = require("zustand/react/shallow");
3434
3426
  function useContextStore(context, selector) {
3435
- const store = (0, import_react23.useContext)(context);
3427
+ const store = (0, import_react22.useContext)(context);
3436
3428
  if (!store) {
3437
3429
  throw new Error("useContextStore must be used inside context");
3438
3430
  }
@@ -3491,9 +3483,9 @@ var DraggableComponent = ({
3491
3483
  iframe,
3492
3484
  state
3493
3485
  } = useAppContext();
3494
- const ctx = (0, import_react24.useContext)(dropZoneContext);
3495
- const [localZones, setLocalZones] = (0, import_react24.useState)({});
3496
- const registerLocalZone = (0, import_react24.useCallback)(
3486
+ const ctx = (0, import_react23.useContext)(dropZoneContext);
3487
+ const [localZones, setLocalZones] = (0, import_react23.useState)({});
3488
+ const registerLocalZone = (0, import_react23.useCallback)(
3497
3489
  (zoneCompound2, active) => {
3498
3490
  var _a;
3499
3491
  (_a = ctx == null ? void 0 : ctx.registerLocalZone) == null ? void 0 : _a.call(ctx, zoneCompound2, active);
@@ -3503,7 +3495,7 @@ var DraggableComponent = ({
3503
3495
  },
3504
3496
  [setLocalZones]
3505
3497
  );
3506
- const unregisterLocalZone = (0, import_react24.useCallback)(
3498
+ const unregisterLocalZone = (0, import_react23.useCallback)(
3507
3499
  (zoneCompound2) => {
3508
3500
  var _a;
3509
3501
  (_a = ctx == null ? void 0 : ctx.unregisterLocalZone) == null ? void 0 : _a.call(ctx, zoneCompound2);
@@ -3517,8 +3509,8 @@ var DraggableComponent = ({
3517
3509
  );
3518
3510
  const containsActiveZone = Object.values(localZones).filter(Boolean).length > 0;
3519
3511
  const { path = [] } = ctx || {};
3520
- const [canDrag, setCanDrag] = (0, import_react24.useState)(false);
3521
- (0, import_react24.useEffect)(() => {
3512
+ const [canDrag, setCanDrag] = (0, import_react23.useState)(false);
3513
+ (0, import_react23.useEffect)(() => {
3522
3514
  var _a;
3523
3515
  const item = getItem({ index, zone: zoneCompound }, state.data);
3524
3516
  if (item) {
@@ -3534,7 +3526,7 @@ var DraggableComponent = ({
3534
3526
  );
3535
3527
  const canCollide = canDrag || userIsDragging;
3536
3528
  const disabled = !isEnabled || !canCollide;
3537
- const [dragAxis, setDragAxis] = (0, import_react24.useState)(userDragAxis || autoDragAxis);
3529
+ const [dragAxis, setDragAxis] = (0, import_react23.useState)(userDragAxis || autoDragAxis);
3538
3530
  const { ref: sortableRef, status } = useSortableSafe({
3539
3531
  id,
3540
3532
  index,
@@ -3560,8 +3552,8 @@ var DraggableComponent = ({
3560
3552
  }
3561
3553
  });
3562
3554
  const thisIsDragging = status === "dragging";
3563
- const ref = (0, import_react24.useRef)(null);
3564
- const refSetter = (0, import_react24.useCallback)(
3555
+ const ref = (0, import_react23.useRef)(null);
3556
+ const refSetter = (0, import_react23.useCallback)(
3565
3557
  (el) => {
3566
3558
  sortableRef(el);
3567
3559
  if (el) {
@@ -3570,14 +3562,14 @@ var DraggableComponent = ({
3570
3562
  },
3571
3563
  [sortableRef]
3572
3564
  );
3573
- const [portalEl, setPortalEl] = (0, import_react24.useState)();
3574
- (0, import_react24.useEffect)(() => {
3565
+ const [portalEl, setPortalEl] = (0, import_react23.useState)();
3566
+ (0, import_react23.useEffect)(() => {
3575
3567
  var _a, _b, _c;
3576
3568
  setPortalEl(
3577
3569
  iframe.enabled ? (_a = ref.current) == null ? void 0 : _a.ownerDocument.body : (_c = (_b = ref.current) == null ? void 0 : _b.closest("[data-puck-preview]")) != null ? _c : document.body
3578
3570
  );
3579
3571
  }, [iframe.enabled, ref.current]);
3580
- const getStyle = (0, import_react24.useCallback)(() => {
3572
+ const getStyle = (0, import_react23.useCallback)(() => {
3581
3573
  var _a, _b, _c;
3582
3574
  if (!ref.current) return;
3583
3575
  const rect = ref.current.getBoundingClientRect();
@@ -3597,11 +3589,11 @@ var DraggableComponent = ({
3597
3589
  };
3598
3590
  return style2;
3599
3591
  }, [ref.current]);
3600
- const [style, setStyle] = (0, import_react24.useState)();
3601
- const sync = (0, import_react24.useCallback)(() => {
3592
+ const [style, setStyle] = (0, import_react23.useState)();
3593
+ const sync = (0, import_react23.useCallback)(() => {
3602
3594
  setStyle(getStyle());
3603
3595
  }, [ref.current, iframe]);
3604
- (0, import_react24.useEffect)(() => {
3596
+ (0, import_react23.useEffect)(() => {
3605
3597
  if (ref.current && !userIsDragging) {
3606
3598
  const observer = new ResizeObserver(sync);
3607
3599
  observer.observe(ref.current);
@@ -3610,7 +3602,7 @@ var DraggableComponent = ({
3610
3602
  };
3611
3603
  }
3612
3604
  }, [ref.current, userIsDragging]);
3613
- (0, import_react24.useEffect)(() => {
3605
+ (0, import_react23.useEffect)(() => {
3614
3606
  ctx == null ? void 0 : ctx.registerPath(
3615
3607
  id,
3616
3608
  {
@@ -3624,14 +3616,14 @@ var DraggableComponent = ({
3624
3616
  (_a = ctx == null ? void 0 : ctx.unregisterPath) == null ? void 0 : _a.call(ctx, id);
3625
3617
  };
3626
3618
  }, [id, zoneCompound, index, componentType]);
3627
- const CustomActionBar = (0, import_react24.useMemo)(
3619
+ const CustomActionBar = (0, import_react23.useMemo)(
3628
3620
  () => overrides.actionBar || DefaultActionBar,
3629
3621
  [overrides.actionBar]
3630
3622
  );
3631
3623
  const permissions = getPermissions({
3632
3624
  item: selectedItem
3633
3625
  });
3634
- const onClick = (0, import_react24.useCallback)(
3626
+ const onClick = (0, import_react23.useCallback)(
3635
3627
  (e) => {
3636
3628
  e.stopPropagation();
3637
3629
  dispatch({
@@ -3643,7 +3635,7 @@ var DraggableComponent = ({
3643
3635
  },
3644
3636
  [index, zoneCompound, id]
3645
3637
  );
3646
- const onSelectParent = (0, import_react24.useCallback)(() => {
3638
+ const onSelectParent = (0, import_react23.useCallback)(() => {
3647
3639
  if (!(ctx == null ? void 0 : ctx.areaId)) {
3648
3640
  return;
3649
3641
  }
@@ -3661,23 +3653,23 @@ var DraggableComponent = ({
3661
3653
  }
3662
3654
  });
3663
3655
  }, [ctx, path]);
3664
- const onDuplicate = (0, import_react24.useCallback)(() => {
3656
+ const onDuplicate = (0, import_react23.useCallback)(() => {
3665
3657
  dispatch({
3666
3658
  type: "duplicate",
3667
3659
  sourceIndex: index,
3668
3660
  sourceZone: zoneCompound
3669
3661
  });
3670
3662
  }, [index, zoneCompound]);
3671
- const onDelete = (0, import_react24.useCallback)(() => {
3663
+ const onDelete = (0, import_react23.useCallback)(() => {
3672
3664
  dispatch({
3673
3665
  type: "remove",
3674
3666
  index,
3675
3667
  zone: zoneCompound
3676
3668
  });
3677
3669
  }, [index, zoneCompound]);
3678
- const [hover, setHover] = (0, import_react24.useState)(false);
3670
+ const [hover, setHover] = (0, import_react23.useState)(false);
3679
3671
  const indicativeHover = (ctx == null ? void 0 : ctx.hoveringComponent) === id;
3680
- (0, import_react24.useEffect)(() => {
3672
+ (0, import_react23.useEffect)(() => {
3681
3673
  if (!ref.current) {
3682
3674
  return;
3683
3675
  }
@@ -3727,7 +3719,7 @@ var DraggableComponent = ({
3727
3719
  thisIsDragging,
3728
3720
  inDroppableZone
3729
3721
  ]);
3730
- (0, import_react24.useEffect)(() => {
3722
+ (0, import_react23.useEffect)(() => {
3731
3723
  if (ref.current && disabled) {
3732
3724
  ref.current.setAttribute("data-puck-disabled", "");
3733
3725
  return () => {
@@ -3736,8 +3728,8 @@ var DraggableComponent = ({
3736
3728
  };
3737
3729
  }
3738
3730
  }, [disabled, ref]);
3739
- const [isVisible, setIsVisible] = (0, import_react24.useState)(false);
3740
- (0, import_react24.useEffect)(() => {
3731
+ const [isVisible, setIsVisible] = (0, import_react23.useState)(false);
3732
+ (0, import_react23.useEffect)(() => {
3741
3733
  sync();
3742
3734
  if ((isSelected || hover || indicativeHover) && !userIsDragging) {
3743
3735
  setIsVisible(true);
@@ -3745,7 +3737,7 @@ var DraggableComponent = ({
3745
3737
  setIsVisible(false);
3746
3738
  }
3747
3739
  }, [isSelected, hover, indicativeHover, iframe, state.data, userIsDragging]);
3748
- const syncActionsPosition = (0, import_react24.useCallback)(
3740
+ const syncActionsPosition = (0, import_react23.useCallback)(
3749
3741
  (el) => {
3750
3742
  if (el) {
3751
3743
  const view = el.ownerDocument.defaultView;
@@ -3753,16 +3745,24 @@ var DraggableComponent = ({
3753
3745
  const rect = el.getBoundingClientRect();
3754
3746
  const diffLeft = rect.x;
3755
3747
  const exceedsBoundsLeft = diffLeft < 0;
3748
+ const diffTop = rect.y;
3749
+ const exceedsBoundsTop = diffTop < 0;
3756
3750
  if (exceedsBoundsLeft) {
3757
3751
  el.style.transformOrigin = "left top";
3758
3752
  el.style.left = "0px";
3759
3753
  }
3754
+ if (exceedsBoundsTop) {
3755
+ el.style.top = "12px";
3756
+ if (!exceedsBoundsLeft) {
3757
+ el.style.transformOrigin = "right top";
3758
+ }
3759
+ }
3760
3760
  }
3761
3761
  }
3762
3762
  },
3763
3763
  [zoomConfig]
3764
3764
  );
3765
- (0, import_react24.useEffect)(() => {
3765
+ (0, import_react23.useEffect)(() => {
3766
3766
  if (userDragAxis) {
3767
3767
  setDragAxis(userDragAxis);
3768
3768
  return;
@@ -3856,14 +3856,14 @@ var styles_module_default12 = { "DropZone": "_DropZone_kmkdc_1", "DropZone--isAc
3856
3856
 
3857
3857
  // components/DropZone/lib/use-min-empty-height.ts
3858
3858
  init_react_import();
3859
- var import_react25 = require("react");
3859
+ var import_react24 = require("react");
3860
3860
  var useMinEmptyHeight = ({
3861
3861
  zoneCompound,
3862
3862
  userMinEmptyHeight,
3863
3863
  ref
3864
3864
  }) => {
3865
- const [prevHeight, setPrevHeight] = (0, import_react25.useState)(0);
3866
- const [isAnimating, setIsAnimating] = (0, import_react25.useState)(false);
3865
+ const [prevHeight, setPrevHeight] = (0, import_react24.useState)(0);
3866
+ const [isAnimating, setIsAnimating] = (0, import_react24.useState)(false);
3867
3867
  const { draggedItem, isZone } = useContextStore(ZoneStoreContext, (s) => {
3868
3868
  var _a, _b;
3869
3869
  return {
@@ -3871,7 +3871,7 @@ var useMinEmptyHeight = ({
3871
3871
  isZone: ((_b = s.draggedItem) == null ? void 0 : _b.data.zone) === zoneCompound
3872
3872
  };
3873
3873
  });
3874
- (0, import_react25.useEffect)(() => {
3874
+ (0, import_react24.useEffect)(() => {
3875
3875
  if (draggedItem && ref.current) {
3876
3876
  if (isZone) {
3877
3877
  const rect = ref.current.getBoundingClientRect();
@@ -3905,15 +3905,15 @@ function assignRefs(refs, node) {
3905
3905
 
3906
3906
  // components/DropZone/lib/use-content-with-preview.ts
3907
3907
  init_react_import();
3908
- var import_react28 = require("react");
3908
+ var import_react27 = require("react");
3909
3909
 
3910
3910
  // lib/dnd/use-rendered-callback.ts
3911
3911
  init_react_import();
3912
- var import_react26 = require("@dnd-kit/react");
3913
- var import_react27 = require("react");
3912
+ var import_react25 = require("@dnd-kit/react");
3913
+ var import_react26 = require("react");
3914
3914
  function useRenderedCallback(callback, deps) {
3915
- const manager = (0, import_react26.useDragDropManager)();
3916
- return (0, import_react27.useCallback)(
3915
+ const manager = (0, import_react25.useDragDropManager)();
3916
+ return (0, import_react26.useCallback)(
3917
3917
  (...args) => __async(this, null, function* () {
3918
3918
  yield manager == null ? void 0 : manager.renderer.rendering;
3919
3919
  return callback(...args);
@@ -3948,8 +3948,8 @@ var useContentWithPreview = (content, zoneCompound) => {
3948
3948
  ui: { isDragging }
3949
3949
  }
3950
3950
  } = useAppContext();
3951
- const [contentWithPreview, setContentWithPreview] = (0, import_react28.useState)(content);
3952
- const [localPreview, setLocalPreview] = (0, import_react28.useState)(
3951
+ const [contentWithPreview, setContentWithPreview] = (0, import_react27.useState)(content);
3952
+ const [localPreview, setLocalPreview] = (0, import_react27.useState)(
3953
3953
  preview
3954
3954
  );
3955
3955
  const updateContent = useRenderedCallback(
@@ -3990,7 +3990,7 @@ var useContentWithPreview = (content, zoneCompound) => {
3990
3990
  },
3991
3991
  [draggedItemId, previewExists]
3992
3992
  );
3993
- (0, import_react28.useEffect)(() => {
3993
+ (0, import_react27.useEffect)(() => {
3994
3994
  updateContent(content, preview, isDragging);
3995
3995
  }, [content, preview, isDragging]);
3996
3996
  return [contentWithPreview, localPreview];
@@ -3998,16 +3998,16 @@ var useContentWithPreview = (content, zoneCompound) => {
3998
3998
 
3999
3999
  // components/DropZone/lib/use-drag-axis.ts
4000
4000
  init_react_import();
4001
- var import_react29 = require("react");
4001
+ var import_react28 = require("react");
4002
4002
  var GRID_DRAG_AXIS = "dynamic";
4003
4003
  var FLEX_ROW_DRAG_AXIS = "x";
4004
4004
  var DEFAULT_DRAG_AXIS = "y";
4005
4005
  var useDragAxis = (ref, collisionAxis) => {
4006
4006
  const { status } = useAppContext();
4007
- const [dragAxis, setDragAxis] = (0, import_react29.useState)(
4007
+ const [dragAxis, setDragAxis] = (0, import_react28.useState)(
4008
4008
  collisionAxis || DEFAULT_DRAG_AXIS
4009
4009
  );
4010
- const calculateDragAxis = (0, import_react29.useCallback)(() => {
4010
+ const calculateDragAxis = (0, import_react28.useCallback)(() => {
4011
4011
  if (ref.current) {
4012
4012
  const computedStyle = window.getComputedStyle(ref.current);
4013
4013
  if (computedStyle.display === "grid") {
@@ -4019,7 +4019,7 @@ var useDragAxis = (ref, collisionAxis) => {
4019
4019
  }
4020
4020
  }
4021
4021
  }, [ref.current]);
4022
- (0, import_react29.useEffect)(() => {
4022
+ (0, import_react28.useEffect)(() => {
4023
4023
  const onViewportChange = () => {
4024
4024
  calculateDragAxis();
4025
4025
  };
@@ -4028,7 +4028,7 @@ var useDragAxis = (ref, collisionAxis) => {
4028
4028
  window.removeEventListener("viewportchange", onViewportChange);
4029
4029
  };
4030
4030
  }, []);
4031
- (0, import_react29.useEffect)(calculateDragAxis, [status, collisionAxis]);
4031
+ (0, import_react28.useEffect)(calculateDragAxis, [status, collisionAxis]);
4032
4032
  return [dragAxis, calculateDragAxis];
4033
4033
  };
4034
4034
 
@@ -4038,7 +4038,7 @@ var getClassName17 = get_class_name_factory_default("DropZone", styles_module_de
4038
4038
  var getRandomColor = () => `#${Math.floor(Math.random() * 16777215).toString(16)}`;
4039
4039
  var RENDER_DEBUG = false;
4040
4040
  var DropZoneEditPure = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropZoneEdit, __spreadValues({}, props));
4041
- var DropZoneEdit = (0, import_react30.forwardRef)(
4041
+ var DropZoneEdit = (0, import_react29.forwardRef)(
4042
4042
  function DropZoneEditInternal({
4043
4043
  zone,
4044
4044
  allow,
@@ -4049,7 +4049,7 @@ var DropZoneEdit = (0, import_react30.forwardRef)(
4049
4049
  collisionAxis
4050
4050
  }, userRef) {
4051
4051
  const appContext2 = useAppContext();
4052
- const ctx = (0, import_react30.useContext)(dropZoneContext);
4052
+ const ctx = (0, import_react29.useContext)(dropZoneContext);
4053
4053
  const {
4054
4054
  // These all need setting via context
4055
4055
  data,
@@ -4085,12 +4085,12 @@ var DropZoneEdit = (0, import_react30.forwardRef)(
4085
4085
  };
4086
4086
  });
4087
4087
  const { itemSelector } = appContext2.state.ui;
4088
- (0, import_react30.useEffect)(() => {
4088
+ (0, import_react29.useEffect)(() => {
4089
4089
  if (areaId && registerZoneArea) {
4090
4090
  registerZoneArea(areaId);
4091
4091
  }
4092
4092
  }, [areaId]);
4093
- (0, import_react30.useEffect)(() => {
4093
+ (0, import_react29.useEffect)(() => {
4094
4094
  if (ctx == null ? void 0 : ctx.registerZone) {
4095
4095
  ctx == null ? void 0 : ctx.registerZone(zoneCompound);
4096
4096
  }
@@ -4100,14 +4100,14 @@ var DropZoneEdit = (0, import_react30.forwardRef)(
4100
4100
  }
4101
4101
  };
4102
4102
  }, []);
4103
- const content = (0, import_react30.useMemo)(() => {
4103
+ const content = (0, import_react29.useMemo)(() => {
4104
4104
  if (areaId && zone !== rootDroppableId) {
4105
4105
  return setupZone(data, zoneCompound).zones[zoneCompound];
4106
4106
  }
4107
4107
  return data.content || [];
4108
4108
  }, [data, zoneCompound]);
4109
- const ref = (0, import_react30.useRef)(null);
4110
- const acceptsTarget = (0, import_react30.useCallback)(
4109
+ const ref = (0, import_react29.useRef)(null);
4110
+ const acceptsTarget = (0, import_react29.useCallback)(
4111
4111
  (componentType) => {
4112
4112
  if (!componentType) {
4113
4113
  return true;
@@ -4129,7 +4129,7 @@ var DropZoneEdit = (0, import_react30.forwardRef)(
4129
4129
  },
4130
4130
  [allow, disallow]
4131
4131
  );
4132
- (0, import_react30.useEffect)(() => {
4132
+ (0, import_react29.useEffect)(() => {
4133
4133
  if (registerLocalZone) {
4134
4134
  registerLocalZone(zoneCompound, acceptsTarget(draggedComponentType));
4135
4135
  }
@@ -4264,13 +4264,13 @@ var DropZoneEdit = (0, import_react30.forwardRef)(
4264
4264
  }
4265
4265
  );
4266
4266
  var DropZoneRenderPure = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropZoneRender, __spreadValues({}, props));
4267
- var DropZoneRender = (0, import_react30.forwardRef)(
4267
+ var DropZoneRender = (0, import_react29.forwardRef)(
4268
4268
  function DropZoneRenderInternal({ className, style, zone }, ref) {
4269
- const ctx = (0, import_react30.useContext)(dropZoneContext);
4269
+ const ctx = (0, import_react29.useContext)(dropZoneContext);
4270
4270
  const { data, areaId = "root", config } = ctx || {};
4271
4271
  let zoneCompound = rootDroppableId;
4272
4272
  let content = (data == null ? void 0 : data.content) || [];
4273
- (0, import_react30.useEffect)(() => {
4273
+ (0, import_react29.useEffect)(() => {
4274
4274
  if (ctx == null ? void 0 : ctx.registerZone) {
4275
4275
  ctx == null ? void 0 : ctx.registerZone(zoneCompound);
4276
4276
  }
@@ -4317,9 +4317,9 @@ var DropZoneRender = (0, import_react30.forwardRef)(
4317
4317
  }
4318
4318
  );
4319
4319
  var DropZonePure = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropZone, __spreadValues({}, props));
4320
- var DropZone = (0, import_react30.forwardRef)(
4320
+ var DropZone = (0, import_react29.forwardRef)(
4321
4321
  function DropZone2(props, ref) {
4322
- const ctx = (0, import_react30.useContext)(dropZoneContext);
4322
+ const ctx = (0, import_react29.useContext)(dropZoneContext);
4323
4323
  if ((ctx == null ? void 0 : ctx.mode) === "edit") {
4324
4324
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropZoneEdit, __spreadProps(__spreadValues({}, props), { ref })) });
4325
4325
  }
@@ -5014,12 +5014,12 @@ function getDeepDir(el) {
5014
5014
  // components/DragDropContext/index.tsx
5015
5015
  var import_jsx_runtime23 = require("react/jsx-runtime");
5016
5016
  var DEBUG3 = false;
5017
- var dragListenerContext = (0, import_react32.createContext)({
5017
+ var dragListenerContext = (0, import_react31.createContext)({
5018
5018
  dragListeners: {}
5019
5019
  });
5020
5020
  function useDragListener(type, fn, deps = []) {
5021
- const { setDragListeners } = (0, import_react32.useContext)(dragListenerContext);
5022
- (0, import_react32.useEffect)(() => {
5021
+ const { setDragListeners } = (0, import_react31.useContext)(dragListenerContext);
5022
+ (0, import_react31.useEffect)(() => {
5023
5023
  if (setDragListeners) {
5024
5024
  setDragListeners((old) => __spreadProps(__spreadValues({}, old), {
5025
5025
  [type]: [...old[type] || [], fn]
@@ -5029,8 +5029,8 @@ function useDragListener(type, fn, deps = []) {
5029
5029
  }
5030
5030
  var AREA_CHANGE_DEBOUNCE_MS = 100;
5031
5031
  var useTempDisableFallback = (timeout3) => {
5032
- const lastFallbackDisable = (0, import_react32.useRef)(null);
5033
- return (0, import_react32.useCallback)((manager) => {
5032
+ const lastFallbackDisable = (0, import_react31.useRef)(null);
5033
+ return (0, import_react31.useCallback)((manager) => {
5034
5034
  collisionStore.setState({ fallbackEnabled: false });
5035
5035
  const fallbackId = generateId();
5036
5036
  lastFallbackDisable.current = fallbackId;
@@ -5047,11 +5047,11 @@ var DragDropContextClient = ({
5047
5047
  disableAutoScroll
5048
5048
  }) => {
5049
5049
  const { state, config, dispatch, resolveData } = useAppContext();
5050
- const id = useSafeId();
5050
+ const id = (0, import_react31.useId)();
5051
5051
  const { data } = state;
5052
- const debouncedParamsRef = (0, import_react32.useRef)(null);
5052
+ const debouncedParamsRef = (0, import_react31.useRef)(null);
5053
5053
  const tempDisableFallback = useTempDisableFallback(100);
5054
- const [zoneStore] = (0, import_react32.useState)(
5054
+ const [zoneStore] = (0, import_react31.useState)(
5055
5055
  () => (0, import_zustand3.createStore)(() => ({
5056
5056
  zoneDepthIndex: {},
5057
5057
  nextZoneDepthIndex: {},
@@ -5061,7 +5061,7 @@ var DragDropContextClient = ({
5061
5061
  previewIndex: {}
5062
5062
  }))
5063
5063
  );
5064
- const getChanged2 = (0, import_react32.useCallback)(
5064
+ const getChanged2 = (0, import_react31.useCallback)(
5065
5065
  (params, id2) => {
5066
5066
  const { zoneDepthIndex = {}, areaDepthIndex = {} } = zoneStore.getState() || {};
5067
5067
  const stateHasZone = Object.keys(zoneDepthIndex).length > 0;
@@ -5082,7 +5082,7 @@ var DragDropContextClient = ({
5082
5082
  },
5083
5083
  [zoneStore]
5084
5084
  );
5085
- const setDeepestAndCollide = (0, import_react32.useCallback)(
5085
+ const setDeepestAndCollide = (0, import_react31.useCallback)(
5086
5086
  (params, manager) => {
5087
5087
  const { zoneChanged, areaChanged } = getChanged2(params, id);
5088
5088
  if (!zoneChanged && !areaChanged) return;
@@ -5106,7 +5106,7 @@ var DragDropContextClient = ({
5106
5106
  setDeepestDb.cancel();
5107
5107
  debouncedParamsRef.current = null;
5108
5108
  };
5109
- (0, import_react32.useEffect)(() => {
5109
+ (0, import_react31.useEffect)(() => {
5110
5110
  if (DEBUG3) {
5111
5111
  zoneStore.subscribe(
5112
5112
  (s) => {
@@ -5120,7 +5120,7 @@ var DragDropContextClient = ({
5120
5120
  );
5121
5121
  }
5122
5122
  }, []);
5123
- const [plugins] = (0, import_react32.useState)(() => [
5123
+ const [plugins] = (0, import_react31.useState)(() => [
5124
5124
  ...disableAutoScroll ? import_dom.defaultPreset.plugins.filter((plugin) => plugin !== import_dom.AutoScroller) : import_dom.defaultPreset.plugins,
5125
5125
  createNestedDroppablePlugin(
5126
5126
  {
@@ -5168,10 +5168,10 @@ var DragDropContextClient = ({
5168
5168
  )
5169
5169
  ]);
5170
5170
  const sensors = useSensors();
5171
- const [dragListeners, setDragListeners] = (0, import_react32.useState)({});
5172
- const [pathData, setPathData] = (0, import_react32.useState)();
5173
- const dragMode = (0, import_react32.useRef)(null);
5174
- const registerPath = (0, import_react32.useCallback)(
5171
+ const [dragListeners, setDragListeners] = (0, import_react31.useState)({});
5172
+ const [pathData, setPathData] = (0, import_react31.useState)();
5173
+ const dragMode = (0, import_react31.useRef)(null);
5174
+ const registerPath = (0, import_react31.useCallback)(
5175
5175
  (id2, selector, label) => {
5176
5176
  const [area] = getZoneId(selector.zone);
5177
5177
  setPathData((latestPathData = {}) => {
@@ -5189,7 +5189,7 @@ var DragDropContextClient = ({
5189
5189
  },
5190
5190
  [data, setPathData]
5191
5191
  );
5192
- const unregisterPath = (0, import_react32.useCallback)(
5192
+ const unregisterPath = (0, import_react31.useCallback)(
5193
5193
  (id2) => {
5194
5194
  setPathData((latestPathData = {}) => {
5195
5195
  const newPathData = __spreadValues({}, latestPathData);
@@ -5199,7 +5199,7 @@ var DragDropContextClient = ({
5199
5199
  },
5200
5200
  [data, setPathData]
5201
5201
  );
5202
- const initialSelector = (0, import_react32.useRef)(void 0);
5202
+ const initialSelector = (0, import_react31.useRef)(void 0);
5203
5203
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { id, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5204
5204
  dragListenerContext.Provider,
5205
5205
  {
@@ -5208,7 +5208,7 @@ var DragDropContextClient = ({
5208
5208
  setDragListeners
5209
5209
  },
5210
5210
  children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
5211
- import_react31.DragDropProvider,
5211
+ import_react30.DragDropProvider,
5212
5212
  {
5213
5213
  plugins,
5214
5214
  sensors,
@@ -5437,7 +5437,7 @@ var DrawerItemInner = ({
5437
5437
  dragRef,
5438
5438
  isDragDisabled
5439
5439
  }) => {
5440
- const CustomInner = (0, import_react33.useMemo)(
5440
+ const CustomInner = (0, import_react32.useMemo)(
5441
5441
  () => children || (({ children: children2 }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassNameItem2("default"), children: children2 })),
5442
5442
  [children]
5443
5443
  );
@@ -5491,7 +5491,7 @@ var DrawerItem = ({
5491
5491
  isDragDisabled
5492
5492
  }) => {
5493
5493
  const resolvedId = id || name;
5494
- const [dynamicId, setDynamicId] = (0, import_react33.useState)(generateId(resolvedId));
5494
+ const [dynamicId, setDynamicId] = (0, import_react32.useState)(generateId(resolvedId));
5495
5495
  if (typeof index !== "undefined") {
5496
5496
  console.error(
5497
5497
  "Warning: The `index` prop on Drawer.Item is deprecated and no longer required."
@@ -5530,7 +5530,7 @@ var Drawer = ({
5530
5530
  "Warning: The `direction` prop on Drawer is deprecated and no longer required to achieve multi-directional dragging."
5531
5531
  );
5532
5532
  }
5533
- const id = useSafeId();
5533
+ const id = (0, import_react32.useId)();
5534
5534
  const { ref } = useDroppableSafe({
5535
5535
  id,
5536
5536
  type: "void",
@@ -5552,7 +5552,7 @@ Drawer.Item = DrawerItem;
5552
5552
 
5553
5553
  // components/Puck/index.tsx
5554
5554
  init_react_import();
5555
- var import_react51 = require("react");
5555
+ var import_react50 = require("react");
5556
5556
 
5557
5557
  // components/SidebarSection/index.tsx
5558
5558
  init_react_import();
@@ -5563,7 +5563,7 @@ var styles_module_default13 = { "SidebarSection": "_SidebarSection_8boj8_1", "Si
5563
5563
 
5564
5564
  // lib/use-breadcrumbs.ts
5565
5565
  init_react_import();
5566
- var import_react34 = require("react");
5566
+ var import_react33 = require("react");
5567
5567
  var convertPathDataToBreadcrumbs = (selectedItem, pathData, data) => {
5568
5568
  const id = selectedItem ? selectedItem == null ? void 0 : selectedItem.props.id : "";
5569
5569
  const currentPathData = pathData && id && pathData[id] ? __spreadValues({}, pathData[id]) : { label: "Page", path: [] };
@@ -5613,8 +5613,8 @@ var useBreadcrumbs = (renderCount) => {
5613
5613
  state: { data },
5614
5614
  selectedItem
5615
5615
  } = useAppContext();
5616
- const dzContext = (0, import_react34.useContext)(dropZoneContext);
5617
- return (0, import_react34.useMemo)(() => {
5616
+ const dzContext = (0, import_react33.useContext)(dropZoneContext);
5617
+ return (0, import_react33.useMemo)(() => {
5618
5618
  const breadcrumbs = convertPathDataToBreadcrumbs(
5619
5619
  selectedItem,
5620
5620
  dzContext == null ? void 0 : dzContext.pathData,
@@ -5748,15 +5748,15 @@ init_react_import();
5748
5748
  var styles_module_default16 = { "PuckFields": "_PuckFields_10bh7_1", "PuckFields--isLoading": "_PuckFields--isLoading_10bh7_6", "PuckFields-loadingOverlay": "_PuckFields-loadingOverlay_10bh7_10", "PuckFields-loadingOverlayInner": "_PuckFields-loadingOverlayInner_10bh7_25", "PuckFields-field": "_PuckFields-field_10bh7_32", "PuckFields--wrapFields": "_PuckFields--wrapFields_10bh7_36" };
5749
5749
 
5750
5750
  // components/Puck/components/Fields/index.tsx
5751
- var import_react38 = require("react");
5751
+ var import_react37 = require("react");
5752
5752
 
5753
5753
  // lib/use-resolved-fields.ts
5754
5754
  init_react_import();
5755
- var import_react37 = require("react");
5755
+ var import_react36 = require("react");
5756
5756
 
5757
5757
  // lib/use-parent.ts
5758
5758
  init_react_import();
5759
- var import_react35 = require("react");
5759
+ var import_react34 = require("react");
5760
5760
  var getParent = (itemSelector, pathData, data) => {
5761
5761
  var _a;
5762
5762
  if (!itemSelector) return null;
@@ -5768,8 +5768,8 @@ var getParent = (itemSelector, pathData, data) => {
5768
5768
  };
5769
5769
  var useGetParent = () => {
5770
5770
  const { state } = useAppContext();
5771
- const { pathData } = (0, import_react35.useContext)(dropZoneContext) || {};
5772
- return (0, import_react35.useCallback)(
5771
+ const { pathData } = (0, import_react34.useContext)(dropZoneContext) || {};
5772
+ return (0, import_react34.useCallback)(
5773
5773
  () => getParent(state.ui.itemSelector, pathData, state.data),
5774
5774
  [state.ui.itemSelector, pathData, state.data]
5775
5775
  );
@@ -5780,10 +5780,10 @@ var useParent = () => {
5780
5780
 
5781
5781
  // lib/use-on-value-change.ts
5782
5782
  init_react_import();
5783
- var import_react36 = require("react");
5783
+ var import_react35 = require("react");
5784
5784
  function useOnValueChange(value, onChange, compare = Object.is, deps = []) {
5785
- const tracked = (0, import_react36.useRef)(value);
5786
- (0, import_react36.useEffect)(() => {
5785
+ const tracked = (0, import_react35.useRef)(value);
5786
+ (0, import_react35.useEffect)(() => {
5787
5787
  const oldValue = tracked.current;
5788
5788
  if (!compare(value, oldValue)) {
5789
5789
  tracked.current = value;
@@ -5810,27 +5810,27 @@ var useResolvedFields = ({
5810
5810
  const { data } = state;
5811
5811
  const rootFields = ((_a = config.root) == null ? void 0 : _a.fields) || defaultPageFields;
5812
5812
  const componentConfig = selectedItem ? config.components[selectedItem.type] : null;
5813
- const defaultFields = (0, import_react37.useMemo)(
5813
+ const defaultFields = (0, import_react36.useMemo)(
5814
5814
  () => (selectedItem ? componentConfig == null ? void 0 : componentConfig.fields : rootFields) || {},
5815
5815
  [selectedItem, rootFields, componentConfig == null ? void 0 : componentConfig.fields]
5816
5816
  );
5817
5817
  const rootProps = data.root.props || data.root;
5818
- const [lastSelectedData, setLastSelectedData] = (0, import_react37.useState)({});
5819
- const [resolvedFields, setResolvedFields] = (0, import_react37.useState)({
5818
+ const [lastSelectedData, setLastSelectedData] = (0, import_react36.useState)({});
5819
+ const [resolvedFields, setResolvedFields] = (0, import_react36.useState)({
5820
5820
  fields: defaultFields,
5821
5821
  id: selectedItem == null ? void 0 : selectedItem.props.id
5822
5822
  });
5823
- const [fieldsLoading, setFieldsLoading] = (0, import_react37.useState)(false);
5824
- const lastFields = (0, import_react37.useRef)(defaultFields);
5823
+ const [fieldsLoading, setFieldsLoading] = (0, import_react36.useState)(false);
5824
+ const lastFields = (0, import_react36.useRef)(defaultFields);
5825
5825
  const defaultResolveFields = (_componentData, _params) => defaultFields;
5826
- const componentData = (0, import_react37.useMemo)(
5826
+ const componentData = (0, import_react36.useMemo)(
5827
5827
  () => selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly || {} },
5828
5828
  [selectedItem, rootProps, data.root.readOnly]
5829
5829
  );
5830
5830
  const hasComponentResolver = selectedItem && (componentConfig == null ? void 0 : componentConfig.resolveFields);
5831
5831
  const hasRootResolver = !selectedItem && ((_b = config.root) == null ? void 0 : _b.resolveFields);
5832
5832
  const hasResolver = hasComponentResolver || hasRootResolver;
5833
- const resolveFields = (0, import_react37.useCallback)(
5833
+ const resolveFields = (0, import_react36.useCallback)(
5834
5834
  (..._0) => __async(void 0, [..._0], function* (fields = {}) {
5835
5835
  var _a2;
5836
5836
  const lastData = ((_a2 = lastSelectedData.props) == null ? void 0 : _a2.id) === componentData.props.id ? lastSelectedData : null;
@@ -5868,7 +5868,7 @@ var useResolvedFields = ({
5868
5868
  }),
5869
5869
  [data, config, componentData, selectedItem, state, parent]
5870
5870
  );
5871
- const triggerResolver = (0, import_react37.useCallback)(() => {
5871
+ const triggerResolver = (0, import_react36.useCallback)(() => {
5872
5872
  var _a2, _b2;
5873
5873
  if (!((_a2 = state.ui.itemSelector) == null ? void 0 : _a2.zone) || ((_b2 = state.ui.itemSelector) == null ? void 0 : _b2.zone) === "default-zone" || parent) {
5874
5874
  if (hasResolver) {
@@ -5908,7 +5908,7 @@ var useResolvedFields = ({
5908
5908
  },
5909
5909
  (a, b) => JSON.stringify(a) === JSON.stringify(b)
5910
5910
  );
5911
- (0, import_react37.useEffect)(() => {
5911
+ (0, import_react36.useEffect)(() => {
5912
5912
  triggerResolver();
5913
5913
  }, []);
5914
5914
  if (resolvedFields.id !== (selectedItem == null ? void 0 : selectedItem.props.id) && !_skipIdCheck) {
@@ -5943,7 +5943,7 @@ var Fields = ({ wrapFields = true }) => {
5943
5943
  const componentResolving = selectedItem ? ((_a = componentState[selectedItem == null ? void 0 : selectedItem.props.id]) == null ? void 0 : _a.loadingCount) > 0 : ((_b = componentState["puck-root"]) == null ? void 0 : _b.loadingCount) > 0;
5944
5944
  const isLoading = fieldsResolving || componentResolving;
5945
5945
  const rootProps = data.root.props || data.root;
5946
- const Wrapper = (0, import_react38.useMemo)(() => overrides.fields || DefaultFields, [overrides]);
5946
+ const Wrapper = (0, import_react37.useMemo)(() => overrides.fields || DefaultFields, [overrides]);
5947
5947
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5948
5948
  "form",
5949
5949
  {
@@ -6064,7 +6064,7 @@ init_react_import();
6064
6064
 
6065
6065
  // lib/use-component-list.tsx
6066
6066
  init_react_import();
6067
- var import_react39 = require("react");
6067
+ var import_react38 = require("react");
6068
6068
 
6069
6069
  // components/ComponentList/index.tsx
6070
6070
  init_react_import();
@@ -6131,8 +6131,8 @@ ComponentList.Item = ComponentListItem;
6131
6131
  // lib/use-component-list.tsx
6132
6132
  var import_jsx_runtime29 = require("react/jsx-runtime");
6133
6133
  var useComponentList = (config, ui) => {
6134
- const [componentList, setComponentList] = (0, import_react39.useState)();
6135
- (0, import_react39.useEffect)(() => {
6134
+ const [componentList, setComponentList] = (0, import_react38.useState)();
6135
+ (0, import_react38.useEffect)(() => {
6136
6136
  var _a, _b, _c;
6137
6137
  if (Object.keys(ui.componentList).length > 0) {
6138
6138
  const matchedComponents = [];
@@ -6201,22 +6201,22 @@ var useComponentList = (config, ui) => {
6201
6201
  };
6202
6202
 
6203
6203
  // components/Puck/components/Components/index.tsx
6204
- var import_react40 = require("react");
6204
+ var import_react39 = require("react");
6205
6205
  var import_jsx_runtime30 = require("react/jsx-runtime");
6206
6206
  var Components = () => {
6207
6207
  const { config, state, overrides } = useAppContext();
6208
6208
  const componentList = useComponentList(config, state.ui);
6209
- const Wrapper = (0, import_react40.useMemo)(() => overrides.components || "div", [overrides]);
6209
+ const Wrapper = (0, import_react39.useMemo)(() => overrides.components || "div", [overrides]);
6210
6210
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ComponentList, { id: "all" }) });
6211
6211
  };
6212
6212
 
6213
6213
  // components/Puck/components/Preview/index.tsx
6214
6214
  init_react_import();
6215
- var import_react42 = require("react");
6215
+ var import_react41 = require("react");
6216
6216
 
6217
6217
  // components/AutoFrame/index.tsx
6218
6218
  init_react_import();
6219
- var import_react41 = require("react");
6219
+ var import_react40 = require("react");
6220
6220
  var import_object_hash = __toESM(require("object-hash"));
6221
6221
  var import_react_dom3 = require("react-dom");
6222
6222
  var import_jsx_runtime31 = require("react/jsx-runtime");
@@ -6262,7 +6262,7 @@ var CopyHostStyles = ({
6262
6262
  onStylesLoaded = () => null
6263
6263
  }) => {
6264
6264
  const { document: doc, window: win } = useFrame();
6265
- (0, import_react41.useEffect)(() => {
6265
+ (0, import_react40.useEffect)(() => {
6266
6266
  if (!win || !doc) {
6267
6267
  return () => {
6268
6268
  };
@@ -6421,8 +6421,8 @@ var CopyHostStyles = ({
6421
6421
  }, []);
6422
6422
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children });
6423
6423
  };
6424
- var autoFrameContext = (0, import_react41.createContext)({});
6425
- var useFrame = () => (0, import_react41.useContext)(autoFrameContext);
6424
+ var autoFrameContext = (0, import_react40.createContext)({});
6425
+ var useFrame = () => (0, import_react40.useContext)(autoFrameContext);
6426
6426
  function AutoFrame(_a) {
6427
6427
  var _b = _a, {
6428
6428
  children,
@@ -6439,10 +6439,10 @@ function AutoFrame(_a) {
6439
6439
  "onStylesLoaded",
6440
6440
  "frameRef"
6441
6441
  ]);
6442
- const [loaded, setLoaded] = (0, import_react41.useState)(false);
6443
- const [ctx, setCtx] = (0, import_react41.useState)({});
6444
- const [mountTarget, setMountTarget] = (0, import_react41.useState)();
6445
- (0, import_react41.useEffect)(() => {
6442
+ const [loaded, setLoaded] = (0, import_react40.useState)(false);
6443
+ const [ctx, setCtx] = (0, import_react40.useState)({});
6444
+ const [mountTarget, setMountTarget] = (0, import_react40.useState)();
6445
+ (0, import_react40.useEffect)(() => {
6446
6446
  var _a2;
6447
6447
  if (frameRef.current) {
6448
6448
  setCtx({
@@ -6537,7 +6537,7 @@ var import_jsx_runtime33 = require("react/jsx-runtime");
6537
6537
  var getClassName23 = get_class_name_factory_default("PuckPreview", styles_module_default18);
6538
6538
  var useBubbleIframeEvents = (ref) => {
6539
6539
  const { status } = useAppContext();
6540
- (0, import_react42.useEffect)(() => {
6540
+ (0, import_react41.useEffect)(() => {
6541
6541
  var _a;
6542
6542
  if (ref.current && status === "READY") {
6543
6543
  const iframe = ref.current;
@@ -6570,7 +6570,7 @@ var useBubbleIframeEvents = (ref) => {
6570
6570
  };
6571
6571
  var Preview2 = ({ id = "puck-preview" }) => {
6572
6572
  const { config, dispatch, state, setStatus, iframe, overrides } = useAppContext();
6573
- const Page = (0, import_react42.useCallback)(
6573
+ const Page = (0, import_react41.useCallback)(
6574
6574
  (pageProps) => {
6575
6575
  var _a, _b;
6576
6576
  return ((_a = config.root) == null ? void 0 : _a.render) ? (_b = config.root) == null ? void 0 : _b.render(__spreadValues({
@@ -6579,9 +6579,9 @@ var Preview2 = ({ id = "puck-preview" }) => {
6579
6579
  },
6580
6580
  [config.root]
6581
6581
  );
6582
- const Frame = (0, import_react42.useMemo)(() => overrides.iframe, [overrides]);
6582
+ const Frame = (0, import_react41.useMemo)(() => overrides.iframe, [overrides]);
6583
6583
  const rootProps = state.data.root.props || state.data.root;
6584
- const ref = (0, import_react42.useRef)(null);
6584
+ const ref = (0, import_react41.useRef)(null);
6585
6585
  useBubbleIframeEvents(ref);
6586
6586
  const inner = state.ui.previewMode === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6587
6587
  Page,
@@ -6678,7 +6678,7 @@ var scrollIntoView = (el) => {
6678
6678
  };
6679
6679
 
6680
6680
  // components/LayerTree/index.tsx
6681
- var import_react43 = require("react");
6681
+ var import_react42 = require("react");
6682
6682
 
6683
6683
  // lib/is-child-of-zone.ts
6684
6684
  init_react_import();
@@ -6724,7 +6724,7 @@ var LayerTree = ({
6724
6724
  label
6725
6725
  }) => {
6726
6726
  const zones = data.zones || {};
6727
- const ctx = (0, import_react43.useContext)(dropZoneContext);
6727
+ const ctx = (0, import_react42.useContext)(dropZoneContext);
6728
6728
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
6729
6729
  label && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: getClassName24("zoneTitle"), children: [
6730
6730
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: getClassName24("zoneIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Layers, { size: "16" }) }),
@@ -6831,13 +6831,13 @@ var LayerTree = ({
6831
6831
  };
6832
6832
 
6833
6833
  // components/Puck/components/Outline/index.tsx
6834
- var import_react44 = require("react");
6834
+ var import_react43 = require("react");
6835
6835
  var import_jsx_runtime35 = require("react/jsx-runtime");
6836
6836
  var Outline = () => {
6837
6837
  const { dispatch, state, overrides, config } = useAppContext();
6838
6838
  const { data, ui } = state;
6839
6839
  const { itemSelector } = ui;
6840
- const setItemSelector = (0, import_react44.useCallback)(
6840
+ const setItemSelector = (0, import_react43.useCallback)(
6841
6841
  (newItemSelector) => {
6842
6842
  dispatch({
6843
6843
  type: "setUi",
@@ -6846,7 +6846,7 @@ var Outline = () => {
6846
6846
  },
6847
6847
  []
6848
6848
  );
6849
- const Wrapper = (0, import_react44.useMemo)(() => overrides.outline || "div", [overrides]);
6849
+ const Wrapper = (0, import_react43.useMemo)(() => overrides.outline || "div", [overrides]);
6850
6850
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(dropZoneContext.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
6851
6851
  (ctx == null ? void 0 : ctx.activeZones) && (ctx == null ? void 0 : ctx.activeZones[rootDroppableId]) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
6852
6852
  LayerTree,
@@ -6960,19 +6960,19 @@ function usePuckHistory({
6960
6960
 
6961
6961
  // lib/use-history-store.ts
6962
6962
  init_react_import();
6963
- var import_react45 = require("react");
6963
+ var import_react44 = require("react");
6964
6964
  var import_use_debounce3 = require("use-debounce");
6965
6965
  var EMPTY_HISTORY_INDEX = 0;
6966
6966
  function useHistoryStore(initialHistory) {
6967
6967
  var _a, _b;
6968
- const [histories, setHistories] = (0, import_react45.useState)(
6968
+ const [histories, setHistories] = (0, import_react44.useState)(
6969
6969
  (_a = initialHistory == null ? void 0 : initialHistory.histories) != null ? _a : []
6970
6970
  );
6971
6971
  const updateHistories = (histories2) => {
6972
6972
  setHistories(histories2);
6973
6973
  setIndex(histories2.length - 1);
6974
6974
  };
6975
- const [index, setIndex] = (0, import_react45.useState)(
6975
+ const [index, setIndex] = (0, import_react44.useState)(
6976
6976
  (_b = initialHistory == null ? void 0 : initialHistory.index) != null ? _b : EMPTY_HISTORY_INDEX
6977
6977
  );
6978
6978
  const hasPast = index > EMPTY_HISTORY_INDEX;
@@ -7132,11 +7132,11 @@ var getBox = function getBox2(el) {
7132
7132
  };
7133
7133
 
7134
7134
  // components/Puck/components/Canvas/index.tsx
7135
- var import_react47 = require("react");
7135
+ var import_react46 = require("react");
7136
7136
 
7137
7137
  // components/ViewportControls/index.tsx
7138
7138
  init_react_import();
7139
- var import_react46 = require("react");
7139
+ var import_react45 = require("react");
7140
7140
 
7141
7141
  // css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
7142
7142
  init_react_import();
@@ -7159,8 +7159,8 @@ var ViewportButton = ({
7159
7159
  onClick
7160
7160
  }) => {
7161
7161
  const { state } = useAppContext();
7162
- const [isActive, setIsActive] = (0, import_react46.useState)(false);
7163
- (0, import_react46.useEffect)(() => {
7162
+ const [isActive, setIsActive] = (0, import_react45.useState)(false);
7163
+ (0, import_react45.useEffect)(() => {
7164
7164
  setIsActive(width === state.ui.viewports.current.width);
7165
7165
  }, [width, state.ui.viewports.current.width]);
7166
7166
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: getClassNameButton({ isActive }), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
@@ -7196,7 +7196,7 @@ var ViewportControls = ({
7196
7196
  const defaultsContainAutoZoom = defaultZoomOptions.find(
7197
7197
  (option) => option.value === autoZoom
7198
7198
  );
7199
- const zoomOptions = (0, import_react46.useMemo)(
7199
+ const zoomOptions = (0, import_react45.useMemo)(
7200
7200
  () => [
7201
7201
  ...defaultZoomOptions,
7202
7202
  ...defaultsContainAutoZoom ? [] : [
@@ -7319,17 +7319,17 @@ var Canvas = () => {
7319
7319
  const { status, iframe } = useAppContext();
7320
7320
  const { dispatch, state, overrides, setUi, zoomConfig, setZoomConfig } = useAppContext();
7321
7321
  const { ui } = state;
7322
- const frameRef = (0, import_react47.useRef)(null);
7323
- const [showTransition, setShowTransition] = (0, import_react47.useState)(false);
7324
- const defaultRender = (0, import_react47.useMemo)(() => {
7322
+ const frameRef = (0, import_react46.useRef)(null);
7323
+ const [showTransition, setShowTransition] = (0, import_react46.useState)(false);
7324
+ const defaultRender = (0, import_react46.useMemo)(() => {
7325
7325
  const PuckDefault = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children });
7326
7326
  return PuckDefault;
7327
7327
  }, []);
7328
- const CustomPreview = (0, import_react47.useMemo)(
7328
+ const CustomPreview = (0, import_react46.useMemo)(
7329
7329
  () => overrides.preview || defaultRender,
7330
7330
  [overrides]
7331
7331
  );
7332
- const getFrameDimensions = (0, import_react47.useCallback)(() => {
7332
+ const getFrameDimensions = (0, import_react46.useCallback)(() => {
7333
7333
  if (frameRef.current) {
7334
7334
  const frame = frameRef.current;
7335
7335
  const box = getBox(frame);
@@ -7337,7 +7337,7 @@ var Canvas = () => {
7337
7337
  }
7338
7338
  return { width: 0, height: 0 };
7339
7339
  }, [frameRef]);
7340
- const resetAutoZoom = (0, import_react47.useCallback)(
7340
+ const resetAutoZoom = (0, import_react46.useCallback)(
7341
7341
  (ui2 = state.ui) => {
7342
7342
  if (frameRef.current) {
7343
7343
  setZoomConfig(
@@ -7347,11 +7347,11 @@ var Canvas = () => {
7347
7347
  },
7348
7348
  [frameRef, zoomConfig, state.ui]
7349
7349
  );
7350
- (0, import_react47.useEffect)(() => {
7350
+ (0, import_react46.useEffect)(() => {
7351
7351
  setShowTransition(false);
7352
7352
  resetAutoZoom();
7353
7353
  }, [frameRef, ui.leftSideBarVisible, ui.rightSideBarVisible]);
7354
- (0, import_react47.useEffect)(() => {
7354
+ (0, import_react46.useEffect)(() => {
7355
7355
  const { height: frameHeight } = getFrameDimensions();
7356
7356
  if (ui.viewports.current.height === "auto") {
7357
7357
  setZoomConfig(__spreadProps(__spreadValues({}, zoomConfig), {
@@ -7359,13 +7359,13 @@ var Canvas = () => {
7359
7359
  }));
7360
7360
  }
7361
7361
  }, [zoomConfig.zoom]);
7362
- (0, import_react47.useEffect)(() => {
7362
+ (0, import_react46.useEffect)(() => {
7363
7363
  if (ZOOM_ON_CHANGE) {
7364
7364
  setShowTransition(true);
7365
7365
  resetAutoZoom(ui);
7366
7366
  }
7367
7367
  }, [ui.viewports.current.width]);
7368
- (0, import_react47.useEffect)(() => {
7368
+ (0, import_react46.useEffect)(() => {
7369
7369
  const cb = () => {
7370
7370
  setShowTransition(false);
7371
7371
  resetAutoZoom();
@@ -7375,8 +7375,8 @@ var Canvas = () => {
7375
7375
  window.removeEventListener("resize", cb);
7376
7376
  };
7377
7377
  }, []);
7378
- const [showLoader, setShowLoader] = (0, import_react47.useState)(false);
7379
- (0, import_react47.useEffect)(() => {
7378
+ const [showLoader, setShowLoader] = (0, import_react46.useState)(false);
7379
+ (0, import_react46.useEffect)(() => {
7380
7380
  setTimeout(() => {
7381
7381
  setShowLoader(true);
7382
7382
  }, 500);
@@ -7454,7 +7454,7 @@ var Canvas = () => {
7454
7454
 
7455
7455
  // lib/use-loaded-overrides.ts
7456
7456
  init_react_import();
7457
- var import_react48 = require("react");
7457
+ var import_react47 = require("react");
7458
7458
 
7459
7459
  // lib/load-overrides.ts
7460
7460
  init_react_import();
@@ -7493,7 +7493,7 @@ var useLoadedOverrides = ({
7493
7493
  overrides,
7494
7494
  plugins
7495
7495
  }) => {
7496
- return (0, import_react48.useMemo)(() => {
7496
+ return (0, import_react47.useMemo)(() => {
7497
7497
  return loadOverrides({ overrides, plugins });
7498
7498
  }, [plugins, overrides]);
7499
7499
  };
@@ -7505,14 +7505,14 @@ var DefaultOverride = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime38
7505
7505
 
7506
7506
  // lib/use-inject-css.ts
7507
7507
  init_react_import();
7508
- var import_react49 = require("react");
7508
+ var import_react48 = require("react");
7509
7509
  var styles = ``;
7510
7510
  var useInjectStyleSheet = (initialStyles, iframeEnabled) => {
7511
- const [el, setEl] = (0, import_react49.useState)();
7512
- (0, import_react49.useEffect)(() => {
7511
+ const [el, setEl] = (0, import_react48.useState)();
7512
+ (0, import_react48.useEffect)(() => {
7513
7513
  setEl(document.createElement("style"));
7514
7514
  }, []);
7515
- (0, import_react49.useEffect)(() => {
7515
+ (0, import_react48.useEffect)(() => {
7516
7516
  var _a;
7517
7517
  if (!el || typeof window === "undefined") {
7518
7518
  return;
@@ -7532,10 +7532,10 @@ var useInjectGlobalCss = (iframeEnabled) => {
7532
7532
 
7533
7533
  // lib/use-preview-mode-hotkeys.ts
7534
7534
  init_react_import();
7535
- var import_react50 = require("react");
7535
+ var import_react49 = require("react");
7536
7536
  var import_react_hotkeys_hook2 = require("react-hotkeys-hook");
7537
7537
  var usePreviewModeHotkeys = (dispatch, iframeEnabled) => {
7538
- const toggleInteractive = (0, import_react50.useCallback)(() => {
7538
+ const toggleInteractive = (0, import_react49.useCallback)(() => {
7539
7539
  dispatch({
7540
7540
  type: "setUi",
7541
7541
  ui: (ui) => ({
@@ -7592,7 +7592,7 @@ function Puck({
7592
7592
  waitForStyles: true
7593
7593
  }, _iframe);
7594
7594
  useInjectGlobalCss(iframe.enabled);
7595
- const [generatedAppState] = (0, import_react51.useState)(() => {
7595
+ const [generatedAppState] = (0, import_react50.useState)(() => {
7596
7596
  var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
7597
7597
  const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
7598
7598
  let clientUiState = {};
@@ -7664,14 +7664,14 @@ function Puck({
7664
7664
  histories,
7665
7665
  index: initialHistoryIndex
7666
7666
  });
7667
- const [reducer] = (0, import_react51.useState)(
7667
+ const [reducer] = (0, import_react50.useState)(
7668
7668
  () => createReducer({
7669
7669
  config,
7670
7670
  record: historyStore.record,
7671
7671
  onAction
7672
7672
  })
7673
7673
  );
7674
- const [appState, dispatch] = (0, import_react51.useReducer)(
7674
+ const [appState, dispatch] = (0, import_react50.useReducer)(
7675
7675
  reducer,
7676
7676
  flushZones(initialAppState)
7677
7677
  );
@@ -7682,14 +7682,14 @@ function Puck({
7682
7682
  historyStore,
7683
7683
  iframeEnabled: (_a = _iframe == null ? void 0 : _iframe.enabled) != null ? _a : true
7684
7684
  });
7685
- const [menuOpen, setMenuOpen] = (0, import_react51.useState)(false);
7685
+ const [menuOpen, setMenuOpen] = (0, import_react50.useState)(false);
7686
7686
  const { itemSelector, leftSideBarVisible, rightSideBarVisible } = ui;
7687
7687
  const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
7688
- (0, import_react51.useEffect)(() => {
7688
+ (0, import_react50.useEffect)(() => {
7689
7689
  if (onChange) onChange(data);
7690
7690
  }, [data]);
7691
7691
  const rootProps = data.root.props || data.root;
7692
- const toggleSidebars = (0, import_react51.useCallback)(
7692
+ const toggleSidebars = (0, import_react50.useCallback)(
7693
7693
  (sidebar) => {
7694
7694
  const widerViewport = window.matchMedia("(min-width: 638px)").matches;
7695
7695
  const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
@@ -7703,7 +7703,7 @@ function Puck({
7703
7703
  },
7704
7704
  [dispatch, leftSideBarVisible, rightSideBarVisible]
7705
7705
  );
7706
- (0, import_react51.useEffect)(() => {
7706
+ (0, import_react50.useEffect)(() => {
7707
7707
  if (!window.matchMedia("(min-width: 638px)").matches) {
7708
7708
  dispatch({
7709
7709
  type: "setUi",
@@ -7726,7 +7726,7 @@ function Puck({
7726
7726
  window.removeEventListener("resize", handleResize);
7727
7727
  };
7728
7728
  }, []);
7729
- const defaultHeaderRender = (0, import_react51.useMemo)(() => {
7729
+ const defaultHeaderRender = (0, import_react50.useMemo)(() => {
7730
7730
  if (renderHeader) {
7731
7731
  console.warn(
7732
7732
  "`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
@@ -7740,7 +7740,7 @@ function Puck({
7740
7740
  }
7741
7741
  return DefaultOverride;
7742
7742
  }, [renderHeader]);
7743
- const defaultHeaderActionsRender = (0, import_react51.useMemo)(() => {
7743
+ const defaultHeaderActionsRender = (0, import_react50.useMemo)(() => {
7744
7744
  if (renderHeaderActions) {
7745
7745
  console.warn(
7746
7746
  "`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
@@ -7757,20 +7757,20 @@ function Puck({
7757
7757
  overrides,
7758
7758
  plugins
7759
7759
  });
7760
- const CustomPuck = (0, import_react51.useMemo)(
7760
+ const CustomPuck = (0, import_react50.useMemo)(
7761
7761
  () => loadedOverrides.puck || DefaultOverride,
7762
7762
  [loadedOverrides]
7763
7763
  );
7764
- const CustomHeader = (0, import_react51.useMemo)(
7764
+ const CustomHeader = (0, import_react50.useMemo)(
7765
7765
  () => loadedOverrides.header || defaultHeaderRender,
7766
7766
  [loadedOverrides]
7767
7767
  );
7768
- const CustomHeaderActions = (0, import_react51.useMemo)(
7768
+ const CustomHeaderActions = (0, import_react50.useMemo)(
7769
7769
  () => loadedOverrides.headerActions || defaultHeaderActionsRender,
7770
7770
  [loadedOverrides]
7771
7771
  );
7772
- const [mounted, setMounted] = (0, import_react51.useState)(false);
7773
- (0, import_react51.useEffect)(() => {
7772
+ const [mounted, setMounted] = (0, import_react50.useState)(false);
7773
+ (0, import_react50.useEffect)(() => {
7774
7774
  setMounted(true);
7775
7775
  }, []);
7776
7776
  const selectedComponentConfig = selectedItem && config.components[selectedItem.type];