@measured/puck 0.18.3-canary.154e7f7 → 0.18.3-canary.1d484ee

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.mjs CHANGED
@@ -8,15 +8,15 @@ import {
8
8
  __spreadProps,
9
9
  __spreadValues,
10
10
  __toESM,
11
- defaultData,
12
11
  getChanged,
13
12
  init_react_import,
14
13
  resolveAllData,
15
14
  resolveComponentData,
16
15
  resolveRootData,
17
16
  rootDroppableId,
18
- setupZone
19
- } from "./chunk-CHWFBYEM.mjs";
17
+ setupZone,
18
+ transformProps
19
+ } from "./chunk-4QIG6FWS.mjs";
20
20
 
21
21
  // ../../node_modules/classnames/index.js
22
22
  var require_classnames = __commonJS({
@@ -213,7 +213,7 @@ import {
213
213
  useContext as useContext3,
214
214
  useEffect as useEffect9,
215
215
  useMemo as useMemo5,
216
- useState as useState12
216
+ useState as useState11
217
217
  } from "react";
218
218
 
219
219
  // components/AutoField/fields/index.tsx
@@ -674,7 +674,7 @@ var IconButton = ({
674
674
  };
675
675
 
676
676
  // components/AutoField/fields/ArrayField/index.tsx
677
- import { useCallback as useCallback3, useEffect as useEffect4, useState as useState7 } from "react";
677
+ import { useCallback as useCallback3, useEffect as useEffect4, useState as useState6 } from "react";
678
678
 
679
679
  // components/DragIcon/index.tsx
680
680
  init_react_import();
@@ -1084,7 +1084,6 @@ function useAppContext() {
1084
1084
  // components/Sortable/index.tsx
1085
1085
  init_react_import();
1086
1086
  import { DragDropProvider } from "@dnd-kit/react";
1087
- import { useState as useState6 } from "react";
1088
1087
 
1089
1088
  // lib/dnd/dnd-kit/safe.ts
1090
1089
  init_react_import();
@@ -1110,7 +1109,8 @@ function useDraggableSafe(input) {
1110
1109
  function useSortableSafe(input) {
1111
1110
  if (typeof window === "undefined") {
1112
1111
  return { ref: () => {
1113
- }, status: "idle" };
1112
+ }, status: "idle", handleRef: () => {
1113
+ } };
1114
1114
  }
1115
1115
  return useSortable(input);
1116
1116
  }
@@ -1394,23 +1394,26 @@ function patchWindow(window2) {
1394
1394
 
1395
1395
  // lib/dnd/use-sensors.ts
1396
1396
  import { isElement as isElement2 } from "@dnd-kit/dom/utilities";
1397
- var useSensors = () => {
1397
+ var useSensors = ({
1398
+ other,
1399
+ mouse,
1400
+ touch
1401
+ } = {
1402
+ touch: { delay: { value: 200, tolerance: 10 } },
1403
+ other: { delay: { value: 200, tolerance: 10 }, distance: { value: 5 } }
1404
+ }) => {
1398
1405
  const [sensors] = useState5(() => [
1399
1406
  PointerSensor.configure({
1400
1407
  activationConstraints(event, source) {
1401
1408
  var _a;
1402
1409
  const { pointerType, target } = event;
1403
1410
  if (pointerType === "mouse" && isElement2(target) && (source.handle === target || ((_a = source.handle) == null ? void 0 : _a.contains(target)))) {
1404
- return void 0;
1411
+ return mouse;
1405
1412
  }
1406
- const delay = { value: 200, tolerance: 10 };
1407
1413
  if (pointerType === "touch") {
1408
- return { delay };
1414
+ return touch;
1409
1415
  }
1410
- return {
1411
- delay,
1412
- distance: { value: 5 }
1413
- };
1416
+ return other;
1414
1417
  }
1415
1418
  })
1416
1419
  ]);
@@ -1756,7 +1759,6 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input
1756
1759
  };
1757
1760
 
1758
1761
  // components/Sortable/index.tsx
1759
- import { RestrictToElement } from "@dnd-kit/dom/modifiers";
1760
1762
  import { jsx as jsx6 } from "react/jsx-runtime";
1761
1763
  var SortableProvider = ({
1762
1764
  children,
@@ -1764,22 +1766,20 @@ var SortableProvider = ({
1764
1766
  onDragEnd,
1765
1767
  onMove
1766
1768
  }) => {
1767
- const [move, setMove] = useState6({ source: -1, target: -1 });
1768
- const sensors = useSensors();
1769
+ const sensors = useSensors({
1770
+ mouse: { distance: { value: 5 } }
1771
+ });
1769
1772
  return /* @__PURE__ */ jsx6(
1770
1773
  DragDropProvider,
1771
1774
  {
1772
1775
  sensors,
1773
- modifiers: [
1774
- RestrictToElement.configure({
1775
- element() {
1776
- return document.querySelector("[data-dnd-container]");
1777
- }
1778
- })
1779
- ],
1780
- onDragStart,
1776
+ onDragStart: (event) => {
1777
+ var _a, _b;
1778
+ return onDragStart((_b = (_a = event.operation.source) == null ? void 0 : _a.id.toString()) != null ? _b : "");
1779
+ },
1781
1780
  onDragOver: (event, manager) => {
1782
1781
  var _a, _b;
1782
+ event.preventDefault();
1783
1783
  const { operation } = event;
1784
1784
  const { source, target } = operation;
1785
1785
  if (!source || !target) return;
@@ -1787,14 +1787,14 @@ var SortableProvider = ({
1787
1787
  let targetIndex = target.data.index;
1788
1788
  const collisionData = (_b = (_a = manager.dragOperation.data) == null ? void 0 : _a.collisionMap) == null ? void 0 : _b[target.id];
1789
1789
  if (sourceIndex !== targetIndex && source.id !== target.id) {
1790
- const collisionPosition = (collisionData == null ? void 0 : collisionData.direction) === "up" ? "before" : "after";
1790
+ const collisionPosition = collisionData.direction === "up" ? "before" : "after";
1791
1791
  if (targetIndex >= sourceIndex) {
1792
1792
  targetIndex = targetIndex - 1;
1793
1793
  }
1794
1794
  if (collisionPosition === "after") {
1795
1795
  targetIndex = targetIndex + 1;
1796
1796
  }
1797
- setMove({
1797
+ onMove({
1798
1798
  source: sourceIndex,
1799
1799
  target: targetIndex
1800
1800
  });
@@ -1802,12 +1802,8 @@ var SortableProvider = ({
1802
1802
  },
1803
1803
  onDragEnd: () => {
1804
1804
  setTimeout(() => {
1805
- if (move.source !== -1 && move.target !== -1) {
1806
- onMove(move);
1807
- }
1808
1805
  onDragEnd();
1809
1806
  }, 250);
1810
- setMove({ source: -1, target: -1 });
1811
1807
  },
1812
1808
  children
1813
1809
  }
@@ -1820,7 +1816,11 @@ var Sortable = ({
1820
1816
  children,
1821
1817
  type = "item"
1822
1818
  }) => {
1823
- const { ref: sortableRef, status } = useSortableSafe({
1819
+ const {
1820
+ ref: sortableRef,
1821
+ status,
1822
+ handleRef
1823
+ } = useSortableSafe({
1824
1824
  id,
1825
1825
  type,
1826
1826
  index,
@@ -1828,7 +1828,7 @@ var Sortable = ({
1828
1828
  data: { index },
1829
1829
  collisionDetector: createDynamicCollisionDetector("y")
1830
1830
  });
1831
- return children({ status, ref: sortableRef });
1831
+ return children({ status, ref: sortableRef, handleRef });
1832
1832
  };
1833
1833
 
1834
1834
  // components/AutoField/context.tsx
@@ -1902,10 +1902,16 @@ var ArrayField = ({
1902
1902
  }),
1903
1903
  openId: ""
1904
1904
  };
1905
- const [localState, setLocalState] = useState7({ arrayState, value });
1905
+ const [localState, setLocalState] = useState6({ arrayState, value });
1906
+ const updateLocalState = useCallback3(
1907
+ (value2) => {
1908
+ setLocalState({ arrayState, value: value2 });
1909
+ },
1910
+ [arrayState]
1911
+ );
1906
1912
  useEffect4(() => {
1907
- setLocalState({ arrayState, value });
1908
- }, [value, state.ui.arrayState[id]]);
1913
+ updateLocalState(value);
1914
+ }, [value]);
1909
1915
  const mapArrayStateToUi = useCallback3(
1910
1916
  (partialArrayState) => {
1911
1917
  return {
@@ -1946,7 +1952,8 @@ var ArrayField = ({
1946
1952
  setUi(mapArrayStateToUi(arrayState));
1947
1953
  }
1948
1954
  }, []);
1949
- const [isDragging, setIsDragging] = useState7(false);
1955
+ const [draggedItem, setDraggedItem] = useState6("");
1956
+ const isDragging = !!draggedItem;
1950
1957
  const forceReadOnly = getPermissions({ item: selectedItem }).edit === false;
1951
1958
  if (field.type !== "array" || !field.arrayFields) {
1952
1959
  return null;
@@ -1962,10 +1969,16 @@ var ArrayField = ({
1962
1969
  children: /* @__PURE__ */ jsx8(
1963
1970
  SortableProvider,
1964
1971
  {
1965
- onDragStart: () => setIsDragging(true),
1966
- onDragEnd: () => setIsDragging(false),
1972
+ onDragStart: (id2) => setDraggedItem(id2),
1973
+ onDragEnd: () => {
1974
+ setDraggedItem("");
1975
+ onChange(localState.value);
1976
+ },
1967
1977
  onMove: (move) => {
1968
- const newValue = reorder(value, move.source, move.target);
1978
+ if (arrayState.items[move.source]._arrayId !== draggedItem) {
1979
+ return;
1980
+ }
1981
+ const newValue = reorder(localState.value, move.source, move.target);
1969
1982
  const newArrayStateItems = reorder(
1970
1983
  arrayState.items,
1971
1984
  move.source,
@@ -1977,7 +1990,6 @@ var ArrayField = ({
1977
1990
  })
1978
1991
  };
1979
1992
  setUi(newUi, false);
1980
- onChange(newValue, newUi);
1981
1993
  setLocalState({
1982
1994
  value: newValue,
1983
1995
  arrayState: __spreadProps(__spreadValues({}, arrayState), { items: newArrayStateItems })
@@ -1990,11 +2002,8 @@ var ArrayField = ({
1990
2002
  hasItems: Array.isArray(value) && value.length > 0,
1991
2003
  addDisabled
1992
2004
  }),
1993
- onClick: (e) => {
1994
- e.preventDefault();
1995
- },
1996
2005
  children: [
1997
- /* @__PURE__ */ jsx8("div", { className: getClassName5("inner"), "data-dnd-container": true, children: localState.arrayState.items.map((item, i) => {
2006
+ localState.arrayState.items.length > 0 && /* @__PURE__ */ jsx8("div", { className: getClassName5("inner"), "data-dnd-container": true, children: localState.arrayState.items.map((item, i) => {
1998
2007
  const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
1999
2008
  const data = Array.from(localState.value || [])[i] || {};
2000
2009
  return /* @__PURE__ */ jsx8(
@@ -2003,7 +2012,7 @@ var ArrayField = ({
2003
2012
  id: _arrayId,
2004
2013
  index: i,
2005
2014
  disabled: readOnly,
2006
- children: ({ status, ref }) => /* @__PURE__ */ jsxs3(
2015
+ children: ({ status, ref, handleRef }) => /* @__PURE__ */ jsxs3(
2007
2016
  "div",
2008
2017
  {
2009
2018
  ref,
@@ -2016,6 +2025,7 @@ var ArrayField = ({
2016
2025
  /* @__PURE__ */ jsxs3(
2017
2026
  "div",
2018
2027
  {
2028
+ ref: handleRef,
2019
2029
  onClick: (e) => {
2020
2030
  if (isDragging) return;
2021
2031
  e.preventDefault();
@@ -2093,58 +2103,49 @@ var ArrayField = ({
2093
2103
  ]
2094
2104
  }
2095
2105
  ),
2096
- /* @__PURE__ */ jsx8("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ jsx8(
2097
- "fieldset",
2098
- {
2099
- className: getClassNameItem("fieldset"),
2100
- onPointerDownCapture: (e) => {
2101
- e.stopPropagation();
2102
- },
2103
- children: Object.keys(field.arrayFields).map((subName) => {
2104
- const subField = field.arrayFields[subName];
2105
- const indexName = `${name}[${i}]`;
2106
- const subPath = `${indexName}.${subName}`;
2107
- const localIndexName = `${localName}[${i}]`;
2108
- const localWildcardName = `${localName}[*]`;
2109
- const localSubPath = `${localIndexName}.${subName}`;
2110
- const localWildcardSubPath = `${localWildcardName}.${subName}`;
2111
- const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
2112
- const label2 = subField.label || subName;
2113
- return /* @__PURE__ */ jsx8(
2114
- NestedFieldProvider,
2106
+ /* @__PURE__ */ jsx8("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ jsx8("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
2107
+ const subField = field.arrayFields[subName];
2108
+ const indexName = `${name}[${i}]`;
2109
+ const subPath = `${indexName}.${subName}`;
2110
+ const localIndexName = `${localName}[${i}]`;
2111
+ const localWildcardName = `${localName}[*]`;
2112
+ const localSubPath = `${localIndexName}.${subName}`;
2113
+ const localWildcardSubPath = `${localWildcardName}.${subName}`;
2114
+ const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
2115
+ const label2 = subField.label || subName;
2116
+ return /* @__PURE__ */ jsx8(
2117
+ NestedFieldProvider,
2118
+ {
2119
+ name: localIndexName,
2120
+ wildcardName: localWildcardName,
2121
+ subName,
2122
+ readOnlyFields,
2123
+ children: /* @__PURE__ */ jsx8(
2124
+ AutoFieldPrivate,
2115
2125
  {
2116
- name: localIndexName,
2117
- wildcardName: localWildcardName,
2118
- subName,
2119
- readOnlyFields,
2120
- children: /* @__PURE__ */ jsx8(
2121
- AutoFieldPrivate,
2122
- {
2123
- name: subPath,
2124
- label: label2,
2125
- id: `${_arrayId}_${subName}`,
2126
- readOnly: subReadOnly,
2127
- field: __spreadProps(__spreadValues({}, subField), {
2128
- label: label2
2129
- // May be used by custom fields
2130
- }),
2131
- value: data[subName],
2132
- onChange: (val, ui) => {
2133
- onChange(
2134
- replace(value, i, __spreadProps(__spreadValues({}, data), {
2135
- [subName]: val
2136
- })),
2137
- ui
2138
- );
2139
- }
2140
- }
2141
- )
2142
- },
2143
- subPath
2144
- );
2145
- })
2146
- }
2147
- ) })
2126
+ name: subPath,
2127
+ label: label2,
2128
+ id: `${_arrayId}_${subName}`,
2129
+ readOnly: subReadOnly,
2130
+ field: __spreadProps(__spreadValues({}, subField), {
2131
+ label: label2
2132
+ // May be used by custom fields
2133
+ }),
2134
+ value: data[subName],
2135
+ onChange: (val, ui) => {
2136
+ onChange(
2137
+ replace(value, i, __spreadProps(__spreadValues({}, data), {
2138
+ [subName]: val
2139
+ })),
2140
+ ui
2141
+ );
2142
+ }
2143
+ }
2144
+ )
2145
+ },
2146
+ subPath
2147
+ );
2148
+ }) }) })
2148
2149
  ]
2149
2150
  }
2150
2151
  )
@@ -2246,7 +2247,7 @@ init_react_import();
2246
2247
  import {
2247
2248
  useMemo as useMemo2,
2248
2249
  useEffect as useEffect7,
2249
- useState as useState10,
2250
+ useState as useState9,
2250
2251
  useCallback as useCallback4,
2251
2252
  isValidElement
2252
2253
  } from "react";
@@ -2257,7 +2258,7 @@ var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_
2257
2258
 
2258
2259
  // components/Modal/index.tsx
2259
2260
  init_react_import();
2260
- import { useEffect as useEffect5, useState as useState8 } from "react";
2261
+ import { useEffect as useEffect5, useState as useState7 } from "react";
2261
2262
 
2262
2263
  // css-module:/home/runner/work/puck/puck/packages/core/components/Modal/styles.module.css#css-module
2263
2264
  init_react_import();
@@ -2272,7 +2273,7 @@ var Modal = ({
2272
2273
  onClose,
2273
2274
  isOpen
2274
2275
  }) => {
2275
- const [rootEl, setRootEl] = useState8(null);
2276
+ const [rootEl, setRootEl] = useState7(null);
2276
2277
  useEffect5(() => {
2277
2278
  setRootEl(document.getElementById("puck-portal-root"));
2278
2279
  }, []);
@@ -2320,7 +2321,7 @@ init_react_import();
2320
2321
 
2321
2322
  // components/Button/Button.tsx
2322
2323
  init_react_import();
2323
- import { useEffect as useEffect6, useState as useState9 } from "react";
2324
+ import { useEffect as useEffect6, useState as useState8 } from "react";
2324
2325
 
2325
2326
  // css-module:/home/runner/work/puck/puck/packages/core/components/Button/Button.module.css#css-module
2326
2327
  init_react_import();
@@ -2370,7 +2371,7 @@ var Button = (_a) => {
2370
2371
  "size",
2371
2372
  "loading"
2372
2373
  ]);
2373
- const [loading, setLoading] = useState9(loadingProp);
2374
+ const [loading, setLoading] = useState8(loadingProp);
2374
2375
  useEffect6(() => setLoading(loadingProp), [loadingProp]);
2375
2376
  const ElementType = href ? "a" : type ? "button" : "span";
2376
2377
  const dataAttrs = filterDataAttrs(props);
@@ -2426,12 +2427,12 @@ var ExternalInput = ({
2426
2427
  mapRow = (val) => val,
2427
2428
  filterFields
2428
2429
  } = field || {};
2429
- const [data, setData] = useState10([]);
2430
- const [isOpen, setOpen] = useState10(false);
2431
- const [isLoading, setIsLoading] = useState10(true);
2430
+ const [data, setData] = useState9([]);
2431
+ const [isOpen, setOpen] = useState9(false);
2432
+ const [isLoading, setIsLoading] = useState9(true);
2432
2433
  const hasFilterFields = !!filterFields;
2433
- const [filters, setFilters] = useState10(field.initialFilters || {});
2434
- const [filtersToggled, setFiltersToggled] = useState10(hasFilterFields);
2434
+ const [filters, setFilters] = useState9(field.initialFilters || {});
2435
+ const [filtersToggled, setFiltersToggled] = useState9(hasFilterFields);
2435
2436
  const mappedData = useMemo2(() => {
2436
2437
  return data.map(mapRow);
2437
2438
  }, [data]);
@@ -2446,7 +2447,7 @@ var ExternalInput = ({
2446
2447
  }
2447
2448
  return Array.from(validKeys);
2448
2449
  }, [mappedData]);
2449
- const [searchQuery, setSearchQuery] = useState10(field.initialQuery || "");
2450
+ const [searchQuery, setSearchQuery] = useState9(field.initialQuery || "");
2450
2451
  const search = useCallback4(
2451
2452
  (query, filters2) => __async(void 0, null, function* () {
2452
2453
  setIsLoading(true);
@@ -2915,7 +2916,7 @@ var ObjectField = ({
2915
2916
 
2916
2917
  // lib/use-safe-id.ts
2917
2918
  init_react_import();
2918
- import React2, { useState as useState11 } from "react";
2919
+ import React2, { useState as useState10 } from "react";
2919
2920
 
2920
2921
  // lib/generate-id.ts
2921
2922
  init_react_import();
@@ -2927,7 +2928,7 @@ var useSafeId = () => {
2927
2928
  if (typeof React2.useId !== "undefined") {
2928
2929
  return React2.useId();
2929
2930
  }
2930
- const [id] = useState11(generateId());
2931
+ const [id] = useState10(generateId());
2931
2932
  return id;
2932
2933
  };
2933
2934
 
@@ -3073,7 +3074,7 @@ function AutoFieldInternal(props) {
3073
3074
  function AutoFieldPrivate(props) {
3074
3075
  const { state } = useAppContext();
3075
3076
  const { value, onChange } = props;
3076
- const [localValue, setLocalValue] = useState12(value);
3077
+ const [localValue, setLocalValue] = useState11(value);
3077
3078
  const onChangeDb = useDebouncedCallback(
3078
3079
  (val, ui) => {
3079
3080
  onChange(val, ui);
@@ -3081,10 +3082,13 @@ function AutoFieldPrivate(props) {
3081
3082
  50,
3082
3083
  { leading: true }
3083
3084
  );
3084
- const onChangeLocal = useCallback5((val, ui) => {
3085
- setLocalValue(val);
3086
- onChangeDb(val, ui);
3087
- }, []);
3085
+ const onChangeLocal = useCallback5(
3086
+ (val, ui) => {
3087
+ setLocalValue(val);
3088
+ onChangeDb(val, ui);
3089
+ },
3090
+ [onChange]
3091
+ );
3088
3092
  useEffect9(() => {
3089
3093
  if (state.ui.field.focus !== props.name) {
3090
3094
  setLocalValue(value);
@@ -3117,7 +3121,7 @@ init_react_import();
3117
3121
  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" };
3118
3122
 
3119
3123
  // components/Drawer/index.tsx
3120
- import { useId as useId2, useMemo as useMemo9, useState as useState19 } from "react";
3124
+ import { useMemo as useMemo9, useState as useState18 } from "react";
3121
3125
 
3122
3126
  // components/DragDropContext/index.tsx
3123
3127
  init_react_import();
@@ -3127,9 +3131,8 @@ import {
3127
3131
  useCallback as useCallback11,
3128
3132
  useContext as useContext7,
3129
3133
  useEffect as useEffect15,
3130
- useId,
3131
- useRef as useRef3,
3132
- useState as useState18
3134
+ useRef as useRef4,
3135
+ useState as useState17
3133
3136
  } from "react";
3134
3137
  import { AutoScroller, defaultPreset } from "@dnd-kit/dom";
3135
3138
 
@@ -3141,7 +3144,7 @@ import {
3141
3144
  useContext as useContext6,
3142
3145
  useEffect as useEffect14,
3143
3146
  useMemo as useMemo8,
3144
- useRef as useRef2
3147
+ useRef as useRef3
3145
3148
  } from "react";
3146
3149
 
3147
3150
  // components/DraggableComponent/index.tsx
@@ -3151,8 +3154,8 @@ import {
3151
3154
  useContext as useContext5,
3152
3155
  useEffect as useEffect10,
3153
3156
  useMemo as useMemo7,
3154
- useRef,
3155
- useState as useState14
3157
+ useRef as useRef2,
3158
+ useState as useState13
3156
3159
  } from "react";
3157
3160
 
3158
3161
  // css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css#css-module
@@ -3187,7 +3190,7 @@ import {
3187
3190
  createContext as createContext3,
3188
3191
  useCallback as useCallback6,
3189
3192
  useMemo as useMemo6,
3190
- useState as useState13
3193
+ useState as useState12
3191
3194
  } from "react";
3192
3195
  import { createStore as createStore2 } from "zustand";
3193
3196
  import { Fragment as Fragment5, jsx as jsx20 } from "react/jsx-runtime";
@@ -3212,11 +3215,11 @@ var DropZoneProvider = ({
3212
3215
  children,
3213
3216
  value
3214
3217
  }) => {
3215
- const [hoveringComponent, setHoveringComponent] = useState13();
3216
- const [areasWithZones, setAreasWithZones] = useState13(
3218
+ const [hoveringComponent, setHoveringComponent] = useState12();
3219
+ const [areasWithZones, setAreasWithZones] = useState12(
3217
3220
  {}
3218
3221
  );
3219
- const [activeZones, setActiveZones] = useState13({});
3222
+ const [activeZones, setActiveZones] = useState12({});
3220
3223
  const { dispatch } = useAppContext();
3221
3224
  const registerZoneArea = useCallback6(
3222
3225
  (area) => {
@@ -3333,7 +3336,7 @@ var DraggableComponent = ({
3333
3336
  state
3334
3337
  } = useAppContext();
3335
3338
  const ctx = useContext5(dropZoneContext);
3336
- const [localZones, setLocalZones] = useState14({});
3339
+ const [localZones, setLocalZones] = useState13({});
3337
3340
  const registerLocalZone = useCallback7(
3338
3341
  (zoneCompound2, active) => {
3339
3342
  var _a;
@@ -3358,7 +3361,7 @@ var DraggableComponent = ({
3358
3361
  );
3359
3362
  const containsActiveZone = Object.values(localZones).filter(Boolean).length > 0;
3360
3363
  const { path = [] } = ctx || {};
3361
- const [canDrag, setCanDrag] = useState14(false);
3364
+ const [canDrag, setCanDrag] = useState13(false);
3362
3365
  useEffect10(() => {
3363
3366
  var _a;
3364
3367
  const item = getItem({ index, zone: zoneCompound }, state.data);
@@ -3375,7 +3378,7 @@ var DraggableComponent = ({
3375
3378
  );
3376
3379
  const canCollide = canDrag || userIsDragging;
3377
3380
  const disabled = !isEnabled || !canCollide;
3378
- const [dragAxis, setDragAxis] = useState14(userDragAxis || autoDragAxis);
3381
+ const [dragAxis, setDragAxis] = useState13(userDragAxis || autoDragAxis);
3379
3382
  const { ref: sortableRef, status } = useSortableSafe({
3380
3383
  id,
3381
3384
  index,
@@ -3401,7 +3404,7 @@ var DraggableComponent = ({
3401
3404
  }
3402
3405
  });
3403
3406
  const thisIsDragging = status === "dragging";
3404
- const ref = useRef(null);
3407
+ const ref = useRef2(null);
3405
3408
  const refSetter = useCallback7(
3406
3409
  (el) => {
3407
3410
  sortableRef(el);
@@ -3411,7 +3414,7 @@ var DraggableComponent = ({
3411
3414
  },
3412
3415
  [sortableRef]
3413
3416
  );
3414
- const [portalEl, setPortalEl] = useState14();
3417
+ const [portalEl, setPortalEl] = useState13();
3415
3418
  useEffect10(() => {
3416
3419
  var _a, _b, _c;
3417
3420
  setPortalEl(
@@ -3438,7 +3441,7 @@ var DraggableComponent = ({
3438
3441
  };
3439
3442
  return style2;
3440
3443
  }, [ref.current]);
3441
- const [style, setStyle] = useState14();
3444
+ const [style, setStyle] = useState13();
3442
3445
  const sync = useCallback7(() => {
3443
3446
  setStyle(getStyle());
3444
3447
  }, [ref.current, iframe]);
@@ -3516,7 +3519,7 @@ var DraggableComponent = ({
3516
3519
  zone: zoneCompound
3517
3520
  });
3518
3521
  }, [index, zoneCompound]);
3519
- const [hover, setHover] = useState14(false);
3522
+ const [hover, setHover] = useState13(false);
3520
3523
  const indicativeHover = (ctx == null ? void 0 : ctx.hoveringComponent) === id;
3521
3524
  useEffect10(() => {
3522
3525
  if (!ref.current) {
@@ -3577,7 +3580,7 @@ var DraggableComponent = ({
3577
3580
  };
3578
3581
  }
3579
3582
  }, [disabled, ref]);
3580
- const [isVisible, setIsVisible] = useState14(false);
3583
+ const [isVisible, setIsVisible] = useState13(false);
3581
3584
  useEffect10(() => {
3582
3585
  sync();
3583
3586
  if ((isSelected || hover || indicativeHover) && !userIsDragging) {
@@ -3594,10 +3597,18 @@ var DraggableComponent = ({
3594
3597
  const rect = el.getBoundingClientRect();
3595
3598
  const diffLeft = rect.x;
3596
3599
  const exceedsBoundsLeft = diffLeft < 0;
3600
+ const diffTop = rect.y;
3601
+ const exceedsBoundsTop = diffTop < 0;
3597
3602
  if (exceedsBoundsLeft) {
3598
3603
  el.style.transformOrigin = "left top";
3599
3604
  el.style.left = "0px";
3600
3605
  }
3606
+ if (exceedsBoundsTop) {
3607
+ el.style.top = "12px";
3608
+ if (!exceedsBoundsLeft) {
3609
+ el.style.transformOrigin = "right top";
3610
+ }
3611
+ }
3601
3612
  }
3602
3613
  }
3603
3614
  },
@@ -3697,14 +3708,14 @@ var styles_module_default12 = { "DropZone": "_DropZone_kmkdc_1", "DropZone--isAc
3697
3708
 
3698
3709
  // components/DropZone/lib/use-min-empty-height.ts
3699
3710
  init_react_import();
3700
- import { useEffect as useEffect11, useState as useState15 } from "react";
3711
+ import { useEffect as useEffect11, useState as useState14 } from "react";
3701
3712
  var useMinEmptyHeight = ({
3702
3713
  zoneCompound,
3703
3714
  userMinEmptyHeight,
3704
3715
  ref
3705
3716
  }) => {
3706
- const [prevHeight, setPrevHeight] = useState15(0);
3707
- const [isAnimating, setIsAnimating] = useState15(false);
3717
+ const [prevHeight, setPrevHeight] = useState14(0);
3718
+ const [isAnimating, setIsAnimating] = useState14(false);
3708
3719
  const { draggedItem, isZone } = useContextStore(ZoneStoreContext, (s) => {
3709
3720
  var _a, _b;
3710
3721
  return {
@@ -3746,7 +3757,7 @@ function assignRefs(refs, node) {
3746
3757
 
3747
3758
  // components/DropZone/lib/use-content-with-preview.ts
3748
3759
  init_react_import();
3749
- import { useEffect as useEffect12, useState as useState16 } from "react";
3760
+ import { useEffect as useEffect12, useState as useState15 } from "react";
3750
3761
 
3751
3762
  // lib/dnd/use-rendered-callback.ts
3752
3763
  init_react_import();
@@ -3789,8 +3800,8 @@ var useContentWithPreview = (content, zoneCompound) => {
3789
3800
  ui: { isDragging }
3790
3801
  }
3791
3802
  } = useAppContext();
3792
- const [contentWithPreview, setContentWithPreview] = useState16(content);
3793
- const [localPreview, setLocalPreview] = useState16(
3803
+ const [contentWithPreview, setContentWithPreview] = useState15(content);
3804
+ const [localPreview, setLocalPreview] = useState15(
3794
3805
  preview
3795
3806
  );
3796
3807
  const updateContent = useRenderedCallback(
@@ -3839,13 +3850,13 @@ var useContentWithPreview = (content, zoneCompound) => {
3839
3850
 
3840
3851
  // components/DropZone/lib/use-drag-axis.ts
3841
3852
  init_react_import();
3842
- import { useCallback as useCallback9, useEffect as useEffect13, useState as useState17 } from "react";
3853
+ import { useCallback as useCallback9, useEffect as useEffect13, useState as useState16 } from "react";
3843
3854
  var GRID_DRAG_AXIS = "dynamic";
3844
3855
  var FLEX_ROW_DRAG_AXIS = "x";
3845
3856
  var DEFAULT_DRAG_AXIS = "y";
3846
3857
  var useDragAxis = (ref, collisionAxis) => {
3847
3858
  const { status } = useAppContext();
3848
- const [dragAxis, setDragAxis] = useState17(
3859
+ const [dragAxis, setDragAxis] = useState16(
3849
3860
  collisionAxis || DEFAULT_DRAG_AXIS
3850
3861
  );
3851
3862
  const calculateDragAxis = useCallback9(() => {
@@ -3947,7 +3958,7 @@ var DropZoneEdit = forwardRef3(
3947
3958
  }
3948
3959
  return data.content || [];
3949
3960
  }, [data, zoneCompound]);
3950
- const ref = useRef2(null);
3961
+ const ref = useRef3(null);
3951
3962
  const acceptsTarget = useCallback10(
3952
3963
  (componentType) => {
3953
3964
  if (!componentType) {
@@ -4870,7 +4881,7 @@ function useDragListener(type, fn, deps = []) {
4870
4881
  }
4871
4882
  var AREA_CHANGE_DEBOUNCE_MS = 100;
4872
4883
  var useTempDisableFallback = (timeout3) => {
4873
- const lastFallbackDisable = useRef3(null);
4884
+ const lastFallbackDisable = useRef4(null);
4874
4885
  return useCallback11((manager) => {
4875
4886
  collisionStore.setState({ fallbackEnabled: false });
4876
4887
  const fallbackId = generateId();
@@ -4888,11 +4899,11 @@ var DragDropContextClient = ({
4888
4899
  disableAutoScroll
4889
4900
  }) => {
4890
4901
  const { state, config, dispatch, resolveData } = useAppContext();
4891
- const id = useId();
4902
+ const id = useSafeId();
4892
4903
  const { data } = state;
4893
- const debouncedParamsRef = useRef3(null);
4904
+ const debouncedParamsRef = useRef4(null);
4894
4905
  const tempDisableFallback = useTempDisableFallback(100);
4895
- const [zoneStore] = useState18(
4906
+ const [zoneStore] = useState17(
4896
4907
  () => createStore3(() => ({
4897
4908
  zoneDepthIndex: {},
4898
4909
  nextZoneDepthIndex: {},
@@ -4961,7 +4972,7 @@ var DragDropContextClient = ({
4961
4972
  );
4962
4973
  }
4963
4974
  }, []);
4964
- const [plugins] = useState18(() => [
4975
+ const [plugins] = useState17(() => [
4965
4976
  ...disableAutoScroll ? defaultPreset.plugins.filter((plugin) => plugin !== AutoScroller) : defaultPreset.plugins,
4966
4977
  createNestedDroppablePlugin(
4967
4978
  {
@@ -5009,9 +5020,9 @@ var DragDropContextClient = ({
5009
5020
  )
5010
5021
  ]);
5011
5022
  const sensors = useSensors();
5012
- const [dragListeners, setDragListeners] = useState18({});
5013
- const [pathData, setPathData] = useState18();
5014
- const dragMode = useRef3(null);
5023
+ const [dragListeners, setDragListeners] = useState17({});
5024
+ const [pathData, setPathData] = useState17();
5025
+ const dragMode = useRef4(null);
5015
5026
  const registerPath = useCallback11(
5016
5027
  (id2, selector, label) => {
5017
5028
  const [area] = getZoneId(selector.zone);
@@ -5040,7 +5051,7 @@ var DragDropContextClient = ({
5040
5051
  },
5041
5052
  [data, setPathData]
5042
5053
  );
5043
- const initialSelector = useRef3(void 0);
5054
+ const initialSelector = useRef4(void 0);
5044
5055
  return /* @__PURE__ */ jsx23("div", { id, children: /* @__PURE__ */ jsx23(
5045
5056
  dragListenerContext.Provider,
5046
5057
  {
@@ -5332,7 +5343,7 @@ var DrawerItem = ({
5332
5343
  isDragDisabled
5333
5344
  }) => {
5334
5345
  const resolvedId = id || name;
5335
- const [dynamicId, setDynamicId] = useState19(generateId(resolvedId));
5346
+ const [dynamicId, setDynamicId] = useState18(generateId(resolvedId));
5336
5347
  if (typeof index !== "undefined") {
5337
5348
  console.error(
5338
5349
  "Warning: The `index` prop on Drawer.Item is deprecated and no longer required."
@@ -5371,7 +5382,7 @@ var Drawer = ({
5371
5382
  "Warning: The `direction` prop on Drawer is deprecated and no longer required to achieve multi-directional dragging."
5372
5383
  );
5373
5384
  }
5374
- const id = useId2();
5385
+ const id = useSafeId();
5375
5386
  const { ref } = useDroppableSafe({
5376
5387
  id,
5377
5388
  type: "void",
@@ -5398,7 +5409,7 @@ import {
5398
5409
  useEffect as useEffect24,
5399
5410
  useMemo as useMemo19,
5400
5411
  useReducer,
5401
- useState as useState27
5412
+ useState as useState26
5402
5413
  } from "react";
5403
5414
 
5404
5415
  // components/SidebarSection/index.tsx
@@ -5599,7 +5610,7 @@ import { useMemo as useMemo12 } from "react";
5599
5610
 
5600
5611
  // lib/use-resolved-fields.ts
5601
5612
  init_react_import();
5602
- import { useCallback as useCallback13, useEffect as useEffect17, useMemo as useMemo11, useRef as useRef5, useState as useState20 } from "react";
5613
+ import { useCallback as useCallback13, useEffect as useEffect17, useMemo as useMemo11, useRef as useRef6, useState as useState19 } from "react";
5603
5614
 
5604
5615
  // lib/use-parent.ts
5605
5616
  init_react_import();
@@ -5627,9 +5638,9 @@ var useParent = () => {
5627
5638
 
5628
5639
  // lib/use-on-value-change.ts
5629
5640
  init_react_import();
5630
- import { useRef as useRef4, useEffect as useEffect16 } from "react";
5641
+ import { useRef as useRef5, useEffect as useEffect16 } from "react";
5631
5642
  function useOnValueChange(value, onChange, compare = Object.is, deps = []) {
5632
- const tracked = useRef4(value);
5643
+ const tracked = useRef5(value);
5633
5644
  useEffect16(() => {
5634
5645
  const oldValue = tracked.current;
5635
5646
  if (!compare(value, oldValue)) {
@@ -5662,13 +5673,13 @@ var useResolvedFields = ({
5662
5673
  [selectedItem, rootFields, componentConfig == null ? void 0 : componentConfig.fields]
5663
5674
  );
5664
5675
  const rootProps = data.root.props || data.root;
5665
- const [lastSelectedData, setLastSelectedData] = useState20({});
5666
- const [resolvedFields, setResolvedFields] = useState20({
5676
+ const [lastSelectedData, setLastSelectedData] = useState19({});
5677
+ const [resolvedFields, setResolvedFields] = useState19({
5667
5678
  fields: defaultFields,
5668
5679
  id: selectedItem == null ? void 0 : selectedItem.props.id
5669
5680
  });
5670
- const [fieldsLoading, setFieldsLoading] = useState20(false);
5671
- const lastFields = useRef5(defaultFields);
5681
+ const [fieldsLoading, setFieldsLoading] = useState19(false);
5682
+ const lastFields = useRef6(defaultFields);
5672
5683
  const defaultResolveFields = (_componentData, _params) => defaultFields;
5673
5684
  const componentData = useMemo11(
5674
5685
  () => selectedItem ? selectedItem : { props: rootProps, readOnly: data.root.readOnly || {} },
@@ -5911,7 +5922,7 @@ init_react_import();
5911
5922
 
5912
5923
  // lib/use-component-list.tsx
5913
5924
  init_react_import();
5914
- import { useEffect as useEffect18, useState as useState21 } from "react";
5925
+ import { useEffect as useEffect18, useState as useState20 } from "react";
5915
5926
 
5916
5927
  // components/ComponentList/index.tsx
5917
5928
  init_react_import();
@@ -5978,7 +5989,7 @@ ComponentList.Item = ComponentListItem;
5978
5989
  // lib/use-component-list.tsx
5979
5990
  import { jsx as jsx29 } from "react/jsx-runtime";
5980
5991
  var useComponentList = (config, ui) => {
5981
- const [componentList, setComponentList] = useState21();
5992
+ const [componentList, setComponentList] = useState20();
5982
5993
  useEffect18(() => {
5983
5994
  var _a, _b, _c;
5984
5995
  if (Object.keys(ui.componentList).length > 0) {
@@ -6059,7 +6070,7 @@ var Components = () => {
6059
6070
 
6060
6071
  // components/Puck/components/Preview/index.tsx
6061
6072
  init_react_import();
6062
- import { useCallback as useCallback14, useEffect as useEffect20, useRef as useRef7, useMemo as useMemo14 } from "react";
6073
+ import { useCallback as useCallback14, useEffect as useEffect20, useRef as useRef8, useMemo as useMemo14 } from "react";
6063
6074
 
6064
6075
  // components/AutoFrame/index.tsx
6065
6076
  init_react_import();
@@ -6067,7 +6078,7 @@ import {
6067
6078
  createContext as createContext5,
6068
6079
  useContext as useContext10,
6069
6080
  useEffect as useEffect19,
6070
- useState as useState22
6081
+ useState as useState21
6071
6082
  } from "react";
6072
6083
  import hash from "object-hash";
6073
6084
  import { createPortal as createPortal3 } from "react-dom";
@@ -6291,9 +6302,9 @@ function AutoFrame(_a) {
6291
6302
  "onStylesLoaded",
6292
6303
  "frameRef"
6293
6304
  ]);
6294
- const [loaded, setLoaded] = useState22(false);
6295
- const [ctx, setCtx] = useState22({});
6296
- const [mountTarget, setMountTarget] = useState22();
6305
+ const [loaded, setLoaded] = useState21(false);
6306
+ const [ctx, setCtx] = useState21({});
6307
+ const [mountTarget, setMountTarget] = useState21();
6297
6308
  useEffect19(() => {
6298
6309
  var _a2;
6299
6310
  if (frameRef.current) {
@@ -6433,7 +6444,7 @@ var Preview2 = ({ id = "puck-preview" }) => {
6433
6444
  );
6434
6445
  const Frame = useMemo14(() => overrides.iframe, [overrides]);
6435
6446
  const rootProps = state.data.root.props || state.data.root;
6436
- const ref = useRef7(null);
6447
+ const ref = useRef8(null);
6437
6448
  useBubbleIframeEvents(ref);
6438
6449
  const inner = state.ui.previewMode === "edit" ? /* @__PURE__ */ jsx33(
6439
6450
  Page,
@@ -6812,19 +6823,19 @@ function usePuckHistory({
6812
6823
 
6813
6824
  // lib/use-history-store.ts
6814
6825
  init_react_import();
6815
- import { useState as useState23 } from "react";
6826
+ import { useState as useState22 } from "react";
6816
6827
  import { useDebouncedCallback as useDebouncedCallback3 } from "use-debounce";
6817
6828
  var EMPTY_HISTORY_INDEX = 0;
6818
6829
  function useHistoryStore(initialHistory) {
6819
6830
  var _a, _b;
6820
- const [histories, setHistories] = useState23(
6831
+ const [histories, setHistories] = useState22(
6821
6832
  (_a = initialHistory == null ? void 0 : initialHistory.histories) != null ? _a : []
6822
6833
  );
6823
6834
  const updateHistories = (histories2) => {
6824
6835
  setHistories(histories2);
6825
6836
  setIndex(histories2.length - 1);
6826
6837
  };
6827
- const [index, setIndex] = useState23(
6838
+ const [index, setIndex] = useState22(
6828
6839
  (_b = initialHistory == null ? void 0 : initialHistory.index) != null ? _b : EMPTY_HISTORY_INDEX
6829
6840
  );
6830
6841
  const hasPast = index > EMPTY_HISTORY_INDEX;
@@ -6988,13 +6999,13 @@ import {
6988
6999
  useCallback as useCallback16,
6989
7000
  useEffect as useEffect22,
6990
7001
  useMemo as useMemo17,
6991
- useRef as useRef8,
6992
- useState as useState25
7002
+ useRef as useRef9,
7003
+ useState as useState24
6993
7004
  } from "react";
6994
7005
 
6995
7006
  // components/ViewportControls/index.tsx
6996
7007
  init_react_import();
6997
- import { useEffect as useEffect21, useMemo as useMemo16, useState as useState24 } from "react";
7008
+ import { useEffect as useEffect21, useMemo as useMemo16, useState as useState23 } from "react";
6998
7009
 
6999
7010
  // css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
7000
7011
  init_react_import();
@@ -7017,7 +7028,7 @@ var ViewportButton = ({
7017
7028
  onClick
7018
7029
  }) => {
7019
7030
  const { state } = useAppContext();
7020
- const [isActive, setIsActive] = useState24(false);
7031
+ const [isActive, setIsActive] = useState23(false);
7021
7032
  useEffect21(() => {
7022
7033
  setIsActive(width === state.ui.viewports.current.width);
7023
7034
  }, [width, state.ui.viewports.current.width]);
@@ -7177,8 +7188,8 @@ var Canvas = () => {
7177
7188
  const { status, iframe } = useAppContext();
7178
7189
  const { dispatch, state, overrides, setUi, zoomConfig, setZoomConfig } = useAppContext();
7179
7190
  const { ui } = state;
7180
- const frameRef = useRef8(null);
7181
- const [showTransition, setShowTransition] = useState25(false);
7191
+ const frameRef = useRef9(null);
7192
+ const [showTransition, setShowTransition] = useState24(false);
7182
7193
  const defaultRender = useMemo17(() => {
7183
7194
  const PuckDefault = ({ children }) => /* @__PURE__ */ jsx37(Fragment13, { children });
7184
7195
  return PuckDefault;
@@ -7233,7 +7244,7 @@ var Canvas = () => {
7233
7244
  window.removeEventListener("resize", cb);
7234
7245
  };
7235
7246
  }, []);
7236
- const [showLoader, setShowLoader] = useState25(false);
7247
+ const [showLoader, setShowLoader] = useState24(false);
7237
7248
  useEffect22(() => {
7238
7249
  setTimeout(() => {
7239
7250
  setShowLoader(true);
@@ -7363,10 +7374,10 @@ var DefaultOverride = ({ children }) => /* @__PURE__ */ jsx38(Fragment14, { chil
7363
7374
 
7364
7375
  // lib/use-inject-css.ts
7365
7376
  init_react_import();
7366
- import { useEffect as useEffect23, useState as useState26 } from "react";
7377
+ import { useEffect as useEffect23, useState as useState25 } from "react";
7367
7378
  var styles = ``;
7368
7379
  var useInjectStyleSheet = (initialStyles, iframeEnabled) => {
7369
- const [el, setEl] = useState26();
7380
+ const [el, setEl] = useState25();
7370
7381
  useEffect23(() => {
7371
7382
  setEl(document.createElement("style"));
7372
7383
  }, []);
@@ -7450,7 +7461,7 @@ function Puck({
7450
7461
  waitForStyles: true
7451
7462
  }, _iframe);
7452
7463
  useInjectGlobalCss(iframe.enabled);
7453
- const [generatedAppState] = useState27(() => {
7464
+ const [generatedAppState] = useState26(() => {
7454
7465
  var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
7455
7466
  const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
7456
7467
  let clientUiState = {};
@@ -7522,7 +7533,7 @@ function Puck({
7522
7533
  histories,
7523
7534
  index: initialHistoryIndex
7524
7535
  });
7525
- const [reducer] = useState27(
7536
+ const [reducer] = useState26(
7526
7537
  () => createReducer({
7527
7538
  config,
7528
7539
  record: historyStore.record,
@@ -7540,7 +7551,7 @@ function Puck({
7540
7551
  historyStore,
7541
7552
  iframeEnabled: (_a = _iframe == null ? void 0 : _iframe.enabled) != null ? _a : true
7542
7553
  });
7543
- const [menuOpen, setMenuOpen] = useState27(false);
7554
+ const [menuOpen, setMenuOpen] = useState26(false);
7544
7555
  const { itemSelector, leftSideBarVisible, rightSideBarVisible } = ui;
7545
7556
  const selectedItem = itemSelector ? getItem(itemSelector, data) : null;
7546
7557
  useEffect24(() => {
@@ -7627,7 +7638,7 @@ function Puck({
7627
7638
  () => loadedOverrides.headerActions || defaultHeaderActionsRender,
7628
7639
  [loadedOverrides]
7629
7640
  );
7630
- const [mounted, setMounted] = useState27(false);
7641
+ const [mounted, setMounted] = useState26(false);
7631
7642
  useEffect24(() => {
7632
7643
  setMounted(true);
7633
7644
  }, []);
@@ -7814,40 +7825,6 @@ function migrate(data) {
7814
7825
  return migrations == null ? void 0 : migrations.reduce((acc, migration) => migration(acc), data);
7815
7826
  }
7816
7827
 
7817
- // lib/transform-props.ts
7818
- init_react_import();
7819
- function transformProps(data, propTransforms) {
7820
- const mapItem = (item) => {
7821
- if (propTransforms[item.type]) {
7822
- return __spreadProps(__spreadValues({}, item), {
7823
- props: propTransforms[item.type](item.props)
7824
- });
7825
- }
7826
- return item;
7827
- };
7828
- const defaultedData = defaultData(data);
7829
- const rootProps = defaultedData.root.props || defaultedData.root;
7830
- let newRoot = __spreadValues({}, defaultedData.root);
7831
- if (propTransforms["root"]) {
7832
- if (defaultedData.root.props) {
7833
- newRoot.props = propTransforms["root"](rootProps);
7834
- } else {
7835
- newRoot = propTransforms["root"](rootProps);
7836
- }
7837
- }
7838
- const afterPropTransforms = __spreadProps(__spreadValues({}, defaultedData), {
7839
- root: newRoot,
7840
- content: defaultedData.content.map(mapItem),
7841
- zones: Object.keys(data.zones || {}).reduce(
7842
- (acc, zoneKey) => __spreadProps(__spreadValues({}, acc), {
7843
- [zoneKey]: data.zones[zoneKey].map(mapItem)
7844
- }),
7845
- {}
7846
- )
7847
- });
7848
- return afterPropTransforms;
7849
- }
7850
-
7851
7828
  // lib/use-puck.ts
7852
7829
  init_react_import();
7853
7830
  var usePuck = () => {