@measured/puck 0.21.0-canary.7dca3a5a → 0.21.0-canary.8358d3e1
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/Editor-F2LSS6SE.css +403 -0
- package/dist/Editor-N46HUQEC.mjs +201 -0
- package/dist/Render-QEMDIDQC.css +101 -0
- package/dist/Render-Y567PGZ7.mjs +53 -0
- package/dist/chunk-3QHWXJEI.mjs +33 -0
- package/dist/chunk-7KY6RHEY.mjs +2230 -0
- package/dist/chunk-C2TVYIYC.mjs +415 -0
- package/dist/chunk-DCSQEDMK.mjs +194 -0
- package/dist/chunk-DJSH5REF.mjs +537 -0
- package/dist/chunk-DNF2EMM4.mjs +63 -0
- package/dist/chunk-FNWOH4R6.mjs +109 -0
- package/dist/chunk-GQKMOYLG.mjs +53 -0
- package/dist/chunk-K3V4LVUL.mjs +704 -0
- package/dist/{chunk-FKDVYRQW.mjs → chunk-N5XMZOMC.mjs} +5078 -7463
- package/dist/chunk-R6CVX2IY.mjs +103 -0
- package/dist/chunk-WUWXFMEM.mjs +11 -0
- package/dist/full-2GJTAAZE.css +301 -0
- package/dist/full-NLUNPJWS.mjs +90 -0
- package/dist/index.css +636 -758
- package/dist/index.d.mts +101 -20
- package/dist/index.d.ts +101 -20
- package/dist/index.js +7363 -4751
- package/dist/index.mjs +25 -15
- package/dist/loaded-EV34KGYJ.mjs +57 -0
- package/dist/loaded-HMSPJUZM.mjs +54 -0
- package/dist/loaded-RVWBFK7L.css +87 -0
- package/dist/loaded-ZXOU6S6R.mjs +54 -0
- package/dist/no-external.css +636 -758
- package/dist/no-external.d.mts +17 -2
- package/dist/no-external.d.ts +17 -2
- package/dist/no-external.js +7360 -4748
- package/dist/no-external.mjs +25 -15
- package/dist/rsc.css +101 -0
- package/dist/rsc.d.mts +17 -2
- package/dist/rsc.d.ts +17 -2
- package/dist/rsc.js +419 -34
- package/dist/rsc.mjs +16 -9
- package/dist/{walk-tree-DS1xB387.d.mts → walk-tree-Ja9bNCM9.d.mts} +216 -26
- package/dist/{walk-tree-DS1xB387.d.ts → walk-tree-Ja9bNCM9.d.ts} +216 -26
- package/package.json +23 -1
- package/dist/chunk-6SIKCDJJ.mjs +0 -967
package/dist/rsc.mjs
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SlotRenderPure,
|
|
3
|
-
__spreadProps,
|
|
4
|
-
__spreadValues,
|
|
5
|
-
init_react_import,
|
|
6
3
|
migrate,
|
|
7
4
|
resolveAllData,
|
|
5
|
+
transformProps,
|
|
6
|
+
useRichtextProps,
|
|
7
|
+
useSlots
|
|
8
|
+
} from "./chunk-C2TVYIYC.mjs";
|
|
9
|
+
import "./chunk-WUWXFMEM.mjs";
|
|
10
|
+
import {
|
|
8
11
|
rootAreaId,
|
|
9
12
|
rootDroppableId,
|
|
10
13
|
rootZone,
|
|
11
14
|
setupZone,
|
|
12
|
-
transformProps,
|
|
13
|
-
useSlots,
|
|
14
15
|
walkTree
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DJSH5REF.mjs";
|
|
17
|
+
import {
|
|
18
|
+
__spreadProps,
|
|
19
|
+
__spreadValues,
|
|
20
|
+
init_react_import
|
|
21
|
+
} from "./chunk-DCSQEDMK.mjs";
|
|
16
22
|
|
|
17
23
|
// bundle/rsc.tsx
|
|
18
24
|
init_react_import();
|
|
@@ -68,7 +74,7 @@ function Render({
|
|
|
68
74
|
data,
|
|
69
75
|
metadata = {}
|
|
70
76
|
}) {
|
|
71
|
-
var _a;
|
|
77
|
+
var _a, _b;
|
|
72
78
|
const rootProps = "props" in data.root ? data.root.props : data.root;
|
|
73
79
|
const title = rootProps.title || "";
|
|
74
80
|
const props = __spreadProps(__spreadValues({}, rootProps), {
|
|
@@ -91,8 +97,9 @@ function Render({
|
|
|
91
97
|
id: "puck-root"
|
|
92
98
|
});
|
|
93
99
|
const propsWithSlots = useSlots(config, { type: "root", props }, (props2) => /* @__PURE__ */ jsx(SlotRenderPure, __spreadProps(__spreadValues({}, props2), { config, metadata })));
|
|
94
|
-
|
|
95
|
-
|
|
100
|
+
const richtextProps = useRichtextProps((_a = config.root) == null ? void 0 : _a.fields, props);
|
|
101
|
+
if ((_b = config.root) == null ? void 0 : _b.render) {
|
|
102
|
+
return /* @__PURE__ */ jsx(config.root.render, __spreadProps(__spreadValues(__spreadValues({}, propsWithSlots), richtextProps), { children: /* @__PURE__ */ jsx(
|
|
96
103
|
DropZoneRender,
|
|
97
104
|
{
|
|
98
105
|
config,
|
|
@@ -1,10 +1,185 @@
|
|
|
1
|
-
import { ReactElement, CSSProperties, ReactNode, JSX } from 'react';
|
|
1
|
+
import { ReactElement, CSSProperties, ReactNode, ElementType, JSX } from 'react';
|
|
2
|
+
import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
|
|
3
|
+
import { BlockquoteOptions } from '@tiptap/extension-blockquote';
|
|
4
|
+
import { BoldOptions } from '@tiptap/extension-bold';
|
|
5
|
+
import { CodeOptions } from '@tiptap/extension-code';
|
|
6
|
+
import { CodeBlockOptions } from '@tiptap/extension-code-block';
|
|
7
|
+
import { HardBreakOptions } from '@tiptap/extension-hard-break';
|
|
8
|
+
import { HeadingOptions } from '@tiptap/extension-heading';
|
|
9
|
+
import { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule';
|
|
10
|
+
import { ItalicOptions } from '@tiptap/extension-italic';
|
|
11
|
+
import { LinkOptions } from '@tiptap/extension-link';
|
|
12
|
+
import { BulletListOptions, ListItemOptions, ListKeymapOptions, OrderedListOptions } from '@tiptap/extension-list';
|
|
13
|
+
import { ParagraphOptions } from '@tiptap/extension-paragraph';
|
|
14
|
+
import { StrikeOptions } from '@tiptap/extension-strike';
|
|
15
|
+
import { TextAlignOptions } from '@tiptap/extension-text-align';
|
|
16
|
+
import { UnderlineOptions } from '@tiptap/extension-underline';
|
|
2
17
|
|
|
3
18
|
type ItemSelector = {
|
|
4
19
|
index: number;
|
|
5
20
|
zone?: string;
|
|
6
21
|
};
|
|
7
22
|
|
|
23
|
+
declare const defaultEditorState: (ctx: EditorStateSnapshot, readOnly: boolean) => {
|
|
24
|
+
isAlignLeft?: undefined;
|
|
25
|
+
canAlignLeft?: undefined;
|
|
26
|
+
isAlignCenter?: undefined;
|
|
27
|
+
canAlignCenter?: undefined;
|
|
28
|
+
isAlignRight?: undefined;
|
|
29
|
+
canAlignRight?: undefined;
|
|
30
|
+
isAlignJustify?: undefined;
|
|
31
|
+
canAlignJustify?: undefined;
|
|
32
|
+
isBold?: undefined;
|
|
33
|
+
canBold?: undefined;
|
|
34
|
+
isItalic?: undefined;
|
|
35
|
+
canItalic?: undefined;
|
|
36
|
+
isUnderline?: undefined;
|
|
37
|
+
canUnderline?: undefined;
|
|
38
|
+
isStrike?: undefined;
|
|
39
|
+
canStrike?: undefined;
|
|
40
|
+
isInlineCode?: undefined;
|
|
41
|
+
canInlineCode?: undefined;
|
|
42
|
+
isBulletList?: undefined;
|
|
43
|
+
canBulletList?: undefined;
|
|
44
|
+
isOrderedList?: undefined;
|
|
45
|
+
canOrderedList?: undefined;
|
|
46
|
+
isCodeBlock?: undefined;
|
|
47
|
+
canCodeBlock?: undefined;
|
|
48
|
+
isBlockquote?: undefined;
|
|
49
|
+
canBlockquote?: undefined;
|
|
50
|
+
canHorizontalRule?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
isAlignLeft: boolean;
|
|
53
|
+
canAlignLeft: boolean;
|
|
54
|
+
isAlignCenter: boolean;
|
|
55
|
+
canAlignCenter: boolean;
|
|
56
|
+
isAlignRight: boolean;
|
|
57
|
+
canAlignRight: boolean;
|
|
58
|
+
isAlignJustify: boolean;
|
|
59
|
+
canAlignJustify: boolean;
|
|
60
|
+
isBold: boolean;
|
|
61
|
+
canBold: boolean;
|
|
62
|
+
isItalic: boolean;
|
|
63
|
+
canItalic: boolean;
|
|
64
|
+
isUnderline: boolean;
|
|
65
|
+
canUnderline: boolean;
|
|
66
|
+
isStrike: boolean;
|
|
67
|
+
canStrike: boolean;
|
|
68
|
+
isInlineCode: boolean;
|
|
69
|
+
canInlineCode: boolean;
|
|
70
|
+
isBulletList: boolean;
|
|
71
|
+
canBulletList: boolean;
|
|
72
|
+
isOrderedList: boolean;
|
|
73
|
+
canOrderedList: boolean;
|
|
74
|
+
isCodeBlock: boolean;
|
|
75
|
+
canCodeBlock: boolean;
|
|
76
|
+
isBlockquote: boolean;
|
|
77
|
+
canBlockquote: boolean;
|
|
78
|
+
canHorizontalRule: boolean;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
type RichTextSelector = (ctx: EditorStateSnapshot, readOnly: boolean) => Partial<Record<string, boolean>>;
|
|
82
|
+
type DefaultEditorState = ReturnType<typeof defaultEditorState>;
|
|
83
|
+
type EditorState<Selector extends RichTextSelector = RichTextSelector> = DefaultEditorState & ReturnType<Selector> & Record<string, boolean | undefined>;
|
|
84
|
+
|
|
85
|
+
interface PuckRichTextOptions {
|
|
86
|
+
/**
|
|
87
|
+
* If set to false, the blockquote extension will not be registered
|
|
88
|
+
* @example blockquote: false
|
|
89
|
+
*/
|
|
90
|
+
blockquote: Partial<BlockquoteOptions> | false;
|
|
91
|
+
/**
|
|
92
|
+
* If set to false, the bold extension will not be registered
|
|
93
|
+
* @example bold: false
|
|
94
|
+
*/
|
|
95
|
+
bold: Partial<BoldOptions> | false;
|
|
96
|
+
/**
|
|
97
|
+
* If set to false, the bulletList extension will not be registered
|
|
98
|
+
* @example bulletList: false
|
|
99
|
+
*/
|
|
100
|
+
bulletList: Partial<BulletListOptions> | false;
|
|
101
|
+
/**
|
|
102
|
+
* If set to false, the code extension will not be registered
|
|
103
|
+
* @example code: false
|
|
104
|
+
*/
|
|
105
|
+
code: Partial<CodeOptions> | false;
|
|
106
|
+
/**
|
|
107
|
+
* If set to false, the codeBlock extension will not be registered
|
|
108
|
+
* @example codeBlock: false
|
|
109
|
+
*/
|
|
110
|
+
codeBlock: Partial<CodeBlockOptions> | false;
|
|
111
|
+
/**
|
|
112
|
+
* If set to false, the document extension will not be registered
|
|
113
|
+
* @example document: false
|
|
114
|
+
*/
|
|
115
|
+
document: false;
|
|
116
|
+
/**
|
|
117
|
+
* If set to false, the hardBreak extension will not be registered
|
|
118
|
+
* @example hardBreak: false
|
|
119
|
+
*/
|
|
120
|
+
hardBreak: Partial<HardBreakOptions> | false;
|
|
121
|
+
/**
|
|
122
|
+
* If set to false, the heading extension will not be registered
|
|
123
|
+
* @example heading: false
|
|
124
|
+
*/
|
|
125
|
+
heading: Partial<HeadingOptions> | false;
|
|
126
|
+
/**
|
|
127
|
+
* If set to false, the horizontalRule extension will not be registered
|
|
128
|
+
* @example horizontalRule: false
|
|
129
|
+
*/
|
|
130
|
+
horizontalRule: Partial<HorizontalRuleOptions> | false;
|
|
131
|
+
/**
|
|
132
|
+
* If set to false, the italic extension will not be registered
|
|
133
|
+
* @example italic: false
|
|
134
|
+
*/
|
|
135
|
+
italic: Partial<ItalicOptions> | false;
|
|
136
|
+
/**
|
|
137
|
+
* If set to false, the listItem extension will not be registered
|
|
138
|
+
* @example listItem: false
|
|
139
|
+
*/
|
|
140
|
+
listItem: Partial<ListItemOptions> | false;
|
|
141
|
+
/**
|
|
142
|
+
* If set to false, the listItemKeymap extension will not be registered
|
|
143
|
+
* @example listKeymap: false
|
|
144
|
+
*/
|
|
145
|
+
listKeymap: Partial<ListKeymapOptions> | false;
|
|
146
|
+
/**
|
|
147
|
+
* If set to false, the link extension will not be registered
|
|
148
|
+
* @example link: false
|
|
149
|
+
*/
|
|
150
|
+
link: Partial<LinkOptions> | false;
|
|
151
|
+
/**
|
|
152
|
+
* If set to false, the orderedList extension will not be registered
|
|
153
|
+
* @example orderedList: false
|
|
154
|
+
*/
|
|
155
|
+
orderedList: Partial<OrderedListOptions> | false;
|
|
156
|
+
/**
|
|
157
|
+
* If set to false, the paragraph extension will not be registered
|
|
158
|
+
* @example paragraph: false
|
|
159
|
+
*/
|
|
160
|
+
paragraph: Partial<ParagraphOptions> | false;
|
|
161
|
+
/**
|
|
162
|
+
* If set to false, the strike extension will not be registered
|
|
163
|
+
* @example strike: false
|
|
164
|
+
*/
|
|
165
|
+
strike: Partial<StrikeOptions> | false;
|
|
166
|
+
/**
|
|
167
|
+
* If set to false, the text extension will not be registered
|
|
168
|
+
* @example text: false
|
|
169
|
+
*/
|
|
170
|
+
text: false;
|
|
171
|
+
/**
|
|
172
|
+
* If set to false, the textAlign extension will not be registered
|
|
173
|
+
* @example text: false
|
|
174
|
+
*/
|
|
175
|
+
textAlign: Partial<TextAlignOptions> | false;
|
|
176
|
+
/**
|
|
177
|
+
* If set to false, the underline extension will not be registered
|
|
178
|
+
* @example underline: false
|
|
179
|
+
*/
|
|
180
|
+
underline: Partial<UnderlineOptions> | false;
|
|
181
|
+
}
|
|
182
|
+
|
|
8
183
|
type FieldOption = {
|
|
9
184
|
label: string;
|
|
10
185
|
value: string | number | boolean | undefined | null | object;
|
|
@@ -41,6 +216,28 @@ interface RadioField extends BaseField {
|
|
|
41
216
|
type: "radio";
|
|
42
217
|
options: FieldOptions;
|
|
43
218
|
}
|
|
219
|
+
interface RichtextField<UserSelector extends RichTextSelector = RichTextSelector> extends BaseField {
|
|
220
|
+
type: "richtext";
|
|
221
|
+
contentEditable?: boolean;
|
|
222
|
+
initialHeight?: CSSProperties["height"];
|
|
223
|
+
options?: Partial<PuckRichTextOptions>;
|
|
224
|
+
renderMenu?: (props: {
|
|
225
|
+
children: ReactNode;
|
|
226
|
+
editor: Editor | null;
|
|
227
|
+
editorState: EditorState<UserSelector> | null;
|
|
228
|
+
readOnly: boolean;
|
|
229
|
+
}) => ReactNode;
|
|
230
|
+
renderInlineMenu?: (props: {
|
|
231
|
+
children: ReactNode;
|
|
232
|
+
editor: Editor | null;
|
|
233
|
+
editorState: EditorState<UserSelector> | null;
|
|
234
|
+
readOnly: boolean;
|
|
235
|
+
}) => ReactNode;
|
|
236
|
+
tiptap?: {
|
|
237
|
+
selector?: UserSelector;
|
|
238
|
+
extensions?: Extensions;
|
|
239
|
+
};
|
|
240
|
+
}
|
|
44
241
|
interface ArrayField<Props extends {
|
|
45
242
|
[key: string]: any;
|
|
46
243
|
}[] = {
|
|
@@ -53,7 +250,7 @@ interface ArrayField<Props extends {
|
|
|
53
250
|
} ? Field<Props[0][SubPropName], UserField> | UserField : Field<Props[0][SubPropName], UserField>;
|
|
54
251
|
};
|
|
55
252
|
defaultItemProps?: Props[0] | ((index: number) => Props[0]);
|
|
56
|
-
getItemSummary?: (item: Props[0], index?: number) =>
|
|
253
|
+
getItemSummary?: (item: Props[0], index?: number) => ReactNode;
|
|
57
254
|
max?: number;
|
|
58
255
|
min?: number;
|
|
59
256
|
}
|
|
@@ -80,7 +277,7 @@ type ExternalFieldWithAdaptor<Props extends any = {
|
|
|
80
277
|
placeholder?: string;
|
|
81
278
|
adaptor: Adaptor<any, any, Props>;
|
|
82
279
|
adaptorParams?: object;
|
|
83
|
-
getItemSummary: (item: NotUndefined<Props>, index?: number) =>
|
|
280
|
+
getItemSummary: (item: NotUndefined<Props>, index?: number) => ReactNode;
|
|
84
281
|
};
|
|
85
282
|
type CacheOpts = {
|
|
86
283
|
enabled?: boolean;
|
|
@@ -97,7 +294,7 @@ interface ExternalField<Props extends any = {
|
|
|
97
294
|
}) => Promise<any[] | null>;
|
|
98
295
|
mapProp?: (value: any) => Props;
|
|
99
296
|
mapRow?: (value: any) => Record<string, string | number | ReactElement>;
|
|
100
|
-
getItemSummary?: (item: NotUndefined<Props>, index?: number) =>
|
|
297
|
+
getItemSummary?: (item: NotUndefined<Props>, index?: number) => ReactNode;
|
|
101
298
|
showSearch?: boolean;
|
|
102
299
|
renderFooter?: (props: {
|
|
103
300
|
items: any[];
|
|
@@ -118,13 +315,14 @@ interface CustomField<Value extends any> extends BaseField {
|
|
|
118
315
|
type: "custom";
|
|
119
316
|
render: CustomFieldRender<Value>;
|
|
120
317
|
contentEditable?: boolean;
|
|
318
|
+
key?: string;
|
|
121
319
|
}
|
|
122
320
|
interface SlotField extends BaseField {
|
|
123
321
|
type: "slot";
|
|
124
322
|
allow?: string[];
|
|
125
323
|
disallow?: string[];
|
|
126
324
|
}
|
|
127
|
-
type Field<ValueType = any, UserField extends {} = {}> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
|
|
325
|
+
type Field<ValueType = any, UserField extends {} = {}> = TextField | RichtextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
|
|
128
326
|
[key: string]: any;
|
|
129
327
|
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
130
328
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
|
|
@@ -145,9 +343,10 @@ type DropZoneProps = {
|
|
|
145
343
|
allow?: string[];
|
|
146
344
|
disallow?: string[];
|
|
147
345
|
style?: CSSProperties;
|
|
148
|
-
minEmptyHeight?: number;
|
|
346
|
+
minEmptyHeight?: CSSProperties["minHeight"] | number;
|
|
149
347
|
className?: string;
|
|
150
348
|
collisionAxis?: DragAxis;
|
|
349
|
+
as?: ElementType;
|
|
151
350
|
};
|
|
152
351
|
|
|
153
352
|
type PuckContext = {
|
|
@@ -238,6 +437,7 @@ UserField extends BaseField = {}> = {
|
|
|
238
437
|
permissions: Partial<Permissions>;
|
|
239
438
|
appState: AppState;
|
|
240
439
|
lastData: DataShape | null;
|
|
440
|
+
parent: ComponentData | null;
|
|
241
441
|
}) => Promise<Partial<Permissions>> | Partial<Permissions>;
|
|
242
442
|
metadata?: ComponentMetadata;
|
|
243
443
|
} & ComponentConfigExtensions;
|
|
@@ -341,7 +541,6 @@ type UiState = {
|
|
|
341
541
|
rightSideBarVisible: boolean;
|
|
342
542
|
leftSideBarWidth?: number | null;
|
|
343
543
|
rightSideBarWidth?: number | null;
|
|
344
|
-
mobilePanelExpanded?: boolean;
|
|
345
544
|
itemSelector: ItemSelector | null;
|
|
346
545
|
arrayState: Record<string, ArrayState | undefined>;
|
|
347
546
|
previewMode: "interactive" | "edit";
|
|
@@ -354,7 +553,7 @@ type UiState = {
|
|
|
354
553
|
isDragging: boolean;
|
|
355
554
|
viewports: {
|
|
356
555
|
current: {
|
|
357
|
-
width: number
|
|
556
|
+
width: number;
|
|
358
557
|
height: number | "auto";
|
|
359
558
|
};
|
|
360
559
|
controlsVisible: boolean;
|
|
@@ -362,9 +561,7 @@ type UiState = {
|
|
|
362
561
|
};
|
|
363
562
|
field: {
|
|
364
563
|
focus?: string | null;
|
|
365
|
-
|
|
366
|
-
plugin: {
|
|
367
|
-
current: string | null;
|
|
564
|
+
metadata?: Record<string, any>;
|
|
368
565
|
};
|
|
369
566
|
};
|
|
370
567
|
type AppState<UserData extends Data = Data> = {
|
|
@@ -409,14 +606,6 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
|
|
|
409
606
|
type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
|
|
410
607
|
never
|
|
411
608
|
] ? False : True;
|
|
412
|
-
type RenderFunc<Props extends {
|
|
413
|
-
[key: string]: any;
|
|
414
|
-
} = {
|
|
415
|
-
children: ReactNode;
|
|
416
|
-
}> = (props: Props) => ReactElement;
|
|
417
|
-
type PluginInternal = Plugin & {
|
|
418
|
-
mobileOnly?: boolean;
|
|
419
|
-
};
|
|
420
609
|
|
|
421
610
|
type MapFnParams<ThisField = Field> = {
|
|
422
611
|
value: any;
|
|
@@ -440,6 +629,11 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
|
|
|
440
629
|
[Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
|
|
441
630
|
}>;
|
|
442
631
|
|
|
632
|
+
type RenderFunc<Props extends {
|
|
633
|
+
[key: string]: any;
|
|
634
|
+
} = {
|
|
635
|
+
children: ReactNode;
|
|
636
|
+
}> = (props: Props) => ReactElement;
|
|
443
637
|
declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
|
|
444
638
|
type OverrideKey = (typeof overrideKeys)[number];
|
|
445
639
|
type OverridesGeneric<Shape extends {
|
|
@@ -511,7 +705,7 @@ type DragAxis = "dynamic" | "y" | "x";
|
|
|
511
705
|
|
|
512
706
|
type iconTypes = "Smartphone" | "Monitor" | "Tablet";
|
|
513
707
|
type Viewport = {
|
|
514
|
-
width: number
|
|
708
|
+
width: number;
|
|
515
709
|
height?: number | "auto";
|
|
516
710
|
label?: string;
|
|
517
711
|
icon?: iconTypes | ReactNode;
|
|
@@ -531,13 +725,8 @@ type IframeConfig = {
|
|
|
531
725
|
};
|
|
532
726
|
type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
|
|
533
727
|
type Plugin<UserConfig extends Config = Config> = {
|
|
534
|
-
name?: string;
|
|
535
|
-
label?: string;
|
|
536
|
-
icon?: ReactNode;
|
|
537
|
-
render?: () => ReactElement;
|
|
538
728
|
overrides?: Partial<Overrides<UserConfig>>;
|
|
539
729
|
fieldTransforms?: FieldTransforms<UserConfig>;
|
|
540
|
-
mobilePanelHeight?: "toggle" | "min-content";
|
|
541
730
|
};
|
|
542
731
|
type History<D = any> = {
|
|
543
732
|
state: D;
|
|
@@ -562,6 +751,7 @@ type Slot<Props extends {
|
|
|
562
751
|
[K in keyof Props]: ComponentDataOptionalId<Props[K], K extends string ? K : never>;
|
|
563
752
|
}[keyof Props][];
|
|
564
753
|
type WithSlotProps<Target extends Record<string, any>, Components extends DefaultComponents = DefaultComponents, SlotType extends Content<Components> = Content<Components>> = WithDeepSlots<Target, SlotType>;
|
|
754
|
+
type RichText = string | ReactNode;
|
|
565
755
|
|
|
566
756
|
type InsertAction = {
|
|
567
757
|
type: "insert";
|
|
@@ -655,4 +845,4 @@ type WalkTreeOptions = {
|
|
|
655
845
|
};
|
|
656
846
|
declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
|
|
657
847
|
|
|
658
|
-
export { type
|
|
848
|
+
export { type RootData as $, type AppState as A, type FieldRenderFunctions as B, type Config as C, type DropZoneProps as D, type ItemWithId as E, type Fields as F, type ArrayState as G, type History as H, type IframeConfig as I, type SlotComponent as J, type PuckComponent as K, type ComponentConfigExtensions as L, type Metadata as M, type RootConfig as N, type Overrides as O, type Permissions as P, type DefaultComponents as Q, type RootDataWithProps as R, type Slot as S, type ExtractConfigParams as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ConfigParams as X, type ComponentConfigParams as Y, type BaseData as Z, type RootDataWithoutProps as _, type ComponentData as a, type ComponentDataOptionalId as a0, type MappedItem as a1, type ComponentDataMap as a2, type Content as a3, type PuckMetadata as a4, type ComponentMetadata as a5, type FieldMetadata as a6, type BaseField as a7, type TextField as a8, type NumberField as a9, type TextareaField as aa, type SelectField as ab, type RadioField as ac, type ArrayField as ad, type ObjectField as ae, type Adaptor as af, type ExternalFieldWithAdaptor as ag, type CacheOpts as ah, type ExternalField as ai, type CustomFieldRender as aj, type CustomField as ak, type SlotField as al, type PuckContext as am, type DefaultRootFieldProps as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type DefaultComponentProps as aq, type WithId as ar, type WithPuckProps as as, type AsFieldProps as at, type WithChildren as au, type ExtractField as av, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldTransforms as g, type RichtextField as h, type Field as i, type FieldProps as j, type Data as k, type OnAction as l, migrate as m, type InitialHistory as n, type ItemSelector as o, type RichText as p, type Direction as q, resolveAllData as r, type DragAxis as s, transformProps as t, type Viewport as u, type FieldTransformFnParams as v, walkTree as w, type FieldTransformFn as x, overrideKeys as y, type OverrideKey as z };
|