@puckeditor/core 0.22.0-canary.d4985bc0 → 0.22.0-canary.d4c8bcf2

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 (53) hide show
  1. package/README.md +0 -3
  2. package/dist/{Editor-NK3TZSR6.mjs → Editor-FJJNKTC3.mjs} +11 -12
  3. package/dist/Editor-ZZW3KF2T.css +385 -0
  4. package/dist/{Render-CU35UAWV.mjs → Render-DQXAYUBI.mjs} +4 -1
  5. package/dist/Render-EKEWMTMI.css +117 -0
  6. package/dist/{actions-BrxBrqKj.d.mts → actions-Csn3gOP8.d.mts} +4 -3
  7. package/dist/{actions-BrxBrqKj.d.ts → actions-Csn3gOP8.d.ts} +4 -3
  8. package/dist/{chunk-KOUWDQ4Q.mjs → chunk-3RQGAM3Z.mjs} +1 -1
  9. package/dist/{chunk-5V242HXR.mjs → chunk-4US666EQ.mjs} +91 -248
  10. package/dist/{chunk-MDUBGHWF.mjs → chunk-6MO3E35Y.mjs} +8 -15
  11. package/dist/{chunk-37HTE4KO.mjs → chunk-DVZWVU66.mjs} +60 -2
  12. package/dist/{chunk-RHVK562Z.mjs → chunk-GKUX6MNS.mjs} +4 -4
  13. package/dist/{chunk-AOEDIUVK.mjs → chunk-H635BA2V.mjs} +1 -1
  14. package/dist/{chunk-MSZPUXZP.mjs → chunk-M5GPDW62.mjs} +1 -1
  15. package/dist/{chunk-PMXRXC2B.mjs → chunk-SHVCBQDY.mjs} +20 -29
  16. package/dist/{chunk-ZUKMN2UE.mjs → chunk-SLDNFU3H.mjs} +7285 -3821
  17. package/dist/{chunk-TNORMHZU.mjs → chunk-SSXLOL3N.mjs} +22 -20
  18. package/dist/{chunk-SKJTJUWU.mjs → chunk-XIGSFEU7.mjs} +1 -1
  19. package/dist/{chunk-UMTU6EA7.mjs → chunk-XQHCQEAF.mjs} +286 -100
  20. package/dist/{full-KLPRWVS4.mjs → full-6ZILLKCS.mjs} +9 -9
  21. package/dist/full-S3QQ2IBQ.css +267 -0
  22. package/dist/{index-GB3Q5h0c.d.ts → index-B1b1cFug.d.ts} +9 -10
  23. package/dist/{index-sczExwEC.d.mts → index-ClzBCbx_.d.mts} +9 -10
  24. package/dist/index.css +1294 -1171
  25. package/dist/index.d.mts +14 -13
  26. package/dist/index.d.ts +14 -13
  27. package/dist/index.js +5002 -1468
  28. package/dist/index.mjs +20 -14
  29. package/dist/internal.d.mts +2 -2
  30. package/dist/internal.d.ts +2 -2
  31. package/dist/internal.js +66 -25
  32. package/dist/internal.mjs +2 -2
  33. package/dist/loaded-FVWRAJR3.css +215 -0
  34. package/dist/{loaded-DIHUQBWF.mjs → loaded-LAKI4KDY.mjs} +5 -5
  35. package/dist/{loaded-SJJ63OY2.mjs → loaded-PILFUJGA.mjs} +5 -5
  36. package/dist/{loaded-362ACKSQ.mjs → loaded-QH5RKCGC.mjs} +5 -5
  37. package/dist/no-external.css +1311 -1192
  38. package/dist/no-external.d.mts +3 -3
  39. package/dist/no-external.d.ts +3 -3
  40. package/dist/no-external.js +5012 -1481
  41. package/dist/no-external.mjs +14 -13
  42. package/dist/rsc.css +61 -46
  43. package/dist/rsc.d.mts +2 -2
  44. package/dist/rsc.d.ts +2 -2
  45. package/dist/rsc.js +78 -70
  46. package/dist/rsc.mjs +46 -28
  47. package/dist/{walk-tree-B8hGlO4f.d.ts → walk-tree-BrW9VQ_t.d.mts} +1 -1
  48. package/dist/{walk-tree-CQfHfM9_.d.mts → walk-tree-CWrsBHHe.d.ts} +1 -1
  49. package/package.json +14 -5
  50. package/dist/Editor-IQP25PUX.css +0 -404
  51. package/dist/Render-3OV4N4MT.css +0 -102
  52. package/dist/full-2GJTAAZE.css +0 -301
  53. package/dist/loaded-RVWBFK7L.css +0 -87
package/README.md CHANGED
@@ -42,7 +42,6 @@ Render the editor:
42
42
  ```jsx
43
43
  // Editor.jsx
44
44
  import { Puck } from "@puckeditor/core";
45
- import "@puckeditor/core/puck.css";
46
45
 
47
46
  // Create Puck component config
48
47
  const config = {
@@ -77,7 +76,6 @@ Render the page:
77
76
  ```jsx
78
77
  // Page.jsx
79
78
  import { Render } from "@puckeditor/core";
80
- import "@puckeditor/core/puck.css";
81
79
 
82
80
  export function Page() {
83
81
  return <Render config={config} data={data} />;
@@ -95,7 +93,6 @@ npx create-puck-app my-app
95
93
  Available recipes include:
96
94
 
97
95
  - [**next**](https://github.com/puckeditor/puck/tree/main/recipes/next): Next.js example, using App Router and static page generation
98
- - [**remix**](https://github.com/puckeditor/puck/tree/main/recipes/remix): Remix Run v2 example, using dynamic routes at root-level
99
96
  - [**react-router**](https://github.com/puckeditor/puck/tree/main/recipes/react-router): React Router v7 app example, using dynamic routes to create pages at any level
100
97
 
101
98
  ## Community
@@ -4,20 +4,20 @@ import {
4
4
  import {
5
5
  EditorInner,
6
6
  LoadedRichTextMenu
7
- } from "./chunk-RHVK562Z.mjs";
8
- import "./chunk-AOEDIUVK.mjs";
9
- import "./chunk-5V242HXR.mjs";
10
- import "./chunk-MSZPUXZP.mjs";
11
- import "./chunk-KOUWDQ4Q.mjs";
12
- import "./chunk-SKJTJUWU.mjs";
7
+ } from "./chunk-GKUX6MNS.mjs";
8
+ import "./chunk-H635BA2V.mjs";
9
+ import "./chunk-4US666EQ.mjs";
10
+ import "./chunk-M5GPDW62.mjs";
11
+ import "./chunk-3RQGAM3Z.mjs";
12
+ import "./chunk-XIGSFEU7.mjs";
13
13
  import {
14
14
  useAppStore,
15
15
  useAppStoreApi
16
- } from "./chunk-UMTU6EA7.mjs";
17
- import "./chunk-37HTE4KO.mjs";
18
- import "./chunk-MDUBGHWF.mjs";
16
+ } from "./chunk-XQHCQEAF.mjs";
17
+ import "./chunk-DVZWVU66.mjs";
18
+ import "./chunk-6MO3E35Y.mjs";
19
19
  import "./chunk-Y2EFNT5P.mjs";
20
- import "./chunk-PMXRXC2B.mjs";
20
+ import "./chunk-SHVCBQDY.mjs";
21
21
  import {
22
22
  __spreadProps,
23
23
  __spreadValues,
@@ -49,7 +49,6 @@ function useSyncedEditor({
49
49
  const lastSyncedRef = useRef("");
50
50
  const editTimer = useRef(null);
51
51
  const isPending = !!editTimer.current;
52
- const isFocused = useAppStore((s) => s.state.ui.field.focus === name);
53
52
  const resetTimer = (clearOn) => {
54
53
  if (editTimer.current) {
55
54
  clearTimeout(editTimer.current);
@@ -68,8 +67,8 @@ function useSyncedEditor({
68
67
  immediatelyRender: false,
69
68
  parseOptions: { preserveWhitespace: "full" },
70
69
  onUpdate: ({ editor: editor2 }) => {
70
+ const isFocused = appStoreApi.getState().state.ui.field.focus === name;
71
71
  if (syncingRef.current || !isFocused) {
72
- appStoreApi.getState().setUi({ field: { focus: name } });
73
72
  return;
74
73
  }
75
74
  const html = editor2.getHTML();
@@ -0,0 +1,385 @@
1
+ /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/styles.module.css/#css-module-data */
2
+ ._RichTextMenu_1ve2j_1 {
3
+ display: flex;
4
+ flex-direction: row;
5
+ flex-wrap: nowrap;
6
+ }
7
+ ._RichTextMenu--form_1ve2j_7 {
8
+ border-top-left-radius: var(--puck-field-radius, var(--puck-radius-m));
9
+ border-top-right-radius: var(--puck-field-radius, var(--puck-radius-m));
10
+ padding: var(--puck-field-richtext-menu-space-y, 6px) var(--puck-field-richtext-menu-space-x, 6px);
11
+ background-color: var( --puck-field-richtext-menu-color-bg, var(--puck-color-surface-subtle) );
12
+ position: relative;
13
+ scrollbar-width: none;
14
+ overflow-x: auto;
15
+ }
16
+ ._RichTextMenu-group_1ve2j_21 {
17
+ display: flex;
18
+ align-items: space-between;
19
+ flex-direction: row;
20
+ flex-wrap: nowrap;
21
+ padding-inline: 6px;
22
+ gap: 2px;
23
+ position: relative;
24
+ }
25
+ ._RichTextMenu-group_1ve2j_21:first-of-type {
26
+ padding-left: 0;
27
+ }
28
+ ._RichTextMenu-group_1ve2j_21:last-of-type {
29
+ padding-right: 0;
30
+ }
31
+ ._RichTextMenu--inline_1ve2j_39 ._RichTextMenu-group_1ve2j_21 {
32
+ color: var(--puck-color-text-inverse);
33
+ gap: 0px;
34
+ flex-wrap: nowrap;
35
+ }
36
+ ._RichTextMenu-group_1ve2j_21 + ._RichTextMenu-group_1ve2j_21 {
37
+ border-left: var(--puck-border-width-regular) solid var( --puck-field-richtext-menu-color-separator, var(--puck-color-border-muted) );
38
+ }
39
+ ._RichTextMenu--inline_1ve2j_39 ._RichTextMenu-group_1ve2j_21 + ._RichTextMenu-group_1ve2j_21 {
40
+ border-left: var(--puck-border-width-hairline) solid var(--puck-color-border-inverse);
41
+ }
42
+
43
+ /* css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css/#css-module-data */
44
+ ._IconButton_yuha3_1 {
45
+ align-items: center;
46
+ background: var(--puck-iconbutton-color-bg, transparent);
47
+ border: none;
48
+ border-radius: var(--puck-iconbutton-radius, var(--puck-radius-m));
49
+ color: var(--puck-iconbutton-color-icon, currentColor);
50
+ display: flex;
51
+ font-family: var(--puck-font-family);
52
+ justify-content: center;
53
+ padding: var(--puck-iconbutton-space, var(--puck-space-1));
54
+ transition: background-color var(--puck-duration-fast) var(--puck-ease-exit), color var(--puck-duration-fast) var(--puck-ease-exit);
55
+ }
56
+ ._IconButton--active_yuha3_15 {
57
+ color: var( --puck-iconbutton-color-icon-active, var(--puck-color-interactive) );
58
+ }
59
+ ._IconButton_yuha3_1:focus-visible {
60
+ outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
61
+ outline-offset: calc(var(--puck-border-width-focus) * -1);
62
+ }
63
+ @media (hover: hover) and (pointer: fine) {
64
+ ._IconButton_yuha3_1:hover:not(._IconButton--disabled_yuha3_28) {
65
+ background: var( --puck-iconbutton-color-bg-hover, var(--puck-color-interactive-neutral-hover) );
66
+ color: var( --puck-iconbutton-color-icon-hover, var(--puck-color-interactive) );
67
+ cursor: pointer;
68
+ transition: none;
69
+ }
70
+ }
71
+ ._IconButton_yuha3_1:active {
72
+ background: var( --puck-iconbutton-color-bg-active, var(--puck-color-interactive-soft) );
73
+ transition: none;
74
+ }
75
+ ._IconButton--disabled_yuha3_28 {
76
+ color: var( --puck-iconbutton-color-icon-disabled, var(--puck-color-text-subtle) );
77
+ }
78
+
79
+ /* css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css/#css-module-data */
80
+ @keyframes _loader-animation_1w5zn_1 {
81
+ 0% {
82
+ transform: rotate(0deg) scale(1);
83
+ }
84
+ 50% {
85
+ transform: rotate(180deg) scale(0.8);
86
+ }
87
+ 100% {
88
+ transform: rotate(360deg) scale(1);
89
+ }
90
+ }
91
+ ._Loader_1w5zn_13 {
92
+ background: transparent;
93
+ border-radius: var(--puck-radius-round);
94
+ border: var(--puck-border-width-focus) solid currentColor;
95
+ border-bottom-color: transparent;
96
+ display: inline-block;
97
+ animation: _loader-animation_1w5zn_1 1s 0s infinite linear;
98
+ animation-fill-mode: both;
99
+ }
100
+
101
+ /* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */
102
+ ._ActionBar_5vdfr_1 {
103
+ align-items: center;
104
+ cursor: default;
105
+ display: flex;
106
+ width: auto;
107
+ padding-top: var(--puck-actionbar-space-y, var(--puck-space-1));
108
+ padding-bottom: var(--puck-actionbar-space-y, var(--puck-space-1));
109
+ padding-inline-start: var(--puck-actionbar-space-x, 0);
110
+ padding-inline-end: var(--puck-actionbar-space-x, 0);
111
+ border-radius: var(--puck-actionbar-radius, var(--puck-radius-l));
112
+ background: var(--puck-actionbar-color-bg, var(--puck-color-surface-inverse));
113
+ color: var(--puck-color-text-inverse);
114
+ font-family: var(--puck-font-family);
115
+ min-height: 26px;
116
+ }
117
+ ._ActionBar-label_5vdfr_17 {
118
+ color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));
119
+ font-size: var(--puck-actionbar-font-size, var(--puck-font-size-xxxs));
120
+ opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));
121
+ font-weight: var(--puck-font-weight-medium);
122
+ padding-inline-start: var(--puck-space-2);
123
+ padding-inline-end: var(--puck-space-2);
124
+ margin-inline-start: var(--puck-space-1);
125
+ margin-inline-end: var(--puck-space-1);
126
+ text-overflow: ellipsis;
127
+ white-space: nowrap;
128
+ }
129
+ ._ActionBarAction_5vdfr_30 + ._ActionBar-label_5vdfr_17 {
130
+ padding-inline-start: 0;
131
+ }
132
+ ._ActionBar-label_5vdfr_17 + ._ActionBarAction_5vdfr_30 {
133
+ margin-inline-start: calc(var(--puck-space-1) * -1);
134
+ }
135
+ ._ActionBar-group_5vdfr_38 {
136
+ align-items: center;
137
+ border-inline-start: var(--puck-border-width-hairline) solid var(--puck-actionbar-color-separator, var(--puck-color-border-inverse));
138
+ display: flex;
139
+ height: 100%;
140
+ padding-inline-start: var(--puck-space-1);
141
+ padding-inline-end: var(--puck-space-1);
142
+ }
143
+ ._ActionBar-group_5vdfr_38:first-of-type {
144
+ border-inline-start: 0;
145
+ }
146
+ ._ActionBar-group_5vdfr_38:empty {
147
+ display: none;
148
+ }
149
+ ._ActionBarAction_5vdfr_30 {
150
+ background: transparent;
151
+ border: none;
152
+ color: var(--puck-actionbar-color-text, var(--puck-color-text-inverse));
153
+ cursor: pointer;
154
+ padding: var(--puck-actionbar-action-space, 6px);
155
+ margin-inline-start: var(--puck-space-1);
156
+ margin-inline-end: var(--puck-space-1);
157
+ border-radius: var(--puck-radius-m);
158
+ overflow: hidden;
159
+ display: flex;
160
+ align-items: center;
161
+ justify-content: center;
162
+ opacity: var(--puck-actionbar-opacity-text, var(--puck-opacity-text-inverse));
163
+ transition: color var(--puck-duration-fast) var(--puck-ease-exit), opacity var(--puck-duration-fast) var(--puck-ease-exit);
164
+ }
165
+ ._ActionBarAction--disabled_5vdfr_74 {
166
+ cursor: auto;
167
+ color: var( --puck-actionbar-color-action-disabled, var(--puck-color-text-inverse) );
168
+ opacity: var(--puck-actionbar-opacity-action-disabled, 0.54);
169
+ }
170
+ ._ActionBarAction_5vdfr_30 svg {
171
+ max-width: none !important;
172
+ }
173
+ ._ActionBarAction_5vdfr_30:focus-visible {
174
+ outline: var(--puck-border-width-focus) solid var(--puck-color-focus-ring);
175
+ outline-offset: calc(var(--puck-border-width-focus) * -1);
176
+ }
177
+ @media (hover: hover) and (pointer: fine) {
178
+ ._ActionBarAction_5vdfr_30:hover:not(._ActionBarAction--disabled_5vdfr_74) {
179
+ color: var( --puck-actionbar-color-action-hover, var(--puck-color-interactive-inverse-hover) );
180
+ opacity: 1;
181
+ transition: none;
182
+ }
183
+ }
184
+ ._ActionBarAction_5vdfr_30:active:not(._ActionBarAction--disabled_5vdfr_74),
185
+ ._ActionBarAction--active_5vdfr_104 {
186
+ color: var( --puck-actionbar-color-action-active, var(--puck-color-interactive-inverse-active) );
187
+ opacity: 1;
188
+ transition: none;
189
+ }
190
+ ._ActionBar-group_5vdfr_38 * {
191
+ margin: 0;
192
+ }
193
+ ._ActionBar-separator_5vdfr_117 {
194
+ background: var( --puck-actionbar-color-separator, var(--puck-color-border-inverse) );
195
+ margin-inline: var(--puck-space-1);
196
+ width: var( --puck-border-width-hairline );
197
+ height: 100%;
198
+ }
199
+
200
+ /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/components/Control/styles.module.css/#css-module-data */
201
+ ._Control_id4pm_1 .lucide {
202
+ height: var(--puck-icon-size-m);
203
+ width: var(--puck-icon-size-m);
204
+ }
205
+ ._Control--inline_id4pm_6 .lucide {
206
+ height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));
207
+ width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));
208
+ }
209
+
210
+ /* css-module:/home/runner/work/puck/puck/packages/core/components/Select/styles.module.css/#css-module-data */
211
+ ._Select_1n4iv_1 {
212
+ position: relative;
213
+ z-index: 1;
214
+ }
215
+ ._Select-buttonInner_1n4iv_6 {
216
+ align-items: center;
217
+ display: flex;
218
+ }
219
+ ._Select-buttonIcon_1n4iv_11 {
220
+ align-items: center;
221
+ display: flex;
222
+ justify-content: center;
223
+ }
224
+ ._Select--standalone_1n4iv_17 ._Select-buttonIcon_1n4iv_11 .lucide {
225
+ height: var(--puck-icon-size-m);
226
+ width: var(--puck-icon-size-m);
227
+ }
228
+ ._Select--actionBar_1n4iv_22 ._Select-buttonIcon_1n4iv_11 .lucide {
229
+ height: var(--puck-actionbar-action-size, var(--puck-icon-size-s));
230
+ width: var(--puck-actionbar-action-size, var(--puck-icon-size-s));
231
+ }
232
+ ._Select-items_1n4iv_27 {
233
+ background: var(--puck-color-surface);
234
+ border: var(--puck-border-width-regular) solid var(--puck-color-border);
235
+ border-radius: var(--puck-radius-l);
236
+ margin: 10px 8px;
237
+ margin-left: 0;
238
+ padding: var(--puck-space-1);
239
+ z-index: 2;
240
+ list-style: none;
241
+ }
242
+ ._SelectItem_1n4iv_38 {
243
+ background: transparent;
244
+ border-radius: var(--puck-radius-m);
245
+ border: none;
246
+ color: var(--puck-color-text-secondary);
247
+ cursor: pointer;
248
+ display: flex;
249
+ gap: var(--puck-space-2);
250
+ align-items: center;
251
+ font-size: var(--puck-font-size-xxs);
252
+ margin: 0;
253
+ padding: var(--puck-space-2) var(--puck-space-3);
254
+ width: 100%;
255
+ }
256
+ ._SelectItem--isSelected_1n4iv_53 {
257
+ background: var(--puck-color-interactive-soft);
258
+ color: var(--puck-color-interactive);
259
+ font-weight: var(--puck-font-weight-medium);
260
+ }
261
+ ._SelectItem--isSelected_1n4iv_53 ._SelectItem-icon_1n4iv_59 {
262
+ color: var(--puck-color-interactive);
263
+ }
264
+ ._SelectItem_1n4iv_38:hover {
265
+ background: var(--puck-color-interactive-soft);
266
+ color: var(--puck-color-interactive);
267
+ }
268
+
269
+ /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data */
270
+ ._RichTextEditor_5wzos_1 .ProseMirror {
271
+ white-space: pre-wrap;
272
+ word-wrap: break-word;
273
+ cursor: text;
274
+ outline: none;
275
+ position: relative;
276
+ }
277
+ ._RichTextEditor_5wzos_1 .rich-text * {
278
+ white-space: pre-wrap;
279
+ user-select: auto;
280
+ -webkit-user-select: auto;
281
+ }
282
+ ._RichTextEditor_5wzos_1 .rich-text blockquote {
283
+ margin: 1em 0;
284
+ padding: 0 1em;
285
+ border-left: var(--puck-border-width-strong) solid var(--puck-color-border);
286
+ }
287
+ ._RichTextEditor_5wzos_1 .rich-text code {
288
+ background-color: var(--puck-color-surface-muted);
289
+ padding: var(--puck-space-1) var(--puck-space-2);
290
+ border-radius: var(--puck-radius-m);
291
+ }
292
+ ._RichTextEditor_5wzos_1 .rich-text p:empty::before {
293
+ content: "\a0";
294
+ }
295
+ ._RichTextEditor_5wzos_1 .rich-text pre code {
296
+ display: block;
297
+ padding: var(--puck-space-2) var(--puck-space-3);
298
+ }
299
+ ._RichTextEditor_5wzos_1 .rich-text > *:first-child,
300
+ ._RichTextEditor_5wzos_1 .ProseMirror > *:first-child,
301
+ ._RichTextEditor_5wzos_1 .rich-text * p:first-of-type {
302
+ margin-top: 0;
303
+ }
304
+ ._RichTextEditor_5wzos_1 .rich-text > *:last-child,
305
+ ._RichTextEditor_5wzos_1 .ProseMirror > *:last-child,
306
+ ._RichTextEditor_5wzos_1 .rich-text * p:last-of-type {
307
+ margin-bottom: 0;
308
+ }
309
+ ._RichTextEditor--editor_5wzos_50 {
310
+ color: var(--puck-field-color-text, var(--puck-color-text));
311
+ background: var(--puck-field-color-bg, var(--puck-color-surface));
312
+ border-width: var( --puck-field-border-width, var(--puck-border-width-regular) );
313
+ border-style: solid;
314
+ border-color: var(--puck-field-color-border, var(--puck-color-border));
315
+ border-radius: var(--puck-field-radius, var(--puck-radius-m));
316
+ box-sizing: border-box;
317
+ display: flex;
318
+ flex-direction: column;
319
+ font-family: inherit;
320
+ font-size: var(--puck-field-font-size, var(--puck-font-size-xxs));
321
+ resize: vertical;
322
+ text-align: initial;
323
+ transition: border-color var(--puck-duration-fast) var(--puck-ease-exit);
324
+ width: 100%;
325
+ max-width: 100%;
326
+ min-height: 128px;
327
+ }
328
+ ._RichTextEditor--editor_5wzos_50 .rich-text {
329
+ flex-grow: 1;
330
+ }
331
+ ._RichTextEditor--editor_5wzos_50 .rich-text:not(:has(.ProseMirror)),
332
+ ._RichTextEditor--editor_5wzos_50 .rich-text .ProseMirror {
333
+ height: 100%;
334
+ padding: var(--puck-field-space-y, var(--puck-space-3)) var( --puck-field-space-x, calc( var(--puck-space-4) - var(--puck-field-border-width, var(--puck-border-width-regular)) ) );
335
+ }
336
+ ._RichTextEditor--editor_5wzos_50 .rich-text ul,
337
+ ._RichTextEditor--editor_5wzos_50 .rich-text ol {
338
+ padding-left: var(--puck-space-5);
339
+ }
340
+ ._RichTextEditor--editor_5wzos_50 .rich-text li {
341
+ line-height: 1.5;
342
+ }
343
+ ._RichTextEditor--editor_5wzos_50 .rich-text p {
344
+ margin-block: var(--puck-space-3);
345
+ }
346
+ ._RichTextEditor--editor_5wzos_50 .rich-text ul {
347
+ list-style: disc;
348
+ }
349
+ ._RichTextEditor--editor_5wzos_50 .rich-text ol {
350
+ list-style: decimal;
351
+ }
352
+ ._RichTextEditor--editor_5wzos_50:focus-within {
353
+ border-color: var( --puck-field-color-border-hover, var(--puck-color-border-hover) );
354
+ outline: var(--puck-border-width-focus) solid var(--puck-field-color-border-focus, var(--puck-color-focus-ring));
355
+ transition: none;
356
+ }
357
+ @media (hover: hover) and (pointer: fine) {
358
+ ._RichTextEditor--editor_5wzos_50:hover:not(._RichTextEditor--disabled_5wzos_123) {
359
+ border-color: var( --puck-field-color-border-hover, var(--puck-color-border-hover) );
360
+ transition: none;
361
+ }
362
+ }
363
+ ._RichTextEditor--editor_5wzos_50._RichTextEditor--disabled_5wzos_123 {
364
+ background: var( --puck-field-color-bg-disabled, var(--puck-color-surface-muted) );
365
+ border-color: var( --puck-field-color-border-disabled, var(--puck-color-border) );
366
+ }
367
+ ._RichTextEditor--editor_5wzos_50._RichTextEditor--disabled_5wzos_123 .rich-text:not(:has(.ProseMirror)),
368
+ ._RichTextEditor--editor_5wzos_50._RichTextEditor--disabled_5wzos_123 .rich-text .ProseMirror {
369
+ color: var( --puck-field-color-text-disabled, var(--puck-color-text-secondary) );
370
+ }
371
+ ._RichTextEditor--editor_5wzos_50._RichTextEditor--disabled_5wzos_123 .ProseMirror[contenteditable=false] {
372
+ cursor: default;
373
+ }
374
+ ._RichTextEditor_5wzos_1:not(:focus-within):not(._RichTextEditor--isActive_5wzos_159) .ProseMirror ::selection {
375
+ background-color: transparent;
376
+ }
377
+ ._RichTextEditor-menu_5wzos_165 {
378
+ border-bottom: var(--puck-border-width-regular) solid var(--puck-color-border-muted);
379
+ position: sticky;
380
+ top: 0;
381
+ z-index: 1;
382
+ }
383
+ ._RichTextEditor--disabled_5wzos_123 ._RichTextEditor-menu_5wzos_165 {
384
+ border-bottom: var(--puck-border-width-regular) solid var(--puck-color-border);
385
+ }
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2CNEFIQP.mjs";
4
4
  import {
5
5
  styles_module_default
6
- } from "./chunk-AOEDIUVK.mjs";
6
+ } from "./chunk-H635BA2V.mjs";
7
7
  import {
8
8
  get_class_name_factory_default
9
9
  } from "./chunk-Y2EFNT5P.mjs";
@@ -32,6 +32,9 @@ function RichTextRender({
32
32
  return content;
33
33
  }
34
34
  if (typeof content === "string") {
35
+ if (!content) {
36
+ return { type: "doc", content: [] };
37
+ }
35
38
  const isHtml = /<\/?[a-z][\s\S]*>/i.test(content);
36
39
  if (isHtml) {
37
40
  return generateJSON(content, loadedExtensions);
@@ -0,0 +1,117 @@
1
+ /* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextEditor/styles.module.css/#css-module-data */
2
+ ._RichTextEditor_5wzos_1 .ProseMirror {
3
+ white-space: pre-wrap;
4
+ word-wrap: break-word;
5
+ cursor: text;
6
+ outline: none;
7
+ position: relative;
8
+ }
9
+ ._RichTextEditor_5wzos_1 .rich-text * {
10
+ white-space: pre-wrap;
11
+ user-select: auto;
12
+ -webkit-user-select: auto;
13
+ }
14
+ ._RichTextEditor_5wzos_1 .rich-text blockquote {
15
+ margin: 1em 0;
16
+ padding: 0 1em;
17
+ border-left: var(--puck-border-width-strong) solid var(--puck-color-border);
18
+ }
19
+ ._RichTextEditor_5wzos_1 .rich-text code {
20
+ background-color: var(--puck-color-surface-muted);
21
+ padding: var(--puck-space-1) var(--puck-space-2);
22
+ border-radius: var(--puck-radius-m);
23
+ }
24
+ ._RichTextEditor_5wzos_1 .rich-text p:empty::before {
25
+ content: "\a0";
26
+ }
27
+ ._RichTextEditor_5wzos_1 .rich-text pre code {
28
+ display: block;
29
+ padding: var(--puck-space-2) var(--puck-space-3);
30
+ }
31
+ ._RichTextEditor_5wzos_1 .rich-text > *:first-child,
32
+ ._RichTextEditor_5wzos_1 .ProseMirror > *:first-child,
33
+ ._RichTextEditor_5wzos_1 .rich-text * p:first-of-type {
34
+ margin-top: 0;
35
+ }
36
+ ._RichTextEditor_5wzos_1 .rich-text > *:last-child,
37
+ ._RichTextEditor_5wzos_1 .ProseMirror > *:last-child,
38
+ ._RichTextEditor_5wzos_1 .rich-text * p:last-of-type {
39
+ margin-bottom: 0;
40
+ }
41
+ ._RichTextEditor--editor_5wzos_50 {
42
+ color: var(--puck-field-color-text, var(--puck-color-text));
43
+ background: var(--puck-field-color-bg, var(--puck-color-surface));
44
+ border-width: var( --puck-field-border-width, var(--puck-border-width-regular) );
45
+ border-style: solid;
46
+ border-color: var(--puck-field-color-border, var(--puck-color-border));
47
+ border-radius: var(--puck-field-radius, var(--puck-radius-m));
48
+ box-sizing: border-box;
49
+ display: flex;
50
+ flex-direction: column;
51
+ font-family: inherit;
52
+ font-size: var(--puck-field-font-size, var(--puck-font-size-xxs));
53
+ resize: vertical;
54
+ text-align: initial;
55
+ transition: border-color var(--puck-duration-fast) var(--puck-ease-exit);
56
+ width: 100%;
57
+ max-width: 100%;
58
+ min-height: 128px;
59
+ }
60
+ ._RichTextEditor--editor_5wzos_50 .rich-text {
61
+ flex-grow: 1;
62
+ }
63
+ ._RichTextEditor--editor_5wzos_50 .rich-text:not(:has(.ProseMirror)),
64
+ ._RichTextEditor--editor_5wzos_50 .rich-text .ProseMirror {
65
+ height: 100%;
66
+ padding: var(--puck-field-space-y, var(--puck-space-3)) var( --puck-field-space-x, calc( var(--puck-space-4) - var(--puck-field-border-width, var(--puck-border-width-regular)) ) );
67
+ }
68
+ ._RichTextEditor--editor_5wzos_50 .rich-text ul,
69
+ ._RichTextEditor--editor_5wzos_50 .rich-text ol {
70
+ padding-left: var(--puck-space-5);
71
+ }
72
+ ._RichTextEditor--editor_5wzos_50 .rich-text li {
73
+ line-height: 1.5;
74
+ }
75
+ ._RichTextEditor--editor_5wzos_50 .rich-text p {
76
+ margin-block: var(--puck-space-3);
77
+ }
78
+ ._RichTextEditor--editor_5wzos_50 .rich-text ul {
79
+ list-style: disc;
80
+ }
81
+ ._RichTextEditor--editor_5wzos_50 .rich-text ol {
82
+ list-style: decimal;
83
+ }
84
+ ._RichTextEditor--editor_5wzos_50:focus-within {
85
+ border-color: var( --puck-field-color-border-hover, var(--puck-color-border-hover) );
86
+ outline: var(--puck-border-width-focus) solid var(--puck-field-color-border-focus, var(--puck-color-focus-ring));
87
+ transition: none;
88
+ }
89
+ @media (hover: hover) and (pointer: fine) {
90
+ ._RichTextEditor--editor_5wzos_50:hover:not(._RichTextEditor--disabled_5wzos_123) {
91
+ border-color: var( --puck-field-color-border-hover, var(--puck-color-border-hover) );
92
+ transition: none;
93
+ }
94
+ }
95
+ ._RichTextEditor--editor_5wzos_50._RichTextEditor--disabled_5wzos_123 {
96
+ background: var( --puck-field-color-bg-disabled, var(--puck-color-surface-muted) );
97
+ border-color: var( --puck-field-color-border-disabled, var(--puck-color-border) );
98
+ }
99
+ ._RichTextEditor--editor_5wzos_50._RichTextEditor--disabled_5wzos_123 .rich-text:not(:has(.ProseMirror)),
100
+ ._RichTextEditor--editor_5wzos_50._RichTextEditor--disabled_5wzos_123 .rich-text .ProseMirror {
101
+ color: var( --puck-field-color-text-disabled, var(--puck-color-text-secondary) );
102
+ }
103
+ ._RichTextEditor--editor_5wzos_50._RichTextEditor--disabled_5wzos_123 .ProseMirror[contenteditable=false] {
104
+ cursor: default;
105
+ }
106
+ ._RichTextEditor_5wzos_1:not(:focus-within):not(._RichTextEditor--isActive_5wzos_159) .ProseMirror ::selection {
107
+ background-color: transparent;
108
+ }
109
+ ._RichTextEditor-menu_5wzos_165 {
110
+ border-bottom: var(--puck-border-width-regular) solid var(--puck-color-border-muted);
111
+ position: sticky;
112
+ top: 0;
113
+ z-index: 1;
114
+ }
115
+ ._RichTextEditor--disabled_5wzos_123 ._RichTextEditor-menu_5wzos_165 {
116
+ border-bottom: var(--puck-border-width-regular) solid var(--puck-color-border);
117
+ }
@@ -308,7 +308,7 @@ type CustomFieldRender<Value extends any> = (props: {
308
308
  name: string;
309
309
  id: string;
310
310
  value: Value;
311
- onChange: (value: Value) => void;
311
+ onChange: (value: Value, uiState?: Partial<UiState>) => void;
312
312
  readOnly?: boolean;
313
313
  }) => ReactElement;
314
314
  interface CustomField<Value extends any> extends BaseField {
@@ -430,6 +430,7 @@ UserField extends BaseField = {}> = {
430
430
  metadata: ComponentMetadata;
431
431
  trigger: ResolveDataTrigger;
432
432
  parent: ComponentData | null;
433
+ root: RootData;
433
434
  }) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
434
435
  resolvePermissions?: (data: DataShape, params: {
435
436
  changed: Partial<Record<keyof FieldProps, boolean> & {
@@ -733,7 +734,7 @@ type Permissions = {
733
734
  type IframeConfig = {
734
735
  enabled?: boolean;
735
736
  waitForStyles?: boolean;
736
- srcDoc?: string;
737
+ syncHostStyles?: boolean;
737
738
  };
738
739
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
739
740
  type Plugin<UserConfig extends Config = Config> = {
@@ -836,4 +837,4 @@ type PuckAction = {
836
837
  recordHistory?: boolean;
837
838
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
838
839
 
839
- 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 };
840
+ export { type Permissions as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type ExternalField as E, type ExtractConfigParams as F, type ExtractField as G, type Field as H, type FieldMetadata as I, type FieldProps as J, type FieldRenderFunctions as K, type FieldTransformFn as L, type FieldTransformFnParams as M, type FieldTransforms as N, type Fields as O, type History as P, type IframeConfig as Q, type InitialHistory as R, type ItemSelector as S, type ItemWithId as T, type MappedItem as U, type Metadata as V, type NumberField as W, type ObjectField as X, type OnAction as Y, type OverrideKey as Z, type Overrides as _, type AppState as a, type Plugin as a0, type PluginInternal as a1, type PrivateAppState as a2, type PuckAction as a3, type PuckComponent as a4, type PuckContext as a5, type PuckMetadata as a6, type RadioField as a7, type ResolveDataTrigger as a8, type RichText as a9, type RichtextField as aa, type RootConfig as ab, type RootData as ac, type RootDataWithProps as ad, type RootDataWithoutProps as ae, type SelectField as af, type Slot as ag, type SlotComponent as ah, type SlotField as ai, type TextField as aj, type TextareaField as ak, type UiState as al, type UserGenerics as am, type Viewport as an, type Viewports as ao, type WithChildren as ap, type WithId as aq, type WithPuckProps as ar, type WithSlotProps as as, overrideKeys as at, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type ComponentConfig as f, type ComponentConfigExtensions as g, type ComponentConfigParams as h, type ComponentData as i, type ComponentDataMap as j, type ComponentDataOptionalId as k, type ComponentMetadata as l, type Config as m, type ConfigParams as n, type Content as o, type CustomField as p, type CustomFieldRender as q, type DefaultComponentProps as r, type DefaultComponents as s, type DefaultRootFieldProps as t, type DefaultRootProps as u, type DefaultRootRenderProps as v, type Direction as w, type DragAxis as x, type DropZoneProps as y, type ExternalFieldWithAdaptor as z };
@@ -308,7 +308,7 @@ type CustomFieldRender<Value extends any> = (props: {
308
308
  name: string;
309
309
  id: string;
310
310
  value: Value;
311
- onChange: (value: Value) => void;
311
+ onChange: (value: Value, uiState?: Partial<UiState>) => void;
312
312
  readOnly?: boolean;
313
313
  }) => ReactElement;
314
314
  interface CustomField<Value extends any> extends BaseField {
@@ -430,6 +430,7 @@ UserField extends BaseField = {}> = {
430
430
  metadata: ComponentMetadata;
431
431
  trigger: ResolveDataTrigger;
432
432
  parent: ComponentData | null;
433
+ root: RootData;
433
434
  }) => Promise<WithPartialProps<DataShape, FieldProps>> | WithPartialProps<DataShape, FieldProps>;
434
435
  resolvePermissions?: (data: DataShape, params: {
435
436
  changed: Partial<Record<keyof FieldProps, boolean> & {
@@ -733,7 +734,7 @@ type Permissions = {
733
734
  type IframeConfig = {
734
735
  enabled?: boolean;
735
736
  waitForStyles?: boolean;
736
- srcDoc?: string;
737
+ syncHostStyles?: boolean;
737
738
  };
738
739
  type OnAction<UserData extends Data = Data> = (action: PuckAction, appState: AppState<UserData>, prevAppState: AppState<UserData>) => void;
739
740
  type Plugin<UserConfig extends Config = Config> = {
@@ -836,4 +837,4 @@ type PuckAction = {
836
837
  recordHistory?: boolean;
837
838
  } & (ReorderAction | InsertAction | MoveAction | ReplaceAction | ReplaceRootAction | RemoveAction | DuplicateAction | SetAction | SetDataAction | SetUiAction | RegisterZoneAction | UnregisterZoneAction);
838
839
 
839
- 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 };
840
+ export { type Permissions as $, type Adaptor as A, type BaseData as B, type CacheOpts as C, type Data as D, type ExternalField as E, type ExtractConfigParams as F, type ExtractField as G, type Field as H, type FieldMetadata as I, type FieldProps as J, type FieldRenderFunctions as K, type FieldTransformFn as L, type FieldTransformFnParams as M, type FieldTransforms as N, type Fields as O, type History as P, type IframeConfig as Q, type InitialHistory as R, type ItemSelector as S, type ItemWithId as T, type MappedItem as U, type Metadata as V, type NumberField as W, type ObjectField as X, type OnAction as Y, type OverrideKey as Z, type Overrides as _, type AppState as a, type Plugin as a0, type PluginInternal as a1, type PrivateAppState as a2, type PuckAction as a3, type PuckComponent as a4, type PuckContext as a5, type PuckMetadata as a6, type RadioField as a7, type ResolveDataTrigger as a8, type RichText as a9, type RichtextField as aa, type RootConfig as ab, type RootData as ac, type RootDataWithProps as ad, type RootDataWithoutProps as ae, type SelectField as af, type Slot as ag, type SlotComponent as ah, type SlotField as ai, type TextField as aj, type TextareaField as ak, type UiState as al, type UserGenerics as am, type Viewport as an, type Viewports as ao, type WithChildren as ap, type WithId as aq, type WithPuckProps as ar, type WithSlotProps as as, overrideKeys as at, type ArrayField as b, type ArrayState as c, type AsFieldProps as d, type BaseField as e, type ComponentConfig as f, type ComponentConfigExtensions as g, type ComponentConfigParams as h, type ComponentData as i, type ComponentDataMap as j, type ComponentDataOptionalId as k, type ComponentMetadata as l, type Config as m, type ConfigParams as n, type Content as o, type CustomField as p, type CustomFieldRender as q, type DefaultComponentProps as r, type DefaultComponents as s, type DefaultRootFieldProps as t, type DefaultRootProps as u, type DefaultRootRenderProps as v, type Direction as w, type DragAxis as x, type DropZoneProps as y, type ExternalFieldWithAdaptor as z };