@measured/puck 0.21.0-canary.c78dc826 → 0.21.0-canary.d1e8fa71
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 → Editor-IQP25PUX.css} +28 -27
- package/dist/{Editor-N46HUQEC.mjs → Editor-L3JAAT2X.mjs} +13 -10
- package/dist/{Render-QEMDIDQC.css → Render-3OV4N4MT.css} +28 -27
- package/dist/{Render-Y567PGZ7.mjs → Render-FXZX6NFH.mjs} +6 -4
- package/dist/{walk-tree-Ja9bNCM9.d.mts → actions-tsxxcX1z.d.mts} +24 -35
- package/dist/{walk-tree-Ja9bNCM9.d.ts → actions-tsxxcX1z.d.ts} +24 -35
- package/dist/chunk-23IZFPL7.mjs +528 -0
- package/dist/{chunk-C2TVYIYC.mjs → chunk-3SDLQIUZ.mjs} +57 -43
- package/dist/chunk-45I5SDOI.mjs +134 -0
- package/dist/{chunk-DNF2EMM4.mjs → chunk-5ZZVX2Z3.mjs} +2 -2
- package/dist/chunk-AOEDIUVK.mjs +11 -0
- package/dist/{chunk-DJSH5REF.mjs → chunk-B7REOAA7.mjs} +24 -126
- package/dist/{chunk-K3V4LVUL.mjs → chunk-BXQQARCR.mjs} +14 -10
- package/dist/{chunk-TB3SSIAY.mjs → chunk-CQUAWHOK.mjs} +5224 -4509
- package/dist/{chunk-7KY6RHEY.mjs → chunk-D2SRL6YA.mjs} +101 -524
- package/dist/{chunk-GQKMOYLG.mjs → chunk-LJEGWHDD.mjs} +2 -2
- package/dist/{chunk-DCSQEDMK.mjs → chunk-M6W7YEVX.mjs} +1 -100
- package/dist/{chunk-FNWOH4R6.mjs → chunk-PBAAIKXA.mjs} +8 -6
- package/dist/{chunk-3QHWXJEI.mjs → chunk-U4VSQKO3.mjs} +2 -2
- package/dist/{chunk-R6CVX2IY.mjs → chunk-V5I7CVLT.mjs} +1 -1
- package/dist/chunk-Y2EFNT5P.mjs +108 -0
- package/dist/{full-NLUNPJWS.mjs → full-L7DWVNTZ.mjs} +10 -7
- package/dist/index-Ca6V6NQD.d.ts +118 -0
- package/dist/index-mQvUCH3C.d.mts +118 -0
- package/dist/index.css +732 -341
- package/dist/index.d.mts +29 -120
- package/dist/index.d.ts +29 -120
- package/dist/index.js +3273 -2392
- package/dist/index.mjs +22 -16
- package/dist/internal.d.mts +27 -0
- package/dist/internal.d.ts +27 -0
- package/dist/internal.js +927 -0
- package/dist/internal.mjs +13 -0
- package/dist/{loaded-HMSPJUZM.mjs → loaded-2HLHDP2G.mjs} +7 -4
- package/dist/{loaded-EV34KGYJ.mjs → loaded-LZUXYAGW.mjs} +7 -4
- package/dist/{loaded-ZXOU6S6R.mjs → loaded-UHVTB6OD.mjs} +7 -4
- package/dist/no-external.css +870 -475
- package/dist/no-external.d.mts +4 -2
- package/dist/no-external.d.ts +4 -2
- package/dist/no-external.js +3276 -2392
- package/dist/no-external.mjs +22 -11
- package/dist/rsc.css +28 -27
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +56 -29
- package/dist/rsc.mjs +6 -4
- package/dist/walk-tree-Bh85NMeo.d.ts +29 -0
- package/dist/walk-tree-CDA3K5S3.d.mts +29 -0
- package/package.json +9 -4
- package/dist/chunk-WUWXFMEM.mjs +0 -11
|
@@ -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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
326
|
+
._RichTextEditor_z25h4_1 .rich-text p:empty::before {
|
|
327
327
|
content: "\a0";
|
|
328
328
|
}
|
|
329
|
-
.
|
|
329
|
+
._RichTextEditor_z25h4_1 .rich-text pre code {
|
|
330
330
|
display: block;
|
|
331
331
|
padding: 8px 12px;
|
|
332
332
|
}
|
|
333
|
-
.
|
|
334
|
-
.
|
|
335
|
-
.
|
|
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
|
-
.
|
|
339
|
-
.
|
|
340
|
-
.
|
|
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--
|
|
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--
|
|
361
|
+
._RichTextEditor--editor_z25h4_50 .rich-text {
|
|
361
362
|
flex-grow: 1;
|
|
362
363
|
}
|
|
363
|
-
._RichTextEditor--
|
|
364
|
-
._RichTextEditor--
|
|
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--
|
|
369
|
-
._RichTextEditor--
|
|
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--
|
|
373
|
+
._RichTextEditor--editor_z25h4_50 .rich-text li {
|
|
373
374
|
line-height: 1.5;
|
|
374
375
|
}
|
|
375
|
-
._RichTextEditor--
|
|
376
|
+
._RichTextEditor--editor_z25h4_50 .rich-text p {
|
|
376
377
|
margin-block: 12px;
|
|
377
378
|
}
|
|
378
|
-
._RichTextEditor--
|
|
379
|
+
._RichTextEditor--editor_z25h4_50 .rich-text ul {
|
|
379
380
|
list-style: disc;
|
|
380
381
|
}
|
|
381
|
-
._RichTextEditor--
|
|
382
|
+
._RichTextEditor--editor_z25h4_50 .rich-text ol {
|
|
382
383
|
list-style: decimal;
|
|
383
384
|
}
|
|
384
|
-
._RichTextEditor--
|
|
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--
|
|
390
|
+
._RichTextEditor--editor_z25h4_50._RichTextEditor--disabled_z25h4_107 {
|
|
390
391
|
background: var(--puck-color-grey-11);
|
|
391
392
|
}
|
|
392
|
-
.
|
|
393
|
+
._RichTextEditor_z25h4_1:not(:focus-within):not(._RichTextEditor--isActive_z25h4_111) .ProseMirror ::selection {
|
|
393
394
|
background-color: transparent;
|
|
394
395
|
}
|
|
395
|
-
._RichTextEditor-
|
|
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--
|
|
402
|
+
._RichTextEditor--disabled_z25h4_107 ._RichTextEditor-menu_z25h4_117 {
|
|
402
403
|
border-bottom: 1px solid var(--puck-color-grey-09);
|
|
403
404
|
}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PuckRichText
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V5I7CVLT.mjs";
|
|
4
4
|
import {
|
|
5
5
|
EditorInner,
|
|
6
6
|
LoadedRichTextMenu
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-PBAAIKXA.mjs";
|
|
8
|
+
import "./chunk-AOEDIUVK.mjs";
|
|
9
|
+
import "./chunk-BXQQARCR.mjs";
|
|
10
|
+
import "./chunk-LJEGWHDD.mjs";
|
|
11
|
+
import "./chunk-5ZZVX2Z3.mjs";
|
|
12
|
+
import "./chunk-U4VSQKO3.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useAppStore,
|
|
15
15
|
useAppStoreApi
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-D2SRL6YA.mjs";
|
|
17
|
+
import "./chunk-23IZFPL7.mjs";
|
|
18
|
+
import "./chunk-45I5SDOI.mjs";
|
|
19
|
+
import "./chunk-Y2EFNT5P.mjs";
|
|
20
|
+
import "./chunk-B7REOAA7.mjs";
|
|
18
21
|
import {
|
|
19
22
|
__spreadProps,
|
|
20
23
|
__spreadValues,
|
|
21
24
|
init_react_import
|
|
22
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-M6W7YEVX.mjs";
|
|
23
26
|
|
|
24
27
|
// components/RichTextEditor/components/Editor.tsx
|
|
25
28
|
init_react_import();
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data */
|
|
2
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
24
|
+
._RichTextEditor_z25h4_1 .rich-text p:empty::before {
|
|
25
25
|
content: "\a0";
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
._RichTextEditor_z25h4_1 .rich-text pre code {
|
|
28
28
|
display: block;
|
|
29
29
|
padding: 8px 12px;
|
|
30
30
|
}
|
|
31
|
-
.
|
|
32
|
-
.
|
|
33
|
-
.
|
|
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
|
-
.
|
|
37
|
-
.
|
|
38
|
-
.
|
|
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--
|
|
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--
|
|
59
|
+
._RichTextEditor--editor_z25h4_50 .rich-text {
|
|
59
60
|
flex-grow: 1;
|
|
60
61
|
}
|
|
61
|
-
._RichTextEditor--
|
|
62
|
-
._RichTextEditor--
|
|
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--
|
|
67
|
-
._RichTextEditor--
|
|
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--
|
|
71
|
+
._RichTextEditor--editor_z25h4_50 .rich-text li {
|
|
71
72
|
line-height: 1.5;
|
|
72
73
|
}
|
|
73
|
-
._RichTextEditor--
|
|
74
|
+
._RichTextEditor--editor_z25h4_50 .rich-text p {
|
|
74
75
|
margin-block: 12px;
|
|
75
76
|
}
|
|
76
|
-
._RichTextEditor--
|
|
77
|
+
._RichTextEditor--editor_z25h4_50 .rich-text ul {
|
|
77
78
|
list-style: disc;
|
|
78
79
|
}
|
|
79
|
-
._RichTextEditor--
|
|
80
|
+
._RichTextEditor--editor_z25h4_50 .rich-text ol {
|
|
80
81
|
list-style: decimal;
|
|
81
82
|
}
|
|
82
|
-
._RichTextEditor--
|
|
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--
|
|
88
|
+
._RichTextEditor--editor_z25h4_50._RichTextEditor--disabled_z25h4_107 {
|
|
88
89
|
background: var(--puck-color-grey-11);
|
|
89
90
|
}
|
|
90
|
-
.
|
|
91
|
+
._RichTextEditor_z25h4_1:not(:focus-within):not(._RichTextEditor--isActive_z25h4_111) .ProseMirror ::selection {
|
|
91
92
|
background-color: transparent;
|
|
92
93
|
}
|
|
93
|
-
._RichTextEditor-
|
|
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--
|
|
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-
|
|
3
|
+
} from "./chunk-V5I7CVLT.mjs";
|
|
4
4
|
import {
|
|
5
5
|
styles_module_default
|
|
6
|
-
} from "./chunk-
|
|
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-
|
|
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 = {
|
|
@@ -531,6 +532,7 @@ interface FieldMetadata extends Metadata {
|
|
|
531
532
|
type ItemWithId = {
|
|
532
533
|
_arrayId: string;
|
|
533
534
|
_originalIndex: number;
|
|
535
|
+
_currentIndex: number;
|
|
534
536
|
};
|
|
535
537
|
type ArrayState = {
|
|
536
538
|
items: ItemWithId[];
|
|
@@ -541,6 +543,7 @@ type UiState = {
|
|
|
541
543
|
rightSideBarVisible: boolean;
|
|
542
544
|
leftSideBarWidth?: number | null;
|
|
543
545
|
rightSideBarWidth?: number | null;
|
|
546
|
+
mobilePanelExpanded?: boolean;
|
|
544
547
|
itemSelector: ItemSelector | null;
|
|
545
548
|
arrayState: Record<string, ArrayState | undefined>;
|
|
546
549
|
previewMode: "interactive" | "edit";
|
|
@@ -553,7 +556,7 @@ type UiState = {
|
|
|
553
556
|
isDragging: boolean;
|
|
554
557
|
viewports: {
|
|
555
558
|
current: {
|
|
556
|
-
width: number;
|
|
559
|
+
width: number | "100%";
|
|
557
560
|
height: number | "auto";
|
|
558
561
|
};
|
|
559
562
|
controlsVisible: boolean;
|
|
@@ -563,6 +566,9 @@ type UiState = {
|
|
|
563
566
|
focus?: string | null;
|
|
564
567
|
metadata?: Record<string, any>;
|
|
565
568
|
};
|
|
569
|
+
plugin: {
|
|
570
|
+
current: string | null;
|
|
571
|
+
};
|
|
566
572
|
};
|
|
567
573
|
type AppState<UserData extends Data = Data> = {
|
|
568
574
|
data: UserData;
|
|
@@ -606,6 +612,15 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
|
|
|
606
612
|
type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
|
|
607
613
|
never
|
|
608
614
|
] ? False : True;
|
|
615
|
+
type RenderFunc<Props extends {
|
|
616
|
+
[key: string]: any;
|
|
617
|
+
} = {
|
|
618
|
+
children: ReactNode;
|
|
619
|
+
}> = (props: Props) => ReactElement;
|
|
620
|
+
type PluginInternal = Plugin & {
|
|
621
|
+
mobileOnly?: boolean;
|
|
622
|
+
desktopOnly?: boolean;
|
|
623
|
+
};
|
|
609
624
|
|
|
610
625
|
type MapFnParams<ThisField = Field> = {
|
|
611
626
|
value: any;
|
|
@@ -629,11 +644,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
|
|
|
629
644
|
[Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
|
|
630
645
|
}>;
|
|
631
646
|
|
|
632
|
-
type RenderFunc<Props extends {
|
|
633
|
-
[key: string]: any;
|
|
634
|
-
} = {
|
|
635
|
-
children: ReactNode;
|
|
636
|
-
}> = (props: Props) => ReactElement;
|
|
637
647
|
declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
|
|
638
648
|
type OverrideKey = (typeof overrideKeys)[number];
|
|
639
649
|
type OverridesGeneric<Shape extends {
|
|
@@ -705,7 +715,7 @@ type DragAxis = "dynamic" | "y" | "x";
|
|
|
705
715
|
|
|
706
716
|
type iconTypes = "Smartphone" | "Monitor" | "Tablet";
|
|
707
717
|
type Viewport = {
|
|
708
|
-
width: number;
|
|
718
|
+
width: number | "100%";
|
|
709
719
|
height?: number | "auto";
|
|
710
720
|
label?: string;
|
|
711
721
|
icon?: iconTypes | ReactNode;
|
|
@@ -725,8 +735,13 @@ type IframeConfig = {
|
|
|
725
735
|
};
|
|
726
736
|
type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
|
|
727
737
|
type Plugin<UserConfig extends Config = Config> = {
|
|
738
|
+
name?: string;
|
|
739
|
+
label?: string;
|
|
740
|
+
icon?: ReactNode;
|
|
741
|
+
render?: () => ReactElement;
|
|
728
742
|
overrides?: Partial<Overrides<UserConfig>>;
|
|
729
743
|
fieldTransforms?: FieldTransforms<UserConfig>;
|
|
744
|
+
mobilePanelHeight?: "toggle" | "min-content";
|
|
730
745
|
};
|
|
731
746
|
type History<D = any> = {
|
|
732
747
|
state: D;
|
|
@@ -819,30 +834,4 @@ type PuckAction = {
|
|
|
819
834
|
recordHistory?: boolean;
|
|
820
835
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
821
836
|
|
|
822
|
-
type
|
|
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 };
|
|
837
|
+
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 = {
|
|
@@ -531,6 +532,7 @@ interface FieldMetadata extends Metadata {
|
|
|
531
532
|
type ItemWithId = {
|
|
532
533
|
_arrayId: string;
|
|
533
534
|
_originalIndex: number;
|
|
535
|
+
_currentIndex: number;
|
|
534
536
|
};
|
|
535
537
|
type ArrayState = {
|
|
536
538
|
items: ItemWithId[];
|
|
@@ -541,6 +543,7 @@ type UiState = {
|
|
|
541
543
|
rightSideBarVisible: boolean;
|
|
542
544
|
leftSideBarWidth?: number | null;
|
|
543
545
|
rightSideBarWidth?: number | null;
|
|
546
|
+
mobilePanelExpanded?: boolean;
|
|
544
547
|
itemSelector: ItemSelector | null;
|
|
545
548
|
arrayState: Record<string, ArrayState | undefined>;
|
|
546
549
|
previewMode: "interactive" | "edit";
|
|
@@ -553,7 +556,7 @@ type UiState = {
|
|
|
553
556
|
isDragging: boolean;
|
|
554
557
|
viewports: {
|
|
555
558
|
current: {
|
|
556
|
-
width: number;
|
|
559
|
+
width: number | "100%";
|
|
557
560
|
height: number | "auto";
|
|
558
561
|
};
|
|
559
562
|
controlsVisible: boolean;
|
|
@@ -563,6 +566,9 @@ type UiState = {
|
|
|
563
566
|
focus?: string | null;
|
|
564
567
|
metadata?: Record<string, any>;
|
|
565
568
|
};
|
|
569
|
+
plugin: {
|
|
570
|
+
current: string | null;
|
|
571
|
+
};
|
|
566
572
|
};
|
|
567
573
|
type AppState<UserData extends Data = Data> = {
|
|
568
574
|
data: UserData;
|
|
@@ -606,6 +612,15 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
|
|
|
606
612
|
type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
|
|
607
613
|
never
|
|
608
614
|
] ? False : True;
|
|
615
|
+
type RenderFunc<Props extends {
|
|
616
|
+
[key: string]: any;
|
|
617
|
+
} = {
|
|
618
|
+
children: ReactNode;
|
|
619
|
+
}> = (props: Props) => ReactElement;
|
|
620
|
+
type PluginInternal = Plugin & {
|
|
621
|
+
mobileOnly?: boolean;
|
|
622
|
+
desktopOnly?: boolean;
|
|
623
|
+
};
|
|
609
624
|
|
|
610
625
|
type MapFnParams<ThisField = Field> = {
|
|
611
626
|
value: any;
|
|
@@ -629,11 +644,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
|
|
|
629
644
|
[Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
|
|
630
645
|
}>;
|
|
631
646
|
|
|
632
|
-
type RenderFunc<Props extends {
|
|
633
|
-
[key: string]: any;
|
|
634
|
-
} = {
|
|
635
|
-
children: ReactNode;
|
|
636
|
-
}> = (props: Props) => ReactElement;
|
|
637
647
|
declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
|
|
638
648
|
type OverrideKey = (typeof overrideKeys)[number];
|
|
639
649
|
type OverridesGeneric<Shape extends {
|
|
@@ -705,7 +715,7 @@ type DragAxis = "dynamic" | "y" | "x";
|
|
|
705
715
|
|
|
706
716
|
type iconTypes = "Smartphone" | "Monitor" | "Tablet";
|
|
707
717
|
type Viewport = {
|
|
708
|
-
width: number;
|
|
718
|
+
width: number | "100%";
|
|
709
719
|
height?: number | "auto";
|
|
710
720
|
label?: string;
|
|
711
721
|
icon?: iconTypes | ReactNode;
|
|
@@ -725,8 +735,13 @@ type IframeConfig = {
|
|
|
725
735
|
};
|
|
726
736
|
type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
|
|
727
737
|
type Plugin<UserConfig extends Config = Config> = {
|
|
738
|
+
name?: string;
|
|
739
|
+
label?: string;
|
|
740
|
+
icon?: ReactNode;
|
|
741
|
+
render?: () => ReactElement;
|
|
728
742
|
overrides?: Partial<Overrides<UserConfig>>;
|
|
729
743
|
fieldTransforms?: FieldTransforms<UserConfig>;
|
|
744
|
+
mobilePanelHeight?: "toggle" | "min-content";
|
|
730
745
|
};
|
|
731
746
|
type History<D = any> = {
|
|
732
747
|
state: D;
|
|
@@ -819,30 +834,4 @@ type PuckAction = {
|
|
|
819
834
|
recordHistory?: boolean;
|
|
820
835
|
} & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
|
|
821
836
|
|
|
822
|
-
type
|
|
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 };
|
|
837
|
+
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 };
|