@measured/puck 0.21.0-canary.ed10e2a4 → 0.21.0-canary.ed351ce5

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-CgWnYC1X.d.mts → actions-tsxxcX1z.d.mts} +224 -36
  6. package/dist/{walk-tree-CgWnYC1X.d.ts → actions-tsxxcX1z.d.ts} +224 -36
  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-QBGM4ELA.mjs +528 -0
  16. package/dist/{chunk-UABEUL66.mjs → chunk-RVZLI2KP.mjs} +6829 -7959
  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 +1030 -384
  27. package/dist/index.d.mts +115 -115
  28. package/dist/index.d.ts +115 -115
  29. package/dist/index.js +12008 -8000
  30. package/dist/index.mjs +34 -12
  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 +1163 -513
  40. package/dist/no-external.d.mts +19 -2
  41. package/dist/no-external.d.ts +19 -2
  42. package/dist/no-external.js +12010 -7999
  43. package/dist/no-external.mjs +36 -9
  44. package/dist/rsc.css +101 -0
  45. package/dist/rsc.d.mts +17 -2
  46. package/dist/rsc.d.ts +17 -2
  47. package/dist/rsc.js +411 -23
  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 +31 -4
  52. package/dist/chunk-JA7SEUEH.mjs +0 -966
package/dist/index.d.mts CHANGED
@@ -1,123 +1,37 @@
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 Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-CgWnYC1X.mjs';
2
- export { ad as Adaptor, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, J as ComponentConfigExtensions, T as ComponentConfigParams, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, a4 as FieldMetadata, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, $ as MappedItem, a7 as NumberField, ac as ObjectField, x as OverrideKey, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, K as RootConfig, Z as RootData, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, q as Viewport, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CgWnYC1X.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
-
7
- type HistorySlice<D = any> = {
8
- index: number;
9
- hasPast: () => boolean;
10
- hasFuture: () => boolean;
11
- histories: History<D>[];
12
- record: (data: D) => void;
13
- back: VoidFunction;
14
- forward: VoidFunction;
15
- currentHistory: () => History;
16
- nextHistory: () => History<D> | null;
17
- prevHistory: () => History<D> | null;
18
- setHistories: (histories: History[]) => void;
19
- setHistoryIndex: (index: number) => void;
20
- initialAppState: D;
21
- };
22
-
23
- type NodeMethods = {
24
- sync: () => void;
25
- hideOverlay: () => void;
26
- showOverlay: () => void;
27
- };
28
- type PuckNodeInstance = {
29
- id: string;
30
- methods: NodeMethods;
31
- element: HTMLElement | null;
32
- };
33
- type NodesSlice = {
34
- nodes: Record<string, PuckNodeInstance | undefined>;
35
- registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
36
- unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
37
- };
38
-
39
- type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
40
- item?: G["UserComponentData"] | null;
41
- type?: keyof G["UserProps"];
42
- root?: boolean;
43
- };
44
- type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
45
- type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
46
- type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
47
- type Cache = Record<string, {
48
- lastPermissions: Partial<Permissions>;
49
- lastData: ComponentData | null;
50
- lastParentId: string | null;
51
- }>;
52
- type PermissionsSlice = {
53
- cache: Cache;
54
- globalPermissions: Permissions;
55
- resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
56
- getPermissions: GetPermissions<Config>;
57
- resolvePermissions: ResolvePermissions<Config>;
58
- refreshPermissions: RefreshPermissions<Config>;
59
- };
60
-
61
- type ComponentOrRootData = Omit<ComponentData<any>, "type">;
62
- type FieldsSlice = {
63
- fields: Fields | Partial<Fields>;
64
- loading: boolean;
65
- lastResolvedData: Partial<ComponentOrRootData>;
66
- id: string | undefined;
67
- };
68
-
69
- type Status = "LOADING" | "MOUNTED" | "READY";
70
- type ZoomConfig = {
71
- autoZoom: number;
72
- rootHeight: number;
73
- zoom: number;
74
- };
75
- type ComponentState = Record<string, {
76
- loadingCount: number;
77
- }>;
78
- type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
79
- state: G["UserAppState"];
80
- dispatch: (action: PuckAction) => void;
81
- config: UserConfig;
82
- componentState: ComponentState;
83
- setComponentState: (componentState: ComponentState) => void;
84
- setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
85
- unsetComponentLoading: (id: string) => void;
86
- pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
87
- resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
88
- node: T;
89
- didChange: boolean;
90
- }>;
91
- resolveAndCommitData: () => void;
92
- plugins: Plugin[];
93
- overrides: Partial<Overrides>;
94
- viewports: Viewports;
95
- zoomConfig: ZoomConfig;
96
- setZoomConfig: (zoomConfig: ZoomConfig) => void;
97
- status: Status;
98
- setStatus: (status: Status) => void;
99
- iframe: IframeConfig;
100
- selectedItem?: G["UserData"]["content"][0] | null;
101
- setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
102
- getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
103
- onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
104
- metadata: Metadata;
105
- fields: FieldsSlice;
106
- history: HistorySlice;
107
- nodes: NodesSlice;
108
- permissions: PermissionsSlice;
109
- fieldTransforms: FieldTransforms;
110
- };
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';
9
+ import '@tiptap/extension-blockquote';
10
+ import '@tiptap/extension-bold';
11
+ import '@tiptap/extension-code';
12
+ import '@tiptap/extension-code-block';
13
+ import '@tiptap/extension-hard-break';
14
+ import '@tiptap/extension-heading';
15
+ import '@tiptap/extension-horizontal-rule';
16
+ import '@tiptap/extension-italic';
17
+ import '@tiptap/extension-link';
18
+ import '@tiptap/extension-list';
19
+ import '@tiptap/extension-paragraph';
20
+ import '@tiptap/extension-strike';
21
+ import '@tiptap/extension-text-align';
22
+ import '@tiptap/extension-underline';
111
23
 
112
24
  declare const ActionBar: {
113
25
  ({ label, children, }: {
114
26
  label?: string;
115
27
  children?: ReactNode;
116
28
  }): react_jsx_runtime.JSX.Element;
117
- Action: ({ children, label, onClick, }: {
29
+ Action: ({ children, label, onClick, active, disabled, }: {
118
30
  children: ReactNode;
119
31
  label?: string;
120
32
  onClick: (e: SyntheticEvent) => void;
33
+ active?: boolean;
34
+ disabled?: boolean;
121
35
  }) => react_jsx_runtime.JSX.Element;
122
36
  Label: ({ label }: {
123
37
  label: string;
@@ -125,11 +39,14 @@ declare const ActionBar: {
125
39
  Group: ({ children }: {
126
40
  children: ReactNode;
127
41
  }) => react_jsx_runtime.JSX.Element;
42
+ Separator: () => react_jsx_runtime.JSX.Element;
128
43
  };
129
- declare const Action: ({ children, label, onClick, }: {
44
+ declare const Action: ({ children, label, onClick, active, disabled, }: {
130
45
  children: ReactNode;
131
46
  label?: string;
132
47
  onClick: (e: SyntheticEvent) => void;
48
+ active?: boolean;
49
+ disabled?: boolean;
133
50
  }) => react_jsx_runtime.JSX.Element;
134
51
  declare const Group: ({ children }: {
135
52
  children: ReactNode;
@@ -137,6 +54,7 @@ declare const Group: ({ children }: {
137
54
  declare const Label: ({ label }: {
138
55
  label: string;
139
56
  }) => react_jsx_runtime.JSX.Element;
57
+ declare const Separator: () => react_jsx_runtime.JSX.Element;
140
58
 
141
59
  declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
142
60
  children?: ReactNode;
@@ -146,8 +64,11 @@ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }:
146
64
  readOnly?: boolean;
147
65
  className?: string;
148
66
  }) => react_jsx_runtime.JSX.Element;
67
+
149
68
  type FieldNoLabel<Props extends any = any> = Omit<Field<Props>, "label">;
150
- 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;
151
72
 
152
73
  declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, ...props }: {
153
74
  children: ReactNode;
@@ -183,19 +104,20 @@ declare const Drawer: {
183
104
  }) => react_jsx_runtime.JSX.Element;
184
105
  };
185
106
 
186
- declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
107
+ declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
187
108
 
188
- declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
109
+ declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, suppressHydrationWarning, }: {
110
+ active?: boolean;
189
111
  children: ReactNode;
190
112
  href?: string;
191
113
  onClick?: (e: SyntheticEvent) => void | Promise<void>;
192
- variant?: "primary" | "secondary";
193
114
  type?: "button" | "submit" | "reset";
194
115
  disabled?: boolean;
195
116
  tabIndex?: number;
196
117
  newTab?: boolean;
197
118
  fullWidth?: boolean;
198
119
  title: string;
120
+ suppressHydrationWarning?: boolean;
199
121
  }) => react_jsx_runtime.JSX.Element;
200
122
 
201
123
  type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
@@ -228,6 +150,8 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
228
150
  };
229
151
  initialHistory?: InitialHistory;
230
152
  metadata?: Metadata;
153
+ height?: CSSProperties["height"];
154
+ _experimentalFullScreenCanvas?: boolean;
231
155
  };
232
156
  declare function Puck<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: PuckProps<UserConfig>): react_jsx_runtime.JSX.Element;
233
157
  declare namespace Puck {
@@ -235,6 +159,9 @@ declare namespace Puck {
235
159
  var Fields: react.MemoExoticComponent<({ wrapFields }: {
236
160
  wrapFields?: boolean;
237
161
  }) => react_jsx_runtime.JSX.Element>;
162
+ var Layout: ({ children }: {
163
+ children?: ReactNode;
164
+ }) => react_jsx_runtime.JSX.Element;
238
165
  var Outline: () => react_jsx_runtime.JSX.Element;
239
166
  var Preview: ({ id }: {
240
167
  id?: string;
@@ -252,6 +179,69 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
252
179
  metadata?: Metadata;
253
180
  }): react_jsx_runtime.JSX.Element;
254
181
 
182
+ declare function AlignLeft(): react_jsx_runtime.JSX.Element;
183
+
184
+ declare function AlignCenter(): react_jsx_runtime.JSX.Element;
185
+
186
+ declare function AlignRight(): react_jsx_runtime.JSX.Element;
187
+
188
+ declare function AlignJustify(): react_jsx_runtime.JSX.Element;
189
+
190
+ declare function Bold(): react_jsx_runtime.JSX.Element;
191
+
192
+ declare function Italic(): react_jsx_runtime.JSX.Element;
193
+
194
+ declare function Underline(): react_jsx_runtime.JSX.Element;
195
+
196
+ declare function Strikethrough(): react_jsx_runtime.JSX.Element;
197
+
198
+ declare function InlineCode(): react_jsx_runtime.JSX.Element;
199
+
200
+ declare function BulletList(): react_jsx_runtime.JSX.Element;
201
+
202
+ declare function OrderedList(): react_jsx_runtime.JSX.Element;
203
+
204
+ declare function CodeBlock(): react_jsx_runtime.JSX.Element;
205
+
206
+ declare function Blockquote(): react_jsx_runtime.JSX.Element;
207
+
208
+ declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
209
+
210
+ declare function Control({ icon, disabled, active, onClick, title, }: {
211
+ icon: ReactNode;
212
+ disabled?: boolean;
213
+ active?: boolean;
214
+ onClick: (e: SyntheticEvent) => any;
215
+ title: string;
216
+ }): react_jsx_runtime.JSX.Element;
217
+
218
+ declare const RichTextMenu: {
219
+ ({ children }: {
220
+ children: ReactNode;
221
+ }): react_jsx_runtime.JSX.Element;
222
+ Group: ({ children }: {
223
+ children: ReactNode;
224
+ }) => react_jsx_runtime.JSX.Element;
225
+ Control: typeof Control;
226
+ AlignCenter: typeof AlignCenter;
227
+ AlignJustify: typeof AlignJustify;
228
+ AlignLeft: typeof AlignLeft;
229
+ AlignRight: typeof AlignRight;
230
+ AlignSelect: () => react_jsx_runtime.JSX.Element;
231
+ Blockquote: typeof Blockquote;
232
+ Bold: typeof Bold;
233
+ BulletList: typeof BulletList;
234
+ CodeBlock: typeof CodeBlock;
235
+ HeadingSelect: () => react_jsx_runtime.JSX.Element;
236
+ HorizontalRule: typeof HorizontalRule;
237
+ InlineCode: typeof InlineCode;
238
+ Italic: typeof Italic;
239
+ ListSelect: () => react_jsx_runtime.JSX.Element;
240
+ OrderedList: typeof OrderedList;
241
+ Strikethrough: typeof Strikethrough;
242
+ Underline: typeof Underline;
243
+ };
244
+
255
245
  declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
256
246
  disableDrag?: boolean;
257
247
  disableDragOnFocus?: boolean;
@@ -304,4 +294,14 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
304
294
  */
305
295
  declare function useGetPuck(): () => UsePuckStore<Config>;
306
296
 
307
- export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, 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,123 +1,37 @@
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 Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-CgWnYC1X.js';
2
- export { ad as Adaptor, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, J as ComponentConfigExtensions, T as ComponentConfigParams, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, a4 as FieldMetadata, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, $ as MappedItem, a7 as NumberField, ac as ObjectField, x as OverrideKey, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, K as RootConfig, Z as RootData, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, q as Viewport, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CgWnYC1X.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
-
7
- type HistorySlice<D = any> = {
8
- index: number;
9
- hasPast: () => boolean;
10
- hasFuture: () => boolean;
11
- histories: History<D>[];
12
- record: (data: D) => void;
13
- back: VoidFunction;
14
- forward: VoidFunction;
15
- currentHistory: () => History;
16
- nextHistory: () => History<D> | null;
17
- prevHistory: () => History<D> | null;
18
- setHistories: (histories: History[]) => void;
19
- setHistoryIndex: (index: number) => void;
20
- initialAppState: D;
21
- };
22
-
23
- type NodeMethods = {
24
- sync: () => void;
25
- hideOverlay: () => void;
26
- showOverlay: () => void;
27
- };
28
- type PuckNodeInstance = {
29
- id: string;
30
- methods: NodeMethods;
31
- element: HTMLElement | null;
32
- };
33
- type NodesSlice = {
34
- nodes: Record<string, PuckNodeInstance | undefined>;
35
- registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
36
- unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
37
- };
38
-
39
- type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
40
- item?: G["UserComponentData"] | null;
41
- type?: keyof G["UserProps"];
42
- root?: boolean;
43
- };
44
- type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
45
- type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
46
- type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
47
- type Cache = Record<string, {
48
- lastPermissions: Partial<Permissions>;
49
- lastData: ComponentData | null;
50
- lastParentId: string | null;
51
- }>;
52
- type PermissionsSlice = {
53
- cache: Cache;
54
- globalPermissions: Permissions;
55
- resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
56
- getPermissions: GetPermissions<Config>;
57
- resolvePermissions: ResolvePermissions<Config>;
58
- refreshPermissions: RefreshPermissions<Config>;
59
- };
60
-
61
- type ComponentOrRootData = Omit<ComponentData<any>, "type">;
62
- type FieldsSlice = {
63
- fields: Fields | Partial<Fields>;
64
- loading: boolean;
65
- lastResolvedData: Partial<ComponentOrRootData>;
66
- id: string | undefined;
67
- };
68
-
69
- type Status = "LOADING" | "MOUNTED" | "READY";
70
- type ZoomConfig = {
71
- autoZoom: number;
72
- rootHeight: number;
73
- zoom: number;
74
- };
75
- type ComponentState = Record<string, {
76
- loadingCount: number;
77
- }>;
78
- type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
79
- state: G["UserAppState"];
80
- dispatch: (action: PuckAction) => void;
81
- config: UserConfig;
82
- componentState: ComponentState;
83
- setComponentState: (componentState: ComponentState) => void;
84
- setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
85
- unsetComponentLoading: (id: string) => void;
86
- pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
87
- resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
88
- node: T;
89
- didChange: boolean;
90
- }>;
91
- resolveAndCommitData: () => void;
92
- plugins: Plugin[];
93
- overrides: Partial<Overrides>;
94
- viewports: Viewports;
95
- zoomConfig: ZoomConfig;
96
- setZoomConfig: (zoomConfig: ZoomConfig) => void;
97
- status: Status;
98
- setStatus: (status: Status) => void;
99
- iframe: IframeConfig;
100
- selectedItem?: G["UserData"]["content"][0] | null;
101
- setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
102
- getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
103
- onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
104
- metadata: Metadata;
105
- fields: FieldsSlice;
106
- history: HistorySlice;
107
- nodes: NodesSlice;
108
- permissions: PermissionsSlice;
109
- fieldTransforms: FieldTransforms;
110
- };
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';
9
+ import '@tiptap/extension-blockquote';
10
+ import '@tiptap/extension-bold';
11
+ import '@tiptap/extension-code';
12
+ import '@tiptap/extension-code-block';
13
+ import '@tiptap/extension-hard-break';
14
+ import '@tiptap/extension-heading';
15
+ import '@tiptap/extension-horizontal-rule';
16
+ import '@tiptap/extension-italic';
17
+ import '@tiptap/extension-link';
18
+ import '@tiptap/extension-list';
19
+ import '@tiptap/extension-paragraph';
20
+ import '@tiptap/extension-strike';
21
+ import '@tiptap/extension-text-align';
22
+ import '@tiptap/extension-underline';
111
23
 
112
24
  declare const ActionBar: {
113
25
  ({ label, children, }: {
114
26
  label?: string;
115
27
  children?: ReactNode;
116
28
  }): react_jsx_runtime.JSX.Element;
117
- Action: ({ children, label, onClick, }: {
29
+ Action: ({ children, label, onClick, active, disabled, }: {
118
30
  children: ReactNode;
119
31
  label?: string;
120
32
  onClick: (e: SyntheticEvent) => void;
33
+ active?: boolean;
34
+ disabled?: boolean;
121
35
  }) => react_jsx_runtime.JSX.Element;
122
36
  Label: ({ label }: {
123
37
  label: string;
@@ -125,11 +39,14 @@ declare const ActionBar: {
125
39
  Group: ({ children }: {
126
40
  children: ReactNode;
127
41
  }) => react_jsx_runtime.JSX.Element;
42
+ Separator: () => react_jsx_runtime.JSX.Element;
128
43
  };
129
- declare const Action: ({ children, label, onClick, }: {
44
+ declare const Action: ({ children, label, onClick, active, disabled, }: {
130
45
  children: ReactNode;
131
46
  label?: string;
132
47
  onClick: (e: SyntheticEvent) => void;
48
+ active?: boolean;
49
+ disabled?: boolean;
133
50
  }) => react_jsx_runtime.JSX.Element;
134
51
  declare const Group: ({ children }: {
135
52
  children: ReactNode;
@@ -137,6 +54,7 @@ declare const Group: ({ children }: {
137
54
  declare const Label: ({ label }: {
138
55
  label: string;
139
56
  }) => react_jsx_runtime.JSX.Element;
57
+ declare const Separator: () => react_jsx_runtime.JSX.Element;
140
58
 
141
59
  declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
142
60
  children?: ReactNode;
@@ -146,8 +64,11 @@ declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }:
146
64
  readOnly?: boolean;
147
65
  className?: string;
148
66
  }) => react_jsx_runtime.JSX.Element;
67
+
149
68
  type FieldNoLabel<Props extends any = any> = Omit<Field<Props>, "label">;
150
- 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;
151
72
 
152
73
  declare const Button: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, icon, size, loading: loadingProp, ...props }: {
153
74
  children: ReactNode;
@@ -183,19 +104,20 @@ declare const Drawer: {
183
104
  }) => react_jsx_runtime.JSX.Element;
184
105
  };
185
106
 
186
- declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
107
+ declare const DropZone: react.ForwardRefExoticComponent<Omit<DropZoneProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
187
108
 
188
- declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
109
+ declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, suppressHydrationWarning, }: {
110
+ active?: boolean;
189
111
  children: ReactNode;
190
112
  href?: string;
191
113
  onClick?: (e: SyntheticEvent) => void | Promise<void>;
192
- variant?: "primary" | "secondary";
193
114
  type?: "button" | "submit" | "reset";
194
115
  disabled?: boolean;
195
116
  tabIndex?: number;
196
117
  newTab?: boolean;
197
118
  fullWidth?: boolean;
198
119
  title: string;
120
+ suppressHydrationWarning?: boolean;
199
121
  }) => react_jsx_runtime.JSX.Element;
200
122
 
201
123
  type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
@@ -228,6 +150,8 @@ type PuckProps<UserConfig extends Config = Config, G extends UserGenerics<UserCo
228
150
  };
229
151
  initialHistory?: InitialHistory;
230
152
  metadata?: Metadata;
153
+ height?: CSSProperties["height"];
154
+ _experimentalFullScreenCanvas?: boolean;
231
155
  };
232
156
  declare function Puck<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(props: PuckProps<UserConfig>): react_jsx_runtime.JSX.Element;
233
157
  declare namespace Puck {
@@ -235,6 +159,9 @@ declare namespace Puck {
235
159
  var Fields: react.MemoExoticComponent<({ wrapFields }: {
236
160
  wrapFields?: boolean;
237
161
  }) => react_jsx_runtime.JSX.Element>;
162
+ var Layout: ({ children }: {
163
+ children?: ReactNode;
164
+ }) => react_jsx_runtime.JSX.Element;
238
165
  var Outline: () => react_jsx_runtime.JSX.Element;
239
166
  var Preview: ({ id }: {
240
167
  id?: string;
@@ -252,6 +179,69 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
252
179
  metadata?: Metadata;
253
180
  }): react_jsx_runtime.JSX.Element;
254
181
 
182
+ declare function AlignLeft(): react_jsx_runtime.JSX.Element;
183
+
184
+ declare function AlignCenter(): react_jsx_runtime.JSX.Element;
185
+
186
+ declare function AlignRight(): react_jsx_runtime.JSX.Element;
187
+
188
+ declare function AlignJustify(): react_jsx_runtime.JSX.Element;
189
+
190
+ declare function Bold(): react_jsx_runtime.JSX.Element;
191
+
192
+ declare function Italic(): react_jsx_runtime.JSX.Element;
193
+
194
+ declare function Underline(): react_jsx_runtime.JSX.Element;
195
+
196
+ declare function Strikethrough(): react_jsx_runtime.JSX.Element;
197
+
198
+ declare function InlineCode(): react_jsx_runtime.JSX.Element;
199
+
200
+ declare function BulletList(): react_jsx_runtime.JSX.Element;
201
+
202
+ declare function OrderedList(): react_jsx_runtime.JSX.Element;
203
+
204
+ declare function CodeBlock(): react_jsx_runtime.JSX.Element;
205
+
206
+ declare function Blockquote(): react_jsx_runtime.JSX.Element;
207
+
208
+ declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
209
+
210
+ declare function Control({ icon, disabled, active, onClick, title, }: {
211
+ icon: ReactNode;
212
+ disabled?: boolean;
213
+ active?: boolean;
214
+ onClick: (e: SyntheticEvent) => any;
215
+ title: string;
216
+ }): react_jsx_runtime.JSX.Element;
217
+
218
+ declare const RichTextMenu: {
219
+ ({ children }: {
220
+ children: ReactNode;
221
+ }): react_jsx_runtime.JSX.Element;
222
+ Group: ({ children }: {
223
+ children: ReactNode;
224
+ }) => react_jsx_runtime.JSX.Element;
225
+ Control: typeof Control;
226
+ AlignCenter: typeof AlignCenter;
227
+ AlignJustify: typeof AlignJustify;
228
+ AlignLeft: typeof AlignLeft;
229
+ AlignRight: typeof AlignRight;
230
+ AlignSelect: () => react_jsx_runtime.JSX.Element;
231
+ Blockquote: typeof Blockquote;
232
+ Bold: typeof Bold;
233
+ BulletList: typeof BulletList;
234
+ CodeBlock: typeof CodeBlock;
235
+ HeadingSelect: () => react_jsx_runtime.JSX.Element;
236
+ HorizontalRule: typeof HorizontalRule;
237
+ InlineCode: typeof InlineCode;
238
+ Italic: typeof Italic;
239
+ ListSelect: () => react_jsx_runtime.JSX.Element;
240
+ OrderedList: typeof OrderedList;
241
+ Strikethrough: typeof Strikethrough;
242
+ Underline: typeof Underline;
243
+ };
244
+
255
245
  declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
256
246
  disableDrag?: boolean;
257
247
  disableDragOnFocus?: boolean;
@@ -304,4 +294,14 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
304
294
  */
305
295
  declare function useGetPuck(): () => UsePuckStore<Config>;
306
296
 
307
- export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RootDataWithProps, UiState, type UsePuckData, UserGenerics, Viewports, 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 };