@measured/puck 0.21.0-canary.e9d5c0ea → 0.21.0-canary.f3ce0d72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -190,8 +190,8 @@ var require_fast_deep_equal = __commonJS({
190
190
  });
191
191
 
192
192
  // bundle/index.ts
193
- var bundle_exports = {};
194
- __export(bundle_exports, {
193
+ var index_exports = {};
194
+ __export(index_exports, {
195
195
  Action: () => Action,
196
196
  ActionBar: () => ActionBar,
197
197
  AutoField: () => AutoField,
@@ -205,6 +205,7 @@ __export(bundle_exports, {
205
205
  Puck: () => Puck,
206
206
  Render: () => Render,
207
207
  blocksPlugin: () => blocksPlugin,
208
+ createReducer: () => createReducer,
208
209
  createUsePuck: () => createUsePuck,
209
210
  fieldsPlugin: () => fieldsPlugin,
210
211
  migrate: () => migrate,
@@ -219,7 +220,7 @@ __export(bundle_exports, {
219
220
  usePuck: () => usePuck,
220
221
  walkTree: () => walkTree
221
222
  });
222
- module.exports = __toCommonJS(bundle_exports);
223
+ module.exports = __toCommonJS(index_exports);
223
224
  init_react_import();
224
225
 
225
226
  // bundle/core.ts
@@ -2045,10 +2046,10 @@ var getChanged = (newItem, oldItem) => {
2045
2046
 
2046
2047
  // store/slices/permissions.ts
2047
2048
  var createPermissionsSlice = (set, get) => {
2048
- const resolvePermissions = (..._0) => __async(void 0, [..._0], function* (params = {}, force) {
2049
+ const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
2049
2050
  const { state, permissions, config } = get();
2050
2051
  const { cache: cache2, globalPermissions } = permissions;
2051
- const resolveDataForItem = (item2, force2 = false) => __async(void 0, null, function* () {
2052
+ const resolveDataForItem = (item2, force2 = false) => __async(null, null, function* () {
2052
2053
  var _a, _b, _c;
2053
2054
  const { config: config2, state: appState, setComponentLoading } = get();
2054
2055
  const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
@@ -2103,13 +2104,13 @@ var createPermissionsSlice = (set, get) => {
2103
2104
  if (item) {
2104
2105
  yield resolveDataForItem(item, force);
2105
2106
  } else if (type) {
2106
- flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(void 0, null, function* () {
2107
+ flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
2107
2108
  yield resolveDataForItem(item2, force);
2108
2109
  }));
2109
2110
  } else if (root) {
2110
2111
  resolveDataForRoot(force);
2111
2112
  } else {
2112
- flattenData(state, config).map((item2) => __async(void 0, null, function* () {
2113
+ flattenData(state, config).map((item2) => __async(null, null, function* () {
2113
2114
  yield resolveDataForItem(item2, force);
2114
2115
  }));
2115
2116
  }
@@ -2190,7 +2191,7 @@ var createFieldsSlice = (_set, _get) => {
2190
2191
  };
2191
2192
  var useRegisterFieldsSlice = (appStore, id) => {
2192
2193
  const resolveFields = (0, import_react7.useCallback)(
2193
- (reset) => __async(void 0, null, function* () {
2194
+ (reset) => __async(null, null, function* () {
2194
2195
  var _a, _b;
2195
2196
  const { fields, lastResolvedData } = appStore.getState().fields;
2196
2197
  const metadata = appStore.getState().metadata;
@@ -2261,7 +2262,7 @@ var useRegisterFieldsSlice = (appStore, id) => {
2261
2262
  init_react_import();
2262
2263
  var import_fast_equals2 = require("fast-equals");
2263
2264
  var cache = { lastChange: {} };
2264
- var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
2265
+ var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
2265
2266
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
2266
2267
  const resolvedItem = __spreadValues({}, item);
2267
2268
  const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
@@ -2289,11 +2290,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
2289
2290
  let itemWithResolvedChildren = yield mapFields(
2290
2291
  resolvedItem,
2291
2292
  {
2292
- slot: (_02) => __async(void 0, [_02], function* ({ value }) {
2293
+ slot: (_02) => __async(null, [_02], function* ({ value }) {
2293
2294
  const content = value;
2294
2295
  return yield Promise.all(
2295
2296
  content.map(
2296
- (childItem) => __async(void 0, null, function* () {
2297
+ (childItem) => __async(null, null, function* () {
2297
2298
  return (yield resolveComponentData(
2298
2299
  childItem,
2299
2300
  config,
@@ -2485,7 +2486,7 @@ var createAppStore = (initialAppStore) => (0, import_zustand2.create)()(
2485
2486
  const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
2486
2487
  return __spreadProps(__spreadValues({}, s), { state, selectedItem });
2487
2488
  }),
2488
- resolveComponentData: (componentData, trigger) => __async(void 0, null, function* () {
2489
+ resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
2489
2490
  const { config, metadata, setComponentLoading, permissions } = get();
2490
2491
  const timeouts = {};
2491
2492
  return yield resolveComponentData(
@@ -2496,7 +2497,7 @@ var createAppStore = (initialAppStore) => (0, import_zustand2.create)()(
2496
2497
  const id = "id" in item.props ? item.props.id : "root";
2497
2498
  timeouts[id] = setComponentLoading(id, true, 50);
2498
2499
  },
2499
- (item) => __async(void 0, null, function* () {
2500
+ (item) => __async(null, null, function* () {
2500
2501
  const id = "id" in item.props ? item.props.id : "root";
2501
2502
  if ("type" in item) {
2502
2503
  yield permissions.refreshPermissions({ item });
@@ -2508,7 +2509,7 @@ var createAppStore = (initialAppStore) => (0, import_zustand2.create)()(
2508
2509
  trigger
2509
2510
  );
2510
2511
  }),
2511
- resolveAndCommitData: () => __async(void 0, null, function* () {
2512
+ resolveAndCommitData: () => __async(null, null, function* () {
2512
2513
  const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
2513
2514
  walkAppState(
2514
2515
  state,
@@ -3082,7 +3083,7 @@ var collisionStore = (0, import_vanilla.createStore)(() => ({
3082
3083
 
3083
3084
  // lib/dnd/collision/dynamic/index.ts
3084
3085
  var flushNext = "";
3085
- var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input) => {
3086
+ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((input) => {
3086
3087
  var _a, _b, _c, _d, _e;
3087
3088
  const { dragOperation, droppable } = input;
3088
3089
  const { position } = dragOperation;
@@ -3175,7 +3176,7 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input
3175
3176
  }
3176
3177
  collisionDebug(dragCenter, dropCenter, droppable.id.toString(), "hotpink");
3177
3178
  return null;
3178
- };
3179
+ });
3179
3180
 
3180
3181
  // components/Sortable/index.tsx
3181
3182
  var import_sortable = require("@dnd-kit/react/sortable");
@@ -4059,7 +4060,7 @@ var ExternalInput = ({
4059
4060
  }, [mappedData]);
4060
4061
  const [searchQuery, setSearchQuery] = (0, import_react18.useState)(field.initialQuery || "");
4061
4062
  const search = (0, import_react18.useCallback)(
4062
- (query, filters2) => __async(void 0, null, function* () {
4063
+ (query, filters2) => __async(null, null, function* () {
4063
4064
  setIsLoading(true);
4064
4065
  const cacheKey = `${id}-${query}-${JSON.stringify(filters2)}`;
4065
4066
  let listData;
@@ -4287,7 +4288,7 @@ var ExternalField = ({
4287
4288
  placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || "Select data",
4288
4289
  mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
4289
4290
  mapRow: validField.mapRow,
4290
- fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(void 0, null, function* () {
4291
+ fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(null, null, function* () {
4291
4292
  return yield deprecatedField.adaptor.fetchList(
4292
4293
  deprecatedField.adaptorParams
4293
4294
  );
@@ -4659,6 +4660,7 @@ function AutoFieldInternal(props) {
4659
4660
  }
4660
4661
  return (_props) => null;
4661
4662
  }, [field.type]);
4663
+ const fieldKey = field.type === "custom" ? field.key : void 0;
4662
4664
  let FieldComponent = (0, import_react22.useMemo)(() => {
4663
4665
  if (field.type === "custom") {
4664
4666
  if (!field.render) {
@@ -4668,7 +4670,7 @@ function AutoFieldInternal(props) {
4668
4670
  } else if (field.type !== "slot") {
4669
4671
  return render[field.type];
4670
4672
  }
4671
- }, [field.type, render]);
4673
+ }, [field.type, fieldKey, render]);
4672
4674
  const { visible = true } = props.field;
4673
4675
  if (!visible) {
4674
4676
  return null;
@@ -5522,7 +5524,7 @@ var import_react29 = require("react");
5522
5524
  function useRenderedCallback(callback, deps) {
5523
5525
  const manager = (0, import_react28.useDragDropManager)();
5524
5526
  return (0, import_react29.useCallback)(
5525
- (...args) => __async(this, null, function* () {
5527
+ (...args) => __async(null, null, function* () {
5526
5528
  yield manager == null ? void 0 : manager.renderer.rendering;
5527
5529
  return callback(...args);
5528
5530
  }),
@@ -5951,7 +5953,7 @@ var InlineTextFieldInternal = ({
5951
5953
  ref.current.replaceChildren(value);
5952
5954
  }
5953
5955
  const cleanupPortal = registerOverlayPortal(ref.current);
5954
- const handleInput = (e) => __async(void 0, null, function* () {
5956
+ const handleInput = (e) => __async(null, null, function* () {
5955
5957
  var _a2;
5956
5958
  const appStore2 = appStoreApi.getState();
5957
5959
  const node = appStore2.state.indexes.nodes[componentId];
@@ -6775,7 +6777,7 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
6775
6777
 
6776
6778
  // lib/insert-component.ts
6777
6779
  init_react_import();
6778
- var insertComponent = (componentType, zone, index, appStore) => __async(void 0, null, function* () {
6780
+ var insertComponent = (componentType, zone, index, appStore) => __async(null, null, function* () {
6779
6781
  const id = generateId(componentType);
6780
6782
  const insertActionData = {
6781
6783
  type: "insert",
@@ -7386,7 +7388,7 @@ var DefaultFields = ({
7386
7388
  }) => {
7387
7389
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children });
7388
7390
  };
7389
- var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(void 0, null, function* () {
7391
+ var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(null, null, function* () {
7390
7392
  let currentProps;
7391
7393
  const { dispatch, state, selectedItem, resolveComponentData: resolveComponentData2 } = appStore.getState();
7392
7394
  const { data, ui } = state;
@@ -7757,7 +7759,7 @@ var CopyHostStyles = ({
7757
7759
  let elements = [];
7758
7760
  const hashes = {};
7759
7761
  const lookupEl = (el) => elements.findIndex((elementMap) => elementMap.original === el);
7760
- const mirrorEl = (el, inlineStyles = false) => __async(void 0, null, function* () {
7762
+ const mirrorEl = (el, inlineStyles = false) => __async(null, null, function* () {
7761
7763
  let mirror;
7762
7764
  if (el.nodeName === "LINK" && inlineStyles) {
7763
7765
  mirror = document.createElement("style");
@@ -7789,7 +7791,7 @@ var CopyHostStyles = ({
7789
7791
  }
7790
7792
  return mirror;
7791
7793
  });
7792
- const addEl = (el) => __async(void 0, null, function* () {
7794
+ const addEl = (el) => __async(null, null, function* () {
7793
7795
  const index = lookupEl(el);
7794
7796
  if (index > -1) {
7795
7797
  if (debug)
@@ -7862,7 +7864,7 @@ var CopyHostStyles = ({
7862
7864
  const parentBody = parentDocument.getElementsByTagName("body")[0];
7863
7865
  syncAttributes(parentBody, doc.body);
7864
7866
  Promise.all(
7865
- collectedStyles.map((styleNode, i) => __async(void 0, null, function* () {
7867
+ collectedStyles.map((styleNode, i) => __async(null, null, function* () {
7866
7868
  if (styleNode.nodeName === "LINK") {
7867
7869
  const linkHref = styleNode.href;
7868
7870
  if (hrefs.indexOf(linkHref) > -1) {
@@ -8472,7 +8474,7 @@ function createUsePuck() {
8472
8474
  }
8473
8475
  const result = (0, import_zustand6.useStore)(
8474
8476
  usePuckApi,
8475
- selector != null ? selector : (s) => s
8477
+ selector != null ? selector : ((s) => s)
8476
8478
  );
8477
8479
  return result;
8478
8480
  };
@@ -8511,7 +8513,7 @@ var import_react62 = require("react");
8511
8513
 
8512
8514
  // css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Layout/styles.module.css#css-module
8513
8515
  init_react_import();
8514
- var styles_module_default20 = { "Puck": "_Puck_hv23j_19", "Puck-portal": "_Puck-portal_hv23j_31", "PuckLayout": "_PuckLayout_hv23j_36", "PuckLayout-inner": "_PuckLayout-inner_hv23j_40", "PuckLayout--mounted": "_PuckLayout--mounted_hv23j_73", "PuckLayout--mobilePanelHeightToggle": "_PuckLayout--mobilePanelHeightToggle_hv23j_77", "PuckLayout--leftSideBarVisible": "_PuckLayout--leftSideBarVisible_hv23j_77", "PuckLayout--isExpanded": "_PuckLayout--isExpanded_hv23j_83", "PuckLayout--mobilePanelHeightMinContent": "_PuckLayout--mobilePanelHeightMinContent_hv23j_101", "PuckLayout--rightSideBarVisible": "_PuckLayout--rightSideBarVisible_hv23j_128", "PuckLayout-mounted": "_PuckLayout-mounted_hv23j_147", "PuckLayout-nav": "_PuckLayout-nav_hv23j_188", "PuckLayout-header": "_PuckLayout-header_hv23j_204", "PuckPluginTab": "_PuckPluginTab_hv23j_218", "PuckPluginTab--visible": "_PuckPluginTab--visible_hv23j_224", "PuckPluginTab-body": "_PuckPluginTab-body_hv23j_229" };
8516
+ var styles_module_default20 = { "Puck": "_Puck_lqzmv_19", "Puck-portal": "_Puck-portal_lqzmv_32", "PuckLayout": "_PuckLayout_lqzmv_37", "PuckLayout-inner": "_PuckLayout-inner_lqzmv_41", "PuckLayout--mounted": "_PuckLayout--mounted_lqzmv_74", "PuckLayout--mobilePanelHeightToggle": "_PuckLayout--mobilePanelHeightToggle_lqzmv_78", "PuckLayout--leftSideBarVisible": "_PuckLayout--leftSideBarVisible_lqzmv_78", "PuckLayout--isExpanded": "_PuckLayout--isExpanded_lqzmv_84", "PuckLayout--mobilePanelHeightMinContent": "_PuckLayout--mobilePanelHeightMinContent_lqzmv_102", "PuckLayout--rightSideBarVisible": "_PuckLayout--rightSideBarVisible_lqzmv_129", "PuckLayout-mounted": "_PuckLayout-mounted_lqzmv_148", "PuckLayout-nav": "_PuckLayout-nav_lqzmv_189", "PuckLayout-header": "_PuckLayout-header_lqzmv_205", "PuckPluginTab": "_PuckPluginTab_lqzmv_219", "PuckPluginTab--visible": "_PuckPluginTab--visible_lqzmv_225", "PuckPluginTab-body": "_PuckPluginTab-body_lqzmv_230" };
8515
8517
 
8516
8518
  // lib/use-inject-css.ts
8517
8519
  init_react_import();
@@ -9665,7 +9667,7 @@ var Layout = ({ children }) => {
9665
9667
  dnd,
9666
9668
  initialHistory: _initialHistory,
9667
9669
  plugins,
9668
- height = "100dvh"
9670
+ height
9669
9671
  } = usePropsContext();
9670
9672
  const iframe = (0, import_react62.useMemo)(
9671
9673
  () => __spreadValues({
@@ -9809,92 +9811,85 @@ var Layout = ({ children }) => {
9809
9811
  return (_a = s.state.ui.mobilePanelExpanded) != null ? _a : false;
9810
9812
  }
9811
9813
  );
9812
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
9813
- "div",
9814
- {
9815
- className: `Puck ${getClassName36()}`,
9816
- style: { height },
9817
- id: instanceId,
9818
- children: [
9819
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FrameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9814
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: `Puck ${getClassName36()}`, id: instanceId, children: [
9815
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CustomPuck, { children: children || /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FrameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9816
+ "div",
9817
+ {
9818
+ className: getLayoutClassName({
9819
+ leftSideBarVisible,
9820
+ mounted,
9821
+ rightSideBarVisible: !hasDesktopFieldsPlugin && rightSideBarVisible,
9822
+ isExpanded: mobilePanelExpanded,
9823
+ mobilePanelHeightToggle: mobilePanelHeightMode === "toggle",
9824
+ mobilePanelHeightMinContent: mobilePanelHeightMode === "min-content"
9825
+ }),
9826
+ style: { height },
9827
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
9820
9828
  "div",
9821
9829
  {
9822
- className: getLayoutClassName({
9823
- leftSideBarVisible,
9824
- mounted,
9825
- rightSideBarVisible: !hasDesktopFieldsPlugin && rightSideBarVisible,
9826
- isExpanded: mobilePanelExpanded,
9827
- mobilePanelHeightToggle: mobilePanelHeightMode === "toggle",
9828
- mobilePanelHeightMinContent: mobilePanelHeightMode === "min-content"
9829
- }),
9830
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
9831
- "div",
9832
- {
9833
- className: getLayoutClassName("inner"),
9834
- style: layoutOptions,
9835
- children: [
9836
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Header, {}) }),
9837
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: getLayoutClassName("nav"), children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9838
- Nav,
9839
- {
9840
- items: pluginItems,
9841
- mobileActions: leftSideBarVisible && mobilePanelHeightMode === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9842
- IconButton,
9843
- {
9844
- type: "button",
9845
- title: "maximize",
9846
- onClick: () => {
9847
- setUi({
9848
- mobilePanelExpanded: !mobilePanelExpanded
9849
- });
9850
- },
9851
- children: mobilePanelExpanded ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Minimize2, { size: 21 }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Maximize2, { size: 21 })
9852
- }
9853
- )
9854
- }
9855
- ) }),
9856
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9857
- Sidebar,
9858
- {
9859
- position: "left",
9860
- sidebarRef: leftSidebarRef,
9861
- isVisible: leftSideBarVisible,
9862
- onResize: setLeftWidth,
9863
- onResizeEnd: handleLeftSidebarResizeEnd,
9864
- children: Object.entries(pluginItems).map(
9865
- ([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9866
- PluginTab,
9867
- {
9868
- visible: currentPlugin === id,
9869
- mobileOnly,
9870
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Render2, {})
9871
- },
9872
- id
9873
- )
9874
- )
9875
- }
9876
- ),
9877
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Canvas, {}),
9878
- !hasDesktopFieldsPlugin && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9879
- Sidebar,
9830
+ className: getLayoutClassName("inner"),
9831
+ style: layoutOptions,
9832
+ children: [
9833
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Header, {}) }),
9834
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: getLayoutClassName("nav"), children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9835
+ Nav,
9836
+ {
9837
+ items: pluginItems,
9838
+ mobileActions: leftSideBarVisible && mobilePanelHeightMode === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9839
+ IconButton,
9880
9840
  {
9881
- position: "right",
9882
- sidebarRef: rightSidebarRef,
9883
- isVisible: rightSideBarVisible,
9884
- onResize: setRightWidth,
9885
- onResizeEnd: handleRightSidebarResizeEnd,
9886
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FieldSideBar, {})
9841
+ type: "button",
9842
+ title: "maximize",
9843
+ onClick: () => {
9844
+ setUi({
9845
+ mobilePanelExpanded: !mobilePanelExpanded
9846
+ });
9847
+ },
9848
+ children: mobilePanelExpanded ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Minimize2, { size: 21 }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Maximize2, { size: 21 })
9887
9849
  }
9888
9850
  )
9889
- ]
9890
- }
9891
- )
9851
+ }
9852
+ ) }),
9853
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9854
+ Sidebar,
9855
+ {
9856
+ position: "left",
9857
+ sidebarRef: leftSidebarRef,
9858
+ isVisible: leftSideBarVisible,
9859
+ onResize: setLeftWidth,
9860
+ onResizeEnd: handleLeftSidebarResizeEnd,
9861
+ children: Object.entries(pluginItems).map(
9862
+ ([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9863
+ PluginTab,
9864
+ {
9865
+ visible: currentPlugin === id,
9866
+ mobileOnly,
9867
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Render2, {})
9868
+ },
9869
+ id
9870
+ )
9871
+ )
9872
+ }
9873
+ ),
9874
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Canvas, {}),
9875
+ !hasDesktopFieldsPlugin && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
9876
+ Sidebar,
9877
+ {
9878
+ position: "right",
9879
+ sidebarRef: rightSidebarRef,
9880
+ isVisible: rightSideBarVisible,
9881
+ onResize: setRightWidth,
9882
+ onResizeEnd: handleRightSidebarResizeEnd,
9883
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FieldSideBar, {})
9884
+ }
9885
+ )
9886
+ ]
9892
9887
  }
9893
- ) }) }) }),
9894
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { id: "puck-portal-root", className: getClassName36("portal") })
9895
- ]
9896
- }
9897
- );
9888
+ )
9889
+ }
9890
+ ) }) }) }),
9891
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { id: "puck-portal-root", className: getClassName36("portal") })
9892
+ ] });
9898
9893
  };
9899
9894
 
9900
9895
  // components/Puck/index.tsx
@@ -10272,7 +10267,7 @@ function resolveAllData(_0, _1) {
10272
10267
  return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
10273
10268
  var _a;
10274
10269
  const defaultedData = defaultData(data);
10275
- const resolveNode = (_node) => __async(this, null, function* () {
10270
+ const resolveNode = (_node) => __async(null, null, function* () {
10276
10271
  const node = toComponent(_node);
10277
10272
  onResolveStart == null ? void 0 : onResolveStart(node);
10278
10273
  const resolved = (yield resolveComponentData(
@@ -10293,13 +10288,13 @@ function resolveAllData(_0, _1) {
10293
10288
  onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
10294
10289
  return resolvedDeep;
10295
10290
  });
10296
- const processContent = (content) => __async(this, null, function* () {
10291
+ const processContent = (content) => __async(null, null, function* () {
10297
10292
  return Promise.all(content.map(resolveNode));
10298
10293
  });
10299
- const processZones = () => __async(this, null, function* () {
10294
+ const processZones = () => __async(null, null, function* () {
10300
10295
  var _a2;
10301
10296
  const zones = (_a2 = data.zones) != null ? _a2 : {};
10302
- Object.entries(zones).forEach((_02) => __async(this, [_02], function* ([zoneKey, content]) {
10297
+ Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
10303
10298
  zones[zoneKey] = yield Promise.all(content.map(resolveNode));
10304
10299
  }));
10305
10300
  return zones;
@@ -10309,7 +10304,7 @@ function resolveAllData(_0, _1) {
10309
10304
  content: yield processContent(defaultedData.content),
10310
10305
  zones: yield processZones()
10311
10306
  };
10312
- Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(this, null, function* () {
10307
+ Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
10313
10308
  const content = defaultedData.zones[zoneKey];
10314
10309
  dynamic.zones[zoneKey] = yield processContent(content);
10315
10310
  }), {});
@@ -10331,6 +10326,7 @@ function resolveAllData(_0, _1) {
10331
10326
  Puck,
10332
10327
  Render,
10333
10328
  blocksPlugin,
10329
+ createReducer,
10334
10330
  createUsePuck,
10335
10331
  fieldsPlugin,
10336
10332
  migrate,
@@ -10355,325 +10351,45 @@ classnames/index.js:
10355
10351
  *)
10356
10352
 
10357
10353
  lucide-react/dist/esm/shared/src/utils.js:
10358
- (**
10359
- * @license lucide-react v0.468.0 - ISC
10360
- *
10361
- * This source code is licensed under the ISC license.
10362
- * See the LICENSE file in the root directory of this source tree.
10363
- *)
10364
-
10365
10354
  lucide-react/dist/esm/defaultAttributes.js:
10366
- (**
10367
- * @license lucide-react v0.468.0 - ISC
10368
- *
10369
- * This source code is licensed under the ISC license.
10370
- * See the LICENSE file in the root directory of this source tree.
10371
- *)
10372
-
10373
10355
  lucide-react/dist/esm/Icon.js:
10374
- (**
10375
- * @license lucide-react v0.468.0 - ISC
10376
- *
10377
- * This source code is licensed under the ISC license.
10378
- * See the LICENSE file in the root directory of this source tree.
10379
- *)
10380
-
10381
10356
  lucide-react/dist/esm/createLucideIcon.js:
10382
- (**
10383
- * @license lucide-react v0.468.0 - ISC
10384
- *
10385
- * This source code is licensed under the ISC license.
10386
- * See the LICENSE file in the root directory of this source tree.
10387
- *)
10388
-
10389
10357
  lucide-react/dist/esm/icons/chevron-down.js:
10390
- (**
10391
- * @license lucide-react v0.468.0 - ISC
10392
- *
10393
- * This source code is licensed under the ISC license.
10394
- * See the LICENSE file in the root directory of this source tree.
10395
- *)
10396
-
10397
10358
  lucide-react/dist/esm/icons/chevron-right.js:
10398
- (**
10399
- * @license lucide-react v0.468.0 - ISC
10400
- *
10401
- * This source code is licensed under the ISC license.
10402
- * See the LICENSE file in the root directory of this source tree.
10403
- *)
10404
-
10405
10359
  lucide-react/dist/esm/icons/chevron-up.js:
10406
- (**
10407
- * @license lucide-react v0.468.0 - ISC
10408
- *
10409
- * This source code is licensed under the ISC license.
10410
- * See the LICENSE file in the root directory of this source tree.
10411
- *)
10412
-
10413
10360
  lucide-react/dist/esm/icons/circle-check-big.js:
10414
- (**
10415
- * @license lucide-react v0.468.0 - ISC
10416
- *
10417
- * This source code is licensed under the ISC license.
10418
- * See the LICENSE file in the root directory of this source tree.
10419
- *)
10420
-
10421
10361
  lucide-react/dist/esm/icons/copy.js:
10422
- (**
10423
- * @license lucide-react v0.468.0 - ISC
10424
- *
10425
- * This source code is licensed under the ISC license.
10426
- * See the LICENSE file in the root directory of this source tree.
10427
- *)
10428
-
10429
10362
  lucide-react/dist/esm/icons/corner-left-up.js:
10430
- (**
10431
- * @license lucide-react v0.468.0 - ISC
10432
- *
10433
- * This source code is licensed under the ISC license.
10434
- * See the LICENSE file in the root directory of this source tree.
10435
- *)
10436
-
10437
10363
  lucide-react/dist/esm/icons/ellipsis-vertical.js:
10438
- (**
10439
- * @license lucide-react v0.468.0 - ISC
10440
- *
10441
- * This source code is licensed under the ISC license.
10442
- * See the LICENSE file in the root directory of this source tree.
10443
- *)
10444
-
10445
10364
  lucide-react/dist/esm/icons/expand.js:
10446
- (**
10447
- * @license lucide-react v0.468.0 - ISC
10448
- *
10449
- * This source code is licensed under the ISC license.
10450
- * See the LICENSE file in the root directory of this source tree.
10451
- *)
10452
-
10453
10365
  lucide-react/dist/esm/icons/globe.js:
10454
- (**
10455
- * @license lucide-react v0.468.0 - ISC
10456
- *
10457
- * This source code is licensed under the ISC license.
10458
- * See the LICENSE file in the root directory of this source tree.
10459
- *)
10460
-
10461
10366
  lucide-react/dist/esm/icons/hammer.js:
10462
- (**
10463
- * @license lucide-react v0.468.0 - ISC
10464
- *
10465
- * This source code is licensed under the ISC license.
10466
- * See the LICENSE file in the root directory of this source tree.
10467
- *)
10468
-
10469
10367
  lucide-react/dist/esm/icons/hash.js:
10470
- (**
10471
- * @license lucide-react v0.468.0 - ISC
10472
- *
10473
- * This source code is licensed under the ISC license.
10474
- * See the LICENSE file in the root directory of this source tree.
10475
- *)
10476
-
10477
10368
  lucide-react/dist/esm/icons/layers.js:
10478
- (**
10479
- * @license lucide-react v0.468.0 - ISC
10480
- *
10481
- * This source code is licensed under the ISC license.
10482
- * See the LICENSE file in the root directory of this source tree.
10483
- *)
10484
-
10485
10369
  lucide-react/dist/esm/icons/layout-grid.js:
10486
- (**
10487
- * @license lucide-react v0.468.0 - ISC
10488
- *
10489
- * This source code is licensed under the ISC license.
10490
- * See the LICENSE file in the root directory of this source tree.
10491
- *)
10492
-
10493
10370
  lucide-react/dist/esm/icons/link.js:
10494
- (**
10495
- * @license lucide-react v0.468.0 - ISC
10496
- *
10497
- * This source code is licensed under the ISC license.
10498
- * See the LICENSE file in the root directory of this source tree.
10499
- *)
10500
-
10501
10371
  lucide-react/dist/esm/icons/list.js:
10502
- (**
10503
- * @license lucide-react v0.468.0 - ISC
10504
- *
10505
- * This source code is licensed under the ISC license.
10506
- * See the LICENSE file in the root directory of this source tree.
10507
- *)
10508
-
10509
10372
  lucide-react/dist/esm/icons/lock-open.js:
10510
- (**
10511
- * @license lucide-react v0.468.0 - ISC
10512
- *
10513
- * This source code is licensed under the ISC license.
10514
- * See the LICENSE file in the root directory of this source tree.
10515
- *)
10516
-
10517
10373
  lucide-react/dist/esm/icons/lock.js:
10518
- (**
10519
- * @license lucide-react v0.468.0 - ISC
10520
- *
10521
- * This source code is licensed under the ISC license.
10522
- * See the LICENSE file in the root directory of this source tree.
10523
- *)
10524
-
10525
10374
  lucide-react/dist/esm/icons/maximize-2.js:
10526
- (**
10527
- * @license lucide-react v0.468.0 - ISC
10528
- *
10529
- * This source code is licensed under the ISC license.
10530
- * See the LICENSE file in the root directory of this source tree.
10531
- *)
10532
-
10533
10375
  lucide-react/dist/esm/icons/minimize-2.js:
10534
- (**
10535
- * @license lucide-react v0.468.0 - ISC
10536
- *
10537
- * This source code is licensed under the ISC license.
10538
- * See the LICENSE file in the root directory of this source tree.
10539
- *)
10540
-
10541
10376
  lucide-react/dist/esm/icons/monitor.js:
10542
- (**
10543
- * @license lucide-react v0.468.0 - ISC
10544
- *
10545
- * This source code is licensed under the ISC license.
10546
- * See the LICENSE file in the root directory of this source tree.
10547
- *)
10548
-
10549
10377
  lucide-react/dist/esm/icons/panel-left.js:
10550
- (**
10551
- * @license lucide-react v0.468.0 - ISC
10552
- *
10553
- * This source code is licensed under the ISC license.
10554
- * See the LICENSE file in the root directory of this source tree.
10555
- *)
10556
-
10557
10378
  lucide-react/dist/esm/icons/panel-right.js:
10558
- (**
10559
- * @license lucide-react v0.468.0 - ISC
10560
- *
10561
- * This source code is licensed under the ISC license.
10562
- * See the LICENSE file in the root directory of this source tree.
10563
- *)
10564
-
10565
10379
  lucide-react/dist/esm/icons/plus.js:
10566
- (**
10567
- * @license lucide-react v0.468.0 - ISC
10568
- *
10569
- * This source code is licensed under the ISC license.
10570
- * See the LICENSE file in the root directory of this source tree.
10571
- *)
10572
-
10573
10380
  lucide-react/dist/esm/icons/rectangle-ellipsis.js:
10574
- (**
10575
- * @license lucide-react v0.468.0 - ISC
10576
- *
10577
- * This source code is licensed under the ISC license.
10578
- * See the LICENSE file in the root directory of this source tree.
10579
- *)
10580
-
10581
10381
  lucide-react/dist/esm/icons/redo-2.js:
10582
- (**
10583
- * @license lucide-react v0.468.0 - ISC
10584
- *
10585
- * This source code is licensed under the ISC license.
10586
- * See the LICENSE file in the root directory of this source tree.
10587
- *)
10588
-
10589
10382
  lucide-react/dist/esm/icons/search.js:
10590
- (**
10591
- * @license lucide-react v0.468.0 - ISC
10592
- *
10593
- * This source code is licensed under the ISC license.
10594
- * See the LICENSE file in the root directory of this source tree.
10595
- *)
10596
-
10597
10383
  lucide-react/dist/esm/icons/sliders-horizontal.js:
10598
- (**
10599
- * @license lucide-react v0.468.0 - ISC
10600
- *
10601
- * This source code is licensed under the ISC license.
10602
- * See the LICENSE file in the root directory of this source tree.
10603
- *)
10604
-
10605
10384
  lucide-react/dist/esm/icons/smartphone.js:
10606
- (**
10607
- * @license lucide-react v0.468.0 - ISC
10608
- *
10609
- * This source code is licensed under the ISC license.
10610
- * See the LICENSE file in the root directory of this source tree.
10611
- *)
10612
-
10613
10385
  lucide-react/dist/esm/icons/tablet.js:
10614
- (**
10615
- * @license lucide-react v0.468.0 - ISC
10616
- *
10617
- * This source code is licensed under the ISC license.
10618
- * See the LICENSE file in the root directory of this source tree.
10619
- *)
10620
-
10621
10386
  lucide-react/dist/esm/icons/toy-brick.js:
10622
- (**
10623
- * @license lucide-react v0.468.0 - ISC
10624
- *
10625
- * This source code is licensed under the ISC license.
10626
- * See the LICENSE file in the root directory of this source tree.
10627
- *)
10628
-
10629
10387
  lucide-react/dist/esm/icons/trash.js:
10630
- (**
10631
- * @license lucide-react v0.468.0 - ISC
10632
- *
10633
- * This source code is licensed under the ISC license.
10634
- * See the LICENSE file in the root directory of this source tree.
10635
- *)
10636
-
10637
10388
  lucide-react/dist/esm/icons/type.js:
10638
- (**
10639
- * @license lucide-react v0.468.0 - ISC
10640
- *
10641
- * This source code is licensed under the ISC license.
10642
- * See the LICENSE file in the root directory of this source tree.
10643
- *)
10644
-
10645
10389
  lucide-react/dist/esm/icons/undo-2.js:
10646
- (**
10647
- * @license lucide-react v0.468.0 - ISC
10648
- *
10649
- * This source code is licensed under the ISC license.
10650
- * See the LICENSE file in the root directory of this source tree.
10651
- *)
10652
-
10653
10390
  lucide-react/dist/esm/icons/x.js:
10654
- (**
10655
- * @license lucide-react v0.468.0 - ISC
10656
- *
10657
- * This source code is licensed under the ISC license.
10658
- * See the LICENSE file in the root directory of this source tree.
10659
- *)
10660
-
10661
10391
  lucide-react/dist/esm/icons/zoom-in.js:
10662
- (**
10663
- * @license lucide-react v0.468.0 - ISC
10664
- *
10665
- * This source code is licensed under the ISC license.
10666
- * See the LICENSE file in the root directory of this source tree.
10667
- *)
10668
-
10669
10392
  lucide-react/dist/esm/icons/zoom-out.js:
10670
- (**
10671
- * @license lucide-react v0.468.0 - ISC
10672
- *
10673
- * This source code is licensed under the ISC license.
10674
- * See the LICENSE file in the root directory of this source tree.
10675
- *)
10676
-
10677
10393
  lucide-react/dist/esm/lucide-react.js:
10678
10394
  (**
10679
10395
  * @license lucide-react v0.468.0 - ISC