@measured/puck 0.21.0-canary.a62292fd → 0.21.0-canary.ac9eba2f

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.
@@ -1,4 +1,4 @@
1
- import { ReactElement, CSSProperties, ReactNode, ElementType, JSX } from 'react';
1
+ import { ReactElement, CSSProperties, ReactNode, ElementType, Ref, JSX } from 'react';
2
2
  import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
3
3
  import { BlockquoteOptions } from '@tiptap/extension-blockquote';
4
4
  import { BoldOptions } from '@tiptap/extension-bold';
@@ -347,6 +347,7 @@ type DropZoneProps = {
347
347
  className?: string;
348
348
  collisionAxis?: DragAxis;
349
349
  as?: ElementType;
350
+ ref?: Ref<any>;
350
351
  };
351
352
 
352
353
  type PuckContext = {
@@ -1,4 +1,4 @@
1
- import { ReactElement, CSSProperties, ReactNode, ElementType, JSX } from 'react';
1
+ import { ReactElement, CSSProperties, ReactNode, ElementType, Ref, JSX } from 'react';
2
2
  import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
3
3
  import { BlockquoteOptions } from '@tiptap/extension-blockquote';
4
4
  import { BoldOptions } from '@tiptap/extension-bold';
@@ -347,6 +347,7 @@ type DropZoneProps = {
347
347
  className?: string;
348
348
  collisionAxis?: DragAxis;
349
349
  as?: ElementType;
350
+ ref?: Ref<any>;
350
351
  };
351
352
 
352
353
  type PuckContext = {
@@ -1902,17 +1902,18 @@ function AutoFieldInternal(props) {
1902
1902
  const resolvedId = id || defaultId;
1903
1903
  const render = useMemo3(
1904
1904
  () => {
1905
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
1905
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
1906
1906
  return __spreadProps(__spreadValues({}, overrides.fieldTypes), {
1907
- array: ((_a2 = overrides.fieldTypes) == null ? void 0 : _a2.array) || defaultFields.array,
1908
- external: ((_b = overrides.fieldTypes) == null ? void 0 : _b.external) || defaultFields.external,
1909
- object: ((_c = overrides.fieldTypes) == null ? void 0 : _c.object) || defaultFields.object,
1910
- select: ((_d = overrides.fieldTypes) == null ? void 0 : _d.select) || defaultFields.select,
1911
- textarea: ((_e = overrides.fieldTypes) == null ? void 0 : _e.textarea) || defaultFields.textarea,
1912
- radio: ((_f = overrides.fieldTypes) == null ? void 0 : _f.radio) || defaultFields.radio,
1913
- text: ((_g = overrides.fieldTypes) == null ? void 0 : _g.text) || defaultFields.text,
1914
- number: ((_h = overrides.fieldTypes) == null ? void 0 : _h.number) || defaultFields.number,
1915
- richtext: ((_i = overrides.fieldTypes) == null ? void 0 : _i.richtext) || defaultFields.richtext
1907
+ custom: (_a2 = overrides.fieldTypes) == null ? void 0 : _a2.custom,
1908
+ array: ((_b = overrides.fieldTypes) == null ? void 0 : _b.array) || defaultFields.array,
1909
+ external: ((_c = overrides.fieldTypes) == null ? void 0 : _c.external) || defaultFields.external,
1910
+ object: ((_d = overrides.fieldTypes) == null ? void 0 : _d.object) || defaultFields.object,
1911
+ select: ((_e = overrides.fieldTypes) == null ? void 0 : _e.select) || defaultFields.select,
1912
+ textarea: ((_f = overrides.fieldTypes) == null ? void 0 : _f.textarea) || defaultFields.textarea,
1913
+ radio: ((_g = overrides.fieldTypes) == null ? void 0 : _g.radio) || defaultFields.radio,
1914
+ text: ((_h = overrides.fieldTypes) == null ? void 0 : _h.text) || defaultFields.text,
1915
+ number: ((_i = overrides.fieldTypes) == null ? void 0 : _i.number) || defaultFields.number,
1916
+ richtext: ((_j = overrides.fieldTypes) == null ? void 0 : _j.richtext) || defaultFields.richtext
1916
1917
  });
1917
1918
  },
1918
1919
  [overrides]
@@ -1959,7 +1960,7 @@ function AutoFieldInternal(props) {
1959
1960
  }, [field.type]);
1960
1961
  const fieldKey = field.type === "custom" ? field.key : void 0;
1961
1962
  let FieldComponent = useMemo3(() => {
1962
- if (field.type === "custom") {
1963
+ if (field.type === "custom" && !render[field.type]) {
1963
1964
  if (!field.render) {
1964
1965
  return null;
1965
1966
  }
@@ -4599,6 +4600,12 @@ var DropZoneEdit = forwardRef(
4599
4600
  userMinEmptyHeight,
4600
4601
  ref
4601
4602
  });
4603
+ const setRefs = useCallback11(
4604
+ (node) => {
4605
+ assignRefs([ref, dropRef, userRef], node);
4606
+ },
4607
+ [dropRef]
4608
+ );
4602
4609
  const El = as != null ? as : "div";
4603
4610
  return /* @__PURE__ */ jsx27(
4604
4611
  El,
@@ -4611,9 +4618,7 @@ var DropZoneEdit = forwardRef(
4611
4618
  hasChildren: contentIds.length > 0,
4612
4619
  isAnimating
4613
4620
  })}${className ? ` ${className}` : ""}`,
4614
- ref: (node) => {
4615
- assignRefs([ref, dropRef, userRef], node);
4616
- },
4621
+ ref: setRefs,
4617
4622
  "data-testid": `dropzone:${zoneCompound}`,
4618
4623
  "data-puck-dropzone": zoneCompound,
4619
4624
  style: __spreadProps(__spreadValues({}, style), {
@@ -1,4 +1,4 @@
1
- import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms, o as RichtextField } from './actions-ONhOkrvf.js';
1
+ import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms, o as RichtextField } from './actions-CJibIB0m.js';
2
2
  import { Editor } from '@tiptap/react';
3
3
 
4
4
  type HistorySlice<D = any> = {
@@ -1,4 +1,4 @@
1
- import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms, o as RichtextField } from './actions-ONhOkrvf.mjs';
1
+ import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms, o as RichtextField } from './actions-CJibIB0m.mjs';
2
2
  import { Editor } from '@tiptap/react';
3
3
 
4
4
  type HistorySlice<D = any> = {
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, t as ItemSelector, c as ComponentData } from './actions-ONhOkrvf.mjs';
2
- export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, a6 as FieldMetadata, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, F as Fields, H as History, K as ItemWithId, a2 as MappedItem, a9 as NumberField, ae as ObjectField, G as OverrideKey, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, y as Viewport, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-ONhOkrvf.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CdriEzFJ.mjs';
1
+ import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, t as ItemSelector, c as ComponentData } from './actions-CJibIB0m.mjs';
2
+ export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, a6 as FieldMetadata, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, F as Fields, H as History, K as ItemWithId, a2 as MappedItem, a9 as NumberField, ae as ObjectField, G as OverrideKey, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, y as Viewport, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-CJibIB0m.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BYuI81Ik.mjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as react from 'react';
6
6
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
7
- import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-DfxZ7tZF.mjs';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-DOcD_H3b.mjs';
8
8
  import '@tiptap/react';
9
9
  import '@tiptap/extension-blockquote';
10
10
  import '@tiptap/extension-bold';
@@ -101,7 +101,7 @@ declare const Drawer: {
101
101
  }) => react_jsx_runtime.JSX.Element;
102
102
  };
103
103
 
104
- declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
104
+ declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
105
105
 
106
106
  declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
107
107
  active?: boolean;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, t as ItemSelector, c as ComponentData } from './actions-ONhOkrvf.js';
2
- export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, a6 as FieldMetadata, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, F as Fields, H as History, K as ItemWithId, a2 as MappedItem, a9 as NumberField, ae as ObjectField, G as OverrideKey, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, y as Viewport, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-ONhOkrvf.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DHbAZ4wF.js';
1
+ import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, t as ItemSelector, c as ComponentData } from './actions-CJibIB0m.js';
2
+ export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, a6 as FieldMetadata, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, F as Fields, H as History, K as ItemWithId, a2 as MappedItem, a9 as NumberField, ae as ObjectField, G as OverrideKey, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, y as Viewport, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-CJibIB0m.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BL55zQ9b.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as react from 'react';
6
6
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
7
- import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-BEoNHRI1.js';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-Bss1jupB.js';
8
8
  import '@tiptap/react';
9
9
  import '@tiptap/extension-blockquote';
10
10
  import '@tiptap/extension-bold';
@@ -101,7 +101,7 @@ declare const Drawer: {
101
101
  }) => react_jsx_runtime.JSX.Element;
102
102
  };
103
103
 
104
- declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
104
+ declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
105
105
 
106
106
  declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
107
107
  active?: boolean;
package/dist/index.js CHANGED
@@ -7269,17 +7269,18 @@ function AutoFieldInternal(props) {
7269
7269
  const resolvedId = id || defaultId;
7270
7270
  const render = (0, import_react43.useMemo)(
7271
7271
  () => {
7272
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
7272
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
7273
7273
  return __spreadProps(__spreadValues({}, overrides.fieldTypes), {
7274
- array: ((_a2 = overrides.fieldTypes) == null ? void 0 : _a2.array) || defaultFields.array,
7275
- external: ((_b = overrides.fieldTypes) == null ? void 0 : _b.external) || defaultFields.external,
7276
- object: ((_c = overrides.fieldTypes) == null ? void 0 : _c.object) || defaultFields.object,
7277
- select: ((_d = overrides.fieldTypes) == null ? void 0 : _d.select) || defaultFields.select,
7278
- textarea: ((_e = overrides.fieldTypes) == null ? void 0 : _e.textarea) || defaultFields.textarea,
7279
- radio: ((_f = overrides.fieldTypes) == null ? void 0 : _f.radio) || defaultFields.radio,
7280
- text: ((_g = overrides.fieldTypes) == null ? void 0 : _g.text) || defaultFields.text,
7281
- number: ((_h = overrides.fieldTypes) == null ? void 0 : _h.number) || defaultFields.number,
7282
- richtext: ((_i = overrides.fieldTypes) == null ? void 0 : _i.richtext) || defaultFields.richtext
7274
+ custom: (_a2 = overrides.fieldTypes) == null ? void 0 : _a2.custom,
7275
+ array: ((_b = overrides.fieldTypes) == null ? void 0 : _b.array) || defaultFields.array,
7276
+ external: ((_c = overrides.fieldTypes) == null ? void 0 : _c.external) || defaultFields.external,
7277
+ object: ((_d = overrides.fieldTypes) == null ? void 0 : _d.object) || defaultFields.object,
7278
+ select: ((_e = overrides.fieldTypes) == null ? void 0 : _e.select) || defaultFields.select,
7279
+ textarea: ((_f = overrides.fieldTypes) == null ? void 0 : _f.textarea) || defaultFields.textarea,
7280
+ radio: ((_g = overrides.fieldTypes) == null ? void 0 : _g.radio) || defaultFields.radio,
7281
+ text: ((_h = overrides.fieldTypes) == null ? void 0 : _h.text) || defaultFields.text,
7282
+ number: ((_i = overrides.fieldTypes) == null ? void 0 : _i.number) || defaultFields.number,
7283
+ richtext: ((_j = overrides.fieldTypes) == null ? void 0 : _j.richtext) || defaultFields.richtext
7283
7284
  });
7284
7285
  },
7285
7286
  [overrides]
@@ -7326,7 +7327,7 @@ function AutoFieldInternal(props) {
7326
7327
  }, [field.type]);
7327
7328
  const fieldKey = field.type === "custom" ? field.key : void 0;
7328
7329
  let FieldComponent = (0, import_react43.useMemo)(() => {
7329
- if (field.type === "custom") {
7330
+ if (field.type === "custom" && !render[field.type]) {
7330
7331
  if (!field.render) {
7331
7332
  return null;
7332
7333
  }
@@ -9315,6 +9316,12 @@ var DropZoneEdit = (0, import_react61.forwardRef)(
9315
9316
  userMinEmptyHeight,
9316
9317
  ref
9317
9318
  });
9319
+ const setRefs = (0, import_react61.useCallback)(
9320
+ (node) => {
9321
+ assignRefs([ref, dropRef, userRef], node);
9322
+ },
9323
+ [dropRef]
9324
+ );
9318
9325
  const El = as != null ? as : "div";
9319
9326
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
9320
9327
  El,
@@ -9327,9 +9334,7 @@ var DropZoneEdit = (0, import_react61.forwardRef)(
9327
9334
  hasChildren: contentIds.length > 0,
9328
9335
  isAnimating
9329
9336
  })}${className ? ` ${className}` : ""}`,
9330
- ref: (node) => {
9331
- assignRefs([ref, dropRef, userRef], node);
9332
- },
9337
+ ref: setRefs,
9333
9338
  "data-testid": `dropzone:${zoneCompound}`,
9334
9339
  "data-puck-dropzone": zoneCompound,
9335
9340
  style: __spreadProps(__spreadValues({}, style), {
package/dist/index.mjs CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  setDeep,
14
14
  useGetPuck,
15
15
  usePuck
16
- } from "./chunk-7GESFTRA.mjs";
16
+ } from "./chunk-Z476VA6G.mjs";
17
17
  import "./chunk-2Q4PACDA.mjs";
18
18
  import {
19
19
  migrate,
@@ -1,6 +1,6 @@
1
1
  import { Reducer } from 'react';
2
- import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-ONhOkrvf.mjs';
3
- import { A as AppStore } from './index-DfxZ7tZF.mjs';
2
+ import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-CJibIB0m.mjs';
3
+ import { A as AppStore } from './index-DOcD_H3b.mjs';
4
4
  import '@tiptap/react';
5
5
  import '@tiptap/extension-blockquote';
6
6
  import '@tiptap/extension-bold';
@@ -1,6 +1,6 @@
1
1
  import { Reducer } from 'react';
2
- import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-ONhOkrvf.js';
3
- import { A as AppStore } from './index-BEoNHRI1.js';
2
+ import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, a as PuckAction } from './actions-CJibIB0m.js';
3
+ import { A as AppStore } from './index-Bss1jupB.js';
4
4
  import '@tiptap/react';
5
5
  import '@tiptap/extension-blockquote';
6
6
  import '@tiptap/extension-bold';
@@ -1,6 +1,6 @@
1
- export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, c as ComponentData, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, C as Config, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, D as Data, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, p as Field, a6 as FieldMetadata, q as FieldProps, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, n as FieldTransforms, F as Fields, H as History, I as IframeConfig, s as InitialHistory, K as ItemWithId, a2 as MappedItem, M as Metadata, a9 as NumberField, ae as ObjectField, O as OnAction, G as OverrideKey, k as Overrides, g as Permissions, j as Plugin, a as PuckAction, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, l as UiState, U as UserGenerics, y as Viewport, V as Viewports, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-ONhOkrvf.mjs';
1
+ export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, c as ComponentData, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, C as Config, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, D as Data, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, p as Field, a6 as FieldMetadata, q as FieldProps, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, n as FieldTransforms, F as Fields, H as History, I as IframeConfig, s as InitialHistory, K as ItemWithId, a2 as MappedItem, M as Metadata, a9 as NumberField, ae as ObjectField, O as OnAction, G as OverrideKey, k as Overrides, g as Permissions, j as Plugin, a as PuckAction, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, l as UiState, U as UserGenerics, y as Viewport, V as Viewports, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-CJibIB0m.mjs';
2
2
  export { Action, ActionBar, AutoField, Button, Drawer, DropZone, FieldLabel, Group, IconButton, Label, Puck, PuckApi, Render, RichTextMenu, Separator, UsePuckData, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck } from './index.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CdriEzFJ.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BYuI81Ik.mjs';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
@@ -18,4 +18,4 @@ import '@tiptap/extension-strike';
18
18
  import '@tiptap/extension-text-align';
19
19
  import '@tiptap/extension-underline';
20
20
  import 'react/jsx-runtime';
21
- import './index-DfxZ7tZF.mjs';
21
+ import './index-DOcD_H3b.mjs';
@@ -1,6 +1,6 @@
1
- export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, c as ComponentData, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, C as Config, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, D as Data, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, p as Field, a6 as FieldMetadata, q as FieldProps, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, n as FieldTransforms, F as Fields, H as History, I as IframeConfig, s as InitialHistory, K as ItemWithId, a2 as MappedItem, M as Metadata, a9 as NumberField, ae as ObjectField, O as OnAction, G as OverrideKey, k as Overrides, g as Permissions, j as Plugin, a as PuckAction, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, l as UiState, U as UserGenerics, y as Viewport, V as Viewports, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-ONhOkrvf.js';
1
+ export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, c as ComponentData, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, C as Config, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, D as Data, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, p as Field, a6 as FieldMetadata, q as FieldProps, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, n as FieldTransforms, F as Fields, H as History, I as IframeConfig, s as InitialHistory, K as ItemWithId, a2 as MappedItem, M as Metadata, a9 as NumberField, ae as ObjectField, O as OnAction, G as OverrideKey, k as Overrides, g as Permissions, j as Plugin, a as PuckAction, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, l as UiState, U as UserGenerics, y as Viewport, V as Viewports, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-CJibIB0m.js';
2
2
  export { Action, ActionBar, AutoField, Button, Drawer, DropZone, FieldLabel, Group, IconButton, Label, Puck, PuckApi, Render, RichTextMenu, Separator, UsePuckData, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck } from './index.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DHbAZ4wF.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BL55zQ9b.js';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
@@ -18,4 +18,4 @@ import '@tiptap/extension-strike';
18
18
  import '@tiptap/extension-text-align';
19
19
  import '@tiptap/extension-underline';
20
20
  import 'react/jsx-runtime';
21
- import './index-BEoNHRI1.js';
21
+ import './index-Bss1jupB.js';
@@ -7269,17 +7269,18 @@ function AutoFieldInternal(props) {
7269
7269
  const resolvedId = id || defaultId;
7270
7270
  const render = (0, import_react43.useMemo)(
7271
7271
  () => {
7272
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
7272
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
7273
7273
  return __spreadProps(__spreadValues({}, overrides.fieldTypes), {
7274
- array: ((_a2 = overrides.fieldTypes) == null ? void 0 : _a2.array) || defaultFields.array,
7275
- external: ((_b = overrides.fieldTypes) == null ? void 0 : _b.external) || defaultFields.external,
7276
- object: ((_c = overrides.fieldTypes) == null ? void 0 : _c.object) || defaultFields.object,
7277
- select: ((_d = overrides.fieldTypes) == null ? void 0 : _d.select) || defaultFields.select,
7278
- textarea: ((_e = overrides.fieldTypes) == null ? void 0 : _e.textarea) || defaultFields.textarea,
7279
- radio: ((_f = overrides.fieldTypes) == null ? void 0 : _f.radio) || defaultFields.radio,
7280
- text: ((_g = overrides.fieldTypes) == null ? void 0 : _g.text) || defaultFields.text,
7281
- number: ((_h = overrides.fieldTypes) == null ? void 0 : _h.number) || defaultFields.number,
7282
- richtext: ((_i = overrides.fieldTypes) == null ? void 0 : _i.richtext) || defaultFields.richtext
7274
+ custom: (_a2 = overrides.fieldTypes) == null ? void 0 : _a2.custom,
7275
+ array: ((_b = overrides.fieldTypes) == null ? void 0 : _b.array) || defaultFields.array,
7276
+ external: ((_c = overrides.fieldTypes) == null ? void 0 : _c.external) || defaultFields.external,
7277
+ object: ((_d = overrides.fieldTypes) == null ? void 0 : _d.object) || defaultFields.object,
7278
+ select: ((_e = overrides.fieldTypes) == null ? void 0 : _e.select) || defaultFields.select,
7279
+ textarea: ((_f = overrides.fieldTypes) == null ? void 0 : _f.textarea) || defaultFields.textarea,
7280
+ radio: ((_g = overrides.fieldTypes) == null ? void 0 : _g.radio) || defaultFields.radio,
7281
+ text: ((_h = overrides.fieldTypes) == null ? void 0 : _h.text) || defaultFields.text,
7282
+ number: ((_i = overrides.fieldTypes) == null ? void 0 : _i.number) || defaultFields.number,
7283
+ richtext: ((_j = overrides.fieldTypes) == null ? void 0 : _j.richtext) || defaultFields.richtext
7283
7284
  });
7284
7285
  },
7285
7286
  [overrides]
@@ -7326,7 +7327,7 @@ function AutoFieldInternal(props) {
7326
7327
  }, [field.type]);
7327
7328
  const fieldKey = field.type === "custom" ? field.key : void 0;
7328
7329
  let FieldComponent = (0, import_react43.useMemo)(() => {
7329
- if (field.type === "custom") {
7330
+ if (field.type === "custom" && !render[field.type]) {
7330
7331
  if (!field.render) {
7331
7332
  return null;
7332
7333
  }
@@ -9315,6 +9316,12 @@ var DropZoneEdit = (0, import_react61.forwardRef)(
9315
9316
  userMinEmptyHeight,
9316
9317
  ref
9317
9318
  });
9319
+ const setRefs = (0, import_react61.useCallback)(
9320
+ (node) => {
9321
+ assignRefs([ref, dropRef, userRef], node);
9322
+ },
9323
+ [dropRef]
9324
+ );
9318
9325
  const El = as != null ? as : "div";
9319
9326
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
9320
9327
  El,
@@ -9327,9 +9334,7 @@ var DropZoneEdit = (0, import_react61.forwardRef)(
9327
9334
  hasChildren: contentIds.length > 0,
9328
9335
  isAnimating
9329
9336
  })}${className ? ` ${className}` : ""}`,
9330
- ref: (node) => {
9331
- assignRefs([ref, dropRef, userRef], node);
9332
- },
9337
+ ref: setRefs,
9333
9338
  "data-testid": `dropzone:${zoneCompound}`,
9334
9339
  "data-puck-dropzone": zoneCompound,
9335
9340
  style: __spreadProps(__spreadValues({}, style), {
@@ -13,7 +13,7 @@ import {
13
13
  setDeep,
14
14
  useGetPuck,
15
15
  usePuck
16
- } from "./chunk-7GESFTRA.mjs";
16
+ } from "./chunk-Z476VA6G.mjs";
17
17
  import "./chunk-2Q4PACDA.mjs";
18
18
  import {
19
19
  migrate,
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, M as Metadata } from './actions-ONhOkrvf.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CdriEzFJ.mjs';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './actions-CJibIB0m.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BYuI81Ik.mjs';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
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, M as Metadata } from './actions-ONhOkrvf.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DHbAZ4wF.js';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './actions-CJibIB0m.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BL55zQ9b.js';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
@@ -1,4 +1,4 @@
1
- import { C as Config, D as Data, W as WithId, U as UserGenerics, b as Content, c as ComponentData, d as DefaultComponents, e as DefaultComponentProps, f as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-ONhOkrvf.js';
1
+ import { C as Config, D as Data, W as WithId, U as UserGenerics, b as Content, c as ComponentData, d as DefaultComponents, e as DefaultComponentProps, f as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-CJibIB0m.js';
2
2
 
3
3
  type MigrationOptions<UserConfig extends Config> = {
4
4
  migrateDynamicZonesForComponent?: {
@@ -1,4 +1,4 @@
1
- import { C as Config, D as Data, W as WithId, U as UserGenerics, b as Content, c as ComponentData, d as DefaultComponents, e as DefaultComponentProps, f as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-ONhOkrvf.mjs';
1
+ import { C as Config, D as Data, W as WithId, U as UserGenerics, b as Content, c as ComponentData, d as DefaultComponents, e as DefaultComponentProps, f as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-CJibIB0m.mjs';
2
2
 
3
3
  type MigrationOptions<UserConfig extends Config> = {
4
4
  migrateDynamicZonesForComponent?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.21.0-canary.a62292fd",
3
+ "version": "0.21.0-canary.ac9eba2f",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": "measuredco/puck",