@measured/puck 0.21.0-canary.eb8ea5ce → 0.21.0-canary.ece26d91

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 (46) hide show
  1. package/dist/{Editor-DR57V55X.mjs → Editor-O447AVCX.mjs} +17 -7
  2. package/dist/{Render-6Q5WP25Y.mjs → Render-OFE6QLI2.mjs} +8 -4
  3. package/dist/{walk-tree-Ja9bNCM9.d.mts → actions-ONhOkrvf.d.mts} +1 -27
  4. package/dist/{walk-tree-Ja9bNCM9.d.ts → actions-ONhOkrvf.d.ts} +1 -27
  5. package/dist/chunk-2Q4PACDA.mjs +111 -0
  6. package/dist/chunk-62AAYNXG.mjs +63 -0
  7. package/dist/chunk-BSDEIOEK.mjs +706 -0
  8. package/dist/chunk-CSSRLPHM.mjs +11 -0
  9. package/dist/{chunk-OPXWLTPM.mjs → chunk-DAQLMM2T.mjs} +1377 -2795
  10. package/dist/chunk-M6W7YEVX.mjs +95 -0
  11. package/dist/{chunk-YZQENDBP.mjs → chunk-NLUHDYVR.mjs} +2 -123
  12. package/dist/chunk-PLXSMBAA.mjs +53 -0
  13. package/dist/chunk-QAWJTCV5.mjs +33 -0
  14. package/dist/chunk-QBGM4ELA.mjs +528 -0
  15. package/dist/{chunk-MSIUWPEI.mjs → chunk-QBJ2LDJB.mjs} +36 -20
  16. package/dist/chunk-T3WX7XJ6.mjs +132 -0
  17. package/dist/{chunk-CF5XA6LF.mjs → chunk-V5I7CVLT.mjs} +1 -1
  18. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  19. package/dist/{chunk-A7EMVTSK.mjs → chunk-Y656T6AQ.mjs} +13 -7
  20. package/dist/full-2GJTAAZE.css +301 -0
  21. package/dist/full-BEMDJKDS.mjs +93 -0
  22. package/dist/index-BEoNHRI1.d.ts +116 -0
  23. package/dist/index-DfxZ7tZF.d.mts +116 -0
  24. package/dist/index.d.mts +9 -125
  25. package/dist/index.d.ts +9 -125
  26. package/dist/index.js +1002 -775
  27. package/dist/index.mjs +14 -5
  28. package/dist/internal.d.mts +27 -0
  29. package/dist/internal.d.ts +27 -0
  30. package/dist/internal.js +908 -0
  31. package/dist/internal.mjs +13 -0
  32. package/dist/loaded-JU3A7Y4L.mjs +57 -0
  33. package/dist/loaded-N3FYGF2Y.mjs +57 -0
  34. package/dist/loaded-OBY7OMS6.mjs +60 -0
  35. package/dist/loaded-RVWBFK7L.css +87 -0
  36. package/dist/no-external.d.mts +3 -1
  37. package/dist/no-external.d.ts +3 -1
  38. package/dist/no-external.js +1002 -775
  39. package/dist/no-external.mjs +14 -5
  40. package/dist/rsc.d.mts +2 -2
  41. package/dist/rsc.d.ts +2 -2
  42. package/dist/rsc.mjs +6 -3
  43. package/dist/walk-tree-CdriEzFJ.d.mts +29 -0
  44. package/dist/walk-tree-DHbAZ4wF.d.ts +29 -0
  45. package/package.json +7 -2
  46. package/dist/chunk-GQ457KMA.mjs +0 -199
@@ -0,0 +1,116 @@
1
+ import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms, o as RichtextField } from './actions-ONhOkrvf.js';
2
+ import { Editor } from '@tiptap/react';
3
+
4
+ type HistorySlice<D = any> = {
5
+ index: number;
6
+ hasPast: () => boolean;
7
+ hasFuture: () => boolean;
8
+ histories: History<D>[];
9
+ record: (data: D) => void;
10
+ back: VoidFunction;
11
+ forward: VoidFunction;
12
+ currentHistory: () => History;
13
+ nextHistory: () => History<D> | null;
14
+ prevHistory: () => History<D> | null;
15
+ setHistories: (histories: History[]) => void;
16
+ setHistoryIndex: (index: number) => void;
17
+ initialAppState: D;
18
+ };
19
+
20
+ type NodeMethods = {
21
+ sync: () => void;
22
+ hideOverlay: () => void;
23
+ showOverlay: () => void;
24
+ };
25
+ type PuckNodeInstance = {
26
+ id: string;
27
+ methods: NodeMethods;
28
+ element: HTMLElement | null;
29
+ };
30
+ type NodesSlice = {
31
+ nodes: Record<string, PuckNodeInstance | undefined>;
32
+ registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
33
+ unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
34
+ };
35
+
36
+ type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
37
+ item?: G["UserComponentData"] | null;
38
+ type?: keyof G["UserProps"];
39
+ root?: boolean;
40
+ };
41
+ type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
42
+ type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
43
+ type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
44
+ type Cache = Record<string, {
45
+ lastPermissions: Partial<Permissions>;
46
+ lastData: ComponentData | null;
47
+ lastParentId: string | null;
48
+ }>;
49
+ type PermissionsSlice = {
50
+ cache: Cache;
51
+ globalPermissions: Permissions;
52
+ resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
53
+ getPermissions: GetPermissions<Config>;
54
+ resolvePermissions: ResolvePermissions<Config>;
55
+ refreshPermissions: RefreshPermissions<Config>;
56
+ };
57
+
58
+ type ComponentOrRootData = Omit<ComponentData<any>, "type">;
59
+ type FieldsSlice = {
60
+ fields: Fields | Partial<Fields>;
61
+ loading: boolean;
62
+ lastResolvedData: Partial<ComponentOrRootData>;
63
+ id: string | undefined;
64
+ };
65
+
66
+ type Status = "LOADING" | "MOUNTED" | "READY";
67
+ type ZoomConfig = {
68
+ autoZoom: number;
69
+ rootHeight: number;
70
+ zoom: number;
71
+ };
72
+ type ComponentState = Record<string, {
73
+ loadingCount: number;
74
+ }>;
75
+ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
76
+ state: G["UserAppState"];
77
+ dispatch: (action: PuckAction) => void;
78
+ config: UserConfig;
79
+ componentState: ComponentState;
80
+ setComponentState: (componentState: ComponentState) => void;
81
+ setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
82
+ unsetComponentLoading: (id: string) => void;
83
+ pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
84
+ resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
85
+ node: T;
86
+ didChange: boolean;
87
+ }>;
88
+ resolveAndCommitData: () => void;
89
+ plugins: Plugin[];
90
+ overrides: Partial<Overrides>;
91
+ viewports: Viewports;
92
+ zoomConfig: ZoomConfig;
93
+ setZoomConfig: (zoomConfig: ZoomConfig) => void;
94
+ status: Status;
95
+ setStatus: (status: Status) => void;
96
+ iframe: IframeConfig;
97
+ selectedItem?: G["UserData"]["content"][0] | null;
98
+ setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
99
+ getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
100
+ onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
101
+ metadata: Metadata;
102
+ fields: FieldsSlice;
103
+ history: HistorySlice;
104
+ nodes: NodesSlice;
105
+ permissions: PermissionsSlice;
106
+ fieldTransforms: FieldTransforms;
107
+ currentRichText?: {
108
+ inlineComponentId?: string;
109
+ inline: boolean;
110
+ field: RichtextField;
111
+ editor: Editor;
112
+ id: string;
113
+ } | null;
114
+ };
115
+
116
+ export type { AppStore as A, GetPermissions as G, HistorySlice as H, RefreshPermissions as R };
@@ -0,0 +1,116 @@
1
+ import { H as History, g as Permissions, c as ComponentData, C as Config, U as UserGenerics, F as Fields, a as PuckAction, h as RootDataWithProps, i as ResolveDataTrigger, j as Plugin, k as Overrides, V as Viewports, I as IframeConfig, l as UiState, m as ComponentConfig, A as AppState, M as Metadata, n as FieldTransforms, o as RichtextField } from './actions-ONhOkrvf.mjs';
2
+ import { Editor } from '@tiptap/react';
3
+
4
+ type HistorySlice<D = any> = {
5
+ index: number;
6
+ hasPast: () => boolean;
7
+ hasFuture: () => boolean;
8
+ histories: History<D>[];
9
+ record: (data: D) => void;
10
+ back: VoidFunction;
11
+ forward: VoidFunction;
12
+ currentHistory: () => History;
13
+ nextHistory: () => History<D> | null;
14
+ prevHistory: () => History<D> | null;
15
+ setHistories: (histories: History[]) => void;
16
+ setHistoryIndex: (index: number) => void;
17
+ initialAppState: D;
18
+ };
19
+
20
+ type NodeMethods = {
21
+ sync: () => void;
22
+ hideOverlay: () => void;
23
+ showOverlay: () => void;
24
+ };
25
+ type PuckNodeInstance = {
26
+ id: string;
27
+ methods: NodeMethods;
28
+ element: HTMLElement | null;
29
+ };
30
+ type NodesSlice = {
31
+ nodes: Record<string, PuckNodeInstance | undefined>;
32
+ registerNode: (id: string, node: Partial<PuckNodeInstance>) => void;
33
+ unregisterNode: (id: string, node?: Partial<PuckNodeInstance>) => void;
34
+ };
35
+
36
+ type PermissionsArgs<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
37
+ item?: G["UserComponentData"] | null;
38
+ type?: keyof G["UserProps"];
39
+ root?: boolean;
40
+ };
41
+ type GetPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>) => Permissions;
42
+ type ResolvePermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
43
+ type RefreshPermissions<UserConfig extends Config = Config> = (params?: PermissionsArgs<UserConfig>, force?: boolean) => void;
44
+ type Cache = Record<string, {
45
+ lastPermissions: Partial<Permissions>;
46
+ lastData: ComponentData | null;
47
+ lastParentId: string | null;
48
+ }>;
49
+ type PermissionsSlice = {
50
+ cache: Cache;
51
+ globalPermissions: Permissions;
52
+ resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
53
+ getPermissions: GetPermissions<Config>;
54
+ resolvePermissions: ResolvePermissions<Config>;
55
+ refreshPermissions: RefreshPermissions<Config>;
56
+ };
57
+
58
+ type ComponentOrRootData = Omit<ComponentData<any>, "type">;
59
+ type FieldsSlice = {
60
+ fields: Fields | Partial<Fields>;
61
+ loading: boolean;
62
+ lastResolvedData: Partial<ComponentOrRootData>;
63
+ id: string | undefined;
64
+ };
65
+
66
+ type Status = "LOADING" | "MOUNTED" | "READY";
67
+ type ZoomConfig = {
68
+ autoZoom: number;
69
+ rootHeight: number;
70
+ zoom: number;
71
+ };
72
+ type ComponentState = Record<string, {
73
+ loadingCount: number;
74
+ }>;
75
+ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
76
+ state: G["UserAppState"];
77
+ dispatch: (action: PuckAction) => void;
78
+ config: UserConfig;
79
+ componentState: ComponentState;
80
+ setComponentState: (componentState: ComponentState) => void;
81
+ setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
82
+ unsetComponentLoading: (id: string) => void;
83
+ pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
84
+ resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
85
+ node: T;
86
+ didChange: boolean;
87
+ }>;
88
+ resolveAndCommitData: () => void;
89
+ plugins: Plugin[];
90
+ overrides: Partial<Overrides>;
91
+ viewports: Viewports;
92
+ zoomConfig: ZoomConfig;
93
+ setZoomConfig: (zoomConfig: ZoomConfig) => void;
94
+ status: Status;
95
+ setStatus: (status: Status) => void;
96
+ iframe: IframeConfig;
97
+ selectedItem?: G["UserData"]["content"][0] | null;
98
+ setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
99
+ getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
100
+ onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
101
+ metadata: Metadata;
102
+ fields: FieldsSlice;
103
+ history: HistorySlice;
104
+ nodes: NodesSlice;
105
+ permissions: PermissionsSlice;
106
+ fieldTransforms: FieldTransforms;
107
+ currentRichText?: {
108
+ inlineComponentId?: string;
109
+ inline: boolean;
110
+ field: RichtextField;
111
+ editor: Editor;
112
+ id: string;
113
+ } | null;
114
+ };
115
+
116
+ export type { AppStore as A, GetPermissions as G, HistorySlice as H, RefreshPermissions as R };
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 } from './actions-ONhOkrvf.mjs';
2
+ export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, a6 as FieldMetadata, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, F as Fields, H as History, K as ItemWithId, a2 as MappedItem, a9 as NumberField, ae as ObjectField, G as OverrideKey, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, y as Viewport, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-ONhOkrvf.mjs';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-CdriEzFJ.mjs';
3
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
5
  import * as react from 'react';
5
6
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
6
- import { Editor } from '@tiptap/react';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-DfxZ7tZF.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;
@@ -288,8 +178,6 @@ declare function AlignRight(): react_jsx_runtime.JSX.Element;
288
178
 
289
179
  declare function AlignJustify(): react_jsx_runtime.JSX.Element;
290
180
 
291
- declare function AlignSelect(): react_jsx_runtime.JSX.Element;
292
-
293
181
  declare function Bold(): react_jsx_runtime.JSX.Element;
294
182
 
295
183
  declare function Italic(): react_jsx_runtime.JSX.Element;
@@ -310,10 +198,6 @@ declare function Blockquote(): react_jsx_runtime.JSX.Element;
310
198
 
311
199
  declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
312
200
 
313
- declare function HeadingSelect(): react_jsx_runtime.JSX.Element;
314
-
315
- declare function ListSelect(): react_jsx_runtime.JSX.Element;
316
-
317
201
  declare function Control({ icon, disabled, active, onClick, title, }: {
318
202
  icon: ReactNode;
319
203
  disabled?: boolean;
@@ -334,16 +218,16 @@ declare const RichTextMenu: {
334
218
  AlignJustify: typeof AlignJustify;
335
219
  AlignLeft: typeof AlignLeft;
336
220
  AlignRight: typeof AlignRight;
337
- AlignSelect: typeof AlignSelect;
221
+ AlignSelect: () => react_jsx_runtime.JSX.Element;
338
222
  Blockquote: typeof Blockquote;
339
223
  Bold: typeof Bold;
340
224
  BulletList: typeof BulletList;
341
225
  CodeBlock: typeof CodeBlock;
342
- HeadingSelect: typeof HeadingSelect;
226
+ HeadingSelect: () => react_jsx_runtime.JSX.Element;
343
227
  HorizontalRule: typeof HorizontalRule;
344
228
  InlineCode: typeof InlineCode;
345
229
  Italic: typeof Italic;
346
- ListSelect: typeof ListSelect;
230
+ ListSelect: () => react_jsx_runtime.JSX.Element;
347
231
  OrderedList: typeof OrderedList;
348
232
  Strikethrough: typeof Strikethrough;
349
233
  Underline: typeof Underline;
@@ -401,4 +285,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
401
285
  */
402
286
  declare function useGetPuck(): () => UsePuckStore<Config>;
403
287
 
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 };
288
+ 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, createUsePuck, 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 } from './actions-ONhOkrvf.js';
2
+ export { af as Adaptor, A as AppState, ad as ArrayField, L as ArrayState, aq as AsFieldProps, $ as BaseData, a7 as BaseField, ah as CacheOpts, m as ComponentConfig, T as ComponentConfigExtensions, _ as ComponentConfigParams, a3 as ComponentDataMap, a1 as ComponentDataOptionalId, a5 as ComponentMetadata, Z as ConfigParams, b as Content, ak as CustomField, aj as CustomFieldRender, e as DefaultComponentProps, d as DefaultComponents, f as DefaultRootFieldProps, ao as DefaultRootProps, an as DefaultRootRenderProps, w as Direction, x as DragAxis, ai as ExternalField, ag as ExternalFieldWithAdaptor, Y as ExtractConfigParams, as as ExtractField, a6 as FieldMetadata, J as FieldRenderFunctions, B as FieldTransformFn, z as FieldTransformFnParams, F as Fields, H as History, K as ItemWithId, a2 as MappedItem, a9 as NumberField, ae as ObjectField, G as OverrideKey, Q as PuckComponent, am as PuckContext, a4 as PuckMetadata, ac as RadioField, i as ResolveDataTrigger, v as RichText, o as RichtextField, X as RootConfig, R as RootData, h as RootDataWithProps, a0 as RootDataWithoutProps, ab as SelectField, S as Slot, N as SlotComponent, al as SlotField, a8 as TextField, aa as TextareaField, y as Viewport, ar as WithChildren, W as WithId, ap as WithPuckProps, u as WithSlotProps, E as overrideKeys } from './actions-ONhOkrvf.js';
3
+ export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-DHbAZ4wF.js';
3
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
5
  import * as react from 'react';
5
6
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
6
- import { Editor } from '@tiptap/react';
7
+ import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-BEoNHRI1.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;
@@ -288,8 +178,6 @@ declare function AlignRight(): react_jsx_runtime.JSX.Element;
288
178
 
289
179
  declare function AlignJustify(): react_jsx_runtime.JSX.Element;
290
180
 
291
- declare function AlignSelect(): react_jsx_runtime.JSX.Element;
292
-
293
181
  declare function Bold(): react_jsx_runtime.JSX.Element;
294
182
 
295
183
  declare function Italic(): react_jsx_runtime.JSX.Element;
@@ -310,10 +198,6 @@ declare function Blockquote(): react_jsx_runtime.JSX.Element;
310
198
 
311
199
  declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
312
200
 
313
- declare function HeadingSelect(): react_jsx_runtime.JSX.Element;
314
-
315
- declare function ListSelect(): react_jsx_runtime.JSX.Element;
316
-
317
201
  declare function Control({ icon, disabled, active, onClick, title, }: {
318
202
  icon: ReactNode;
319
203
  disabled?: boolean;
@@ -334,16 +218,16 @@ declare const RichTextMenu: {
334
218
  AlignJustify: typeof AlignJustify;
335
219
  AlignLeft: typeof AlignLeft;
336
220
  AlignRight: typeof AlignRight;
337
- AlignSelect: typeof AlignSelect;
221
+ AlignSelect: () => react_jsx_runtime.JSX.Element;
338
222
  Blockquote: typeof Blockquote;
339
223
  Bold: typeof Bold;
340
224
  BulletList: typeof BulletList;
341
225
  CodeBlock: typeof CodeBlock;
342
- HeadingSelect: typeof HeadingSelect;
226
+ HeadingSelect: () => react_jsx_runtime.JSX.Element;
343
227
  HorizontalRule: typeof HorizontalRule;
344
228
  InlineCode: typeof InlineCode;
345
229
  Italic: typeof Italic;
346
- ListSelect: typeof ListSelect;
230
+ ListSelect: () => react_jsx_runtime.JSX.Element;
347
231
  OrderedList: typeof OrderedList;
348
232
  Strikethrough: typeof Strikethrough;
349
233
  Underline: typeof Underline;
@@ -401,4 +285,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
401
285
  */
402
286
  declare function useGetPuck(): () => UsePuckStore<Config>;
403
287
 
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 };
288
+ 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, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };