@measured/puck 0.21.0-canary.eb8ea5ce → 0.21.0-canary.ed10e2a4
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/{chunk-YZQENDBP.mjs → chunk-JA7SEUEH.mjs} +499 -70
- package/dist/{chunk-MSIUWPEI.mjs → chunk-UABEUL66.mjs} +2681 -913
- package/dist/index.css +22 -278
- package/dist/index.d.mts +7 -104
- package/dist/index.d.ts +7 -104
- package/dist/index.js +2494 -5508
- package/dist/index.mjs +9 -19
- package/dist/no-external.css +22 -278
- package/dist/no-external.d.mts +2 -17
- package/dist/no-external.d.ts +2 -17
- package/dist/no-external.js +2494 -5508
- package/dist/no-external.mjs +9 -19
- package/dist/rsc.d.mts +2 -17
- package/dist/rsc.d.ts +2 -17
- package/dist/rsc.js +21 -407
- package/dist/rsc.mjs +9 -15
- package/dist/{walk-tree-Ja9bNCM9.d.mts → walk-tree-CgWnYC1X.d.mts} +3 -202
- package/dist/{walk-tree-Ja9bNCM9.d.ts → walk-tree-CgWnYC1X.d.ts} +3 -202
- package/package.json +1 -23
- package/dist/Editor-DR57V55X.mjs +0 -194
- package/dist/Editor-F2LSS6SE.css +0 -403
- package/dist/Render-6Q5WP25Y.mjs +0 -51
- package/dist/Render-QEMDIDQC.css +0 -101
- package/dist/chunk-A7EMVTSK.mjs +0 -413
- package/dist/chunk-CF5XA6LF.mjs +0 -103
- package/dist/chunk-GQ457KMA.mjs +0 -199
- package/dist/chunk-OPXWLTPM.mjs +0 -3140
- package/dist/rsc.css +0 -101
|
@@ -1,185 +1,10 @@
|
|
|
1
|
-
import { ReactElement,
|
|
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';
|
|
1
|
+
import { ReactElement, ReactNode, CSSProperties, ElementType, JSX } from 'react';
|
|
17
2
|
|
|
18
3
|
type ItemSelector = {
|
|
19
4
|
index: number;
|
|
20
5
|
zone?: string;
|
|
21
6
|
};
|
|
22
7
|
|
|
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
|
-
|
|
183
8
|
type FieldOption = {
|
|
184
9
|
label: string;
|
|
185
10
|
value: string | number | boolean | undefined | null | object;
|
|
@@ -216,28 +41,6 @@ interface RadioField extends BaseField {
|
|
|
216
41
|
type: "radio";
|
|
217
42
|
options: FieldOptions;
|
|
218
43
|
}
|
|
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
|
-
}
|
|
241
44
|
interface ArrayField<Props extends {
|
|
242
45
|
[key: string]: any;
|
|
243
46
|
}[] = {
|
|
@@ -322,7 +125,7 @@ interface SlotField extends BaseField {
|
|
|
322
125
|
allow?: string[];
|
|
323
126
|
disallow?: string[];
|
|
324
127
|
}
|
|
325
|
-
type Field<ValueType = any, UserField extends {} = {}> = TextField |
|
|
128
|
+
type Field<ValueType = any, UserField extends {} = {}> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
|
|
326
129
|
[key: string]: any;
|
|
327
130
|
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
328
131
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
|
|
@@ -561,7 +364,6 @@ type UiState = {
|
|
|
561
364
|
};
|
|
562
365
|
field: {
|
|
563
366
|
focus?: string | null;
|
|
564
|
-
metadata?: Record<string, any>;
|
|
565
367
|
};
|
|
566
368
|
};
|
|
567
369
|
type AppState<UserData extends Data = Data> = {
|
|
@@ -751,7 +553,6 @@ type Slot<Props extends {
|
|
|
751
553
|
[K in keyof Props]: ComponentDataOptionalId<Props[K], K extends string ? K : never>;
|
|
752
554
|
}[keyof Props][];
|
|
753
555
|
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;
|
|
755
556
|
|
|
756
557
|
type InsertAction = {
|
|
757
558
|
type: "insert";
|
|
@@ -845,4 +646,4 @@ type WalkTreeOptions = {
|
|
|
845
646
|
};
|
|
846
647
|
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;
|
|
847
648
|
|
|
848
|
-
export { type
|
|
649
|
+
export { type MappedItem as $, type AppState as A, type ArrayState as B, type Config as C, type DropZoneProps as D, type SlotComponent as E, type Fields as F, type PuckComponent as G, type History as H, type IframeConfig as I, type ComponentConfigExtensions as J, type RootConfig as K, type DefaultComponents as L, type Metadata as M, type ExtractConfigParams as N, type Overrides as O, type Permissions as P, type ConfigParams as Q, type RootDataWithProps as R, type Slot as S, type ComponentConfigParams as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type BaseData as X, type RootDataWithoutProps as Y, type RootData as Z, type ComponentDataOptionalId as _, type ComponentData as a, type ComponentDataMap as a0, type Content as a1, type PuckMetadata as a2, type ComponentMetadata as a3, type FieldMetadata as a4, type BaseField as a5, type TextField as a6, type NumberField as a7, type TextareaField as a8, type SelectField as a9, type RadioField as aa, type ArrayField as ab, type ObjectField as ac, type Adaptor as ad, type ExternalFieldWithAdaptor as ae, type CacheOpts as af, type ExternalField as ag, type CustomFieldRender as ah, type CustomField as ai, type SlotField as aj, type PuckContext as ak, type DefaultRootFieldProps as al, type DefaultRootRenderProps as am, type DefaultRootProps as an, type DefaultComponentProps as ao, type WithId as ap, type WithPuckProps as aq, type AsFieldProps as ar, type WithChildren as as, type ExtractField as at, 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 Field as h, type FieldProps as i, type Data as j, type OnAction as k, type InitialHistory as l, migrate as m, type ItemSelector as n, type Direction as o, type DragAxis as p, type Viewport as q, resolveAllData as r, type FieldTransformFnParams as s, transformProps as t, type FieldTransformFn as u, overrideKeys as v, walkTree as w, type OverrideKey as x, type FieldRenderFunctions as y, type ItemWithId as z };
|
|
@@ -1,185 +1,10 @@
|
|
|
1
|
-
import { ReactElement,
|
|
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';
|
|
1
|
+
import { ReactElement, ReactNode, CSSProperties, ElementType, JSX } from 'react';
|
|
17
2
|
|
|
18
3
|
type ItemSelector = {
|
|
19
4
|
index: number;
|
|
20
5
|
zone?: string;
|
|
21
6
|
};
|
|
22
7
|
|
|
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
|
-
|
|
183
8
|
type FieldOption = {
|
|
184
9
|
label: string;
|
|
185
10
|
value: string | number | boolean | undefined | null | object;
|
|
@@ -216,28 +41,6 @@ interface RadioField extends BaseField {
|
|
|
216
41
|
type: "radio";
|
|
217
42
|
options: FieldOptions;
|
|
218
43
|
}
|
|
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
|
-
}
|
|
241
44
|
interface ArrayField<Props extends {
|
|
242
45
|
[key: string]: any;
|
|
243
46
|
}[] = {
|
|
@@ -322,7 +125,7 @@ interface SlotField extends BaseField {
|
|
|
322
125
|
allow?: string[];
|
|
323
126
|
disallow?: string[];
|
|
324
127
|
}
|
|
325
|
-
type Field<ValueType = any, UserField extends {} = {}> = TextField |
|
|
128
|
+
type Field<ValueType = any, UserField extends {} = {}> = TextField | NumberField | TextareaField | SelectField | RadioField | ArrayField<ValueType extends {
|
|
326
129
|
[key: string]: any;
|
|
327
130
|
}[] ? ValueType : never, UserField> | ObjectField<ValueType, UserField> | ExternalField<ValueType> | ExternalFieldWithAdaptor<ValueType> | CustomField<ValueType> | SlotField;
|
|
328
131
|
type Fields<ComponentProps extends DefaultComponentProps = DefaultComponentProps, UserField extends {} = {}> = {
|
|
@@ -561,7 +364,6 @@ type UiState = {
|
|
|
561
364
|
};
|
|
562
365
|
field: {
|
|
563
366
|
focus?: string | null;
|
|
564
|
-
metadata?: Record<string, any>;
|
|
565
367
|
};
|
|
566
368
|
};
|
|
567
369
|
type AppState<UserData extends Data = Data> = {
|
|
@@ -751,7 +553,6 @@ type Slot<Props extends {
|
|
|
751
553
|
[K in keyof Props]: ComponentDataOptionalId<Props[K], K extends string ? K : never>;
|
|
752
554
|
}[keyof Props][];
|
|
753
555
|
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;
|
|
755
556
|
|
|
756
557
|
type InsertAction = {
|
|
757
558
|
type: "insert";
|
|
@@ -845,4 +646,4 @@ type WalkTreeOptions = {
|
|
|
845
646
|
};
|
|
846
647
|
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;
|
|
847
648
|
|
|
848
|
-
export { type
|
|
649
|
+
export { type MappedItem as $, type AppState as A, type ArrayState as B, type Config as C, type DropZoneProps as D, type SlotComponent as E, type Fields as F, type PuckComponent as G, type History as H, type IframeConfig as I, type ComponentConfigExtensions as J, type RootConfig as K, type DefaultComponents as L, type Metadata as M, type ExtractConfigParams as N, type Overrides as O, type Permissions as P, type ConfigParams as Q, type RootDataWithProps as R, type Slot as S, type ComponentConfigParams as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type BaseData as X, type RootDataWithoutProps as Y, type RootData as Z, type ComponentDataOptionalId as _, type ComponentData as a, type ComponentDataMap as a0, type Content as a1, type PuckMetadata as a2, type ComponentMetadata as a3, type FieldMetadata as a4, type BaseField as a5, type TextField as a6, type NumberField as a7, type TextareaField as a8, type SelectField as a9, type RadioField as aa, type ArrayField as ab, type ObjectField as ac, type Adaptor as ad, type ExternalFieldWithAdaptor as ae, type CacheOpts as af, type ExternalField as ag, type CustomFieldRender as ah, type CustomField as ai, type SlotField as aj, type PuckContext as ak, type DefaultRootFieldProps as al, type DefaultRootRenderProps as am, type DefaultRootProps as an, type DefaultComponentProps as ao, type WithId as ap, type WithPuckProps as aq, type AsFieldProps as ar, type WithChildren as as, type ExtractField as at, 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 Field as h, type FieldProps as i, type Data as j, type OnAction as k, type InitialHistory as l, migrate as m, type ItemSelector as n, type Direction as o, type DragAxis as p, type Viewport as q, resolveAllData as r, type FieldTransformFnParams as s, transformProps as t, type FieldTransformFn as u, overrideKeys as v, walkTree as w, type OverrideKey as x, type FieldRenderFunctions as y, type ItemWithId as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@measured/puck",
|
|
3
|
-
"version": "0.21.0-canary.
|
|
3
|
+
"version": "0.21.0-canary.ed10e2a4",
|
|
4
4
|
"description": "The open-source visual editor for React",
|
|
5
5
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
6
6
|
"repository": "measuredco/puck",
|
|
@@ -95,31 +95,9 @@
|
|
|
95
95
|
"dependencies": {
|
|
96
96
|
"@dnd-kit/helpers": "0.1.18",
|
|
97
97
|
"@dnd-kit/react": "0.1.18",
|
|
98
|
-
"@radix-ui/react-popover": "^1.1.15",
|
|
99
|
-
"@tiptap/core": "^3.11.1",
|
|
100
|
-
"@tiptap/extension-blockquote": "^3.11.1",
|
|
101
|
-
"@tiptap/extension-bold": "^3.11.1",
|
|
102
|
-
"@tiptap/extension-code": "^3.11.1",
|
|
103
|
-
"@tiptap/extension-code-block": "^3.11.1",
|
|
104
|
-
"@tiptap/extension-document": "^3.11.1",
|
|
105
|
-
"@tiptap/extension-hard-break": "^3.11.1",
|
|
106
|
-
"@tiptap/extension-heading": "^3.11.1",
|
|
107
|
-
"@tiptap/extension-horizontal-rule": "^3.11.1",
|
|
108
|
-
"@tiptap/extension-italic": "^3.11.1",
|
|
109
|
-
"@tiptap/extension-link": "^3.11.1",
|
|
110
|
-
"@tiptap/extension-list": "^3.11.1",
|
|
111
|
-
"@tiptap/extension-paragraph": "^3.11.1",
|
|
112
|
-
"@tiptap/extension-strike": "^3.11.1",
|
|
113
|
-
"@tiptap/extension-text": "^3.11.1",
|
|
114
|
-
"@tiptap/extension-text-align": "^3.11.1",
|
|
115
|
-
"@tiptap/extension-underline": "^3.11.1",
|
|
116
|
-
"@tiptap/html": "^3.11.1",
|
|
117
|
-
"@tiptap/pm": "^3.11.1",
|
|
118
|
-
"@tiptap/react": "^3.11.1",
|
|
119
98
|
"deep-diff": "^1.0.2",
|
|
120
99
|
"fast-equals": "5.2.2",
|
|
121
100
|
"flat": "^5.0.2",
|
|
122
|
-
"happy-dom": "^20.0.10",
|
|
123
101
|
"object-hash": "^3.0.0",
|
|
124
102
|
"react-hotkeys-hook": "^4.6.1",
|
|
125
103
|
"use-debounce": "^9.0.4",
|