@measured/puck 0.20.3-canary.d855fa8c → 0.21.0-canary.15fe8d60

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.
@@ -153,6 +153,42 @@ var require_classnames = __commonJS({
153
153
  }
154
154
  });
155
155
 
156
+ // ../../node_modules/fast-deep-equal/index.js
157
+ var require_fast_deep_equal = __commonJS({
158
+ "../../node_modules/fast-deep-equal/index.js"(exports2, module2) {
159
+ "use strict";
160
+ init_react_import();
161
+ module2.exports = function equal(a, b) {
162
+ if (a === b) return true;
163
+ if (a && b && typeof a == "object" && typeof b == "object") {
164
+ if (a.constructor !== b.constructor) return false;
165
+ var length, i, keys;
166
+ if (Array.isArray(a)) {
167
+ length = a.length;
168
+ if (length != b.length) return false;
169
+ for (i = length; i-- !== 0; )
170
+ if (!equal(a[i], b[i])) return false;
171
+ return true;
172
+ }
173
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
174
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
175
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
176
+ keys = Object.keys(a);
177
+ length = keys.length;
178
+ if (length !== Object.keys(b).length) return false;
179
+ for (i = length; i-- !== 0; )
180
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
181
+ for (i = length; i-- !== 0; ) {
182
+ var key = keys[i];
183
+ if (!equal(a[key], b[key])) return false;
184
+ }
185
+ return true;
186
+ }
187
+ return a !== a && b !== b;
188
+ };
189
+ }
190
+ });
191
+
156
192
  // bundle/no-external.ts
157
193
  var no_external_exports = {};
158
194
  __export(no_external_exports, {
@@ -1661,7 +1697,9 @@ var keyCodeMap = {
1661
1697
  KeyW: "w",
1662
1698
  KeyX: "x",
1663
1699
  KeyY: "y",
1664
- KeyZ: "z"
1700
+ KeyZ: "z",
1701
+ Delete: "delete",
1702
+ Backspace: "backspace"
1665
1703
  };
1666
1704
  var useHotkeyStore = (0, import_zustand.create)()(
1667
1705
  (0, import_middleware.subscribeWithSelector)((set) => ({
@@ -1685,8 +1723,10 @@ var monitorHotkeys = (doc) => {
1685
1723
  ([key2, value]) => value === !!combo[key2]
1686
1724
  );
1687
1725
  if (conditionMet) {
1688
- e.preventDefault();
1689
- cb();
1726
+ const handled = cb(e);
1727
+ if (handled !== false) {
1728
+ e.preventDefault();
1729
+ }
1690
1730
  }
1691
1731
  });
1692
1732
  if (key !== "meta" && key !== "ctrl" && key !== "shift") {
@@ -1709,6 +1749,10 @@ var monitorHotkeys = (doc) => {
1709
1749
  useHotkeyStore.getState().reset();
1710
1750
  }
1711
1751
  };
1752
+ const onBlur = () => {
1753
+ useHotkeyStore.getState().reset();
1754
+ };
1755
+ window.addEventListener("blur", onBlur);
1712
1756
  doc.addEventListener("keydown", onKeyDown);
1713
1757
  doc.addEventListener("keyup", onKeyUp);
1714
1758
  doc.addEventListener("visibilitychange", onVisibilityChanged);
@@ -1716,6 +1760,7 @@ var monitorHotkeys = (doc) => {
1716
1760
  doc.removeEventListener("keydown", onKeyDown);
1717
1761
  doc.removeEventListener("keyup", onKeyUp);
1718
1762
  doc.removeEventListener("visibilitychange", onVisibilityChanged);
1763
+ window.removeEventListener("blur", onBlur);
1719
1764
  };
1720
1765
  };
1721
1766
  var useMonitorHotkeys = () => {
@@ -1910,7 +1955,7 @@ var flattenData = (state, config) => {
1910
1955
  (content) => content,
1911
1956
  (item) => {
1912
1957
  data.push(item);
1913
- return null;
1958
+ return item;
1914
1959
  }
1915
1960
  );
1916
1961
  return data;
@@ -1918,23 +1963,23 @@ var flattenData = (state, config) => {
1918
1963
 
1919
1964
  // lib/get-changed.ts
1920
1965
  init_react_import();
1921
- var import_fast_deep_equal = __toESM(require("fast-deep-equal"));
1966
+ var import_fast_equals = require("fast-equals");
1922
1967
  var getChanged = (newItem, oldItem) => {
1923
1968
  return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
1924
1969
  const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
1925
1970
  const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
1926
1971
  return __spreadProps(__spreadValues({}, acc), {
1927
- [item]: !(0, import_fast_deep_equal.default)(oldItemProps[item], newItemProps[item])
1972
+ [item]: !(0, import_fast_equals.deepEqual)(oldItemProps[item], newItemProps[item])
1928
1973
  });
1929
1974
  }, {}) : {};
1930
1975
  };
1931
1976
 
1932
1977
  // store/slices/permissions.ts
1933
1978
  var createPermissionsSlice = (set, get) => {
1934
- const resolvePermissions = (..._0) => __async(void 0, [..._0], function* (params = {}, force) {
1979
+ const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
1935
1980
  const { state, permissions, config } = get();
1936
1981
  const { cache: cache2, globalPermissions } = permissions;
1937
- const resolveDataForItem = (item2, force2 = false) => __async(void 0, null, function* () {
1982
+ const resolveDataForItem = (item2, force2 = false) => __async(null, null, function* () {
1938
1983
  var _a, _b, _c;
1939
1984
  const { config: config2, state: appState, setComponentLoading } = get();
1940
1985
  const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
@@ -1989,13 +2034,13 @@ var createPermissionsSlice = (set, get) => {
1989
2034
  if (item) {
1990
2035
  yield resolveDataForItem(item, force);
1991
2036
  } else if (type) {
1992
- flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(void 0, null, function* () {
2037
+ flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
1993
2038
  yield resolveDataForItem(item2, force);
1994
2039
  }));
1995
2040
  } else if (root) {
1996
2041
  resolveDataForRoot(force);
1997
2042
  } else {
1998
- flattenData(state, config).map((item2) => __async(void 0, null, function* () {
2043
+ flattenData(state, config).map((item2) => __async(null, null, function* () {
1999
2044
  yield resolveDataForItem(item2, force);
2000
2045
  }));
2001
2046
  }
@@ -2076,9 +2121,10 @@ var createFieldsSlice = (_set, _get) => {
2076
2121
  };
2077
2122
  var useRegisterFieldsSlice = (appStore, id) => {
2078
2123
  const resolveFields = (0, import_react7.useCallback)(
2079
- (reset) => __async(void 0, null, function* () {
2124
+ (reset) => __async(null, null, function* () {
2080
2125
  var _a, _b;
2081
2126
  const { fields, lastResolvedData } = appStore.getState().fields;
2127
+ const metadata = appStore.getState().metadata;
2082
2128
  const nodes = appStore.getState().state.indexes.nodes;
2083
2129
  const node = nodes[id || "root"];
2084
2130
  const componentData = node == null ? void 0 : node.data;
@@ -2108,6 +2154,7 @@ var useRegisterFieldsSlice = (appStore, id) => {
2108
2154
  changed,
2109
2155
  fields: defaultFields2,
2110
2156
  lastFields,
2157
+ metadata: __spreadValues(__spreadValues({}, metadata), componentConfig.metadata),
2111
2158
  lastData,
2112
2159
  appState: makeStatePublic(state),
2113
2160
  parent
@@ -2143,16 +2190,16 @@ var useRegisterFieldsSlice = (appStore, id) => {
2143
2190
 
2144
2191
  // lib/resolve-component-data.ts
2145
2192
  init_react_import();
2146
- var import_fast_deep_equal2 = __toESM(require("fast-deep-equal"));
2193
+ var import_fast_equals2 = require("fast-equals");
2147
2194
  var cache = { lastChange: {} };
2148
- var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
2195
+ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
2149
2196
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
2150
2197
  const resolvedItem = __spreadValues({}, item);
2151
2198
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
2152
2199
  const id = "id" in item.props ? item.props.id : "root";
2153
2200
  if (shouldRunResolver) {
2154
2201
  const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
2155
- if (trigger !== "force" && item && (0, import_fast_deep_equal2.default)(item, oldItem)) {
2202
+ if (trigger !== "force" && item && (0, import_fast_equals2.deepEqual)(item, oldItem)) {
2156
2203
  return { node: resolved, didChange: false };
2157
2204
  }
2158
2205
  const changed = getChanged(item, oldItem);
@@ -2173,11 +2220,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
2173
2220
  let itemWithResolvedChildren = yield mapFields(
2174
2221
  resolvedItem,
2175
2222
  {
2176
- slot: (_02) => __async(void 0, [_02], function* ({ value }) {
2223
+ slot: (_02) => __async(null, [_02], function* ({ value }) {
2177
2224
  const content = value;
2178
2225
  return yield Promise.all(
2179
2226
  content.map(
2180
- (childItem) => __async(void 0, null, function* () {
2227
+ (childItem) => __async(null, null, function* () {
2181
2228
  return (yield resolveComponentData(
2182
2229
  childItem,
2183
2230
  config,
@@ -2202,7 +2249,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
2202
2249
  };
2203
2250
  return {
2204
2251
  node: itemWithResolvedChildren,
2205
- didChange: !(0, import_fast_deep_equal2.default)(item, itemWithResolvedChildren)
2252
+ didChange: !(0, import_fast_equals2.deepEqual)(item, itemWithResolvedChildren)
2206
2253
  };
2207
2254
  });
2208
2255
 
@@ -2367,7 +2414,7 @@ var createAppStore = (initialAppStore) => (0, import_zustand2.create)()(
2367
2414
  const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
2368
2415
  return __spreadProps(__spreadValues({}, s), { state, selectedItem });
2369
2416
  }),
2370
- resolveComponentData: (componentData, trigger) => __async(void 0, null, function* () {
2417
+ resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
2371
2418
  const { config, metadata, setComponentLoading, permissions } = get();
2372
2419
  const timeouts = {};
2373
2420
  return yield resolveComponentData(
@@ -2378,7 +2425,7 @@ var createAppStore = (initialAppStore) => (0, import_zustand2.create)()(
2378
2425
  const id = "id" in item.props ? item.props.id : "root";
2379
2426
  timeouts[id] = setComponentLoading(id, true, 50);
2380
2427
  },
2381
- (item) => __async(void 0, null, function* () {
2428
+ (item) => __async(null, null, function* () {
2382
2429
  const id = "id" in item.props ? item.props.id : "root";
2383
2430
  if ("type" in item) {
2384
2431
  yield permissions.refreshPermissions({ item });
@@ -2390,7 +2437,7 @@ var createAppStore = (initialAppStore) => (0, import_zustand2.create)()(
2390
2437
  trigger
2391
2438
  );
2392
2439
  }),
2393
- resolveAndCommitData: () => __async(void 0, null, function* () {
2440
+ resolveAndCommitData: () => __async(null, null, function* () {
2394
2441
  const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
2395
2442
  walkAppState(
2396
2443
  state,
@@ -2962,7 +3009,7 @@ var collisionStore = (0, import_vanilla.createStore)(() => ({
2962
3009
 
2963
3010
  // lib/dnd/collision/dynamic/index.ts
2964
3011
  var flushNext = "";
2965
- var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input) => {
3012
+ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((input) => {
2966
3013
  var _a, _b, _c, _d, _e;
2967
3014
  const { dragOperation, droppable } = input;
2968
3015
  const { position } = dragOperation;
@@ -3055,7 +3102,7 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input
3055
3102
  }
3056
3103
  collisionDebug(dragCenter, dropCenter, droppable.id.toString(), "hotpink");
3057
3104
  return null;
3058
- };
3105
+ });
3059
3106
 
3060
3107
  // components/Sortable/index.tsx
3061
3108
  var import_sortable = require("@dnd-kit/react/sortable");
@@ -3488,8 +3535,9 @@ var ArrayField = ({
3488
3535
  var _a;
3489
3536
  if (isDraggingAny) return;
3490
3537
  const existingValue = value || [];
3538
+ const defaultProps = typeof field.defaultItemProps === "function" ? field.defaultItemProps(existingValue.length) : (_a = field.defaultItemProps) != null ? _a : {};
3491
3539
  const newItem = defaultSlots(
3492
- uniqifyItem((_a = field.defaultItemProps) != null ? _a : {}),
3540
+ uniqifyItem(defaultProps),
3493
3541
  field.arrayFields
3494
3542
  );
3495
3543
  const newValue = [...existingValue, newItem];
@@ -3748,11 +3796,13 @@ var ExternalInput = ({
3748
3796
  id,
3749
3797
  readOnly
3750
3798
  }) => {
3799
+ var _a;
3751
3800
  const {
3752
3801
  mapProp = (val) => val,
3753
3802
  mapRow = (val) => val,
3754
3803
  filterFields
3755
3804
  } = field || {};
3805
+ const { enabled: shouldCacheData } = (_a = field.cache) != null ? _a : { enabled: true };
3756
3806
  const [data, setData] = (0, import_react17.useState)([]);
3757
3807
  const [isOpen, setOpen] = (0, import_react17.useState)(false);
3758
3808
  const [isLoading, setIsLoading] = (0, import_react17.useState)(true);
@@ -3775,14 +3825,21 @@ var ExternalInput = ({
3775
3825
  }, [mappedData]);
3776
3826
  const [searchQuery, setSearchQuery] = (0, import_react17.useState)(field.initialQuery || "");
3777
3827
  const search = (0, import_react17.useCallback)(
3778
- (query, filters2) => __async(void 0, null, function* () {
3828
+ (query, filters2) => __async(null, null, function* () {
3779
3829
  setIsLoading(true);
3780
3830
  const cacheKey = `${id}-${query}-${JSON.stringify(filters2)}`;
3781
- const listData = dataCache[cacheKey] || (yield field.fetchList({ query, filters: filters2 }));
3831
+ let listData;
3832
+ if (shouldCacheData && dataCache[cacheKey]) {
3833
+ listData = dataCache[cacheKey];
3834
+ } else {
3835
+ listData = yield field.fetchList({ query, filters: filters2 });
3836
+ }
3782
3837
  if (listData) {
3783
3838
  setData(listData);
3784
3839
  setIsLoading(false);
3785
- dataCache[cacheKey] = listData;
3840
+ if (shouldCacheData) {
3841
+ dataCache[cacheKey] = listData;
3842
+ }
3786
3843
  }
3787
3844
  }),
3788
3845
  [id, field]
@@ -3846,6 +3903,7 @@ var ExternalInput = ({
3846
3903
  }),
3847
3904
  onSubmit: (e) => {
3848
3905
  e.preventDefault();
3906
+ e.stopPropagation();
3849
3907
  search(searchQuery, filters);
3850
3908
  },
3851
3909
  children: [
@@ -3993,7 +4051,7 @@ var ExternalField = ({
3993
4051
  placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || "Select data",
3994
4052
  mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
3995
4053
  mapRow: validField.mapRow,
3996
- fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(void 0, null, function* () {
4054
+ fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(null, null, function* () {
3997
4055
  return yield deprecatedField.adaptor.fetchList(
3998
4056
  deprecatedField.adaptorParams
3999
4057
  );
@@ -4749,12 +4807,14 @@ var DraggableComponent = ({
4749
4807
  }
4750
4808
  return cleanup;
4751
4809
  }, [permissions.drag, zoneCompound]);
4810
+ const [, setRerender] = (0, import_react24.useState)(0);
4752
4811
  const ref = (0, import_react24.useRef)(null);
4753
4812
  const refSetter = (0, import_react24.useCallback)(
4754
4813
  (el) => {
4755
4814
  sortableRef(el);
4756
- if (el) {
4815
+ if (ref.current !== el) {
4757
4816
  ref.current = el;
4817
+ setRerender((update) => update + 1);
4758
4818
  }
4759
4819
  },
4760
4820
  [sortableRef]
@@ -5201,7 +5261,7 @@ var import_react27 = require("react");
5201
5261
  function useRenderedCallback(callback, deps) {
5202
5262
  const manager = (0, import_react26.useDragDropManager)();
5203
5263
  return (0, import_react27.useCallback)(
5204
- (...args) => __async(this, null, function* () {
5264
+ (...args) => __async(null, null, function* () {
5205
5265
  yield manager == null ? void 0 : manager.renderer.rendering;
5206
5266
  return callback(...args);
5207
5267
  }),
@@ -5529,26 +5589,26 @@ var registerOverlayPortal = (el, opts = {}) => {
5529
5589
  capture: true
5530
5590
  });
5531
5591
  };
5532
- if (disableDragOnFocus) {
5533
- el.addEventListener("focus", onFocus, { capture: true });
5534
- el.addEventListener("blur", onBlur, { capture: true });
5535
- } else if (disableDrag) {
5592
+ if (disableDrag) {
5536
5593
  el.addEventListener("pointerdown", stopPropagation, {
5537
5594
  capture: true
5538
5595
  });
5596
+ } else if (disableDragOnFocus) {
5597
+ el.addEventListener("focus", onFocus, { capture: true });
5598
+ el.addEventListener("blur", onBlur, { capture: true });
5539
5599
  }
5540
5600
  el.setAttribute("data-puck-overlay-portal", "true");
5541
5601
  return () => {
5542
5602
  el.removeEventListener("mouseover", stopPropagation, {
5543
5603
  capture: true
5544
5604
  });
5545
- if (disableDragOnFocus) {
5546
- el.removeEventListener("focus", onFocus, { capture: true });
5547
- el.removeEventListener("blur", onFocus, { capture: true });
5548
- } else if (disableDrag) {
5605
+ if (disableDrag) {
5549
5606
  el.removeEventListener("pointerdown", stopPropagation, {
5550
5607
  capture: true
5551
5608
  });
5609
+ } else if (disableDragOnFocus) {
5610
+ el.removeEventListener("focus", onFocus, { capture: true });
5611
+ el.removeEventListener("blur", onBlur, { capture: true });
5552
5612
  }
5553
5613
  el.removeAttribute("data-puck-overlay-portal");
5554
5614
  };
@@ -5556,7 +5616,7 @@ var registerOverlayPortal = (el, opts = {}) => {
5556
5616
 
5557
5617
  // css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css#css-module
5558
5618
  init_react_import();
5559
- var styles_module_default13 = { "InlineTextField": "_InlineTextField_1xph6_1" };
5619
+ var styles_module_default13 = { "InlineTextField": "_InlineTextField_104qp_1" };
5560
5620
 
5561
5621
  // lib/data/set-deep.ts
5562
5622
  init_react_import();
@@ -5630,7 +5690,7 @@ var InlineTextFieldInternal = ({
5630
5690
  ref.current.replaceChildren(value);
5631
5691
  }
5632
5692
  const cleanupPortal = registerOverlayPortal(ref.current);
5633
- const handleInput = (e) => __async(void 0, null, function* () {
5693
+ const handleInput = (e) => __async(null, null, function* () {
5634
5694
  var _a2;
5635
5695
  const appStore2 = appStoreApi.getState();
5636
5696
  const node = appStore2.state.indexes.nodes[componentId];
@@ -6454,7 +6514,7 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
6454
6514
 
6455
6515
  // lib/insert-component.ts
6456
6516
  init_react_import();
6457
- var insertComponent = (componentType, zone, index, appStore) => __async(void 0, null, function* () {
6517
+ var insertComponent = (componentType, zone, index, appStore) => __async(null, null, function* () {
6458
6518
  const id = generateId(componentType);
6459
6519
  const insertActionData = {
6460
6520
  type: "insert",
@@ -7046,7 +7106,7 @@ Drawer.Item = DrawerItem;
7046
7106
 
7047
7107
  // components/Puck/index.tsx
7048
7108
  init_react_import();
7049
- var import_react59 = require("react");
7109
+ var import_react60 = require("react");
7050
7110
 
7051
7111
  // components/SidebarSection/index.tsx
7052
7112
  init_react_import();
@@ -7162,7 +7222,7 @@ var DefaultFields = ({
7162
7222
  }) => {
7163
7223
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children });
7164
7224
  };
7165
- var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(void 0, null, function* () {
7225
+ var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(null, null, function* () {
7166
7226
  let currentProps;
7167
7227
  const { dispatch, state, selectedItem, resolveComponentData: resolveComponentData2 } = appStore.getState();
7168
7228
  const { data, ui } = state;
@@ -7531,7 +7591,7 @@ var CopyHostStyles = ({
7531
7591
  let elements = [];
7532
7592
  const hashes = {};
7533
7593
  const lookupEl = (el) => elements.findIndex((elementMap) => elementMap.original === el);
7534
- const mirrorEl = (el, inlineStyles = false) => __async(void 0, null, function* () {
7594
+ const mirrorEl = (el, inlineStyles = false) => __async(null, null, function* () {
7535
7595
  let mirror;
7536
7596
  if (el.nodeName === "LINK" && inlineStyles) {
7537
7597
  mirror = document.createElement("style");
@@ -7563,7 +7623,7 @@ var CopyHostStyles = ({
7563
7623
  }
7564
7624
  return mirror;
7565
7625
  });
7566
- const addEl = (el) => __async(void 0, null, function* () {
7626
+ const addEl = (el) => __async(null, null, function* () {
7567
7627
  const index = lookupEl(el);
7568
7628
  if (index > -1) {
7569
7629
  if (debug)
@@ -7636,7 +7696,7 @@ var CopyHostStyles = ({
7636
7696
  const parentBody = parentDocument.getElementsByTagName("body")[0];
7637
7697
  syncAttributes(parentBody, doc.body);
7638
7698
  Promise.all(
7639
- collectedStyles.map((styleNode, i) => __async(void 0, null, function* () {
7699
+ collectedStyles.map((styleNode, i) => __async(null, null, function* () {
7640
7700
  if (styleNode.nodeName === "LINK") {
7641
7701
  const linkHref = styleNode.href;
7642
7702
  if (hrefs.indexOf(linkHref) > -1) {
@@ -8584,9 +8644,70 @@ var usePreviewModeHotkeys = () => {
8584
8644
  useHotkey({ ctrl: true, i: true }, toggleInteractive);
8585
8645
  };
8586
8646
 
8587
- // lib/use-puck.ts
8647
+ // lib/use-delete-hotkeys.ts
8588
8648
  init_react_import();
8589
8649
  var import_react55 = require("react");
8650
+ var isElementVisible = (element) => {
8651
+ let current = element;
8652
+ while (current && current !== document.body) {
8653
+ const style = window.getComputedStyle(current);
8654
+ if (style.display === "none" || style.visibility === "hidden" || style.opacity === "0" || current.getAttribute("aria-hidden") === "true" || current.hasAttribute("hidden")) {
8655
+ return false;
8656
+ }
8657
+ current = current.parentElement;
8658
+ }
8659
+ return true;
8660
+ };
8661
+ var shouldBlockDeleteHotkey = (e) => {
8662
+ var _a;
8663
+ if (e == null ? void 0 : e.defaultPrevented) return true;
8664
+ const origin = ((_a = e == null ? void 0 : e.composedPath) == null ? void 0 : _a.call(e)[0]) || (e == null ? void 0 : e.target) || document.activeElement;
8665
+ if (origin instanceof HTMLElement) {
8666
+ const tag = origin.tagName.toLowerCase();
8667
+ if (tag === "input" || tag === "textarea" || tag === "select") return true;
8668
+ if (origin.isContentEditable) return true;
8669
+ const role = origin.getAttribute("role");
8670
+ if (role === "textbox" || role === "combobox" || role === "searchbox" || role === "listbox" || role === "grid") {
8671
+ return true;
8672
+ }
8673
+ }
8674
+ const modal = document.querySelector(
8675
+ 'dialog[open], [aria-modal="true"], [role="dialog"], [role="alertdialog"]'
8676
+ );
8677
+ if (modal && isElementVisible(modal)) {
8678
+ return true;
8679
+ }
8680
+ return false;
8681
+ };
8682
+ var useDeleteHotkeys = () => {
8683
+ const appStore = useAppStoreApi();
8684
+ const deleteSelectedComponent = (0, import_react55.useCallback)(
8685
+ (e) => {
8686
+ var _a;
8687
+ if (shouldBlockDeleteHotkey(e)) {
8688
+ return false;
8689
+ }
8690
+ const { state, dispatch, permissions, selectedItem } = appStore.getState();
8691
+ const sel = (_a = state.ui) == null ? void 0 : _a.itemSelector;
8692
+ if (!(sel == null ? void 0 : sel.zone) || !selectedItem) return true;
8693
+ if (!permissions.getPermissions({ item: selectedItem }).delete)
8694
+ return true;
8695
+ dispatch({
8696
+ type: "remove",
8697
+ index: sel.index,
8698
+ zone: sel.zone
8699
+ });
8700
+ return true;
8701
+ },
8702
+ [appStore]
8703
+ );
8704
+ useHotkey({ delete: true }, deleteSelectedComponent);
8705
+ useHotkey({ backspace: true }, deleteSelectedComponent);
8706
+ };
8707
+
8708
+ // lib/use-puck.ts
8709
+ init_react_import();
8710
+ var import_react56 = require("react");
8590
8711
  var import_zustand6 = require("zustand");
8591
8712
  var generateUsePuck = (store) => {
8592
8713
  const history = {
@@ -8613,7 +8734,7 @@ var generateUsePuck = (store) => {
8613
8734
  };
8614
8735
  return storeData;
8615
8736
  };
8616
- var UsePuckStoreContext = (0, import_react55.createContext)(
8737
+ var UsePuckStoreContext = (0, import_react56.createContext)(
8617
8738
  null
8618
8739
  );
8619
8740
  var convertToPickedStore = (store) => {
@@ -8627,12 +8748,12 @@ var convertToPickedStore = (store) => {
8627
8748
  };
8628
8749
  };
8629
8750
  var useRegisterUsePuckStore = (appStore) => {
8630
- const [usePuckStore] = (0, import_react55.useState)(
8751
+ const [usePuckStore] = (0, import_react56.useState)(
8631
8752
  () => (0, import_zustand6.createStore)(
8632
8753
  () => generateUsePuck(convertToPickedStore(appStore.getState()))
8633
8754
  )
8634
8755
  );
8635
- (0, import_react55.useEffect)(() => {
8756
+ (0, import_react56.useEffect)(() => {
8636
8757
  return appStore.subscribe(
8637
8758
  (store) => convertToPickedStore(store),
8638
8759
  (pickedStore) => {
@@ -8644,19 +8765,19 @@ var useRegisterUsePuckStore = (appStore) => {
8644
8765
  };
8645
8766
  function createUsePuck() {
8646
8767
  return function usePuck2(selector) {
8647
- const usePuckApi = (0, import_react55.useContext)(UsePuckStoreContext);
8768
+ const usePuckApi = (0, import_react56.useContext)(UsePuckStoreContext);
8648
8769
  if (!usePuckApi) {
8649
8770
  throw new Error("usePuck must be used inside <Puck>.");
8650
8771
  }
8651
8772
  const result = (0, import_zustand6.useStore)(
8652
8773
  usePuckApi,
8653
- selector != null ? selector : (s) => s
8774
+ selector != null ? selector : ((s) => s)
8654
8775
  );
8655
8776
  return result;
8656
8777
  };
8657
8778
  }
8658
8779
  function usePuck() {
8659
- (0, import_react55.useEffect)(() => {
8780
+ (0, import_react56.useEffect)(() => {
8660
8781
  console.warn(
8661
8782
  "You're using the `usePuck` method without a selector, which may cause unnecessary re-renders. Replace with `createUsePuck` and provide a selector for improved performance."
8662
8783
  );
@@ -8664,7 +8785,7 @@ function usePuck() {
8664
8785
  return createUsePuck()((s) => s);
8665
8786
  }
8666
8787
  function useGetPuck() {
8667
- const usePuckApi = (0, import_react55.useContext)(UsePuckStoreContext);
8788
+ const usePuckApi = (0, import_react56.useContext)(UsePuckStoreContext);
8668
8789
  if (!usePuckApi) {
8669
8790
  throw new Error("usePuckGet must be used inside <Puck>.");
8670
8791
  }
@@ -8672,11 +8793,11 @@ function useGetPuck() {
8672
8793
  }
8673
8794
 
8674
8795
  // components/Puck/index.tsx
8675
- var import_fast_deep_equal3 = __toESM(require("fast-deep-equal"));
8796
+ var import_fast_deep_equal = __toESM(require_fast_deep_equal());
8676
8797
 
8677
8798
  // components/Puck/components/Header/index.tsx
8678
8799
  init_react_import();
8679
- var import_react56 = require("react");
8800
+ var import_react57 = require("react");
8680
8801
 
8681
8802
  // components/MenuBar/index.tsx
8682
8803
  init_react_import();
@@ -8758,7 +8879,7 @@ var HeaderInner = () => {
8758
8879
  } = usePropsContext();
8759
8880
  const dispatch = useAppStore((s) => s.dispatch);
8760
8881
  const appStore = useAppStoreApi();
8761
- const defaultHeaderRender = (0, import_react56.useMemo)(() => {
8882
+ const defaultHeaderRender = (0, import_react57.useMemo)(() => {
8762
8883
  if (renderHeader) {
8763
8884
  console.warn(
8764
8885
  "`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
@@ -8773,7 +8894,7 @@ var HeaderInner = () => {
8773
8894
  }
8774
8895
  return DefaultOverride;
8775
8896
  }, [renderHeader]);
8776
- const defaultHeaderActionsRender = (0, import_react56.useMemo)(() => {
8897
+ const defaultHeaderActionsRender = (0, import_react57.useMemo)(() => {
8777
8898
  if (renderHeaderActions) {
8778
8899
  console.warn(
8779
8900
  "`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
@@ -8793,7 +8914,7 @@ var HeaderInner = () => {
8793
8914
  const CustomHeaderActions = useAppStore(
8794
8915
  (s) => s.overrides.headerActions || defaultHeaderActionsRender
8795
8916
  );
8796
- const [menuOpen, setMenuOpen] = (0, import_react56.useState)(false);
8917
+ const [menuOpen, setMenuOpen] = (0, import_react57.useState)(false);
8797
8918
  const rootTitle = useAppStore((s) => {
8798
8919
  var _a, _b;
8799
8920
  const rootData = (_a = s.state.indexes.nodes["root"]) == null ? void 0 : _a.data;
@@ -8803,7 +8924,7 @@ var HeaderInner = () => {
8803
8924
  const rightSideBarVisible = useAppStore(
8804
8925
  (s) => s.state.ui.rightSideBarVisible
8805
8926
  );
8806
- const toggleSidebars = (0, import_react56.useCallback)(
8927
+ const toggleSidebars = (0, import_react57.useCallback)(
8807
8928
  (sidebar) => {
8808
8929
  const widerViewport = window.matchMedia("(min-width: 638px)").matches;
8809
8930
  const sideBarVisible = sidebar === "left" ? leftSideBarVisible : rightSideBarVisible;
@@ -8906,14 +9027,14 @@ var HeaderInner = () => {
8906
9027
  }
8907
9028
  );
8908
9029
  };
8909
- var Header = (0, import_react56.memo)(HeaderInner);
9030
+ var Header = (0, import_react57.memo)(HeaderInner);
8910
9031
 
8911
9032
  // components/Puck/components/Sidebar/index.tsx
8912
9033
  init_react_import();
8913
9034
 
8914
9035
  // components/Puck/components/ResizeHandle/index.tsx
8915
9036
  init_react_import();
8916
- var import_react57 = require("react");
9037
+ var import_react58 = require("react");
8917
9038
 
8918
9039
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/ResizeHandle/styles.module.css#css-module
8919
9040
  init_react_import();
@@ -8930,11 +9051,11 @@ var ResizeHandle = ({
8930
9051
  }) => {
8931
9052
  const { frameRef } = useCanvasFrame();
8932
9053
  const resetAutoZoom = useResetAutoZoom(frameRef);
8933
- const handleRef = (0, import_react57.useRef)(null);
8934
- const isDragging = (0, import_react57.useRef)(false);
8935
- const startX = (0, import_react57.useRef)(0);
8936
- const startWidth = (0, import_react57.useRef)(0);
8937
- const handleMouseMove = (0, import_react57.useCallback)(
9054
+ const handleRef = (0, import_react58.useRef)(null);
9055
+ const isDragging = (0, import_react58.useRef)(false);
9056
+ const startX = (0, import_react58.useRef)(0);
9057
+ const startWidth = (0, import_react58.useRef)(0);
9058
+ const handleMouseMove = (0, import_react58.useCallback)(
8938
9059
  (e) => {
8939
9060
  if (!isDragging.current) return;
8940
9061
  const delta = e.clientX - startX.current;
@@ -8945,7 +9066,7 @@ var ResizeHandle = ({
8945
9066
  },
8946
9067
  [onResize, position]
8947
9068
  );
8948
- const handleMouseUp = (0, import_react57.useCallback)(() => {
9069
+ const handleMouseUp = (0, import_react58.useCallback)(() => {
8949
9070
  var _a;
8950
9071
  if (!isDragging.current) return;
8951
9072
  isDragging.current = false;
@@ -8961,7 +9082,7 @@ var ResizeHandle = ({
8961
9082
  onResizeEnd(finalWidth);
8962
9083
  resetAutoZoom();
8963
9084
  }, [onResizeEnd]);
8964
- const handleMouseDown = (0, import_react57.useCallback)(
9085
+ const handleMouseDown = (0, import_react58.useCallback)(
8965
9086
  (e) => {
8966
9087
  var _a;
8967
9088
  isDragging.current = true;
@@ -9021,14 +9142,14 @@ var Sidebar = ({
9021
9142
 
9022
9143
  // lib/use-sidebar-resize.ts
9023
9144
  init_react_import();
9024
- var import_react58 = require("react");
9145
+ var import_react59 = require("react");
9025
9146
  function useSidebarResize(position, dispatch) {
9026
- const [width, setWidth] = (0, import_react58.useState)(null);
9027
- const sidebarRef = (0, import_react58.useRef)(null);
9147
+ const [width, setWidth] = (0, import_react59.useState)(null);
9148
+ const sidebarRef = (0, import_react59.useRef)(null);
9028
9149
  const storeWidth = useAppStore(
9029
9150
  (s) => position === "left" ? s.state.ui.leftSideBarWidth : s.state.ui.rightSideBarWidth
9030
9151
  );
9031
- (0, import_react58.useEffect)(() => {
9152
+ (0, import_react59.useEffect)(() => {
9032
9153
  if (typeof window !== "undefined" && !storeWidth) {
9033
9154
  try {
9034
9155
  const savedWidths = localStorage.getItem("puck-sidebar-widths");
@@ -9053,12 +9174,12 @@ function useSidebarResize(position, dispatch) {
9053
9174
  }
9054
9175
  }
9055
9176
  }, [dispatch, position, storeWidth]);
9056
- (0, import_react58.useEffect)(() => {
9177
+ (0, import_react59.useEffect)(() => {
9057
9178
  if (storeWidth !== void 0) {
9058
9179
  setWidth(storeWidth);
9059
9180
  }
9060
9181
  }, [storeWidth]);
9061
- const handleResizeEnd = (0, import_react58.useCallback)(
9182
+ const handleResizeEnd = (0, import_react59.useCallback)(
9062
9183
  (width2) => {
9063
9184
  dispatch({
9064
9185
  type: "setUi",
@@ -9100,6 +9221,15 @@ function useSidebarResize(position, dispatch) {
9100
9221
  };
9101
9222
  }
9102
9223
 
9224
+ // lib/data/to-component.ts
9225
+ init_react_import();
9226
+ var toComponent = (item) => {
9227
+ return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
9228
+ props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
9229
+ type: "root"
9230
+ });
9231
+ };
9232
+
9103
9233
  // components/Puck/index.tsx
9104
9234
  var import_jsx_runtime46 = require("react/jsx-runtime");
9105
9235
  var getClassName31 = get_class_name_factory_default("Puck", styles_module_default15);
@@ -9113,11 +9243,11 @@ var FieldSideBar = () => {
9113
9243
  );
9114
9244
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SidebarSection, { noPadding: true, noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Fields, {}) });
9115
9245
  };
9116
- var propsContext = (0, import_react59.createContext)({});
9246
+ var propsContext = (0, import_react60.createContext)({});
9117
9247
  function PropsProvider(props) {
9118
9248
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(propsContext.Provider, { value: props, children: props.children });
9119
9249
  }
9120
- var usePropsContext = () => (0, import_react59.useContext)(propsContext);
9250
+ var usePropsContext = () => (0, import_react60.useContext)(propsContext);
9121
9251
  function PuckProvider({ children }) {
9122
9252
  const {
9123
9253
  config,
@@ -9134,14 +9264,14 @@ function PuckProvider({ children }) {
9134
9264
  onAction,
9135
9265
  fieldTransforms
9136
9266
  } = usePropsContext();
9137
- const iframe = (0, import_react59.useMemo)(
9267
+ const iframe = (0, import_react60.useMemo)(
9138
9268
  () => __spreadValues({
9139
9269
  enabled: true,
9140
9270
  waitForStyles: true
9141
9271
  }, _iframe),
9142
9272
  [_iframe]
9143
9273
  );
9144
- const [generatedAppState] = (0, import_react59.useState)(() => {
9274
+ const [generatedAppState] = (0, import_react60.useState)(() => {
9145
9275
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
9146
9276
  const initial = __spreadValues(__spreadValues({}, defaultAppState.ui), initialUi);
9147
9277
  let clientUiState = {};
@@ -9176,9 +9306,13 @@ function PuckProvider({ children }) {
9176
9306
  }
9177
9307
  const rootProps = ((_h = initialData == null ? void 0 : initialData.root) == null ? void 0 : _h.props) || (initialData == null ? void 0 : initialData.root) || {};
9178
9308
  const defaultedRootProps = __spreadValues(__spreadValues({}, (_i = config.root) == null ? void 0 : _i.defaultProps), rootProps);
9309
+ const root = populateIds(
9310
+ toComponent(__spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: defaultedRootProps })),
9311
+ config
9312
+ );
9179
9313
  const newAppState = __spreadProps(__spreadValues({}, defaultAppState), {
9180
9314
  data: __spreadProps(__spreadValues({}, initialData), {
9181
- root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: defaultedRootProps }),
9315
+ root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: root.props }),
9182
9316
  content: initialData.content || []
9183
9317
  }),
9184
9318
  ui: __spreadProps(__spreadValues(__spreadValues({}, initial), clientUiState), {
@@ -9201,7 +9335,7 @@ function PuckProvider({ children }) {
9201
9335
  return walkAppState(newAppState, config);
9202
9336
  });
9203
9337
  const { appendData = true } = _initialHistory || {};
9204
- const [blendedHistories] = (0, import_react59.useState)(
9338
+ const [blendedHistories] = (0, import_react60.useState)(
9205
9339
  [
9206
9340
  ...(_initialHistory == null ? void 0 : _initialHistory.histories) || [],
9207
9341
  ...appendData ? [{ state: generatedAppState }] : []
@@ -9221,7 +9355,7 @@ function PuckProvider({ children }) {
9221
9355
  overrides,
9222
9356
  plugins
9223
9357
  });
9224
- const loadedFieldTransforms = (0, import_react59.useMemo)(() => {
9358
+ const loadedFieldTransforms = (0, import_react60.useMemo)(() => {
9225
9359
  const _plugins = plugins || [];
9226
9360
  const pluginFieldTransforms = _plugins.reduce(
9227
9361
  (acc, plugin) => __spreadValues(__spreadValues({}, acc), plugin.fieldTransforms),
@@ -9229,7 +9363,7 @@ function PuckProvider({ children }) {
9229
9363
  );
9230
9364
  return __spreadValues(__spreadValues({}, pluginFieldTransforms), fieldTransforms);
9231
9365
  }, [fieldTransforms, plugins]);
9232
- const generateAppStore = (0, import_react59.useCallback)(
9366
+ const generateAppStore = (0, import_react60.useCallback)(
9233
9367
  (state) => {
9234
9368
  return {
9235
9369
  state,
@@ -9255,15 +9389,15 @@ function PuckProvider({ children }) {
9255
9389
  loadedFieldTransforms
9256
9390
  ]
9257
9391
  );
9258
- const [appStore] = (0, import_react59.useState)(
9392
+ const [appStore] = (0, import_react60.useState)(
9259
9393
  () => createAppStore(generateAppStore(initialAppState))
9260
9394
  );
9261
- (0, import_react59.useEffect)(() => {
9395
+ (0, import_react60.useEffect)(() => {
9262
9396
  if (process.env.NODE_ENV !== "production") {
9263
9397
  window.__PUCK_INTERNAL_DO_NOT_USE = { appStore };
9264
9398
  }
9265
9399
  }, [appStore]);
9266
- (0, import_react59.useEffect)(() => {
9400
+ (0, import_react60.useEffect)(() => {
9267
9401
  const state = appStore.getState().state;
9268
9402
  appStore.setState(__spreadValues({}, generateAppStore(state)));
9269
9403
  }, [config, plugins, loadedOverrides, viewports, iframe, onAction, metadata]);
@@ -9272,22 +9406,22 @@ function PuckProvider({ children }) {
9272
9406
  index: initialHistoryIndex,
9273
9407
  initialAppState
9274
9408
  });
9275
- const previousData = (0, import_react59.useRef)(null);
9276
- (0, import_react59.useEffect)(() => {
9277
- appStore.subscribe(
9409
+ const previousData = (0, import_react60.useRef)(null);
9410
+ (0, import_react60.useEffect)(() => {
9411
+ return appStore.subscribe(
9278
9412
  (s) => s.state.data,
9279
9413
  (data) => {
9280
9414
  if (onChange) {
9281
- if ((0, import_fast_deep_equal3.default)(data, previousData.current)) return;
9415
+ if ((0, import_fast_deep_equal.default)(data, previousData.current)) return;
9282
9416
  onChange(data);
9283
9417
  previousData.current = data;
9284
9418
  }
9285
9419
  }
9286
9420
  );
9287
- }, []);
9421
+ }, [onChange]);
9288
9422
  useRegisterPermissionsSlice(appStore, permissions);
9289
9423
  const uPuckStore = useRegisterUsePuckStore(appStore);
9290
- (0, import_react59.useEffect)(() => {
9424
+ (0, import_react60.useEffect)(() => {
9291
9425
  const { resolveAndCommitData } = appStore.getState();
9292
9426
  resolveAndCommitData();
9293
9427
  }, []);
@@ -9299,7 +9433,7 @@ function PuckLayout({ children }) {
9299
9433
  dnd,
9300
9434
  initialHistory: _initialHistory
9301
9435
  } = usePropsContext();
9302
- const iframe = (0, import_react59.useMemo)(
9436
+ const iframe = (0, import_react60.useMemo)(
9303
9437
  () => __spreadValues({
9304
9438
  enabled: true,
9305
9439
  waitForStyles: true
@@ -9324,7 +9458,7 @@ function PuckLayout({ children }) {
9324
9458
  sidebarRef: rightSidebarRef,
9325
9459
  handleResizeEnd: handleRightSidebarResizeEnd
9326
9460
  } = useSidebarResize("right", dispatch);
9327
- (0, import_react59.useEffect)(() => {
9461
+ (0, import_react60.useEffect)(() => {
9328
9462
  if (!window.matchMedia("(min-width: 638px)").matches) {
9329
9463
  dispatch({
9330
9464
  type: "setUi",
@@ -9348,17 +9482,18 @@ function PuckLayout({ children }) {
9348
9482
  };
9349
9483
  }, []);
9350
9484
  const overrides = useAppStore((s) => s.overrides);
9351
- const CustomPuck = (0, import_react59.useMemo)(
9485
+ const CustomPuck = (0, import_react60.useMemo)(
9352
9486
  () => overrides.puck || DefaultOverride,
9353
9487
  [overrides]
9354
9488
  );
9355
- const [mounted, setMounted] = (0, import_react59.useState)(false);
9356
- (0, import_react59.useEffect)(() => {
9489
+ const [mounted, setMounted] = (0, import_react60.useState)(false);
9490
+ (0, import_react60.useEffect)(() => {
9357
9491
  setMounted(true);
9358
9492
  }, []);
9359
9493
  const ready = useAppStore((s) => s.status === "READY");
9360
9494
  useMonitorHotkeys();
9361
- (0, import_react59.useEffect)(() => {
9495
+ useDeleteHotkeys();
9496
+ (0, import_react60.useEffect)(() => {
9362
9497
  if (ready && iframe.enabled) {
9363
9498
  const frameDoc = getFrame();
9364
9499
  if (frameDoc) {
@@ -9596,22 +9731,11 @@ function transformProps(data, propTransforms, config = { components: {} }) {
9596
9731
 
9597
9732
  // lib/resolve-all-data.ts
9598
9733
  init_react_import();
9599
-
9600
- // lib/data/to-component.ts
9601
- init_react_import();
9602
- var toComponent = (item) => {
9603
- return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
9604
- props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
9605
- type: "root"
9606
- });
9607
- };
9608
-
9609
- // lib/resolve-all-data.ts
9610
9734
  function resolveAllData(_0, _1) {
9611
9735
  return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
9612
9736
  var _a;
9613
9737
  const defaultedData = defaultData(data);
9614
- const resolveNode = (_node) => __async(this, null, function* () {
9738
+ const resolveNode = (_node) => __async(null, null, function* () {
9615
9739
  const node = toComponent(_node);
9616
9740
  onResolveStart == null ? void 0 : onResolveStart(node);
9617
9741
  const resolved = (yield resolveComponentData(
@@ -9632,13 +9756,13 @@ function resolveAllData(_0, _1) {
9632
9756
  onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
9633
9757
  return resolvedDeep;
9634
9758
  });
9635
- const processContent = (content) => __async(this, null, function* () {
9759
+ const processContent = (content) => __async(null, null, function* () {
9636
9760
  return Promise.all(content.map(resolveNode));
9637
9761
  });
9638
- const processZones = () => __async(this, null, function* () {
9762
+ const processZones = () => __async(null, null, function* () {
9639
9763
  var _a2;
9640
9764
  const zones = (_a2 = data.zones) != null ? _a2 : {};
9641
- Object.entries(zones).forEach((_02) => __async(this, [_02], function* ([zoneKey, content]) {
9765
+ Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
9642
9766
  zones[zoneKey] = yield Promise.all(content.map(resolveNode));
9643
9767
  }));
9644
9768
  return zones;
@@ -9648,7 +9772,7 @@ function resolveAllData(_0, _1) {
9648
9772
  content: yield processContent(defaultedData.content),
9649
9773
  zones: yield processZones()
9650
9774
  };
9651
- Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(this, null, function* () {
9775
+ Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
9652
9776
  const content = defaultedData.zones[zoneKey];
9653
9777
  dynamic.zones[zoneKey] = yield processContent(content);
9654
9778
  }), {});
@@ -9691,269 +9815,38 @@ classnames/index.js:
9691
9815
  *)
9692
9816
 
9693
9817
  lucide-react/dist/esm/shared/src/utils.js:
9694
- (**
9695
- * @license lucide-react v0.468.0 - ISC
9696
- *
9697
- * This source code is licensed under the ISC license.
9698
- * See the LICENSE file in the root directory of this source tree.
9699
- *)
9700
-
9701
9818
  lucide-react/dist/esm/defaultAttributes.js:
9702
- (**
9703
- * @license lucide-react v0.468.0 - ISC
9704
- *
9705
- * This source code is licensed under the ISC license.
9706
- * See the LICENSE file in the root directory of this source tree.
9707
- *)
9708
-
9709
9819
  lucide-react/dist/esm/Icon.js:
9710
- (**
9711
- * @license lucide-react v0.468.0 - ISC
9712
- *
9713
- * This source code is licensed under the ISC license.
9714
- * See the LICENSE file in the root directory of this source tree.
9715
- *)
9716
-
9717
9820
  lucide-react/dist/esm/createLucideIcon.js:
9718
- (**
9719
- * @license lucide-react v0.468.0 - ISC
9720
- *
9721
- * This source code is licensed under the ISC license.
9722
- * See the LICENSE file in the root directory of this source tree.
9723
- *)
9724
-
9725
9821
  lucide-react/dist/esm/icons/chevron-down.js:
9726
- (**
9727
- * @license lucide-react v0.468.0 - ISC
9728
- *
9729
- * This source code is licensed under the ISC license.
9730
- * See the LICENSE file in the root directory of this source tree.
9731
- *)
9732
-
9733
9822
  lucide-react/dist/esm/icons/chevron-right.js:
9734
- (**
9735
- * @license lucide-react v0.468.0 - ISC
9736
- *
9737
- * This source code is licensed under the ISC license.
9738
- * See the LICENSE file in the root directory of this source tree.
9739
- *)
9740
-
9741
9823
  lucide-react/dist/esm/icons/chevron-up.js:
9742
- (**
9743
- * @license lucide-react v0.468.0 - ISC
9744
- *
9745
- * This source code is licensed under the ISC license.
9746
- * See the LICENSE file in the root directory of this source tree.
9747
- *)
9748
-
9749
9824
  lucide-react/dist/esm/icons/circle-check-big.js:
9750
- (**
9751
- * @license lucide-react v0.468.0 - ISC
9752
- *
9753
- * This source code is licensed under the ISC license.
9754
- * See the LICENSE file in the root directory of this source tree.
9755
- *)
9756
-
9757
9825
  lucide-react/dist/esm/icons/copy.js:
9758
- (**
9759
- * @license lucide-react v0.468.0 - ISC
9760
- *
9761
- * This source code is licensed under the ISC license.
9762
- * See the LICENSE file in the root directory of this source tree.
9763
- *)
9764
-
9765
9826
  lucide-react/dist/esm/icons/corner-left-up.js:
9766
- (**
9767
- * @license lucide-react v0.468.0 - ISC
9768
- *
9769
- * This source code is licensed under the ISC license.
9770
- * See the LICENSE file in the root directory of this source tree.
9771
- *)
9772
-
9773
9827
  lucide-react/dist/esm/icons/ellipsis-vertical.js:
9774
- (**
9775
- * @license lucide-react v0.468.0 - ISC
9776
- *
9777
- * This source code is licensed under the ISC license.
9778
- * See the LICENSE file in the root directory of this source tree.
9779
- *)
9780
-
9781
9828
  lucide-react/dist/esm/icons/globe.js:
9782
- (**
9783
- * @license lucide-react v0.468.0 - ISC
9784
- *
9785
- * This source code is licensed under the ISC license.
9786
- * See the LICENSE file in the root directory of this source tree.
9787
- *)
9788
-
9789
9829
  lucide-react/dist/esm/icons/hash.js:
9790
- (**
9791
- * @license lucide-react v0.468.0 - ISC
9792
- *
9793
- * This source code is licensed under the ISC license.
9794
- * See the LICENSE file in the root directory of this source tree.
9795
- *)
9796
-
9797
9830
  lucide-react/dist/esm/icons/layers.js:
9798
- (**
9799
- * @license lucide-react v0.468.0 - ISC
9800
- *
9801
- * This source code is licensed under the ISC license.
9802
- * See the LICENSE file in the root directory of this source tree.
9803
- *)
9804
-
9805
9831
  lucide-react/dist/esm/icons/layout-grid.js:
9806
- (**
9807
- * @license lucide-react v0.468.0 - ISC
9808
- *
9809
- * This source code is licensed under the ISC license.
9810
- * See the LICENSE file in the root directory of this source tree.
9811
- *)
9812
-
9813
9832
  lucide-react/dist/esm/icons/link.js:
9814
- (**
9815
- * @license lucide-react v0.468.0 - ISC
9816
- *
9817
- * This source code is licensed under the ISC license.
9818
- * See the LICENSE file in the root directory of this source tree.
9819
- *)
9820
-
9821
9833
  lucide-react/dist/esm/icons/list.js:
9822
- (**
9823
- * @license lucide-react v0.468.0 - ISC
9824
- *
9825
- * This source code is licensed under the ISC license.
9826
- * See the LICENSE file in the root directory of this source tree.
9827
- *)
9828
-
9829
9834
  lucide-react/dist/esm/icons/lock-open.js:
9830
- (**
9831
- * @license lucide-react v0.468.0 - ISC
9832
- *
9833
- * This source code is licensed under the ISC license.
9834
- * See the LICENSE file in the root directory of this source tree.
9835
- *)
9836
-
9837
9835
  lucide-react/dist/esm/icons/lock.js:
9838
- (**
9839
- * @license lucide-react v0.468.0 - ISC
9840
- *
9841
- * This source code is licensed under the ISC license.
9842
- * See the LICENSE file in the root directory of this source tree.
9843
- *)
9844
-
9845
9836
  lucide-react/dist/esm/icons/monitor.js:
9846
- (**
9847
- * @license lucide-react v0.468.0 - ISC
9848
- *
9849
- * This source code is licensed under the ISC license.
9850
- * See the LICENSE file in the root directory of this source tree.
9851
- *)
9852
-
9853
9837
  lucide-react/dist/esm/icons/panel-left.js:
9854
- (**
9855
- * @license lucide-react v0.468.0 - ISC
9856
- *
9857
- * This source code is licensed under the ISC license.
9858
- * See the LICENSE file in the root directory of this source tree.
9859
- *)
9860
-
9861
9838
  lucide-react/dist/esm/icons/panel-right.js:
9862
- (**
9863
- * @license lucide-react v0.468.0 - ISC
9864
- *
9865
- * This source code is licensed under the ISC license.
9866
- * See the LICENSE file in the root directory of this source tree.
9867
- *)
9868
-
9869
9839
  lucide-react/dist/esm/icons/plus.js:
9870
- (**
9871
- * @license lucide-react v0.468.0 - ISC
9872
- *
9873
- * This source code is licensed under the ISC license.
9874
- * See the LICENSE file in the root directory of this source tree.
9875
- *)
9876
-
9877
9840
  lucide-react/dist/esm/icons/redo-2.js:
9878
- (**
9879
- * @license lucide-react v0.468.0 - ISC
9880
- *
9881
- * This source code is licensed under the ISC license.
9882
- * See the LICENSE file in the root directory of this source tree.
9883
- *)
9884
-
9885
9841
  lucide-react/dist/esm/icons/search.js:
9886
- (**
9887
- * @license lucide-react v0.468.0 - ISC
9888
- *
9889
- * This source code is licensed under the ISC license.
9890
- * See the LICENSE file in the root directory of this source tree.
9891
- *)
9892
-
9893
9842
  lucide-react/dist/esm/icons/sliders-horizontal.js:
9894
- (**
9895
- * @license lucide-react v0.468.0 - ISC
9896
- *
9897
- * This source code is licensed under the ISC license.
9898
- * See the LICENSE file in the root directory of this source tree.
9899
- *)
9900
-
9901
9843
  lucide-react/dist/esm/icons/smartphone.js:
9902
- (**
9903
- * @license lucide-react v0.468.0 - ISC
9904
- *
9905
- * This source code is licensed under the ISC license.
9906
- * See the LICENSE file in the root directory of this source tree.
9907
- *)
9908
-
9909
9844
  lucide-react/dist/esm/icons/tablet.js:
9910
- (**
9911
- * @license lucide-react v0.468.0 - ISC
9912
- *
9913
- * This source code is licensed under the ISC license.
9914
- * See the LICENSE file in the root directory of this source tree.
9915
- *)
9916
-
9917
9845
  lucide-react/dist/esm/icons/trash.js:
9918
- (**
9919
- * @license lucide-react v0.468.0 - ISC
9920
- *
9921
- * This source code is licensed under the ISC license.
9922
- * See the LICENSE file in the root directory of this source tree.
9923
- *)
9924
-
9925
9846
  lucide-react/dist/esm/icons/type.js:
9926
- (**
9927
- * @license lucide-react v0.468.0 - ISC
9928
- *
9929
- * This source code is licensed under the ISC license.
9930
- * See the LICENSE file in the root directory of this source tree.
9931
- *)
9932
-
9933
9847
  lucide-react/dist/esm/icons/undo-2.js:
9934
- (**
9935
- * @license lucide-react v0.468.0 - ISC
9936
- *
9937
- * This source code is licensed under the ISC license.
9938
- * See the LICENSE file in the root directory of this source tree.
9939
- *)
9940
-
9941
9848
  lucide-react/dist/esm/icons/zoom-in.js:
9942
- (**
9943
- * @license lucide-react v0.468.0 - ISC
9944
- *
9945
- * This source code is licensed under the ISC license.
9946
- * See the LICENSE file in the root directory of this source tree.
9947
- *)
9948
-
9949
9849
  lucide-react/dist/esm/icons/zoom-out.js:
9950
- (**
9951
- * @license lucide-react v0.468.0 - ISC
9952
- *
9953
- * This source code is licensed under the ISC license.
9954
- * See the LICENSE file in the root directory of this source tree.
9955
- *)
9956
-
9957
9850
  lucide-react/dist/esm/lucide-react.js:
9958
9851
  (**
9959
9852
  * @license lucide-react v0.468.0 - ISC