@measured/puck 0.21.0-canary.c78dc826 → 0.21.0-canary.cbc526d1
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-N46HUQEC.mjs → Editor-32UYWE6W.mjs} +13 -10
- package/dist/{Editor-F2LSS6SE.css → Editor-IQP25PUX.css} +28 -27
- package/dist/{Render-QEMDIDQC.css → Render-3OV4N4MT.css} +28 -27
- package/dist/{Render-Y567PGZ7.mjs → Render-FXZX6NFH.mjs} +6 -4
- package/dist/{walk-tree-Ja9bNCM9.d.mts → actions-BkBoKAc5.d.mts} +26 -36
- package/dist/{walk-tree-Ja9bNCM9.d.ts → actions-BkBoKAc5.d.ts} +26 -36
- package/dist/{chunk-3QHWXJEI.mjs → chunk-3VQHXASI.mjs} +2 -2
- package/dist/{chunk-K3V4LVUL.mjs → chunk-6KNQXLQR.mjs} +14 -10
- package/dist/chunk-AOEDIUVK.mjs +11 -0
- package/dist/{chunk-GQKMOYLG.mjs → chunk-GVKHZNTR.mjs} +2 -2
- package/dist/{chunk-7KY6RHEY.mjs → chunk-K562SEXI.mjs} +109 -526
- package/dist/chunk-KN3XDS7U.mjs +528 -0
- package/dist/{chunk-DCSQEDMK.mjs → chunk-M6W7YEVX.mjs} +1 -100
- package/dist/{chunk-DNF2EMM4.mjs → chunk-MEL7FUSF.mjs} +2 -2
- package/dist/{chunk-C2TVYIYC.mjs → chunk-NYGQH27S.mjs} +105 -75
- package/dist/{chunk-DJSH5REF.mjs → chunk-Q3TJ2VYO.mjs} +25 -126
- package/dist/chunk-REWRIUGR.mjs +156 -0
- package/dist/{chunk-FNWOH4R6.mjs → chunk-V2IQTPPK.mjs} +8 -6
- package/dist/{chunk-R6CVX2IY.mjs → chunk-V5I7CVLT.mjs} +1 -1
- package/dist/{chunk-TB3SSIAY.mjs → chunk-WD3LNSAC.mjs} +5258 -4424
- package/dist/chunk-Y2EFNT5P.mjs +108 -0
- package/dist/{full-NLUNPJWS.mjs → full-4OS3O57Y.mjs} +10 -7
- package/dist/index-bqD1SEOb.d.mts +118 -0
- package/dist/index-lt1zf5WR.d.ts +118 -0
- package/dist/index.css +732 -341
- package/dist/index.d.mts +31 -120
- package/dist/index.d.ts +31 -120
- package/dist/index.js +3494 -2436
- package/dist/index.mjs +22 -16
- package/dist/internal.d.mts +27 -0
- package/dist/internal.d.ts +27 -0
- package/dist/internal.js +927 -0
- package/dist/internal.mjs +13 -0
- package/dist/{loaded-ZXOU6S6R.mjs → loaded-DCQVLO7I.mjs} +7 -4
- package/dist/{loaded-HMSPJUZM.mjs → loaded-JGRO7BH7.mjs} +7 -4
- package/dist/{loaded-EV34KGYJ.mjs → loaded-KKVJE5KH.mjs} +7 -4
- package/dist/no-external.css +870 -475
- package/dist/no-external.d.mts +4 -2
- package/dist/no-external.d.ts +4 -2
- package/dist/no-external.js +3412 -2351
- package/dist/no-external.mjs +22 -11
- package/dist/rsc.css +28 -27
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +146 -83
- package/dist/rsc.mjs +6 -4
- package/dist/walk-tree-CRRDqx6_.d.mts +29 -0
- package/dist/walk-tree-CS7sEpfG.d.ts +29 -0
- package/package.json +9 -4
- package/dist/chunk-WUWXFMEM.mjs +0 -11
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, i as ResolveDataTrigger, t as ItemSelector, c as ComponentData, u as PluginInternal } from './actions-BkBoKAc5.mjs';
|
|
2
|
+
export { ag as Adaptor, A as AppState, ae as ArrayField, N as ArrayState, ar as AsFieldProps, a0 as BaseData, a8 as BaseField, ai as CacheOpts, m as ComponentConfig, X as ComponentConfigExtensions, $ as ComponentConfigParams, a4 as ComponentDataMap, a2 as ComponentDataOptionalId, a6 as ComponentMetadata, _ as ConfigParams, b as Content, al as CustomField, ak as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, x as Direction, y as DragAxis, aj as ExternalField, ah as ExternalFieldWithAdaptor, Z as ExtractConfigParams, at as ExtractField, a7 as FieldMetadata, K as FieldRenderFunctions, E as FieldTransformFn, B as FieldTransformFnParams, F as Fields, H as History, L as ItemWithId, a3 as MappedItem, aa as NumberField, af as ObjectField, J as OverrideKey, T as PuckComponent, an as PuckContext, a5 as PuckMetadata, ad as RadioField, w as RichText, o as RichtextField, Y as RootConfig, R as RootData, h as RootDataWithProps, a1 as RootDataWithoutProps, ac as SelectField, S as Slot, Q as SlotComponent, am as SlotField, a9 as TextField, ab as TextareaField, z as Viewport, as as WithChildren, W as WithId, aq as WithPuckProps, v as WithSlotProps, G as overrideKeys } from './actions-BkBoKAc5.mjs';
|
|
3
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CRRDqx6_.mjs';
|
|
3
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import * as react from 'react';
|
|
5
|
-
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import react__default, { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
|
|
7
|
+
import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-bqD1SEOb.mjs';
|
|
8
|
+
import '@tiptap/react';
|
|
7
9
|
import '@tiptap/extension-blockquote';
|
|
8
10
|
import '@tiptap/extension-bold';
|
|
9
11
|
import '@tiptap/extension-code';
|
|
@@ -19,118 +21,6 @@ import '@tiptap/extension-strike';
|
|
|
19
21
|
import '@tiptap/extension-text-align';
|
|
20
22
|
import '@tiptap/extension-underline';
|
|
21
23
|
|
|
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
|
-
};
|
|
133
|
-
|
|
134
24
|
declare const ActionBar: {
|
|
135
25
|
({ label, children, }: {
|
|
136
26
|
label?: string;
|
|
@@ -174,8 +64,11 @@ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }:
|
|
|
174
64
|
readOnly?: boolean;
|
|
175
65
|
className?: string;
|
|
176
66
|
}) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
177
68
|
type FieldNoLabel<Props extends any = any> = Omit<Field<Props>, "label">;
|
|
178
|
-
declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<FieldType, ValueType>
|
|
69
|
+
declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<FieldType, ValueType> & {
|
|
70
|
+
value: any;
|
|
71
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
179
72
|
|
|
180
73
|
declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, ...props }: {
|
|
181
74
|
children: ReactNode;
|
|
@@ -211,9 +104,9 @@ declare const Drawer: {
|
|
|
211
104
|
}) => react_jsx_runtime.JSX.Element;
|
|
212
105
|
};
|
|
213
106
|
|
|
214
|
-
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
|
107
|
+
declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
215
108
|
|
|
216
|
-
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
|
109
|
+
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, suppressHydrationWarning, }: {
|
|
217
110
|
active?: boolean;
|
|
218
111
|
children: ReactNode;
|
|
219
112
|
href?: string;
|
|
@@ -224,6 +117,7 @@ declare const IconButton: ({ active, children, href, onClick, type, disabled, ta
|
|
|
224
117
|
newTab?: boolean;
|
|
225
118
|
fullWidth?: boolean;
|
|
226
119
|
title: string;
|
|
120
|
+
suppressHydrationWarning?: boolean;
|
|
227
121
|
}) => react_jsx_runtime.JSX.Element;
|
|
228
122
|
|
|
229
123
|
type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
@@ -256,6 +150,8 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
|
|
|
256
150
|
};
|
|
257
151
|
initialHistory?: InitialHistory;
|
|
258
152
|
metadata?: Metadata;
|
|
153
|
+
height?: CSSProperties["height"];
|
|
154
|
+
_experimentalFullScreenCanvas?: boolean;
|
|
259
155
|
};
|
|
260
156
|
declare function Puck<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: PuckProps<UserConfig>): react_jsx_runtime.JSX.Element;
|
|
261
157
|
declare namespace Puck {
|
|
@@ -263,6 +159,9 @@ declare namespace Puck {
|
|
|
263
159
|
var Fields: react.MemoExoticComponent<({ wrapFields }: {
|
|
264
160
|
wrapFields?: boolean;
|
|
265
161
|
}) => react_jsx_runtime.JSX.Element>;
|
|
162
|
+
var Layout: ({ children }: {
|
|
163
|
+
children?: ReactNode;
|
|
164
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
266
165
|
var Outline: () => react_jsx_runtime.JSX.Element;
|
|
267
166
|
var Preview: ({ id }: {
|
|
268
167
|
id?: string;
|
|
@@ -359,6 +258,8 @@ type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<User
|
|
|
359
258
|
dispatch: AppStore["dispatch"];
|
|
360
259
|
getPermissions: GetPermissions<UserConfig>;
|
|
361
260
|
refreshPermissions: RefreshPermissions<UserConfig>;
|
|
261
|
+
resolveDataById: (id: string, trigger?: ResolveDataTrigger) => void;
|
|
262
|
+
resolveDataBySelector: (selector: ItemSelector, trigger?: ResolveDataTrigger) => void;
|
|
362
263
|
selectedItem: G["UserComponentData"] | null;
|
|
363
264
|
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
364
265
|
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
@@ -395,4 +296,14 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
|
|
|
395
296
|
*/
|
|
396
297
|
declare function useGetPuck(): () => UsePuckStore<Config>;
|
|
397
298
|
|
|
398
|
-
|
|
299
|
+
declare const blocksPlugin: () => Plugin;
|
|
300
|
+
|
|
301
|
+
declare const fieldsPlugin: (params?: {
|
|
302
|
+
desktopSideBar?: "left" | "right";
|
|
303
|
+
}) => PluginInternal;
|
|
304
|
+
|
|
305
|
+
declare const outlinePlugin: () => Plugin;
|
|
306
|
+
|
|
307
|
+
declare const legacySideBarPlugin: () => Plugin;
|
|
308
|
+
|
|
309
|
+
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, ResolveDataTrigger, RichTextMenu, Separator, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createUsePuck, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, i as ResolveDataTrigger, t as ItemSelector, c as ComponentData, u as PluginInternal } from './actions-BkBoKAc5.js';
|
|
2
|
+
export { ag as Adaptor, A as AppState, ae as ArrayField, N as ArrayState, ar as AsFieldProps, a0 as BaseData, a8 as BaseField, ai as CacheOpts, m as ComponentConfig, X as ComponentConfigExtensions, $ as ComponentConfigParams, a4 as ComponentDataMap, a2 as ComponentDataOptionalId, a6 as ComponentMetadata, _ as ConfigParams, b as Content, al as CustomField, ak as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ap as DefaultRootProps, ao as DefaultRootRenderProps, x as Direction, y as DragAxis, aj as ExternalField, ah as ExternalFieldWithAdaptor, Z as ExtractConfigParams, at as ExtractField, a7 as FieldMetadata, K as FieldRenderFunctions, E as FieldTransformFn, B as FieldTransformFnParams, F as Fields, H as History, L as ItemWithId, a3 as MappedItem, aa as NumberField, af as ObjectField, J as OverrideKey, T as PuckComponent, an as PuckContext, a5 as PuckMetadata, ad as RadioField, w as RichText, o as RichtextField, Y as RootConfig, R as RootData, h as RootDataWithProps, a1 as RootDataWithoutProps, ac as SelectField, S as Slot, Q as SlotComponent, am as SlotField, a9 as TextField, ab as TextareaField, z as Viewport, as as WithChildren, W as WithId, aq as WithPuckProps, v as WithSlotProps, G as overrideKeys } from './actions-BkBoKAc5.js';
|
|
3
|
+
export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CS7sEpfG.js';
|
|
3
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import * as react from 'react';
|
|
5
|
-
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import react__default, { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
|
|
7
|
+
import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-lt1zf5WR.js';
|
|
8
|
+
import '@tiptap/react';
|
|
7
9
|
import '@tiptap/extension-blockquote';
|
|
8
10
|
import '@tiptap/extension-bold';
|
|
9
11
|
import '@tiptap/extension-code';
|
|
@@ -19,118 +21,6 @@ import '@tiptap/extension-strike';
|
|
|
19
21
|
import '@tiptap/extension-text-align';
|
|
20
22
|
import '@tiptap/extension-underline';
|
|
21
23
|
|
|
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
|
-
};
|
|
133
|
-
|
|
134
24
|
declare const ActionBar: {
|
|
135
25
|
({ label, children, }: {
|
|
136
26
|
label?: string;
|
|
@@ -174,8 +64,11 @@ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }:
|
|
|
174
64
|
readOnly?: boolean;
|
|
175
65
|
className?: string;
|
|
176
66
|
}) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
177
68
|
type FieldNoLabel<Props extends any = any> = Omit<Field<Props>, "label">;
|
|
178
|
-
declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<FieldType, ValueType>
|
|
69
|
+
declare function AutoField<ValueType = any, FieldType extends FieldNoLabel<ValueType> = FieldNoLabel<ValueType>>(props: FieldProps<FieldType, ValueType> & {
|
|
70
|
+
value: any;
|
|
71
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
179
72
|
|
|
180
73
|
declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, ...props }: {
|
|
181
74
|
children: ReactNode;
|
|
@@ -211,9 +104,9 @@ declare const Drawer: {
|
|
|
211
104
|
}) => react_jsx_runtime.JSX.Element;
|
|
212
105
|
};
|
|
213
106
|
|
|
214
|
-
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
|
107
|
+
declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
215
108
|
|
|
216
|
-
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
|
109
|
+
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, suppressHydrationWarning, }: {
|
|
217
110
|
active?: boolean;
|
|
218
111
|
children: ReactNode;
|
|
219
112
|
href?: string;
|
|
@@ -224,6 +117,7 @@ declare const IconButton: ({ active, children, href, onClick, type, disabled, ta
|
|
|
224
117
|
newTab?: boolean;
|
|
225
118
|
fullWidth?: boolean;
|
|
226
119
|
title: string;
|
|
120
|
+
suppressHydrationWarning?: boolean;
|
|
227
121
|
}) => react_jsx_runtime.JSX.Element;
|
|
228
122
|
|
|
229
123
|
type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
@@ -256,6 +150,8 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
|
|
|
256
150
|
};
|
|
257
151
|
initialHistory?: InitialHistory;
|
|
258
152
|
metadata?: Metadata;
|
|
153
|
+
height?: CSSProperties["height"];
|
|
154
|
+
_experimentalFullScreenCanvas?: boolean;
|
|
259
155
|
};
|
|
260
156
|
declare function Puck<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: PuckProps<UserConfig>): react_jsx_runtime.JSX.Element;
|
|
261
157
|
declare namespace Puck {
|
|
@@ -263,6 +159,9 @@ declare namespace Puck {
|
|
|
263
159
|
var Fields: react.MemoExoticComponent<({ wrapFields }: {
|
|
264
160
|
wrapFields?: boolean;
|
|
265
161
|
}) => react_jsx_runtime.JSX.Element>;
|
|
162
|
+
var Layout: ({ children }: {
|
|
163
|
+
children?: ReactNode;
|
|
164
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
266
165
|
var Outline: () => react_jsx_runtime.JSX.Element;
|
|
267
166
|
var Preview: ({ id }: {
|
|
268
167
|
id?: string;
|
|
@@ -359,6 +258,8 @@ type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<User
|
|
|
359
258
|
dispatch: AppStore["dispatch"];
|
|
360
259
|
getPermissions: GetPermissions<UserConfig>;
|
|
361
260
|
refreshPermissions: RefreshPermissions<UserConfig>;
|
|
261
|
+
resolveDataById: (id: string, trigger?: ResolveDataTrigger) => void;
|
|
262
|
+
resolveDataBySelector: (selector: ItemSelector, trigger?: ResolveDataTrigger) => void;
|
|
362
263
|
selectedItem: G["UserComponentData"] | null;
|
|
363
264
|
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
364
265
|
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
@@ -395,4 +296,14 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
|
|
|
395
296
|
*/
|
|
396
297
|
declare function useGetPuck(): () => UsePuckStore<Config>;
|
|
397
298
|
|
|
398
|
-
|
|
299
|
+
declare const blocksPlugin: () => Plugin;
|
|
300
|
+
|
|
301
|
+
declare const fieldsPlugin: (params?: {
|
|
302
|
+
desktopSideBar?: "left" | "right";
|
|
303
|
+
}) => PluginInternal;
|
|
304
|
+
|
|
305
|
+
declare const outlinePlugin: () => Plugin;
|
|
306
|
+
|
|
307
|
+
declare const legacySideBarPlugin: () => Plugin;
|
|
308
|
+
|
|
309
|
+
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, ResolveDataTrigger, RichTextMenu, Separator, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createUsePuck, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };
|