@measured/puck 0.17.0-canary.8ea38c3 → 0.17.0-canary.9de5e5e

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.mts CHANGED
@@ -1,9 +1,10 @@
1
- import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-CaVk1fIL.mjs';
2
- export { L as Adaptor, J as ArrayField, r as ArrayState, a2 as AsFieldProps, B as BaseData, y as BaseField, t as ComponentConfig, w as ComponentData, x as Content, X as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, W as ExternalField, Q as ExternalFieldWithAdaptor, p as FieldRenderFunctions, Y as Fields, q as ItemWithId, M as MappedItem, N as NumberField, K as ObjectField, n as OverrideKey, s as PuckComponent, Z as PuckContext, G as RadioField, v as RootData, R as RootDataWithProps, u as RootDataWithoutProps, S as SelectField, T as TextField, z as TextareaField, m as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, o as overrideKeys, a4 as resolveAllData } from './resolve-all-data-CaVk1fIL.mjs';
1
+ import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-Fx9YY5bj.mjs';
2
+ export { W as Adaptor, L as ArrayField, t as ArrayState, a4 as AsFieldProps, B as BaseData, G as BaseField, v as ComponentConfig, y as ComponentData, z as Content, Z as CustomField, a1 as DefaultRootProps, a0 as DefaultRootRenderProps, m as Direction, n as DragAxis, Y as ExternalField, X as ExternalFieldWithAdaptor, r as FieldRenderFunctions, _ as Fields, s as ItemWithId, M as MappedItem, N as NumberField, Q as ObjectField, q as OverrideKey, u as PuckComponent, $ as PuckContext, K as RadioField, x as RootData, R as RootDataWithProps, w as RootDataWithoutProps, S as SelectField, T as TextField, J as TextareaField, o as Viewport, a5 as WithChildren, a2 as WithId, a3 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-Fx9YY5bj.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
- import { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
6
- import { DragStart, DragUpdate } from '@measured/dnd';
5
+ import { ReactNode, SyntheticEvent, ReactElement } from 'react';
6
+ import { UniqueIdentifier } from '@dnd-kit/abstract';
7
+ import { Draggable } from '@dnd-kit/dom';
7
8
 
8
9
  declare const ActionBar: {
9
10
  ({ label, children, }: {
@@ -55,7 +56,7 @@ declare const Button: ({ children, href, onClick, variant, type, disabled, tabIn
55
56
  }) => react_jsx_runtime.JSX.Element;
56
57
 
57
58
  declare const Drawer: {
58
- ({ children, droppableId: _droppableId, direction, }: {
59
+ ({ children, droppableId, direction, }: {
59
60
  children: ReactNode;
60
61
  droppableId?: string;
61
62
  direction?: "vertical" | "horizontal";
@@ -68,7 +69,7 @@ declare const Drawer: {
68
69
  }) => ReactElement;
69
70
  id?: string;
70
71
  label?: string;
71
- index: number;
72
+ index?: number;
72
73
  isDragDisabled?: boolean;
73
74
  }) => react_jsx_runtime.JSX.Element;
74
75
  };
@@ -85,12 +86,9 @@ type DropZoneContext<UserConfig extends Config = Config> = {
85
86
  setItemSelector?: (newIndex: ItemSelector | null) => void;
86
87
  dispatch?: (action: PuckAction) => void;
87
88
  areaId?: string;
88
- draggedItem?: DragStart & Partial<DragUpdate>;
89
- placeholderStyle?: CSSProperties;
90
- hoveringArea?: string | null;
91
- setHoveringArea?: (area: string | null) => void;
92
- hoveringZone?: string | null;
93
- setHoveringZone?: (zone: string | null) => void;
89
+ zoneCompound?: string;
90
+ index?: number;
91
+ draggedItem?: Draggable | null;
94
92
  hoveringComponent?: string | null;
95
93
  setHoveringComponent?: (id: string | null) => void;
96
94
  registerZoneArea?: (areaId: string) => void;
@@ -101,8 +99,13 @@ type DropZoneContext<UserConfig extends Config = Config> = {
101
99
  pathData?: PathData;
102
100
  registerPath?: (selector: ItemSelector) => void;
103
101
  mode?: "edit" | "render";
104
- zoneWillDrag?: string;
105
- setZoneWillDrag?: (zone: string) => void;
102
+ depth: number;
103
+ registerLocalZone?: (zone: string, active: boolean) => void;
104
+ deepestZone?: string | null;
105
+ deepestArea?: string | null;
106
+ nextDeepestZone?: string | null;
107
+ nextDeepestArea?: string | null;
108
+ path: string[];
106
109
  } | null;
107
110
  declare const dropZoneContext: react.Context<DropZoneContext<Config>>;
108
111
  declare const DropZoneProvider: ({ children, value, }: {
@@ -110,6 +113,12 @@ declare const DropZoneProvider: ({ children, value, }: {
110
113
  value: DropZoneContext;
111
114
  }) => react_jsx_runtime.JSX.Element;
112
115
 
116
+ type DropZoneDndData = {
117
+ areaId?: string;
118
+ depth: number;
119
+ path: UniqueIdentifier[];
120
+ isDroppableTarget: boolean;
121
+ };
113
122
  declare function DropZone(props: DropZoneProps): react_jsx_runtime.JSX.Element;
114
123
 
115
124
  declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
@@ -224,4 +233,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
224
233
  selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
225
234
  };
226
235
 
227
- export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, DropZoneProvider, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, dropZoneContext, migrate, transformProps, usePuck };
236
+ export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, type DropZoneDndData, DropZoneProvider, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, dropZoneContext, migrate, transformProps, usePuck };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-CaVk1fIL.js';
2
- export { L as Adaptor, J as ArrayField, r as ArrayState, a2 as AsFieldProps, B as BaseData, y as BaseField, t as ComponentConfig, w as ComponentData, x as Content, X as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, W as ExternalField, Q as ExternalFieldWithAdaptor, p as FieldRenderFunctions, Y as Fields, q as ItemWithId, M as MappedItem, N as NumberField, K as ObjectField, n as OverrideKey, s as PuckComponent, Z as PuckContext, G as RadioField, v as RootData, R as RootDataWithProps, u as RootDataWithoutProps, S as SelectField, T as TextField, z as TextareaField, m as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, o as overrideKeys, a4 as resolveAllData } from './resolve-all-data-CaVk1fIL.js';
1
+ import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-Fx9YY5bj.js';
2
+ export { W as Adaptor, L as ArrayField, t as ArrayState, a4 as AsFieldProps, B as BaseData, G as BaseField, v as ComponentConfig, y as ComponentData, z as Content, Z as CustomField, a1 as DefaultRootProps, a0 as DefaultRootRenderProps, m as Direction, n as DragAxis, Y as ExternalField, X as ExternalFieldWithAdaptor, r as FieldRenderFunctions, _ as Fields, s as ItemWithId, M as MappedItem, N as NumberField, Q as ObjectField, q as OverrideKey, u as PuckComponent, $ as PuckContext, K as RadioField, x as RootData, R as RootDataWithProps, w as RootDataWithoutProps, S as SelectField, T as TextField, J as TextareaField, o as Viewport, a5 as WithChildren, a2 as WithId, a3 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-Fx9YY5bj.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
- import { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
6
- import { DragStart, DragUpdate } from '@measured/dnd';
5
+ import { ReactNode, SyntheticEvent, ReactElement } from 'react';
6
+ import { UniqueIdentifier } from '@dnd-kit/abstract';
7
+ import { Draggable } from '@dnd-kit/dom';
7
8
 
8
9
  declare const ActionBar: {
9
10
  ({ label, children, }: {
@@ -55,7 +56,7 @@ declare const Button: ({ children, href, onClick, variant, type, disabled, tabIn
55
56
  }) => react_jsx_runtime.JSX.Element;
56
57
 
57
58
  declare const Drawer: {
58
- ({ children, droppableId: _droppableId, direction, }: {
59
+ ({ children, droppableId, direction, }: {
59
60
  children: ReactNode;
60
61
  droppableId?: string;
61
62
  direction?: "vertical" | "horizontal";
@@ -68,7 +69,7 @@ declare const Drawer: {
68
69
  }) => ReactElement;
69
70
  id?: string;
70
71
  label?: string;
71
- index: number;
72
+ index?: number;
72
73
  isDragDisabled?: boolean;
73
74
  }) => react_jsx_runtime.JSX.Element;
74
75
  };
@@ -85,12 +86,9 @@ type DropZoneContext<UserConfig extends Config = Config> = {
85
86
  setItemSelector?: (newIndex: ItemSelector | null) => void;
86
87
  dispatch?: (action: PuckAction) => void;
87
88
  areaId?: string;
88
- draggedItem?: DragStart & Partial<DragUpdate>;
89
- placeholderStyle?: CSSProperties;
90
- hoveringArea?: string | null;
91
- setHoveringArea?: (area: string | null) => void;
92
- hoveringZone?: string | null;
93
- setHoveringZone?: (zone: string | null) => void;
89
+ zoneCompound?: string;
90
+ index?: number;
91
+ draggedItem?: Draggable | null;
94
92
  hoveringComponent?: string | null;
95
93
  setHoveringComponent?: (id: string | null) => void;
96
94
  registerZoneArea?: (areaId: string) => void;
@@ -101,8 +99,13 @@ type DropZoneContext<UserConfig extends Config = Config> = {
101
99
  pathData?: PathData;
102
100
  registerPath?: (selector: ItemSelector) => void;
103
101
  mode?: "edit" | "render";
104
- zoneWillDrag?: string;
105
- setZoneWillDrag?: (zone: string) => void;
102
+ depth: number;
103
+ registerLocalZone?: (zone: string, active: boolean) => void;
104
+ deepestZone?: string | null;
105
+ deepestArea?: string | null;
106
+ nextDeepestZone?: string | null;
107
+ nextDeepestArea?: string | null;
108
+ path: string[];
106
109
  } | null;
107
110
  declare const dropZoneContext: react.Context<DropZoneContext<Config>>;
108
111
  declare const DropZoneProvider: ({ children, value, }: {
@@ -110,6 +113,12 @@ declare const DropZoneProvider: ({ children, value, }: {
110
113
  value: DropZoneContext;
111
114
  }) => react_jsx_runtime.JSX.Element;
112
115
 
116
+ type DropZoneDndData = {
117
+ areaId?: string;
118
+ depth: number;
119
+ path: UniqueIdentifier[];
120
+ isDroppableTarget: boolean;
121
+ };
113
122
  declare function DropZone(props: DropZoneProps): react_jsx_runtime.JSX.Element;
114
123
 
115
124
  declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
@@ -224,4 +233,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
224
233
  selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
225
234
  };
226
235
 
227
- export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, DropZoneProvider, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, dropZoneContext, migrate, transformProps, usePuck };
236
+ export { Action, ActionBar, AppState, AutoField, Button, ComponentDataMap, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, type DropZoneDndData, DropZoneProvider, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldProps, Group, History, IconButton, IframeConfig, InitialHistory, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, dropZoneContext, migrate, transformProps, usePuck };