@measured/puck 0.16.0-canary.a43914d → 0.16.0-canary.bc81d9c
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/actions-BaAekM3E.d.mts +434 -0
- package/dist/actions-BaAekM3E.d.ts +434 -0
- package/dist/chunk-LM7YWFFF.mjs +114 -0
- package/dist/index.css +56 -29
- package/dist/index.d.mts +245 -0
- package/dist/index.d.ts +42 -178
- package/dist/index.js +585 -28818
- package/dist/index.mjs +5934 -0
- package/dist/rsc.d.mts +10 -0
- package/dist/rsc.d.ts +1 -1
- package/dist/rsc.js +3 -2
- package/dist/rsc.mjs +80 -0
- package/package.json +14 -6
- package/dist/Config-B7UadvMA.d.ts +0 -268
package/dist/index.css
CHANGED
@@ -137,7 +137,7 @@
|
|
137
137
|
/* styles.css */
|
138
138
|
|
139
139
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */
|
140
|
-
.
|
140
|
+
._ActionBarComponent_8nyey_1 {
|
141
141
|
display: flex;
|
142
142
|
width: auto;
|
143
143
|
padding: 4px;
|
@@ -148,8 +148,9 @@
|
|
148
148
|
color: var(--puck-color-white);
|
149
149
|
font-family: var(--puck-font-family);
|
150
150
|
gap: 4px;
|
151
|
+
min-height: 26px;
|
151
152
|
}
|
152
|
-
._ActionBarComponent-
|
153
|
+
._ActionBarComponent-actionsLabel_8nyey_15 {
|
153
154
|
color: var(--puck-color-grey-08);
|
154
155
|
display: flex;
|
155
156
|
font-size: var(--puck-font-size-xxxs);
|
@@ -157,13 +158,16 @@
|
|
157
158
|
justify-content: center;
|
158
159
|
align-items: center;
|
159
160
|
padding-left: 8px;
|
160
|
-
padding-right:
|
161
|
-
margin-right: 8px;
|
162
|
-
border-right: 0.5px solid var(--puck-color-grey-05);
|
161
|
+
padding-right: 8px;
|
163
162
|
text-overflow: ellipsis;
|
164
163
|
white-space: nowrap;
|
165
164
|
}
|
166
|
-
._ActionBarComponent-
|
165
|
+
._ActionBarComponent-action_8nyey_15:first-of-type {
|
166
|
+
border-left: 0.5px solid var(--puck-color-grey-05);
|
167
|
+
border-radius: 0;
|
168
|
+
padding-left: 16px;
|
169
|
+
}
|
170
|
+
._ActionBarComponent-action_8nyey_15 {
|
167
171
|
background: transparent;
|
168
172
|
border: none;
|
169
173
|
color: var(--puck-color-grey-08);
|
@@ -176,17 +180,17 @@
|
|
176
180
|
justify-content: center;
|
177
181
|
transition: color 50ms ease-in;
|
178
182
|
}
|
179
|
-
._ActionBarComponent-
|
183
|
+
._ActionBarComponent-action_8nyey_15:focus-visible {
|
180
184
|
outline: 2px solid var(--puck-color-azure-05);
|
181
185
|
outline-offset: -2px;
|
182
186
|
}
|
183
187
|
@media (hover: hover) and (pointer: fine) {
|
184
|
-
._ActionBarComponent-
|
188
|
+
._ActionBarComponent-action_8nyey_15:hover {
|
185
189
|
color: var(--puck-color-azure-06);
|
186
190
|
transition: none;
|
187
191
|
}
|
188
192
|
}
|
189
|
-
._ActionBarComponent-
|
193
|
+
._ActionBarComponent-action_8nyey_15:active {
|
190
194
|
color: var(--puck-color-azure-07);
|
191
195
|
transition: none;
|
192
196
|
}
|
@@ -578,14 +582,17 @@ textarea._Input-input_3pq3z_47 {
|
|
578
582
|
}
|
579
583
|
|
580
584
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/DragIcon/styles.module.css/#css-module-data */
|
581
|
-
.
|
585
|
+
._DragIcon_17p8x_1 {
|
582
586
|
color: var(--puck-color-grey-05);
|
583
587
|
cursor: grab;
|
584
588
|
padding: 4px;
|
585
589
|
border-radius: 4px;
|
586
590
|
}
|
591
|
+
._DragIcon--disabled_17p8x_8 {
|
592
|
+
cursor: no-drop;
|
593
|
+
}
|
587
594
|
@media (hover: hover) and (pointer: fine) {
|
588
|
-
.
|
595
|
+
._DragIcon_17p8x_1:not(._DragIcon--disabled_17p8x_8):hover {
|
589
596
|
color: var(--puck-color-azure-05);
|
590
597
|
background-color: var(--puck-color-azure-12);
|
591
598
|
}
|
@@ -1044,16 +1051,21 @@ textarea._Input-input_3pq3z_47 {
|
|
1044
1051
|
}
|
1045
1052
|
|
1046
1053
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Drawer/styles.module.css/#css-module-data */
|
1047
|
-
.
|
1054
|
+
._Drawer_4yfqn_1 {
|
1048
1055
|
font-family: var(--puck-font-family);
|
1049
1056
|
}
|
1050
|
-
._DrawerItem
|
1057
|
+
._DrawerItem--disabled_4yfqn_5 {
|
1058
|
+
background: var(--puck-color-grey-11);
|
1059
|
+
color: var(--puck-color-grey-05);
|
1060
|
+
cursor: not-allowed;
|
1061
|
+
}
|
1062
|
+
._DrawerItem-default_4yfqn_11 ._DrawerItem-draggableWrapper_4yfqn_11 {
|
1051
1063
|
padding-bottom: 12px;
|
1052
1064
|
}
|
1053
|
-
.
|
1065
|
+
._DrawerItem_4yfqn_5:last-of-type ._DrawerItem-default_4yfqn_11 ._DrawerItem-draggableWrapper_4yfqn_11 {
|
1054
1066
|
padding-bottom: 0;
|
1055
1067
|
}
|
1056
|
-
._DrawerItem-
|
1068
|
+
._DrawerItem-draggable_4yfqn_11 {
|
1057
1069
|
background: var(--puck-color-white);
|
1058
1070
|
padding: 12px;
|
1059
1071
|
display: flex;
|
@@ -1062,25 +1074,24 @@ textarea._Input-input_3pq3z_47 {
|
|
1062
1074
|
font-size: var(--puck-font-size-xxs);
|
1063
1075
|
justify-content: space-between;
|
1064
1076
|
align-items: center;
|
1065
|
-
cursor: grab;
|
1066
1077
|
transition: background-color 50ms ease-in, color 50ms ease-in;
|
1067
1078
|
}
|
1068
|
-
.
|
1079
|
+
._DrawerItem_4yfqn_5:focus-visible {
|
1069
1080
|
outline: 0;
|
1070
1081
|
}
|
1071
|
-
.
|
1082
|
+
._Drawer_4yfqn_1:not(._Drawer--isDraggingFrom_4yfqn_36) ._DrawerItem_4yfqn_5:focus-visible ._DrawerItem-draggable_4yfqn_11 {
|
1072
1083
|
border-radius: 4px;
|
1073
1084
|
outline: 2px solid var(--puck-color-azure-05);
|
1074
1085
|
outline-offset: 2px;
|
1075
1086
|
}
|
1076
1087
|
@media (hover: hover) and (pointer: fine) {
|
1077
|
-
.
|
1088
|
+
._Drawer_4yfqn_1:not(._Drawer--isDraggingFrom_4yfqn_36) ._DrawerItem_4yfqn_5:not(._DrawerItem--disabled_4yfqn_5) ._DrawerItem-draggable_4yfqn_11:hover {
|
1078
1089
|
background-color: var(--puck-color-azure-12);
|
1079
1090
|
color: var(--puck-color-azure-04);
|
1080
1091
|
transition: none;
|
1081
1092
|
}
|
1082
1093
|
}
|
1083
|
-
._DrawerItem-
|
1094
|
+
._DrawerItem-name_4yfqn_54 {
|
1084
1095
|
overflow-x: hidden;
|
1085
1096
|
text-overflow: ellipsis;
|
1086
1097
|
white-space: nowrap;
|
@@ -1721,7 +1732,7 @@ textarea._Input-input_3pq3z_47 {
|
|
1721
1732
|
}
|
1722
1733
|
|
1723
1734
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Puck/components/Canvas/styles.module.css/#css-module-data */
|
1724
|
-
.
|
1735
|
+
._PuckCanvas_esbg1_1 {
|
1725
1736
|
background: var(--puck-color-grey-11);
|
1726
1737
|
display: flex;
|
1727
1738
|
grid-area: editor;
|
@@ -1730,15 +1741,15 @@ textarea._Input-input_3pq3z_47 {
|
|
1730
1741
|
overflow: auto;
|
1731
1742
|
}
|
1732
1743
|
@media (min-width: 1198px) {
|
1733
|
-
.
|
1744
|
+
._PuckCanvas_esbg1_1 {
|
1734
1745
|
padding: calc(var(--puck-space-px) * 1.5);
|
1735
1746
|
padding-top: var(--puck-space-px);
|
1736
1747
|
}
|
1737
|
-
.
|
1748
|
+
._PuckCanvas_esbg1_1:not(._PuckCanvas_esbg1_1:has(._PuckCanvas-controls_esbg1_16)) {
|
1738
1749
|
padding-top: calc(var(--puck-space-px) * 1.5);
|
1739
1750
|
}
|
1740
1751
|
}
|
1741
|
-
._PuckCanvas-
|
1752
|
+
._PuckCanvas-inner_esbg1_21 {
|
1742
1753
|
box-sizing: border-box;
|
1743
1754
|
display: flex;
|
1744
1755
|
height: 100%;
|
@@ -1748,7 +1759,7 @@ textarea._Input-input_3pq3z_47 {
|
|
1748
1759
|
position: relative;
|
1749
1760
|
width: 100%;
|
1750
1761
|
}
|
1751
|
-
._PuckCanvas-
|
1762
|
+
._PuckCanvas-root_esbg1_32 {
|
1752
1763
|
background: white;
|
1753
1764
|
border: 1px solid var(--puck-color-grey-09);
|
1754
1765
|
box-sizing: border-box;
|
@@ -1760,16 +1771,32 @@ textarea._Input-input_3pq3z_47 {
|
|
1760
1771
|
opacity: 0;
|
1761
1772
|
}
|
1762
1773
|
@media (min-width: 1198px) {
|
1763
|
-
._PuckCanvas-
|
1774
|
+
._PuckCanvas-root_esbg1_32 {
|
1764
1775
|
min-width: unset;
|
1765
1776
|
}
|
1766
1777
|
}
|
1767
1778
|
@media (prefers-reduced-motion: reduce) {
|
1768
|
-
._PuckCanvas-
|
1779
|
+
._PuckCanvas-root_esbg1_32 {
|
1769
1780
|
transition: none !important;
|
1770
1781
|
}
|
1771
1782
|
}
|
1772
|
-
._PuckCanvas--
|
1783
|
+
._PuckCanvas--ready_esbg1_56 ._PuckCanvas-root_esbg1_32 {
|
1773
1784
|
opacity: 1;
|
1774
|
-
|
1785
|
+
}
|
1786
|
+
._PuckCanvas-loader_esbg1_60 {
|
1787
|
+
align-items: center;
|
1788
|
+
color: var(--puck-color-grey-06);
|
1789
|
+
display: flex;
|
1790
|
+
height: 100%;
|
1791
|
+
justify-content: center;
|
1792
|
+
transition: opacity 250ms ease-out;
|
1793
|
+
opacity: 0;
|
1794
|
+
}
|
1795
|
+
._PuckCanvas--showLoader_esbg1_70 ._PuckCanvas-loader_esbg1_60 {
|
1796
|
+
opacity: 1;
|
1797
|
+
}
|
1798
|
+
._PuckCanvas--showLoader_esbg1_70._PuckCanvas--ready_esbg1_56 ._PuckCanvas-loader_esbg1_60 {
|
1799
|
+
opacity: 0;
|
1800
|
+
height: 0;
|
1801
|
+
transition: none;
|
1775
1802
|
}
|
package/dist/index.d.mts
ADDED
@@ -0,0 +1,245 @@
|
|
1
|
+
import { F as Field, a as FieldProps, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, E as ExtractPropsFromConfig, c as ExtractRootPropsFromConfig, U as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, A as AppState, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, k as ComponentData, H as History } from './actions-BaAekM3E.mjs';
|
2
|
+
export { K as Adaptor, G as ArrayField, q as ArrayState, a1 as AsFieldProps, B as BaseData, x as BaseField, s as ComponentConfig, v as ComponentDataMap, w as Content, W as CustomField, _ as DefaultRootProps, Z as DefaultRootRenderProps, Q as ExternalField, L as ExternalFieldWithAdaptor, n as FieldRenderFunctions, X as Fields, p as ItemWithId, M as MappedItem, N as NumberField, J as ObjectField, m as OverrideKey, r as PuckComponent, Y as PuckContext, z as RadioField, u as RootData, R as RootDataWithProps, t as RootDataWithoutProps, S as SelectField, T as TextField, y as TextareaField, l as Viewport, a2 as WithChildren, $ as WithId, a0 as WithPuckProps, o as overrideKeys } from './actions-BaAekM3E.mjs';
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
|
+
import * as react from 'react';
|
5
|
+
import { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
|
6
|
+
import { DragStart, DragUpdate } from '@measured/dnd';
|
7
|
+
|
8
|
+
declare const ActionBar: {
|
9
|
+
({ label, children, }: {
|
10
|
+
label?: string;
|
11
|
+
children?: ReactNode;
|
12
|
+
}): react_jsx_runtime.JSX.Element;
|
13
|
+
Action: ({ children, label, onClick, }: {
|
14
|
+
children: ReactNode;
|
15
|
+
label?: string;
|
16
|
+
onClick: (e: SyntheticEvent) => void;
|
17
|
+
}) => react_jsx_runtime.JSX.Element;
|
18
|
+
};
|
19
|
+
declare const Action: ({ children, label, onClick, }: {
|
20
|
+
children: ReactNode;
|
21
|
+
label?: string;
|
22
|
+
onClick: (e: SyntheticEvent) => void;
|
23
|
+
}) => react_jsx_runtime.JSX.Element;
|
24
|
+
|
25
|
+
declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
|
26
|
+
children?: ReactNode;
|
27
|
+
icon?: ReactNode;
|
28
|
+
label: string;
|
29
|
+
el?: "label" | "div";
|
30
|
+
readOnly?: boolean;
|
31
|
+
className?: string;
|
32
|
+
}) => react_jsx_runtime.JSX.Element;
|
33
|
+
type FieldLabelPropsInternal = {
|
34
|
+
children?: ReactNode;
|
35
|
+
icon?: ReactNode;
|
36
|
+
label?: string;
|
37
|
+
el?: "label" | "div";
|
38
|
+
readOnly?: boolean;
|
39
|
+
};
|
40
|
+
declare const FieldLabelInternal: ({ children, icon, label, el, readOnly, }: FieldLabelPropsInternal) => react_jsx_runtime.JSX.Element;
|
41
|
+
type FieldPropsInternalOptional<ValueType = any, F = Field<any>> = FieldProps<ValueType, F> & {
|
42
|
+
Label?: React.FC<FieldLabelPropsInternal>;
|
43
|
+
label?: string;
|
44
|
+
name?: string;
|
45
|
+
};
|
46
|
+
type FieldPropsInternal<ValueType = any, F = Field<any>> = FieldProps<ValueType, F> & {
|
47
|
+
Label: React.FC<FieldLabelPropsInternal>;
|
48
|
+
label?: string;
|
49
|
+
id: string;
|
50
|
+
name?: string;
|
51
|
+
};
|
52
|
+
declare function AutoFieldPrivate<ValueType = any, FieldType extends Field<ValueType> = Field<ValueType>>(props: FieldPropsInternalOptional<ValueType, FieldType> & {
|
53
|
+
Label?: React.FC<FieldLabelPropsInternal>;
|
54
|
+
}): react_jsx_runtime.JSX.Element;
|
55
|
+
declare function AutoField<ValueType = any, FieldType extends Field<ValueType> = Field<ValueType>>(props: FieldProps<ValueType, FieldType>): react_jsx_runtime.JSX.Element;
|
56
|
+
|
57
|
+
declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, }: {
|
58
|
+
children: ReactNode;
|
59
|
+
href?: string;
|
60
|
+
onClick?: (e: any) => void | Promise<void>;
|
61
|
+
variant?: "primary" | "secondary";
|
62
|
+
type?: "button" | "submit" | "reset";
|
63
|
+
disabled?: boolean;
|
64
|
+
tabIndex?: number;
|
65
|
+
newTab?: boolean;
|
66
|
+
fullWidth?: boolean;
|
67
|
+
icon?: ReactNode;
|
68
|
+
size?: "medium" | "large";
|
69
|
+
loading?: boolean;
|
70
|
+
}) => react_jsx_runtime.JSX.Element;
|
71
|
+
|
72
|
+
declare const Drawer: {
|
73
|
+
({ children, droppableId: _droppableId, direction, }: {
|
74
|
+
children: ReactNode;
|
75
|
+
droppableId?: string;
|
76
|
+
direction?: "vertical" | "horizontal";
|
77
|
+
}): react_jsx_runtime.JSX.Element;
|
78
|
+
Item: ({ name, children, id, label, index, isDragDisabled, }: {
|
79
|
+
name: string;
|
80
|
+
children?: (props: {
|
81
|
+
children: ReactNode;
|
82
|
+
name: string;
|
83
|
+
}) => ReactElement;
|
84
|
+
id?: string;
|
85
|
+
label?: string;
|
86
|
+
index: number;
|
87
|
+
isDragDisabled?: boolean;
|
88
|
+
}) => react_jsx_runtime.JSX.Element;
|
89
|
+
};
|
90
|
+
|
91
|
+
type PathData = Record<string, {
|
92
|
+
path: string[];
|
93
|
+
label: string;
|
94
|
+
}>;
|
95
|
+
type DropZoneContext<UserConfig extends Config = Config> = {
|
96
|
+
data: Data;
|
97
|
+
config: UserConfig;
|
98
|
+
componentState?: Record<string, any>;
|
99
|
+
itemSelector?: ItemSelector | null;
|
100
|
+
setItemSelector?: (newIndex: ItemSelector | null) => void;
|
101
|
+
dispatch?: (action: PuckAction) => void;
|
102
|
+
areaId?: string;
|
103
|
+
draggedItem?: DragStart & Partial<DragUpdate>;
|
104
|
+
placeholderStyle?: CSSProperties;
|
105
|
+
hoveringArea?: string | null;
|
106
|
+
setHoveringArea?: (area: string | null) => void;
|
107
|
+
hoveringZone?: string | null;
|
108
|
+
setHoveringZone?: (zone: string | null) => void;
|
109
|
+
hoveringComponent?: string | null;
|
110
|
+
setHoveringComponent?: (id: string | null) => void;
|
111
|
+
registerZoneArea?: (areaId: string) => void;
|
112
|
+
areasWithZones?: Record<string, boolean>;
|
113
|
+
registerZone?: (zoneCompound: string) => void;
|
114
|
+
unregisterZone?: (zoneCompound: string) => void;
|
115
|
+
activeZones?: Record<string, boolean>;
|
116
|
+
pathData?: PathData;
|
117
|
+
registerPath?: (selector: ItemSelector) => void;
|
118
|
+
mode?: "edit" | "render";
|
119
|
+
zoneWillDrag?: string;
|
120
|
+
setZoneWillDrag?: (zone: string) => void;
|
121
|
+
} | null;
|
122
|
+
declare const dropZoneContext: react.Context<DropZoneContext<Config>>;
|
123
|
+
declare const DropZoneProvider: ({ children, value, }: {
|
124
|
+
children: ReactNode;
|
125
|
+
value: DropZoneContext;
|
126
|
+
}) => react_jsx_runtime.JSX.Element;
|
127
|
+
|
128
|
+
declare function DropZone(props: DropZoneProps): react_jsx_runtime.JSX.Element;
|
129
|
+
|
130
|
+
declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
131
|
+
children: ReactNode;
|
132
|
+
href?: string;
|
133
|
+
onClick?: (e: SyntheticEvent) => void | Promise<void>;
|
134
|
+
variant?: "primary" | "secondary";
|
135
|
+
type?: "button" | "submit" | "reset";
|
136
|
+
disabled?: boolean;
|
137
|
+
tabIndex?: number;
|
138
|
+
newTab?: boolean;
|
139
|
+
fullWidth?: boolean;
|
140
|
+
title: string;
|
141
|
+
}) => react_jsx_runtime.JSX.Element;
|
142
|
+
|
143
|
+
declare function Puck<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>>({ children, config, data: initialData, ui: initialUi, onChange, onPublish, onAction, permissions, plugins, overrides, renderHeader, renderHeaderActions, headerTitle, headerPath, viewports, iframe: _iframe, dnd, initialHistory: _initialHistory, }: {
|
144
|
+
children?: ReactNode;
|
145
|
+
config: UserConfig;
|
146
|
+
data: Partial<UserData>;
|
147
|
+
ui?: Partial<UiState>;
|
148
|
+
onChange?: (data: UserData) => void;
|
149
|
+
onPublish?: (data: UserData) => void;
|
150
|
+
onAction?: OnAction<UserData>;
|
151
|
+
permissions?: Partial<Permissions>;
|
152
|
+
plugins?: Plugin[];
|
153
|
+
overrides?: Partial<Overrides>;
|
154
|
+
renderHeader?: (props: {
|
155
|
+
children: ReactNode;
|
156
|
+
dispatch: (action: PuckAction) => void;
|
157
|
+
state: AppState<UserData>;
|
158
|
+
}) => ReactElement;
|
159
|
+
renderHeaderActions?: (props: {
|
160
|
+
state: AppState<UserData>;
|
161
|
+
dispatch: (action: PuckAction) => void;
|
162
|
+
}) => ReactElement;
|
163
|
+
headerTitle?: string;
|
164
|
+
headerPath?: string;
|
165
|
+
viewports?: Viewports;
|
166
|
+
iframe?: IframeConfig;
|
167
|
+
dnd?: {
|
168
|
+
disableAutoScroll?: boolean;
|
169
|
+
};
|
170
|
+
initialHistory?: InitialHistory;
|
171
|
+
}): react_jsx_runtime.JSX.Element;
|
172
|
+
declare namespace Puck {
|
173
|
+
var Components: () => react_jsx_runtime.JSX.Element;
|
174
|
+
var Fields: () => react_jsx_runtime.JSX.Element;
|
175
|
+
var Outline: () => react_jsx_runtime.JSX.Element;
|
176
|
+
var Preview: ({ id }: {
|
177
|
+
id?: string;
|
178
|
+
}) => react_jsx_runtime.JSX.Element;
|
179
|
+
}
|
180
|
+
|
181
|
+
declare function Render<UserConfig extends Config = Config, UserProps extends ExtractPropsFromConfig<UserConfig> = ExtractPropsFromConfig<UserConfig>, UserRootProps extends ExtractRootPropsFromConfig<UserConfig> = ExtractRootPropsFromConfig<UserConfig>, UserData extends Data<UserProps, UserRootProps> | Data = Data<UserProps, UserRootProps>>({ config, data }: {
|
182
|
+
config: UserConfig;
|
183
|
+
data: Partial<UserData>;
|
184
|
+
}): react_jsx_runtime.JSX.Element;
|
185
|
+
|
186
|
+
declare function migrate(data: Data): Data;
|
187
|
+
|
188
|
+
type PropTransform<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
|
189
|
+
[ComponentName in keyof Props]: (props: Props[ComponentName] & {
|
190
|
+
[key: string]: any;
|
191
|
+
}) => Props[ComponentName];
|
192
|
+
} & {
|
193
|
+
root: (props: RootProps & {
|
194
|
+
[key: string]: any;
|
195
|
+
}) => RootProps;
|
196
|
+
}>;
|
197
|
+
declare function transformProps<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Props, RootProps>): Data;
|
198
|
+
|
199
|
+
declare function resolveAllData<Props extends DefaultComponentProps = DefaultComponentProps, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Props, RootProps>>;
|
200
|
+
|
201
|
+
type HistoryStore<D = any> = {
|
202
|
+
index: number;
|
203
|
+
hasPast: boolean;
|
204
|
+
hasFuture: boolean;
|
205
|
+
histories: History<D>[];
|
206
|
+
record: (data: D) => void;
|
207
|
+
back: VoidFunction;
|
208
|
+
forward: VoidFunction;
|
209
|
+
currentHistory: History;
|
210
|
+
nextHistory: History<D> | null;
|
211
|
+
prevHistory: History<D> | null;
|
212
|
+
setHistories: (histories: History[]) => void;
|
213
|
+
setHistoryIndex: (index: number) => void;
|
214
|
+
};
|
215
|
+
|
216
|
+
declare const usePuck: () => {
|
217
|
+
appState: AppState;
|
218
|
+
config: Config;
|
219
|
+
dispatch: (action: PuckAction) => void;
|
220
|
+
getPermissions: ({ item, type, }?: {
|
221
|
+
item?: ComponentData;
|
222
|
+
type?: keyof DefaultComponentProps;
|
223
|
+
}) => {
|
224
|
+
[x: string]: boolean | undefined;
|
225
|
+
drag?: boolean | undefined;
|
226
|
+
duplicate?: boolean | undefined;
|
227
|
+
delete?: boolean | undefined;
|
228
|
+
edit?: boolean | undefined;
|
229
|
+
insert?: boolean | undefined;
|
230
|
+
};
|
231
|
+
history: {
|
232
|
+
back: VoidFunction;
|
233
|
+
forward: VoidFunction;
|
234
|
+
setHistories: (histories: History[]) => void;
|
235
|
+
setHistoryIndex: (index: number) => void;
|
236
|
+
hasPast: boolean;
|
237
|
+
hasFuture: boolean;
|
238
|
+
histories: History<any>[];
|
239
|
+
index: number;
|
240
|
+
historyStore: HistoryStore | undefined;
|
241
|
+
};
|
242
|
+
selectedItem: ComponentData<any, string> | null;
|
243
|
+
};
|
244
|
+
|
245
|
+
export { Action, ActionBar, AppState, AutoField, AutoFieldPrivate, Button, ComponentData, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, DropZone, DropZoneProvider, ExtractPropsFromConfig, ExtractRootPropsFromConfig, Field, FieldLabel, FieldLabelInternal, FieldProps, type FieldPropsInternal, History, IconButton, IframeConfig, InitialHistory, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, Render, UiState, Viewports, dropZoneContext, migrate, resolveAllData, transformProps, usePuck };
|