@measured/puck 0.18.2-canary.b399c21 → 0.18.2-canary.bdef789

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.d.mts CHANGED
@@ -1,8 +1,9 @@
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, C as Config, D as Data, I as ItemSelector, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, 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-DzJEE28m.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-DzJEE28m.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';
6
+ import { UniqueIdentifier } from '@dnd-kit/abstract';
6
7
 
7
8
  declare const ActionBar: {
8
9
  ({ label, children, }: {
@@ -42,7 +43,7 @@ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }:
42
43
  className?: string;
43
44
  }) => react_jsx_runtime.JSX.Element;
44
45
  type FieldNoLabel<Props extends any = any> = Omit<Field<Props>, "label">;
45
- declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<FieldType, ValueType>): react_jsx_runtime.JSX.Element;
46
+ declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<ValueType, FieldType>): react_jsx_runtime.JSX.Element;
46
47
 
47
48
  declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, ...props }: {
48
49
  children: ReactNode;
@@ -78,6 +79,47 @@ declare const Drawer: {
78
79
  }) => react_jsx_runtime.JSX.Element;
79
80
  };
80
81
 
82
+ type PathData = Record<string, {
83
+ path: string[];
84
+ label: string;
85
+ }>;
86
+ type DropZoneContext<UserConfig extends Config = Config> = {
87
+ data: Data;
88
+ config: UserConfig;
89
+ componentState?: Record<string, any>;
90
+ itemSelector?: ItemSelector | null;
91
+ setItemSelector?: (newIndex: ItemSelector | null) => void;
92
+ areaId?: string;
93
+ zoneCompound?: string;
94
+ index?: number;
95
+ hoveringComponent?: string | null;
96
+ setHoveringComponent?: (id: string | null) => void;
97
+ registerZoneArea?: (areaId: string) => void;
98
+ areasWithZones?: Record<string, boolean>;
99
+ registerZone?: (zoneCompound: string) => void;
100
+ unregisterZone?: (zoneCompound: string) => void;
101
+ activeZones?: Record<string, boolean>;
102
+ pathData?: PathData;
103
+ registerPath?: (id: string, selector: ItemSelector, label: string) => void;
104
+ unregisterPath?: (id: string) => void;
105
+ mode?: "edit" | "render";
106
+ depth: number;
107
+ registerLocalZone?: (zone: string, active: boolean) => void;
108
+ unregisterLocalZone?: (zone: string) => void;
109
+ path: string[];
110
+ } | null;
111
+ declare const dropZoneContext: react.Context<DropZoneContext<Config>>;
112
+ declare const DropZoneProvider: ({ children, value, }: {
113
+ children: ReactNode;
114
+ value: DropZoneContext;
115
+ }) => react_jsx_runtime.JSX.Element;
116
+
117
+ type DropZoneDndData = {
118
+ areaId?: string;
119
+ depth: number;
120
+ path: UniqueIdentifier[];
121
+ isDroppableTarget: boolean;
122
+ };
81
123
  declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
82
124
 
83
125
  declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
@@ -194,4 +236,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
194
236
  selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
195
237
  };
196
238
 
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 };
239
+ 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 };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
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, C as Config, D as Data, I as ItemSelector, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, 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-DzJEE28m.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-DzJEE28m.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';
6
+ import { UniqueIdentifier } from '@dnd-kit/abstract';
6
7
 
7
8
  declare const ActionBar: {
8
9
  ({ label, children, }: {
@@ -42,7 +43,7 @@ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }:
42
43
  className?: string;
43
44
  }) => react_jsx_runtime.JSX.Element;
44
45
  type FieldNoLabel<Props extends any = any> = Omit<Field<Props>, "label">;
45
- declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<FieldType, ValueType>): react_jsx_runtime.JSX.Element;
46
+ declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<ValueType, FieldType>): react_jsx_runtime.JSX.Element;
46
47
 
47
48
  declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, ...props }: {
48
49
  children: ReactNode;
@@ -78,6 +79,47 @@ declare const Drawer: {
78
79
  }) => react_jsx_runtime.JSX.Element;
79
80
  };
80
81
 
82
+ type PathData = Record<string, {
83
+ path: string[];
84
+ label: string;
85
+ }>;
86
+ type DropZoneContext<UserConfig extends Config = Config> = {
87
+ data: Data;
88
+ config: UserConfig;
89
+ componentState?: Record<string, any>;
90
+ itemSelector?: ItemSelector | null;
91
+ setItemSelector?: (newIndex: ItemSelector | null) => void;
92
+ areaId?: string;
93
+ zoneCompound?: string;
94
+ index?: number;
95
+ hoveringComponent?: string | null;
96
+ setHoveringComponent?: (id: string | null) => void;
97
+ registerZoneArea?: (areaId: string) => void;
98
+ areasWithZones?: Record<string, boolean>;
99
+ registerZone?: (zoneCompound: string) => void;
100
+ unregisterZone?: (zoneCompound: string) => void;
101
+ activeZones?: Record<string, boolean>;
102
+ pathData?: PathData;
103
+ registerPath?: (id: string, selector: ItemSelector, label: string) => void;
104
+ unregisterPath?: (id: string) => void;
105
+ mode?: "edit" | "render";
106
+ depth: number;
107
+ registerLocalZone?: (zone: string, active: boolean) => void;
108
+ unregisterLocalZone?: (zone: string) => void;
109
+ path: string[];
110
+ } | null;
111
+ declare const dropZoneContext: react.Context<DropZoneContext<Config>>;
112
+ declare const DropZoneProvider: ({ children, value, }: {
113
+ children: ReactNode;
114
+ value: DropZoneContext;
115
+ }) => react_jsx_runtime.JSX.Element;
116
+
117
+ type DropZoneDndData = {
118
+ areaId?: string;
119
+ depth: number;
120
+ path: UniqueIdentifier[];
121
+ isDroppableTarget: boolean;
122
+ };
81
123
  declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
82
124
 
83
125
  declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
@@ -194,4 +236,4 @@ declare const usePuck: <UserConfig extends Config = Config>() => {
194
236
  selectedItem: ComponentDataMap<ExtractPropsFromConfig<UserConfig>> | null;
195
237
  };
196
238
 
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 };
239
+ 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 };