@measured/puck 0.17.0-canary.5e57623 → 0.17.0-canary.6e5864a

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
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-ZKVfUAQq.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-ZKVfUAQq.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-C7aAQCY3.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-C7aAQCY3.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
- import { ReactNode, SyntheticEvent, ReactElement } from 'react';
6
- import { UniqueIdentifier } from '@dnd-kit/abstract';
7
- import { Draggable } from '@dnd-kit/dom';
5
+ import { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
6
+ import { DragStart, DragUpdate } from '@measured/dnd';
8
7
 
9
8
  declare const ActionBar: {
10
9
  ({ label, children, }: {
@@ -16,9 +15,6 @@ declare const ActionBar: {
16
15
  label?: string;
17
16
  onClick: (e: SyntheticEvent) => void;
18
17
  }) => react_jsx_runtime.JSX.Element;
19
- Label: ({ label }: {
20
- label: string;
21
- }) => react_jsx_runtime.JSX.Element;
22
18
  Group: ({ children }: {
23
19
  children: ReactNode;
24
20
  }) => react_jsx_runtime.JSX.Element;
@@ -31,9 +27,6 @@ declare const Action: ({ children, label, onClick, }: {
31
27
  declare const Group: ({ children }: {
32
28
  children: ReactNode;
33
29
  }) => react_jsx_runtime.JSX.Element;
34
- declare const Label: ({ label }: {
35
- label: string;
36
- }) => react_jsx_runtime.JSX.Element;
37
30
 
38
31
  declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
39
32
  children?: ReactNode;
@@ -62,7 +55,7 @@ declare const Button: ({ children, href, onClick, variant, type, disabled, tabIn
62
55
  }) => react_jsx_runtime.JSX.Element;
63
56
 
64
57
  declare const Drawer: {
65
- ({ children, droppableId, direction, }: {
58
+ ({ children, droppableId: _droppableId, direction, }: {
66
59
  children: ReactNode;
67
60
  droppableId?: string;
68
61
  direction?: "vertical" | "horizontal";
@@ -75,7 +68,7 @@ declare const Drawer: {
75
68
  }) => ReactElement;
76
69
  id?: string;
77
70
  label?: string;
78
- index?: number;
71
+ index: number;
79
72
  isDragDisabled?: boolean;
80
73
  }) => react_jsx_runtime.JSX.Element;
81
74
  };
@@ -92,9 +85,12 @@ type DropZoneContext<UserConfig extends Config = Config> = {
92
85
  setItemSelector?: (newIndex: ItemSelector | null) => void;
93
86
  dispatch?: (action: PuckAction) => void;
94
87
  areaId?: string;
95
- zoneCompound?: string;
96
- index?: number;
97
- draggedItem?: Draggable | null;
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;
98
94
  hoveringComponent?: string | null;
99
95
  setHoveringComponent?: (id: string | null) => void;
100
96
  registerZoneArea?: (areaId: string) => void;
@@ -105,13 +101,8 @@ type DropZoneContext<UserConfig extends Config = Config> = {
105
101
  pathData?: PathData;
106
102
  registerPath?: (selector: ItemSelector) => void;
107
103
  mode?: "edit" | "render";
108
- depth: number;
109
- registerLocalZone?: (zone: string, active: boolean) => void;
110
- deepestZone?: string | null;
111
- deepestArea?: string | null;
112
- nextDeepestZone?: string | null;
113
- nextDeepestArea?: string | null;
114
- path: string[];
104
+ zoneWillDrag?: string;
105
+ setZoneWillDrag?: (zone: string) => void;
115
106
  } | null;
116
107
  declare const dropZoneContext: react.Context<DropZoneContext<Config>>;
117
108
  declare const DropZoneProvider: ({ children, value, }: {
@@ -119,12 +110,6 @@ declare const DropZoneProvider: ({ children, value, }: {
119
110
  value: DropZoneContext;
120
111
  }) => react_jsx_runtime.JSX.Element;
121
112
 
122
- type DropZoneDndData = {
123
- areaId?: string;
124
- depth: number;
125
- path: UniqueIdentifier[];
126
- isDroppableTarget: boolean;
127
- };
128
113
  declare function DropZone(props: DropZoneProps): react_jsx_runtime.JSX.Element;
129
114
 
130
115
  declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
@@ -239,4 +224,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
239
224
  selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
240
225
  };
241
226
 
242
- 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, Label, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, UserGenerics, Viewports, dropZoneContext, migrate, transformProps, usePuck };
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 };