@measured/puck 0.21.0-canary.ec77dd9f → 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.
- package/dist/Editor-F2LSS6SE.css +403 -0
- package/dist/Editor-O447AVCX.mjs +204 -0
- package/dist/Render-OFE6QLI2.mjs +55 -0
- package/dist/Render-QEMDIDQC.css +101 -0
- package/dist/{walk-tree-CkSoNBF7.d.mts → actions-ONhOkrvf.d.mts} +208 -33
- package/dist/{walk-tree-CkSoNBF7.d.ts → actions-ONhOkrvf.d.ts} +208 -33
- package/dist/chunk-2Q4PACDA.mjs +111 -0
- package/dist/chunk-62AAYNXG.mjs +63 -0
- package/dist/chunk-BSDEIOEK.mjs +706 -0
- package/dist/chunk-CSSRLPHM.mjs +11 -0
- package/dist/chunk-DAQLMM2T.mjs +1722 -0
- package/dist/chunk-M6W7YEVX.mjs +95 -0
- package/dist/chunk-NLUHDYVR.mjs +416 -0
- package/dist/chunk-PLXSMBAA.mjs +53 -0
- package/dist/chunk-QAWJTCV5.mjs +33 -0
- package/dist/chunk-QBGM4ELA.mjs +528 -0
- package/dist/{chunk-NW2GGRCZ.mjs → chunk-QBJ2LDJB.mjs} +1048 -2778
- package/dist/chunk-T3WX7XJ6.mjs +132 -0
- package/dist/chunk-V5I7CVLT.mjs +103 -0
- package/dist/chunk-Y2EFNT5P.mjs +108 -0
- package/dist/chunk-Y656T6AQ.mjs +419 -0
- package/dist/full-2GJTAAZE.css +301 -0
- package/dist/full-BEMDJKDS.mjs +93 -0
- package/dist/index-BEoNHRI1.d.ts +116 -0
- package/dist/index-DfxZ7tZF.d.mts +116 -0
- package/dist/index.css +278 -22
- package/dist/index.d.mts +94 -111
- package/dist/index.d.ts +94 -111
- package/dist/index.js +5812 -2550
- package/dist/index.mjs +28 -9
- package/dist/internal.d.mts +27 -0
- package/dist/internal.d.ts +27 -0
- package/dist/internal.js +908 -0
- package/dist/internal.mjs +13 -0
- package/dist/loaded-JU3A7Y4L.mjs +57 -0
- package/dist/loaded-N3FYGF2Y.mjs +57 -0
- package/dist/loaded-OBY7OMS6.mjs +60 -0
- package/dist/loaded-RVWBFK7L.css +87 -0
- package/dist/no-external.css +278 -22
- package/dist/no-external.d.mts +19 -2
- package/dist/no-external.d.ts +19 -2
- package/dist/no-external.js +5812 -2550
- package/dist/no-external.mjs +28 -9
- package/dist/rsc.css +101 -0
- package/dist/rsc.d.mts +17 -2
- package/dist/rsc.d.ts +17 -2
- package/dist/rsc.js +409 -22
- package/dist/rsc.mjs +18 -9
- package/dist/walk-tree-CdriEzFJ.d.mts +29 -0
- package/dist/walk-tree-DHbAZ4wF.d.ts +29 -0
- package/package.json +29 -2
- package/dist/chunk-TC25DCTQ.mjs +0 -965
package/dist/index.d.ts
CHANGED
|
@@ -1,122 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { p as Field, q as FieldProps, r as DropZoneProps, C as Config, U as UserGenerics, D as Data, l as UiState, O as OnAction, g as Permissions, j as Plugin, k as Overrides, n as FieldTransforms, a as PuckAction, V as Viewports, I as IframeConfig, s as InitialHistory, M as Metadata, 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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
}>;
|
|
51
|
-
type PermissionsSlice = {
|
|
52
|
-
cache: Cache;
|
|
53
|
-
globalPermissions: Permissions;
|
|
54
|
-
resolvedPermissions: Record<string, Partial<Permissions> | undefined>;
|
|
55
|
-
getPermissions: GetPermissions<Config>;
|
|
56
|
-
resolvePermissions: ResolvePermissions<Config>;
|
|
57
|
-
refreshPermissions: RefreshPermissions<Config>;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
type ComponentOrRootData = Omit<ComponentData<any>, "type">;
|
|
61
|
-
type FieldsSlice = {
|
|
62
|
-
fields: Fields | Partial<Fields>;
|
|
63
|
-
loading: boolean;
|
|
64
|
-
lastResolvedData: Partial<ComponentOrRootData>;
|
|
65
|
-
id: string | undefined;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
type Status = "LOADING" | "MOUNTED" | "READY";
|
|
69
|
-
type ZoomConfig = {
|
|
70
|
-
autoZoom: number;
|
|
71
|
-
rootHeight: number;
|
|
72
|
-
zoom: number;
|
|
73
|
-
};
|
|
74
|
-
type ComponentState = Record<string, {
|
|
75
|
-
loadingCount: number;
|
|
76
|
-
}>;
|
|
77
|
-
type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
|
|
78
|
-
state: G["UserAppState"];
|
|
79
|
-
dispatch: (action: PuckAction) => void;
|
|
80
|
-
config: UserConfig;
|
|
81
|
-
componentState: ComponentState;
|
|
82
|
-
setComponentState: (componentState: ComponentState) => void;
|
|
83
|
-
setComponentLoading: (id: string, loading?: boolean, defer?: number) => () => void;
|
|
84
|
-
unsetComponentLoading: (id: string) => void;
|
|
85
|
-
pendingLoadTimeouts: Record<string, NodeJS.Timeout>;
|
|
86
|
-
resolveComponentData: <T extends ComponentData | RootDataWithProps>(componentData: T, trigger: ResolveDataTrigger) => Promise<{
|
|
87
|
-
node: T;
|
|
88
|
-
didChange: boolean;
|
|
89
|
-
}>;
|
|
90
|
-
resolveAndCommitData: () => void;
|
|
91
|
-
plugins: Plugin[];
|
|
92
|
-
overrides: Partial<Overrides>;
|
|
93
|
-
viewports: Viewports;
|
|
94
|
-
zoomConfig: ZoomConfig;
|
|
95
|
-
setZoomConfig: (zoomConfig: ZoomConfig) => void;
|
|
96
|
-
status: Status;
|
|
97
|
-
setStatus: (status: Status) => void;
|
|
98
|
-
iframe: IframeConfig;
|
|
99
|
-
selectedItem?: G["UserData"]["content"][0] | null;
|
|
100
|
-
setUi: (ui: Partial<UiState>, recordHistory?: boolean) => void;
|
|
101
|
-
getComponentConfig: (type?: string) => ComponentConfig | null | undefined;
|
|
102
|
-
onAction?: (action: PuckAction, newState: AppState, state: AppState) => void;
|
|
103
|
-
metadata: Metadata;
|
|
104
|
-
fields: FieldsSlice;
|
|
105
|
-
history: HistorySlice;
|
|
106
|
-
nodes: NodesSlice;
|
|
107
|
-
permissions: PermissionsSlice;
|
|
108
|
-
fieldTransforms: FieldTransforms;
|
|
109
|
-
};
|
|
7
|
+
import { A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-BEoNHRI1.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';
|
|
110
23
|
|
|
111
24
|
declare const ActionBar: {
|
|
112
25
|
({ label, children, }: {
|
|
113
26
|
label?: string;
|
|
114
27
|
children?: ReactNode;
|
|
115
28
|
}): react_jsx_runtime.JSX.Element;
|
|
116
|
-
Action: ({ children, label, onClick, }: {
|
|
29
|
+
Action: ({ children, label, onClick, active, disabled, }: {
|
|
117
30
|
children: ReactNode;
|
|
118
31
|
label?: string;
|
|
119
32
|
onClick: (e: SyntheticEvent) => void;
|
|
33
|
+
active?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
120
35
|
}) => react_jsx_runtime.JSX.Element;
|
|
121
36
|
Label: ({ label }: {
|
|
122
37
|
label: string;
|
|
@@ -124,11 +39,14 @@ declare const ActionBar: {
|
|
|
124
39
|
Group: ({ children }: {
|
|
125
40
|
children: ReactNode;
|
|
126
41
|
}) => react_jsx_runtime.JSX.Element;
|
|
42
|
+
Separator: () => react_jsx_runtime.JSX.Element;
|
|
127
43
|
};
|
|
128
|
-
declare const Action: ({ children, label, onClick, }: {
|
|
44
|
+
declare const Action: ({ children, label, onClick, active, disabled, }: {
|
|
129
45
|
children: ReactNode;
|
|
130
46
|
label?: string;
|
|
131
47
|
onClick: (e: SyntheticEvent) => void;
|
|
48
|
+
active?: boolean;
|
|
49
|
+
disabled?: boolean;
|
|
132
50
|
}) => react_jsx_runtime.JSX.Element;
|
|
133
51
|
declare const Group: ({ children }: {
|
|
134
52
|
children: ReactNode;
|
|
@@ -136,6 +54,7 @@ declare const Group: ({ children }: {
|
|
|
136
54
|
declare const Label: ({ label }: {
|
|
137
55
|
label: string;
|
|
138
56
|
}) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
declare const Separator: () => react_jsx_runtime.JSX.Element;
|
|
139
58
|
|
|
140
59
|
declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
|
|
141
60
|
children?: ReactNode;
|
|
@@ -184,11 +103,11 @@ declare const Drawer: {
|
|
|
184
103
|
|
|
185
104
|
declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
|
|
186
105
|
|
|
187
|
-
declare const IconButton: ({ children, href, onClick,
|
|
106
|
+
declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
|
|
107
|
+
active?: boolean;
|
|
188
108
|
children: ReactNode;
|
|
189
109
|
href?: string;
|
|
190
110
|
onClick?: (e: SyntheticEvent) => void | Promise<void>;
|
|
191
|
-
variant?: "primary" | "secondary";
|
|
192
111
|
type?: "button" | "submit" | "reset";
|
|
193
112
|
disabled?: boolean;
|
|
194
113
|
tabIndex?: number;
|
|
@@ -251,6 +170,69 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
|
|
|
251
170
|
metadata?: Metadata;
|
|
252
171
|
}): react_jsx_runtime.JSX.Element;
|
|
253
172
|
|
|
173
|
+
declare function AlignLeft(): react_jsx_runtime.JSX.Element;
|
|
174
|
+
|
|
175
|
+
declare function AlignCenter(): react_jsx_runtime.JSX.Element;
|
|
176
|
+
|
|
177
|
+
declare function AlignRight(): react_jsx_runtime.JSX.Element;
|
|
178
|
+
|
|
179
|
+
declare function AlignJustify(): react_jsx_runtime.JSX.Element;
|
|
180
|
+
|
|
181
|
+
declare function Bold(): react_jsx_runtime.JSX.Element;
|
|
182
|
+
|
|
183
|
+
declare function Italic(): react_jsx_runtime.JSX.Element;
|
|
184
|
+
|
|
185
|
+
declare function Underline(): react_jsx_runtime.JSX.Element;
|
|
186
|
+
|
|
187
|
+
declare function Strikethrough(): react_jsx_runtime.JSX.Element;
|
|
188
|
+
|
|
189
|
+
declare function InlineCode(): react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
191
|
+
declare function BulletList(): react_jsx_runtime.JSX.Element;
|
|
192
|
+
|
|
193
|
+
declare function OrderedList(): react_jsx_runtime.JSX.Element;
|
|
194
|
+
|
|
195
|
+
declare function CodeBlock(): react_jsx_runtime.JSX.Element;
|
|
196
|
+
|
|
197
|
+
declare function Blockquote(): react_jsx_runtime.JSX.Element;
|
|
198
|
+
|
|
199
|
+
declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
|
|
200
|
+
|
|
201
|
+
declare function Control({ icon, disabled, active, onClick, title, }: {
|
|
202
|
+
icon: ReactNode;
|
|
203
|
+
disabled?: boolean;
|
|
204
|
+
active?: boolean;
|
|
205
|
+
onClick: (e: SyntheticEvent) => any;
|
|
206
|
+
title: string;
|
|
207
|
+
}): react_jsx_runtime.JSX.Element;
|
|
208
|
+
|
|
209
|
+
declare const RichTextMenu: {
|
|
210
|
+
({ children }: {
|
|
211
|
+
children: ReactNode;
|
|
212
|
+
}): react_jsx_runtime.JSX.Element;
|
|
213
|
+
Group: ({ children }: {
|
|
214
|
+
children: ReactNode;
|
|
215
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
216
|
+
Control: typeof Control;
|
|
217
|
+
AlignCenter: typeof AlignCenter;
|
|
218
|
+
AlignJustify: typeof AlignJustify;
|
|
219
|
+
AlignLeft: typeof AlignLeft;
|
|
220
|
+
AlignRight: typeof AlignRight;
|
|
221
|
+
AlignSelect: () => react_jsx_runtime.JSX.Element;
|
|
222
|
+
Blockquote: typeof Blockquote;
|
|
223
|
+
Bold: typeof Bold;
|
|
224
|
+
BulletList: typeof BulletList;
|
|
225
|
+
CodeBlock: typeof CodeBlock;
|
|
226
|
+
HeadingSelect: () => react_jsx_runtime.JSX.Element;
|
|
227
|
+
HorizontalRule: typeof HorizontalRule;
|
|
228
|
+
InlineCode: typeof InlineCode;
|
|
229
|
+
Italic: typeof Italic;
|
|
230
|
+
ListSelect: () => react_jsx_runtime.JSX.Element;
|
|
231
|
+
OrderedList: typeof OrderedList;
|
|
232
|
+
Strikethrough: typeof Strikethrough;
|
|
233
|
+
Underline: typeof Underline;
|
|
234
|
+
};
|
|
235
|
+
|
|
254
236
|
declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
|
|
255
237
|
disableDrag?: boolean;
|
|
256
238
|
disableDragOnFocus?: boolean;
|
|
@@ -271,6 +253,7 @@ type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<User
|
|
|
271
253
|
getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
|
|
272
254
|
getItemById: (id: string) => G["UserComponentData"] | undefined;
|
|
273
255
|
getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
|
|
256
|
+
getParentById: (id: string) => ComponentData | undefined;
|
|
274
257
|
history: {
|
|
275
258
|
back: HistorySlice["back"];
|
|
276
259
|
forward: HistorySlice["forward"];
|
|
@@ -302,4 +285,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
|
|
|
302
285
|
*/
|
|
303
286
|
declare function useGetPuck(): () => UsePuckStore<Config>;
|
|
304
287
|
|
|
305
|
-
export { Action, ActionBar,
|
|
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 };
|