@measured/puck 0.21.0-canary.c78dc826 → 0.21.0-canary.d1e8fa71

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.
Files changed (50) hide show
  1. package/dist/{Editor-F2LSS6SE.css → Editor-IQP25PUX.css} +28 -27
  2. package/dist/{Editor-N46HUQEC.mjs → Editor-L3JAAT2X.mjs} +13 -10
  3. package/dist/{Render-QEMDIDQC.css → Render-3OV4N4MT.css} +28 -27
  4. package/dist/{Render-Y567PGZ7.mjs → Render-FXZX6NFH.mjs} +6 -4
  5. package/dist/{walk-tree-Ja9bNCM9.d.mts → actions-tsxxcX1z.d.mts} +24 -35
  6. package/dist/{walk-tree-Ja9bNCM9.d.ts → actions-tsxxcX1z.d.ts} +24 -35
  7. package/dist/chunk-23IZFPL7.mjs +528 -0
  8. package/dist/{chunk-C2TVYIYC.mjs → chunk-3SDLQIUZ.mjs} +57 -43
  9. package/dist/chunk-45I5SDOI.mjs +134 -0
  10. package/dist/{chunk-DNF2EMM4.mjs → chunk-5ZZVX2Z3.mjs} +2 -2
  11. package/dist/chunk-AOEDIUVK.mjs +11 -0
  12. package/dist/{chunk-DJSH5REF.mjs → chunk-B7REOAA7.mjs} +24 -126
  13. package/dist/{chunk-K3V4LVUL.mjs → chunk-BXQQARCR.mjs} +14 -10
  14. package/dist/{chunk-TB3SSIAY.mjs → chunk-CQUAWHOK.mjs} +5224 -4509
  15. package/dist/{chunk-7KY6RHEY.mjs → chunk-D2SRL6YA.mjs} +101 -524
  16. package/dist/{chunk-GQKMOYLG.mjs → chunk-LJEGWHDD.mjs} +2 -2
  17. package/dist/{chunk-DCSQEDMK.mjs → chunk-M6W7YEVX.mjs} +1 -100
  18. package/dist/{chunk-FNWOH4R6.mjs → chunk-PBAAIKXA.mjs} +8 -6
  19. package/dist/{chunk-3QHWXJEI.mjs → chunk-U4VSQKO3.mjs} +2 -2
  20. package/dist/{chunk-R6CVX2IY.mjs → chunk-V5I7CVLT.mjs} +1 -1
  21. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  22. package/dist/{full-NLUNPJWS.mjs → full-L7DWVNTZ.mjs} +10 -7
  23. package/dist/index-Ca6V6NQD.d.ts +118 -0
  24. package/dist/index-mQvUCH3C.d.mts +118 -0
  25. package/dist/index.css +732 -341
  26. package/dist/index.d.mts +29 -120
  27. package/dist/index.d.ts +29 -120
  28. package/dist/index.js +3273 -2392
  29. package/dist/index.mjs +22 -16
  30. package/dist/internal.d.mts +27 -0
  31. package/dist/internal.d.ts +27 -0
  32. package/dist/internal.js +927 -0
  33. package/dist/internal.mjs +13 -0
  34. package/dist/{loaded-HMSPJUZM.mjs → loaded-2HLHDP2G.mjs} +7 -4
  35. package/dist/{loaded-EV34KGYJ.mjs → loaded-LZUXYAGW.mjs} +7 -4
  36. package/dist/{loaded-ZXOU6S6R.mjs → loaded-UHVTB6OD.mjs} +7 -4
  37. package/dist/no-external.css +870 -475
  38. package/dist/no-external.d.mts +4 -2
  39. package/dist/no-external.d.ts +4 -2
  40. package/dist/no-external.js +3276 -2392
  41. package/dist/no-external.mjs +22 -11
  42. package/dist/rsc.css +28 -27
  43. package/dist/rsc.d.mts +2 -2
  44. package/dist/rsc.d.ts +2 -2
  45. package/dist/rsc.js +56 -29
  46. package/dist/rsc.mjs +6 -4
  47. package/dist/walk-tree-Bh85NMeo.d.ts +29 -0
  48. package/dist/walk-tree-CDA3K5S3.d.mts +29 -0
  49. package/package.json +9 -4
  50. package/dist/chunk-WUWXFMEM.mjs +0 -11
package/dist/index.d.mts CHANGED
@@ -1,9 +1,11 @@
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';
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, t as ItemSelector, c as ComponentData, u as PluginInternal } from './actions-tsxxcX1z.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, i as ResolveDataTrigger, 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-tsxxcX1z.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CDA3K5S3.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 { Editor } from '@tiptap/react';
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-mQvUCH3C.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>): react_jsx_runtime.JSX.Element | null;
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;
@@ -395,4 +294,14 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
395
294
  */
396
295
  declare function useGetPuck(): () => UsePuckStore<Config>;
397
296
 
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 };
297
+ declare const blocksPlugin: () => Plugin;
298
+
299
+ declare const fieldsPlugin: (params?: {
300
+ desktopSideBar?: "left" | "right";
301
+ }) => PluginInternal;
302
+
303
+ declare const outlinePlugin: () => Plugin;
304
+
305
+ declare const legacySideBarPlugin: () => Plugin;
306
+
307
+ 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, 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 { 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';
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, t as ItemSelector, c as ComponentData, u as PluginInternal } from './actions-tsxxcX1z.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, i as ResolveDataTrigger, 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-tsxxcX1z.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-Bh85NMeo.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 { Editor } from '@tiptap/react';
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-Ca6V6NQD.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>): react_jsx_runtime.JSX.Element | null;
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;
@@ -395,4 +294,14 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
395
294
  */
396
295
  declare function useGetPuck(): () => UsePuckStore<Config>;
397
296
 
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 };
297
+ declare const blocksPlugin: () => Plugin;
298
+
299
+ declare const fieldsPlugin: (params?: {
300
+ desktopSideBar?: "left" | "right";
301
+ }) => PluginInternal;
302
+
303
+ declare const outlinePlugin: () => Plugin;
304
+
305
+ declare const legacySideBarPlugin: () => Plugin;
306
+
307
+ 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, RichTextMenu, Separator, UiState, type UsePuckData, UserGenerics, Viewports, blocksPlugin, createUsePuck, fieldsPlugin, legacySideBarPlugin, outlinePlugin, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };