@measured/puck 0.12.0-canary.e38b98f → 0.12.0-canary.f882878

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,45 @@
1
- import { U as UiState, D as Data, A as AppState, C as Config, I as ItemSelector, M as MappedItem, R as RootDataWithProps, a as DefaultRootProps, b as RootData } from './Config-60a50493.js';
2
- export { d as Adaptor, c as ArrayField, p as ArrayState, l as BaseData, B as BaseField, k as ComponentConfig, m as ComponentData, i as Content, f as CustomField, g as DefaultComponentProps, q as DropZone, e as ExternalField, E as ExternalFieldWithAdaptor, F as Field, h as Fields, o as ItemWithId, P as PuckComponent, j as PuckContext, n as RootDataWithoutProps, S as SelectField, T as TextField } from './Config-60a50493.js';
1
+ import { D as Data, C as Config, I as ItemSelector, U as UiState, A as AppState, M as MappedItem, R as RootDataWithProps, a as DefaultRootProps, b as RootData } from './Config-35e6eaae.js';
2
+ export { d as Adaptor, c as ArrayField, p as ArrayState, l as BaseData, B as BaseField, k as ComponentConfig, m as ComponentData, i as Content, f as CustomField, g as DefaultComponentProps, q as DropZone, e as ExternalField, E as ExternalFieldWithAdaptor, F as Field, h as Fields, o as ItemWithId, P as PuckComponent, j as PuckContext, n as RootDataWithoutProps, S as SelectField, T as TextField } from './Config-35e6eaae.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
- import { ReactNode, CSSProperties, ReactElement } from 'react';
5
+ import { ReactNode, CSSProperties, SyntheticEvent, ReactElement } from 'react';
6
6
  import { DragStart, DragUpdate } from '@hello-pangea/dnd';
7
7
 
8
+ type PathData = Record<string, {
9
+ path: string[];
10
+ label: string;
11
+ }>;
12
+ type DropZoneContext = {
13
+ data: Data;
14
+ config: Config;
15
+ componentState?: Record<string, any>;
16
+ itemSelector?: ItemSelector | null;
17
+ setItemSelector?: (newIndex: ItemSelector | null) => void;
18
+ dispatch?: (action: PuckAction) => void;
19
+ areaId?: string;
20
+ draggedItem?: DragStart & Partial<DragUpdate>;
21
+ placeholderStyle?: CSSProperties;
22
+ hoveringArea?: string | null;
23
+ setHoveringArea?: (area: string | null) => void;
24
+ hoveringZone?: string | null;
25
+ setHoveringZone?: (zone: string | null) => void;
26
+ hoveringComponent?: string | null;
27
+ setHoveringComponent?: (id: string | null) => void;
28
+ registerZoneArea?: (areaId: string) => void;
29
+ areasWithZones?: Record<string, boolean>;
30
+ registerZone?: (zoneCompound: string) => void;
31
+ unregisterZone?: (zoneCompound: string) => void;
32
+ activeZones?: Record<string, boolean>;
33
+ pathData?: PathData;
34
+ registerPath?: (selector: ItemSelector) => void;
35
+ mode?: "edit" | "render";
36
+ } | null;
37
+ declare const dropZoneContext: react.Context<DropZoneContext>;
38
+ declare const DropZoneProvider: ({ children, value, }: {
39
+ children: ReactNode;
40
+ value: DropZoneContext;
41
+ }) => react_jsx_runtime.JSX.Element;
42
+
8
43
  type InsertAction = {
9
44
  type: "insert";
10
45
  componentType: string;
@@ -50,7 +85,7 @@ type SetDataAction = {
50
85
  };
51
86
  type SetAction = {
52
87
  type: "set";
53
- state: Partial<AppState>;
88
+ state: Partial<AppState> | ((previous: AppState) => Partial<AppState>);
54
89
  };
55
90
  type RegisterZoneAction = {
56
91
  type: "registerZone";
@@ -64,41 +99,6 @@ type PuckAction = {
64
99
  recordHistory?: boolean;
65
100
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
66
101
 
67
- type PathData = Record<string, {
68
- path: string[];
69
- label: string;
70
- }>;
71
- type DropZoneContext = {
72
- data: Data;
73
- config: Config;
74
- componentState?: Record<string, any>;
75
- itemSelector?: ItemSelector | null;
76
- setItemSelector?: (newIndex: ItemSelector | null) => void;
77
- dispatch?: (action: PuckAction) => void;
78
- areaId?: string;
79
- draggedItem?: DragStart & Partial<DragUpdate>;
80
- placeholderStyle?: CSSProperties;
81
- hoveringArea?: string | null;
82
- setHoveringArea?: (area: string | null) => void;
83
- hoveringZone?: string | null;
84
- setHoveringZone?: (zone: string | null) => void;
85
- hoveringComponent?: string | null;
86
- setHoveringComponent?: (id: string | null) => void;
87
- registerZoneArea?: (areaId: string) => void;
88
- areasWithZones?: Record<string, boolean>;
89
- registerZone?: (zoneCompound: string) => void;
90
- unregisterZone?: (zoneCompound: string) => void;
91
- activeZones?: Record<string, boolean>;
92
- pathData?: PathData;
93
- registerPath?: (selector: ItemSelector) => void;
94
- mode?: "edit" | "render";
95
- } | null;
96
- declare const dropZoneContext: react.Context<DropZoneContext>;
97
- declare const DropZoneProvider: ({ children, value, }: {
98
- children: ReactNode;
99
- value: DropZoneContext;
100
- }) => react_jsx_runtime.JSX.Element;
101
-
102
102
  declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, }: {
103
103
  children: ReactNode;
104
104
  href?: string | undefined;
@@ -116,7 +116,7 @@ declare const Button: ({ children, href, onClick, variant, type, disabled, tabIn
116
116
  declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
117
117
  children: ReactNode;
118
118
  href?: string | undefined;
119
- onClick?: ((e: any) => void | Promise<void>) | undefined;
119
+ onClick?: ((e: SyntheticEvent) => void | Promise<void>) | undefined;
120
120
  variant?: "primary" | "secondary" | undefined;
121
121
  type?: "reset" | "submit" | "button" | undefined;
122
122
  disabled?: boolean | undefined;
@@ -188,4 +188,4 @@ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }:
188
188
  className?: string | undefined;
189
189
  }) => react_jsx_runtime.JSX.Element;
190
190
 
191
- export { AppState, Button, Config, Data, DefaultRootProps, DropZoneProvider, FieldLabel, IconButton, MappedItem, Puck, Render, RootData, RootDataWithProps, UiState, dropZoneContext, resolveAllData };
191
+ export { AppState, Button, Config, Data, DefaultRootProps, DropZoneProvider, FieldLabel, IconButton, MappedItem, Puck, PuckAction, Render, RootData, RootDataWithProps, UiState, dropZoneContext, resolveAllData };