@react-email/editor 0.0.0-experimental.4 → 0.0.0-experimental.40

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 (74) hide show
  1. package/dist/core/index.cjs +9 -0
  2. package/dist/core/index.d.cts +2 -0
  3. package/dist/core/index.d.mts +3 -0
  4. package/dist/core/index.mjs +4 -0
  5. package/dist/create-paste-handler-B8BtjBk3.d.cts +14 -0
  6. package/dist/create-paste-handler-B8BtjBk3.d.cts.map +1 -0
  7. package/dist/create-paste-handler-CGR738bC.d.mts +14 -0
  8. package/dist/create-paste-handler-CGR738bC.d.mts.map +1 -0
  9. package/dist/event-bus-CHEzOS_O.mjs +329 -0
  10. package/dist/event-bus-CHEzOS_O.mjs.map +1 -0
  11. package/dist/event-bus-fb8U7hrl.cjs +450 -0
  12. package/dist/extension-DyY8_bh4.mjs +1110 -0
  13. package/dist/extension-DyY8_bh4.mjs.map +1 -0
  14. package/dist/extension-w5VaUeSw.cjs +1235 -0
  15. package/dist/extensions/index.cjs +51 -0
  16. package/dist/extensions/index.d.cts +399 -0
  17. package/dist/extensions/index.d.cts.map +1 -0
  18. package/dist/extensions/index.d.mts +400 -0
  19. package/dist/extensions/index.d.mts.map +1 -0
  20. package/dist/extensions/index.mjs +5 -0
  21. package/dist/extensions-BvfmaKCn.mjs +2088 -0
  22. package/dist/extensions-BvfmaKCn.mjs.map +1 -0
  23. package/dist/extensions-CkjPj2JO.cjs +2369 -0
  24. package/dist/global-content-D_WYaFgX.mjs +78 -0
  25. package/dist/global-content-D_WYaFgX.mjs.map +1 -0
  26. package/dist/global-content-bJgotqmA.cjs +89 -0
  27. package/dist/index-C4KcMQ0R.d.cts +161 -0
  28. package/dist/index-C4KcMQ0R.d.cts.map +1 -0
  29. package/dist/index-CxX7W63O.d.mts +161 -0
  30. package/dist/index-CxX7W63O.d.mts.map +1 -0
  31. package/dist/index.cjs +74 -0
  32. package/dist/index.css +832 -0
  33. package/dist/index.css.map +1 -0
  34. package/dist/index.d.cts +33 -0
  35. package/dist/index.d.cts.map +1 -0
  36. package/dist/index.d.mts +31 -277
  37. package/dist/index.d.mts.map +1 -1
  38. package/dist/index.mjs +64 -1377
  39. package/dist/index.mjs.map +1 -1
  40. package/dist/plugins/index.cjs +23 -0
  41. package/dist/plugins/index.d.cts +191 -0
  42. package/dist/plugins/index.d.cts.map +1 -0
  43. package/dist/plugins/index.d.mts +191 -0
  44. package/dist/plugins/index.d.mts.map +1 -0
  45. package/dist/plugins/index.mjs +3 -0
  46. package/dist/root-CkYaJZpj.mjs +2316 -0
  47. package/dist/root-CkYaJZpj.mjs.map +1 -0
  48. package/dist/root-Gu08xybW.cjs +2832 -0
  49. package/dist/set-text-alignment-Cv72txmv.cjs +24 -0
  50. package/dist/set-text-alignment-OA8IMWmO.mjs +19 -0
  51. package/dist/set-text-alignment-OA8IMWmO.mjs.map +1 -0
  52. package/dist/styles-C-cCyJCn.cjs +211 -0
  53. package/dist/styles-_TMw3YxC.mjs +194 -0
  54. package/dist/styles-_TMw3YxC.mjs.map +1 -0
  55. package/dist/ui/bubble-menu/bubble-menu.css +285 -0
  56. package/dist/ui/index.cjs +147 -0
  57. package/dist/ui/index.d.cts +939 -0
  58. package/dist/ui/index.d.cts.map +1 -0
  59. package/dist/ui/index.d.mts +939 -0
  60. package/dist/ui/index.d.mts.map +1 -0
  61. package/dist/ui/index.mjs +60 -0
  62. package/dist/ui/index.mjs.map +1 -0
  63. package/dist/ui/slash-command/slash-command.css +44 -0
  64. package/dist/ui/themes/default.css +830 -0
  65. package/dist/utils/index.cjs +3 -0
  66. package/dist/utils/index.d.cts +7 -0
  67. package/dist/utils/index.d.cts.map +1 -0
  68. package/dist/utils/index.d.mts +7 -0
  69. package/dist/utils/index.d.mts.map +1 -0
  70. package/dist/utils/index.mjs +3 -0
  71. package/package.json +109 -21
  72. package/dist/index.d.ts +0 -279
  73. package/dist/index.d.ts.map +0 -1
  74. package/dist/index.js +0 -1436
@@ -0,0 +1,2832 @@
1
+ const require_event_bus = require('./event-bus-fb8U7hrl.cjs');
2
+ const require_set_text_alignment = require('./set-text-alignment-Cv72txmv.cjs');
3
+ let _tiptap_react = require("@tiptap/react");
4
+ let react = require("react");
5
+ react = require_event_bus.__toESM(react);
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ let _tiptap_pm_state = require("@tiptap/pm/state");
8
+ let _tiptap_react_menus = require("@tiptap/react/menus");
9
+ let _radix_ui_react_popover = require("@radix-ui/react-popover");
10
+ _radix_ui_react_popover = require_event_bus.__toESM(_radix_ui_react_popover);
11
+ let _floating_ui_react_dom = require("@floating-ui/react-dom");
12
+ let _tiptap_suggestion = require("@tiptap/suggestion");
13
+ _tiptap_suggestion = require_event_bus.__toESM(_tiptap_suggestion);
14
+ let react_dom = require("react-dom");
15
+
16
+ //#region src/ui/icons/align-center.tsx
17
+ function AlignCenterIcon({ size, width, height, ...props }) {
18
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
19
+ xmlns: "http://www.w3.org/2000/svg",
20
+ width: size ?? width ?? 24,
21
+ height: size ?? height ?? 24,
22
+ viewBox: "0 0 24 24",
23
+ fill: "none",
24
+ stroke: "currentColor",
25
+ strokeWidth: 2,
26
+ strokeLinecap: "round",
27
+ strokeLinejoin: "round",
28
+ "aria-hidden": "true",
29
+ ...props,
30
+ children: [
31
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 5H3" }),
32
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M17 12H7" }),
33
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M19 19H5" })
34
+ ]
35
+ });
36
+ }
37
+
38
+ //#endregion
39
+ //#region src/ui/icons/align-left.tsx
40
+ function AlignLeftIcon({ size, width, height, ...props }) {
41
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
42
+ xmlns: "http://www.w3.org/2000/svg",
43
+ width: size ?? width ?? 24,
44
+ height: size ?? height ?? 24,
45
+ viewBox: "0 0 24 24",
46
+ fill: "none",
47
+ stroke: "currentColor",
48
+ strokeWidth: 2,
49
+ strokeLinecap: "round",
50
+ strokeLinejoin: "round",
51
+ "aria-hidden": "true",
52
+ ...props,
53
+ children: [
54
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 5H3" }),
55
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M15 12H3" }),
56
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M17 19H3" })
57
+ ]
58
+ });
59
+ }
60
+
61
+ //#endregion
62
+ //#region src/ui/icons/align-right.tsx
63
+ function AlignRightIcon({ size, width, height, ...props }) {
64
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ width: size ?? width ?? 24,
67
+ height: size ?? height ?? 24,
68
+ viewBox: "0 0 24 24",
69
+ fill: "none",
70
+ stroke: "currentColor",
71
+ strokeWidth: 2,
72
+ strokeLinecap: "round",
73
+ strokeLinejoin: "round",
74
+ "aria-hidden": "true",
75
+ ...props,
76
+ children: [
77
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 5H3" }),
78
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 12H9" }),
79
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 19H7" })
80
+ ]
81
+ });
82
+ }
83
+
84
+ //#endregion
85
+ //#region src/ui/icons/bold.tsx
86
+ function BoldIcon({ size, width, height, ...props }) {
87
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
88
+ xmlns: "http://www.w3.org/2000/svg",
89
+ width: size ?? width ?? 24,
90
+ height: size ?? height ?? 24,
91
+ viewBox: "0 0 24 24",
92
+ fill: "none",
93
+ stroke: "currentColor",
94
+ strokeWidth: 2,
95
+ strokeLinecap: "round",
96
+ strokeLinejoin: "round",
97
+ "aria-hidden": "true",
98
+ ...props,
99
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" })
100
+ });
101
+ }
102
+
103
+ //#endregion
104
+ //#region src/ui/icons/case-upper.tsx
105
+ function CaseUpperIcon({ size, width, height, ...props }) {
106
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
107
+ xmlns: "http://www.w3.org/2000/svg",
108
+ width: size ?? width ?? 24,
109
+ height: size ?? height ?? 24,
110
+ viewBox: "0 0 24 24",
111
+ fill: "none",
112
+ stroke: "currentColor",
113
+ strokeWidth: 2,
114
+ strokeLinecap: "round",
115
+ strokeLinejoin: "round",
116
+ "aria-hidden": "true",
117
+ ...props,
118
+ children: [
119
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M15 11h4.5a1 1 0 0 1 0 5h-4a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h3a1 1 0 0 1 0 5" }),
120
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16" }),
121
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3.304 13h6.392" })
122
+ ]
123
+ });
124
+ }
125
+
126
+ //#endregion
127
+ //#region src/ui/icons/check.tsx
128
+ function Check({ size, width, height, ...props }) {
129
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
130
+ xmlns: "http://www.w3.org/2000/svg",
131
+ width: size ?? width ?? 24,
132
+ height: size ?? height ?? 24,
133
+ viewBox: "0 0 24 24",
134
+ fill: "none",
135
+ stroke: "currentColor",
136
+ strokeWidth: 2,
137
+ strokeLinecap: "round",
138
+ strokeLinejoin: "round",
139
+ "aria-hidden": "true",
140
+ ...props,
141
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M20 6 9 17l-5-5" })
142
+ });
143
+ }
144
+
145
+ //#endregion
146
+ //#region src/ui/icons/chevron-down.tsx
147
+ function ChevronDown({ size, width, height, ...props }) {
148
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
149
+ xmlns: "http://www.w3.org/2000/svg",
150
+ width: size ?? width ?? 24,
151
+ height: size ?? height ?? 24,
152
+ viewBox: "0 0 24 24",
153
+ fill: "none",
154
+ stroke: "currentColor",
155
+ strokeWidth: 2,
156
+ strokeLinecap: "round",
157
+ strokeLinejoin: "round",
158
+ "aria-hidden": "true",
159
+ ...props,
160
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m6 9 6 6 6-6" })
161
+ });
162
+ }
163
+
164
+ //#endregion
165
+ //#region src/ui/icons/code.tsx
166
+ function CodeIcon({ size, width, height, ...props }) {
167
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
168
+ xmlns: "http://www.w3.org/2000/svg",
169
+ width: size ?? width ?? 24,
170
+ height: size ?? height ?? 24,
171
+ viewBox: "0 0 24 24",
172
+ fill: "none",
173
+ stroke: "currentColor",
174
+ strokeWidth: 2,
175
+ strokeLinecap: "round",
176
+ strokeLinejoin: "round",
177
+ "aria-hidden": "true",
178
+ ...props,
179
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m16 18 6-6-6-6" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m8 6-6 6 6 6" })]
180
+ });
181
+ }
182
+ const Code = CodeIcon;
183
+
184
+ //#endregion
185
+ //#region src/ui/icons/columns-2.tsx
186
+ function Columns2({ size, width, height, ...props }) {
187
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
188
+ xmlns: "http://www.w3.org/2000/svg",
189
+ width: size ?? width ?? 24,
190
+ height: size ?? height ?? 24,
191
+ viewBox: "0 0 24 24",
192
+ fill: "none",
193
+ stroke: "currentColor",
194
+ strokeWidth: 2,
195
+ strokeLinecap: "round",
196
+ strokeLinejoin: "round",
197
+ "aria-hidden": "true",
198
+ ...props,
199
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
200
+ width: "18",
201
+ height: "18",
202
+ x: "3",
203
+ y: "3",
204
+ rx: "2"
205
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 3v18" })]
206
+ });
207
+ }
208
+
209
+ //#endregion
210
+ //#region src/ui/icons/columns-3.tsx
211
+ function Columns3({ size, width, height, ...props }) {
212
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
213
+ xmlns: "http://www.w3.org/2000/svg",
214
+ width: size ?? width ?? 24,
215
+ height: size ?? height ?? 24,
216
+ viewBox: "0 0 24 24",
217
+ fill: "none",
218
+ stroke: "currentColor",
219
+ strokeWidth: 2,
220
+ strokeLinecap: "round",
221
+ strokeLinejoin: "round",
222
+ "aria-hidden": "true",
223
+ ...props,
224
+ children: [
225
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
226
+ width: "18",
227
+ height: "18",
228
+ x: "3",
229
+ y: "3",
230
+ rx: "2"
231
+ }),
232
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M9 3v18" }),
233
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M15 3v18" })
234
+ ]
235
+ });
236
+ }
237
+
238
+ //#endregion
239
+ //#region src/ui/icons/columns-4.tsx
240
+ function Columns4({ size, width, height, ...props }) {
241
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
242
+ xmlns: "http://www.w3.org/2000/svg",
243
+ width: size ?? width ?? 24,
244
+ height: size ?? height ?? 24,
245
+ viewBox: "0 0 24 24",
246
+ fill: "none",
247
+ stroke: "currentColor",
248
+ strokeWidth: 2,
249
+ strokeLinecap: "round",
250
+ strokeLinejoin: "round",
251
+ "aria-hidden": "true",
252
+ ...props,
253
+ children: [
254
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
255
+ width: "18",
256
+ height: "18",
257
+ x: "3",
258
+ y: "3",
259
+ rx: "2"
260
+ }),
261
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M7.5 3v18" }),
262
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 3v18" }),
263
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M16.5 3v18" })
264
+ ]
265
+ });
266
+ }
267
+
268
+ //#endregion
269
+ //#region src/ui/icons/external-link.tsx
270
+ function ExternalLinkIcon({ size, width, height, ...props }) {
271
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
272
+ xmlns: "http://www.w3.org/2000/svg",
273
+ width: size ?? width ?? 24,
274
+ height: size ?? height ?? 24,
275
+ viewBox: "0 0 24 24",
276
+ fill: "none",
277
+ stroke: "currentColor",
278
+ strokeWidth: 2,
279
+ strokeLinecap: "round",
280
+ strokeLinejoin: "round",
281
+ "aria-hidden": "true",
282
+ ...props,
283
+ children: [
284
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M15 3h6v6" }),
285
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10 14 21 3" }),
286
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
287
+ ]
288
+ });
289
+ }
290
+
291
+ //#endregion
292
+ //#region src/ui/icons/heading-1.tsx
293
+ function Heading1({ size, width, height, ...props }) {
294
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
295
+ xmlns: "http://www.w3.org/2000/svg",
296
+ width: size ?? width ?? 24,
297
+ height: size ?? height ?? 24,
298
+ viewBox: "0 0 24 24",
299
+ fill: "none",
300
+ stroke: "currentColor",
301
+ strokeWidth: 2,
302
+ strokeLinecap: "round",
303
+ strokeLinejoin: "round",
304
+ "aria-hidden": "true",
305
+ ...props,
306
+ children: [
307
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 12h8" }),
308
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 18V6" }),
309
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 18V6" }),
310
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m17 12 3-2v8" })
311
+ ]
312
+ });
313
+ }
314
+
315
+ //#endregion
316
+ //#region src/ui/icons/heading-2.tsx
317
+ function Heading2({ size, width, height, ...props }) {
318
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
319
+ xmlns: "http://www.w3.org/2000/svg",
320
+ width: size ?? width ?? 24,
321
+ height: size ?? height ?? 24,
322
+ viewBox: "0 0 24 24",
323
+ fill: "none",
324
+ stroke: "currentColor",
325
+ strokeWidth: 2,
326
+ strokeLinecap: "round",
327
+ strokeLinejoin: "round",
328
+ "aria-hidden": "true",
329
+ ...props,
330
+ children: [
331
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 12h8" }),
332
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 18V6" }),
333
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 18V6" }),
334
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1" })
335
+ ]
336
+ });
337
+ }
338
+
339
+ //#endregion
340
+ //#region src/ui/icons/heading-3.tsx
341
+ function Heading3({ size, width, height, ...props }) {
342
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
343
+ xmlns: "http://www.w3.org/2000/svg",
344
+ width: size ?? width ?? 24,
345
+ height: size ?? height ?? 24,
346
+ viewBox: "0 0 24 24",
347
+ fill: "none",
348
+ stroke: "currentColor",
349
+ strokeWidth: 2,
350
+ strokeLinecap: "round",
351
+ strokeLinejoin: "round",
352
+ "aria-hidden": "true",
353
+ ...props,
354
+ children: [
355
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 12h8" }),
356
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 18V6" }),
357
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 18V6" }),
358
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2" }),
359
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2" })
360
+ ]
361
+ });
362
+ }
363
+
364
+ //#endregion
365
+ //#region src/ui/icons/italic.tsx
366
+ function ItalicIcon({ size, width, height, ...props }) {
367
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
368
+ xmlns: "http://www.w3.org/2000/svg",
369
+ width: size ?? width ?? 24,
370
+ height: size ?? height ?? 24,
371
+ viewBox: "0 0 24 24",
372
+ fill: "none",
373
+ stroke: "currentColor",
374
+ strokeWidth: 2,
375
+ strokeLinecap: "round",
376
+ strokeLinejoin: "round",
377
+ "aria-hidden": "true",
378
+ ...props,
379
+ children: [
380
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
381
+ x1: "19",
382
+ x2: "10",
383
+ y1: "4",
384
+ y2: "4"
385
+ }),
386
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
387
+ x1: "14",
388
+ x2: "5",
389
+ y1: "20",
390
+ y2: "20"
391
+ }),
392
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
393
+ x1: "15",
394
+ x2: "9",
395
+ y1: "4",
396
+ y2: "20"
397
+ })
398
+ ]
399
+ });
400
+ }
401
+
402
+ //#endregion
403
+ //#region src/ui/icons/link.tsx
404
+ function LinkIcon({ size, width, height, ...props }) {
405
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
406
+ xmlns: "http://www.w3.org/2000/svg",
407
+ width: size ?? width ?? 24,
408
+ height: size ?? height ?? 24,
409
+ viewBox: "0 0 24 24",
410
+ fill: "none",
411
+ stroke: "currentColor",
412
+ strokeWidth: 2,
413
+ strokeLinecap: "round",
414
+ strokeLinejoin: "round",
415
+ "aria-hidden": "true",
416
+ ...props,
417
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" })]
418
+ });
419
+ }
420
+
421
+ //#endregion
422
+ //#region src/ui/icons/list.tsx
423
+ function List({ size, width, height, ...props }) {
424
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
425
+ xmlns: "http://www.w3.org/2000/svg",
426
+ width: size ?? width ?? 24,
427
+ height: size ?? height ?? 24,
428
+ viewBox: "0 0 24 24",
429
+ fill: "none",
430
+ stroke: "currentColor",
431
+ strokeWidth: 2,
432
+ strokeLinecap: "round",
433
+ strokeLinejoin: "round",
434
+ "aria-hidden": "true",
435
+ ...props,
436
+ children: [
437
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 5h.01" }),
438
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 12h.01" }),
439
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 19h.01" }),
440
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M8 5h13" }),
441
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M8 12h13" }),
442
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M8 19h13" })
443
+ ]
444
+ });
445
+ }
446
+
447
+ //#endregion
448
+ //#region src/ui/icons/list-ordered.tsx
449
+ function ListOrdered({ size, width, height, ...props }) {
450
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
451
+ xmlns: "http://www.w3.org/2000/svg",
452
+ width: size ?? width ?? 24,
453
+ height: size ?? height ?? 24,
454
+ viewBox: "0 0 24 24",
455
+ fill: "none",
456
+ stroke: "currentColor",
457
+ strokeWidth: 2,
458
+ strokeLinecap: "round",
459
+ strokeLinejoin: "round",
460
+ "aria-hidden": "true",
461
+ ...props,
462
+ children: [
463
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M11 5h10" }),
464
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M11 12h10" }),
465
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M11 19h10" }),
466
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 4h1v5" }),
467
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 9h2" }),
468
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02" })
469
+ ]
470
+ });
471
+ }
472
+
473
+ //#endregion
474
+ //#region src/ui/icons/mouse-pointer.tsx
475
+ function MousePointer({ size, width, height, ...props }) {
476
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
477
+ xmlns: "http://www.w3.org/2000/svg",
478
+ width: size ?? width ?? 24,
479
+ height: size ?? height ?? 24,
480
+ viewBox: "0 0 24 24",
481
+ fill: "none",
482
+ stroke: "currentColor",
483
+ strokeWidth: 2,
484
+ strokeLinecap: "round",
485
+ strokeLinejoin: "round",
486
+ "aria-hidden": "true",
487
+ ...props,
488
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12.586 12.586 19 19" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z" })]
489
+ });
490
+ }
491
+
492
+ //#endregion
493
+ //#region src/ui/icons/pencil.tsx
494
+ function PencilIcon({ size, width, height, ...props }) {
495
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
496
+ xmlns: "http://www.w3.org/2000/svg",
497
+ width: size ?? width ?? 24,
498
+ height: size ?? height ?? 24,
499
+ viewBox: "0 0 24 24",
500
+ fill: "none",
501
+ stroke: "currentColor",
502
+ strokeWidth: 2,
503
+ strokeLinecap: "round",
504
+ strokeLinejoin: "round",
505
+ "aria-hidden": "true",
506
+ ...props,
507
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m15 5 4 4" })]
508
+ });
509
+ }
510
+
511
+ //#endregion
512
+ //#region src/ui/icons/rows-2.tsx
513
+ function Rows2({ size, width, height, ...props }) {
514
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
515
+ xmlns: "http://www.w3.org/2000/svg",
516
+ width: size ?? width ?? 24,
517
+ height: size ?? height ?? 24,
518
+ viewBox: "0 0 24 24",
519
+ fill: "none",
520
+ stroke: "currentColor",
521
+ strokeWidth: 2,
522
+ strokeLinecap: "round",
523
+ strokeLinejoin: "round",
524
+ "aria-hidden": "true",
525
+ ...props,
526
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
527
+ width: "18",
528
+ height: "18",
529
+ x: "3",
530
+ y: "3",
531
+ rx: "2"
532
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 12h18" })]
533
+ });
534
+ }
535
+
536
+ //#endregion
537
+ //#region src/ui/icons/split-square-vertical.tsx
538
+ function SplitSquareVertical({ size, width, height, ...props }) {
539
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
540
+ xmlns: "http://www.w3.org/2000/svg",
541
+ width: size ?? width ?? 24,
542
+ height: size ?? height ?? 24,
543
+ viewBox: "0 0 24 24",
544
+ fill: "none",
545
+ stroke: "currentColor",
546
+ strokeWidth: 2,
547
+ strokeLinecap: "round",
548
+ strokeLinejoin: "round",
549
+ "aria-hidden": "true",
550
+ ...props,
551
+ children: [
552
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M5 8V5c0-1 1-2 2-2h10c1 0 2 1 2 2v3" }),
553
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M19 16v3c0 1-1 2-2 2H7c-1 0-2-1-2-2v-3" }),
554
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
555
+ x1: "4",
556
+ x2: "20",
557
+ y1: "12",
558
+ y2: "12"
559
+ })
560
+ ]
561
+ });
562
+ }
563
+
564
+ //#endregion
565
+ //#region src/ui/icons/square-code.tsx
566
+ function SquareCode({ size, width, height, ...props }) {
567
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
568
+ xmlns: "http://www.w3.org/2000/svg",
569
+ width: size ?? width ?? 24,
570
+ height: size ?? height ?? 24,
571
+ viewBox: "0 0 24 24",
572
+ fill: "none",
573
+ stroke: "currentColor",
574
+ strokeWidth: 2,
575
+ strokeLinecap: "round",
576
+ strokeLinejoin: "round",
577
+ "aria-hidden": "true",
578
+ ...props,
579
+ children: [
580
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m10 9-3 3 3 3" }),
581
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m14 15 3-3-3-3" }),
582
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
583
+ x: "3",
584
+ y: "3",
585
+ width: "18",
586
+ height: "18",
587
+ rx: "2"
588
+ })
589
+ ]
590
+ });
591
+ }
592
+
593
+ //#endregion
594
+ //#region src/ui/icons/strikethrough.tsx
595
+ function StrikethroughIcon({ size, width, height, ...props }) {
596
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
597
+ xmlns: "http://www.w3.org/2000/svg",
598
+ width: size ?? width ?? 24,
599
+ height: size ?? height ?? 24,
600
+ viewBox: "0 0 24 24",
601
+ fill: "none",
602
+ stroke: "currentColor",
603
+ strokeWidth: 2,
604
+ strokeLinecap: "round",
605
+ strokeLinejoin: "round",
606
+ "aria-hidden": "true",
607
+ ...props,
608
+ children: [
609
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M16 4H9a3 3 0 0 0-2.83 4" }),
610
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M14 12a4 4 0 0 1 0 8H6" }),
611
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
612
+ x1: "4",
613
+ x2: "20",
614
+ y1: "12",
615
+ y2: "12"
616
+ })
617
+ ]
618
+ });
619
+ }
620
+
621
+ //#endregion
622
+ //#region src/ui/icons/text.tsx
623
+ function TextIcon({ size, width, height, ...props }) {
624
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
625
+ xmlns: "http://www.w3.org/2000/svg",
626
+ width: size ?? width ?? 24,
627
+ height: size ?? height ?? 24,
628
+ viewBox: "0 0 24 24",
629
+ fill: "none",
630
+ stroke: "currentColor",
631
+ strokeWidth: 2,
632
+ strokeLinecap: "round",
633
+ strokeLinejoin: "round",
634
+ "aria-hidden": "true",
635
+ ...props,
636
+ children: [
637
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 5H3" }),
638
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M15 12H3" }),
639
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M17 19H3" })
640
+ ]
641
+ });
642
+ }
643
+ const Text = TextIcon;
644
+
645
+ //#endregion
646
+ //#region src/ui/icons/text-quote.tsx
647
+ function TextQuote({ size, width, height, ...props }) {
648
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
649
+ xmlns: "http://www.w3.org/2000/svg",
650
+ width: size ?? width ?? 24,
651
+ height: size ?? height ?? 24,
652
+ viewBox: "0 0 24 24",
653
+ fill: "none",
654
+ stroke: "currentColor",
655
+ strokeWidth: 2,
656
+ strokeLinecap: "round",
657
+ strokeLinejoin: "round",
658
+ "aria-hidden": "true",
659
+ ...props,
660
+ children: [
661
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M17 5H3" }),
662
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 12H8" }),
663
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 19H8" }),
664
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 12v7" })
665
+ ]
666
+ });
667
+ }
668
+
669
+ //#endregion
670
+ //#region src/ui/icons/underline.tsx
671
+ function UnderlineIcon({ size, width, height, ...props }) {
672
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
673
+ xmlns: "http://www.w3.org/2000/svg",
674
+ width: size ?? width ?? 24,
675
+ height: size ?? height ?? 24,
676
+ viewBox: "0 0 24 24",
677
+ fill: "none",
678
+ stroke: "currentColor",
679
+ strokeWidth: 2,
680
+ strokeLinecap: "round",
681
+ strokeLinejoin: "round",
682
+ "aria-hidden": "true",
683
+ ...props,
684
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M6 4v6a6 6 0 0 0 12 0V4" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
685
+ x1: "4",
686
+ x2: "20",
687
+ y1: "20",
688
+ y2: "20"
689
+ })]
690
+ });
691
+ }
692
+
693
+ //#endregion
694
+ //#region src/ui/icons/unlink.tsx
695
+ function UnlinkIcon({ size, width, height, ...props }) {
696
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
697
+ xmlns: "http://www.w3.org/2000/svg",
698
+ width: size ?? width ?? 24,
699
+ height: size ?? height ?? 24,
700
+ viewBox: "0 0 24 24",
701
+ fill: "none",
702
+ stroke: "currentColor",
703
+ strokeWidth: 2,
704
+ strokeLinecap: "round",
705
+ strokeLinejoin: "round",
706
+ "aria-hidden": "true",
707
+ ...props,
708
+ children: [
709
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71" }),
710
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71" }),
711
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
712
+ x1: "8",
713
+ x2: "8",
714
+ y1: "2",
715
+ y2: "5"
716
+ }),
717
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
718
+ x1: "2",
719
+ x2: "5",
720
+ y1: "8",
721
+ y2: "8"
722
+ }),
723
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
724
+ x1: "16",
725
+ x2: "16",
726
+ y1: "19",
727
+ y2: "22"
728
+ }),
729
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
730
+ x1: "19",
731
+ x2: "22",
732
+ y1: "16",
733
+ y2: "16"
734
+ })
735
+ ]
736
+ });
737
+ }
738
+
739
+ //#endregion
740
+ //#region src/ui/bubble-menu/context.tsx
741
+ const BubbleMenuContext = react.createContext(null);
742
+ function useBubbleMenuContext() {
743
+ const context = react.useContext(BubbleMenuContext);
744
+ if (!context) throw new Error("BubbleMenu compound components must be used within <BubbleMenu.Root>");
745
+ return context;
746
+ }
747
+
748
+ //#endregion
749
+ //#region src/ui/bubble-menu/button-edit-link.tsx
750
+ function BubbleMenuButtonEditLink({ className, children, onClick, onMouseDown, ...rest }) {
751
+ const { setIsEditing } = useBubbleMenuContext();
752
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
753
+ ...rest,
754
+ type: "button",
755
+ "aria-label": "Edit link",
756
+ "data-re-btn-bm-item": "",
757
+ "data-item": "edit-link",
758
+ className,
759
+ onMouseDown: (e) => {
760
+ e.preventDefault();
761
+ onMouseDown?.(e);
762
+ },
763
+ onClick: (e) => {
764
+ onClick?.(e);
765
+ setIsEditing(true);
766
+ },
767
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PencilIcon, {})
768
+ });
769
+ }
770
+
771
+ //#endregion
772
+ //#region src/ui/bubble-menu/utils.ts
773
+ const SAFE_PROTOCOLS = new Set([
774
+ "http:",
775
+ "https:",
776
+ "mailto:",
777
+ "tel:"
778
+ ]);
779
+ /**
780
+ * Basic URL validation and auto-prefixing.
781
+ * Rejects dangerous schemes (javascript:, data:, vbscript:, etc.).
782
+ * Returns the valid URL string or null.
783
+ */
784
+ function getUrlFromString(str) {
785
+ if (str === "#") return str;
786
+ try {
787
+ const url = new URL(str);
788
+ if (SAFE_PROTOCOLS.has(url.protocol)) return str;
789
+ return null;
790
+ } catch {}
791
+ try {
792
+ if (str.includes(".") && !str.includes(" ")) return new URL(`https://${str}`).toString();
793
+ } catch {}
794
+ return null;
795
+ }
796
+ function setLinkHref(editor, href) {
797
+ if (href.length === 0) {
798
+ editor.chain().unsetLink().run();
799
+ return;
800
+ }
801
+ const { from, to } = editor.state.selection;
802
+ if (from === to) {
803
+ editor.chain().extendMarkRange("link").setLink({ href }).setTextSelection({
804
+ from,
805
+ to
806
+ }).run();
807
+ return;
808
+ }
809
+ editor.chain().setLink({ href }).run();
810
+ }
811
+ function focusEditor(editor) {
812
+ setTimeout(() => {
813
+ editor.commands.focus();
814
+ }, 0);
815
+ }
816
+
817
+ //#endregion
818
+ //#region src/ui/bubble-menu/button-form.tsx
819
+ function BubbleMenuButtonForm({ className, validateUrl, onLinkApply, onLinkRemove }) {
820
+ const { editor, isEditing, setIsEditing } = useBubbleMenuContext();
821
+ const inputRef = react.useRef(null);
822
+ const formRef = react.useRef(null);
823
+ const buttonHref = editor.getAttributes("button").href ?? "";
824
+ const displayHref = buttonHref === "#" ? "" : buttonHref;
825
+ const [inputValue, setInputValue] = react.useState(displayHref);
826
+ react.useEffect(() => {
827
+ if (!isEditing) return;
828
+ const currentHref = editor.getAttributes("button").href ?? "";
829
+ setInputValue(currentHref === "#" ? "" : currentHref);
830
+ const timeoutId = setTimeout(() => {
831
+ inputRef.current?.focus();
832
+ }, 0);
833
+ return () => clearTimeout(timeoutId);
834
+ }, [isEditing, editor]);
835
+ react.useEffect(() => {
836
+ if (!isEditing) return;
837
+ const handleKeyDown = (event) => {
838
+ if (event.key === "Escape") setIsEditing(false);
839
+ };
840
+ const handleClickOutside = (event) => {
841
+ if (formRef.current && !formRef.current.contains(event.target)) {
842
+ const form = formRef.current;
843
+ const submitEvent = new Event("submit", {
844
+ bubbles: true,
845
+ cancelable: true
846
+ });
847
+ form.dispatchEvent(submitEvent);
848
+ setIsEditing(false);
849
+ }
850
+ };
851
+ document.addEventListener("mousedown", handleClickOutside);
852
+ window.addEventListener("keydown", handleKeyDown);
853
+ return () => {
854
+ window.removeEventListener("keydown", handleKeyDown);
855
+ document.removeEventListener("mousedown", handleClickOutside);
856
+ };
857
+ }, [isEditing, setIsEditing]);
858
+ if (!isEditing) return null;
859
+ function handleSubmit(e) {
860
+ e.preventDefault();
861
+ const value = inputValue.trim();
862
+ if (value === "") {
863
+ editor.commands.updateButton({ href: "#" });
864
+ setIsEditing(false);
865
+ focusEditor(editor);
866
+ onLinkRemove?.();
867
+ return;
868
+ }
869
+ const finalValue = (validateUrl ?? getUrlFromString)(value);
870
+ if (!finalValue) {
871
+ editor.commands.updateButton({ href: "#" });
872
+ setIsEditing(false);
873
+ focusEditor(editor);
874
+ onLinkRemove?.();
875
+ return;
876
+ }
877
+ editor.commands.updateButton({ href: finalValue });
878
+ setIsEditing(false);
879
+ focusEditor(editor);
880
+ onLinkApply?.(finalValue);
881
+ }
882
+ function handleUnlink(e) {
883
+ e.stopPropagation();
884
+ editor.commands.updateButton({ href: "#" });
885
+ setIsEditing(false);
886
+ focusEditor(editor);
887
+ onLinkRemove?.();
888
+ }
889
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
890
+ ref: formRef,
891
+ "data-re-btn-bm-form": "",
892
+ className,
893
+ onMouseDown: (e) => e.stopPropagation(),
894
+ onClick: (e) => e.stopPropagation(),
895
+ onKeyDown: (e) => e.stopPropagation(),
896
+ onSubmit: handleSubmit,
897
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
898
+ ref: inputRef,
899
+ "data-re-btn-bm-input": "",
900
+ value: inputValue,
901
+ onFocus: (e) => e.stopPropagation(),
902
+ onChange: (e) => setInputValue(e.target.value),
903
+ placeholder: "Paste a link",
904
+ type: "text"
905
+ }), displayHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
906
+ type: "button",
907
+ "aria-label": "Remove link",
908
+ "data-re-btn-bm-unlink": "",
909
+ onClick: handleUnlink,
910
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnlinkIcon, {})
911
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
912
+ type: "submit",
913
+ "aria-label": "Apply link",
914
+ "data-re-btn-bm-apply": "",
915
+ onMouseDown: (e) => e.stopPropagation(),
916
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Check, {})
917
+ })]
918
+ });
919
+ }
920
+
921
+ //#endregion
922
+ //#region src/ui/bubble-menu/button-toolbar.tsx
923
+ function BubbleMenuButtonToolbar({ children, ...rest }) {
924
+ const { isEditing } = useBubbleMenuContext();
925
+ if (isEditing) return null;
926
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
927
+ "data-re-btn-bm-toolbar": "",
928
+ ...rest,
929
+ children
930
+ });
931
+ }
932
+
933
+ //#endregion
934
+ //#region src/ui/bubble-menu/button-unlink.tsx
935
+ function BubbleMenuButtonUnlink({ className, children, onClick, onMouseDown, onLinkRemove, ...rest }) {
936
+ const { editor } = useBubbleMenuContext();
937
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
938
+ ...rest,
939
+ type: "button",
940
+ "aria-label": "Remove link",
941
+ "data-re-btn-bm-item": "",
942
+ "data-item": "unlink",
943
+ className,
944
+ onMouseDown: (e) => {
945
+ e.preventDefault();
946
+ onMouseDown?.(e);
947
+ },
948
+ onClick: (e) => {
949
+ onClick?.(e);
950
+ editor.commands.updateButton({ href: "#" });
951
+ focusEditor(editor);
952
+ onLinkRemove?.();
953
+ },
954
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnlinkIcon, {})
955
+ });
956
+ }
957
+
958
+ //#endregion
959
+ //#region src/ui/bubble-menu/triggers.ts
960
+ const bubbleMenuTriggers = {
961
+ textSelection(hideWhenActiveNodes = [], hideWhenActiveMarks = []) {
962
+ return ({ editor, state }) => {
963
+ for (const node of hideWhenActiveNodes) {
964
+ if (editor.isActive(node)) return false;
965
+ const { $from } = state.selection;
966
+ for (let d = $from.depth; d > 0; d--) if ($from.node(d).type.name === node) return false;
967
+ }
968
+ for (const mark of hideWhenActiveMarks) if (editor.isActive(mark)) return false;
969
+ return editor.view.state.selection.content().size > 0;
970
+ };
971
+ },
972
+ node(name) {
973
+ return ({ editor }) => editor.isActive(name);
974
+ },
975
+ nodeWithoutSelection(name) {
976
+ return ({ editor }) => editor.isActive(name) && editor.view.state.selection.content().size === 0;
977
+ }
978
+ };
979
+
980
+ //#endregion
981
+ //#region src/ui/bubble-menu/root.tsx
982
+ const defaultPluginKey = new _tiptap_pm_state.PluginKey("bubbleMenu");
983
+ function BubbleMenuRoot({ shouldShow, pluginKey: pluginKey$1 = defaultPluginKey, hideWhenActiveNodes = [], hideWhenActiveMarks = [], placement = "bottom", offset: offset$1 = 8, onHide, className, children, ...rest }) {
984
+ const { editor } = (0, _tiptap_react.useCurrentEditor)();
985
+ const [isEditing, setIsEditing] = react.useState(false);
986
+ const resolvedShouldShow = shouldShow ?? bubbleMenuTriggers.textSelection(hideWhenActiveNodes, hideWhenActiveMarks);
987
+ if (!editor) return null;
988
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react_menus.BubbleMenu, {
989
+ editor,
990
+ pluginKey: pluginKey$1,
991
+ "data-re-bubble-menu": "",
992
+ shouldShow: resolvedShouldShow,
993
+ options: {
994
+ placement,
995
+ offset: offset$1,
996
+ onHide: () => {
997
+ setIsEditing(false);
998
+ onHide?.();
999
+ }
1000
+ },
1001
+ className,
1002
+ ...rest,
1003
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuContext.Provider, {
1004
+ value: {
1005
+ editor,
1006
+ isEditing,
1007
+ setIsEditing
1008
+ },
1009
+ children
1010
+ })
1011
+ });
1012
+ }
1013
+
1014
+ //#endregion
1015
+ //#region src/ui/bubble-menu/button-default.tsx
1016
+ const buttonPluginKey = new _tiptap_pm_state.PluginKey("buttonBubbleMenu");
1017
+ function BubbleMenuButtonDefaultInner({ validateUrl, onLinkApply, onLinkRemove }) {
1018
+ const { editor } = useBubbleMenuContext();
1019
+ const buttonHref = (0, _tiptap_react.useEditorState)({
1020
+ editor,
1021
+ selector: ({ editor: e }) => e?.getAttributes("button").href ?? ""
1022
+ });
1023
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleMenuButtonToolbar, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuButtonEditLink, {}), (buttonHref ?? "") !== "" && buttonHref !== "#" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuButtonUnlink, { onLinkRemove })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuButtonForm, {
1024
+ validateUrl,
1025
+ onLinkApply,
1026
+ onLinkRemove
1027
+ })] });
1028
+ }
1029
+ function BubbleMenuButtonDefault({ placement = "top", offset: offset$1, onHide, className, validateUrl, onLinkApply, onLinkRemove, ...rest }) {
1030
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuRoot, {
1031
+ shouldShow: bubbleMenuTriggers.node("button"),
1032
+ pluginKey: buttonPluginKey,
1033
+ placement,
1034
+ offset: offset$1,
1035
+ onHide,
1036
+ className,
1037
+ ...rest,
1038
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuButtonDefaultInner, {
1039
+ validateUrl,
1040
+ onLinkApply,
1041
+ onLinkRemove
1042
+ })
1043
+ });
1044
+ }
1045
+
1046
+ //#endregion
1047
+ //#region src/ui/bubble-menu/item.tsx
1048
+ function BubbleMenuItem({ name, isActive, onCommand, className, children, ...rest }) {
1049
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1050
+ type: "button",
1051
+ "aria-label": name,
1052
+ "aria-pressed": isActive,
1053
+ className,
1054
+ "data-re-bubble-menu-item": "",
1055
+ "data-item": name,
1056
+ ...isActive ? { "data-active": "" } : {},
1057
+ onMouseDown: (e) => e.preventDefault(),
1058
+ onClick: onCommand,
1059
+ ...rest,
1060
+ children
1061
+ });
1062
+ }
1063
+
1064
+ //#endregion
1065
+ //#region src/ui/bubble-menu/align-center.tsx
1066
+ function BubbleMenuAlignCenter({ className, children }) {
1067
+ const { editor } = useBubbleMenuContext();
1068
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
1069
+ name: "align-center",
1070
+ isActive: (0, _tiptap_react.useEditorState)({
1071
+ editor,
1072
+ selector: ({ editor: editor$1 }) => editor$1?.isActive({ alignment: "center" }) ?? false
1073
+ }),
1074
+ onCommand: () => require_set_text_alignment.setTextAlignment(editor, "center"),
1075
+ className,
1076
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlignCenterIcon, {})
1077
+ });
1078
+ }
1079
+
1080
+ //#endregion
1081
+ //#region src/ui/bubble-menu/align-left.tsx
1082
+ function BubbleMenuAlignLeft({ className, children }) {
1083
+ const { editor } = useBubbleMenuContext();
1084
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
1085
+ name: "align-left",
1086
+ isActive: (0, _tiptap_react.useEditorState)({
1087
+ editor,
1088
+ selector: ({ editor: editor$1 }) => editor$1?.isActive({ alignment: "left" }) ?? false
1089
+ }),
1090
+ onCommand: () => require_set_text_alignment.setTextAlignment(editor, "left"),
1091
+ className,
1092
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlignLeftIcon, {})
1093
+ });
1094
+ }
1095
+
1096
+ //#endregion
1097
+ //#region src/ui/bubble-menu/align-right.tsx
1098
+ function BubbleMenuAlignRight({ className, children }) {
1099
+ const { editor } = useBubbleMenuContext();
1100
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
1101
+ name: "align-right",
1102
+ isActive: (0, _tiptap_react.useEditorState)({
1103
+ editor,
1104
+ selector: ({ editor: editor$1 }) => editor$1?.isActive({ alignment: "right" }) ?? false
1105
+ }),
1106
+ onCommand: () => require_set_text_alignment.setTextAlignment(editor, "right"),
1107
+ className,
1108
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlignRightIcon, {})
1109
+ });
1110
+ }
1111
+
1112
+ //#endregion
1113
+ //#region src/ui/bubble-menu/create-mark-bubble-item.tsx
1114
+ function createMarkBubbleItem(config) {
1115
+ function MarkBubbleItem({ className, children }) {
1116
+ const { editor } = useBubbleMenuContext();
1117
+ const isActive = (0, _tiptap_react.useEditorState)({
1118
+ editor,
1119
+ selector: ({ editor: editor$1 }) => {
1120
+ if (config.activeParams) return editor$1?.isActive(config.activeName, config.activeParams) ?? false;
1121
+ return editor$1?.isActive(config.activeName) ?? false;
1122
+ }
1123
+ });
1124
+ const handleCommand = () => {
1125
+ const chain = editor.chain().focus();
1126
+ const method = chain[config.command];
1127
+ if (method) method.call(chain).run();
1128
+ };
1129
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
1130
+ name: config.name,
1131
+ isActive,
1132
+ onCommand: handleCommand,
1133
+ className,
1134
+ children: children ?? config.icon
1135
+ });
1136
+ }
1137
+ MarkBubbleItem.displayName = `BubbleMenu${config.name.charAt(0).toUpperCase() + config.name.slice(1)}`;
1138
+ return MarkBubbleItem;
1139
+ }
1140
+
1141
+ //#endregion
1142
+ //#region src/ui/bubble-menu/bold.tsx
1143
+ const BubbleMenuBold = createMarkBubbleItem({
1144
+ name: "bold",
1145
+ activeName: "bold",
1146
+ command: "toggleBold",
1147
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BoldIcon, {})
1148
+ });
1149
+
1150
+ //#endregion
1151
+ //#region src/ui/bubble-menu/code.tsx
1152
+ const BubbleMenuCode = createMarkBubbleItem({
1153
+ name: "code",
1154
+ activeName: "code",
1155
+ command: "toggleCode",
1156
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CodeIcon, {})
1157
+ });
1158
+
1159
+ //#endregion
1160
+ //#region src/ui/bubble-menu/group.tsx
1161
+ function BubbleMenuItemGroup({ className, children }) {
1162
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("fieldset", {
1163
+ className,
1164
+ "data-re-bubble-menu-group": "",
1165
+ children
1166
+ });
1167
+ }
1168
+
1169
+ //#endregion
1170
+ //#region src/ui/bubble-menu/italic.tsx
1171
+ const BubbleMenuItalic = createMarkBubbleItem({
1172
+ name: "italic",
1173
+ activeName: "italic",
1174
+ command: "toggleItalic",
1175
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItalicIcon, {})
1176
+ });
1177
+
1178
+ //#endregion
1179
+ //#region src/ui/bubble-menu/link-selector.tsx
1180
+ function BubbleMenuLinkSelector({ className, showToggle = true, validateUrl, onLinkApply, onLinkRemove, children, open: controlledOpen, onOpenChange }) {
1181
+ const { editor } = useBubbleMenuContext();
1182
+ const [uncontrolledOpen, setUncontrolledOpen] = react.useState(false);
1183
+ const isControlled = controlledOpen !== void 0;
1184
+ const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
1185
+ const setIsOpen = react.useCallback((value) => {
1186
+ if (!isControlled) setUncontrolledOpen(value);
1187
+ onOpenChange?.(value);
1188
+ }, [isControlled, onOpenChange]);
1189
+ const editorState = (0, _tiptap_react.useEditorState)({
1190
+ editor,
1191
+ selector: ({ editor: editor$1 }) => ({
1192
+ isLinkActive: editor$1?.isActive("link") ?? false,
1193
+ hasLink: Boolean(editor$1?.getAttributes("link").href),
1194
+ currentHref: editor$1?.getAttributes("link").href || ""
1195
+ })
1196
+ });
1197
+ const setIsOpenRef = react.useRef(setIsOpen);
1198
+ setIsOpenRef.current = setIsOpen;
1199
+ react.useEffect(() => {
1200
+ const subscription = require_event_bus.editorEventBus.on("bubble-menu:add-link", () => {
1201
+ setIsOpenRef.current(true);
1202
+ });
1203
+ return () => {
1204
+ setIsOpenRef.current(false);
1205
+ subscription.unsubscribe();
1206
+ };
1207
+ }, []);
1208
+ if (!editorState) return null;
1209
+ const handleOpenLink = () => {
1210
+ setIsOpen(!isOpen);
1211
+ };
1212
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1213
+ "data-re-link-selector": "",
1214
+ ...isOpen ? { "data-open": "" } : {},
1215
+ ...editorState.hasLink ? { "data-has-link": "" } : {},
1216
+ className,
1217
+ children: [showToggle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1218
+ type: "button",
1219
+ "aria-expanded": isOpen,
1220
+ "aria-haspopup": "true",
1221
+ "aria-label": "Add link",
1222
+ "aria-pressed": editorState.isLinkActive && editorState.hasLink,
1223
+ "data-re-link-selector-trigger": "",
1224
+ onClick: handleOpenLink,
1225
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkIcon, {})
1226
+ }), isOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkForm, {
1227
+ editor,
1228
+ currentHref: editorState.currentHref,
1229
+ validateUrl,
1230
+ onLinkApply,
1231
+ onLinkRemove,
1232
+ setIsOpen,
1233
+ children
1234
+ })]
1235
+ });
1236
+ }
1237
+ function LinkForm({ editor, currentHref, validateUrl, onLinkApply, onLinkRemove, setIsOpen, children }) {
1238
+ const inputRef = react.useRef(null);
1239
+ const formRef = react.useRef(null);
1240
+ const displayHref = currentHref === "#" ? "" : currentHref;
1241
+ const [inputValue, setInputValue] = react.useState(displayHref);
1242
+ react.useEffect(() => {
1243
+ const timeoutId = setTimeout(() => {
1244
+ inputRef.current?.focus();
1245
+ }, 0);
1246
+ return () => clearTimeout(timeoutId);
1247
+ }, []);
1248
+ react.useEffect(() => {
1249
+ const handleKeyDown = (event) => {
1250
+ if (event.key === "Escape") {
1251
+ if (editor.getAttributes("link").href === "#") editor.chain().unsetLink().run();
1252
+ setIsOpen(false);
1253
+ }
1254
+ };
1255
+ const handleClickOutside = (event) => {
1256
+ if (formRef.current && !formRef.current.contains(event.target)) {
1257
+ const form = formRef.current;
1258
+ const submitEvent = new Event("submit", {
1259
+ bubbles: true,
1260
+ cancelable: true
1261
+ });
1262
+ form.dispatchEvent(submitEvent);
1263
+ setIsOpen(false);
1264
+ }
1265
+ };
1266
+ document.addEventListener("mousedown", handleClickOutside);
1267
+ window.addEventListener("keydown", handleKeyDown);
1268
+ return () => {
1269
+ window.removeEventListener("keydown", handleKeyDown);
1270
+ document.removeEventListener("mousedown", handleClickOutside);
1271
+ };
1272
+ }, [editor, setIsOpen]);
1273
+ function handleSubmit(e) {
1274
+ e.preventDefault();
1275
+ const value = inputValue.trim();
1276
+ if (value === "") {
1277
+ setLinkHref(editor, "");
1278
+ setIsOpen(false);
1279
+ focusEditor(editor);
1280
+ onLinkRemove?.();
1281
+ return;
1282
+ }
1283
+ const finalValue = (validateUrl ?? getUrlFromString)(value);
1284
+ if (!finalValue) {
1285
+ setLinkHref(editor, "");
1286
+ setIsOpen(false);
1287
+ focusEditor(editor);
1288
+ onLinkRemove?.();
1289
+ return;
1290
+ }
1291
+ setLinkHref(editor, finalValue);
1292
+ setIsOpen(false);
1293
+ focusEditor(editor);
1294
+ onLinkApply?.(finalValue);
1295
+ }
1296
+ function handleUnlink(e) {
1297
+ e.stopPropagation();
1298
+ setLinkHref(editor, "");
1299
+ setIsOpen(false);
1300
+ focusEditor(editor);
1301
+ onLinkRemove?.();
1302
+ }
1303
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1304
+ ref: formRef,
1305
+ "data-re-link-selector-form": "",
1306
+ onMouseDown: (e) => e.stopPropagation(),
1307
+ onClick: (e) => e.stopPropagation(),
1308
+ onKeyDown: (e) => e.stopPropagation(),
1309
+ onSubmit: handleSubmit,
1310
+ children: [
1311
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1312
+ ref: inputRef,
1313
+ "data-re-link-selector-input": "",
1314
+ value: inputValue,
1315
+ onFocus: (e) => e.stopPropagation(),
1316
+ onChange: (e) => setInputValue(e.target.value),
1317
+ placeholder: "Paste a link",
1318
+ type: "text"
1319
+ }),
1320
+ children,
1321
+ displayHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1322
+ type: "button",
1323
+ "aria-label": "Remove link",
1324
+ "data-re-link-selector-unlink": "",
1325
+ onClick: handleUnlink,
1326
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnlinkIcon, {})
1327
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1328
+ type: "submit",
1329
+ "aria-label": "Apply link",
1330
+ "data-re-link-selector-apply": "",
1331
+ onMouseDown: (e) => e.stopPropagation(),
1332
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Check, {})
1333
+ })
1334
+ ]
1335
+ });
1336
+ }
1337
+
1338
+ //#endregion
1339
+ //#region src/ui/bubble-menu/node-selector.tsx
1340
+ const NodeSelectorContext = react.createContext(null);
1341
+ function useNodeSelectorContext() {
1342
+ const context = react.useContext(NodeSelectorContext);
1343
+ if (!context) throw new Error("NodeSelector compound components must be used within <NodeSelector.Root>");
1344
+ return context;
1345
+ }
1346
+ function NodeSelectorRoot({ omit = [], open: controlledOpen, onOpenChange, className, children }) {
1347
+ const { editor } = useBubbleMenuContext();
1348
+ const [uncontrolledOpen, setUncontrolledOpen] = react.useState(false);
1349
+ const isControlled = controlledOpen !== void 0;
1350
+ const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
1351
+ const setIsOpen = react.useCallback((value) => {
1352
+ if (!isControlled) setUncontrolledOpen(value);
1353
+ onOpenChange?.(value);
1354
+ }, [isControlled, onOpenChange]);
1355
+ const editorState = (0, _tiptap_react.useEditorState)({
1356
+ editor,
1357
+ selector: ({ editor: editor$1 }) => ({
1358
+ isParagraphActive: (editor$1?.isActive("paragraph") ?? false) && !editor$1?.isActive("bulletList") && !editor$1?.isActive("orderedList"),
1359
+ isHeading1Active: editor$1?.isActive("heading", { level: 1 }) ?? false,
1360
+ isHeading2Active: editor$1?.isActive("heading", { level: 2 }) ?? false,
1361
+ isHeading3Active: editor$1?.isActive("heading", { level: 3 }) ?? false,
1362
+ isBulletListActive: editor$1?.isActive("bulletList") ?? false,
1363
+ isOrderedListActive: editor$1?.isActive("orderedList") ?? false,
1364
+ isBlockquoteActive: editor$1?.isActive("blockquote") ?? false,
1365
+ isCodeBlockActive: editor$1?.isActive("codeBlock") ?? false
1366
+ })
1367
+ });
1368
+ const allItems = react.useMemo(() => [
1369
+ {
1370
+ name: "Text",
1371
+ icon: TextIcon,
1372
+ command: () => editor.chain().focus().clearNodes().toggleNode("paragraph", "paragraph").run(),
1373
+ isActive: editorState?.isParagraphActive ?? false
1374
+ },
1375
+ {
1376
+ name: "Title",
1377
+ icon: Heading1,
1378
+ command: () => editor.chain().focus().clearNodes().toggleHeading({ level: 1 }).run(),
1379
+ isActive: editorState?.isHeading1Active ?? false
1380
+ },
1381
+ {
1382
+ name: "Subtitle",
1383
+ icon: Heading2,
1384
+ command: () => editor.chain().focus().clearNodes().toggleHeading({ level: 2 }).run(),
1385
+ isActive: editorState?.isHeading2Active ?? false
1386
+ },
1387
+ {
1388
+ name: "Heading",
1389
+ icon: Heading3,
1390
+ command: () => editor.chain().focus().clearNodes().toggleHeading({ level: 3 }).run(),
1391
+ isActive: editorState?.isHeading3Active ?? false
1392
+ },
1393
+ {
1394
+ name: "Bullet List",
1395
+ icon: List,
1396
+ command: () => editor.chain().focus().clearNodes().toggleBulletList().run(),
1397
+ isActive: editorState?.isBulletListActive ?? false
1398
+ },
1399
+ {
1400
+ name: "Numbered List",
1401
+ icon: ListOrdered,
1402
+ command: () => editor.chain().focus().clearNodes().toggleOrderedList().run(),
1403
+ isActive: editorState?.isOrderedListActive ?? false
1404
+ },
1405
+ {
1406
+ name: "Quote",
1407
+ icon: TextQuote,
1408
+ command: () => editor.chain().focus().clearNodes().toggleNode("paragraph", "paragraph").toggleBlockquote().run(),
1409
+ isActive: editorState?.isBlockquoteActive ?? false
1410
+ },
1411
+ {
1412
+ name: "Code",
1413
+ icon: Code,
1414
+ command: () => editor.chain().focus().clearNodes().toggleCodeBlock().run(),
1415
+ isActive: editorState?.isCodeBlockActive ?? false
1416
+ }
1417
+ ], [editor, editorState]);
1418
+ const items = react.useMemo(() => allItems.filter((item) => !omit.includes(item.name)), [allItems, omit]);
1419
+ const activeItem = react.useMemo(() => items.find((item) => item.isActive) ?? { name: "Multiple" }, [items]);
1420
+ const contextValue = react.useMemo(() => ({
1421
+ items,
1422
+ activeItem,
1423
+ isOpen,
1424
+ setIsOpen
1425
+ }), [
1426
+ items,
1427
+ activeItem,
1428
+ isOpen,
1429
+ setIsOpen
1430
+ ]);
1431
+ if (!editorState || items.length === 0) return null;
1432
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NodeSelectorContext.Provider, {
1433
+ value: contextValue,
1434
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Root, {
1435
+ open: isOpen,
1436
+ onOpenChange: setIsOpen,
1437
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1438
+ "data-re-node-selector": "",
1439
+ ...isOpen ? { "data-open": "" } : {},
1440
+ className,
1441
+ children
1442
+ })
1443
+ })
1444
+ });
1445
+ }
1446
+ function NodeSelectorTrigger({ className, children }) {
1447
+ const { activeItem, isOpen, setIsOpen } = useNodeSelectorContext();
1448
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Trigger, {
1449
+ "data-re-node-selector-trigger": "",
1450
+ className,
1451
+ onClick: () => setIsOpen(!isOpen),
1452
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: activeItem.name }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDown, {})] })
1453
+ });
1454
+ }
1455
+ function NodeSelectorContent({ className, align = "start", children }) {
1456
+ const { items, setIsOpen } = useNodeSelectorContext();
1457
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Content, {
1458
+ align,
1459
+ "data-re-node-selector-content": "",
1460
+ className,
1461
+ children: children ? children(items, () => setIsOpen(false)) : items.map((item) => {
1462
+ const Icon = item.icon;
1463
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1464
+ type: "button",
1465
+ "data-re-node-selector-item": "",
1466
+ ...item.isActive ? { "data-active": "" } : {},
1467
+ onClick: () => {
1468
+ item.command();
1469
+ setIsOpen(false);
1470
+ },
1471
+ children: [
1472
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {}),
1473
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: item.name }),
1474
+ item.isActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Check, {})
1475
+ ]
1476
+ }, item.name);
1477
+ })
1478
+ });
1479
+ }
1480
+ function BubbleMenuNodeSelector({ omit = [], className, triggerContent, open, onOpenChange }) {
1481
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(NodeSelectorRoot, {
1482
+ omit,
1483
+ open,
1484
+ onOpenChange,
1485
+ className,
1486
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NodeSelectorTrigger, { children: triggerContent }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NodeSelectorContent, {})]
1487
+ });
1488
+ }
1489
+
1490
+ //#endregion
1491
+ //#region src/ui/bubble-menu/strike.tsx
1492
+ const BubbleMenuStrike = createMarkBubbleItem({
1493
+ name: "strike",
1494
+ activeName: "strike",
1495
+ command: "toggleStrike",
1496
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StrikethroughIcon, {})
1497
+ });
1498
+
1499
+ //#endregion
1500
+ //#region src/ui/bubble-menu/underline.tsx
1501
+ const BubbleMenuUnderline = createMarkBubbleItem({
1502
+ name: "underline",
1503
+ activeName: "underline",
1504
+ command: "toggleUnderline",
1505
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnderlineIcon, {})
1506
+ });
1507
+
1508
+ //#endregion
1509
+ //#region src/ui/bubble-menu/uppercase.tsx
1510
+ const BubbleMenuUppercase = createMarkBubbleItem({
1511
+ name: "uppercase",
1512
+ activeName: "uppercase",
1513
+ command: "toggleUppercase",
1514
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CaseUpperIcon, {})
1515
+ });
1516
+
1517
+ //#endregion
1518
+ //#region src/ui/bubble-menu/default.tsx
1519
+ const textPluginKey = new _tiptap_pm_state.PluginKey("textBubbleMenu");
1520
+ function BubbleMenuDefault({ excludeItems = [], hideWhenActiveNodes, hideWhenActiveMarks, placement, offset: offset$1, onHide, className, ...rest }) {
1521
+ const [isNodeSelectorOpen, setIsNodeSelectorOpen] = react.useState(false);
1522
+ const [isLinkSelectorOpen, setIsLinkSelectorOpen] = react.useState(false);
1523
+ const has = (item) => !excludeItems.includes(item);
1524
+ const handleNodeSelectorOpenChange = react.useCallback((open) => {
1525
+ setIsNodeSelectorOpen(open);
1526
+ if (open) setIsLinkSelectorOpen(false);
1527
+ }, []);
1528
+ const handleLinkSelectorOpenChange = react.useCallback((open) => {
1529
+ setIsLinkSelectorOpen(open);
1530
+ if (open) setIsNodeSelectorOpen(false);
1531
+ }, []);
1532
+ const handleHide = react.useCallback(() => {
1533
+ setIsNodeSelectorOpen(false);
1534
+ setIsLinkSelectorOpen(false);
1535
+ onHide?.();
1536
+ }, [onHide]);
1537
+ const hasFormattingItems = has("bold") || has("italic") || has("underline") || has("strike") || has("code") || has("uppercase");
1538
+ const hasAlignmentItems = has("align-left") || has("align-center") || has("align-right");
1539
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleMenuRoot, {
1540
+ pluginKey: textPluginKey,
1541
+ hideWhenActiveNodes,
1542
+ hideWhenActiveMarks,
1543
+ placement,
1544
+ offset: offset$1,
1545
+ onHide: handleHide,
1546
+ className,
1547
+ ...rest,
1548
+ children: [
1549
+ has("node-selector") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuNodeSelector, {
1550
+ open: isNodeSelectorOpen,
1551
+ onOpenChange: handleNodeSelectorOpenChange
1552
+ }),
1553
+ has("link-selector") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuLinkSelector, {
1554
+ open: isLinkSelectorOpen,
1555
+ onOpenChange: handleLinkSelectorOpenChange
1556
+ }),
1557
+ hasFormattingItems && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleMenuItemGroup, { children: [
1558
+ has("bold") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuBold, {}),
1559
+ has("italic") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItalic, {}),
1560
+ has("underline") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuUnderline, {}),
1561
+ has("strike") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuStrike, {}),
1562
+ has("code") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuCode, {}),
1563
+ has("uppercase") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuUppercase, {})
1564
+ ] }),
1565
+ hasAlignmentItems && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleMenuItemGroup, { children: [
1566
+ has("align-left") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuAlignLeft, {}),
1567
+ has("align-center") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuAlignCenter, {}),
1568
+ has("align-right") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuAlignRight, {})
1569
+ ] })
1570
+ ]
1571
+ });
1572
+ }
1573
+
1574
+ //#endregion
1575
+ //#region src/ui/bubble-menu/image-edit-link.tsx
1576
+ function BubbleMenuImageEditLink({ className, children, onClick, onMouseDown, ...rest }) {
1577
+ const { setIsEditing } = useBubbleMenuContext();
1578
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1579
+ ...rest,
1580
+ type: "button",
1581
+ "aria-label": "Edit link",
1582
+ "data-re-img-bm-item": "",
1583
+ "data-item": "edit-link",
1584
+ className,
1585
+ onMouseDown: (e) => {
1586
+ e.preventDefault();
1587
+ onMouseDown?.(e);
1588
+ },
1589
+ onClick: (e) => {
1590
+ onClick?.(e);
1591
+ setIsEditing(true);
1592
+ },
1593
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkIcon, {})
1594
+ });
1595
+ }
1596
+
1597
+ //#endregion
1598
+ //#region src/ui/bubble-menu/image-toolbar.tsx
1599
+ function BubbleMenuImageToolbar({ children, ...rest }) {
1600
+ const { isEditing } = useBubbleMenuContext();
1601
+ if (isEditing) return null;
1602
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1603
+ "data-re-img-bm-toolbar": "",
1604
+ ...rest,
1605
+ children
1606
+ });
1607
+ }
1608
+
1609
+ //#endregion
1610
+ //#region src/ui/bubble-menu/image-default.tsx
1611
+ const imagePluginKey = new _tiptap_pm_state.PluginKey("imageBubbleMenu");
1612
+ function BubbleMenuImageDefault({ excludeItems = [], placement = "top", offset: offset$1, onHide, className, ...rest }) {
1613
+ const hasEditLink = !excludeItems.includes("edit-link");
1614
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuRoot, {
1615
+ shouldShow: bubbleMenuTriggers.node("image"),
1616
+ pluginKey: imagePluginKey,
1617
+ placement,
1618
+ offset: offset$1,
1619
+ onHide,
1620
+ className,
1621
+ ...rest,
1622
+ children: hasEditLink && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuImageToolbar, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuImageEditLink, {}) })
1623
+ });
1624
+ }
1625
+
1626
+ //#endregion
1627
+ //#region src/ui/bubble-menu/link-edit-link.tsx
1628
+ function BubbleMenuLinkEditLink({ className, children, onClick, onMouseDown, ...rest }) {
1629
+ const { setIsEditing } = useBubbleMenuContext();
1630
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1631
+ type: "button",
1632
+ "aria-label": "Edit link",
1633
+ "data-re-link-bm-item": "",
1634
+ "data-item": "edit-link",
1635
+ className,
1636
+ onMouseDown: (e) => {
1637
+ e.preventDefault();
1638
+ onMouseDown?.(e);
1639
+ },
1640
+ onClick: (e) => {
1641
+ onClick?.(e);
1642
+ setIsEditing(true);
1643
+ },
1644
+ ...rest,
1645
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PencilIcon, {})
1646
+ });
1647
+ }
1648
+
1649
+ //#endregion
1650
+ //#region src/ui/bubble-menu/link-form.tsx
1651
+ function BubbleMenuLinkForm({ className, validateUrl, onLinkApply, onLinkRemove, children }) {
1652
+ const { editor, isEditing, setIsEditing } = useBubbleMenuContext();
1653
+ const inputRef = react.useRef(null);
1654
+ const formRef = react.useRef(null);
1655
+ const linkHref = (0, _tiptap_react.useEditorState)({
1656
+ editor,
1657
+ selector: ({ editor: e }) => e?.getAttributes("link").href ?? ""
1658
+ });
1659
+ const displayHref = (linkHref ?? "") === "#" ? "" : linkHref ?? "";
1660
+ const [inputValue, setInputValue] = react.useState(displayHref);
1661
+ react.useEffect(() => {
1662
+ if (!isEditing) return;
1663
+ setInputValue(displayHref);
1664
+ const timeoutId = setTimeout(() => {
1665
+ inputRef.current?.focus();
1666
+ }, 0);
1667
+ return () => clearTimeout(timeoutId);
1668
+ }, [isEditing, displayHref]);
1669
+ react.useEffect(() => {
1670
+ if (!isEditing) return;
1671
+ const handleKeyDown = (event) => {
1672
+ if (event.key === "Escape") setIsEditing(false);
1673
+ };
1674
+ const handleClickOutside = (event) => {
1675
+ if (formRef.current && !formRef.current.contains(event.target)) {
1676
+ const form = formRef.current;
1677
+ const submitEvent = new Event("submit", {
1678
+ bubbles: true,
1679
+ cancelable: true
1680
+ });
1681
+ form.dispatchEvent(submitEvent);
1682
+ setIsEditing(false);
1683
+ }
1684
+ };
1685
+ document.addEventListener("mousedown", handleClickOutside);
1686
+ window.addEventListener("keydown", handleKeyDown);
1687
+ return () => {
1688
+ window.removeEventListener("keydown", handleKeyDown);
1689
+ document.removeEventListener("mousedown", handleClickOutside);
1690
+ };
1691
+ }, [isEditing, setIsEditing]);
1692
+ if (!isEditing) return null;
1693
+ function handleSubmit(e) {
1694
+ e.preventDefault();
1695
+ const value = inputValue.trim();
1696
+ if (value === "") {
1697
+ setLinkHref(editor, "");
1698
+ setIsEditing(false);
1699
+ focusEditor(editor);
1700
+ onLinkRemove?.();
1701
+ return;
1702
+ }
1703
+ const finalValue = (validateUrl ?? getUrlFromString)(value);
1704
+ if (!finalValue) {
1705
+ setLinkHref(editor, "");
1706
+ setIsEditing(false);
1707
+ focusEditor(editor);
1708
+ onLinkRemove?.();
1709
+ return;
1710
+ }
1711
+ setLinkHref(editor, finalValue);
1712
+ setIsEditing(false);
1713
+ focusEditor(editor);
1714
+ onLinkApply?.(finalValue);
1715
+ }
1716
+ function handleUnlink(e) {
1717
+ e.stopPropagation();
1718
+ setLinkHref(editor, "");
1719
+ setIsEditing(false);
1720
+ focusEditor(editor);
1721
+ onLinkRemove?.();
1722
+ }
1723
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1724
+ ref: formRef,
1725
+ "data-re-link-bm-form": "",
1726
+ className,
1727
+ onMouseDown: (e) => e.stopPropagation(),
1728
+ onClick: (e) => e.stopPropagation(),
1729
+ onKeyDown: (e) => e.stopPropagation(),
1730
+ onSubmit: handleSubmit,
1731
+ children: [
1732
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1733
+ ref: inputRef,
1734
+ "data-re-link-bm-input": "",
1735
+ value: inputValue,
1736
+ onFocus: (e) => e.stopPropagation(),
1737
+ onChange: (e) => setInputValue(e.target.value),
1738
+ placeholder: "Paste a link",
1739
+ type: "text"
1740
+ }),
1741
+ children,
1742
+ displayHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1743
+ type: "button",
1744
+ "aria-label": "Remove link",
1745
+ "data-re-link-bm-unlink": "",
1746
+ onClick: handleUnlink,
1747
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnlinkIcon, {})
1748
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1749
+ type: "submit",
1750
+ "aria-label": "Apply link",
1751
+ "data-re-link-bm-apply": "",
1752
+ onMouseDown: (e) => e.stopPropagation(),
1753
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Check, {})
1754
+ })
1755
+ ]
1756
+ });
1757
+ }
1758
+
1759
+ //#endregion
1760
+ //#region src/ui/bubble-menu/link-open-link.tsx
1761
+ function BubbleMenuLinkOpenLink({ className, children, ...rest }) {
1762
+ const { editor } = useBubbleMenuContext();
1763
+ const linkHref = (0, _tiptap_react.useEditorState)({
1764
+ editor,
1765
+ selector: ({ editor: e }) => e?.getAttributes("link").href ?? ""
1766
+ });
1767
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1768
+ ...rest,
1769
+ href: linkHref ?? "",
1770
+ target: "_blank",
1771
+ rel: "noopener noreferrer",
1772
+ "aria-label": "Open link",
1773
+ "data-re-link-bm-item": "",
1774
+ "data-item": "open-link",
1775
+ className,
1776
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExternalLinkIcon, {})
1777
+ });
1778
+ }
1779
+
1780
+ //#endregion
1781
+ //#region src/ui/bubble-menu/link-toolbar.tsx
1782
+ function BubbleMenuLinkToolbar({ children, ...rest }) {
1783
+ const { isEditing } = useBubbleMenuContext();
1784
+ if (isEditing) return null;
1785
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1786
+ "data-re-link-bm-toolbar": "",
1787
+ ...rest,
1788
+ children
1789
+ });
1790
+ }
1791
+
1792
+ //#endregion
1793
+ //#region src/ui/bubble-menu/link-unlink.tsx
1794
+ function BubbleMenuLinkUnlink({ className, children, onClick, onMouseDown, ...rest }) {
1795
+ const { editor } = useBubbleMenuContext();
1796
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1797
+ type: "button",
1798
+ "aria-label": "Remove link",
1799
+ "data-re-link-bm-item": "",
1800
+ "data-item": "unlink",
1801
+ className,
1802
+ onMouseDown: (e) => {
1803
+ e.preventDefault();
1804
+ onMouseDown?.(e);
1805
+ },
1806
+ onClick: (e) => {
1807
+ onClick?.(e);
1808
+ editor.chain().focus().unsetLink().run();
1809
+ },
1810
+ ...rest,
1811
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnlinkIcon, {})
1812
+ });
1813
+ }
1814
+
1815
+ //#endregion
1816
+ //#region src/ui/bubble-menu/link-default.tsx
1817
+ const linkPluginKey = new _tiptap_pm_state.PluginKey("linkBubbleMenu");
1818
+ function BubbleMenuLinkDefault({ excludeItems = [], placement = "top", offset: offset$1, onHide, className, validateUrl, onLinkApply, onLinkRemove, ...rest }) {
1819
+ const has = (item) => !excludeItems.includes(item);
1820
+ const hasToolbarItems = has("edit-link") || has("open-link") || has("unlink");
1821
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleMenuRoot, {
1822
+ shouldShow: bubbleMenuTriggers.nodeWithoutSelection("link"),
1823
+ pluginKey: linkPluginKey,
1824
+ placement,
1825
+ offset: offset$1,
1826
+ onHide,
1827
+ className,
1828
+ ...rest,
1829
+ children: [hasToolbarItems && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleMenuLinkToolbar, { children: [
1830
+ has("edit-link") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuLinkEditLink, {}),
1831
+ has("open-link") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuLinkOpenLink, {}),
1832
+ has("unlink") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuLinkUnlink, {})
1833
+ ] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuLinkForm, {
1834
+ validateUrl,
1835
+ onLinkApply,
1836
+ onLinkRemove
1837
+ })]
1838
+ });
1839
+ }
1840
+
1841
+ //#endregion
1842
+ //#region src/ui/slash-command/utils.ts
1843
+ function isInsideNode(editor, type) {
1844
+ const { $from } = editor.state.selection;
1845
+ for (let d = $from.depth; d > 0; d--) if ($from.node(d).type.name === type) return true;
1846
+ return false;
1847
+ }
1848
+ function isAtMaxColumnsDepth(editor) {
1849
+ const { from } = editor.state.selection;
1850
+ return require_event_bus.getColumnsDepth(editor.state.doc, from) >= require_event_bus.MAX_COLUMNS_DEPTH;
1851
+ }
1852
+ function updateScrollView(container, item) {
1853
+ const containerRect = container.getBoundingClientRect();
1854
+ const itemRect = item.getBoundingClientRect();
1855
+ if (itemRect.top < containerRect.top) container.scrollTop -= containerRect.top - itemRect.top;
1856
+ else if (itemRect.bottom > containerRect.bottom) container.scrollTop += itemRect.bottom - containerRect.bottom;
1857
+ }
1858
+
1859
+ //#endregion
1860
+ //#region src/ui/slash-command/command-list.tsx
1861
+ const CATEGORY_ORDER = [
1862
+ "Text",
1863
+ "Media",
1864
+ "Layout",
1865
+ "Utility"
1866
+ ];
1867
+ function groupByCategory(items) {
1868
+ const seen = /* @__PURE__ */ new Map();
1869
+ for (const item of items) {
1870
+ const existing = seen.get(item.category);
1871
+ if (existing) existing.push(item);
1872
+ else seen.set(item.category, [item]);
1873
+ }
1874
+ const ordered = [];
1875
+ for (const cat of CATEGORY_ORDER) {
1876
+ const group = seen.get(cat);
1877
+ if (group) {
1878
+ ordered.push({
1879
+ category: cat,
1880
+ items: group
1881
+ });
1882
+ seen.delete(cat);
1883
+ }
1884
+ }
1885
+ for (const [category, group] of seen) ordered.push({
1886
+ category,
1887
+ items: group
1888
+ });
1889
+ return ordered;
1890
+ }
1891
+ function CommandItem({ item, selected, onSelect }) {
1892
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1893
+ "data-re-slash-command-item": "",
1894
+ "data-selected": selected || void 0,
1895
+ onClick: onSelect,
1896
+ type: "button",
1897
+ children: [item.icon, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: item.title })]
1898
+ });
1899
+ }
1900
+ function CommandList({ items, query, selectedIndex, onSelect }) {
1901
+ const containerRef = (0, react.useRef)(null);
1902
+ (0, react.useLayoutEffect)(() => {
1903
+ const container = containerRef.current;
1904
+ if (!container) return;
1905
+ const selected = container.querySelector("[data-selected]");
1906
+ if (selected) updateScrollView(container, selected);
1907
+ }, [selectedIndex]);
1908
+ if (items.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1909
+ "data-re-slash-command": "",
1910
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1911
+ "data-re-slash-command-empty": "",
1912
+ children: "No results"
1913
+ })
1914
+ });
1915
+ if (query.trim().length > 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1916
+ "data-re-slash-command": "",
1917
+ ref: containerRef,
1918
+ children: items.map((item, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandItem, {
1919
+ item,
1920
+ onSelect: () => onSelect(index),
1921
+ selected: index === selectedIndex
1922
+ }, item.title))
1923
+ });
1924
+ const groups = groupByCategory(items);
1925
+ let flatIndex = 0;
1926
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1927
+ "data-re-slash-command": "",
1928
+ ref: containerRef,
1929
+ children: groups.map((group) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1930
+ "data-re-slash-command-category": "",
1931
+ children: group.category
1932
+ }), group.items.map((item) => {
1933
+ const currentIndex = flatIndex++;
1934
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandItem, {
1935
+ item,
1936
+ onSelect: () => onSelect(currentIndex),
1937
+ selected: currentIndex === selectedIndex
1938
+ }, item.title);
1939
+ })] }, group.category))
1940
+ });
1941
+ }
1942
+
1943
+ //#endregion
1944
+ //#region src/ui/slash-command/commands.tsx
1945
+ const TEXT = {
1946
+ title: "Text",
1947
+ description: "Plain text block",
1948
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, { size: 20 }),
1949
+ category: "Text",
1950
+ searchTerms: ["p", "paragraph"],
1951
+ command: ({ editor, range }) => {
1952
+ editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
1953
+ }
1954
+ };
1955
+ const H1 = {
1956
+ title: "Title",
1957
+ description: "Large heading",
1958
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading1, { size: 20 }),
1959
+ category: "Text",
1960
+ searchTerms: [
1961
+ "title",
1962
+ "big",
1963
+ "large",
1964
+ "h1"
1965
+ ],
1966
+ command: ({ editor, range }) => {
1967
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
1968
+ }
1969
+ };
1970
+ const H2 = {
1971
+ title: "Subtitle",
1972
+ description: "Medium heading",
1973
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading2, { size: 20 }),
1974
+ category: "Text",
1975
+ searchTerms: [
1976
+ "subtitle",
1977
+ "medium",
1978
+ "h2"
1979
+ ],
1980
+ command: ({ editor, range }) => {
1981
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
1982
+ }
1983
+ };
1984
+ const H3 = {
1985
+ title: "Heading",
1986
+ description: "Small heading",
1987
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading3, { size: 20 }),
1988
+ category: "Text",
1989
+ searchTerms: [
1990
+ "subtitle",
1991
+ "small",
1992
+ "h3"
1993
+ ],
1994
+ command: ({ editor, range }) => {
1995
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
1996
+ }
1997
+ };
1998
+ const BULLET_LIST = {
1999
+ title: "Bullet list",
2000
+ description: "Unordered list",
2001
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(List, { size: 20 }),
2002
+ category: "Text",
2003
+ searchTerms: ["unordered", "point"],
2004
+ command: ({ editor, range }) => {
2005
+ editor.chain().focus().deleteRange(range).toggleBulletList().run();
2006
+ }
2007
+ };
2008
+ const NUMBERED_LIST = {
2009
+ title: "Numbered list",
2010
+ description: "Ordered list",
2011
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ListOrdered, { size: 20 }),
2012
+ category: "Text",
2013
+ searchTerms: ["ordered"],
2014
+ command: ({ editor, range }) => {
2015
+ editor.chain().focus().deleteRange(range).toggleOrderedList().run();
2016
+ }
2017
+ };
2018
+ const QUOTE = {
2019
+ title: "Quote",
2020
+ description: "Block quote",
2021
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextQuote, { size: 20 }),
2022
+ category: "Text",
2023
+ searchTerms: ["blockquote"],
2024
+ command: ({ editor, range }) => {
2025
+ editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").toggleBlockquote().run();
2026
+ }
2027
+ };
2028
+ const CODE = {
2029
+ title: "Code block",
2030
+ description: "Code snippet",
2031
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SquareCode, { size: 20 }),
2032
+ category: "Text",
2033
+ searchTerms: ["codeblock"],
2034
+ command: ({ editor, range }) => {
2035
+ editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
2036
+ }
2037
+ };
2038
+ const BUTTON = {
2039
+ title: "Button",
2040
+ description: "Clickable button",
2041
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MousePointer, { size: 20 }),
2042
+ category: "Layout",
2043
+ searchTerms: ["button"],
2044
+ command: ({ editor, range }) => {
2045
+ editor.chain().focus().deleteRange(range).setButton().run();
2046
+ }
2047
+ };
2048
+ const DIVIDER = {
2049
+ title: "Divider",
2050
+ description: "Horizontal separator",
2051
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SplitSquareVertical, { size: 20 }),
2052
+ category: "Layout",
2053
+ searchTerms: [
2054
+ "hr",
2055
+ "divider",
2056
+ "separator"
2057
+ ],
2058
+ command: ({ editor, range }) => {
2059
+ editor.chain().focus().deleteRange(range).setHorizontalRule().run();
2060
+ }
2061
+ };
2062
+ const SECTION = {
2063
+ title: "Section",
2064
+ description: "Content section",
2065
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Rows2, { size: 20 }),
2066
+ category: "Layout",
2067
+ searchTerms: [
2068
+ "section",
2069
+ "row",
2070
+ "container"
2071
+ ],
2072
+ command: ({ editor, range }) => {
2073
+ editor.chain().focus().deleteRange(range).insertSection().run();
2074
+ }
2075
+ };
2076
+ const TWO_COLUMNS = {
2077
+ title: "2 columns",
2078
+ description: "Two column layout",
2079
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Columns2, { size: 20 }),
2080
+ category: "Layout",
2081
+ searchTerms: [
2082
+ "columns",
2083
+ "column",
2084
+ "layout",
2085
+ "grid",
2086
+ "split",
2087
+ "side-by-side",
2088
+ "multi-column",
2089
+ "row",
2090
+ "two",
2091
+ "2"
2092
+ ],
2093
+ command: ({ editor, range }) => {
2094
+ editor.chain().focus().deleteRange(range).insertColumns(2).run();
2095
+ }
2096
+ };
2097
+ const THREE_COLUMNS = {
2098
+ title: "3 columns",
2099
+ description: "Three column layout",
2100
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Columns3, { size: 20 }),
2101
+ category: "Layout",
2102
+ searchTerms: [
2103
+ "columns",
2104
+ "column",
2105
+ "layout",
2106
+ "grid",
2107
+ "split",
2108
+ "multi-column",
2109
+ "row",
2110
+ "three",
2111
+ "3"
2112
+ ],
2113
+ command: ({ editor, range }) => {
2114
+ editor.chain().focus().deleteRange(range).insertColumns(3).run();
2115
+ }
2116
+ };
2117
+ const FOUR_COLUMNS = {
2118
+ title: "4 columns",
2119
+ description: "Four column layout",
2120
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Columns4, { size: 20 }),
2121
+ category: "Layout",
2122
+ searchTerms: [
2123
+ "columns",
2124
+ "column",
2125
+ "layout",
2126
+ "grid",
2127
+ "split",
2128
+ "multi-column",
2129
+ "row",
2130
+ "four",
2131
+ "4"
2132
+ ],
2133
+ command: ({ editor, range }) => {
2134
+ editor.chain().focus().deleteRange(range).insertColumns(4).run();
2135
+ }
2136
+ };
2137
+ const defaultSlashCommands = [
2138
+ TEXT,
2139
+ H1,
2140
+ H2,
2141
+ H3,
2142
+ BULLET_LIST,
2143
+ NUMBERED_LIST,
2144
+ QUOTE,
2145
+ CODE,
2146
+ BUTTON,
2147
+ DIVIDER,
2148
+ SECTION,
2149
+ TWO_COLUMNS,
2150
+ THREE_COLUMNS,
2151
+ FOUR_COLUMNS
2152
+ ];
2153
+
2154
+ //#endregion
2155
+ //#region src/ui/slash-command/search.ts
2156
+ function scoreItem(item, query) {
2157
+ if (!query) return 100;
2158
+ const q = query.toLowerCase();
2159
+ const title = item.title.toLowerCase();
2160
+ const description = item.description.toLowerCase();
2161
+ const terms = item.searchTerms?.map((t) => t.toLowerCase()) ?? [];
2162
+ if (title === q) return 100;
2163
+ if (title.startsWith(q)) return 90;
2164
+ if (title.split(/\s+/).some((w) => w.startsWith(q))) return 80;
2165
+ if (terms.some((t) => t === q)) return 70;
2166
+ if (terms.some((t) => t.startsWith(q))) return 60;
2167
+ if (title.includes(q)) return 40;
2168
+ if (terms.some((t) => t.includes(q))) return 30;
2169
+ if (description.includes(q)) return 20;
2170
+ return 0;
2171
+ }
2172
+ function filterAndRankItems(items, query) {
2173
+ const trimmed = query.trim();
2174
+ if (!trimmed) return items;
2175
+ const scored = items.map((item) => ({
2176
+ item,
2177
+ score: scoreItem(item, trimmed)
2178
+ })).filter(({ score }) => score > 0);
2179
+ scored.sort((a, b) => b.score - a.score);
2180
+ return scored.map(({ item }) => item);
2181
+ }
2182
+
2183
+ //#endregion
2184
+ //#region src/ui/slash-command/root.tsx
2185
+ const pluginKey = new _tiptap_pm_state.PluginKey("slash-command");
2186
+ const INITIAL_STATE = {
2187
+ active: false,
2188
+ query: "",
2189
+ items: [],
2190
+ clientRect: null
2191
+ };
2192
+ function defaultFilterItems(items, query, editor) {
2193
+ return filterAndRankItems(isAtMaxColumnsDepth(editor) ? items.filter((item) => item.category !== "Layout" || !item.title.includes("column")) : items, query);
2194
+ }
2195
+ function SlashCommandRoot({ items: itemsProp, filterItems: filterItemsProp, char = "/", allow: allowProp, children }) {
2196
+ const { editor } = (0, _tiptap_react.useCurrentEditor)();
2197
+ const [state, setState] = (0, react.useState)(INITIAL_STATE);
2198
+ const [selectedIndex, setSelectedIndex] = (0, react.useState)(0);
2199
+ const itemsRef = (0, react.useRef)(itemsProp ?? defaultSlashCommands);
2200
+ const filterRef = (0, react.useRef)(filterItemsProp ?? defaultFilterItems);
2201
+ const allowRef = (0, react.useRef)(allowProp ?? (({ editor: e }) => !e.isActive("codeBlock")));
2202
+ itemsRef.current = itemsProp ?? defaultSlashCommands;
2203
+ filterRef.current = filterItemsProp ?? defaultFilterItems;
2204
+ allowRef.current = allowProp ?? (({ editor: e }) => !e.isActive("codeBlock"));
2205
+ const commandRef = (0, react.useRef)(null);
2206
+ const suggestionItemsRef = (0, react.useRef)([]);
2207
+ const selectedIndexRef = (0, react.useRef)(0);
2208
+ suggestionItemsRef.current = state.items;
2209
+ selectedIndexRef.current = selectedIndex;
2210
+ const { refs, floatingStyles } = (0, _floating_ui_react_dom.useFloating)({
2211
+ open: state.active,
2212
+ placement: "bottom-start",
2213
+ middleware: [
2214
+ (0, _floating_ui_react_dom.offset)(8),
2215
+ (0, _floating_ui_react_dom.flip)(),
2216
+ (0, _floating_ui_react_dom.shift)({ padding: 8 })
2217
+ ],
2218
+ whileElementsMounted: _floating_ui_react_dom.autoUpdate
2219
+ });
2220
+ (0, react.useEffect)(() => {
2221
+ if (!state.clientRect) return;
2222
+ refs.setReference({ getBoundingClientRect: state.clientRect });
2223
+ }, [state.clientRect, refs]);
2224
+ (0, react.useEffect)(() => {
2225
+ setSelectedIndex(0);
2226
+ }, [state.items]);
2227
+ const onSelect = (0, react.useCallback)((index) => {
2228
+ const item = suggestionItemsRef.current[index];
2229
+ if (item && commandRef.current) commandRef.current(item);
2230
+ }, []);
2231
+ (0, react.useEffect)(() => {
2232
+ if (!editor) return;
2233
+ const plugin = (0, _tiptap_suggestion.default)({
2234
+ pluginKey,
2235
+ editor,
2236
+ char,
2237
+ allow: ({ editor: e }) => allowRef.current({ editor: e }),
2238
+ command: ({ editor: e, range, props }) => {
2239
+ props.command({
2240
+ editor: e,
2241
+ range
2242
+ });
2243
+ },
2244
+ items: ({ query, editor: e }) => filterRef.current(itemsRef.current, query, e),
2245
+ render: () => ({
2246
+ onStart: (props) => {
2247
+ commandRef.current = props.command;
2248
+ setState({
2249
+ active: true,
2250
+ query: props.query,
2251
+ items: props.items,
2252
+ clientRect: props.clientRect ?? null
2253
+ });
2254
+ },
2255
+ onUpdate: (props) => {
2256
+ commandRef.current = props.command;
2257
+ setState({
2258
+ active: true,
2259
+ query: props.query,
2260
+ items: props.items,
2261
+ clientRect: props.clientRect ?? null
2262
+ });
2263
+ },
2264
+ onKeyDown: ({ event }) => {
2265
+ if (event.key === "Escape") {
2266
+ setState(INITIAL_STATE);
2267
+ return true;
2268
+ }
2269
+ const items = suggestionItemsRef.current;
2270
+ if (items.length === 0) return false;
2271
+ if (event.key === "ArrowUp") {
2272
+ setSelectedIndex((i) => (i + items.length - 1) % items.length);
2273
+ return true;
2274
+ }
2275
+ if (event.key === "ArrowDown") {
2276
+ setSelectedIndex((i) => (i + 1) % items.length);
2277
+ return true;
2278
+ }
2279
+ if (event.key === "Enter") {
2280
+ const item = items[selectedIndexRef.current];
2281
+ if (item && commandRef.current) commandRef.current(item);
2282
+ return true;
2283
+ }
2284
+ return false;
2285
+ },
2286
+ onExit: () => {
2287
+ setState(INITIAL_STATE);
2288
+ requestAnimationFrame(() => {
2289
+ commandRef.current = null;
2290
+ });
2291
+ }
2292
+ })
2293
+ });
2294
+ editor.registerPlugin(plugin, (newPlugin, plugins) => [newPlugin, ...plugins]);
2295
+ return () => {
2296
+ editor.unregisterPlugin(pluginKey);
2297
+ };
2298
+ }, [editor, char]);
2299
+ if (!editor || !state.active) return null;
2300
+ const renderProps = {
2301
+ items: state.items,
2302
+ query: state.query,
2303
+ selectedIndex,
2304
+ onSelect
2305
+ };
2306
+ let content;
2307
+ if (children) content = children(renderProps);
2308
+ else content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandList, { ...renderProps });
2309
+ return (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2310
+ ref: refs.setFloating,
2311
+ style: floatingStyles,
2312
+ children: content
2313
+ }), document.body);
2314
+ }
2315
+
2316
+ //#endregion
2317
+ Object.defineProperty(exports, 'AlignCenterIcon', {
2318
+ enumerable: true,
2319
+ get: function () {
2320
+ return AlignCenterIcon;
2321
+ }
2322
+ });
2323
+ Object.defineProperty(exports, 'AlignLeftIcon', {
2324
+ enumerable: true,
2325
+ get: function () {
2326
+ return AlignLeftIcon;
2327
+ }
2328
+ });
2329
+ Object.defineProperty(exports, 'AlignRightIcon', {
2330
+ enumerable: true,
2331
+ get: function () {
2332
+ return AlignRightIcon;
2333
+ }
2334
+ });
2335
+ Object.defineProperty(exports, 'BULLET_LIST', {
2336
+ enumerable: true,
2337
+ get: function () {
2338
+ return BULLET_LIST;
2339
+ }
2340
+ });
2341
+ Object.defineProperty(exports, 'BUTTON', {
2342
+ enumerable: true,
2343
+ get: function () {
2344
+ return BUTTON;
2345
+ }
2346
+ });
2347
+ Object.defineProperty(exports, 'BoldIcon', {
2348
+ enumerable: true,
2349
+ get: function () {
2350
+ return BoldIcon;
2351
+ }
2352
+ });
2353
+ Object.defineProperty(exports, 'BubbleMenuAlignCenter', {
2354
+ enumerable: true,
2355
+ get: function () {
2356
+ return BubbleMenuAlignCenter;
2357
+ }
2358
+ });
2359
+ Object.defineProperty(exports, 'BubbleMenuAlignLeft', {
2360
+ enumerable: true,
2361
+ get: function () {
2362
+ return BubbleMenuAlignLeft;
2363
+ }
2364
+ });
2365
+ Object.defineProperty(exports, 'BubbleMenuAlignRight', {
2366
+ enumerable: true,
2367
+ get: function () {
2368
+ return BubbleMenuAlignRight;
2369
+ }
2370
+ });
2371
+ Object.defineProperty(exports, 'BubbleMenuBold', {
2372
+ enumerable: true,
2373
+ get: function () {
2374
+ return BubbleMenuBold;
2375
+ }
2376
+ });
2377
+ Object.defineProperty(exports, 'BubbleMenuButtonDefault', {
2378
+ enumerable: true,
2379
+ get: function () {
2380
+ return BubbleMenuButtonDefault;
2381
+ }
2382
+ });
2383
+ Object.defineProperty(exports, 'BubbleMenuButtonEditLink', {
2384
+ enumerable: true,
2385
+ get: function () {
2386
+ return BubbleMenuButtonEditLink;
2387
+ }
2388
+ });
2389
+ Object.defineProperty(exports, 'BubbleMenuButtonForm', {
2390
+ enumerable: true,
2391
+ get: function () {
2392
+ return BubbleMenuButtonForm;
2393
+ }
2394
+ });
2395
+ Object.defineProperty(exports, 'BubbleMenuButtonToolbar', {
2396
+ enumerable: true,
2397
+ get: function () {
2398
+ return BubbleMenuButtonToolbar;
2399
+ }
2400
+ });
2401
+ Object.defineProperty(exports, 'BubbleMenuButtonUnlink', {
2402
+ enumerable: true,
2403
+ get: function () {
2404
+ return BubbleMenuButtonUnlink;
2405
+ }
2406
+ });
2407
+ Object.defineProperty(exports, 'BubbleMenuCode', {
2408
+ enumerable: true,
2409
+ get: function () {
2410
+ return BubbleMenuCode;
2411
+ }
2412
+ });
2413
+ Object.defineProperty(exports, 'BubbleMenuDefault', {
2414
+ enumerable: true,
2415
+ get: function () {
2416
+ return BubbleMenuDefault;
2417
+ }
2418
+ });
2419
+ Object.defineProperty(exports, 'BubbleMenuImageDefault', {
2420
+ enumerable: true,
2421
+ get: function () {
2422
+ return BubbleMenuImageDefault;
2423
+ }
2424
+ });
2425
+ Object.defineProperty(exports, 'BubbleMenuImageEditLink', {
2426
+ enumerable: true,
2427
+ get: function () {
2428
+ return BubbleMenuImageEditLink;
2429
+ }
2430
+ });
2431
+ Object.defineProperty(exports, 'BubbleMenuImageToolbar', {
2432
+ enumerable: true,
2433
+ get: function () {
2434
+ return BubbleMenuImageToolbar;
2435
+ }
2436
+ });
2437
+ Object.defineProperty(exports, 'BubbleMenuItalic', {
2438
+ enumerable: true,
2439
+ get: function () {
2440
+ return BubbleMenuItalic;
2441
+ }
2442
+ });
2443
+ Object.defineProperty(exports, 'BubbleMenuItem', {
2444
+ enumerable: true,
2445
+ get: function () {
2446
+ return BubbleMenuItem;
2447
+ }
2448
+ });
2449
+ Object.defineProperty(exports, 'BubbleMenuItemGroup', {
2450
+ enumerable: true,
2451
+ get: function () {
2452
+ return BubbleMenuItemGroup;
2453
+ }
2454
+ });
2455
+ Object.defineProperty(exports, 'BubbleMenuLinkDefault', {
2456
+ enumerable: true,
2457
+ get: function () {
2458
+ return BubbleMenuLinkDefault;
2459
+ }
2460
+ });
2461
+ Object.defineProperty(exports, 'BubbleMenuLinkEditLink', {
2462
+ enumerable: true,
2463
+ get: function () {
2464
+ return BubbleMenuLinkEditLink;
2465
+ }
2466
+ });
2467
+ Object.defineProperty(exports, 'BubbleMenuLinkForm', {
2468
+ enumerable: true,
2469
+ get: function () {
2470
+ return BubbleMenuLinkForm;
2471
+ }
2472
+ });
2473
+ Object.defineProperty(exports, 'BubbleMenuLinkOpenLink', {
2474
+ enumerable: true,
2475
+ get: function () {
2476
+ return BubbleMenuLinkOpenLink;
2477
+ }
2478
+ });
2479
+ Object.defineProperty(exports, 'BubbleMenuLinkSelector', {
2480
+ enumerable: true,
2481
+ get: function () {
2482
+ return BubbleMenuLinkSelector;
2483
+ }
2484
+ });
2485
+ Object.defineProperty(exports, 'BubbleMenuLinkToolbar', {
2486
+ enumerable: true,
2487
+ get: function () {
2488
+ return BubbleMenuLinkToolbar;
2489
+ }
2490
+ });
2491
+ Object.defineProperty(exports, 'BubbleMenuLinkUnlink', {
2492
+ enumerable: true,
2493
+ get: function () {
2494
+ return BubbleMenuLinkUnlink;
2495
+ }
2496
+ });
2497
+ Object.defineProperty(exports, 'BubbleMenuNodeSelector', {
2498
+ enumerable: true,
2499
+ get: function () {
2500
+ return BubbleMenuNodeSelector;
2501
+ }
2502
+ });
2503
+ Object.defineProperty(exports, 'BubbleMenuRoot', {
2504
+ enumerable: true,
2505
+ get: function () {
2506
+ return BubbleMenuRoot;
2507
+ }
2508
+ });
2509
+ Object.defineProperty(exports, 'BubbleMenuStrike', {
2510
+ enumerable: true,
2511
+ get: function () {
2512
+ return BubbleMenuStrike;
2513
+ }
2514
+ });
2515
+ Object.defineProperty(exports, 'BubbleMenuUnderline', {
2516
+ enumerable: true,
2517
+ get: function () {
2518
+ return BubbleMenuUnderline;
2519
+ }
2520
+ });
2521
+ Object.defineProperty(exports, 'BubbleMenuUppercase', {
2522
+ enumerable: true,
2523
+ get: function () {
2524
+ return BubbleMenuUppercase;
2525
+ }
2526
+ });
2527
+ Object.defineProperty(exports, 'CODE', {
2528
+ enumerable: true,
2529
+ get: function () {
2530
+ return CODE;
2531
+ }
2532
+ });
2533
+ Object.defineProperty(exports, 'CaseUpperIcon', {
2534
+ enumerable: true,
2535
+ get: function () {
2536
+ return CaseUpperIcon;
2537
+ }
2538
+ });
2539
+ Object.defineProperty(exports, 'Check', {
2540
+ enumerable: true,
2541
+ get: function () {
2542
+ return Check;
2543
+ }
2544
+ });
2545
+ Object.defineProperty(exports, 'ChevronDown', {
2546
+ enumerable: true,
2547
+ get: function () {
2548
+ return ChevronDown;
2549
+ }
2550
+ });
2551
+ Object.defineProperty(exports, 'Code', {
2552
+ enumerable: true,
2553
+ get: function () {
2554
+ return Code;
2555
+ }
2556
+ });
2557
+ Object.defineProperty(exports, 'CodeIcon', {
2558
+ enumerable: true,
2559
+ get: function () {
2560
+ return CodeIcon;
2561
+ }
2562
+ });
2563
+ Object.defineProperty(exports, 'Columns2', {
2564
+ enumerable: true,
2565
+ get: function () {
2566
+ return Columns2;
2567
+ }
2568
+ });
2569
+ Object.defineProperty(exports, 'Columns3', {
2570
+ enumerable: true,
2571
+ get: function () {
2572
+ return Columns3;
2573
+ }
2574
+ });
2575
+ Object.defineProperty(exports, 'Columns4', {
2576
+ enumerable: true,
2577
+ get: function () {
2578
+ return Columns4;
2579
+ }
2580
+ });
2581
+ Object.defineProperty(exports, 'CommandList', {
2582
+ enumerable: true,
2583
+ get: function () {
2584
+ return CommandList;
2585
+ }
2586
+ });
2587
+ Object.defineProperty(exports, 'DIVIDER', {
2588
+ enumerable: true,
2589
+ get: function () {
2590
+ return DIVIDER;
2591
+ }
2592
+ });
2593
+ Object.defineProperty(exports, 'ExternalLinkIcon', {
2594
+ enumerable: true,
2595
+ get: function () {
2596
+ return ExternalLinkIcon;
2597
+ }
2598
+ });
2599
+ Object.defineProperty(exports, 'FOUR_COLUMNS', {
2600
+ enumerable: true,
2601
+ get: function () {
2602
+ return FOUR_COLUMNS;
2603
+ }
2604
+ });
2605
+ Object.defineProperty(exports, 'H1', {
2606
+ enumerable: true,
2607
+ get: function () {
2608
+ return H1;
2609
+ }
2610
+ });
2611
+ Object.defineProperty(exports, 'H2', {
2612
+ enumerable: true,
2613
+ get: function () {
2614
+ return H2;
2615
+ }
2616
+ });
2617
+ Object.defineProperty(exports, 'H3', {
2618
+ enumerable: true,
2619
+ get: function () {
2620
+ return H3;
2621
+ }
2622
+ });
2623
+ Object.defineProperty(exports, 'Heading1', {
2624
+ enumerable: true,
2625
+ get: function () {
2626
+ return Heading1;
2627
+ }
2628
+ });
2629
+ Object.defineProperty(exports, 'Heading2', {
2630
+ enumerable: true,
2631
+ get: function () {
2632
+ return Heading2;
2633
+ }
2634
+ });
2635
+ Object.defineProperty(exports, 'Heading3', {
2636
+ enumerable: true,
2637
+ get: function () {
2638
+ return Heading3;
2639
+ }
2640
+ });
2641
+ Object.defineProperty(exports, 'ItalicIcon', {
2642
+ enumerable: true,
2643
+ get: function () {
2644
+ return ItalicIcon;
2645
+ }
2646
+ });
2647
+ Object.defineProperty(exports, 'LinkIcon', {
2648
+ enumerable: true,
2649
+ get: function () {
2650
+ return LinkIcon;
2651
+ }
2652
+ });
2653
+ Object.defineProperty(exports, 'List', {
2654
+ enumerable: true,
2655
+ get: function () {
2656
+ return List;
2657
+ }
2658
+ });
2659
+ Object.defineProperty(exports, 'ListOrdered', {
2660
+ enumerable: true,
2661
+ get: function () {
2662
+ return ListOrdered;
2663
+ }
2664
+ });
2665
+ Object.defineProperty(exports, 'MousePointer', {
2666
+ enumerable: true,
2667
+ get: function () {
2668
+ return MousePointer;
2669
+ }
2670
+ });
2671
+ Object.defineProperty(exports, 'NUMBERED_LIST', {
2672
+ enumerable: true,
2673
+ get: function () {
2674
+ return NUMBERED_LIST;
2675
+ }
2676
+ });
2677
+ Object.defineProperty(exports, 'NodeSelectorContent', {
2678
+ enumerable: true,
2679
+ get: function () {
2680
+ return NodeSelectorContent;
2681
+ }
2682
+ });
2683
+ Object.defineProperty(exports, 'NodeSelectorRoot', {
2684
+ enumerable: true,
2685
+ get: function () {
2686
+ return NodeSelectorRoot;
2687
+ }
2688
+ });
2689
+ Object.defineProperty(exports, 'NodeSelectorTrigger', {
2690
+ enumerable: true,
2691
+ get: function () {
2692
+ return NodeSelectorTrigger;
2693
+ }
2694
+ });
2695
+ Object.defineProperty(exports, 'PencilIcon', {
2696
+ enumerable: true,
2697
+ get: function () {
2698
+ return PencilIcon;
2699
+ }
2700
+ });
2701
+ Object.defineProperty(exports, 'QUOTE', {
2702
+ enumerable: true,
2703
+ get: function () {
2704
+ return QUOTE;
2705
+ }
2706
+ });
2707
+ Object.defineProperty(exports, 'Rows2', {
2708
+ enumerable: true,
2709
+ get: function () {
2710
+ return Rows2;
2711
+ }
2712
+ });
2713
+ Object.defineProperty(exports, 'SECTION', {
2714
+ enumerable: true,
2715
+ get: function () {
2716
+ return SECTION;
2717
+ }
2718
+ });
2719
+ Object.defineProperty(exports, 'SlashCommandRoot', {
2720
+ enumerable: true,
2721
+ get: function () {
2722
+ return SlashCommandRoot;
2723
+ }
2724
+ });
2725
+ Object.defineProperty(exports, 'SplitSquareVertical', {
2726
+ enumerable: true,
2727
+ get: function () {
2728
+ return SplitSquareVertical;
2729
+ }
2730
+ });
2731
+ Object.defineProperty(exports, 'SquareCode', {
2732
+ enumerable: true,
2733
+ get: function () {
2734
+ return SquareCode;
2735
+ }
2736
+ });
2737
+ Object.defineProperty(exports, 'StrikethroughIcon', {
2738
+ enumerable: true,
2739
+ get: function () {
2740
+ return StrikethroughIcon;
2741
+ }
2742
+ });
2743
+ Object.defineProperty(exports, 'TEXT', {
2744
+ enumerable: true,
2745
+ get: function () {
2746
+ return TEXT;
2747
+ }
2748
+ });
2749
+ Object.defineProperty(exports, 'THREE_COLUMNS', {
2750
+ enumerable: true,
2751
+ get: function () {
2752
+ return THREE_COLUMNS;
2753
+ }
2754
+ });
2755
+ Object.defineProperty(exports, 'TWO_COLUMNS', {
2756
+ enumerable: true,
2757
+ get: function () {
2758
+ return TWO_COLUMNS;
2759
+ }
2760
+ });
2761
+ Object.defineProperty(exports, 'Text', {
2762
+ enumerable: true,
2763
+ get: function () {
2764
+ return Text;
2765
+ }
2766
+ });
2767
+ Object.defineProperty(exports, 'TextIcon', {
2768
+ enumerable: true,
2769
+ get: function () {
2770
+ return TextIcon;
2771
+ }
2772
+ });
2773
+ Object.defineProperty(exports, 'TextQuote', {
2774
+ enumerable: true,
2775
+ get: function () {
2776
+ return TextQuote;
2777
+ }
2778
+ });
2779
+ Object.defineProperty(exports, 'UnderlineIcon', {
2780
+ enumerable: true,
2781
+ get: function () {
2782
+ return UnderlineIcon;
2783
+ }
2784
+ });
2785
+ Object.defineProperty(exports, 'UnlinkIcon', {
2786
+ enumerable: true,
2787
+ get: function () {
2788
+ return UnlinkIcon;
2789
+ }
2790
+ });
2791
+ Object.defineProperty(exports, 'bubbleMenuTriggers', {
2792
+ enumerable: true,
2793
+ get: function () {
2794
+ return bubbleMenuTriggers;
2795
+ }
2796
+ });
2797
+ Object.defineProperty(exports, 'defaultSlashCommands', {
2798
+ enumerable: true,
2799
+ get: function () {
2800
+ return defaultSlashCommands;
2801
+ }
2802
+ });
2803
+ Object.defineProperty(exports, 'filterAndRankItems', {
2804
+ enumerable: true,
2805
+ get: function () {
2806
+ return filterAndRankItems;
2807
+ }
2808
+ });
2809
+ Object.defineProperty(exports, 'isAtMaxColumnsDepth', {
2810
+ enumerable: true,
2811
+ get: function () {
2812
+ return isAtMaxColumnsDepth;
2813
+ }
2814
+ });
2815
+ Object.defineProperty(exports, 'isInsideNode', {
2816
+ enumerable: true,
2817
+ get: function () {
2818
+ return isInsideNode;
2819
+ }
2820
+ });
2821
+ Object.defineProperty(exports, 'scoreItem', {
2822
+ enumerable: true,
2823
+ get: function () {
2824
+ return scoreItem;
2825
+ }
2826
+ });
2827
+ Object.defineProperty(exports, 'useBubbleMenuContext', {
2828
+ enumerable: true,
2829
+ get: function () {
2830
+ return useBubbleMenuContext;
2831
+ }
2832
+ });