@measured/puck 0.21.0-canary.c78dc826 → 0.21.0-canary.cbc526d1

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 (50) hide show
  1. package/dist/{Editor-N46HUQEC.mjs → Editor-32UYWE6W.mjs} +13 -10
  2. package/dist/{Editor-F2LSS6SE.css → Editor-IQP25PUX.css} +28 -27
  3. package/dist/{Render-QEMDIDQC.css → Render-3OV4N4MT.css} +28 -27
  4. package/dist/{Render-Y567PGZ7.mjs → Render-FXZX6NFH.mjs} +6 -4
  5. package/dist/{walk-tree-Ja9bNCM9.d.mts → actions-BkBoKAc5.d.mts} +26 -36
  6. package/dist/{walk-tree-Ja9bNCM9.d.ts → actions-BkBoKAc5.d.ts} +26 -36
  7. package/dist/{chunk-3QHWXJEI.mjs → chunk-3VQHXASI.mjs} +2 -2
  8. package/dist/{chunk-K3V4LVUL.mjs → chunk-6KNQXLQR.mjs} +14 -10
  9. package/dist/chunk-AOEDIUVK.mjs +11 -0
  10. package/dist/{chunk-GQKMOYLG.mjs → chunk-GVKHZNTR.mjs} +2 -2
  11. package/dist/{chunk-7KY6RHEY.mjs → chunk-K562SEXI.mjs} +109 -526
  12. package/dist/chunk-KN3XDS7U.mjs +528 -0
  13. package/dist/{chunk-DCSQEDMK.mjs → chunk-M6W7YEVX.mjs} +1 -100
  14. package/dist/{chunk-DNF2EMM4.mjs → chunk-MEL7FUSF.mjs} +2 -2
  15. package/dist/{chunk-C2TVYIYC.mjs → chunk-NYGQH27S.mjs} +105 -75
  16. package/dist/{chunk-DJSH5REF.mjs → chunk-Q3TJ2VYO.mjs} +25 -126
  17. package/dist/chunk-REWRIUGR.mjs +156 -0
  18. package/dist/{chunk-FNWOH4R6.mjs → chunk-V2IQTPPK.mjs} +8 -6
  19. package/dist/{chunk-R6CVX2IY.mjs → chunk-V5I7CVLT.mjs} +1 -1
  20. package/dist/{chunk-TB3SSIAY.mjs → chunk-WD3LNSAC.mjs} +5258 -4424
  21. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  22. package/dist/{full-NLUNPJWS.mjs → full-4OS3O57Y.mjs} +10 -7
  23. package/dist/index-bqD1SEOb.d.mts +118 -0
  24. package/dist/index-lt1zf5WR.d.ts +118 -0
  25. package/dist/index.css +732 -341
  26. package/dist/index.d.mts +31 -120
  27. package/dist/index.d.ts +31 -120
  28. package/dist/index.js +3494 -2436
  29. package/dist/index.mjs +22 -16
  30. package/dist/internal.d.mts +27 -0
  31. package/dist/internal.d.ts +27 -0
  32. package/dist/internal.js +927 -0
  33. package/dist/internal.mjs +13 -0
  34. package/dist/{loaded-ZXOU6S6R.mjs → loaded-DCQVLO7I.mjs} +7 -4
  35. package/dist/{loaded-HMSPJUZM.mjs → loaded-JGRO7BH7.mjs} +7 -4
  36. package/dist/{loaded-EV34KGYJ.mjs → loaded-KKVJE5KH.mjs} +7 -4
  37. package/dist/no-external.css +870 -475
  38. package/dist/no-external.d.mts +4 -2
  39. package/dist/no-external.d.ts +4 -2
  40. package/dist/no-external.js +3412 -2351
  41. package/dist/no-external.mjs +22 -11
  42. package/dist/rsc.css +28 -27
  43. package/dist/rsc.d.mts +2 -2
  44. package/dist/rsc.d.ts +2 -2
  45. package/dist/rsc.js +146 -83
  46. package/dist/rsc.mjs +6 -4
  47. package/dist/walk-tree-CRRDqx6_.d.mts +29 -0
  48. package/dist/walk-tree-CS7sEpfG.d.ts +29 -0
  49. package/package.json +9 -4
  50. package/dist/chunk-WUWXFMEM.mjs +0 -11
@@ -1,25 +1,28 @@
1
1
  import {
2
2
  PuckRichText
3
- } from "./chunk-R6CVX2IY.mjs";
3
+ } from "./chunk-V5I7CVLT.mjs";
4
4
  import {
5
5
  EditorInner,
6
6
  LoadedRichTextMenu
7
- } from "./chunk-FNWOH4R6.mjs";
8
- import "./chunk-WUWXFMEM.mjs";
9
- import "./chunk-K3V4LVUL.mjs";
10
- import "./chunk-GQKMOYLG.mjs";
11
- import "./chunk-DNF2EMM4.mjs";
12
- import "./chunk-3QHWXJEI.mjs";
7
+ } from "./chunk-V2IQTPPK.mjs";
8
+ import "./chunk-AOEDIUVK.mjs";
9
+ import "./chunk-6KNQXLQR.mjs";
10
+ import "./chunk-GVKHZNTR.mjs";
11
+ import "./chunk-MEL7FUSF.mjs";
12
+ import "./chunk-3VQHXASI.mjs";
13
13
  import {
14
14
  useAppStore,
15
15
  useAppStoreApi
16
- } from "./chunk-7KY6RHEY.mjs";
17
- import "./chunk-DJSH5REF.mjs";
16
+ } from "./chunk-K562SEXI.mjs";
17
+ import "./chunk-KN3XDS7U.mjs";
18
+ import "./chunk-REWRIUGR.mjs";
19
+ import "./chunk-Y2EFNT5P.mjs";
20
+ import "./chunk-Q3TJ2VYO.mjs";
18
21
  import {
19
22
  __spreadProps,
20
23
  __spreadValues,
21
24
  init_react_import
22
- } from "./chunk-DCSQEDMK.mjs";
25
+ } from "./chunk-M6W7YEVX.mjs";
23
26
 
24
27
  // components/RichTextEditor/components/Editor.tsx
25
28
  init_react_import();
@@ -301,46 +301,46 @@
301
301
  }
302
302
 
303
303
  /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data */
304
- ._RichTextEditor_1elol_1 .ProseMirror {
304
+ ._RichTextEditor_z25h4_1 .ProseMirror {
305
305
  white-space: pre-wrap;
306
306
  word-wrap: break-word;
307
307
  cursor: text;
308
308
  outline: none;
309
309
  position: relative;
310
310
  }
311
- ._RichTextEditor_1elol_1 .rich-text * {
311
+ ._RichTextEditor_z25h4_1 .rich-text * {
312
312
  white-space: pre-wrap;
313
313
  user-select: auto;
314
314
  -webkit-user-select: auto;
315
315
  }
316
- ._RichTextEditor_1elol_1 .rich-text blockquote {
316
+ ._RichTextEditor_z25h4_1 .rich-text blockquote {
317
317
  margin: 1em 0;
318
318
  padding: 0 1em;
319
319
  border-left: 4px solid var(--puck-color-grey-09);
320
320
  }
321
- ._RichTextEditor_1elol_1 .rich-text code {
321
+ ._RichTextEditor_z25h4_1 .rich-text code {
322
322
  background-color: var(--puck-color-grey-11);
323
323
  padding: 4px 8px;
324
324
  border-radius: 4px;
325
325
  }
326
- ._RichTextEditor_1elol_1 .rich-text p:empty::before {
326
+ ._RichTextEditor_z25h4_1 .rich-text p:empty::before {
327
327
  content: "\a0";
328
328
  }
329
- ._RichTextEditor_1elol_1 .rich-text pre code {
329
+ ._RichTextEditor_z25h4_1 .rich-text pre code {
330
330
  display: block;
331
331
  padding: 8px 12px;
332
332
  }
333
- ._RichTextEditor_1elol_1 .rich-text > *:first-child,
334
- ._RichTextEditor_1elol_1 .ProseMirror > *:first-child,
335
- ._RichTextEditor_1elol_1 .rich-text * p:first-of-type {
333
+ ._RichTextEditor_z25h4_1 .rich-text > *:first-child,
334
+ ._RichTextEditor_z25h4_1 .ProseMirror > *:first-child,
335
+ ._RichTextEditor_z25h4_1 .rich-text * p:first-of-type {
336
336
  margin-top: 0;
337
337
  }
338
- ._RichTextEditor_1elol_1 .rich-text > *:last-child,
339
- ._RichTextEditor_1elol_1 .ProseMirror > *:last-child,
340
- ._RichTextEditor_1elol_1 .rich-text * p:last-of-type {
338
+ ._RichTextEditor_z25h4_1 .rich-text > *:last-child,
339
+ ._RichTextEditor_z25h4_1 .ProseMirror > *:last-child,
340
+ ._RichTextEditor_z25h4_1 .rich-text * p:last-of-type {
341
341
  margin-bottom: 0;
342
342
  }
343
- ._RichTextEditor--editor_1elol_50 {
343
+ ._RichTextEditor--editor_z25h4_50 {
344
344
  background: var(--puck-color-white);
345
345
  border-width: 1px;
346
346
  border-style: solid;
@@ -352,52 +352,53 @@
352
352
  font-family: inherit;
353
353
  font-size: var(--puck-font-size-xxs);
354
354
  resize: vertical;
355
+ text-align: initial;
355
356
  transition: border-color 50ms ease-in;
356
357
  width: 100%;
357
358
  max-width: 100%;
358
359
  min-height: 128px;
359
360
  }
360
- ._RichTextEditor--editor_1elol_50 .rich-text {
361
+ ._RichTextEditor--editor_z25h4_50 .rich-text {
361
362
  flex-grow: 1;
362
363
  }
363
- ._RichTextEditor--editor_1elol_50 .rich-text:not(:has(.ProseMirror)),
364
- ._RichTextEditor--editor_1elol_50 .rich-text .ProseMirror {
364
+ ._RichTextEditor--editor_z25h4_50 .rich-text:not(:has(.ProseMirror)),
365
+ ._RichTextEditor--editor_z25h4_50 .rich-text .ProseMirror {
365
366
  height: 100%;
366
367
  padding: 12px 15px;
367
368
  }
368
- ._RichTextEditor--editor_1elol_50 .rich-text ul,
369
- ._RichTextEditor--editor_1elol_50 .rich-text ol {
369
+ ._RichTextEditor--editor_z25h4_50 .rich-text ul,
370
+ ._RichTextEditor--editor_z25h4_50 .rich-text ol {
370
371
  padding-left: 24px;
371
372
  }
372
- ._RichTextEditor--editor_1elol_50 .rich-text li {
373
+ ._RichTextEditor--editor_z25h4_50 .rich-text li {
373
374
  line-height: 1.5;
374
375
  }
375
- ._RichTextEditor--editor_1elol_50 .rich-text p {
376
+ ._RichTextEditor--editor_z25h4_50 .rich-text p {
376
377
  margin-block: 12px;
377
378
  }
378
- ._RichTextEditor--editor_1elol_50 .rich-text ul {
379
+ ._RichTextEditor--editor_z25h4_50 .rich-text ul {
379
380
  list-style: disc;
380
381
  }
381
- ._RichTextEditor--editor_1elol_50 .rich-text ol {
382
+ ._RichTextEditor--editor_z25h4_50 .rich-text ol {
382
383
  list-style: decimal;
383
384
  }
384
- ._RichTextEditor--editor_1elol_50:focus-within {
385
+ ._RichTextEditor--editor_z25h4_50:focus-within {
385
386
  border-color: var(--puck-color-grey-05);
386
387
  outline: 2px solid var(--puck-color-azure-05);
387
388
  transition: none;
388
389
  }
389
- ._RichTextEditor--editor_1elol_50._RichTextEditor--disabled_1elol_106 {
390
+ ._RichTextEditor--editor_z25h4_50._RichTextEditor--disabled_z25h4_107 {
390
391
  background: var(--puck-color-grey-11);
391
392
  }
392
- ._RichTextEditor_1elol_1:not(:focus-within):not(._RichTextEditor--isActive_1elol_110) .ProseMirror ::selection {
393
+ ._RichTextEditor_z25h4_1:not(:focus-within):not(._RichTextEditor--isActive_z25h4_111) .ProseMirror ::selection {
393
394
  background-color: transparent;
394
395
  }
395
- ._RichTextEditor-menu_1elol_116 {
396
+ ._RichTextEditor-menu_z25h4_117 {
396
397
  border-bottom: 1px solid var(--puck-color-grey-10);
397
398
  position: sticky;
398
399
  top: 0;
399
400
  z-index: 1;
400
401
  }
401
- ._RichTextEditor--disabled_1elol_106 ._RichTextEditor-menu_1elol_116 {
402
+ ._RichTextEditor--disabled_z25h4_107 ._RichTextEditor-menu_z25h4_117 {
402
403
  border-bottom: 1px solid var(--puck-color-grey-09);
403
404
  }
@@ -1,44 +1,44 @@
1
1
  /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data */
2
- ._RichTextEditor_1elol_1 .ProseMirror {
2
+ ._RichTextEditor_z25h4_1 .ProseMirror {
3
3
  white-space: pre-wrap;
4
4
  word-wrap: break-word;
5
5
  cursor: text;
6
6
  outline: none;
7
7
  position: relative;
8
8
  }
9
- ._RichTextEditor_1elol_1 .rich-text * {
9
+ ._RichTextEditor_z25h4_1 .rich-text * {
10
10
  white-space: pre-wrap;
11
11
  user-select: auto;
12
12
  -webkit-user-select: auto;
13
13
  }
14
- ._RichTextEditor_1elol_1 .rich-text blockquote {
14
+ ._RichTextEditor_z25h4_1 .rich-text blockquote {
15
15
  margin: 1em 0;
16
16
  padding: 0 1em;
17
17
  border-left: 4px solid var(--puck-color-grey-09);
18
18
  }
19
- ._RichTextEditor_1elol_1 .rich-text code {
19
+ ._RichTextEditor_z25h4_1 .rich-text code {
20
20
  background-color: var(--puck-color-grey-11);
21
21
  padding: 4px 8px;
22
22
  border-radius: 4px;
23
23
  }
24
- ._RichTextEditor_1elol_1 .rich-text p:empty::before {
24
+ ._RichTextEditor_z25h4_1 .rich-text p:empty::before {
25
25
  content: "\a0";
26
26
  }
27
- ._RichTextEditor_1elol_1 .rich-text pre code {
27
+ ._RichTextEditor_z25h4_1 .rich-text pre code {
28
28
  display: block;
29
29
  padding: 8px 12px;
30
30
  }
31
- ._RichTextEditor_1elol_1 .rich-text > *:first-child,
32
- ._RichTextEditor_1elol_1 .ProseMirror > *:first-child,
33
- ._RichTextEditor_1elol_1 .rich-text * p:first-of-type {
31
+ ._RichTextEditor_z25h4_1 .rich-text > *:first-child,
32
+ ._RichTextEditor_z25h4_1 .ProseMirror > *:first-child,
33
+ ._RichTextEditor_z25h4_1 .rich-text * p:first-of-type {
34
34
  margin-top: 0;
35
35
  }
36
- ._RichTextEditor_1elol_1 .rich-text > *:last-child,
37
- ._RichTextEditor_1elol_1 .ProseMirror > *:last-child,
38
- ._RichTextEditor_1elol_1 .rich-text * p:last-of-type {
36
+ ._RichTextEditor_z25h4_1 .rich-text > *:last-child,
37
+ ._RichTextEditor_z25h4_1 .ProseMirror > *:last-child,
38
+ ._RichTextEditor_z25h4_1 .rich-text * p:last-of-type {
39
39
  margin-bottom: 0;
40
40
  }
41
- ._RichTextEditor--editor_1elol_50 {
41
+ ._RichTextEditor--editor_z25h4_50 {
42
42
  background: var(--puck-color-white);
43
43
  border-width: 1px;
44
44
  border-style: solid;
@@ -50,52 +50,53 @@
50
50
  font-family: inherit;
51
51
  font-size: var(--puck-font-size-xxs);
52
52
  resize: vertical;
53
+ text-align: initial;
53
54
  transition: border-color 50ms ease-in;
54
55
  width: 100%;
55
56
  max-width: 100%;
56
57
  min-height: 128px;
57
58
  }
58
- ._RichTextEditor--editor_1elol_50 .rich-text {
59
+ ._RichTextEditor--editor_z25h4_50 .rich-text {
59
60
  flex-grow: 1;
60
61
  }
61
- ._RichTextEditor--editor_1elol_50 .rich-text:not(:has(.ProseMirror)),
62
- ._RichTextEditor--editor_1elol_50 .rich-text .ProseMirror {
62
+ ._RichTextEditor--editor_z25h4_50 .rich-text:not(:has(.ProseMirror)),
63
+ ._RichTextEditor--editor_z25h4_50 .rich-text .ProseMirror {
63
64
  height: 100%;
64
65
  padding: 12px 15px;
65
66
  }
66
- ._RichTextEditor--editor_1elol_50 .rich-text ul,
67
- ._RichTextEditor--editor_1elol_50 .rich-text ol {
67
+ ._RichTextEditor--editor_z25h4_50 .rich-text ul,
68
+ ._RichTextEditor--editor_z25h4_50 .rich-text ol {
68
69
  padding-left: 24px;
69
70
  }
70
- ._RichTextEditor--editor_1elol_50 .rich-text li {
71
+ ._RichTextEditor--editor_z25h4_50 .rich-text li {
71
72
  line-height: 1.5;
72
73
  }
73
- ._RichTextEditor--editor_1elol_50 .rich-text p {
74
+ ._RichTextEditor--editor_z25h4_50 .rich-text p {
74
75
  margin-block: 12px;
75
76
  }
76
- ._RichTextEditor--editor_1elol_50 .rich-text ul {
77
+ ._RichTextEditor--editor_z25h4_50 .rich-text ul {
77
78
  list-style: disc;
78
79
  }
79
- ._RichTextEditor--editor_1elol_50 .rich-text ol {
80
+ ._RichTextEditor--editor_z25h4_50 .rich-text ol {
80
81
  list-style: decimal;
81
82
  }
82
- ._RichTextEditor--editor_1elol_50:focus-within {
83
+ ._RichTextEditor--editor_z25h4_50:focus-within {
83
84
  border-color: var(--puck-color-grey-05);
84
85
  outline: 2px solid var(--puck-color-azure-05);
85
86
  transition: none;
86
87
  }
87
- ._RichTextEditor--editor_1elol_50._RichTextEditor--disabled_1elol_106 {
88
+ ._RichTextEditor--editor_z25h4_50._RichTextEditor--disabled_z25h4_107 {
88
89
  background: var(--puck-color-grey-11);
89
90
  }
90
- ._RichTextEditor_1elol_1:not(:focus-within):not(._RichTextEditor--isActive_1elol_110) .ProseMirror ::selection {
91
+ ._RichTextEditor_z25h4_1:not(:focus-within):not(._RichTextEditor--isActive_z25h4_111) .ProseMirror ::selection {
91
92
  background-color: transparent;
92
93
  }
93
- ._RichTextEditor-menu_1elol_116 {
94
+ ._RichTextEditor-menu_z25h4_117 {
94
95
  border-bottom: 1px solid var(--puck-color-grey-10);
95
96
  position: sticky;
96
97
  top: 0;
97
98
  z-index: 1;
98
99
  }
99
- ._RichTextEditor--disabled_1elol_106 ._RichTextEditor-menu_1elol_116 {
100
+ ._RichTextEditor--disabled_z25h4_107 ._RichTextEditor-menu_z25h4_117 {
100
101
  border-bottom: 1px solid var(--puck-color-grey-09);
101
102
  }
@@ -1,13 +1,15 @@
1
1
  import {
2
2
  PuckRichText
3
- } from "./chunk-R6CVX2IY.mjs";
3
+ } from "./chunk-V5I7CVLT.mjs";
4
4
  import {
5
5
  styles_module_default
6
- } from "./chunk-WUWXFMEM.mjs";
6
+ } from "./chunk-AOEDIUVK.mjs";
7
+ import {
8
+ get_class_name_factory_default
9
+ } from "./chunk-Y2EFNT5P.mjs";
7
10
  import {
8
- get_class_name_factory_default,
9
11
  init_react_import
10
- } from "./chunk-DCSQEDMK.mjs";
12
+ } from "./chunk-M6W7YEVX.mjs";
11
13
 
12
14
  // components/RichTextEditor/components/Render.tsx
13
15
  init_react_import();
@@ -1,4 +1,4 @@
1
- import { ReactElement, CSSProperties, ReactNode, ElementType, JSX } from 'react';
1
+ import { ReactElement, CSSProperties, ReactNode, ElementType, Ref, JSX } from 'react';
2
2
  import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
3
3
  import { BlockquoteOptions } from '@tiptap/extension-blockquote';
4
4
  import { BoldOptions } from '@tiptap/extension-bold';
@@ -347,6 +347,7 @@ type DropZoneProps = {
347
347
  className?: string;
348
348
  collisionAxis?: DragAxis;
349
349
  as?: ElementType;
350
+ ref?: Ref<any>;
350
351
  };
351
352
 
352
353
  type PuckContext = {
@@ -396,7 +397,7 @@ type SlotComponent = (props?: Omit<DropZoneProps, "zone">) => ReactNode;
396
397
  type PuckComponent<Props> = (props: WithId<WithPuckProps<{
397
398
  [K in keyof Props]: WithDeepSlots<Props[K], SlotComponent>;
398
399
  }>>) => JSX.Element;
399
- type ResolveDataTrigger = "insert" | "replace" | "load" | "force";
400
+ type ResolveDataTrigger = "insert" | "replace" | "load" | "force" | "move";
400
401
  type WithPartialProps<T, Props extends DefaultComponentProps> = Omit<T, "props"> & {
401
402
  props?: Partial<Props>;
402
403
  };
@@ -428,6 +429,7 @@ UserField extends BaseField = {}> = {
428
429
  lastData: DataShape | null;
429
430
  metadata: ComponentMetadata;
430
431
  trigger: ResolveDataTrigger;
432
+ parent: ComponentData | null;
431
433
  }) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
432
434
  resolvePermissions?: (data: DataShape, params: {
433
435
  changed: Partial<Record<keyof FieldProps, boolean> & {
@@ -531,6 +533,7 @@ interface FieldMetadata extends Metadata {
531
533
  type ItemWithId = {
532
534
  _arrayId: string;
533
535
  _originalIndex: number;
536
+ _currentIndex: number;
534
537
  };
535
538
  type ArrayState = {
536
539
  items: ItemWithId[];
@@ -541,6 +544,7 @@ type UiState = {
541
544
  rightSideBarVisible: boolean;
542
545
  leftSideBarWidth?: number | null;
543
546
  rightSideBarWidth?: number | null;
547
+ mobilePanelExpanded?: boolean;
544
548
  itemSelector: ItemSelector | null;
545
549
  arrayState: Record<string, ArrayState | undefined>;
546
550
  previewMode: "interactive" | "edit";
@@ -553,7 +557,7 @@ type UiState = {
553
557
  isDragging: boolean;
554
558
  viewports: {
555
559
  current: {
556
- width: number;
560
+ width: number | "100%";
557
561
  height: number | "auto";
558
562
  };
559
563
  controlsVisible: boolean;
@@ -563,6 +567,9 @@ type UiState = {
563
567
  focus?: string | null;
564
568
  metadata?: Record<string, any>;
565
569
  };
570
+ plugin: {
571
+ current: string | null;
572
+ };
566
573
  };
567
574
  type AppState<UserData extends Data = Data> = {
568
575
  data: UserData;
@@ -606,6 +613,15 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
606
613
  type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
607
614
  never
608
615
  ] ? False : True;
616
+ type RenderFunc<Props extends {
617
+ [key: string]: any;
618
+ } = {
619
+ children: ReactNode;
620
+ }> = (props: Props) => ReactElement;
621
+ type PluginInternal = Plugin & {
622
+ mobileOnly?: boolean;
623
+ desktopOnly?: boolean;
624
+ };
609
625
 
610
626
  type MapFnParams<ThisField = Field> = {
611
627
  value: any;
@@ -629,11 +645,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
629
645
  [Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
630
646
  }>;
631
647
 
632
- type RenderFunc<Props extends {
633
- [key: string]: any;
634
- } = {
635
- children: ReactNode;
636
- }> = (props: Props) => ReactElement;
637
648
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
638
649
  type OverrideKey = (typeof overrideKeys)[number];
639
650
  type OverridesGeneric<Shape extends {
@@ -705,7 +716,7 @@ type DragAxis = "dynamic" | "y" | "x";
705
716
 
706
717
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
707
718
  type Viewport = {
708
- width: number;
719
+ width: number | "100%";
709
720
  height?: number | "auto";
710
721
  label?: string;
711
722
  icon?: iconTypes | ReactNode;
@@ -725,8 +736,13 @@ type IframeConfig = {
725
736
  };
726
737
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
727
738
  type Plugin<UserConfig extends Config = Config> = {
739
+ name?: string;
740
+ label?: string;
741
+ icon?: ReactNode;
742
+ render?: () => ReactElement;
728
743
  overrides?: Partial<Overrides<UserConfig>>;
729
744
  fieldTransforms?: FieldTransforms<UserConfig>;
745
+ mobilePanelHeight?: "toggle" | "min-content";
730
746
  };
731
747
  type History<D = any> = {
732
748
  state: D;
@@ -819,30 +835,4 @@ type PuckAction = {
819
835
  recordHistory?: boolean;
820
836
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
821
837
 
822
- type MigrationOptions<UserConfig extends Config> = {
823
- migrateDynamicZonesForComponent?: {
824
- [ComponentName in keyof UserConfig["components"]]: (props: WithId<UserGenerics<UserConfig>["UserProps"][ComponentName]>, zones: Record<string, Content>) => ComponentData["props"];
825
- };
826
- };
827
- declare function migrate<UserConfig extends Config = Config>(data: Data, config?: UserConfig, migrationOptions?: MigrationOptions<UserConfig>): Data;
828
-
829
- type PropTransform<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
830
- [ComponentName in keyof Components]: (props: Components[ComponentName] & {
831
- [key: string]: any;
832
- }) => Components[ComponentName];
833
- } & {
834
- root: (props: RootProps & {
835
- [key: string]: any;
836
- }) => RootProps;
837
- }>;
838
- declare function transformProps<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Components, RootProps>, config?: Config): Data;
839
-
840
- declare function resolveAllData<Components extends DefaultComponents = DefaultComponents, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Components, RootProps>>;
841
-
842
- type WalkTreeOptions = {
843
- parentId: string;
844
- propName: string;
845
- };
846
- declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
847
-
848
- export { type RootData as $, type AppState as A, type FieldRenderFunctions as B, type Config as C, type DropZoneProps as D, type ItemWithId as E, type Fields as F, type ArrayState as G, type History as H, type IframeConfig as I, type SlotComponent as J, type PuckComponent as K, type ComponentConfigExtensions as L, type Metadata as M, type RootConfig as N, type Overrides as O, type Permissions as P, type DefaultComponents as Q, type RootDataWithProps as R, type Slot as S, type ExtractConfigParams as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ConfigParams as X, type ComponentConfigParams as Y, type BaseData as Z, type RootDataWithoutProps as _, type ComponentData as a, type ComponentDataOptionalId as a0, type MappedItem as a1, type ComponentDataMap as a2, type Content as a3, type PuckMetadata as a4, type ComponentMetadata as a5, type FieldMetadata as a6, type BaseField as a7, type TextField as a8, type NumberField as a9, type TextareaField as aa, type SelectField as ab, type RadioField as ac, type ArrayField as ad, type ObjectField as ae, type Adaptor as af, type ExternalFieldWithAdaptor as ag, type CacheOpts as ah, type ExternalField as ai, type CustomFieldRender as aj, type CustomField as ak, type SlotField as al, type PuckContext as am, type DefaultRootFieldProps as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type DefaultComponentProps as aq, type WithId as ar, type WithPuckProps as as, type AsFieldProps as at, type WithChildren as au, type ExtractField as av, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldTransforms as g, type RichtextField as h, type Field as i, type FieldProps as j, type Data as k, type OnAction as l, migrate as m, type InitialHistory as n, type ItemSelector as o, type RichText as p, type Direction as q, resolveAllData as r, type DragAxis as s, transformProps as t, type Viewport as u, type FieldTransformFnParams as v, walkTree as w, type FieldTransformFn as x, overrideKeys as y, type OverrideKey as z };
838
+ export { type ComponentConfigParams as $, type AppState as A, type FieldTransformFnParams as B, type Config as C, type Data as D, type FieldTransformFn as E, type Fields as F, overrideKeys as G, type History as H, type IframeConfig as I, type OverrideKey as J, type FieldRenderFunctions as K, type ItemWithId as L, type Metadata as M, type ArrayState as N, type OnAction as O, type PrivateAppState as P, type SlotComponent as Q, type RootData as R, type Slot as S, type PuckComponent as T, type UserGenerics as U, type Viewports as V, type WithId as W, type ComponentConfigExtensions as X, type RootConfig as Y, type ExtractConfigParams as Z, type ConfigParams as _, type PuckAction as a, type BaseData as a0, type RootDataWithoutProps as a1, type ComponentDataOptionalId as a2, type MappedItem as a3, type ComponentDataMap as a4, type PuckMetadata as a5, type ComponentMetadata as a6, type FieldMetadata as a7, type BaseField as a8, type TextField as a9, type NumberField as aa, type TextareaField as ab, type SelectField as ac, type RadioField as ad, type ArrayField as ae, type ObjectField as af, type Adaptor as ag, type ExternalFieldWithAdaptor as ah, type CacheOpts as ai, type ExternalField as aj, type CustomFieldRender as ak, type CustomField as al, type SlotField as am, type PuckContext as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type WithPuckProps as aq, type AsFieldProps as ar, type WithChildren as as, type ExtractField as at, type Content as b, type ComponentData as c, type DefaultComponents as d, type DefaultComponentProps as e, type DefaultRootFieldProps as f, type Permissions as g, type RootDataWithProps as h, type ResolveDataTrigger as i, type Plugin as j, type Overrides as k, type UiState as l, type ComponentConfig as m, type FieldTransforms as n, type RichtextField as o, type Field as p, type FieldProps as q, type DropZoneProps as r, type InitialHistory as s, type ItemSelector as t, type PluginInternal as u, type WithSlotProps as v, type RichText as w, type Direction as x, type DragAxis as y, type Viewport as z };
@@ -1,4 +1,4 @@
1
- import { ReactElement, CSSProperties, ReactNode, ElementType, JSX } from 'react';
1
+ import { ReactElement, CSSProperties, ReactNode, ElementType, Ref, JSX } from 'react';
2
2
  import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
3
3
  import { BlockquoteOptions } from '@tiptap/extension-blockquote';
4
4
  import { BoldOptions } from '@tiptap/extension-bold';
@@ -347,6 +347,7 @@ type DropZoneProps = {
347
347
  className?: string;
348
348
  collisionAxis?: DragAxis;
349
349
  as?: ElementType;
350
+ ref?: Ref<any>;
350
351
  };
351
352
 
352
353
  type PuckContext = {
@@ -396,7 +397,7 @@ type SlotComponent = (props?: Omit<DropZoneProps, "zone">) => ReactNode;
396
397
  type PuckComponent<Props> = (props: WithId<WithPuckProps<{
397
398
  [K in keyof Props]: WithDeepSlots<Props[K], SlotComponent>;
398
399
  }>>) => JSX.Element;
399
- type ResolveDataTrigger = "insert" | "replace" | "load" | "force";
400
+ type ResolveDataTrigger = "insert" | "replace" | "load" | "force" | "move";
400
401
  type WithPartialProps<T, Props extends DefaultComponentProps> = Omit<T, "props"> & {
401
402
  props?: Partial<Props>;
402
403
  };
@@ -428,6 +429,7 @@ UserField extends BaseField = {}> = {
428
429
  lastData: DataShape | null;
429
430
  metadata: ComponentMetadata;
430
431
  trigger: ResolveDataTrigger;
432
+ parent: ComponentData | null;
431
433
  }) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
432
434
  resolvePermissions?: (data: DataShape, params: {
433
435
  changed: Partial<Record<keyof FieldProps, boolean> & {
@@ -531,6 +533,7 @@ interface FieldMetadata extends Metadata {
531
533
  type ItemWithId = {
532
534
  _arrayId: string;
533
535
  _originalIndex: number;
536
+ _currentIndex: number;
534
537
  };
535
538
  type ArrayState = {
536
539
  items: ItemWithId[];
@@ -541,6 +544,7 @@ type UiState = {
541
544
  rightSideBarVisible: boolean;
542
545
  leftSideBarWidth?: number | null;
543
546
  rightSideBarWidth?: number | null;
547
+ mobilePanelExpanded?: boolean;
544
548
  itemSelector: ItemSelector | null;
545
549
  arrayState: Record<string, ArrayState | undefined>;
546
550
  previewMode: "interactive" | "edit";
@@ -553,7 +557,7 @@ type UiState = {
553
557
  isDragging: boolean;
554
558
  viewports: {
555
559
  current: {
556
- width: number;
560
+ width: number | "100%";
557
561
  height: number | "auto";
558
562
  };
559
563
  controlsVisible: boolean;
@@ -563,6 +567,9 @@ type UiState = {
563
567
  focus?: string | null;
564
568
  metadata?: Record<string, any>;
565
569
  };
570
+ plugin: {
571
+ current: string | null;
572
+ };
566
573
  };
567
574
  type AppState<UserData extends Data = Data> = {
568
575
  data: UserData;
@@ -606,6 +613,15 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
606
613
  type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
607
614
  never
608
615
  ] ? False : True;
616
+ type RenderFunc<Props extends {
617
+ [key: string]: any;
618
+ } = {
619
+ children: ReactNode;
620
+ }> = (props: Props) => ReactElement;
621
+ type PluginInternal = Plugin & {
622
+ mobileOnly?: boolean;
623
+ desktopOnly?: boolean;
624
+ };
609
625
 
610
626
  type MapFnParams<ThisField = Field> = {
611
627
  value: any;
@@ -629,11 +645,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
629
645
  [Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
630
646
  }>;
631
647
 
632
- type RenderFunc<Props extends {
633
- [key: string]: any;
634
- } = {
635
- children: ReactNode;
636
- }> = (props: Props) => ReactElement;
637
648
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
638
649
  type OverrideKey = (typeof overrideKeys)[number];
639
650
  type OverridesGeneric<Shape extends {
@@ -705,7 +716,7 @@ type DragAxis = "dynamic" | "y" | "x";
705
716
 
706
717
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
707
718
  type Viewport = {
708
- width: number;
719
+ width: number | "100%";
709
720
  height?: number | "auto";
710
721
  label?: string;
711
722
  icon?: iconTypes | ReactNode;
@@ -725,8 +736,13 @@ type IframeConfig = {
725
736
  };
726
737
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
727
738
  type Plugin<UserConfig extends Config = Config> = {
739
+ name?: string;
740
+ label?: string;
741
+ icon?: ReactNode;
742
+ render?: () => ReactElement;
728
743
  overrides?: Partial<Overrides<UserConfig>>;
729
744
  fieldTransforms?: FieldTransforms<UserConfig>;
745
+ mobilePanelHeight?: "toggle" | "min-content";
730
746
  };
731
747
  type History<D = any> = {
732
748
  state: D;
@@ -819,30 +835,4 @@ type PuckAction = {
819
835
  recordHistory?: boolean;
820
836
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
821
837
 
822
- type MigrationOptions<UserConfig extends Config> = {
823
- migrateDynamicZonesForComponent?: {
824
- [ComponentName in keyof UserConfig["components"]]: (props: WithId<UserGenerics<UserConfig>["UserProps"][ComponentName]>, zones: Record<string, Content>) => ComponentData["props"];
825
- };
826
- };
827
- declare function migrate<UserConfig extends Config = Config>(data: Data, config?: UserConfig, migrationOptions?: MigrationOptions<UserConfig>): Data;
828
-
829
- type PropTransform<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = DefaultRootFieldProps> = Partial<{
830
- [ComponentName in keyof Components]: (props: Components[ComponentName] & {
831
- [key: string]: any;
832
- }) => Components[ComponentName];
833
- } & {
834
- root: (props: RootProps & {
835
- [key: string]: any;
836
- }) => RootProps;
837
- }>;
838
- declare function transformProps<Components extends DefaultComponents = DefaultComponents, RootProps extends DefaultComponentProps = DefaultRootFieldProps>(data: Partial<Data>, propTransforms: PropTransform<Components, RootProps>, config?: Config): Data;
839
-
840
- declare function resolveAllData<Components extends DefaultComponents = DefaultComponents, RootProps extends Record<string, any> = DefaultRootFieldProps>(data: Partial<Data>, config: Config, metadata?: Metadata, onResolveStart?: (item: ComponentData) => void, onResolveEnd?: (item: ComponentData) => void): Promise<Data<Components, RootProps>>;
841
-
842
- type WalkTreeOptions = {
843
- parentId: string;
844
- propName: string;
845
- };
846
- declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
847
-
848
- export { type RootData as $, type AppState as A, type FieldRenderFunctions as B, type Config as C, type DropZoneProps as D, type ItemWithId as E, type Fields as F, type ArrayState as G, type History as H, type IframeConfig as I, type SlotComponent as J, type PuckComponent as K, type ComponentConfigExtensions as L, type Metadata as M, type RootConfig as N, type Overrides as O, type Permissions as P, type DefaultComponents as Q, type RootDataWithProps as R, type Slot as S, type ExtractConfigParams as T, type UserGenerics as U, type Viewports as V, type WithSlotProps as W, type ConfigParams as X, type ComponentConfigParams as Y, type BaseData as Z, type RootDataWithoutProps as _, type ComponentData as a, type ComponentDataOptionalId as a0, type MappedItem as a1, type ComponentDataMap as a2, type Content as a3, type PuckMetadata as a4, type ComponentMetadata as a5, type FieldMetadata as a6, type BaseField as a7, type TextField as a8, type NumberField as a9, type TextareaField as aa, type SelectField as ab, type RadioField as ac, type ArrayField as ad, type ObjectField as ae, type Adaptor as af, type ExternalFieldWithAdaptor as ag, type CacheOpts as ah, type ExternalField as ai, type CustomFieldRender as aj, type CustomField as ak, type SlotField as al, type PuckContext as am, type DefaultRootFieldProps as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type DefaultComponentProps as aq, type WithId as ar, type WithPuckProps as as, type AsFieldProps as at, type WithChildren as au, type ExtractField as av, type PuckAction as b, type ResolveDataTrigger as c, type Plugin as d, type UiState as e, type ComponentConfig as f, type FieldTransforms as g, type RichtextField as h, type Field as i, type FieldProps as j, type Data as k, type OnAction as l, migrate as m, type InitialHistory as n, type ItemSelector as o, type RichText as p, type Direction as q, resolveAllData as r, type DragAxis as s, transformProps as t, type Viewport as u, type FieldTransformFnParams as v, walkTree as w, type FieldTransformFn as x, overrideKeys as y, type OverrideKey as z };
838
+ export { type ComponentConfigParams as $, type AppState as A, type FieldTransformFnParams as B, type Config as C, type Data as D, type FieldTransformFn as E, type Fields as F, overrideKeys as G, type History as H, type IframeConfig as I, type OverrideKey as J, type FieldRenderFunctions as K, type ItemWithId as L, type Metadata as M, type ArrayState as N, type OnAction as O, type PrivateAppState as P, type SlotComponent as Q, type RootData as R, type Slot as S, type PuckComponent as T, type UserGenerics as U, type Viewports as V, type WithId as W, type ComponentConfigExtensions as X, type RootConfig as Y, type ExtractConfigParams as Z, type ConfigParams as _, type PuckAction as a, type BaseData as a0, type RootDataWithoutProps as a1, type ComponentDataOptionalId as a2, type MappedItem as a3, type ComponentDataMap as a4, type PuckMetadata as a5, type ComponentMetadata as a6, type FieldMetadata as a7, type BaseField as a8, type TextField as a9, type NumberField as aa, type TextareaField as ab, type SelectField as ac, type RadioField as ad, type ArrayField as ae, type ObjectField as af, type Adaptor as ag, type ExternalFieldWithAdaptor as ah, type CacheOpts as ai, type ExternalField as aj, type CustomFieldRender as ak, type CustomField as al, type SlotField as am, type PuckContext as an, type DefaultRootRenderProps as ao, type DefaultRootProps as ap, type WithPuckProps as aq, type AsFieldProps as ar, type WithChildren as as, type ExtractField as at, type Content as b, type ComponentData as c, type DefaultComponents as d, type DefaultComponentProps as e, type DefaultRootFieldProps as f, type Permissions as g, type RootDataWithProps as h, type ResolveDataTrigger as i, type Plugin as j, type Overrides as k, type UiState as l, type ComponentConfig as m, type FieldTransforms as n, type RichtextField as o, type Field as p, type FieldProps as q, type DropZoneProps as r, type InitialHistory as s, type ItemSelector as t, type PluginInternal as u, type WithSlotProps as v, type RichText as w, type Direction as x, type DragAxis as y, type Viewport as z };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  List,
3
3
  ListOrdered
4
- } from "./chunk-7KY6RHEY.mjs";
4
+ } from "./chunk-K562SEXI.mjs";
5
5
  import {
6
6
  init_react_import
7
- } from "./chunk-DCSQEDMK.mjs";
7
+ } from "./chunk-M6W7YEVX.mjs";
8
8
 
9
9
  // components/RichTextMenu/controls/ListSelect/use-options.ts
10
10
  init_react_import();