@measured/puck 0.21.0-canary.ace4c8b3 → 0.21.0-canary.b353d921

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 (40) hide show
  1. package/dist/Editor-F2LSS6SE.css +403 -0
  2. package/dist/Editor-N46HUQEC.mjs +201 -0
  3. package/dist/Render-QEMDIDQC.css +101 -0
  4. package/dist/Render-Y567PGZ7.mjs +53 -0
  5. package/dist/chunk-3QHWXJEI.mjs +33 -0
  6. package/dist/chunk-7KY6RHEY.mjs +2230 -0
  7. package/dist/chunk-C2TVYIYC.mjs +415 -0
  8. package/dist/chunk-DCSQEDMK.mjs +194 -0
  9. package/dist/{chunk-TC25DCTQ.mjs → chunk-DJSH5REF.mjs} +70 -498
  10. package/dist/chunk-DNF2EMM4.mjs +63 -0
  11. package/dist/chunk-FNWOH4R6.mjs +109 -0
  12. package/dist/chunk-GQKMOYLG.mjs +53 -0
  13. package/dist/chunk-K3V4LVUL.mjs +704 -0
  14. package/dist/chunk-R6CVX2IY.mjs +103 -0
  15. package/dist/{chunk-AIFI2M23.mjs → chunk-TB3SSIAY.mjs} +1041 -2778
  16. package/dist/chunk-WUWXFMEM.mjs +11 -0
  17. package/dist/full-2GJTAAZE.css +301 -0
  18. package/dist/full-NLUNPJWS.mjs +90 -0
  19. package/dist/index.css +278 -22
  20. package/dist/index.d.mts +100 -7
  21. package/dist/index.d.ts +100 -7
  22. package/dist/index.js +5811 -2550
  23. package/dist/index.mjs +25 -9
  24. package/dist/loaded-EV34KGYJ.mjs +57 -0
  25. package/dist/loaded-HMSPJUZM.mjs +54 -0
  26. package/dist/loaded-RVWBFK7L.css +87 -0
  27. package/dist/loaded-ZXOU6S6R.mjs +54 -0
  28. package/dist/no-external.css +278 -22
  29. package/dist/no-external.d.mts +17 -2
  30. package/dist/no-external.d.ts +17 -2
  31. package/dist/no-external.js +5811 -2550
  32. package/dist/no-external.mjs +25 -9
  33. package/dist/rsc.css +101 -0
  34. package/dist/rsc.d.mts +17 -2
  35. package/dist/rsc.d.ts +17 -2
  36. package/dist/rsc.js +409 -22
  37. package/dist/rsc.mjs +16 -9
  38. package/dist/{walk-tree-CkSoNBF7.d.mts → walk-tree-Ja9bNCM9.d.mts} +208 -7
  39. package/dist/{walk-tree-CkSoNBF7.d.ts → walk-tree-Ja9bNCM9.d.ts} +208 -7
  40. package/package.json +23 -1
package/dist/index.d.ts CHANGED
@@ -1,8 +1,23 @@
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-CkSoNBF7.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-CkSoNBF7.js';
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';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
6
+ import { Editor } from '@tiptap/react';
7
+ import '@tiptap/extension-blockquote';
8
+ import '@tiptap/extension-bold';
9
+ import '@tiptap/extension-code';
10
+ import '@tiptap/extension-code-block';
11
+ import '@tiptap/extension-hard-break';
12
+ import '@tiptap/extension-heading';
13
+ import '@tiptap/extension-horizontal-rule';
14
+ import '@tiptap/extension-italic';
15
+ import '@tiptap/extension-link';
16
+ import '@tiptap/extension-list';
17
+ import '@tiptap/extension-paragraph';
18
+ import '@tiptap/extension-strike';
19
+ import '@tiptap/extension-text-align';
20
+ import '@tiptap/extension-underline';
6
21
 
7
22
  type HistorySlice<D = any> = {
8
23
  index: number;
@@ -47,6 +62,7 @@ type RefreshPermissions<UserConfig extends Config = Config> = (params?: Permissi
47
62
  type Cache = Record<string, {
48
63
  lastPermissions: Partial<Permissions>;
49
64
  lastData: ComponentData | null;
65
+ lastParentId: string | null;
50
66
  }>;
51
67
  type PermissionsSlice = {
52
68
  cache: Cache;
@@ -106,6 +122,13 @@ type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserCon
106
122
  nodes: NodesSlice;
107
123
  permissions: PermissionsSlice;
108
124
  fieldTransforms: FieldTransforms;
125
+ currentRichText?: {
126
+ inlineComponentId?: string;
127
+ inline: boolean;
128
+ field: RichtextField;
129
+ editor: Editor;
130
+ id: string;
131
+ } | null;
109
132
  };
110
133
 
111
134
  declare const ActionBar: {
@@ -113,10 +136,12 @@ declare const ActionBar: {
113
136
  label?: string;
114
137
  children?: ReactNode;
115
138
  }): react_jsx_runtime.JSX.Element;
116
- Action: ({ children, label, onClick, }: {
139
+ Action: ({ children, label, onClick, active, disabled, }: {
117
140
  children: ReactNode;
118
141
  label?: string;
119
142
  onClick: (e: SyntheticEvent) => void;
143
+ active?: boolean;
144
+ disabled?: boolean;
120
145
  }) => react_jsx_runtime.JSX.Element;
121
146
  Label: ({ label }: {
122
147
  label: string;
@@ -124,11 +149,14 @@ declare const ActionBar: {
124
149
  Group: ({ children }: {
125
150
  children: ReactNode;
126
151
  }) => react_jsx_runtime.JSX.Element;
152
+ Separator: () => react_jsx_runtime.JSX.Element;
127
153
  };
128
- declare const Action: ({ children, label, onClick, }: {
154
+ declare const Action: ({ children, label, onClick, active, disabled, }: {
129
155
  children: ReactNode;
130
156
  label?: string;
131
157
  onClick: (e: SyntheticEvent) => void;
158
+ active?: boolean;
159
+ disabled?: boolean;
132
160
  }) => react_jsx_runtime.JSX.Element;
133
161
  declare const Group: ({ children }: {
134
162
  children: ReactNode;
@@ -136,6 +164,7 @@ declare const Group: ({ children }: {
136
164
  declare const Label: ({ label }: {
137
165
  label: string;
138
166
  }) => react_jsx_runtime.JSX.Element;
167
+ declare const Separator: () => react_jsx_runtime.JSX.Element;
139
168
 
140
169
  declare const FieldLabel: ({ children, icon, label, el, readOnly, className, }: {
141
170
  children?: ReactNode;
@@ -184,11 +213,11 @@ declare const Drawer: {
184
213
 
185
214
  declare const DropZone: react.ForwardRefExoticComponent<DropZoneProps & react.RefAttributes<HTMLDivElement>>;
186
215
 
187
- declare const IconButton: ({ children, href, onClick, variant, type, disabled, tabIndex, newTab, fullWidth, title, }: {
216
+ declare const IconButton: ({ active, children, href, onClick, type, disabled, tabIndex, newTab, fullWidth, title, }: {
217
+ active?: boolean;
188
218
  children: ReactNode;
189
219
  href?: string;
190
220
  onClick?: (e: SyntheticEvent) => void | Promise<void>;
191
- variant?: "primary" | "secondary";
192
221
  type?: "button" | "submit" | "reset";
193
222
  disabled?: boolean;
194
223
  tabIndex?: number;
@@ -251,6 +280,69 @@ declare function Render<UserConfig extends Config = Config, G extends UserGeneri
251
280
  metadata?: Metadata;
252
281
  }): react_jsx_runtime.JSX.Element;
253
282
 
283
+ declare function AlignLeft(): react_jsx_runtime.JSX.Element;
284
+
285
+ declare function AlignCenter(): react_jsx_runtime.JSX.Element;
286
+
287
+ declare function AlignRight(): react_jsx_runtime.JSX.Element;
288
+
289
+ declare function AlignJustify(): react_jsx_runtime.JSX.Element;
290
+
291
+ declare function Bold(): react_jsx_runtime.JSX.Element;
292
+
293
+ declare function Italic(): react_jsx_runtime.JSX.Element;
294
+
295
+ declare function Underline(): react_jsx_runtime.JSX.Element;
296
+
297
+ declare function Strikethrough(): react_jsx_runtime.JSX.Element;
298
+
299
+ declare function InlineCode(): react_jsx_runtime.JSX.Element;
300
+
301
+ declare function BulletList(): react_jsx_runtime.JSX.Element;
302
+
303
+ declare function OrderedList(): react_jsx_runtime.JSX.Element;
304
+
305
+ declare function CodeBlock(): react_jsx_runtime.JSX.Element;
306
+
307
+ declare function Blockquote(): react_jsx_runtime.JSX.Element;
308
+
309
+ declare function HorizontalRule(): react_jsx_runtime.JSX.Element;
310
+
311
+ declare function Control({ icon, disabled, active, onClick, title, }: {
312
+ icon: ReactNode;
313
+ disabled?: boolean;
314
+ active?: boolean;
315
+ onClick: (e: SyntheticEvent) => any;
316
+ title: string;
317
+ }): react_jsx_runtime.JSX.Element;
318
+
319
+ declare const RichTextMenu: {
320
+ ({ children }: {
321
+ children: ReactNode;
322
+ }): react_jsx_runtime.JSX.Element;
323
+ Group: ({ children }: {
324
+ children: ReactNode;
325
+ }) => react_jsx_runtime.JSX.Element;
326
+ Control: typeof Control;
327
+ AlignCenter: typeof AlignCenter;
328
+ AlignJustify: typeof AlignJustify;
329
+ AlignLeft: typeof AlignLeft;
330
+ AlignRight: typeof AlignRight;
331
+ AlignSelect: () => react_jsx_runtime.JSX.Element;
332
+ Blockquote: typeof Blockquote;
333
+ Bold: typeof Bold;
334
+ BulletList: typeof BulletList;
335
+ CodeBlock: typeof CodeBlock;
336
+ HeadingSelect: () => react_jsx_runtime.JSX.Element;
337
+ HorizontalRule: typeof HorizontalRule;
338
+ InlineCode: typeof InlineCode;
339
+ Italic: typeof Italic;
340
+ ListSelect: () => react_jsx_runtime.JSX.Element;
341
+ OrderedList: typeof OrderedList;
342
+ Strikethrough: typeof Strikethrough;
343
+ Underline: typeof Underline;
344
+ };
345
+
254
346
  declare const registerOverlayPortal: (el: HTMLElement | null | undefined, opts?: {
255
347
  disableDrag?: boolean;
256
348
  disableDragOnFocus?: boolean;
@@ -271,6 +363,7 @@ type UsePuckData<UserConfig extends Config = Config, G extends UserGenerics<User
271
363
  getItemBySelector: (selector: ItemSelector) => G["UserComponentData"] | undefined;
272
364
  getItemById: (id: string) => G["UserComponentData"] | undefined;
273
365
  getSelectorForId: (id: string) => Required<ItemSelector> | undefined;
366
+ getParentById: (id: string) => ComponentData | undefined;
274
367
  history: {
275
368
  back: HistorySlice["back"];
276
369
  forward: HistorySlice["forward"];
@@ -302,4 +395,4 @@ declare function usePuck<UserConfig extends Config = Config>(): UsePuckStore<Use
302
395
  */
303
396
  declare function useGetPuck(): () => UsePuckStore<Config>;
304
397
 
305
- 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 };
398
+ export { Action, ActionBar, AppState, AutoField, Button, ComponentConfig, ComponentData, Config, Data, Drawer, DropZone, Field, FieldLabel, FieldProps, FieldTransforms, Fields, Group, History, IconButton, IframeConfig, InitialHistory, Label, Metadata, OnAction, Overrides, Permissions, Plugin, Puck, PuckAction, type PuckApi, Render, ResolveDataTrigger, RichTextMenu, RichtextField, RootDataWithProps, Separator, UiState, type UsePuckData, UserGenerics, Viewports, createUsePuck, registerOverlayPortal, renderContext, setDeep, useGetPuck, usePuck };