@measured/puck 0.21.0-canary.3aa27d1d → 0.21.0-canary.56be3202

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 (52) hide show
  1. package/dist/Editor-CYTATURR.mjs +204 -0
  2. package/dist/Editor-F2LSS6SE.css +403 -0
  3. package/dist/Render-OFE6QLI2.mjs +55 -0
  4. package/dist/Render-QEMDIDQC.css +101 -0
  5. package/dist/{walk-tree-16XYcbNo.d.mts → actions-tsxxcX1z.d.mts} +29 -40
  6. package/dist/{walk-tree-16XYcbNo.d.ts → actions-tsxxcX1z.d.ts} +29 -40
  7. package/dist/chunk-72SA22GI.mjs +134 -0
  8. package/dist/chunk-CSSRLPHM.mjs +11 -0
  9. package/dist/chunk-M4QBB3JM.mjs +111 -0
  10. package/dist/chunk-M6W7YEVX.mjs +95 -0
  11. package/dist/chunk-MLTVJA2A.mjs +63 -0
  12. package/dist/chunk-MVJKIFF6.mjs +419 -0
  13. package/dist/chunk-NLUHDYVR.mjs +416 -0
  14. package/dist/chunk-NOJQSXRU.mjs +33 -0
  15. package/dist/{chunk-GFIVKP2H.mjs → chunk-PZ4SED7H.mjs} +6848 -9297
  16. package/dist/chunk-QBGM4ELA.mjs +528 -0
  17. package/dist/chunk-UNQOU2OI.mjs +53 -0
  18. package/dist/chunk-UUOBSXZR.mjs +1807 -0
  19. package/dist/chunk-V5I7CVLT.mjs +103 -0
  20. package/dist/chunk-V7333LON.mjs +708 -0
  21. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  22. package/dist/full-2GJTAAZE.css +301 -0
  23. package/dist/full-GZ4L3XCF.mjs +93 -0
  24. package/dist/index-Ca6V6NQD.d.ts +118 -0
  25. package/dist/index-mQvUCH3C.d.mts +118 -0
  26. package/dist/index.css +856 -458
  27. package/dist/index.d.mts +32 -129
  28. package/dist/index.d.ts +32 -129
  29. package/dist/index.js +11790 -9359
  30. package/dist/index.mjs +32 -14
  31. package/dist/internal.d.mts +27 -0
  32. package/dist/internal.d.ts +27 -0
  33. package/dist/internal.js +908 -0
  34. package/dist/internal.mjs +13 -0
  35. package/dist/loaded-2MNXXPJP.mjs +57 -0
  36. package/dist/loaded-6QT4HD2O.mjs +57 -0
  37. package/dist/loaded-RVWBFK7L.css +87 -0
  38. package/dist/loaded-ZVPBQVNE.mjs +60 -0
  39. package/dist/no-external.css +988 -586
  40. package/dist/no-external.d.mts +4 -2
  41. package/dist/no-external.d.ts +4 -2
  42. package/dist/no-external.js +11793 -9359
  43. package/dist/no-external.mjs +34 -11
  44. package/dist/rsc.css +34 -26
  45. package/dist/rsc.d.mts +2 -2
  46. package/dist/rsc.d.ts +2 -2
  47. package/dist/rsc.js +249 -189
  48. package/dist/rsc.mjs +18 -9
  49. package/dist/walk-tree-Bh85NMeo.d.ts +29 -0
  50. package/dist/walk-tree-CDA3K5S3.d.mts +29 -0
  51. package/package.json +9 -4
  52. package/dist/chunk-SRDLYODX.mjs +0 -1245
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-16XYcbNo.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-16XYcbNo.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;
@@ -288,8 +187,6 @@ declare function AlignRight(): react_jsx_runtime.JSX.Element;
288
187
 
289
188
  declare function AlignJustify(): react_jsx_runtime.JSX.Element;
290
189
 
291
- declare function AlignSelect(): react_jsx_runtime.JSX.Element;
292
-
293
190
  declare function Bold(): react_jsx_runtime.JSX.Element;
294
191
 
295
192
  declare function Italic(): react_jsx_runtime.JSX.Element;
@@ -310,10 +207,6 @@ declare function Blockquote(): react_jsx_runtime.JSX.Element;
310
207
 
311
208
  declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
312
209
 
313
- declare function HeadingSelect(): react_jsx_runtime.JSX.Element;
314
-
315
- declare function ListSelect(): react_jsx_runtime.JSX.Element;
316
-
317
210
  declare function Control({ icon, disabled, active, onClick, title, }: {
318
211
  icon: ReactNode;
319
212
  disabled?: boolean;
@@ -334,16 +227,16 @@ declare const RichTextMenu: {
334
227
  AlignJustify: typeof AlignJustify;
335
228
  AlignLeft: typeof AlignLeft;
336
229
  AlignRight: typeof AlignRight;
337
- AlignSelect: typeof AlignSelect;
230
+ AlignSelect: () => react_jsx_runtime.JSX.Element;
338
231
  Blockquote: typeof Blockquote;
339
232
  Bold: typeof Bold;
340
233
  BulletList: typeof BulletList;
341
234
  CodeBlock: typeof CodeBlock;
342
- HeadingSelect: typeof HeadingSelect;
235
+ HeadingSelect: () => react_jsx_runtime.JSX.Element;
343
236
  HorizontalRule: typeof HorizontalRule;
344
237
  InlineCode: typeof InlineCode;
345
238
  Italic: typeof Italic;
346
- ListSelect: typeof ListSelect;
239
+ ListSelect: () => react_jsx_runtime.JSX.Element;
347
240
  OrderedList: typeof OrderedList;
348
241
  Strikethrough: typeof Strikethrough;
349
242
  Underline: typeof Underline;
@@ -401,4 +294,14 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
401
294
  */
402
295
  declare function useGetPuck(): () => UsePuckStore<Config>;
403
296
 
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 };
297
+ declare const blocksPlugin: () => Plugin;
298
+
299
+ declare const fieldsPlugin: (params?: {
300
+ mobileOnly?: boolean;
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-16XYcbNo.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-16XYcbNo.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;
@@ -288,8 +187,6 @@ declare function AlignRight(): react_jsx_runtime.JSX.Element;
288
187
 
289
188
  declare function AlignJustify(): react_jsx_runtime.JSX.Element;
290
189
 
291
- declare function AlignSelect(): react_jsx_runtime.JSX.Element;
292
-
293
190
  declare function Bold(): react_jsx_runtime.JSX.Element;
294
191
 
295
192
  declare function Italic(): react_jsx_runtime.JSX.Element;
@@ -310,10 +207,6 @@ declare function Blockquote(): react_jsx_runtime.JSX.Element;
310
207
 
311
208
  declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
312
209
 
313
- declare function HeadingSelect(): react_jsx_runtime.JSX.Element;
314
-
315
- declare function ListSelect(): react_jsx_runtime.JSX.Element;
316
-
317
210
  declare function Control({ icon, disabled, active, onClick, title, }: {
318
211
  icon: ReactNode;
319
212
  disabled?: boolean;
@@ -334,16 +227,16 @@ declare const RichTextMenu: {
334
227
  AlignJustify: typeof AlignJustify;
335
228
  AlignLeft: typeof AlignLeft;
336
229
  AlignRight: typeof AlignRight;
337
- AlignSelect: typeof AlignSelect;
230
+ AlignSelect: () => react_jsx_runtime.JSX.Element;
338
231
  Blockquote: typeof Blockquote;
339
232
  Bold: typeof Bold;
340
233
  BulletList: typeof BulletList;
341
234
  CodeBlock: typeof CodeBlock;
342
- HeadingSelect: typeof HeadingSelect;
235
+ HeadingSelect: () => react_jsx_runtime.JSX.Element;
343
236
  HorizontalRule: typeof HorizontalRule;
344
237
  InlineCode: typeof InlineCode;
345
238
  Italic: typeof Italic;
346
- ListSelect: typeof ListSelect;
239
+ ListSelect: () => react_jsx_runtime.JSX.Element;
347
240
  OrderedList: typeof OrderedList;
348
241
  Strikethrough: typeof Strikethrough;
349
242
  Underline: typeof Underline;
@@ -401,4 +294,14 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
401
294
  */
402
295
  declare function useGetPuck(): () => UsePuckStore<Config>;
403
296
 
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 };
297
+ declare const blocksPlugin: () => Plugin;
298
+
299
+ declare const fieldsPlugin: (params?: {
300
+ mobileOnly?: boolean;
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 };