@measured/puck 0.19.0-canary.a281c342 → 0.19.0-canary.a6dd529f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -51,8 +51,11 @@ import {
51
51
  defaultViewports,
52
52
  dropZoneContext,
53
53
  getFrame,
54
+ getItem,
54
55
  get_class_name_factory_default,
55
56
  init_react_import,
57
+ makeStatePublic,
58
+ mapSlotsPublic,
56
59
  monitorHotkeys,
57
60
  renderContext,
58
61
  reorder,
@@ -72,7 +75,7 @@ import {
72
75
  useSlots,
73
76
  useSortableSafe,
74
77
  walkTree
75
- } from "./chunk-6SCV2ENX.mjs";
78
+ } from "./chunk-ZOHJNF5K.mjs";
76
79
 
77
80
  // index.ts
78
81
  init_react_import();
@@ -126,7 +129,7 @@ init_react_import();
126
129
 
127
130
  // css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/styles.module.css#css-module
128
131
  init_react_import();
129
- var styles_module_default = { "InputWrapper": "_InputWrapper_g5w3n_1", "Input-label": "_Input-label_g5w3n_5", "Input-labelIcon": "_Input-labelIcon_g5w3n_14", "Input-disabledIcon": "_Input-disabledIcon_g5w3n_21", "Input-input": "_Input-input_g5w3n_26", "Input": "_Input_g5w3n_1", "Input--readOnly": "_Input--readOnly_g5w3n_74", "Input-radioGroupItems": "_Input-radioGroupItems_g5w3n_85", "Input-radio": "_Input-radio_g5w3n_85", "Input-radioInner": "_Input-radioInner_g5w3n_102", "Input-radioInput": "_Input-radioInput_g5w3n_147" };
132
+ var styles_module_default = { "InputWrapper": "_InputWrapper_4xor1_1", "Input-label": "_Input-label_4xor1_5", "Input-labelIcon": "_Input-labelIcon_4xor1_14", "Input-disabledIcon": "_Input-disabledIcon_4xor1_21", "Input-input": "_Input-input_4xor1_26", "Input": "_Input_4xor1_1", "Input--readOnly": "_Input--readOnly_4xor1_75", "Input-radioGroupItems": "_Input-radioGroupItems_4xor1_86", "Input-radio": "_Input-radio_4xor1_86", "Input-radioInner": "_Input-radioInner_4xor1_103", "Input-radioInput": "_Input-radioInput_4xor1_148" };
130
133
 
131
134
  // components/AutoField/index.tsx
132
135
  import {
@@ -2651,7 +2654,7 @@ var LayerTree = ({
2651
2654
  // components/Puck/components/Outline/index.tsx
2652
2655
  import { useMemo as useMemo10 } from "react";
2653
2656
 
2654
- // lib/find-zones-for-area.ts
2657
+ // lib/data/find-zones-for-area.ts
2655
2658
  init_react_import();
2656
2659
  var findZonesForArea = (state, area) => {
2657
2660
  return Object.keys(state.indexes.zones).filter(
@@ -3267,13 +3270,22 @@ var generateUsePuck = (store) => {
3267
3270
  index: store.history.index
3268
3271
  };
3269
3272
  const storeData = {
3270
- appState: store.state,
3273
+ appState: makeStatePublic(store.state),
3271
3274
  config: store.config,
3272
3275
  dispatch: store.dispatch,
3273
3276
  getPermissions: store.permissions.getPermissions,
3274
3277
  refreshPermissions: store.permissions.refreshPermissions,
3275
3278
  history,
3276
- selectedItem: store.selectedItem || null
3279
+ selectedItem: store.selectedItem || null,
3280
+ getItemBySelector: (selector) => getItem(selector, store.state),
3281
+ getItemById: (id) => store.state.indexes.nodes[id].data,
3282
+ getSelectorForId: (id) => {
3283
+ const node = store.state.indexes.nodes[id];
3284
+ if (!node) return;
3285
+ const zoneCompound = `${node.parentId}:${node.zone}`;
3286
+ const index = store.state.indexes.zones[zoneCompound].contentIds.indexOf(id);
3287
+ return { zone: zoneCompound, index };
3288
+ }
3277
3289
  };
3278
3290
  const get = () => storeData;
3279
3291
  return __spreadProps(__spreadValues({}, storeData), { get });
@@ -3281,23 +3293,25 @@ var generateUsePuck = (store) => {
3281
3293
  var UsePuckStoreContext = createContext3(
3282
3294
  null
3283
3295
  );
3296
+ var convertToPickedStore = (store) => {
3297
+ return {
3298
+ state: store.state,
3299
+ config: store.config,
3300
+ dispatch: store.dispatch,
3301
+ permissions: store.permissions,
3302
+ history: store.history,
3303
+ selectedItem: store.selectedItem
3304
+ };
3305
+ };
3284
3306
  var useRegisterUsePuckStore = (appStore) => {
3285
3307
  const [usePuckStore] = useState12(
3286
- () => createStore(() => generateUsePuck(appStore.getState()))
3308
+ () => createStore(
3309
+ () => generateUsePuck(convertToPickedStore(appStore.getState()))
3310
+ )
3287
3311
  );
3288
3312
  useEffect13(() => {
3289
3313
  return appStore.subscribe(
3290
- (store) => {
3291
- const pickedStore = {
3292
- state: store.state,
3293
- config: store.config,
3294
- dispatch: store.dispatch,
3295
- permissions: store.permissions,
3296
- history: store.history,
3297
- selectedItem: store.selectedItem
3298
- };
3299
- return pickedStore;
3300
- },
3314
+ (store) => convertToPickedStore(store),
3301
3315
  (pickedStore) => {
3302
3316
  usePuckStore.setState(generateUsePuck(pickedStore));
3303
3317
  }
@@ -3340,29 +3354,11 @@ var FieldSideBar = () => {
3340
3354
  );
3341
3355
  return /* @__PURE__ */ jsx29(SidebarSection, { noPadding: true, noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ jsx29(Fields, {}) });
3342
3356
  };
3343
- var DEBUG = false;
3344
3357
  var propsContext = createContext4({});
3345
3358
  function PropsProvider(props) {
3346
3359
  return /* @__PURE__ */ jsx29(propsContext.Provider, { value: props, children: props.children });
3347
3360
  }
3348
3361
  var usePropsContext = () => useContext6(propsContext);
3349
- var debugPlugin = {
3350
- overrides: {
3351
- fields: ({ children }) => {
3352
- const state = useAppStore((s) => s.state);
3353
- const selectedItem = useAppStore((s) => s.selectedItem);
3354
- return /* @__PURE__ */ jsxs15(Fragment12, { children: [
3355
- children,
3356
- /* @__PURE__ */ jsx29(SidebarSection, { title: "Debug: Data", children: JSON.stringify(state.data) }),
3357
- /* @__PURE__ */ jsx29(SidebarSection, { title: "Debug: UI", children: JSON.stringify(state.ui) }),
3358
- /* @__PURE__ */ jsx29(SidebarSection, { title: "Debug: Other", children: /* @__PURE__ */ jsx29("ul", { children: /* @__PURE__ */ jsxs15("li", { children: [
3359
- "Selected Item: ",
3360
- JSON.stringify(selectedItem)
3361
- ] }) }) })
3362
- ] });
3363
- }
3364
- }
3365
- };
3366
3362
  function PuckProvider({ children }) {
3367
3363
  const {
3368
3364
  config,
@@ -3370,7 +3366,7 @@ function PuckProvider({ children }) {
3370
3366
  ui: initialUi,
3371
3367
  onChange,
3372
3368
  permissions = {},
3373
- plugins: _plugins,
3369
+ plugins,
3374
3370
  overrides,
3375
3371
  viewports = defaultViewports,
3376
3372
  iframe: _iframe,
@@ -3442,57 +3438,57 @@ function PuckProvider({ children }) {
3442
3438
  return walkTree(newAppState, config);
3443
3439
  });
3444
3440
  const { appendData = true } = _initialHistory || {};
3445
- const blendedHistories = [
3446
- ...(_initialHistory == null ? void 0 : _initialHistory.histories) || [],
3447
- ...appendData ? [{ state: generatedAppState }] : []
3448
- ].map((history) => __spreadProps(__spreadValues({}, history), {
3449
- // Inject default data to enable partial history injections
3450
- state: __spreadValues(__spreadValues({}, generatedAppState), history.state)
3451
- }));
3441
+ const [blendedHistories] = useState13(
3442
+ [
3443
+ ...(_initialHistory == null ? void 0 : _initialHistory.histories) || [],
3444
+ ...appendData ? [{ state: generatedAppState }] : []
3445
+ ].map((history) => {
3446
+ let newState = __spreadValues(__spreadValues({}, generatedAppState), history.state);
3447
+ if (!history.state.indexes) {
3448
+ newState = walkTree(newState, config);
3449
+ }
3450
+ return __spreadProps(__spreadValues({}, history), {
3451
+ state: newState
3452
+ });
3453
+ })
3454
+ );
3452
3455
  const initialHistoryIndex = (_initialHistory == null ? void 0 : _initialHistory.index) || blendedHistories.length - 1;
3453
3456
  const initialAppState = blendedHistories[initialHistoryIndex].state;
3454
- const plugins = useMemo14(
3455
- () => DEBUG ? [..._plugins || [], debugPlugin] : _plugins,
3456
- [_plugins]
3457
- );
3458
3457
  const loadedOverrides = useLoadedOverrides({
3459
3458
  overrides,
3460
3459
  plugins
3461
3460
  });
3462
- const generateAppStore = useCallback9(() => {
3463
- return {
3464
- state: initialAppState,
3461
+ const generateAppStore = useCallback9(
3462
+ (state) => {
3463
+ return {
3464
+ state,
3465
+ config,
3466
+ plugins: plugins || [],
3467
+ overrides: loadedOverrides,
3468
+ viewports,
3469
+ iframe,
3470
+ onAction,
3471
+ metadata
3472
+ };
3473
+ },
3474
+ [
3475
+ initialAppState,
3465
3476
  config,
3466
- plugins: plugins || [],
3467
- overrides: loadedOverrides,
3477
+ plugins,
3478
+ loadedOverrides,
3468
3479
  viewports,
3469
3480
  iframe,
3470
3481
  onAction,
3471
3482
  metadata
3472
- };
3473
- }, [
3474
- initialAppState,
3475
- config,
3476
- plugins,
3477
- loadedOverrides,
3478
- viewports,
3479
- iframe,
3480
- onAction,
3481
- metadata
3482
- ]);
3483
- const [appStore] = useState13(() => createAppStore(generateAppStore()));
3483
+ ]
3484
+ );
3485
+ const [appStore] = useState13(
3486
+ () => createAppStore(generateAppStore(initialAppState))
3487
+ );
3484
3488
  useEffect14(() => {
3485
- appStore.setState(__spreadValues({}, generateAppStore()));
3486
- }, [
3487
- initialAppState,
3488
- config,
3489
- plugins,
3490
- loadedOverrides,
3491
- viewports,
3492
- iframe,
3493
- onAction,
3494
- metadata
3495
- ]);
3489
+ const state = appStore.getState().state;
3490
+ appStore.setState(__spreadValues({}, generateAppStore(state)));
3491
+ }, [config, plugins, loadedOverrides, viewports, iframe, onAction, metadata]);
3496
3492
  useRegisterHistorySlice(appStore, {
3497
3493
  histories: blendedHistories,
3498
3494
  index: initialHistoryIndex,
@@ -3782,10 +3778,67 @@ var migrations = [
3782
3778
  });
3783
3779
  }
3784
3780
  return data;
3781
+ },
3782
+ // Migrate zones to slots
3783
+ (data, config) => {
3784
+ var _a;
3785
+ if (!config) return data;
3786
+ console.log("Migrating DropZones to slots...");
3787
+ const updatedItems = {};
3788
+ const appState = __spreadProps(__spreadValues({}, defaultAppState), { data });
3789
+ const { indexes } = walkTree(appState, config);
3790
+ const deletedCompounds = [];
3791
+ walkTree(appState, config, (content, zoneCompound, zoneType) => {
3792
+ var _a2, _b;
3793
+ if (zoneType === "dropzone") {
3794
+ const [id, slotName] = zoneCompound.split(":");
3795
+ const nodeData = indexes.nodes[id].data;
3796
+ const componentType = nodeData.type;
3797
+ const configForComponent = config.components[componentType];
3798
+ if (((_b = (_a2 = configForComponent == null ? void 0 : configForComponent.fields) == null ? void 0 : _a2[slotName]) == null ? void 0 : _b.type) === "slot") {
3799
+ updatedItems[id] = __spreadProps(__spreadValues({}, nodeData), {
3800
+ props: __spreadProps(__spreadValues({}, nodeData.props), {
3801
+ [slotName]: content
3802
+ })
3803
+ });
3804
+ deletedCompounds.push(zoneCompound);
3805
+ }
3806
+ return content;
3807
+ }
3808
+ return content;
3809
+ });
3810
+ const updated = walkTree(
3811
+ appState,
3812
+ config,
3813
+ (content) => content,
3814
+ (item) => {
3815
+ var _a2;
3816
+ return (_a2 = updatedItems[item.props.id]) != null ? _a2 : item;
3817
+ }
3818
+ );
3819
+ deletedCompounds.forEach((zoneCompound) => {
3820
+ var _a2;
3821
+ const [_, propName] = zoneCompound.split(":");
3822
+ console.log(
3823
+ `\u2713 Success: Migrated "${zoneCompound}" from DropZone to slot field "${propName}"`
3824
+ );
3825
+ (_a2 = updated.data.zones) == null ? true : delete _a2[zoneCompound];
3826
+ });
3827
+ Object.keys((_a = updated.data.zones) != null ? _a : {}).forEach((zoneCompound) => {
3828
+ const [_, propName] = zoneCompound.split(":");
3829
+ throw new Error(
3830
+ `Could not migrate DropZone "${zoneCompound}" to slot field. No slot exists with the name "${propName}".`
3831
+ );
3832
+ });
3833
+ delete updated.data.zones;
3834
+ return updated.data;
3785
3835
  }
3786
3836
  ];
3787
- function migrate(data) {
3788
- return migrations == null ? void 0 : migrations.reduce((acc, migration) => migration(acc), data);
3837
+ function migrate(data, config) {
3838
+ return migrations == null ? void 0 : migrations.reduce(
3839
+ (acc, migration) => migration(acc, config),
3840
+ data
3841
+ );
3789
3842
  }
3790
3843
  export {
3791
3844
  Action,
@@ -3801,6 +3854,7 @@ export {
3801
3854
  Puck,
3802
3855
  Render,
3803
3856
  createUsePuck,
3857
+ mapSlotsPublic as mapSlots,
3804
3858
  migrate,
3805
3859
  overrideKeys,
3806
3860
  renderContext,
@@ -23,6 +23,7 @@ type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
23
23
  type BaseField = {
24
24
  label?: string;
25
25
  labelIcon?: ReactElement;
26
+ metadata?: Metadata;
26
27
  };
27
28
  type TextField = BaseField & {
28
29
  type: "text";
@@ -122,6 +123,8 @@ type CustomField<Props extends any = {}> = BaseField & {
122
123
  };
123
124
  type SlotField = BaseField & {
124
125
  type: "slot";
126
+ allow?: string[];
127
+ disallow?: string[];
125
128
  };
126
129
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
127
130
  [key: string]: any;
@@ -187,6 +190,7 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
187
190
  appState: AppState;
188
191
  lastData: DataShape | null;
189
192
  }) => Promise<Partial<Permissions>> | Partial<Permissions>;
193
+ metadata?: Metadata;
190
194
  };
191
195
  type RootConfig<RootProps extends DefaultComponentProps = any> = Partial<ComponentConfig<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>>>;
192
196
  type Category<ComponentName> = {
@@ -522,4 +526,4 @@ declare function transformProps<Props extends DefaultComponentProps = DefaultCom
522
526
 
523
527
  declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
524
528
 
525
- export { type PuckContext as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type BaseField as E, type Fields as F, type TextareaField as G, type History as H, type IframeConfig as I, type SelectField as J, type RadioField as K, type ArrayField as L, type Metadata as M, type NumberField as N, type Overrides as O, type Permissions as P, type ObjectField as Q, type RootDataWithProps as R, type Slot as S, type TextField as T, type UserGenerics as U, type Viewports as V, type Adaptor as W, type ExternalFieldWithAdaptor as X, type ExternalField as Y, type CustomField as Z, type SlotField as _, type ComponentData as a, type DefaultRootFieldProps as a0, type DefaultRootRenderProps as a1, type DefaultRootProps as a2, type DefaultComponentProps as a3, type WithId as a4, type WithPuckProps as a5, type AsFieldProps as a6, type WithChildren as a7, type ExtractPropsFromConfig as a8, type ExtractRootPropsFromConfig as a9, transformProps as aa, resolveAllData as ab, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldProps as g, type Field as h, type Data as i, type OnAction as j, type InitialHistory 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 RootConfig as u, type RootDataWithoutProps as v, type RootData as w, type MappedItem as x, type ComponentDataMap as y, type Content as z };
529
+ export { type SlotField as $, type AppState as A, type BaseData as B, type ComponentData as C, type DropZoneProps as D, type ComponentDataMap as E, type Fields as F, type BaseField as G, type History as H, type IframeConfig as I, type TextareaField as J, type SelectField as K, type RadioField as L, type Metadata as M, type NumberField as N, type Overrides as O, type Permissions as P, type ArrayField as Q, type RootDataWithProps as R, type Slot as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ObjectField as W, type Adaptor as X, type ExternalFieldWithAdaptor as Y, type ExternalField as Z, type CustomField as _, type Config as a, type PuckContext as a0, type DefaultRootFieldProps as a1, type DefaultRootRenderProps as a2, type DefaultRootProps as a3, type DefaultComponentProps as a4, type WithId as a5, type WithPuckProps as a6, type AsFieldProps as a7, type WithChildren as a8, type ExtractPropsFromConfig as a9, type ExtractRootPropsFromConfig as aa, transformProps as ab, resolveAllData as ac, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type Field as g, type FieldProps as h, type Data as i, type OnAction as j, type InitialHistory as k, type RootData as l, type Content as m, type ItemSelector as n, type Direction as o, type DragAxis as p, type Viewport as q, overrideKeys as r, type OverrideKey as s, type FieldRenderFunctions as t, type ItemWithId as u, type ArrayState as v, type PuckComponent as w, type RootConfig as x, type RootDataWithoutProps as y, type MappedItem as z };
@@ -23,6 +23,7 @@ type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
23
23
  type BaseField = {
24
24
  label?: string;
25
25
  labelIcon?: ReactElement;
26
+ metadata?: Metadata;
26
27
  };
27
28
  type TextField = BaseField & {
28
29
  type: "text";
@@ -122,6 +123,8 @@ type CustomField<Props extends any = {}> = BaseField & {
122
123
  };
123
124
  type SlotField = BaseField & {
124
125
  type: "slot";
126
+ allow?: string[];
127
+ disallow?: string[];
125
128
  };
126
129
  type Field<Props extends any = any> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<Props extends {
127
130
  [key: string]: any;
@@ -187,6 +190,7 @@ type ComponentConfig<RenderProps extends DefaultComponentProps = DefaultComponen
187
190
  appState: AppState;
188
191
  lastData: DataShape | null;
189
192
  }) => Promise<Partial<Permissions>> | Partial<Permissions>;
193
+ metadata?: Metadata;
190
194
  };
191
195
  type RootConfig<RootProps extends DefaultComponentProps = any> = Partial<ComponentConfig<WithChildren<RootProps>, AsFieldProps<RootProps>, RootData<AsFieldProps<RootProps>>>>;
192
196
  type Category<ComponentName> = {
@@ -522,4 +526,4 @@ declare function transformProps<Props extends DefaultComponentProps = DefaultCom
522
526
 
523
527
  declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
524
528
 
525
- export { type PuckContext as $, type AppState as A, type BaseData as B, type Config as C, type DropZoneProps as D, type BaseField as E, type Fields as F, type TextareaField as G, type History as H, type IframeConfig as I, type SelectField as J, type RadioField as K, type ArrayField as L, type Metadata as M, type NumberField as N, type Overrides as O, type Permissions as P, type ObjectField as Q, type RootDataWithProps as R, type Slot as S, type TextField as T, type UserGenerics as U, type Viewports as V, type Adaptor as W, type ExternalFieldWithAdaptor as X, type ExternalField as Y, type CustomField as Z, type SlotField as _, type ComponentData as a, type DefaultRootFieldProps as a0, type DefaultRootRenderProps as a1, type DefaultRootProps as a2, type DefaultComponentProps as a3, type WithId as a4, type WithPuckProps as a5, type AsFieldProps as a6, type WithChildren as a7, type ExtractPropsFromConfig as a8, type ExtractRootPropsFromConfig as a9, transformProps as aa, resolveAllData as ab, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldProps as g, type Field as h, type Data as i, type OnAction as j, type InitialHistory 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 RootConfig as u, type RootDataWithoutProps as v, type RootData as w, type MappedItem as x, type ComponentDataMap as y, type Content as z };
529
+ export { type SlotField as $, type AppState as A, type BaseData as B, type ComponentData as C, type DropZoneProps as D, type ComponentDataMap as E, type Fields as F, type BaseField as G, type History as H, type IframeConfig as I, type TextareaField as J, type SelectField as K, type RadioField as L, type Metadata as M, type NumberField as N, type Overrides as O, type Permissions as P, type ArrayField as Q, type RootDataWithProps as R, type Slot as S, type TextField as T, type UserGenerics as U, type Viewports as V, type ObjectField as W, type Adaptor as X, type ExternalFieldWithAdaptor as Y, type ExternalField as Z, type CustomField as _, type Config as a, type PuckContext as a0, type DefaultRootFieldProps as a1, type DefaultRootRenderProps as a2, type DefaultRootProps as a3, type DefaultComponentProps as a4, type WithId as a5, type WithPuckProps as a6, type AsFieldProps as a7, type WithChildren as a8, type ExtractPropsFromConfig as a9, type ExtractRootPropsFromConfig as aa, transformProps as ab, resolveAllData as ac, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type Field as g, type FieldProps as h, type Data as i, type OnAction as j, type InitialHistory as k, type RootData as l, type Content as m, type ItemSelector as n, type Direction as o, type DragAxis as p, type Viewport as q, overrideKeys as r, type OverrideKey as s, type FieldRenderFunctions as t, type ItemWithId as u, type ArrayState as v, type PuckComponent as w, type RootConfig as x, type RootDataWithoutProps as y, type MappedItem as z };
package/dist/rsc.css CHANGED
@@ -1,10 +1,10 @@
1
1
  /* css-module:/home/runner/work/puck/puck/packages/core/components/DraggableComponent/styles.module.css/#css-module-data */
2
- ._DraggableComponent_1ukn8_1 {
2
+ ._DraggableComponent_qzbgx_1 {
3
3
  position: absolute;
4
4
  pointer-events: none;
5
5
  --overlay-background: color-mix( in srgb, var(--puck-color-azure-08) 30%, transparent );
6
6
  }
7
- ._DraggableComponent-overlay_1ukn8_12 {
7
+ ._DraggableComponent-overlay_qzbgx_12 {
8
8
  cursor: pointer;
9
9
  height: 100%;
10
10
  width: 100%;
@@ -16,10 +16,10 @@
16
16
  box-sizing: border-box;
17
17
  z-index: 1;
18
18
  }
19
- ._DraggableComponent_1ukn8_1:focus-visible > ._DraggableComponent-overlay_1ukn8_12 {
19
+ ._DraggableComponent_qzbgx_1:focus-visible > ._DraggableComponent-overlay_qzbgx_12 {
20
20
  outline: 1px solid var(--puck-color-azure-05);
21
21
  }
22
- ._DraggableComponent-loadingOverlay_1ukn8_29 {
22
+ ._DraggableComponent-loadingOverlay_qzbgx_29 {
23
23
  background: var(--puck-color-white);
24
24
  color: var(--puck-color-grey-03);
25
25
  border-radius: 4px;
@@ -34,35 +34,36 @@
34
34
  opacity: 0.8;
35
35
  z-index: 1;
36
36
  }
37
- ._DraggableComponent--hover_1ukn8_45:not(._DraggableComponent--isLocked_1ukn8_45) > ._DraggableComponent-overlay_1ukn8_12 {
37
+ ._DraggableComponent--hover_qzbgx_45:not(._DraggableComponent--isLocked_qzbgx_45) > ._DraggableComponent-overlay_qzbgx_12 {
38
38
  background: var(--overlay-background);
39
39
  }
40
- ._DraggableComponent--hover_1ukn8_45 > ._DraggableComponent-overlay_1ukn8_12 {
40
+ ._DraggableComponent--hover_qzbgx_45 > ._DraggableComponent-overlay_qzbgx_12 {
41
41
  outline: 2px var(--puck-color-azure-09) solid;
42
42
  }
43
- ._DraggableComponent--isSelected_1ukn8_54 > ._DraggableComponent-overlay_1ukn8_12 {
43
+ ._DraggableComponent--isSelected_qzbgx_54 > ._DraggableComponent-overlay_qzbgx_12 {
44
44
  outline-color: var(--puck-color-azure-07);
45
45
  }
46
- ._DraggableComponent_1ukn8_1:has(._DraggableComponent--hover_1ukn8_45 > ._DraggableComponent-overlay_1ukn8_12) > ._DraggableComponent-overlay_1ukn8_12 {
46
+ ._DraggableComponent_qzbgx_1:has(._DraggableComponent--hover_qzbgx_45 > ._DraggableComponent-overlay_qzbgx_12) > ._DraggableComponent-overlay_qzbgx_12 {
47
47
  display: none;
48
48
  }
49
- ._DraggableComponent-actionsOverlay_1ukn8_66 {
49
+ ._DraggableComponent-actionsOverlay_qzbgx_66 {
50
50
  position: sticky;
51
51
  opacity: 0;
52
52
  pointer-events: none;
53
53
  z-index: 2;
54
54
  }
55
- ._DraggableComponent--isSelected_1ukn8_54 ._DraggableComponent-actionsOverlay_1ukn8_66 {
55
+ ._DraggableComponent--isSelected_qzbgx_54 ._DraggableComponent-actionsOverlay_qzbgx_66 {
56
56
  opacity: 1;
57
57
  pointer-events: auto;
58
58
  }
59
- ._DraggableComponent-actions_1ukn8_66 {
59
+ ._DraggableComponent-actions_qzbgx_66 {
60
60
  position: absolute;
61
61
  width: auto;
62
62
  cursor: grab;
63
63
  display: flex;
64
64
  box-sizing: border-box;
65
65
  transform-origin: right top;
66
+ min-height: 36px;
66
67
  }
67
68
 
68
69
  /* components/DraggableComponent/styles.css */
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 './resolve-all-data-Cs8PfTrg.mjs';
3
- export { ab as resolveAllData, aa as transformProps } from './resolve-all-data-Cs8PfTrg.mjs';
2
+ import { a as Config, U as UserGenerics, M as Metadata } from './resolve-all-data-BFRAghCj.mjs';
3
+ export { ac as resolveAllData, ab as transformProps } from './resolve-all-data-BFRAghCj.mjs';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {
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 './resolve-all-data-Cs8PfTrg.js';
3
- export { ab as resolveAllData, aa as transformProps } from './resolve-all-data-Cs8PfTrg.js';
2
+ import { a as Config, U as UserGenerics, M as Metadata } from './resolve-all-data-BFRAghCj.js';
3
+ export { ac as resolveAllData, ab as transformProps } from './resolve-all-data-BFRAghCj.js';
4
4
  import 'react';
5
5
 
6
6
  declare function Render<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>({ config, data, metadata, }: {