@measured/puck 0.21.0-canary.e491598a → 0.21.0-canary.eb8ea5ce
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-DR57V55X.mjs +194 -0
- package/dist/Editor-F2LSS6SE.css +403 -0
- package/dist/Render-6Q5WP25Y.mjs +51 -0
- package/dist/Render-QEMDIDQC.css +101 -0
- package/dist/chunk-A7EMVTSK.mjs +413 -0
- package/dist/chunk-CF5XA6LF.mjs +103 -0
- package/dist/chunk-GQ457KMA.mjs +199 -0
- package/dist/{chunk-2NYOEOP7.mjs → chunk-MSIUWPEI.mjs} +3414 -5702
- package/dist/chunk-OPXWLTPM.mjs +3140 -0
- package/dist/chunk-YZQENDBP.mjs +537 -0
- package/dist/index.css +636 -759
- package/dist/index.d.mts +107 -27
- package/dist/index.d.ts +107 -27
- package/dist/index.js +7751 -5256
- package/dist/index.mjs +19 -17
- package/dist/no-external.css +636 -759
- package/dist/no-external.d.mts +17 -2
- package/dist/no-external.d.ts +17 -2
- package/dist/no-external.js +7751 -5256
- package/dist/no-external.mjs +19 -17
- package/dist/rsc.css +101 -0
- package/dist/rsc.d.mts +17 -2
- package/dist/rsc.d.ts +17 -2
- package/dist/rsc.js +411 -26
- package/dist/rsc.mjs +15 -9
- package/dist/{walk-tree-CL-j099F.d.mts → walk-tree-Ja9bNCM9.d.mts} +215 -27
- package/dist/{walk-tree-CL-j099F.d.ts → walk-tree-Ja9bNCM9.d.ts} +215 -27
- package/package.json +23 -1
- package/dist/chunk-FY5AZKYD.mjs +0 -967
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms,
|
|
2
|
-
export { af as Adaptor, ad as ArrayField, G as ArrayState, at as AsFieldProps, Z as BaseData, a7 as BaseField, ah as CacheOpts, L as ComponentConfigExtensions, Y as ComponentConfigParams, a2 as ComponentDataMap, a0 as ComponentDataOptionalId, a5 as ComponentMetadata, X as ConfigParams, a3 as Content, ak as CustomField, aj as CustomFieldRender, aq as DefaultComponentProps, Q as DefaultComponents, an as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, q as Direction, s as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, T as ExtractConfigParams, av as ExtractField, a6 as FieldMetadata, B as FieldRenderFunctions, x as FieldTransformFn, v as FieldTransformFnParams, E as ItemWithId, a1 as MappedItem, a9 as NumberField, ae as ObjectField, z as OverrideKey, K as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, N as RootConfig, $ as RootData, _ as RootDataWithoutProps, ab as SelectField, S as Slot, J as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, u as Viewport, au as WithChildren, ar as WithId, as as WithPuckProps, W as WithSlotProps, m as migrate, y as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
1
|
+
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as RichtextField, i as Field, j as FieldProps, D as DropZoneProps, k as Data, l as OnAction, n as InitialHistory, o as ItemSelector } from './walk-tree-Ja9bNCM9.mjs';
|
|
2
|
+
export { af as Adaptor, ad as ArrayField, G as ArrayState, at as AsFieldProps, Z as BaseData, a7 as BaseField, ah as CacheOpts, L as ComponentConfigExtensions, Y as ComponentConfigParams, a2 as ComponentDataMap, a0 as ComponentDataOptionalId, a5 as ComponentMetadata, X as ConfigParams, a3 as Content, ak as CustomField, aj as CustomFieldRender, aq as DefaultComponentProps, Q as DefaultComponents, an as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, q as Direction, s as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, T as ExtractConfigParams, av as ExtractField, a6 as FieldMetadata, B as FieldRenderFunctions, x as FieldTransformFn, v as FieldTransformFnParams, E as ItemWithId, a1 as MappedItem, a9 as NumberField, ae as ObjectField, z as OverrideKey, K as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, p as RichText, N as RootConfig, $ as RootData, _ as RootDataWithoutProps, ab as SelectField, S as Slot, J as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, u as Viewport, au as WithChildren, ar as WithId, as as WithPuckProps, W as WithSlotProps, m as migrate, y as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Ja9bNCM9.mjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
-
import react__default, {
|
|
5
|
+
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
|
6
|
+
import { Editor } from '@tiptap/react';
|
|
7
|
+
import '@tiptap/extension-blockquote';
|
|
8
|
+
import '@tiptap/extension-bold';
|
|
9
|
+
import '@tiptap/extension-code';
|
|
10
|
+
import '@tiptap/extension-code-block';
|
|
11
|
+
import '@tiptap/extension-hard-break';
|
|
12
|
+
import '@tiptap/extension-heading';
|
|
13
|
+
import '@tiptap/extension-horizontal-rule';
|
|
14
|
+
import '@tiptap/extension-italic';
|
|
15
|
+
import '@tiptap/extension-link';
|
|
16
|
+
import '@tiptap/extension-list';
|
|
17
|
+
import '@tiptap/extension-paragraph';
|
|
18
|
+
import '@tiptap/extension-strike';
|
|
19
|
+
import '@tiptap/extension-text-align';
|
|
20
|
+
import '@tiptap/extension-underline';
|
|
6
21
|
|
|
7
22
|
type HistorySlice<D = any> = {
|
|
8
23
|
index: number;
|
|
@@ -47,6 +62,7 @@ type RefreshPermissions<UserConfig extends Config = Config> = (params?: Permissi
|
|
|
47
62
|
type Cache = Record<string, {
|
|
48
63
|
lastPermissions: Partial<Permissions>;
|
|
49
64
|
lastData: ComponentData | null;
|
|
65
|
+
lastParentId: string | null;
|
|
50
66
|
}>;
|
|
51
67
|
type PermissionsSlice = {
|
|
52
68
|
cache: Cache;
|
|
@@ -75,7 +91,6 @@ type ComponentState = Record<string, {
|
|
|
75
91
|
loadingCount: number;
|
|
76
92
|
}>;
|
|
77
93
|
type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
78
|
-
instanceId: string;
|
|
79
94
|
state: G["UserAppState"];
|
|
80
95
|
dispatch: (action: PuckAction) => void;
|
|
81
96
|
config: UserConfig;
|
|
@@ -107,24 +122,26 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
|
|
|
107
122
|
nodes: NodesSlice;
|
|
108
123
|
permissions: PermissionsSlice;
|
|
109
124
|
fieldTransforms: FieldTransforms;
|
|
125
|
+
currentRichText?: {
|
|
126
|
+
inlineComponentId?: string;
|
|
127
|
+
inline: boolean;
|
|
128
|
+
field: RichtextField;
|
|
129
|
+
editor: Editor;
|
|
130
|
+
id: string;
|
|
131
|
+
} | null;
|
|
110
132
|
};
|
|
111
133
|
|
|
112
|
-
type StateReducer<UserData extends Data = Data> = Reducer<PrivateAppState<UserData>, PuckAction>;
|
|
113
|
-
declare function createReducer<UserData extends Data>({ record, onAction, appStore, }: {
|
|
114
|
-
record?: (appState: AppState<UserData>) => void;
|
|
115
|
-
onAction?: OnAction<UserData>;
|
|
116
|
-
appStore: AppStore;
|
|
117
|
-
}): StateReducer<UserData>;
|
|
118
|
-
|
|
119
134
|
declare const ActionBar: {
|
|
120
135
|
({ label, children, }: {
|
|
121
136
|
label?: string;
|
|
122
137
|
children?: ReactNode;
|
|
123
138
|
}): react_jsx_runtime.JSX.Element;
|
|
124
|
-
Action: ({ children, label, onClick, }: {
|
|
139
|
+
Action: ({ children, label, onClick, active, disabled, }: {
|
|
125
140
|
children: ReactNode;
|
|
126
141
|
label?: string;
|
|
127
142
|
onClick: (e: SyntheticEvent) => void;
|
|
143
|
+
active?: boolean;
|
|
144
|
+
disabled?: boolean;
|
|
128
145
|
}) => react_jsx_runtime.JSX.Element;
|
|
129
146
|
Label: ({ label }: {
|
|
130
147
|
label: string;
|
|
@@ -132,11 +149,14 @@ declare const ActionBar: {
|
|
|
132
149
|
Group: ({ children }: {
|
|
133
150
|
children: ReactNode;
|
|
134
151
|
}) => react_jsx_runtime.JSX.Element;
|
|
152
|
+
Separator: () => react_jsx_runtime.JSX.Element;
|
|
135
153
|
};
|
|
136
|
-
declare const Action: ({ children, label, onClick, }: {
|
|
154
|
+
declare const Action: ({ children, label, onClick, active, disabled, }: {
|
|
137
155
|
children: ReactNode;
|
|
138
156
|
label?: string;
|
|
139
157
|
onClick: (e: SyntheticEvent) => void;
|
|
158
|
+
active?: boolean;
|
|
159
|
+
disabled?: boolean;
|
|
140
160
|
}) => react_jsx_runtime.JSX.Element;
|
|
141
161
|
declare const Group: ({ children }: {
|
|
142
162
|
children: ReactNode;
|
|
@@ -144,6 +164,7 @@ declare const Group: ({ children }: {
|
|
|
144
164
|
declare const Label: ({ label }: {
|
|
145
165
|
label: string;
|
|
146
166
|
}) => react_jsx_runtime.JSX.Element;
|
|
167
|
+
declare const Separator: () => react_jsx_runtime.JSX.Element;
|
|
147
168
|
|
|
148
169
|
declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
|
|
149
170
|
children?: ReactNode;
|
|
@@ -192,18 +213,17 @@ declare const Drawer: {
|
|
|
192
213
|
|
|
193
214
|
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
|
194
215
|
|
|
195
|
-
declare const IconButton: ({ children, href, onClick,
|
|
216
|
+
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
|
217
|
+
active?: boolean;
|
|
196
218
|
children: ReactNode;
|
|
197
219
|
href?: string;
|
|
198
220
|
onClick?: (e: SyntheticEvent) => void | Promise<void>;
|
|
199
|
-
variant?: "primary" | "secondary";
|
|
200
221
|
type?: "button" | "submit" | "reset";
|
|
201
222
|
disabled?: boolean;
|
|
202
223
|
tabIndex?: number;
|
|
203
224
|
newTab?: boolean;
|
|
204
225
|
fullWidth?: boolean;
|
|
205
226
|
title: string;
|
|
206
|
-
suppressHydrationWarning?: boolean;
|
|
207
227
|
}) => react_jsx_runtime.JSX.Element;
|
|
208
228
|
|
|
209
229
|
type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
@@ -236,8 +256,6 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
|
|
|
236
256
|
};
|
|
237
257
|
initialHistory?: InitialHistory;
|
|
238
258
|
metadata?: Metadata;
|
|
239
|
-
height?: CSSProperties["height"];
|
|
240
|
-
_experimentalFullScreenCanvas?: boolean;
|
|
241
259
|
};
|
|
242
260
|
declare function Puck<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: PuckProps<UserConfig>): react_jsx_runtime.JSX.Element;
|
|
243
261
|
declare namespace Puck {
|
|
@@ -262,6 +280,75 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
|
|
|
262
280
|
metadata?: Metadata;
|
|
263
281
|
}): react_jsx_runtime.JSX.Element;
|
|
264
282
|
|
|
283
|
+
declare function AlignLeft(): react_jsx_runtime.JSX.Element;
|
|
284
|
+
|
|
285
|
+
declare function AlignCenter(): react_jsx_runtime.JSX.Element;
|
|
286
|
+
|
|
287
|
+
declare function AlignRight(): react_jsx_runtime.JSX.Element;
|
|
288
|
+
|
|
289
|
+
declare function AlignJustify(): react_jsx_runtime.JSX.Element;
|
|
290
|
+
|
|
291
|
+
declare function AlignSelect(): react_jsx_runtime.JSX.Element;
|
|
292
|
+
|
|
293
|
+
declare function Bold(): react_jsx_runtime.JSX.Element;
|
|
294
|
+
|
|
295
|
+
declare function Italic(): react_jsx_runtime.JSX.Element;
|
|
296
|
+
|
|
297
|
+
declare function Underline(): react_jsx_runtime.JSX.Element;
|
|
298
|
+
|
|
299
|
+
declare function Strikethrough(): react_jsx_runtime.JSX.Element;
|
|
300
|
+
|
|
301
|
+
declare function InlineCode(): react_jsx_runtime.JSX.Element;
|
|
302
|
+
|
|
303
|
+
declare function BulletList(): react_jsx_runtime.JSX.Element;
|
|
304
|
+
|
|
305
|
+
declare function OrderedList(): react_jsx_runtime.JSX.Element;
|
|
306
|
+
|
|
307
|
+
declare function CodeBlock(): react_jsx_runtime.JSX.Element;
|
|
308
|
+
|
|
309
|
+
declare function Blockquote(): react_jsx_runtime.JSX.Element;
|
|
310
|
+
|
|
311
|
+
declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
|
|
312
|
+
|
|
313
|
+
declare function HeadingSelect(): react_jsx_runtime.JSX.Element;
|
|
314
|
+
|
|
315
|
+
declare function ListSelect(): react_jsx_runtime.JSX.Element;
|
|
316
|
+
|
|
317
|
+
declare function Control({ icon, disabled, active, onClick, title, }: {
|
|
318
|
+
icon: ReactNode;
|
|
319
|
+
disabled?: boolean;
|
|
320
|
+
active?: boolean;
|
|
321
|
+
onClick: (e: SyntheticEvent) => any;
|
|
322
|
+
title: string;
|
|
323
|
+
}): react_jsx_runtime.JSX.Element;
|
|
324
|
+
|
|
325
|
+
declare const RichTextMenu: {
|
|
326
|
+
({ children }: {
|
|
327
|
+
children: ReactNode;
|
|
328
|
+
}): react_jsx_runtime.JSX.Element;
|
|
329
|
+
Group: ({ children }: {
|
|
330
|
+
children: ReactNode;
|
|
331
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
332
|
+
Control: typeof Control;
|
|
333
|
+
AlignCenter: typeof AlignCenter;
|
|
334
|
+
AlignJustify: typeof AlignJustify;
|
|
335
|
+
AlignLeft: typeof AlignLeft;
|
|
336
|
+
AlignRight: typeof AlignRight;
|
|
337
|
+
AlignSelect: typeof AlignSelect;
|
|
338
|
+
Blockquote: typeof Blockquote;
|
|
339
|
+
Bold: typeof Bold;
|
|
340
|
+
BulletList: typeof BulletList;
|
|
341
|
+
CodeBlock: typeof CodeBlock;
|
|
342
|
+
HeadingSelect: typeof HeadingSelect;
|
|
343
|
+
HorizontalRule: typeof HorizontalRule;
|
|
344
|
+
InlineCode: typeof InlineCode;
|
|
345
|
+
Italic: typeof Italic;
|
|
346
|
+
ListSelect: typeof ListSelect;
|
|
347
|
+
OrderedList: typeof OrderedList;
|
|
348
|
+
Strikethrough: typeof Strikethrough;
|
|
349
|
+
Underline: typeof Underline;
|
|
350
|
+
};
|
|
351
|
+
|
|
265
352
|
declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
|
|
266
353
|
disableDrag?: boolean;
|
|
267
354
|
disableDragOnFocus?: boolean;
|
|
@@ -282,6 +369,7 @@ type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<User
|
|
|
282
369
|
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
283
370
|
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
284
371
|
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
|
372
|
+
getParentById: (id: string) => ComponentData | undefined;
|
|
285
373
|
history: {
|
|
286
374
|
back: HistorySlice["back"];
|
|
287
375
|
forward: HistorySlice["forward"];
|
|
@@ -313,12 +401,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
|
|
|
313
401
|
*/
|
|
314
402
|
declare function useGetPuck(): () => UsePuckStore<Config>;
|
|
315
403
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
declare const fieldsPlugin: (params?: {
|
|
319
|
-
mobileOnly?: boolean;
|
|
320
|
-
}) => PluginInternal;
|
|
321
|
-
|
|
322
|
-
declare const outlinePlugin: () => Plugin;
|
|
323
|
-
|
|
324
|
-
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createReducer, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|
|
404
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RichTextMenu, RichtextField, RootDataWithProps, Separator, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms,
|
|
2
|
-
export { af as Adaptor, ad as ArrayField, G as ArrayState, at as AsFieldProps, Z as BaseData, a7 as BaseField, ah as CacheOpts, L as ComponentConfigExtensions, Y as ComponentConfigParams, a2 as ComponentDataMap, a0 as ComponentDataOptionalId, a5 as ComponentMetadata, X as ConfigParams, a3 as Content, ak as CustomField, aj as CustomFieldRender, aq as DefaultComponentProps, Q as DefaultComponents, an as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, q as Direction, s as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, T as ExtractConfigParams, av as ExtractField, a6 as FieldMetadata, B as FieldRenderFunctions, x as FieldTransformFn, v as FieldTransformFnParams, E as ItemWithId, a1 as MappedItem, a9 as NumberField, ae as ObjectField, z as OverrideKey, K as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, N as RootConfig, $ as RootData, _ as RootDataWithoutProps, ab as SelectField, S as Slot, J as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, u as Viewport, au as WithChildren, ar as WithId, as as WithPuckProps, W as WithSlotProps, m as migrate, y as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-
|
|
1
|
+
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as RichtextField, i as Field, j as FieldProps, D as DropZoneProps, k as Data, l as OnAction, n as InitialHistory, o as ItemSelector } from './walk-tree-Ja9bNCM9.js';
|
|
2
|
+
export { af as Adaptor, ad as ArrayField, G as ArrayState, at as AsFieldProps, Z as BaseData, a7 as BaseField, ah as CacheOpts, L as ComponentConfigExtensions, Y as ComponentConfigParams, a2 as ComponentDataMap, a0 as ComponentDataOptionalId, a5 as ComponentMetadata, X as ConfigParams, a3 as Content, ak as CustomField, aj as CustomFieldRender, aq as DefaultComponentProps, Q as DefaultComponents, an as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, q as Direction, s as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, T as ExtractConfigParams, av as ExtractField, a6 as FieldMetadata, B as FieldRenderFunctions, x as FieldTransformFn, v as FieldTransformFnParams, E as ItemWithId, a1 as MappedItem, a9 as NumberField, ae as ObjectField, z as OverrideKey, K as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, p as RichText, N as RootConfig, $ as RootData, _ as RootDataWithoutProps, ab as SelectField, S as Slot, J as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, u as Viewport, au as WithChildren, ar as WithId, as as WithPuckProps, W as WithSlotProps, m as migrate, y as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Ja9bNCM9.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
-
import react__default, {
|
|
5
|
+
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
|
6
|
+
import { Editor } from '@tiptap/react';
|
|
7
|
+
import '@tiptap/extension-blockquote';
|
|
8
|
+
import '@tiptap/extension-bold';
|
|
9
|
+
import '@tiptap/extension-code';
|
|
10
|
+
import '@tiptap/extension-code-block';
|
|
11
|
+
import '@tiptap/extension-hard-break';
|
|
12
|
+
import '@tiptap/extension-heading';
|
|
13
|
+
import '@tiptap/extension-horizontal-rule';
|
|
14
|
+
import '@tiptap/extension-italic';
|
|
15
|
+
import '@tiptap/extension-link';
|
|
16
|
+
import '@tiptap/extension-list';
|
|
17
|
+
import '@tiptap/extension-paragraph';
|
|
18
|
+
import '@tiptap/extension-strike';
|
|
19
|
+
import '@tiptap/extension-text-align';
|
|
20
|
+
import '@tiptap/extension-underline';
|
|
6
21
|
|
|
7
22
|
type HistorySlice<D = any> = {
|
|
8
23
|
index: number;
|
|
@@ -47,6 +62,7 @@ type RefreshPermissions<UserConfig extends Config = Config> = (params?: Permissi
|
|
|
47
62
|
type Cache = Record<string, {
|
|
48
63
|
lastPermissions: Partial<Permissions>;
|
|
49
64
|
lastData: ComponentData | null;
|
|
65
|
+
lastParentId: string | null;
|
|
50
66
|
}>;
|
|
51
67
|
type PermissionsSlice = {
|
|
52
68
|
cache: Cache;
|
|
@@ -75,7 +91,6 @@ type ComponentState = Record<string, {
|
|
|
75
91
|
loadingCount: number;
|
|
76
92
|
}>;
|
|
77
93
|
type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
78
|
-
instanceId: string;
|
|
79
94
|
state: G["UserAppState"];
|
|
80
95
|
dispatch: (action: PuckAction) => void;
|
|
81
96
|
config: UserConfig;
|
|
@@ -107,24 +122,26 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
|
|
|
107
122
|
nodes: NodesSlice;
|
|
108
123
|
permissions: PermissionsSlice;
|
|
109
124
|
fieldTransforms: FieldTransforms;
|
|
125
|
+
currentRichText?: {
|
|
126
|
+
inlineComponentId?: string;
|
|
127
|
+
inline: boolean;
|
|
128
|
+
field: RichtextField;
|
|
129
|
+
editor: Editor;
|
|
130
|
+
id: string;
|
|
131
|
+
} | null;
|
|
110
132
|
};
|
|
111
133
|
|
|
112
|
-
type StateReducer<UserData extends Data = Data> = Reducer<PrivateAppState<UserData>, PuckAction>;
|
|
113
|
-
declare function createReducer<UserData extends Data>({ record, onAction, appStore, }: {
|
|
114
|
-
record?: (appState: AppState<UserData>) => void;
|
|
115
|
-
onAction?: OnAction<UserData>;
|
|
116
|
-
appStore: AppStore;
|
|
117
|
-
}): StateReducer<UserData>;
|
|
118
|
-
|
|
119
134
|
declare const ActionBar: {
|
|
120
135
|
({ label, children, }: {
|
|
121
136
|
label?: string;
|
|
122
137
|
children?: ReactNode;
|
|
123
138
|
}): react_jsx_runtime.JSX.Element;
|
|
124
|
-
Action: ({ children, label, onClick, }: {
|
|
139
|
+
Action: ({ children, label, onClick, active, disabled, }: {
|
|
125
140
|
children: ReactNode;
|
|
126
141
|
label?: string;
|
|
127
142
|
onClick: (e: SyntheticEvent) => void;
|
|
143
|
+
active?: boolean;
|
|
144
|
+
disabled?: boolean;
|
|
128
145
|
}) => react_jsx_runtime.JSX.Element;
|
|
129
146
|
Label: ({ label }: {
|
|
130
147
|
label: string;
|
|
@@ -132,11 +149,14 @@ declare const ActionBar: {
|
|
|
132
149
|
Group: ({ children }: {
|
|
133
150
|
children: ReactNode;
|
|
134
151
|
}) => react_jsx_runtime.JSX.Element;
|
|
152
|
+
Separator: () => react_jsx_runtime.JSX.Element;
|
|
135
153
|
};
|
|
136
|
-
declare const Action: ({ children, label, onClick, }: {
|
|
154
|
+
declare const Action: ({ children, label, onClick, active, disabled, }: {
|
|
137
155
|
children: ReactNode;
|
|
138
156
|
label?: string;
|
|
139
157
|
onClick: (e: SyntheticEvent) => void;
|
|
158
|
+
active?: boolean;
|
|
159
|
+
disabled?: boolean;
|
|
140
160
|
}) => react_jsx_runtime.JSX.Element;
|
|
141
161
|
declare const Group: ({ children }: {
|
|
142
162
|
children: ReactNode;
|
|
@@ -144,6 +164,7 @@ declare const Group: ({ children }: {
|
|
|
144
164
|
declare const Label: ({ label }: {
|
|
145
165
|
label: string;
|
|
146
166
|
}) => react_jsx_runtime.JSX.Element;
|
|
167
|
+
declare const Separator: () => react_jsx_runtime.JSX.Element;
|
|
147
168
|
|
|
148
169
|
declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
|
|
149
170
|
children?: ReactNode;
|
|
@@ -192,18 +213,17 @@ declare const Drawer: {
|
|
|
192
213
|
|
|
193
214
|
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
|
194
215
|
|
|
195
|
-
declare const IconButton: ({ children, href, onClick,
|
|
216
|
+
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
|
217
|
+
active?: boolean;
|
|
196
218
|
children: ReactNode;
|
|
197
219
|
href?: string;
|
|
198
220
|
onClick?: (e: SyntheticEvent) => void | Promise<void>;
|
|
199
|
-
variant?: "primary" | "secondary";
|
|
200
221
|
type?: "button" | "submit" | "reset";
|
|
201
222
|
disabled?: boolean;
|
|
202
223
|
tabIndex?: number;
|
|
203
224
|
newTab?: boolean;
|
|
204
225
|
fullWidth?: boolean;
|
|
205
226
|
title: string;
|
|
206
|
-
suppressHydrationWarning?: boolean;
|
|
207
227
|
}) => react_jsx_runtime.JSX.Element;
|
|
208
228
|
|
|
209
229
|
type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
@@ -236,8 +256,6 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
|
|
|
236
256
|
};
|
|
237
257
|
initialHistory?: InitialHistory;
|
|
238
258
|
metadata?: Metadata;
|
|
239
|
-
height?: CSSProperties["height"];
|
|
240
|
-
_experimentalFullScreenCanvas?: boolean;
|
|
241
259
|
};
|
|
242
260
|
declare function Puck<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: PuckProps<UserConfig>): react_jsx_runtime.JSX.Element;
|
|
243
261
|
declare namespace Puck {
|
|
@@ -262,6 +280,75 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
|
|
|
262
280
|
metadata?: Metadata;
|
|
263
281
|
}): react_jsx_runtime.JSX.Element;
|
|
264
282
|
|
|
283
|
+
declare function AlignLeft(): react_jsx_runtime.JSX.Element;
|
|
284
|
+
|
|
285
|
+
declare function AlignCenter(): react_jsx_runtime.JSX.Element;
|
|
286
|
+
|
|
287
|
+
declare function AlignRight(): react_jsx_runtime.JSX.Element;
|
|
288
|
+
|
|
289
|
+
declare function AlignJustify(): react_jsx_runtime.JSX.Element;
|
|
290
|
+
|
|
291
|
+
declare function AlignSelect(): react_jsx_runtime.JSX.Element;
|
|
292
|
+
|
|
293
|
+
declare function Bold(): react_jsx_runtime.JSX.Element;
|
|
294
|
+
|
|
295
|
+
declare function Italic(): react_jsx_runtime.JSX.Element;
|
|
296
|
+
|
|
297
|
+
declare function Underline(): react_jsx_runtime.JSX.Element;
|
|
298
|
+
|
|
299
|
+
declare function Strikethrough(): react_jsx_runtime.JSX.Element;
|
|
300
|
+
|
|
301
|
+
declare function InlineCode(): react_jsx_runtime.JSX.Element;
|
|
302
|
+
|
|
303
|
+
declare function BulletList(): react_jsx_runtime.JSX.Element;
|
|
304
|
+
|
|
305
|
+
declare function OrderedList(): react_jsx_runtime.JSX.Element;
|
|
306
|
+
|
|
307
|
+
declare function CodeBlock(): react_jsx_runtime.JSX.Element;
|
|
308
|
+
|
|
309
|
+
declare function Blockquote(): react_jsx_runtime.JSX.Element;
|
|
310
|
+
|
|
311
|
+
declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
|
|
312
|
+
|
|
313
|
+
declare function HeadingSelect(): react_jsx_runtime.JSX.Element;
|
|
314
|
+
|
|
315
|
+
declare function ListSelect(): react_jsx_runtime.JSX.Element;
|
|
316
|
+
|
|
317
|
+
declare function Control({ icon, disabled, active, onClick, title, }: {
|
|
318
|
+
icon: ReactNode;
|
|
319
|
+
disabled?: boolean;
|
|
320
|
+
active?: boolean;
|
|
321
|
+
onClick: (e: SyntheticEvent) => any;
|
|
322
|
+
title: string;
|
|
323
|
+
}): react_jsx_runtime.JSX.Element;
|
|
324
|
+
|
|
325
|
+
declare const RichTextMenu: {
|
|
326
|
+
({ children }: {
|
|
327
|
+
children: ReactNode;
|
|
328
|
+
}): react_jsx_runtime.JSX.Element;
|
|
329
|
+
Group: ({ children }: {
|
|
330
|
+
children: ReactNode;
|
|
331
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
332
|
+
Control: typeof Control;
|
|
333
|
+
AlignCenter: typeof AlignCenter;
|
|
334
|
+
AlignJustify: typeof AlignJustify;
|
|
335
|
+
AlignLeft: typeof AlignLeft;
|
|
336
|
+
AlignRight: typeof AlignRight;
|
|
337
|
+
AlignSelect: typeof AlignSelect;
|
|
338
|
+
Blockquote: typeof Blockquote;
|
|
339
|
+
Bold: typeof Bold;
|
|
340
|
+
BulletList: typeof BulletList;
|
|
341
|
+
CodeBlock: typeof CodeBlock;
|
|
342
|
+
HeadingSelect: typeof HeadingSelect;
|
|
343
|
+
HorizontalRule: typeof HorizontalRule;
|
|
344
|
+
InlineCode: typeof InlineCode;
|
|
345
|
+
Italic: typeof Italic;
|
|
346
|
+
ListSelect: typeof ListSelect;
|
|
347
|
+
OrderedList: typeof OrderedList;
|
|
348
|
+
Strikethrough: typeof Strikethrough;
|
|
349
|
+
Underline: typeof Underline;
|
|
350
|
+
};
|
|
351
|
+
|
|
265
352
|
declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
|
|
266
353
|
disableDrag?: boolean;
|
|
267
354
|
disableDragOnFocus?: boolean;
|
|
@@ -282,6 +369,7 @@ type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<User
|
|
|
282
369
|
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
283
370
|
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
284
371
|
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
|
372
|
+
getParentById: (id: string) => ComponentData | undefined;
|
|
285
373
|
history: {
|
|
286
374
|
back: HistorySlice["back"];
|
|
287
375
|
forward: HistorySlice["forward"];
|
|
@@ -313,12 +401,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
|
|
|
313
401
|
*/
|
|
314
402
|
declare function useGetPuck(): () => UsePuckStore<Config>;
|
|
315
403
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
declare const fieldsPlugin: (params?: {
|
|
319
|
-
mobileOnly?: boolean;
|
|
320
|
-
}) => PluginInternal;
|
|
321
|
-
|
|
322
|
-
declare const outlinePlugin: () => Plugin;
|
|
323
|
-
|
|
324
|
-
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createReducer, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|
|
404
|
+
export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RichTextMenu, RichtextField, RootDataWithProps, Separator, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|