@measured/puck 0.21.0-canary.c0db75c1 → 0.21.0-canary.c78dc826
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-PJYARUPI.mjs → chunk-C2TVYIYC.mjs} +76 -138
- package/dist/chunk-DCSQEDMK.mjs +194 -0
- package/dist/{chunk-S3RM5GHZ.mjs → chunk-DJSH5REF.mjs} +127 -93
- 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-R6CVX2IY.mjs +103 -0
- package/dist/{chunk-E4BOPJJV.mjs → chunk-TB3SSIAY.mjs} +3519 -5334
- 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 -759
- package/dist/index.d.mts +204 -21
- package/dist/index.d.ts +204 -21
- package/dist/index.js +7837 -5145
- package/dist/index.mjs +23 -16
- 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 -759
- package/dist/no-external.d.mts +17 -4
- package/dist/no-external.d.ts +17 -4
- package/dist/no-external.js +7837 -5145
- package/dist/no-external.mjs +23 -16
- package/dist/rsc.css +101 -0
- package/dist/rsc.d.mts +17 -2
- package/dist/rsc.d.ts +17 -2
- package/dist/rsc.js +409 -25
- package/dist/rsc.mjs +13 -8
- package/dist/{actions-CaYAKtsG.d.mts → walk-tree-Ja9bNCM9.d.mts} +235 -23
- package/dist/{actions-CaYAKtsG.d.ts → walk-tree-Ja9bNCM9.d.ts} +235 -23
- package/package.json +24 -7
- package/dist/chunk-J32NOAUF.mjs +0 -524
- package/dist/index-C6QwyW4B.d.ts +0 -109
- package/dist/index-IMRjDHZk.d.mts +0 -109
- package/dist/internal.d.mts +0 -12
- package/dist/internal.d.ts +0 -12
- package/dist/internal.js +0 -906
- package/dist/internal.mjs +0 -12
- package/dist/walk-tree-B-Q2gpMX.d.mts +0 -29
- package/dist/walk-tree-ksvZ7C4q.d.ts +0 -29
package/dist/index.d.mts
CHANGED
|
@@ -1,20 +1,147 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-B-Q2gpMX.mjs';
|
|
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';
|
|
4
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
4
|
import * as react from 'react';
|
|
6
|
-
import react__default, { ReactNode, SyntheticEvent, ReactElement
|
|
7
|
-
import {
|
|
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';
|
|
21
|
+
|
|
22
|
+
type HistorySlice<D = any> = {
|
|
23
|
+
index: number;
|
|
24
|
+
hasPast: () => boolean;
|
|
25
|
+
hasFuture: () => boolean;
|
|
26
|
+
histories: History<D>[];
|
|
27
|
+
record: (data: D) => void;
|
|
28
|
+
back: VoidFunction;
|
|
29
|
+
forward: VoidFunction;
|
|
30
|
+
currentHistory: () => History;
|
|
31
|
+
nextHistory: () => History<D> | null;
|
|
32
|
+
prevHistory: () => History<D> | null;
|
|
33
|
+
setHistories: (histories: History[]) => void;
|
|
34
|
+
setHistoryIndex: (index: number) => void;
|
|
35
|
+
initialAppState: D;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type NodeMethods = {
|
|
39
|
+
sync: () => void;
|
|
40
|
+
hideOverlay: () => void;
|
|
41
|
+
showOverlay: () => void;
|
|
42
|
+
};
|
|
43
|
+
type PuckNodeInstance = {
|
|
44
|
+
id: string;
|
|
45
|
+
methods: NodeMethods;
|
|
46
|
+
element: HTMLElement | null;
|
|
47
|
+
};
|
|
48
|
+
type NodesSlice = {
|
|
49
|
+
nodes: Record<string, PuckNodeInstance | undefined>;
|
|
50
|
+
registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
|
|
51
|
+
unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
55
|
+
item?: G["UserComponentData"] | null;
|
|
56
|
+
type?: keyof G["UserProps"];
|
|
57
|
+
root?: boolean;
|
|
58
|
+
};
|
|
59
|
+
type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
|
|
60
|
+
type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
|
|
61
|
+
type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
|
|
62
|
+
type Cache = Record<string, {
|
|
63
|
+
lastPermissions: Partial<Permissions>;
|
|
64
|
+
lastData: ComponentData | null;
|
|
65
|
+
lastParentId: string | null;
|
|
66
|
+
}>;
|
|
67
|
+
type PermissionsSlice = {
|
|
68
|
+
cache: Cache;
|
|
69
|
+
globalPermissions: Permissions;
|
|
70
|
+
resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
|
|
71
|
+
getPermissions: GetPermissions<Config>;
|
|
72
|
+
resolvePermissions: ResolvePermissions<Config>;
|
|
73
|
+
refreshPermissions: RefreshPermissions<Config>;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
type ComponentOrRootData = Omit<ComponentData<any>, "type">;
|
|
77
|
+
type FieldsSlice = {
|
|
78
|
+
fields: Fields | Partial<Fields>;
|
|
79
|
+
loading: boolean;
|
|
80
|
+
lastResolvedData: Partial<ComponentOrRootData>;
|
|
81
|
+
id: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
type Status = "LOADING" | "MOUNTED" | "READY";
|
|
85
|
+
type ZoomConfig = {
|
|
86
|
+
autoZoom: number;
|
|
87
|
+
rootHeight: number;
|
|
88
|
+
zoom: number;
|
|
89
|
+
};
|
|
90
|
+
type ComponentState = Record<string, {
|
|
91
|
+
loadingCount: number;
|
|
92
|
+
}>;
|
|
93
|
+
type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
94
|
+
state: G["UserAppState"];
|
|
95
|
+
dispatch: (action: PuckAction) => void;
|
|
96
|
+
config: UserConfig;
|
|
97
|
+
componentState: ComponentState;
|
|
98
|
+
setComponentState: (componentState: ComponentState) => void;
|
|
99
|
+
setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
|
|
100
|
+
unsetComponentLoading: (id: string) => void;
|
|
101
|
+
pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
|
|
102
|
+
resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
|
|
103
|
+
node: T;
|
|
104
|
+
didChange: boolean;
|
|
105
|
+
}>;
|
|
106
|
+
resolveAndCommitData: () => void;
|
|
107
|
+
plugins: Plugin[];
|
|
108
|
+
overrides: Partial<Overrides>;
|
|
109
|
+
viewports: Viewports;
|
|
110
|
+
zoomConfig: ZoomConfig;
|
|
111
|
+
setZoomConfig: (zoomConfig: ZoomConfig) => void;
|
|
112
|
+
status: Status;
|
|
113
|
+
setStatus: (status: Status) => void;
|
|
114
|
+
iframe: IframeConfig;
|
|
115
|
+
selectedItem?: G["UserData"]["content"][0] | null;
|
|
116
|
+
setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
|
|
117
|
+
getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
|
|
118
|
+
onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
|
|
119
|
+
metadata: Metadata;
|
|
120
|
+
fields: FieldsSlice;
|
|
121
|
+
history: HistorySlice;
|
|
122
|
+
nodes: NodesSlice;
|
|
123
|
+
permissions: PermissionsSlice;
|
|
124
|
+
fieldTransforms: FieldTransforms;
|
|
125
|
+
currentRichText?: {
|
|
126
|
+
inlineComponentId?: string;
|
|
127
|
+
inline: boolean;
|
|
128
|
+
field: RichtextField;
|
|
129
|
+
editor: Editor;
|
|
130
|
+
id: string;
|
|
131
|
+
} | null;
|
|
132
|
+
};
|
|
8
133
|
|
|
9
134
|
declare const ActionBar: {
|
|
10
135
|
({ label, children, }: {
|
|
11
136
|
label?: string;
|
|
12
137
|
children?: ReactNode;
|
|
13
138
|
}): react_jsx_runtime.JSX.Element;
|
|
14
|
-
Action: ({ children, label, onClick, }: {
|
|
139
|
+
Action: ({ children, label, onClick, active, disabled, }: {
|
|
15
140
|
children: ReactNode;
|
|
16
141
|
label?: string;
|
|
17
142
|
onClick: (e: SyntheticEvent) => void;
|
|
143
|
+
active?: boolean;
|
|
144
|
+
disabled?: boolean;
|
|
18
145
|
}) => react_jsx_runtime.JSX.Element;
|
|
19
146
|
Label: ({ label }: {
|
|
20
147
|
label: string;
|
|
@@ -22,11 +149,14 @@ declare const ActionBar: {
|
|
|
22
149
|
Group: ({ children }: {
|
|
23
150
|
children: ReactNode;
|
|
24
151
|
}) => react_jsx_runtime.JSX.Element;
|
|
152
|
+
Separator: () => react_jsx_runtime.JSX.Element;
|
|
25
153
|
};
|
|
26
|
-
declare const Action: ({ children, label, onClick, }: {
|
|
154
|
+
declare const Action: ({ children, label, onClick, active, disabled, }: {
|
|
27
155
|
children: ReactNode;
|
|
28
156
|
label?: string;
|
|
29
157
|
onClick: (e: SyntheticEvent) => void;
|
|
158
|
+
active?: boolean;
|
|
159
|
+
disabled?: boolean;
|
|
30
160
|
}) => react_jsx_runtime.JSX.Element;
|
|
31
161
|
declare const Group: ({ children }: {
|
|
32
162
|
children: ReactNode;
|
|
@@ -34,6 +164,7 @@ declare const Group: ({ children }: {
|
|
|
34
164
|
declare const Label: ({ label }: {
|
|
35
165
|
label: string;
|
|
36
166
|
}) => react_jsx_runtime.JSX.Element;
|
|
167
|
+
declare const Separator: () => react_jsx_runtime.JSX.Element;
|
|
37
168
|
|
|
38
169
|
declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
|
|
39
170
|
children?: ReactNode;
|
|
@@ -82,18 +213,17 @@ declare const Drawer: {
|
|
|
82
213
|
|
|
83
214
|
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
|
84
215
|
|
|
85
|
-
declare const IconButton: ({ children, href, onClick,
|
|
216
|
+
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
|
217
|
+
active?: boolean;
|
|
86
218
|
children: ReactNode;
|
|
87
219
|
href?: string;
|
|
88
220
|
onClick?: (e: SyntheticEvent) => void | Promise<void>;
|
|
89
|
-
variant?: "primary" | "secondary";
|
|
90
221
|
type?: "button" | "submit" | "reset";
|
|
91
222
|
disabled?: boolean;
|
|
92
223
|
tabIndex?: number;
|
|
93
224
|
newTab?: boolean;
|
|
94
225
|
fullWidth?: boolean;
|
|
95
226
|
title: string;
|
|
96
|
-
suppressHydrationWarning?: boolean;
|
|
97
227
|
}) => react_jsx_runtime.JSX.Element;
|
|
98
228
|
|
|
99
229
|
type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
@@ -126,8 +256,6 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
|
|
|
126
256
|
};
|
|
127
257
|
initialHistory?: InitialHistory;
|
|
128
258
|
metadata?: Metadata;
|
|
129
|
-
height?: CSSProperties["height"];
|
|
130
|
-
_experimentalFullScreenCanvas?: boolean;
|
|
131
259
|
};
|
|
132
260
|
declare function Puck<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: PuckProps<UserConfig>): react_jsx_runtime.JSX.Element;
|
|
133
261
|
declare namespace Puck {
|
|
@@ -152,6 +280,69 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
|
|
|
152
280
|
metadata?: Metadata;
|
|
153
281
|
}): react_jsx_runtime.JSX.Element;
|
|
154
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 Bold(): react_jsx_runtime.JSX.Element;
|
|
292
|
+
|
|
293
|
+
declare function Italic(): react_jsx_runtime.JSX.Element;
|
|
294
|
+
|
|
295
|
+
declare function Underline(): react_jsx_runtime.JSX.Element;
|
|
296
|
+
|
|
297
|
+
declare function Strikethrough(): react_jsx_runtime.JSX.Element;
|
|
298
|
+
|
|
299
|
+
declare function InlineCode(): react_jsx_runtime.JSX.Element;
|
|
300
|
+
|
|
301
|
+
declare function BulletList(): react_jsx_runtime.JSX.Element;
|
|
302
|
+
|
|
303
|
+
declare function OrderedList(): react_jsx_runtime.JSX.Element;
|
|
304
|
+
|
|
305
|
+
declare function CodeBlock(): react_jsx_runtime.JSX.Element;
|
|
306
|
+
|
|
307
|
+
declare function Blockquote(): react_jsx_runtime.JSX.Element;
|
|
308
|
+
|
|
309
|
+
declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
|
|
310
|
+
|
|
311
|
+
declare function Control({ icon, disabled, active, onClick, title, }: {
|
|
312
|
+
icon: ReactNode;
|
|
313
|
+
disabled?: boolean;
|
|
314
|
+
active?: boolean;
|
|
315
|
+
onClick: (e: SyntheticEvent) => any;
|
|
316
|
+
title: string;
|
|
317
|
+
}): react_jsx_runtime.JSX.Element;
|
|
318
|
+
|
|
319
|
+
declare const RichTextMenu: {
|
|
320
|
+
({ children }: {
|
|
321
|
+
children: ReactNode;
|
|
322
|
+
}): react_jsx_runtime.JSX.Element;
|
|
323
|
+
Group: ({ children }: {
|
|
324
|
+
children: ReactNode;
|
|
325
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
326
|
+
Control: typeof Control;
|
|
327
|
+
AlignCenter: typeof AlignCenter;
|
|
328
|
+
AlignJustify: typeof AlignJustify;
|
|
329
|
+
AlignLeft: typeof AlignLeft;
|
|
330
|
+
AlignRight: typeof AlignRight;
|
|
331
|
+
AlignSelect: () => react_jsx_runtime.JSX.Element;
|
|
332
|
+
Blockquote: typeof Blockquote;
|
|
333
|
+
Bold: typeof Bold;
|
|
334
|
+
BulletList: typeof BulletList;
|
|
335
|
+
CodeBlock: typeof CodeBlock;
|
|
336
|
+
HeadingSelect: () => react_jsx_runtime.JSX.Element;
|
|
337
|
+
HorizontalRule: typeof HorizontalRule;
|
|
338
|
+
InlineCode: typeof InlineCode;
|
|
339
|
+
Italic: typeof Italic;
|
|
340
|
+
ListSelect: () => react_jsx_runtime.JSX.Element;
|
|
341
|
+
OrderedList: typeof OrderedList;
|
|
342
|
+
Strikethrough: typeof Strikethrough;
|
|
343
|
+
Underline: typeof Underline;
|
|
344
|
+
};
|
|
345
|
+
|
|
155
346
|
declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
|
|
156
347
|
disableDrag?: boolean;
|
|
157
348
|
disableDragOnFocus?: boolean;
|
|
@@ -204,12 +395,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
|
|
|
204
395
|
*/
|
|
205
396
|
declare function useGetPuck(): () => UsePuckStore<Config>;
|
|
206
397
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
declare const fieldsPlugin: (params?: {
|
|
210
|
-
mobileOnly?: boolean;
|
|
211
|
-
}) => PluginInternal;
|
|
212
|
-
|
|
213
|
-
declare const outlinePlugin: () => Plugin;
|
|
214
|
-
|
|
215
|
-
export { Action, ActionBar, AutoField, Button, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Group, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|
|
398
|
+
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,20 +1,147 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-ksvZ7C4q.js';
|
|
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';
|
|
4
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
4
|
import * as react from 'react';
|
|
6
|
-
import react__default, { ReactNode, SyntheticEvent, ReactElement
|
|
7
|
-
import {
|
|
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';
|
|
21
|
+
|
|
22
|
+
type HistorySlice<D = any> = {
|
|
23
|
+
index: number;
|
|
24
|
+
hasPast: () => boolean;
|
|
25
|
+
hasFuture: () => boolean;
|
|
26
|
+
histories: History<D>[];
|
|
27
|
+
record: (data: D) => void;
|
|
28
|
+
back: VoidFunction;
|
|
29
|
+
forward: VoidFunction;
|
|
30
|
+
currentHistory: () => History;
|
|
31
|
+
nextHistory: () => History<D> | null;
|
|
32
|
+
prevHistory: () => History<D> | null;
|
|
33
|
+
setHistories: (histories: History[]) => void;
|
|
34
|
+
setHistoryIndex: (index: number) => void;
|
|
35
|
+
initialAppState: D;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type NodeMethods = {
|
|
39
|
+
sync: () => void;
|
|
40
|
+
hideOverlay: () => void;
|
|
41
|
+
showOverlay: () => void;
|
|
42
|
+
};
|
|
43
|
+
type PuckNodeInstance = {
|
|
44
|
+
id: string;
|
|
45
|
+
methods: NodeMethods;
|
|
46
|
+
element: HTMLElement | null;
|
|
47
|
+
};
|
|
48
|
+
type NodesSlice = {
|
|
49
|
+
nodes: Record<string, PuckNodeInstance | undefined>;
|
|
50
|
+
registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
|
|
51
|
+
unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
55
|
+
item?: G["UserComponentData"] | null;
|
|
56
|
+
type?: keyof G["UserProps"];
|
|
57
|
+
root?: boolean;
|
|
58
|
+
};
|
|
59
|
+
type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
|
|
60
|
+
type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
|
|
61
|
+
type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
|
|
62
|
+
type Cache = Record<string, {
|
|
63
|
+
lastPermissions: Partial<Permissions>;
|
|
64
|
+
lastData: ComponentData | null;
|
|
65
|
+
lastParentId: string | null;
|
|
66
|
+
}>;
|
|
67
|
+
type PermissionsSlice = {
|
|
68
|
+
cache: Cache;
|
|
69
|
+
globalPermissions: Permissions;
|
|
70
|
+
resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
|
|
71
|
+
getPermissions: GetPermissions<Config>;
|
|
72
|
+
resolvePermissions: ResolvePermissions<Config>;
|
|
73
|
+
refreshPermissions: RefreshPermissions<Config>;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
type ComponentOrRootData = Omit<ComponentData<any>, "type">;
|
|
77
|
+
type FieldsSlice = {
|
|
78
|
+
fields: Fields | Partial<Fields>;
|
|
79
|
+
loading: boolean;
|
|
80
|
+
lastResolvedData: Partial<ComponentOrRootData>;
|
|
81
|
+
id: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
type Status = "LOADING" | "MOUNTED" | "READY";
|
|
85
|
+
type ZoomConfig = {
|
|
86
|
+
autoZoom: number;
|
|
87
|
+
rootHeight: number;
|
|
88
|
+
zoom: number;
|
|
89
|
+
};
|
|
90
|
+
type ComponentState = Record<string, {
|
|
91
|
+
loadingCount: number;
|
|
92
|
+
}>;
|
|
93
|
+
type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
94
|
+
state: G["UserAppState"];
|
|
95
|
+
dispatch: (action: PuckAction) => void;
|
|
96
|
+
config: UserConfig;
|
|
97
|
+
componentState: ComponentState;
|
|
98
|
+
setComponentState: (componentState: ComponentState) => void;
|
|
99
|
+
setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
|
|
100
|
+
unsetComponentLoading: (id: string) => void;
|
|
101
|
+
pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
|
|
102
|
+
resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
|
|
103
|
+
node: T;
|
|
104
|
+
didChange: boolean;
|
|
105
|
+
}>;
|
|
106
|
+
resolveAndCommitData: () => void;
|
|
107
|
+
plugins: Plugin[];
|
|
108
|
+
overrides: Partial<Overrides>;
|
|
109
|
+
viewports: Viewports;
|
|
110
|
+
zoomConfig: ZoomConfig;
|
|
111
|
+
setZoomConfig: (zoomConfig: ZoomConfig) => void;
|
|
112
|
+
status: Status;
|
|
113
|
+
setStatus: (status: Status) => void;
|
|
114
|
+
iframe: IframeConfig;
|
|
115
|
+
selectedItem?: G["UserData"]["content"][0] | null;
|
|
116
|
+
setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
|
|
117
|
+
getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
|
|
118
|
+
onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
|
|
119
|
+
metadata: Metadata;
|
|
120
|
+
fields: FieldsSlice;
|
|
121
|
+
history: HistorySlice;
|
|
122
|
+
nodes: NodesSlice;
|
|
123
|
+
permissions: PermissionsSlice;
|
|
124
|
+
fieldTransforms: FieldTransforms;
|
|
125
|
+
currentRichText?: {
|
|
126
|
+
inlineComponentId?: string;
|
|
127
|
+
inline: boolean;
|
|
128
|
+
field: RichtextField;
|
|
129
|
+
editor: Editor;
|
|
130
|
+
id: string;
|
|
131
|
+
} | null;
|
|
132
|
+
};
|
|
8
133
|
|
|
9
134
|
declare const ActionBar: {
|
|
10
135
|
({ label, children, }: {
|
|
11
136
|
label?: string;
|
|
12
137
|
children?: ReactNode;
|
|
13
138
|
}): react_jsx_runtime.JSX.Element;
|
|
14
|
-
Action: ({ children, label, onClick, }: {
|
|
139
|
+
Action: ({ children, label, onClick, active, disabled, }: {
|
|
15
140
|
children: ReactNode;
|
|
16
141
|
label?: string;
|
|
17
142
|
onClick: (e: SyntheticEvent) => void;
|
|
143
|
+
active?: boolean;
|
|
144
|
+
disabled?: boolean;
|
|
18
145
|
}) => react_jsx_runtime.JSX.Element;
|
|
19
146
|
Label: ({ label }: {
|
|
20
147
|
label: string;
|
|
@@ -22,11 +149,14 @@ declare const ActionBar: {
|
|
|
22
149
|
Group: ({ children }: {
|
|
23
150
|
children: ReactNode;
|
|
24
151
|
}) => react_jsx_runtime.JSX.Element;
|
|
152
|
+
Separator: () => react_jsx_runtime.JSX.Element;
|
|
25
153
|
};
|
|
26
|
-
declare const Action: ({ children, label, onClick, }: {
|
|
154
|
+
declare const Action: ({ children, label, onClick, active, disabled, }: {
|
|
27
155
|
children: ReactNode;
|
|
28
156
|
label?: string;
|
|
29
157
|
onClick: (e: SyntheticEvent) => void;
|
|
158
|
+
active?: boolean;
|
|
159
|
+
disabled?: boolean;
|
|
30
160
|
}) => react_jsx_runtime.JSX.Element;
|
|
31
161
|
declare const Group: ({ children }: {
|
|
32
162
|
children: ReactNode;
|
|
@@ -34,6 +164,7 @@ declare const Group: ({ children }: {
|
|
|
34
164
|
declare const Label: ({ label }: {
|
|
35
165
|
label: string;
|
|
36
166
|
}) => react_jsx_runtime.JSX.Element;
|
|
167
|
+
declare const Separator: () => react_jsx_runtime.JSX.Element;
|
|
37
168
|
|
|
38
169
|
declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
|
|
39
170
|
children?: ReactNode;
|
|
@@ -82,18 +213,17 @@ declare const Drawer: {
|
|
|
82
213
|
|
|
83
214
|
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
|
84
215
|
|
|
85
|
-
declare const IconButton: ({ children, href, onClick,
|
|
216
|
+
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
|
217
|
+
active?: boolean;
|
|
86
218
|
children: ReactNode;
|
|
87
219
|
href?: string;
|
|
88
220
|
onClick?: (e: SyntheticEvent) => void | Promise<void>;
|
|
89
|
-
variant?: "primary" | "secondary";
|
|
90
221
|
type?: "button" | "submit" | "reset";
|
|
91
222
|
disabled?: boolean;
|
|
92
223
|
tabIndex?: number;
|
|
93
224
|
newTab?: boolean;
|
|
94
225
|
fullWidth?: boolean;
|
|
95
226
|
title: string;
|
|
96
|
-
suppressHydrationWarning?: boolean;
|
|
97
227
|
}) => react_jsx_runtime.JSX.Element;
|
|
98
228
|
|
|
99
229
|
type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
@@ -126,8 +256,6 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
|
|
|
126
256
|
};
|
|
127
257
|
initialHistory?: InitialHistory;
|
|
128
258
|
metadata?: Metadata;
|
|
129
|
-
height?: CSSProperties["height"];
|
|
130
|
-
_experimentalFullScreenCanvas?: boolean;
|
|
131
259
|
};
|
|
132
260
|
declare function Puck<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: PuckProps<UserConfig>): react_jsx_runtime.JSX.Element;
|
|
133
261
|
declare namespace Puck {
|
|
@@ -152,6 +280,69 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
|
|
|
152
280
|
metadata?: Metadata;
|
|
153
281
|
}): react_jsx_runtime.JSX.Element;
|
|
154
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 Bold(): react_jsx_runtime.JSX.Element;
|
|
292
|
+
|
|
293
|
+
declare function Italic(): react_jsx_runtime.JSX.Element;
|
|
294
|
+
|
|
295
|
+
declare function Underline(): react_jsx_runtime.JSX.Element;
|
|
296
|
+
|
|
297
|
+
declare function Strikethrough(): react_jsx_runtime.JSX.Element;
|
|
298
|
+
|
|
299
|
+
declare function InlineCode(): react_jsx_runtime.JSX.Element;
|
|
300
|
+
|
|
301
|
+
declare function BulletList(): react_jsx_runtime.JSX.Element;
|
|
302
|
+
|
|
303
|
+
declare function OrderedList(): react_jsx_runtime.JSX.Element;
|
|
304
|
+
|
|
305
|
+
declare function CodeBlock(): react_jsx_runtime.JSX.Element;
|
|
306
|
+
|
|
307
|
+
declare function Blockquote(): react_jsx_runtime.JSX.Element;
|
|
308
|
+
|
|
309
|
+
declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
|
|
310
|
+
|
|
311
|
+
declare function Control({ icon, disabled, active, onClick, title, }: {
|
|
312
|
+
icon: ReactNode;
|
|
313
|
+
disabled?: boolean;
|
|
314
|
+
active?: boolean;
|
|
315
|
+
onClick: (e: SyntheticEvent) => any;
|
|
316
|
+
title: string;
|
|
317
|
+
}): react_jsx_runtime.JSX.Element;
|
|
318
|
+
|
|
319
|
+
declare const RichTextMenu: {
|
|
320
|
+
({ children }: {
|
|
321
|
+
children: ReactNode;
|
|
322
|
+
}): react_jsx_runtime.JSX.Element;
|
|
323
|
+
Group: ({ children }: {
|
|
324
|
+
children: ReactNode;
|
|
325
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
326
|
+
Control: typeof Control;
|
|
327
|
+
AlignCenter: typeof AlignCenter;
|
|
328
|
+
AlignJustify: typeof AlignJustify;
|
|
329
|
+
AlignLeft: typeof AlignLeft;
|
|
330
|
+
AlignRight: typeof AlignRight;
|
|
331
|
+
AlignSelect: () => react_jsx_runtime.JSX.Element;
|
|
332
|
+
Blockquote: typeof Blockquote;
|
|
333
|
+
Bold: typeof Bold;
|
|
334
|
+
BulletList: typeof BulletList;
|
|
335
|
+
CodeBlock: typeof CodeBlock;
|
|
336
|
+
HeadingSelect: () => react_jsx_runtime.JSX.Element;
|
|
337
|
+
HorizontalRule: typeof HorizontalRule;
|
|
338
|
+
InlineCode: typeof InlineCode;
|
|
339
|
+
Italic: typeof Italic;
|
|
340
|
+
ListSelect: () => react_jsx_runtime.JSX.Element;
|
|
341
|
+
OrderedList: typeof OrderedList;
|
|
342
|
+
Strikethrough: typeof Strikethrough;
|
|
343
|
+
Underline: typeof Underline;
|
|
344
|
+
};
|
|
345
|
+
|
|
155
346
|
declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
|
|
156
347
|
disableDrag?: boolean;
|
|
157
348
|
disableDragOnFocus?: boolean;
|
|
@@ -204,12 +395,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
|
|
|
204
395
|
*/
|
|
205
396
|
declare function useGetPuck(): () => UsePuckStore<Config>;
|
|
206
397
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
declare const fieldsPlugin: (params?: {
|
|
210
|
-
mobileOnly?: boolean;
|
|
211
|
-
}) => PluginInternal;
|
|
212
|
-
|
|
213
|
-
declare const outlinePlugin: () => Plugin;
|
|
214
|
-
|
|
215
|
-
export { Action, ActionBar, AutoField, Button, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Group, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createUsePuck, fieldsPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|
|
398
|
+
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 };
|