@measured/puck 0.18.3-canary.934cfae → 0.18.3-canary.9de70d3

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.
@@ -91,6 +91,49 @@ var init_react_import = __esm({
91
91
  }
92
92
  });
93
93
 
94
+ // lib/transform-props.ts
95
+ init_react_import();
96
+
97
+ // lib/default-data.ts
98
+ init_react_import();
99
+ var defaultData = (data) => __spreadProps(__spreadValues({}, data), {
100
+ root: data.root || {},
101
+ content: data.content || []
102
+ });
103
+
104
+ // lib/transform-props.ts
105
+ function transformProps(data, propTransforms) {
106
+ const mapItem = (item) => {
107
+ if (propTransforms[item.type]) {
108
+ return __spreadProps(__spreadValues({}, item), {
109
+ props: propTransforms[item.type](item.props)
110
+ });
111
+ }
112
+ return item;
113
+ };
114
+ const defaultedData = defaultData(data);
115
+ const rootProps = defaultedData.root.props || defaultedData.root;
116
+ let newRoot = __spreadValues({}, defaultedData.root);
117
+ if (propTransforms["root"]) {
118
+ if (defaultedData.root.props) {
119
+ newRoot.props = propTransforms["root"](rootProps);
120
+ } else {
121
+ newRoot = propTransforms["root"](rootProps);
122
+ }
123
+ }
124
+ const afterPropTransforms = __spreadProps(__spreadValues({}, defaultedData), {
125
+ root: newRoot,
126
+ content: defaultedData.content.map(mapItem),
127
+ zones: Object.keys(data.zones || {}).reduce(
128
+ (acc, zoneKey) => __spreadProps(__spreadValues({}, acc), {
129
+ [zoneKey]: data.zones[zoneKey].map(mapItem)
130
+ }),
131
+ {}
132
+ )
133
+ });
134
+ return afterPropTransforms;
135
+ }
136
+
94
137
  // lib/resolve-all-data.ts
95
138
  init_react_import();
96
139
 
@@ -181,13 +224,6 @@ function resolveRootData(data, config) {
181
224
  });
182
225
  }
183
226
 
184
- // lib/default-data.ts
185
- init_react_import();
186
- var defaultData = (data) => __spreadProps(__spreadValues({}, data), {
187
- root: data.root || {},
188
- content: data.content || []
189
- });
190
-
191
227
  // lib/resolve-all-data.ts
192
228
  function resolveAllData(data, config, onResolveStart, onResolveEnd) {
193
229
  return __async(this, null, function* () {
@@ -251,6 +287,6 @@ export {
251
287
  getChanged,
252
288
  resolveComponentData,
253
289
  resolveRootData,
254
- defaultData,
290
+ transformProps,
255
291
  resolveAllData
256
292
  };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, j as ExtractRootPropsFromConfig, k as ComponentDataMap } from './resolve-all-data-ppm982Jh.mjs';
2
- export { Q as Adaptor, K as ArrayField, s as ArrayState, a3 as AsFieldProps, B as BaseData, z as BaseField, u as ComponentConfig, x as ComponentData, y as Content, Y as CustomField, a0 as DefaultRootProps, $ as DefaultRootRenderProps, l as Direction, m as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, q as FieldRenderFunctions, Z as Fields, r as ItemWithId, M as MappedItem, N as NumberField, L as ObjectField, p as OverrideKey, t as PuckComponent, _ as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, n as Viewport, a4 as WithChildren, a1 as WithId, a2 as WithPuckProps, o as overrideKeys, a5 as resolveAllData } from './resolve-all-data-ppm982Jh.mjs';
1
+ import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, H as History, A as AppState, E as ExtractPropsFromConfig, h as ExtractRootPropsFromConfig, i as ComponentDataMap } from './resolve-all-data-ChsqfT2w.mjs';
2
+ export { K as Adaptor, G as ArrayField, q as ArrayState, a3 as AsFieldProps, B as BaseData, x as BaseField, s as ComponentConfig, v as ComponentData, w as Content, W as CustomField, a0 as DefaultComponentProps, Z as DefaultRootFieldProps, $ as DefaultRootProps, _ as DefaultRootRenderProps, j as Direction, k as DragAxis, Q as ExternalField, L as ExternalFieldWithAdaptor, n as FieldRenderFunctions, X as Fields, p as ItemWithId, M as MappedItem, N as NumberField, J as ObjectField, m as OverrideKey, r as PuckComponent, Y as PuckContext, z as RadioField, u as RootData, R as RootDataWithProps, t as RootDataWithoutProps, S as SelectField, T as TextField, y as TextareaField, l as Viewport, a4 as WithChildren, a1 as WithId, a2 as WithPuckProps, o as overrideKeys, a6 as resolveAllData, a5 as transformProps } from './resolve-all-data-ChsqfT2w.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, SyntheticEvent, ReactElement } from 'react';
@@ -140,17 +140,6 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
140
140
 
141
141
  declare function migrate(data: Data): Data;
142
142
 
143
- type PropTransform<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
144
- [ComponentName in keyof Props]: (props: Props[ComponentName] & {
145
- [key: string]: any;
146
- }) => Props[ComponentName];
147
- } & {
148
- root: (props: RootProps & {
149
- [key: string]: any;
150
- }) => RootProps;
151
- }>;
152
- declare function transformProps<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Props, RootProps>): Data;
153
-
154
143
  type HistoryStore<D = any> = {
155
144
  index: number;
156
145
  hasPast: boolean;
@@ -194,4 +183,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
194
183
  selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
195
184
  };
196
185
 
197
- export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, Label, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, migrate, transformProps, usePuck };
186
+ export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, Drawer, DropZone, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, Label, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, migrate, usePuck };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, j as ExtractRootPropsFromConfig, k as ComponentDataMap } from './resolve-all-data-ppm982Jh.js';
2
- export { Q as Adaptor, K as ArrayField, s as ArrayState, a3 as AsFieldProps, B as BaseData, z as BaseField, u as ComponentConfig, x as ComponentData, y as Content, Y as CustomField, a0 as DefaultRootProps, $ as DefaultRootRenderProps, l as Direction, m as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, q as FieldRenderFunctions, Z as Fields, r as ItemWithId, M as MappedItem, N as NumberField, L as ObjectField, p as OverrideKey, t as PuckComponent, _ as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, n as Viewport, a4 as WithChildren, a1 as WithId, a2 as WithPuckProps, o as overrideKeys, a5 as resolveAllData } from './resolve-all-data-ppm982Jh.js';
1
+ import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, H as History, A as AppState, E as ExtractPropsFromConfig, h as ExtractRootPropsFromConfig, i as ComponentDataMap } from './resolve-all-data-ChsqfT2w.js';
2
+ export { K as Adaptor, G as ArrayField, q as ArrayState, a3 as AsFieldProps, B as BaseData, x as BaseField, s as ComponentConfig, v as ComponentData, w as Content, W as CustomField, a0 as DefaultComponentProps, Z as DefaultRootFieldProps, $ as DefaultRootProps, _ as DefaultRootRenderProps, j as Direction, k as DragAxis, Q as ExternalField, L as ExternalFieldWithAdaptor, n as FieldRenderFunctions, X as Fields, p as ItemWithId, M as MappedItem, N as NumberField, J as ObjectField, m as OverrideKey, r as PuckComponent, Y as PuckContext, z as RadioField, u as RootData, R as RootDataWithProps, t as RootDataWithoutProps, S as SelectField, T as TextField, y as TextareaField, l as Viewport, a4 as WithChildren, a1 as WithId, a2 as WithPuckProps, o as overrideKeys, a6 as resolveAllData, a5 as transformProps } from './resolve-all-data-ChsqfT2w.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, SyntheticEvent, ReactElement } from 'react';
@@ -140,17 +140,6 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
140
140
 
141
141
  declare function migrate(data: Data): Data;
142
142
 
143
- type PropTransform<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
144
- [ComponentName in keyof Props]: (props: Props[ComponentName] & {
145
- [key: string]: any;
146
- }) => Props[ComponentName];
147
- } & {
148
- root: (props: RootProps & {
149
- [key: string]: any;
150
- }) => RootProps;
151
- }>;
152
- declare function transformProps<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Props, RootProps>): Data;
153
-
154
143
  type HistoryStore<D = any> = {
155
144
  index: number;
156
145
  hasPast: boolean;
@@ -194,4 +183,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
194
183
  selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
195
184
  };
196
185
 
197
- export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, Label, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, migrate, transformProps, usePuck };
186
+ export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, Drawer, DropZone, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, Label, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, migrate, usePuck };
package/dist/index.js CHANGED
@@ -1301,7 +1301,8 @@ function useDraggableSafe(input) {
1301
1301
  function useSortableSafe(input) {
1302
1302
  if (typeof window === "undefined") {
1303
1303
  return { ref: () => {
1304
- }, status: "idle" };
1304
+ }, status: "idle", handleRef: () => {
1305
+ } };
1305
1306
  }
1306
1307
  return (0, import_sortable.useSortable)(input);
1307
1308
  }
@@ -1576,23 +1577,26 @@ function patchWindow(window2) {
1576
1577
 
1577
1578
  // lib/dnd/use-sensors.ts
1578
1579
  var import_utilities2 = require("@dnd-kit/dom/utilities");
1579
- var useSensors = () => {
1580
+ var useSensors = ({
1581
+ other,
1582
+ mouse,
1583
+ touch
1584
+ } = {
1585
+ touch: { delay: { value: 200, tolerance: 10 } },
1586
+ other: { delay: { value: 200, tolerance: 10 }, distance: { value: 5 } }
1587
+ }) => {
1580
1588
  const [sensors] = (0, import_react9.useState)(() => [
1581
1589
  PointerSensor.configure({
1582
1590
  activationConstraints(event, source) {
1583
1591
  var _a;
1584
1592
  const { pointerType, target } = event;
1585
1593
  if (pointerType === "mouse" && (0, import_utilities2.isElement)(target) && (source.handle === target || ((_a = source.handle) == null ? void 0 : _a.contains(target)))) {
1586
- return void 0;
1594
+ return mouse;
1587
1595
  }
1588
- const delay = { value: 200, tolerance: 10 };
1589
1596
  if (pointerType === "touch") {
1590
- return { delay };
1597
+ return touch;
1591
1598
  }
1592
- return {
1593
- delay,
1594
- distance: { value: 5 }
1595
- };
1599
+ return other;
1596
1600
  }
1597
1601
  })
1598
1602
  ]);
@@ -1945,7 +1949,9 @@ var SortableProvider = ({
1945
1949
  onMove
1946
1950
  }) => {
1947
1951
  const [move, setMove] = (0, import_react11.useState)({ source: -1, target: -1 });
1948
- const sensors = useSensors();
1952
+ const sensors = useSensors({
1953
+ mouse: { distance: { value: 5 } }
1954
+ });
1949
1955
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1950
1956
  import_react10.DragDropProvider,
1951
1957
  {
@@ -2000,7 +2006,11 @@ var Sortable = ({
2000
2006
  children,
2001
2007
  type = "item"
2002
2008
  }) => {
2003
- const { ref: sortableRef, status } = useSortableSafe({
2009
+ const {
2010
+ ref: sortableRef,
2011
+ status,
2012
+ handleRef
2013
+ } = useSortableSafe({
2004
2014
  id,
2005
2015
  type,
2006
2016
  index,
@@ -2008,7 +2018,7 @@ var Sortable = ({
2008
2018
  data: { index },
2009
2019
  collisionDetector: createDynamicCollisionDetector("y")
2010
2020
  });
2011
- return children({ status, ref: sortableRef });
2021
+ return children({ status, ref: sortableRef, handleRef });
2012
2022
  };
2013
2023
 
2014
2024
  // components/AutoField/context.tsx
@@ -2173,7 +2183,7 @@ var ArrayField = ({
2173
2183
  addDisabled
2174
2184
  }),
2175
2185
  children: [
2176
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2186
+ localState.arrayState.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2177
2187
  "div",
2178
2188
  {
2179
2189
  ref: dndContainerRef,
@@ -2188,7 +2198,7 @@ var ArrayField = ({
2188
2198
  id: _arrayId,
2189
2199
  index: i,
2190
2200
  disabled: readOnly,
2191
- children: ({ status, ref }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2201
+ children: ({ status, ref, handleRef }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2192
2202
  "div",
2193
2203
  {
2194
2204
  ref,
@@ -2201,6 +2211,7 @@ var ArrayField = ({
2201
2211
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2202
2212
  "div",
2203
2213
  {
2214
+ ref: handleRef,
2204
2215
  onClick: (e) => {
2205
2216
  if (isDragging) return;
2206
2217
  e.preventDefault();
@@ -2278,58 +2289,49 @@ var ArrayField = ({
2278
2289
  ]
2279
2290
  }
2280
2291
  ),
2281
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2282
- "fieldset",
2283
- {
2284
- className: getClassNameItem("fieldset"),
2285
- onPointerDownCapture: (e) => {
2286
- e.stopPropagation();
2287
- },
2288
- children: Object.keys(field.arrayFields).map((subName) => {
2289
- const subField = field.arrayFields[subName];
2290
- const indexName = `${name}[${i}]`;
2291
- const subPath = `${indexName}.${subName}`;
2292
- const localIndexName = `${localName}[${i}]`;
2293
- const localWildcardName = `${localName}[*]`;
2294
- const localSubPath = `${localIndexName}.${subName}`;
2295
- const localWildcardSubPath = `${localWildcardName}.${subName}`;
2296
- const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
2297
- const label2 = subField.label || subName;
2298
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2299
- NestedFieldProvider,
2292
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
2293
+ const subField = field.arrayFields[subName];
2294
+ const indexName = `${name}[${i}]`;
2295
+ const subPath = `${indexName}.${subName}`;
2296
+ const localIndexName = `${localName}[${i}]`;
2297
+ const localWildcardName = `${localName}[*]`;
2298
+ const localSubPath = `${localIndexName}.${subName}`;
2299
+ const localWildcardSubPath = `${localWildcardName}.${subName}`;
2300
+ const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
2301
+ const label2 = subField.label || subName;
2302
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2303
+ NestedFieldProvider,
2304
+ {
2305
+ name: localIndexName,
2306
+ wildcardName: localWildcardName,
2307
+ subName,
2308
+ readOnlyFields,
2309
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2310
+ AutoFieldPrivate,
2300
2311
  {
2301
- name: localIndexName,
2302
- wildcardName: localWildcardName,
2303
- subName,
2304
- readOnlyFields,
2305
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2306
- AutoFieldPrivate,
2307
- {
2308
- name: subPath,
2309
- label: label2,
2310
- id: `${_arrayId}_${subName}`,
2311
- readOnly: subReadOnly,
2312
- field: __spreadProps(__spreadValues({}, subField), {
2313
- label: label2
2314
- // May be used by custom fields
2315
- }),
2316
- value: data[subName],
2317
- onChange: (val, ui) => {
2318
- onChange(
2319
- replace(value, i, __spreadProps(__spreadValues({}, data), {
2320
- [subName]: val
2321
- })),
2322
- ui
2323
- );
2324
- }
2325
- }
2326
- )
2327
- },
2328
- subPath
2329
- );
2330
- })
2331
- }
2332
- ) })
2312
+ name: subPath,
2313
+ label: label2,
2314
+ id: `${_arrayId}_${subName}`,
2315
+ readOnly: subReadOnly,
2316
+ field: __spreadProps(__spreadValues({}, subField), {
2317
+ label: label2
2318
+ // May be used by custom fields
2319
+ }),
2320
+ value: data[subName],
2321
+ onChange: (val, ui) => {
2322
+ onChange(
2323
+ replace(value, i, __spreadProps(__spreadValues({}, data), {
2324
+ [subName]: val
2325
+ })),
2326
+ ui
2327
+ );
2328
+ }
2329
+ }
2330
+ )
2331
+ },
2332
+ subPath
2333
+ );
2334
+ }) }) })
2333
2335
  ]
2334
2336
  }
2335
2337
  )
@@ -3751,10 +3753,18 @@ var DraggableComponent = ({
3751
3753
  const rect = el.getBoundingClientRect();
3752
3754
  const diffLeft = rect.x;
3753
3755
  const exceedsBoundsLeft = diffLeft < 0;
3756
+ const diffTop = rect.y;
3757
+ const exceedsBoundsTop = diffTop < 0;
3754
3758
  if (exceedsBoundsLeft) {
3755
3759
  el.style.transformOrigin = "left top";
3756
3760
  el.style.left = "0px";
3757
3761
  }
3762
+ if (exceedsBoundsTop) {
3763
+ el.style.top = "12px";
3764
+ if (!exceedsBoundsLeft) {
3765
+ el.style.transformOrigin = "right top";
3766
+ }
3767
+ }
3758
3768
  }
3759
3769
  }
3760
3770
  },
@@ -5045,7 +5055,7 @@ var DragDropContextClient = ({
5045
5055
  disableAutoScroll
5046
5056
  }) => {
5047
5057
  const { state, config, dispatch, resolveData } = useAppContext();
5048
- const id = (0, import_react32.useId)();
5058
+ const id = useSafeId();
5049
5059
  const { data } = state;
5050
5060
  const debouncedParamsRef = (0, import_react32.useRef)(null);
5051
5061
  const tempDisableFallback = useTempDisableFallback(100);
@@ -5528,7 +5538,7 @@ var Drawer = ({
5528
5538
  "Warning: The `direction` prop on Drawer is deprecated and no longer required to achieve multi-directional dragging."
5529
5539
  );
5530
5540
  }
5531
- const id = (0, import_react33.useId)();
5541
+ const id = useSafeId();
5532
5542
  const { ref } = useDroppableSafe({
5533
5543
  id,
5534
5544
  type: "void",
package/dist/index.mjs CHANGED
@@ -8,15 +8,15 @@ import {
8
8
  __spreadProps,
9
9
  __spreadValues,
10
10
  __toESM,
11
- defaultData,
12
11
  getChanged,
13
12
  init_react_import,
14
13
  resolveAllData,
15
14
  resolveComponentData,
16
15
  resolveRootData,
17
16
  rootDroppableId,
18
- setupZone
19
- } from "./chunk-CHWFBYEM.mjs";
17
+ setupZone,
18
+ transformProps
19
+ } from "./chunk-4QIG6FWS.mjs";
20
20
 
21
21
  // ../../node_modules/classnames/index.js
22
22
  var require_classnames = __commonJS({
@@ -1110,7 +1110,8 @@ function useDraggableSafe(input) {
1110
1110
  function useSortableSafe(input) {
1111
1111
  if (typeof window === "undefined") {
1112
1112
  return { ref: () => {
1113
- }, status: "idle" };
1113
+ }, status: "idle", handleRef: () => {
1114
+ } };
1114
1115
  }
1115
1116
  return useSortable(input);
1116
1117
  }
@@ -1394,23 +1395,26 @@ function patchWindow(window2) {
1394
1395
 
1395
1396
  // lib/dnd/use-sensors.ts
1396
1397
  import { isElement as isElement2 } from "@dnd-kit/dom/utilities";
1397
- var useSensors = () => {
1398
+ var useSensors = ({
1399
+ other,
1400
+ mouse,
1401
+ touch
1402
+ } = {
1403
+ touch: { delay: { value: 200, tolerance: 10 } },
1404
+ other: { delay: { value: 200, tolerance: 10 }, distance: { value: 5 } }
1405
+ }) => {
1398
1406
  const [sensors] = useState5(() => [
1399
1407
  PointerSensor.configure({
1400
1408
  activationConstraints(event, source) {
1401
1409
  var _a;
1402
1410
  const { pointerType, target } = event;
1403
1411
  if (pointerType === "mouse" && isElement2(target) && (source.handle === target || ((_a = source.handle) == null ? void 0 : _a.contains(target)))) {
1404
- return void 0;
1412
+ return mouse;
1405
1413
  }
1406
- const delay = { value: 200, tolerance: 10 };
1407
1414
  if (pointerType === "touch") {
1408
- return { delay };
1415
+ return touch;
1409
1416
  }
1410
- return {
1411
- delay,
1412
- distance: { value: 5 }
1413
- };
1417
+ return other;
1414
1418
  }
1415
1419
  })
1416
1420
  ]);
@@ -1766,7 +1770,9 @@ var SortableProvider = ({
1766
1770
  onMove
1767
1771
  }) => {
1768
1772
  const [move, setMove] = useState6({ source: -1, target: -1 });
1769
- const sensors = useSensors();
1773
+ const sensors = useSensors({
1774
+ mouse: { distance: { value: 5 } }
1775
+ });
1770
1776
  return /* @__PURE__ */ jsx6(
1771
1777
  DragDropProvider,
1772
1778
  {
@@ -1821,7 +1827,11 @@ var Sortable = ({
1821
1827
  children,
1822
1828
  type = "item"
1823
1829
  }) => {
1824
- const { ref: sortableRef, status } = useSortableSafe({
1830
+ const {
1831
+ ref: sortableRef,
1832
+ status,
1833
+ handleRef
1834
+ } = useSortableSafe({
1825
1835
  id,
1826
1836
  type,
1827
1837
  index,
@@ -1829,7 +1839,7 @@ var Sortable = ({
1829
1839
  data: { index },
1830
1840
  collisionDetector: createDynamicCollisionDetector("y")
1831
1841
  });
1832
- return children({ status, ref: sortableRef });
1842
+ return children({ status, ref: sortableRef, handleRef });
1833
1843
  };
1834
1844
 
1835
1845
  // components/AutoField/context.tsx
@@ -1994,7 +2004,7 @@ var ArrayField = ({
1994
2004
  addDisabled
1995
2005
  }),
1996
2006
  children: [
1997
- /* @__PURE__ */ jsx8(
2007
+ localState.arrayState.items.length > 0 && /* @__PURE__ */ jsx8(
1998
2008
  "div",
1999
2009
  {
2000
2010
  ref: dndContainerRef,
@@ -2009,7 +2019,7 @@ var ArrayField = ({
2009
2019
  id: _arrayId,
2010
2020
  index: i,
2011
2021
  disabled: readOnly,
2012
- children: ({ status, ref }) => /* @__PURE__ */ jsxs3(
2022
+ children: ({ status, ref, handleRef }) => /* @__PURE__ */ jsxs3(
2013
2023
  "div",
2014
2024
  {
2015
2025
  ref,
@@ -2022,6 +2032,7 @@ var ArrayField = ({
2022
2032
  /* @__PURE__ */ jsxs3(
2023
2033
  "div",
2024
2034
  {
2035
+ ref: handleRef,
2025
2036
  onClick: (e) => {
2026
2037
  if (isDragging) return;
2027
2038
  e.preventDefault();
@@ -2099,58 +2110,49 @@ var ArrayField = ({
2099
2110
  ]
2100
2111
  }
2101
2112
  ),
2102
- /* @__PURE__ */ jsx8("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ jsx8(
2103
- "fieldset",
2104
- {
2105
- className: getClassNameItem("fieldset"),
2106
- onPointerDownCapture: (e) => {
2107
- e.stopPropagation();
2108
- },
2109
- children: Object.keys(field.arrayFields).map((subName) => {
2110
- const subField = field.arrayFields[subName];
2111
- const indexName = `${name}[${i}]`;
2112
- const subPath = `${indexName}.${subName}`;
2113
- const localIndexName = `${localName}[${i}]`;
2114
- const localWildcardName = `${localName}[*]`;
2115
- const localSubPath = `${localIndexName}.${subName}`;
2116
- const localWildcardSubPath = `${localWildcardName}.${subName}`;
2117
- const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
2118
- const label2 = subField.label || subName;
2119
- return /* @__PURE__ */ jsx8(
2120
- NestedFieldProvider,
2113
+ /* @__PURE__ */ jsx8("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ jsx8("fieldset", { className: getClassNameItem("fieldset"), children: Object.keys(field.arrayFields).map((subName) => {
2114
+ const subField = field.arrayFields[subName];
2115
+ const indexName = `${name}[${i}]`;
2116
+ const subPath = `${indexName}.${subName}`;
2117
+ const localIndexName = `${localName}[${i}]`;
2118
+ const localWildcardName = `${localName}[*]`;
2119
+ const localSubPath = `${localIndexName}.${subName}`;
2120
+ const localWildcardSubPath = `${localWildcardName}.${subName}`;
2121
+ const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
2122
+ const label2 = subField.label || subName;
2123
+ return /* @__PURE__ */ jsx8(
2124
+ NestedFieldProvider,
2125
+ {
2126
+ name: localIndexName,
2127
+ wildcardName: localWildcardName,
2128
+ subName,
2129
+ readOnlyFields,
2130
+ children: /* @__PURE__ */ jsx8(
2131
+ AutoFieldPrivate,
2121
2132
  {
2122
- name: localIndexName,
2123
- wildcardName: localWildcardName,
2124
- subName,
2125
- readOnlyFields,
2126
- children: /* @__PURE__ */ jsx8(
2127
- AutoFieldPrivate,
2128
- {
2129
- name: subPath,
2130
- label: label2,
2131
- id: `${_arrayId}_${subName}`,
2132
- readOnly: subReadOnly,
2133
- field: __spreadProps(__spreadValues({}, subField), {
2134
- label: label2
2135
- // May be used by custom fields
2136
- }),
2137
- value: data[subName],
2138
- onChange: (val, ui) => {
2139
- onChange(
2140
- replace(value, i, __spreadProps(__spreadValues({}, data), {
2141
- [subName]: val
2142
- })),
2143
- ui
2144
- );
2145
- }
2146
- }
2147
- )
2148
- },
2149
- subPath
2150
- );
2151
- })
2152
- }
2153
- ) })
2133
+ name: subPath,
2134
+ label: label2,
2135
+ id: `${_arrayId}_${subName}`,
2136
+ readOnly: subReadOnly,
2137
+ field: __spreadProps(__spreadValues({}, subField), {
2138
+ label: label2
2139
+ // May be used by custom fields
2140
+ }),
2141
+ value: data[subName],
2142
+ onChange: (val, ui) => {
2143
+ onChange(
2144
+ replace(value, i, __spreadProps(__spreadValues({}, data), {
2145
+ [subName]: val
2146
+ })),
2147
+ ui
2148
+ );
2149
+ }
2150
+ }
2151
+ )
2152
+ },
2153
+ subPath
2154
+ );
2155
+ }) }) })
2154
2156
  ]
2155
2157
  }
2156
2158
  )
@@ -3128,7 +3130,7 @@ init_react_import();
3128
3130
  var styles_module_default10 = { "Drawer": "_Drawer_fkqfo_1", "Drawer-draggable": "_Drawer-draggable_fkqfo_8", "Drawer-draggableBg": "_Drawer-draggableBg_fkqfo_12", "Drawer-draggableFg": "_Drawer-draggableFg_fkqfo_21", "DrawerItem-draggable": "_DrawerItem-draggable_fkqfo_25", "DrawerItem--disabled": "_DrawerItem--disabled_fkqfo_38", "DrawerItem": "_DrawerItem_fkqfo_25", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_fkqfo_48", "DrawerItem-name": "_DrawerItem-name_fkqfo_66" };
3129
3131
 
3130
3132
  // components/Drawer/index.tsx
3131
- import { useId as useId2, useMemo as useMemo9, useState as useState19 } from "react";
3133
+ import { useMemo as useMemo9, useState as useState19 } from "react";
3132
3134
 
3133
3135
  // components/DragDropContext/index.tsx
3134
3136
  init_react_import();
@@ -3138,7 +3140,6 @@ import {
3138
3140
  useCallback as useCallback11,
3139
3141
  useContext as useContext7,
3140
3142
  useEffect as useEffect15,
3141
- useId,
3142
3143
  useRef as useRef4,
3143
3144
  useState as useState18
3144
3145
  } from "react";
@@ -3605,10 +3606,18 @@ var DraggableComponent = ({
3605
3606
  const rect = el.getBoundingClientRect();
3606
3607
  const diffLeft = rect.x;
3607
3608
  const exceedsBoundsLeft = diffLeft < 0;
3609
+ const diffTop = rect.y;
3610
+ const exceedsBoundsTop = diffTop < 0;
3608
3611
  if (exceedsBoundsLeft) {
3609
3612
  el.style.transformOrigin = "left top";
3610
3613
  el.style.left = "0px";
3611
3614
  }
3615
+ if (exceedsBoundsTop) {
3616
+ el.style.top = "12px";
3617
+ if (!exceedsBoundsLeft) {
3618
+ el.style.transformOrigin = "right top";
3619
+ }
3620
+ }
3612
3621
  }
3613
3622
  }
3614
3623
  },
@@ -4899,7 +4908,7 @@ var DragDropContextClient = ({
4899
4908
  disableAutoScroll
4900
4909
  }) => {
4901
4910
  const { state, config, dispatch, resolveData } = useAppContext();
4902
- const id = useId();
4911
+ const id = useSafeId();
4903
4912
  const { data } = state;
4904
4913
  const debouncedParamsRef = useRef4(null);
4905
4914
  const tempDisableFallback = useTempDisableFallback(100);
@@ -5382,7 +5391,7 @@ var Drawer = ({
5382
5391
  "Warning: The `direction` prop on Drawer is deprecated and no longer required to achieve multi-directional dragging."
5383
5392
  );
5384
5393
  }
5385
- const id = useId2();
5394
+ const id = useSafeId();
5386
5395
  const { ref } = useDroppableSafe({
5387
5396
  id,
5388
5397
  type: "void",
@@ -7825,40 +7834,6 @@ function migrate(data) {
7825
7834
  return migrations == null ? void 0 : migrations.reduce((acc, migration) => migration(acc), data);
7826
7835
  }
7827
7836
 
7828
- // lib/transform-props.ts
7829
- init_react_import();
7830
- function transformProps(data, propTransforms) {
7831
- const mapItem = (item) => {
7832
- if (propTransforms[item.type]) {
7833
- return __spreadProps(__spreadValues({}, item), {
7834
- props: propTransforms[item.type](item.props)
7835
- });
7836
- }
7837
- return item;
7838
- };
7839
- const defaultedData = defaultData(data);
7840
- const rootProps = defaultedData.root.props || defaultedData.root;
7841
- let newRoot = __spreadValues({}, defaultedData.root);
7842
- if (propTransforms["root"]) {
7843
- if (defaultedData.root.props) {
7844
- newRoot.props = propTransforms["root"](rootProps);
7845
- } else {
7846
- newRoot = propTransforms["root"](rootProps);
7847
- }
7848
- }
7849
- const afterPropTransforms = __spreadProps(__spreadValues({}, defaultedData), {
7850
- root: newRoot,
7851
- content: defaultedData.content.map(mapItem),
7852
- zones: Object.keys(data.zones || {}).reduce(
7853
- (acc, zoneKey) => __spreadProps(__spreadValues({}, acc), {
7854
- [zoneKey]: data.zones[zoneKey].map(mapItem)
7855
- }),
7856
- {}
7857
- )
7858
- });
7859
- return afterPropTransforms;
7860
- }
7861
-
7862
7837
  // lib/use-puck.ts
7863
7838
  init_react_import();
7864
7839
  var usePuck = () => {
@@ -457,6 +457,17 @@ type PuckAction = {
457
457
  recordHistory?: boolean;
458
458
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
459
459
 
460
+ type PropTransform<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
461
+ [ComponentName in keyof Props]: (props: Props[ComponentName] & {
462
+ [key: string]: any;
463
+ }) => Props[ComponentName];
464
+ } & {
465
+ root: (props: RootProps & {
466
+ [key: string]: any;
467
+ }) => RootProps;
468
+ }>;
469
+ declare function transformProps<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Props, RootProps>): Data;
470
+
460
471
  declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
461
472
 
462
- export { type DefaultRootRenderProps as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type ExtractPropsFromConfig as E, type FieldProps as F, type TextareaField as G, type History as H, type IframeConfig as I, type RadioField as J, type ArrayField as K, type ObjectField as L, type MappedItem as M, type NumberField as N, type OnAction as O, type Permissions as P, type Adaptor as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ExternalFieldWithAdaptor as W, type ExternalField as X, type CustomField as Y, type Fields as Z, type PuckContext as _, type Field as a, type DefaultRootProps as a0, type WithId as a1, type WithPuckProps as a2, type AsFieldProps as a3, type WithChildren as a4, resolveAllData as a5, type Data as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type InitialHistory as g, type DefaultComponentProps as h, type DefaultRootFieldProps as i, type ExtractRootPropsFromConfig as j, type ComponentDataMap as k, type Direction as l, type DragAxis as m, type Viewport as n, overrideKeys as o, type OverrideKey as p, type FieldRenderFunctions as q, type ItemWithId as r, type ArrayState as s, type PuckComponent as t, type ComponentConfig as u, type RootDataWithoutProps as v, type RootData as w, type ComponentData as x, type Content as y, type BaseField as z };
473
+ export { type DefaultRootProps as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type ExtractPropsFromConfig as E, type FieldProps as F, type ArrayField as G, type History as H, type IframeConfig as I, type ObjectField as J, type Adaptor as K, type ExternalFieldWithAdaptor as L, type MappedItem as M, type NumberField as N, type OnAction as O, type Permissions as P, type ExternalField as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type CustomField as W, type Fields as X, type PuckContext as Y, type DefaultRootFieldProps as Z, type DefaultRootRenderProps as _, type Field as a, type DefaultComponentProps as a0, type WithId as a1, type WithPuckProps as a2, type AsFieldProps as a3, type WithChildren as a4, transformProps as a5, resolveAllData as a6, type Data as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type InitialHistory as g, type ExtractRootPropsFromConfig as h, type ComponentDataMap as i, type Direction as j, type DragAxis as k, type Viewport as l, type OverrideKey as m, type FieldRenderFunctions as n, overrideKeys as o, type ItemWithId as p, type ArrayState as q, type PuckComponent as r, type ComponentConfig as s, type RootDataWithoutProps as t, type RootData as u, type ComponentData as v, type Content as w, type BaseField as x, type TextareaField as y, type RadioField as z };
@@ -457,6 +457,17 @@ type PuckAction = {
457
457
  recordHistory?: boolean;
458
458
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
459
459
 
460
+ type PropTransform<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
461
+ [ComponentName in keyof Props]: (props: Props[ComponentName] & {
462
+ [key: string]: any;
463
+ }) => Props[ComponentName];
464
+ } & {
465
+ root: (props: RootProps & {
466
+ [key: string]: any;
467
+ }) => RootProps;
468
+ }>;
469
+ declare function transformProps<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Props, RootProps>): Data;
470
+
460
471
  declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
461
472
 
462
- export { type DefaultRootRenderProps as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type ExtractPropsFromConfig as E, type FieldProps as F, type TextareaField as G, type History as H, type IframeConfig as I, type RadioField as J, type ArrayField as K, type ObjectField as L, type MappedItem as M, type NumberField as N, type OnAction as O, type Permissions as P, type Adaptor as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ExternalFieldWithAdaptor as W, type ExternalField as X, type CustomField as Y, type Fields as Z, type PuckContext as _, type Field as a, type DefaultRootProps as a0, type WithId as a1, type WithPuckProps as a2, type AsFieldProps as a3, type WithChildren as a4, resolveAllData as a5, type Data as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type InitialHistory as g, type DefaultComponentProps as h, type DefaultRootFieldProps as i, type ExtractRootPropsFromConfig as j, type ComponentDataMap as k, type Direction as l, type DragAxis as m, type Viewport as n, overrideKeys as o, type OverrideKey as p, type FieldRenderFunctions as q, type ItemWithId as r, type ArrayState as s, type PuckComponent as t, type ComponentConfig as u, type RootDataWithoutProps as v, type RootData as w, type ComponentData as x, type Content as y, type BaseField as z };
473
+ export { type DefaultRootProps as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type ExtractPropsFromConfig as E, type FieldProps as F, type ArrayField as G, type History as H, type IframeConfig as I, type ObjectField as J, type Adaptor as K, type ExternalFieldWithAdaptor as L, type MappedItem as M, type NumberField as N, type OnAction as O, type Permissions as P, type ExternalField as Q, type RootDataWithProps as R, type SelectField as S, type TextField as T, type UserGenerics as U, type Viewports as V, type CustomField as W, type Fields as X, type PuckContext as Y, type DefaultRootFieldProps as Z, type DefaultRootRenderProps as _, type Field as a, type DefaultComponentProps as a0, type WithId as a1, type WithPuckProps as a2, type AsFieldProps as a3, type WithChildren as a4, transformProps as a5, resolveAllData as a6, type Data as b, type UiState as c, type Plugin as d, type Overrides as e, type PuckAction as f, type InitialHistory as g, type ExtractRootPropsFromConfig as h, type ComponentDataMap as i, type Direction as j, type DragAxis as k, type Viewport as l, type OverrideKey as m, type FieldRenderFunctions as n, overrideKeys as o, type ItemWithId as p, type ArrayState as q, type PuckComponent as r, type ComponentConfig as s, type RootDataWithoutProps as t, type RootData as u, type ComponentData as v, type Content as w, type BaseField as x, type TextareaField as y, type RadioField as z };
package/dist/rsc.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics } from './resolve-all-data-ppm982Jh.mjs';
3
- export { a5 as resolveAllData } from './resolve-all-data-ppm982Jh.mjs';
2
+ import { C as Config, U as UserGenerics } from './resolve-all-data-ChsqfT2w.mjs';
3
+ export { a6 as resolveAllData, a5 as transformProps } from './resolve-all-data-ChsqfT2w.mjs';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data }: {
package/dist/rsc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics } from './resolve-all-data-ppm982Jh.js';
3
- export { a5 as resolveAllData } from './resolve-all-data-ppm982Jh.js';
2
+ import { C as Config, U as UserGenerics } from './resolve-all-data-ChsqfT2w.js';
3
+ export { a6 as resolveAllData, a5 as transformProps } from './resolve-all-data-ChsqfT2w.js';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data }: {
package/dist/rsc.js CHANGED
@@ -68,7 +68,8 @@ var __async = (__this, __arguments, generator) => {
68
68
  var rsc_exports = {};
69
69
  __export(rsc_exports, {
70
70
  Render: () => Render,
71
- resolveAllData: () => resolveAllData
71
+ resolveAllData: () => resolveAllData,
72
+ transformProps: () => transformProps
72
73
  });
73
74
  module.exports = __toCommonJS(rsc_exports);
74
75
 
@@ -271,8 +272,42 @@ function resolveAllData(data, config, onResolveStart, onResolveEnd) {
271
272
  });
272
273
  });
273
274
  }
275
+
276
+ // lib/transform-props.ts
277
+ function transformProps(data, propTransforms) {
278
+ const mapItem = (item) => {
279
+ if (propTransforms[item.type]) {
280
+ return __spreadProps(__spreadValues({}, item), {
281
+ props: propTransforms[item.type](item.props)
282
+ });
283
+ }
284
+ return item;
285
+ };
286
+ const defaultedData = defaultData(data);
287
+ const rootProps = defaultedData.root.props || defaultedData.root;
288
+ let newRoot = __spreadValues({}, defaultedData.root);
289
+ if (propTransforms["root"]) {
290
+ if (defaultedData.root.props) {
291
+ newRoot.props = propTransforms["root"](rootProps);
292
+ } else {
293
+ newRoot = propTransforms["root"](rootProps);
294
+ }
295
+ }
296
+ const afterPropTransforms = __spreadProps(__spreadValues({}, defaultedData), {
297
+ root: newRoot,
298
+ content: defaultedData.content.map(mapItem),
299
+ zones: Object.keys(data.zones || {}).reduce(
300
+ (acc, zoneKey) => __spreadProps(__spreadValues({}, acc), {
301
+ [zoneKey]: data.zones[zoneKey].map(mapItem)
302
+ }),
303
+ {}
304
+ )
305
+ });
306
+ return afterPropTransforms;
307
+ }
274
308
  // Annotate the CommonJS export names for ESM import in node:
275
309
  0 && (module.exports = {
276
310
  Render,
277
- resolveAllData
311
+ resolveAllData,
312
+ transformProps
278
313
  });
package/dist/rsc.mjs CHANGED
@@ -4,8 +4,9 @@ import {
4
4
  init_react_import,
5
5
  resolveAllData,
6
6
  rootDroppableId,
7
- setupZone
8
- } from "./chunk-CHWFBYEM.mjs";
7
+ setupZone,
8
+ transformProps
9
+ } from "./chunk-4QIG6FWS.mjs";
9
10
 
10
11
  // rsc.tsx
11
12
  init_react_import();
@@ -76,5 +77,6 @@ function Render({ config, data }) {
76
77
  }
77
78
  export {
78
79
  Render,
79
- resolveAllData
80
+ resolveAllData,
81
+ transformProps
80
82
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.18.3-canary.934cfae",
3
+ "version": "0.18.3-canary.9de70d3",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",
@@ -75,7 +75,7 @@
75
75
  "react-hotkeys-hook": "^4.6.1",
76
76
  "use-debounce": "^9.0.4",
77
77
  "uuid": "^9.0.1",
78
- "zustand": "^5.0.2"
78
+ "zustand": "^4.5.6"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0"