@measured/puck 0.20.0-canary.6cf56a8a → 0.20.0-canary.6dace1cf

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.
@@ -392,7 +392,7 @@ import {
392
392
  useCallback as useCallback4,
393
393
  useContext as useContext3,
394
394
  useEffect as useEffect10,
395
- useMemo as useMemo5,
395
+ useMemo as useMemo3,
396
396
  useState as useState8
397
397
  } from "react";
398
398
 
@@ -3196,20 +3196,6 @@ var ExternalField = ({
3196
3196
 
3197
3197
  // components/AutoField/fields/RadioField/index.tsx
3198
3198
  init_react_import();
3199
- import { useMemo as useMemo3 } from "react";
3200
-
3201
- // lib/safe-json-parse.ts
3202
- init_react_import();
3203
- var safeJsonParse = (str) => {
3204
- try {
3205
- const jsonValue = JSON.parse(str);
3206
- return jsonValue;
3207
- } catch (e) {
3208
- return str;
3209
- }
3210
- };
3211
-
3212
- // components/AutoField/fields/RadioField/index.tsx
3213
3199
  import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
3214
3200
  var getClassName11 = get_class_name_factory_default("Input", styles_module_default3);
3215
3201
  var RadioField = ({
@@ -3223,10 +3209,6 @@ var RadioField = ({
3223
3209
  labelIcon,
3224
3210
  Label: Label2
3225
3211
  }) => {
3226
- const flatOptions = useMemo3(
3227
- () => field.type === "radio" ? field.options.map(({ value: value2 }) => value2) : [],
3228
- [field]
3229
- );
3230
3212
  if (field.type !== "radio" || !field.options) {
3231
3213
  return null;
3232
3214
  }
@@ -3237,43 +3219,39 @@ var RadioField = ({
3237
3219
  label: label || name,
3238
3220
  readOnly,
3239
3221
  el: "div",
3240
- children: /* @__PURE__ */ jsx14("div", { className: getClassName11("radioGroupItems"), id, children: field.options.map((option) => /* @__PURE__ */ jsxs7(
3241
- "label",
3242
- {
3243
- className: getClassName11("radio"),
3244
- children: [
3245
- /* @__PURE__ */ jsx14(
3246
- "input",
3247
- {
3248
- type: "radio",
3249
- className: getClassName11("radioInput"),
3250
- value: option.value,
3251
- name,
3252
- onChange: (e) => {
3253
- var _a;
3254
- const jsonValue = (_a = safeJsonParse(e.target.value)) != null ? _a : e.target.value;
3255
- if (flatOptions.indexOf(jsonValue) > -1) {
3256
- onChange(jsonValue);
3257
- } else {
3258
- onChange(e.target.value);
3259
- }
3260
- },
3261
- disabled: readOnly,
3262
- checked: value === option.value
3263
- }
3264
- ),
3265
- /* @__PURE__ */ jsx14("div", { className: getClassName11("radioInner"), children: option.label || option.value })
3266
- ]
3267
- },
3268
- option.label + option.value
3269
- )) })
3222
+ children: /* @__PURE__ */ jsx14("div", { className: getClassName11("radioGroupItems"), id, children: field.options.map((option) => {
3223
+ var _a;
3224
+ return /* @__PURE__ */ jsxs7(
3225
+ "label",
3226
+ {
3227
+ className: getClassName11("radio"),
3228
+ children: [
3229
+ /* @__PURE__ */ jsx14(
3230
+ "input",
3231
+ {
3232
+ type: "radio",
3233
+ className: getClassName11("radioInput"),
3234
+ value: JSON.stringify({ value: option.value }),
3235
+ name,
3236
+ onChange: (e) => {
3237
+ onChange(JSON.parse(e.target.value).value);
3238
+ },
3239
+ disabled: readOnly,
3240
+ checked: value === option.value
3241
+ }
3242
+ ),
3243
+ /* @__PURE__ */ jsx14("div", { className: getClassName11("radioInner"), children: option.label || ((_a = option.value) == null ? void 0 : _a.toString()) })
3244
+ ]
3245
+ },
3246
+ option.label + option.value
3247
+ );
3248
+ }) })
3270
3249
  }
3271
3250
  );
3272
3251
  };
3273
3252
 
3274
3253
  // components/AutoField/fields/SelectField/index.tsx
3275
3254
  init_react_import();
3276
- import { useMemo as useMemo4 } from "react";
3277
3255
  import { jsx as jsx15 } from "react/jsx-runtime";
3278
3256
  var getClassName12 = get_class_name_factory_default("Input", styles_module_default3);
3279
3257
  var SelectField = ({
@@ -3287,10 +3265,6 @@ var SelectField = ({
3287
3265
  readOnly,
3288
3266
  id
3289
3267
  }) => {
3290
- const flatOptions = useMemo4(
3291
- () => field.type === "select" ? field.options.map(({ value: value2 }) => value2) : [],
3292
- [field]
3293
- );
3294
3268
  if (field.type !== "select" || !field.options) {
3295
3269
  return null;
3296
3270
  }
@@ -3308,22 +3282,16 @@ var SelectField = ({
3308
3282
  className: getClassName12("input"),
3309
3283
  disabled: readOnly,
3310
3284
  onChange: (e) => {
3311
- var _a;
3312
- const jsonValue = (_a = safeJsonParse(e.target.value)) != null ? _a : e.target.value;
3313
- if (flatOptions.indexOf(jsonValue) > -1) {
3314
- onChange(jsonValue);
3315
- } else {
3316
- onChange(e.target.value);
3317
- }
3285
+ onChange(JSON.parse(e.target.value).value);
3318
3286
  },
3319
- value,
3287
+ value: JSON.stringify({ value }),
3320
3288
  children: field.options.map((option) => /* @__PURE__ */ jsx15(
3321
3289
  "option",
3322
3290
  {
3323
3291
  label: option.label,
3324
- value: option.value
3292
+ value: JSON.stringify({ value: option.value })
3325
3293
  },
3326
- option.label + option.value
3294
+ option.label + JSON.stringify(option.value)
3327
3295
  ))
3328
3296
  }
3329
3297
  )
@@ -3486,7 +3454,7 @@ var FieldLabelInternal = ({
3486
3454
  readOnly
3487
3455
  }) => {
3488
3456
  const overrides = useAppStore((s) => s.overrides);
3489
- const Wrapper = useMemo5(
3457
+ const Wrapper = useMemo3(
3490
3458
  () => overrides.fieldLabel || FieldLabel,
3491
3459
  [overrides]
3492
3460
  );
@@ -3641,7 +3609,7 @@ function AutoFieldPrivate(props) {
3641
3609
  return /* @__PURE__ */ jsx18(AutoFieldInternal, __spreadValues(__spreadValues({}, props), localProps));
3642
3610
  }
3643
3611
  function AutoField(props) {
3644
- const DefaultLabel = useMemo5(() => {
3612
+ const DefaultLabel = useMemo3(() => {
3645
3613
  const DefaultLabel2 = (labelProps) => /* @__PURE__ */ jsx18(
3646
3614
  "div",
3647
3615
  __spreadProps(__spreadValues({}, labelProps), {
@@ -3667,7 +3635,7 @@ import {
3667
3635
  useCallback as useCallback11,
3668
3636
  useContext as useContext8,
3669
3637
  useEffect as useEffect17,
3670
- useMemo as useMemo10,
3638
+ useMemo as useMemo8,
3671
3639
  useRef as useRef5
3672
3640
  } from "react";
3673
3641
 
@@ -3677,7 +3645,7 @@ import {
3677
3645
  useCallback as useCallback7,
3678
3646
  useContext as useContext5,
3679
3647
  useEffect as useEffect12,
3680
- useMemo as useMemo7,
3648
+ useMemo as useMemo5,
3681
3649
  useRef as useRef2,
3682
3650
  useState as useState10,
3683
3651
  useTransition
@@ -3714,7 +3682,7 @@ init_react_import();
3714
3682
  import {
3715
3683
  createContext as createContext3,
3716
3684
  useCallback as useCallback5,
3717
- useMemo as useMemo6
3685
+ useMemo as useMemo4
3718
3686
  } from "react";
3719
3687
  import { createStore as createStore2 } from "zustand";
3720
3688
  import { Fragment as Fragment5, jsx as jsx19 } from "react/jsx-runtime";
@@ -3751,7 +3719,7 @@ var DropZoneProvider = ({
3751
3719
  },
3752
3720
  [dispatch]
3753
3721
  );
3754
- const memoValue = useMemo6(
3722
+ const memoValue = useMemo4(
3755
3723
  () => __spreadValues({
3756
3724
  registerZone
3757
3725
  }, value),
@@ -3904,7 +3872,7 @@ var DraggableComponent = ({
3904
3872
  );
3905
3873
  const zoneStore = useContext5(ZoneStoreContext);
3906
3874
  const [dragAxis, setDragAxis] = useState10(userDragAxis || autoDragAxis);
3907
- const dynamicCollisionDetector = useMemo7(
3875
+ const dynamicCollisionDetector = useMemo5(
3908
3876
  () => createDynamicCollisionDetector(dragAxis),
3909
3877
  [dragAxis]
3910
3878
  );
@@ -4032,7 +4000,7 @@ var DraggableComponent = ({
4032
4000
  });
4033
4001
  };
4034
4002
  }, [id, zoneCompound, index, componentType, sync]);
4035
- const CustomActionBar = useMemo7(
4003
+ const CustomActionBar = useMemo5(
4036
4004
  () => overrides.actionBar || DefaultActionBar,
4037
4005
  [overrides.actionBar]
4038
4006
  );
@@ -4206,11 +4174,11 @@ var DraggableComponent = ({
4206
4174
  }
4207
4175
  setDragAxis(autoDragAxis);
4208
4176
  }, [ref, userDragAxis, autoDragAxis]);
4209
- const parentAction = useMemo7(
4177
+ const parentAction = useMemo5(
4210
4178
  () => (ctx == null ? void 0 : ctx.areaId) && (ctx == null ? void 0 : ctx.areaId) !== "root" && /* @__PURE__ */ jsx20(ActionBar.Action, { onClick: onSelectParent, label: "Select parent", children: /* @__PURE__ */ jsx20(CornerLeftUp, { size: 16 }) }),
4211
4179
  [ctx == null ? void 0 : ctx.areaId]
4212
4180
  );
4213
- const nextContextValue = useMemo7(
4181
+ const nextContextValue = useMemo5(
4214
4182
  () => __spreadProps(__spreadValues({}, ctx), {
4215
4183
  areaId: id,
4216
4184
  zoneCompound,
@@ -4303,7 +4271,7 @@ init_react_import();
4303
4271
  var styles_module_default12 = { "Drawer": "_Drawer_pl7z0_1", "Drawer-draggable": "_Drawer-draggable_pl7z0_8", "Drawer-draggableBg": "_Drawer-draggableBg_pl7z0_12", "DrawerItem-draggable": "_DrawerItem-draggable_pl7z0_22", "DrawerItem--disabled": "_DrawerItem--disabled_pl7z0_35", "DrawerItem": "_DrawerItem_pl7z0_22", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_pl7z0_45", "DrawerItem-name": "_DrawerItem-name_pl7z0_63" };
4304
4272
 
4305
4273
  // components/Drawer/index.tsx
4306
- import { useMemo as useMemo9, useState as useState12 } from "react";
4274
+ import { useMemo as useMemo7, useState as useState12 } from "react";
4307
4275
 
4308
4276
  // components/DragDropContext/index.tsx
4309
4277
  init_react_import();
@@ -4313,7 +4281,7 @@ import {
4313
4281
  useCallback as useCallback8,
4314
4282
  useContext as useContext6,
4315
4283
  useEffect as useEffect13,
4316
- useMemo as useMemo8,
4284
+ useMemo as useMemo6,
4317
4285
  useRef as useRef3,
4318
4286
  useState as useState11
4319
4287
  } from "react";
@@ -4812,7 +4780,7 @@ var DragDropContextClient = ({
4812
4780
  const [dragListeners, setDragListeners] = useState11({});
4813
4781
  const dragMode = useRef3(null);
4814
4782
  const initialSelector = useRef3(void 0);
4815
- const nextContextValue = useMemo8(
4783
+ const nextContextValue = useMemo6(
4816
4784
  () => ({
4817
4785
  mode: "edit",
4818
4786
  areaId: "root",
@@ -5072,7 +5040,7 @@ var DrawerItemInner = ({
5072
5040
  dragRef,
5073
5041
  isDragDisabled
5074
5042
  }) => {
5075
- const CustomInner = useMemo9(
5043
+ const CustomInner = useMemo7(
5076
5044
  () => children || (({ children: children2 }) => /* @__PURE__ */ jsx22("div", { className: getClassNameItem2("default"), children: children2 })),
5077
5045
  [children]
5078
5046
  );
@@ -5455,7 +5423,7 @@ var DropZoneChild = ({
5455
5423
  })
5456
5424
  );
5457
5425
  const appStore = useAppStoreApi();
5458
- const item = useMemo10(() => {
5426
+ const item = useMemo8(() => {
5459
5427
  if (nodeProps) {
5460
5428
  const expanded = expandNode({
5461
5429
  type: nodeType,
@@ -5477,7 +5445,7 @@ var DropZoneChild = ({
5477
5445
  const componentConfig = useAppStore(
5478
5446
  (s) => (item == null ? void 0 : item.type) ? s.config.components[item.type] : null
5479
5447
  );
5480
- const puckProps = useMemo10(
5448
+ const puckProps = useMemo8(
5481
5449
  () => ({
5482
5450
  renderDropZone: DropZoneEditPure,
5483
5451
  isEditing: true,
@@ -5500,7 +5468,7 @@ var DropZoneChild = ({
5500
5468
  }
5501
5469
  );
5502
5470
  let label = (_b = (_a = componentConfig == null ? void 0 : componentConfig.label) != null ? _a : item == null ? void 0 : item.type.toString()) != null ? _b : "Component";
5503
- const renderPreview = useMemo10(
5471
+ const renderPreview = useMemo8(
5504
5472
  () => function Preview3() {
5505
5473
  if (item && "element" in item && item.element) {
5506
5474
  return (
@@ -5512,7 +5480,7 @@ var DropZoneChild = ({
5512
5480
  },
5513
5481
  [componentId, label, overrides]
5514
5482
  );
5515
- const defaultsProps = useMemo10(
5483
+ const defaultsProps = useMemo8(
5516
5484
  () => __spreadProps(__spreadValues(__spreadValues({}, componentConfig == null ? void 0 : componentConfig.defaultProps), item == null ? void 0 : item.props), {
5517
5485
  puck: puckProps,
5518
5486
  editMode: true
@@ -5520,7 +5488,7 @@ var DropZoneChild = ({
5520
5488
  }),
5521
5489
  [componentConfig == null ? void 0 : componentConfig.defaultProps, item == null ? void 0 : item.props, puckProps]
5522
5490
  );
5523
- const defaultedNode = useMemo10(
5491
+ const defaultedNode = useMemo8(
5524
5492
  () => {
5525
5493
  var _a2;
5526
5494
  return { type: (_a2 = item == null ? void 0 : item.type) != null ? _a2 : nodeType, props: defaultsProps };
@@ -5636,7 +5604,7 @@ var DropZoneEdit = forwardRef3(
5636
5604
  }
5637
5605
  }
5638
5606
  }, [zoneType]);
5639
- const contentIds = useMemo10(() => {
5607
+ const contentIds = useMemo8(() => {
5640
5608
  return zoneContentIds || [];
5641
5609
  }, [zoneContentIds]);
5642
5610
  const ref = useRef5(null);
@@ -5768,7 +5736,7 @@ var DropZoneRenderItem = ({
5768
5736
  }) => {
5769
5737
  const Component = config.components[item.type];
5770
5738
  const props = useSlots(config, item, (slotProps) => /* @__PURE__ */ jsx24(SlotRenderPure, __spreadProps(__spreadValues({}, slotProps), { config, metadata })));
5771
- const nextContextValue = useMemo10(
5739
+ const nextContextValue = useMemo8(
5772
5740
  () => ({
5773
5741
  areaId: props.id,
5774
5742
  depth: 1
@@ -5835,7 +5803,7 @@ var DropZone = forwardRef3(
5835
5803
  );
5836
5804
 
5837
5805
  // components/Render/index.tsx
5838
- import React3, { useMemo as useMemo11 } from "react";
5806
+ import React3, { useMemo as useMemo9 } from "react";
5839
5807
  import { jsx as jsx25 } from "react/jsx-runtime";
5840
5808
  var renderContext = React3.createContext({
5841
5809
  config: { components: {} },
@@ -5870,7 +5838,7 @@ function Render({
5870
5838
  { type: "root", props: pageProps },
5871
5839
  (props) => /* @__PURE__ */ jsx25(SlotRender, __spreadProps(__spreadValues({}, props), { config, metadata }))
5872
5840
  );
5873
- const nextContextValue = useMemo11(
5841
+ const nextContextValue = useMemo9(
5874
5842
  () => ({
5875
5843
  mode: "render",
5876
5844
  depth: 0
@@ -5983,7 +5951,7 @@ import {
5983
5951
  useCallback as useCallback18,
5984
5952
  useContext as useContext12,
5985
5953
  useEffect as useEffect25,
5986
- useMemo as useMemo21,
5954
+ useMemo as useMemo19,
5987
5955
  useRef as useRef8,
5988
5956
  useState as useState23
5989
5957
  } from "react";
@@ -5997,7 +5965,7 @@ var styles_module_default13 = { "SidebarSection": "_SidebarSection_8boj8_1", "Si
5997
5965
 
5998
5966
  // lib/use-breadcrumbs.ts
5999
5967
  init_react_import();
6000
- import { useMemo as useMemo12 } from "react";
5968
+ import { useMemo as useMemo10 } from "react";
6001
5969
  var useBreadcrumbs = (renderCount) => {
6002
5970
  const selectedId = useAppStore((s) => {
6003
5971
  var _a;
@@ -6009,7 +5977,7 @@ var useBreadcrumbs = (renderCount) => {
6009
5977
  return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
6010
5978
  });
6011
5979
  const appStore = useAppStoreApi();
6012
- return useMemo12(() => {
5980
+ return useMemo10(() => {
6013
5981
  const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
6014
5982
  var _a, _b, _c;
6015
5983
  const [componentId] = zoneCompound.split(":");
@@ -6093,7 +6061,7 @@ init_react_import();
6093
6061
  var styles_module_default15 = { "PuckFields": "_PuckFields_10bh7_1", "PuckFields--isLoading": "_PuckFields--isLoading_10bh7_6", "PuckFields-loadingOverlay": "_PuckFields-loadingOverlay_10bh7_10", "PuckFields-loadingOverlayInner": "_PuckFields-loadingOverlayInner_10bh7_25", "PuckFields-field": "_PuckFields-field_10bh7_32", "PuckFields--wrapFields": "_PuckFields--wrapFields_10bh7_36" };
6094
6062
 
6095
6063
  // components/Puck/components/Fields/index.tsx
6096
- import { memo as memo2, useCallback as useCallback12, useMemo as useMemo13 } from "react";
6064
+ import { memo as memo2, useCallback as useCallback12, useMemo as useMemo11 } from "react";
6097
6065
  import { useShallow as useShallow5 } from "zustand/react/shallow";
6098
6066
  import { Fragment as Fragment7, jsx as jsx27, jsxs as jsxs13 } from "react/jsx-runtime";
6099
6067
  var getClassName20 = get_class_name_factory_default("PuckFields", styles_module_default15);
@@ -6209,7 +6177,7 @@ var FieldsInternal = ({ wrapFields = true }) => {
6209
6177
  })
6210
6178
  );
6211
6179
  const isLoading = fieldsLoading || componentResolving;
6212
- const Wrapper = useMemo13(() => overrides.fields || DefaultFields, [overrides]);
6180
+ const Wrapper = useMemo11(() => overrides.fields || DefaultFields, [overrides]);
6213
6181
  return /* @__PURE__ */ jsxs13(
6214
6182
  "form",
6215
6183
  {
@@ -6374,18 +6342,18 @@ var useComponentList = () => {
6374
6342
  };
6375
6343
 
6376
6344
  // components/Puck/components/Components/index.tsx
6377
- import { useMemo as useMemo14 } from "react";
6345
+ import { useMemo as useMemo12 } from "react";
6378
6346
  import { jsx as jsx30 } from "react/jsx-runtime";
6379
6347
  var Components = () => {
6380
6348
  const overrides = useAppStore((s) => s.overrides);
6381
6349
  const componentList = useComponentList();
6382
- const Wrapper = useMemo14(() => overrides.components || "div", [overrides]);
6350
+ const Wrapper = useMemo12(() => overrides.components || "div", [overrides]);
6383
6351
  return /* @__PURE__ */ jsx30(Wrapper, { children: componentList ? componentList : /* @__PURE__ */ jsx30(ComponentList, { id: "all" }) });
6384
6352
  };
6385
6353
 
6386
6354
  // components/Puck/components/Preview/index.tsx
6387
6355
  init_react_import();
6388
- import { useCallback as useCallback13, useEffect as useEffect21, useRef as useRef6, useMemo as useMemo15 } from "react";
6356
+ import { useCallback as useCallback13, useEffect as useEffect21, useRef as useRef6, useMemo as useMemo13 } from "react";
6389
6357
 
6390
6358
  // components/AutoFrame/index.tsx
6391
6359
  init_react_import();
@@ -6747,7 +6715,7 @@ var Preview2 = ({ id = "puck-preview" }) => {
6747
6715
  },
6748
6716
  [config]
6749
6717
  );
6750
- const Frame = useMemo15(() => overrides.iframe, [overrides]);
6718
+ const Frame = useMemo13(() => overrides.iframe, [overrides]);
6751
6719
  const rootProps = root.props || root;
6752
6720
  const ref = useRef6(null);
6753
6721
  useBubbleIframeEvents(ref);
@@ -7016,7 +6984,7 @@ var LayerTree = ({
7016
6984
  };
7017
6985
 
7018
6986
  // components/Puck/components/Outline/index.tsx
7019
- import { useMemo as useMemo16 } from "react";
6987
+ import { useMemo as useMemo14 } from "react";
7020
6988
 
7021
6989
  // lib/data/find-zones-for-area.ts
7022
6990
  init_react_import();
@@ -7034,7 +7002,7 @@ var Outline = () => {
7034
7002
  const rootZones = useAppStore(
7035
7003
  useShallow7((s) => findZonesForArea(s.state, "root"))
7036
7004
  );
7037
- const Wrapper = useMemo16(() => outlineOverride || "div", [outlineOverride]);
7005
+ const Wrapper = useMemo14(() => outlineOverride || "div", [outlineOverride]);
7038
7006
  return /* @__PURE__ */ jsx34(Wrapper, { children: rootZones.map((zoneCompound) => /* @__PURE__ */ jsx34(
7039
7007
  LayerTree,
7040
7008
  {
@@ -7171,14 +7139,14 @@ var getBox = function getBox2(el) {
7171
7139
  import {
7172
7140
  useCallback as useCallback15,
7173
7141
  useEffect as useEffect23,
7174
- useMemo as useMemo18,
7142
+ useMemo as useMemo16,
7175
7143
  useRef as useRef7,
7176
7144
  useState as useState20
7177
7145
  } from "react";
7178
7146
 
7179
7147
  // components/ViewportControls/index.tsx
7180
7148
  init_react_import();
7181
- import { useEffect as useEffect22, useMemo as useMemo17, useState as useState19 } from "react";
7149
+ import { useEffect as useEffect22, useMemo as useMemo15, useState as useState19 } from "react";
7182
7150
 
7183
7151
  // css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
7184
7152
  init_react_import();
@@ -7239,7 +7207,7 @@ var ViewportControls = ({
7239
7207
  const defaultsContainAutoZoom = defaultZoomOptions.find(
7240
7208
  (option) => option.value === autoZoom
7241
7209
  );
7242
- const zoomOptions = useMemo17(
7210
+ const zoomOptions = useMemo15(
7243
7211
  () => [
7244
7212
  ...defaultZoomOptions,
7245
7213
  ...defaultsContainAutoZoom ? [] : [
@@ -7390,11 +7358,11 @@ var Canvas = () => {
7390
7358
  );
7391
7359
  const frameRef = useRef7(null);
7392
7360
  const [showTransition, setShowTransition] = useState20(false);
7393
- const defaultRender = useMemo18(() => {
7361
+ const defaultRender = useMemo16(() => {
7394
7362
  const PuckDefault = ({ children }) => /* @__PURE__ */ jsx36(Fragment11, { children });
7395
7363
  return PuckDefault;
7396
7364
  }, []);
7397
- const CustomPreview = useMemo18(
7365
+ const CustomPreview = useMemo16(
7398
7366
  () => overrides.preview || defaultRender,
7399
7367
  [overrides]
7400
7368
  );
@@ -7527,7 +7495,7 @@ var Canvas = () => {
7527
7495
 
7528
7496
  // lib/use-loaded-overrides.ts
7529
7497
  init_react_import();
7530
- import { useMemo as useMemo19 } from "react";
7498
+ import { useMemo as useMemo17 } from "react";
7531
7499
 
7532
7500
  // lib/load-overrides.ts
7533
7501
  init_react_import();
@@ -7566,7 +7534,7 @@ var useLoadedOverrides = ({
7566
7534
  overrides,
7567
7535
  plugins
7568
7536
  }) => {
7569
- return useMemo19(() => {
7537
+ return useMemo17(() => {
7570
7538
  return loadOverrides({ overrides, plugins });
7571
7539
  }, [plugins, overrides]);
7572
7540
  };
@@ -7626,7 +7594,7 @@ import fdeq from "fast-deep-equal";
7626
7594
 
7627
7595
  // components/Puck/components/Header/index.tsx
7628
7596
  init_react_import();
7629
- import { memo as memo3, useCallback as useCallback17, useMemo as useMemo20, useState as useState22 } from "react";
7597
+ import { memo as memo3, useCallback as useCallback17, useMemo as useMemo18, useState as useState22 } from "react";
7630
7598
 
7631
7599
  // components/MenuBar/index.tsx
7632
7600
  init_react_import();
@@ -7708,7 +7676,7 @@ var HeaderInner = () => {
7708
7676
  } = usePropsContext();
7709
7677
  const dispatch = useAppStore((s) => s.dispatch);
7710
7678
  const appStore = useAppStoreApi();
7711
- const defaultHeaderRender = useMemo20(() => {
7679
+ const defaultHeaderRender = useMemo18(() => {
7712
7680
  if (renderHeader) {
7713
7681
  console.warn(
7714
7682
  "`renderHeader` is deprecated. Please use `overrides.header` and the `usePuck` hook instead"
@@ -7723,7 +7691,7 @@ var HeaderInner = () => {
7723
7691
  }
7724
7692
  return DefaultOverride;
7725
7693
  }, [renderHeader]);
7726
- const defaultHeaderActionsRender = useMemo20(() => {
7694
+ const defaultHeaderActionsRender = useMemo18(() => {
7727
7695
  if (renderHeaderActions) {
7728
7696
  console.warn(
7729
7697
  "`renderHeaderActions` is deprecated. Please use `overrides.headerActions` and the `usePuck` hook instead."
@@ -7891,7 +7859,7 @@ function PuckProvider({ children }) {
7891
7859
  metadata,
7892
7860
  onAction
7893
7861
  } = usePropsContext();
7894
- const iframe = useMemo21(
7862
+ const iframe = useMemo19(
7895
7863
  () => __spreadValues({
7896
7864
  enabled: true,
7897
7865
  waitForStyles: true
@@ -8046,7 +8014,7 @@ function PuckLayout({ children }) {
8046
8014
  dnd,
8047
8015
  initialHistory: _initialHistory
8048
8016
  } = usePropsContext();
8049
- const iframe = useMemo21(
8017
+ const iframe = useMemo19(
8050
8018
  () => __spreadValues({
8051
8019
  enabled: true,
8052
8020
  waitForStyles: true
@@ -8083,7 +8051,7 @@ function PuckLayout({ children }) {
8083
8051
  };
8084
8052
  }, []);
8085
8053
  const overrides = useAppStore((s) => s.overrides);
8086
- const CustomPuck = useMemo21(
8054
+ const CustomPuck = useMemo19(
8087
8055
  () => overrides.puck || DefaultOverride,
8088
8056
  [overrides]
8089
8057
  );
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as Field, h as FieldProps, D as DropZoneProps, i as Data, j as OnAction, k as InitialHistory, l as ItemSelector } from './walk-tree-Bp8tnkJS.mjs';
2
- export { a2 as Adaptor, a0 as ArrayField, x as ArrayState, af as AsFieldProps, E as BaseData, T as BaseField, N as ComponentDataMap, K as ComponentDataOptionalId, Q as Content, a6 as CustomField, a5 as CustomFieldRender, ac as DefaultComponentProps, a9 as DefaultRootFieldProps, ab as DefaultRootProps, aa as DefaultRootRenderProps, n as Direction, o as DragAxis, a4 as ExternalField, a3 as ExternalFieldWithAdaptor, ah as ExtractPropsFromConfig, ai as ExtractRootPropsFromConfig, u as FieldRenderFunctions, v as ItemWithId, L as MappedItem, Y as NumberField, a1 as ObjectField, s as OverrideKey, z as PuckComponent, a8 as PuckContext, $ as RadioField, B as RootConfig, J as RootData, G as RootDataWithoutProps, _ as SelectField, S as Slot, y as SlotComponent, a7 as SlotField, X as TextField, Z as TextareaField, p as Viewport, ag as WithChildren, ad as WithId, ae as WithPuckProps, W as WithSlotProps, m as migrate, q as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Bp8tnkJS.mjs';
1
+ import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as Field, h as FieldProps, D as DropZoneProps, i as Data, j as OnAction, k as InitialHistory, l as ItemSelector } from './walk-tree-DrNRq2FV.mjs';
2
+ export { a2 as Adaptor, a0 as ArrayField, x as ArrayState, af as AsFieldProps, E as BaseData, T as BaseField, N as ComponentDataMap, K as ComponentDataOptionalId, Q as Content, a6 as CustomField, a5 as CustomFieldRender, ac as DefaultComponentProps, a9 as DefaultRootFieldProps, ab as DefaultRootProps, aa as DefaultRootRenderProps, n as Direction, o as DragAxis, a4 as ExternalField, a3 as ExternalFieldWithAdaptor, ah as ExtractPropsFromConfig, ai as ExtractRootPropsFromConfig, u as FieldRenderFunctions, v as ItemWithId, L as MappedItem, Y as NumberField, a1 as ObjectField, s as OverrideKey, z as PuckComponent, a8 as PuckContext, $ as RadioField, B as RootConfig, J as RootData, G as RootDataWithoutProps, _ as SelectField, S as Slot, y as SlotComponent, a7 as SlotField, X as TextField, Z as TextareaField, p as Viewport, ag as WithChildren, ad as WithId, ae as WithPuckProps, W as WithSlotProps, m as migrate, q as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DrNRq2FV.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as Field, h as FieldProps, D as DropZoneProps, i as Data, j as OnAction, k as InitialHistory, l as ItemSelector } from './walk-tree-Bp8tnkJS.js';
2
- export { a2 as Adaptor, a0 as ArrayField, x as ArrayState, af as AsFieldProps, E as BaseData, T as BaseField, N as ComponentDataMap, K as ComponentDataOptionalId, Q as Content, a6 as CustomField, a5 as CustomFieldRender, ac as DefaultComponentProps, a9 as DefaultRootFieldProps, ab as DefaultRootProps, aa as DefaultRootRenderProps, n as Direction, o as DragAxis, a4 as ExternalField, a3 as ExternalFieldWithAdaptor, ah as ExtractPropsFromConfig, ai as ExtractRootPropsFromConfig, u as FieldRenderFunctions, v as ItemWithId, L as MappedItem, Y as NumberField, a1 as ObjectField, s as OverrideKey, z as PuckComponent, a8 as PuckContext, $ as RadioField, B as RootConfig, J as RootData, G as RootDataWithoutProps, _ as SelectField, S as Slot, y as SlotComponent, a7 as SlotField, X as TextField, Z as TextareaField, p as Viewport, ag as WithChildren, ad as WithId, ae as WithPuckProps, W as WithSlotProps, m as migrate, q as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Bp8tnkJS.js';
1
+ import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as Field, h as FieldProps, D as DropZoneProps, i as Data, j as OnAction, k as InitialHistory, l as ItemSelector } from './walk-tree-DrNRq2FV.js';
2
+ export { a2 as Adaptor, a0 as ArrayField, x as ArrayState, af as AsFieldProps, E as BaseData, T as BaseField, N as ComponentDataMap, K as ComponentDataOptionalId, Q as Content, a6 as CustomField, a5 as CustomFieldRender, ac as DefaultComponentProps, a9 as DefaultRootFieldProps, ab as DefaultRootProps, aa as DefaultRootRenderProps, n as Direction, o as DragAxis, a4 as ExternalField, a3 as ExternalFieldWithAdaptor, ah as ExtractPropsFromConfig, ai as ExtractRootPropsFromConfig, u as FieldRenderFunctions, v as ItemWithId, L as MappedItem, Y as NumberField, a1 as ObjectField, s as OverrideKey, z as PuckComponent, a8 as PuckContext, $ as RadioField, B as RootConfig, J as RootData, G as RootDataWithoutProps, _ as SelectField, S as Slot, y as SlotComponent, a7 as SlotField, X as TextField, Z as TextareaField, p as Viewport, ag as WithChildren, ad as WithId, ae as WithPuckProps, W as WithSlotProps, m as migrate, q as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DrNRq2FV.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';