@measured/puck 0.21.0-canary.ec77dd9f → 0.21.0-canary.ece26d91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/Editor-F2LSS6SE.css +403 -0
  2. package/dist/Editor-O447AVCX.mjs +204 -0
  3. package/dist/Render-OFE6QLI2.mjs +55 -0
  4. package/dist/Render-QEMDIDQC.css +101 -0
  5. package/dist/{walk-tree-CkSoNBF7.d.mts → actions-ONhOkrvf.d.mts} +208 -33
  6. package/dist/{walk-tree-CkSoNBF7.d.ts → actions-ONhOkrvf.d.ts} +208 -33
  7. package/dist/chunk-2Q4PACDA.mjs +111 -0
  8. package/dist/chunk-62AAYNXG.mjs +63 -0
  9. package/dist/chunk-BSDEIOEK.mjs +706 -0
  10. package/dist/chunk-CSSRLPHM.mjs +11 -0
  11. package/dist/chunk-DAQLMM2T.mjs +1722 -0
  12. package/dist/chunk-M6W7YEVX.mjs +95 -0
  13. package/dist/chunk-NLUHDYVR.mjs +416 -0
  14. package/dist/chunk-PLXSMBAA.mjs +53 -0
  15. package/dist/chunk-QAWJTCV5.mjs +33 -0
  16. package/dist/chunk-QBGM4ELA.mjs +528 -0
  17. package/dist/{chunk-NW2GGRCZ.mjs → chunk-QBJ2LDJB.mjs} +1048 -2778
  18. package/dist/chunk-T3WX7XJ6.mjs +132 -0
  19. package/dist/chunk-V5I7CVLT.mjs +103 -0
  20. package/dist/chunk-Y2EFNT5P.mjs +108 -0
  21. package/dist/chunk-Y656T6AQ.mjs +419 -0
  22. package/dist/full-2GJTAAZE.css +301 -0
  23. package/dist/full-BEMDJKDS.mjs +93 -0
  24. package/dist/index-BEoNHRI1.d.ts +116 -0
  25. package/dist/index-DfxZ7tZF.d.mts +116 -0
  26. package/dist/index.css +278 -22
  27. package/dist/index.d.mts +94 -111
  28. package/dist/index.d.ts +94 -111
  29. package/dist/index.js +5812 -2550
  30. package/dist/index.mjs +28 -9
  31. package/dist/internal.d.mts +27 -0
  32. package/dist/internal.d.ts +27 -0
  33. package/dist/internal.js +908 -0
  34. package/dist/internal.mjs +13 -0
  35. package/dist/loaded-JU3A7Y4L.mjs +57 -0
  36. package/dist/loaded-N3FYGF2Y.mjs +57 -0
  37. package/dist/loaded-OBY7OMS6.mjs +60 -0
  38. package/dist/loaded-RVWBFK7L.css +87 -0
  39. package/dist/no-external.css +278 -22
  40. package/dist/no-external.d.mts +19 -2
  41. package/dist/no-external.d.ts +19 -2
  42. package/dist/no-external.js +5812 -2550
  43. package/dist/no-external.mjs +28 -9
  44. package/dist/rsc.css +101 -0
  45. package/dist/rsc.d.mts +17 -2
  46. package/dist/rsc.d.ts +17 -2
  47. package/dist/rsc.js +409 -22
  48. package/dist/rsc.mjs +18 -9
  49. package/dist/walk-tree-CdriEzFJ.d.mts +29 -0
  50. package/dist/walk-tree-DHbAZ4wF.d.ts +29 -0
  51. package/package.json +29 -2
  52. package/dist/chunk-TC25DCTQ.mjs +0 -965
@@ -0,0 +1,706 @@
1
+ import {
2
+ useAlignOptions
3
+ } from "./chunk-PLXSMBAA.mjs";
4
+ import {
5
+ useHeadingOptions
6
+ } from "./chunk-62AAYNXG.mjs";
7
+ import {
8
+ useListOptions
9
+ } from "./chunk-QAWJTCV5.mjs";
10
+ import {
11
+ AlignCenter,
12
+ AlignJustify,
13
+ AlignLeft,
14
+ AlignRight,
15
+ Bold,
16
+ Code,
17
+ ControlContext,
18
+ Heading,
19
+ Italic,
20
+ List,
21
+ ListOrdered,
22
+ Minus,
23
+ Quote,
24
+ SelectControl,
25
+ SquareCode,
26
+ Strikethrough,
27
+ Underline,
28
+ useControlContext
29
+ } from "./chunk-DAQLMM2T.mjs";
30
+ import {
31
+ get_class_name_factory_default
32
+ } from "./chunk-Y2EFNT5P.mjs";
33
+ import {
34
+ __objRest,
35
+ __spreadValues,
36
+ init_react_import
37
+ } from "./chunk-M6W7YEVX.mjs";
38
+
39
+ // components/ActionBar/index.tsx
40
+ init_react_import();
41
+
42
+ // css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css#css-module
43
+ init_react_import();
44
+ var styles_module_default = { "ActionBar": "_ActionBar_1nmyk_1", "ActionBar-label": "_ActionBar-label_1nmyk_18", "ActionBarAction": "_ActionBarAction_1nmyk_30", "ActionBar-group": "_ActionBar-group_1nmyk_38", "ActionBarAction--disabled": "_ActionBarAction--disabled_1nmyk_71", "ActionBarAction--active": "_ActionBarAction--active_1nmyk_93", "ActionBar-separator": "_ActionBar-separator_1nmyk_102" };
45
+
46
+ // components/ActionBar/index.tsx
47
+ import { jsx, jsxs } from "react/jsx-runtime";
48
+ var getClassName = get_class_name_factory_default("ActionBar", styles_module_default);
49
+ var getActionClassName = get_class_name_factory_default("ActionBarAction", styles_module_default);
50
+ var ActionBar = ({
51
+ label,
52
+ children
53
+ }) => /* @__PURE__ */ jsxs(
54
+ "div",
55
+ {
56
+ className: getClassName(),
57
+ onClick: (e) => {
58
+ e.stopPropagation();
59
+ },
60
+ children: [
61
+ label && /* @__PURE__ */ jsx(ActionBar.Group, { children: /* @__PURE__ */ jsx("div", { className: getClassName("label"), children: label }) }),
62
+ children
63
+ ]
64
+ }
65
+ );
66
+ var Action = ({
67
+ children,
68
+ label,
69
+ onClick,
70
+ active = false,
71
+ disabled
72
+ }) => /* @__PURE__ */ jsx(
73
+ "button",
74
+ {
75
+ type: "button",
76
+ className: getActionClassName({ active, disabled }),
77
+ onClick,
78
+ title: label,
79
+ tabIndex: 0,
80
+ disabled,
81
+ children
82
+ }
83
+ );
84
+ var Group = ({ children }) => /* @__PURE__ */ jsx("div", { className: getClassName("group"), children });
85
+ var Label = ({ label }) => /* @__PURE__ */ jsx("div", { className: getClassName("label"), children: label });
86
+ var Separator = () => /* @__PURE__ */ jsx("div", { className: getClassName("separator") });
87
+ ActionBar.Action = Action;
88
+ ActionBar.Label = Label;
89
+ ActionBar.Group = Group;
90
+ ActionBar.Separator = Separator;
91
+
92
+ // components/IconButton/IconButton.tsx
93
+ init_react_import();
94
+ import { useState } from "react";
95
+
96
+ // css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css#css-module
97
+ init_react_import();
98
+ var IconButton_module_default = { "IconButton": "_IconButton_ffob9_1", "IconButton--active": "_IconButton--active_ffob9_14", "IconButton--disabled": "_IconButton--disabled_ffob9_24", "IconButton-title": "_IconButton-title_ffob9_37" };
99
+
100
+ // components/Loader/index.tsx
101
+ init_react_import();
102
+
103
+ // css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
104
+ init_react_import();
105
+ var styles_module_default2 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
106
+
107
+ // components/Loader/index.tsx
108
+ import { jsx as jsx2 } from "react/jsx-runtime";
109
+ var getClassName2 = get_class_name_factory_default("Loader", styles_module_default2);
110
+ var Loader = (_a) => {
111
+ var _b = _a, {
112
+ color,
113
+ size = 16
114
+ } = _b, props = __objRest(_b, [
115
+ "color",
116
+ "size"
117
+ ]);
118
+ return /* @__PURE__ */ jsx2(
119
+ "span",
120
+ __spreadValues({
121
+ className: getClassName2(),
122
+ style: {
123
+ width: size,
124
+ height: size,
125
+ color
126
+ },
127
+ "aria-label": "loading"
128
+ }, props)
129
+ );
130
+ };
131
+
132
+ // components/IconButton/IconButton.tsx
133
+ import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
134
+ var getClassName3 = get_class_name_factory_default("IconButton", IconButton_module_default);
135
+ var IconButton = ({
136
+ active = false,
137
+ children,
138
+ href,
139
+ onClick,
140
+ type,
141
+ disabled,
142
+ tabIndex,
143
+ newTab,
144
+ fullWidth,
145
+ title
146
+ }) => {
147
+ const [loading, setLoading] = useState(false);
148
+ const ElementType = href ? "a" : "button";
149
+ const el = /* @__PURE__ */ jsxs2(
150
+ ElementType,
151
+ {
152
+ className: getClassName3({
153
+ active,
154
+ disabled,
155
+ fullWidth
156
+ }),
157
+ onClick: (e) => {
158
+ if (!onClick) return;
159
+ setLoading(true);
160
+ Promise.resolve(onClick(e)).then(() => {
161
+ setLoading(false);
162
+ });
163
+ },
164
+ type,
165
+ disabled: disabled || loading,
166
+ tabIndex,
167
+ target: newTab ? "_blank" : void 0,
168
+ rel: newTab ? "noreferrer" : void 0,
169
+ href,
170
+ title,
171
+ children: [
172
+ /* @__PURE__ */ jsx3("span", { className: getClassName3("title"), children: title }),
173
+ children,
174
+ loading && /* @__PURE__ */ jsxs2(Fragment, { children: [
175
+ "\xA0\xA0",
176
+ /* @__PURE__ */ jsx3(Loader, { size: 14 })
177
+ ] })
178
+ ]
179
+ }
180
+ );
181
+ return el;
182
+ };
183
+
184
+ // components/RichTextMenu/inner.tsx
185
+ init_react_import();
186
+
187
+ // css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/styles.module.css#css-module
188
+ init_react_import();
189
+ var styles_module_default3 = { "RichTextMenu": "_RichTextMenu_k97eh_1", "RichTextMenu--form": "_RichTextMenu--form_k97eh_7", "RichTextMenu-group": "_RichTextMenu-group_k97eh_17", "RichTextMenu--inline": "_RichTextMenu--inline_k97eh_35" };
190
+
191
+ // components/RichTextMenu/inner.tsx
192
+ import { useMemo } from "react";
193
+
194
+ // components/RichTextMenu/controls/index.ts
195
+ init_react_import();
196
+
197
+ // components/RichTextMenu/controls/AlignLeft.tsx
198
+ init_react_import();
199
+
200
+ // components/RichTextMenu/components/Control/index.tsx
201
+ init_react_import();
202
+
203
+ // components/IconButton/index.ts
204
+ init_react_import();
205
+
206
+ // css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/components/Control/styles.module.css#css-module
207
+ init_react_import();
208
+ var styles_module_default4 = { "Control": "_Control_1aveu_1", "Control--inline": "_Control--inline_1aveu_6" };
209
+
210
+ // components/RichTextMenu/components/Control/index.tsx
211
+ import { jsx as jsx4 } from "react/jsx-runtime";
212
+ var getClassName4 = get_class_name_factory_default("Control", styles_module_default4);
213
+ function Control({
214
+ icon,
215
+ disabled,
216
+ active,
217
+ onClick,
218
+ title
219
+ }) {
220
+ const { inline } = useControlContext();
221
+ if (inline) {
222
+ return /* @__PURE__ */ jsx4("span", { className: getClassName4({ inline: true }), children: /* @__PURE__ */ jsx4(
223
+ Action,
224
+ {
225
+ onClick,
226
+ disabled,
227
+ active,
228
+ label: title,
229
+ children: icon
230
+ }
231
+ ) });
232
+ }
233
+ return /* @__PURE__ */ jsx4("span", { className: getClassName4(), children: /* @__PURE__ */ jsx4(
234
+ IconButton,
235
+ {
236
+ onClick,
237
+ disabled,
238
+ active,
239
+ title,
240
+ children: icon
241
+ }
242
+ ) });
243
+ }
244
+
245
+ // components/RichTextMenu/controls/AlignLeft.tsx
246
+ import { jsx as jsx5 } from "react/jsx-runtime";
247
+ function AlignLeft2() {
248
+ const { editor, editorState } = useControlContext();
249
+ return /* @__PURE__ */ jsx5(
250
+ Control,
251
+ {
252
+ icon: /* @__PURE__ */ jsx5(AlignLeft, {}),
253
+ onClick: (e) => {
254
+ e.stopPropagation();
255
+ editor == null ? void 0 : editor.chain().focus().setTextAlign("left").run();
256
+ },
257
+ disabled: !(editorState == null ? void 0 : editorState.canAlignLeft),
258
+ active: editorState == null ? void 0 : editorState.isAlignLeft,
259
+ title: "Align left"
260
+ }
261
+ );
262
+ }
263
+
264
+ // components/RichTextMenu/controls/AlignCenter.tsx
265
+ init_react_import();
266
+ import { jsx as jsx6 } from "react/jsx-runtime";
267
+ function AlignCenter2() {
268
+ const { editor, editorState } = useControlContext();
269
+ return /* @__PURE__ */ jsx6(
270
+ Control,
271
+ {
272
+ icon: /* @__PURE__ */ jsx6(AlignCenter, {}),
273
+ onClick: (e) => {
274
+ e.stopPropagation();
275
+ editor == null ? void 0 : editor.chain().focus().setTextAlign("center").run();
276
+ },
277
+ disabled: !(editorState == null ? void 0 : editorState.canAlignCenter),
278
+ active: editorState == null ? void 0 : editorState.isAlignCenter,
279
+ title: "Align center"
280
+ }
281
+ );
282
+ }
283
+
284
+ // components/RichTextMenu/controls/AlignRight.tsx
285
+ init_react_import();
286
+ import { jsx as jsx7 } from "react/jsx-runtime";
287
+ function AlignRight2() {
288
+ const { editor, editorState } = useControlContext();
289
+ return /* @__PURE__ */ jsx7(
290
+ Control,
291
+ {
292
+ icon: /* @__PURE__ */ jsx7(AlignRight, {}),
293
+ onClick: (e) => {
294
+ e.stopPropagation();
295
+ editor == null ? void 0 : editor.chain().focus().setTextAlign("right").run();
296
+ },
297
+ disabled: !(editorState == null ? void 0 : editorState.canAlignRight),
298
+ active: editorState == null ? void 0 : editorState.isAlignRight,
299
+ title: "Align right"
300
+ }
301
+ );
302
+ }
303
+
304
+ // components/RichTextMenu/controls/AlignJustify.tsx
305
+ init_react_import();
306
+ import { jsx as jsx8 } from "react/jsx-runtime";
307
+ function AlignJustify2() {
308
+ const { editor, editorState } = useControlContext();
309
+ return /* @__PURE__ */ jsx8(
310
+ Control,
311
+ {
312
+ icon: /* @__PURE__ */ jsx8(AlignJustify, {}),
313
+ onClick: (e) => {
314
+ e.stopPropagation();
315
+ editor == null ? void 0 : editor.chain().focus().setTextAlign("justify").run();
316
+ },
317
+ disabled: !(editorState == null ? void 0 : editorState.canAlignJustify),
318
+ active: editorState == null ? void 0 : editorState.isAlignJustify,
319
+ title: "Justify"
320
+ }
321
+ );
322
+ }
323
+
324
+ // components/RichTextMenu/controls/AlignSelect/index.tsx
325
+ init_react_import();
326
+ import { lazy, Suspense } from "react";
327
+
328
+ // components/RichTextMenu/controls/AlignSelect/fallback.tsx
329
+ init_react_import();
330
+ import { jsx as jsx9 } from "react/jsx-runtime";
331
+ function AlignSelectFallback() {
332
+ const ctx = useControlContext();
333
+ const alignOptions = useAlignOptions(ctx.options);
334
+ return /* @__PURE__ */ jsx9(
335
+ SelectControl,
336
+ {
337
+ options: alignOptions,
338
+ onChange: () => {
339
+ },
340
+ value: "left",
341
+ defaultValue: "left",
342
+ renderDefaultIcon: AlignLeft
343
+ }
344
+ );
345
+ }
346
+
347
+ // components/RichTextMenu/controls/AlignSelect/index.tsx
348
+ import { jsx as jsx10 } from "react/jsx-runtime";
349
+ var AlignSelectLoaded = lazy(
350
+ () => import("./loaded-JU3A7Y4L.mjs").then((m) => ({
351
+ default: m.AlignSelectLoaded
352
+ }))
353
+ );
354
+ var AlignSelect = () => /* @__PURE__ */ jsx10(Suspense, { fallback: /* @__PURE__ */ jsx10(AlignSelectFallback, {}), children: /* @__PURE__ */ jsx10(AlignSelectLoaded, {}) });
355
+
356
+ // components/RichTextMenu/controls/Bold.tsx
357
+ init_react_import();
358
+ import { jsx as jsx11 } from "react/jsx-runtime";
359
+ function Bold2() {
360
+ const { editor, editorState } = useControlContext();
361
+ return /* @__PURE__ */ jsx11(
362
+ Control,
363
+ {
364
+ icon: /* @__PURE__ */ jsx11(Bold, {}),
365
+ onClick: (e) => {
366
+ e.stopPropagation();
367
+ editor == null ? void 0 : editor.chain().focus().toggleBold().run();
368
+ },
369
+ disabled: !(editorState == null ? void 0 : editorState.canBold),
370
+ active: editorState == null ? void 0 : editorState.isBold,
371
+ title: "Bold"
372
+ }
373
+ );
374
+ }
375
+
376
+ // components/RichTextMenu/controls/Italic.tsx
377
+ init_react_import();
378
+ import { jsx as jsx12 } from "react/jsx-runtime";
379
+ function Italic2() {
380
+ const { editor, editorState } = useControlContext();
381
+ return /* @__PURE__ */ jsx12(
382
+ Control,
383
+ {
384
+ icon: /* @__PURE__ */ jsx12(Italic, {}),
385
+ onClick: (e) => {
386
+ e.stopPropagation();
387
+ editor == null ? void 0 : editor.chain().focus().toggleItalic().run();
388
+ },
389
+ disabled: !(editorState == null ? void 0 : editorState.canItalic),
390
+ active: editorState == null ? void 0 : editorState.isItalic,
391
+ title: "Italic"
392
+ }
393
+ );
394
+ }
395
+
396
+ // components/RichTextMenu/controls/Underline.tsx
397
+ init_react_import();
398
+ import { jsx as jsx13 } from "react/jsx-runtime";
399
+ function Underline2() {
400
+ const { editor, editorState } = useControlContext();
401
+ return /* @__PURE__ */ jsx13(
402
+ Control,
403
+ {
404
+ icon: /* @__PURE__ */ jsx13(Underline, {}),
405
+ onClick: (e) => {
406
+ e.stopPropagation();
407
+ editor == null ? void 0 : editor.chain().focus().toggleUnderline().run();
408
+ },
409
+ disabled: !(editorState == null ? void 0 : editorState.canUnderline),
410
+ active: editorState == null ? void 0 : editorState.isUnderline,
411
+ title: "Underline"
412
+ }
413
+ );
414
+ }
415
+
416
+ // components/RichTextMenu/controls/Strikethrough.tsx
417
+ init_react_import();
418
+ import { jsx as jsx14 } from "react/jsx-runtime";
419
+ function Strikethrough2() {
420
+ const { editor, editorState } = useControlContext();
421
+ return /* @__PURE__ */ jsx14(
422
+ Control,
423
+ {
424
+ icon: /* @__PURE__ */ jsx14(Strikethrough, {}),
425
+ onClick: (e) => {
426
+ e.stopPropagation();
427
+ editor == null ? void 0 : editor.chain().focus().toggleStrike().run();
428
+ },
429
+ disabled: !(editorState == null ? void 0 : editorState.canStrike),
430
+ active: editorState == null ? void 0 : editorState.isStrike,
431
+ title: "Strikethrough"
432
+ }
433
+ );
434
+ }
435
+
436
+ // components/RichTextMenu/controls/InlineCode.tsx
437
+ init_react_import();
438
+ import { jsx as jsx15 } from "react/jsx-runtime";
439
+ function InlineCode() {
440
+ const { editor, editorState } = useControlContext();
441
+ return /* @__PURE__ */ jsx15(
442
+ Control,
443
+ {
444
+ icon: /* @__PURE__ */ jsx15(Code, {}),
445
+ onClick: (e) => {
446
+ e.stopPropagation();
447
+ editor == null ? void 0 : editor.chain().focus().toggleCode().run();
448
+ },
449
+ disabled: !(editorState == null ? void 0 : editorState.canInlineCode),
450
+ active: editorState == null ? void 0 : editorState.isInlineCode,
451
+ title: "Inline code"
452
+ }
453
+ );
454
+ }
455
+
456
+ // components/RichTextMenu/controls/BulletList.tsx
457
+ init_react_import();
458
+ import { jsx as jsx16 } from "react/jsx-runtime";
459
+ function BulletList() {
460
+ const { editor, editorState } = useControlContext();
461
+ return /* @__PURE__ */ jsx16(
462
+ Control,
463
+ {
464
+ icon: /* @__PURE__ */ jsx16(List, {}),
465
+ onClick: (e) => {
466
+ e.stopPropagation();
467
+ editor == null ? void 0 : editor.chain().focus().toggleBulletList().run();
468
+ },
469
+ disabled: !(editorState == null ? void 0 : editorState.canBulletList),
470
+ active: editorState == null ? void 0 : editorState.isBulletList,
471
+ title: "Bullet list"
472
+ }
473
+ );
474
+ }
475
+
476
+ // components/RichTextMenu/controls/OrderedList.tsx
477
+ init_react_import();
478
+ import { jsx as jsx17 } from "react/jsx-runtime";
479
+ function OrderedList() {
480
+ const { editor, editorState } = useControlContext();
481
+ return /* @__PURE__ */ jsx17(
482
+ Control,
483
+ {
484
+ icon: /* @__PURE__ */ jsx17(ListOrdered, {}),
485
+ onClick: (e) => {
486
+ e.stopPropagation();
487
+ editor == null ? void 0 : editor.chain().focus().toggleOrderedList().run();
488
+ },
489
+ disabled: !(editorState == null ? void 0 : editorState.canOrderedList),
490
+ active: editorState == null ? void 0 : editorState.isOrderedList,
491
+ title: "Ordered list"
492
+ }
493
+ );
494
+ }
495
+
496
+ // components/RichTextMenu/controls/CodeBlock.tsx
497
+ init_react_import();
498
+ import { jsx as jsx18 } from "react/jsx-runtime";
499
+ function CodeBlock() {
500
+ const { editor, editorState } = useControlContext();
501
+ return /* @__PURE__ */ jsx18(
502
+ Control,
503
+ {
504
+ icon: /* @__PURE__ */ jsx18(SquareCode, {}),
505
+ onClick: (e) => {
506
+ e.stopPropagation();
507
+ editor == null ? void 0 : editor.chain().focus().toggleCodeBlock().run();
508
+ },
509
+ disabled: !(editorState == null ? void 0 : editorState.canCodeBlock),
510
+ active: editorState == null ? void 0 : editorState.isCodeBlock,
511
+ title: "Code block"
512
+ }
513
+ );
514
+ }
515
+
516
+ // components/RichTextMenu/controls/Blockquote.tsx
517
+ init_react_import();
518
+ import { jsx as jsx19 } from "react/jsx-runtime";
519
+ function Blockquote() {
520
+ const { editor, editorState } = useControlContext();
521
+ return /* @__PURE__ */ jsx19(
522
+ Control,
523
+ {
524
+ icon: /* @__PURE__ */ jsx19(Quote, {}),
525
+ onClick: (e) => {
526
+ e.stopPropagation();
527
+ editor == null ? void 0 : editor.chain().focus().toggleBlockquote().run();
528
+ },
529
+ disabled: !(editorState == null ? void 0 : editorState.canBlockquote),
530
+ active: editorState == null ? void 0 : editorState.isBlockquote,
531
+ title: "Blockquote"
532
+ }
533
+ );
534
+ }
535
+
536
+ // components/RichTextMenu/controls/HorizontalRule.tsx
537
+ init_react_import();
538
+ import { jsx as jsx20 } from "react/jsx-runtime";
539
+ function HorizontalRule() {
540
+ const { editor, editorState } = useControlContext();
541
+ return /* @__PURE__ */ jsx20(
542
+ Control,
543
+ {
544
+ icon: /* @__PURE__ */ jsx20(Minus, {}),
545
+ onClick: (e) => {
546
+ e.stopPropagation();
547
+ editor == null ? void 0 : editor.chain().focus().setHorizontalRule().run();
548
+ },
549
+ disabled: !(editorState == null ? void 0 : editorState.canHorizontalRule),
550
+ title: "Horizontal rule"
551
+ }
552
+ );
553
+ }
554
+
555
+ // components/RichTextMenu/controls/HeadingSelect/index.tsx
556
+ init_react_import();
557
+ import { lazy as lazy2, Suspense as Suspense2 } from "react";
558
+
559
+ // components/RichTextMenu/controls/HeadingSelect/fallback.tsx
560
+ init_react_import();
561
+ import { jsx as jsx21 } from "react/jsx-runtime";
562
+ function HeadingSelectFallback() {
563
+ const ctx = useControlContext();
564
+ const headingOptions = useHeadingOptions(ctx.options);
565
+ return /* @__PURE__ */ jsx21(
566
+ SelectControl,
567
+ {
568
+ options: headingOptions,
569
+ onChange: () => {
570
+ },
571
+ value: "p",
572
+ defaultValue: "p",
573
+ renderDefaultIcon: Heading
574
+ }
575
+ );
576
+ }
577
+
578
+ // components/RichTextMenu/controls/HeadingSelect/index.tsx
579
+ import { jsx as jsx22 } from "react/jsx-runtime";
580
+ var HeadingSelectLoaded = lazy2(
581
+ () => import("./loaded-OBY7OMS6.mjs").then((m) => ({
582
+ default: m.HeadingSelectLoaded
583
+ }))
584
+ );
585
+ var HeadingSelect = () => /* @__PURE__ */ jsx22(Suspense2, { fallback: /* @__PURE__ */ jsx22(HeadingSelectFallback, {}), children: /* @__PURE__ */ jsx22(HeadingSelectLoaded, {}) });
586
+
587
+ // components/RichTextMenu/controls/ListSelect/index.tsx
588
+ init_react_import();
589
+ import { lazy as lazy3, Suspense as Suspense3 } from "react";
590
+
591
+ // components/RichTextMenu/controls/ListSelect/fallback.tsx
592
+ init_react_import();
593
+ import { jsx as jsx23 } from "react/jsx-runtime";
594
+ function ListSelectFallback() {
595
+ const ctx = useControlContext();
596
+ const listOptions = useListOptions(ctx.options);
597
+ return /* @__PURE__ */ jsx23(
598
+ SelectControl,
599
+ {
600
+ options: listOptions,
601
+ onChange: () => {
602
+ },
603
+ value: "p",
604
+ defaultValue: "p",
605
+ renderDefaultIcon: List
606
+ }
607
+ );
608
+ }
609
+
610
+ // components/RichTextMenu/controls/ListSelect/index.tsx
611
+ import { jsx as jsx24 } from "react/jsx-runtime";
612
+ var ListSelectLoaded = lazy3(
613
+ () => import("./loaded-N3FYGF2Y.mjs").then((m) => ({
614
+ default: m.ListSelectLoaded
615
+ }))
616
+ );
617
+ var ListSelect = () => /* @__PURE__ */ jsx24(Suspense3, { fallback: /* @__PURE__ */ jsx24(ListSelectFallback, {}), children: /* @__PURE__ */ jsx24(ListSelectLoaded, {}) });
618
+
619
+ // components/RichTextMenu/inner.tsx
620
+ import { jsx as jsx25, jsxs as jsxs3 } from "react/jsx-runtime";
621
+ var getClassName5 = get_class_name_factory_default("RichTextMenu", styles_module_default3);
622
+ var DefaultMenu = ({ children }) => {
623
+ return /* @__PURE__ */ jsx25(RichTextMenu, { children });
624
+ };
625
+ var RichTextMenu = ({ children }) => {
626
+ const { inline } = useControlContext();
627
+ return /* @__PURE__ */ jsx25("div", { className: getClassName5({ inline, form: !inline }), "data-puck-rte-menu": true, children });
628
+ };
629
+ var Group2 = ({ children }) => {
630
+ return /* @__PURE__ */ jsx25("div", { className: getClassName5("group"), children });
631
+ };
632
+ RichTextMenu.Group = Group2;
633
+ RichTextMenu.Control = Control;
634
+ RichTextMenu.AlignCenter = AlignCenter2;
635
+ RichTextMenu.AlignJustify = AlignJustify2;
636
+ RichTextMenu.AlignLeft = AlignLeft2;
637
+ RichTextMenu.AlignRight = AlignRight2;
638
+ RichTextMenu.AlignSelect = AlignSelect;
639
+ RichTextMenu.Blockquote = Blockquote;
640
+ RichTextMenu.Bold = Bold2;
641
+ RichTextMenu.BulletList = BulletList;
642
+ RichTextMenu.CodeBlock = CodeBlock;
643
+ RichTextMenu.HeadingSelect = HeadingSelect;
644
+ RichTextMenu.HorizontalRule = HorizontalRule;
645
+ RichTextMenu.InlineCode = InlineCode;
646
+ RichTextMenu.Italic = Italic2;
647
+ RichTextMenu.ListSelect = ListSelect;
648
+ RichTextMenu.OrderedList = OrderedList;
649
+ RichTextMenu.Strikethrough = Strikethrough2;
650
+ RichTextMenu.Underline = Underline2;
651
+ var LoadedRichTextMenuInner = ({
652
+ editor = null,
653
+ editorState = null,
654
+ field,
655
+ readOnly,
656
+ inline
657
+ }) => {
658
+ const { renderMenu, renderInlineMenu } = field;
659
+ const InlineMenu = useMemo(
660
+ () => renderInlineMenu || DefaultMenu,
661
+ [renderInlineMenu]
662
+ );
663
+ const Menu = useMemo(() => renderMenu || DefaultMenu, [renderMenu]);
664
+ return /* @__PURE__ */ jsx25(
665
+ ControlContext.Provider,
666
+ {
667
+ value: { editor, editorState, inline, options: field.options, readOnly },
668
+ children: inline ? /* @__PURE__ */ jsx25(
669
+ InlineMenu,
670
+ {
671
+ editor,
672
+ editorState,
673
+ readOnly,
674
+ children: /* @__PURE__ */ jsxs3(Group2, { children: [
675
+ /* @__PURE__ */ jsx25(Bold2, {}),
676
+ /* @__PURE__ */ jsx25(Italic2, {}),
677
+ /* @__PURE__ */ jsx25(Underline2, {})
678
+ ] })
679
+ }
680
+ ) : /* @__PURE__ */ jsxs3(Menu, { editor, editorState, readOnly, children: [
681
+ /* @__PURE__ */ jsxs3(Group2, { children: [
682
+ /* @__PURE__ */ jsx25(HeadingSelect, {}),
683
+ /* @__PURE__ */ jsx25(ListSelect, {})
684
+ ] }),
685
+ /* @__PURE__ */ jsxs3(Group2, { children: [
686
+ /* @__PURE__ */ jsx25(Bold2, {}),
687
+ /* @__PURE__ */ jsx25(Italic2, {}),
688
+ /* @__PURE__ */ jsx25(Underline2, {})
689
+ ] }),
690
+ /* @__PURE__ */ jsx25(Group2, { children: /* @__PURE__ */ jsx25(AlignSelect, {}) })
691
+ ] })
692
+ }
693
+ );
694
+ };
695
+
696
+ export {
697
+ ActionBar,
698
+ Action,
699
+ Group,
700
+ Label,
701
+ Separator,
702
+ Loader,
703
+ IconButton,
704
+ RichTextMenu,
705
+ LoadedRichTextMenuInner
706
+ };