@react-email/editor 0.0.0-experimental.35 → 0.0.0-experimental.38

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 (67) hide show
  1. package/dist/core/index.cjs +8 -7
  2. package/dist/core/index.d.cts +2 -2
  3. package/dist/core/index.d.mts +3 -2
  4. package/dist/core/index.mjs +3 -3
  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/{columns-Cos2lqfu.mjs → event-bus-CHEzOS_O.mjs} +45 -45
  10. package/dist/event-bus-CHEzOS_O.mjs.map +1 -0
  11. package/dist/{columns-BXN-NNd4.cjs → event-bus-fb8U7hrl.cjs} +42 -42
  12. package/dist/extension-CnC8y63H.mjs +1119 -0
  13. package/dist/extension-CnC8y63H.mjs.map +1 -0
  14. package/dist/extension-dGpPpEvD.cjs +1244 -0
  15. package/dist/extensions/index.cjs +45 -45
  16. package/dist/extensions/index.d.cts +2 -41
  17. package/dist/extensions/index.d.cts.map +1 -1
  18. package/dist/extensions/index.d.mts +3 -41
  19. package/dist/extensions/index.d.mts.map +1 -1
  20. package/dist/extensions/index.mjs +3 -3
  21. package/dist/{core-mUMTkab3.mjs → extensions-DWsu9kwZ.mjs} +221 -221
  22. package/dist/extensions-DWsu9kwZ.mjs.map +1 -0
  23. package/dist/{core-DVox_fis.cjs → extensions-aMMnHcs9.cjs} +298 -280
  24. package/dist/{global-content-kdUzYcsA.mjs → global-content-5rAU84QT.mjs} +1 -1
  25. package/dist/{global-content-kdUzYcsA.mjs.map → global-content-5rAU84QT.mjs.map} +1 -1
  26. package/dist/{global-content-BRvA4PRG.cjs → global-content-62RO9uoQ.cjs} +1 -1
  27. package/dist/{index-CVRlPqX_.d.cts → index-C4KcMQ0R.d.cts} +43 -13
  28. package/dist/index-C4KcMQ0R.d.cts.map +1 -0
  29. package/dist/{index-BrSAA0dn.d.mts → index-CxX7W63O.d.mts} +43 -13
  30. package/dist/index-CxX7W63O.d.mts.map +1 -0
  31. package/dist/index.cjs +74 -0
  32. package/dist/index.css +859 -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 +33 -0
  37. package/dist/index.d.mts.map +1 -0
  38. package/dist/index.mjs +74 -0
  39. package/dist/index.mjs.map +1 -0
  40. package/dist/plugins/index.cjs +22 -1138
  41. package/dist/plugins/index.d.cts.map +1 -1
  42. package/dist/plugins/index.d.mts +1 -1
  43. package/dist/plugins/index.d.mts.map +1 -1
  44. package/dist/plugins/index.mjs +2 -1118
  45. package/dist/root-BMxsq1NF.mjs +2401 -0
  46. package/dist/root-BMxsq1NF.mjs.map +1 -0
  47. package/dist/root-CNVO39XG.cjs +2941 -0
  48. package/dist/{set-text-alignment-BO24ieeE.mjs → set-text-alignment-GMXOPMlJ.mjs} +1 -1
  49. package/dist/{set-text-alignment-BO24ieeE.mjs.map → set-text-alignment-GMXOPMlJ.mjs.map} +1 -1
  50. package/dist/{styles-DLviD0JK.mjs → styles-_TMw3YxC.mjs} +1 -1
  51. package/dist/{styles-DLviD0JK.mjs.map → styles-_TMw3YxC.mjs.map} +1 -1
  52. package/dist/ui/index.cjs +128 -2515
  53. package/dist/ui/index.d.cts +97 -102
  54. package/dist/ui/index.d.cts.map +1 -1
  55. package/dist/ui/index.d.mts +98 -103
  56. package/dist/ui/index.d.mts.map +1 -1
  57. package/dist/ui/index.mjs +2 -2388
  58. package/dist/ui/index.mjs.map +1 -1
  59. package/dist/utils/index.cjs +1 -1
  60. package/dist/utils/index.mjs +1 -1
  61. package/package.json +12 -2
  62. package/dist/columns-Cos2lqfu.mjs.map +0 -1
  63. package/dist/core-mUMTkab3.mjs.map +0 -1
  64. package/dist/index-BrSAA0dn.d.mts.map +0 -1
  65. package/dist/index-CVRlPqX_.d.cts.map +0 -1
  66. package/dist/plugins/index.mjs.map +0 -1
  67. /package/dist/{set-text-alignment-CbECklB4.cjs → set-text-alignment-aNb7Ml9N.cjs} +0 -0
package/dist/ui/index.cjs CHANGED
@@ -1,1354 +1,7 @@
1
- const require_columns = require('../columns-BXN-NNd4.cjs');
2
- const require_set_text_alignment = require('../set-text-alignment-CbECklB4.cjs');
1
+ const require_event_bus = require('../event-bus-fb8U7hrl.cjs');
2
+ const require_root = require('../root-CNVO39XG.cjs');
3
3
  let react_jsx_runtime = require("react/jsx-runtime");
4
- let _tiptap_react = require("@tiptap/react");
5
- let react = require("react");
6
- react = require_columns.__toESM(react);
7
- let _tiptap_pm_state = require("@tiptap/pm/state");
8
- let _radix_ui_react_popover = require("@radix-ui/react-popover");
9
- _radix_ui_react_popover = require_columns.__toESM(_radix_ui_react_popover);
10
- let _tiptap_react_menus = require("@tiptap/react/menus");
11
- let _floating_ui_react_dom = require("@floating-ui/react-dom");
12
- let _tiptap_suggestion = require("@tiptap/suggestion");
13
- _tiptap_suggestion = require_columns.__toESM(_tiptap_suggestion);
14
- let react_dom = require("react-dom");
15
4
 
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/item.tsx
750
- function BubbleMenuItem({ name, isActive, onCommand, className, children, ...rest }) {
751
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
752
- type: "button",
753
- "aria-label": name,
754
- "aria-pressed": isActive,
755
- className,
756
- "data-re-bubble-menu-item": "",
757
- "data-item": name,
758
- ...isActive ? { "data-active": "" } : {},
759
- onMouseDown: (e) => e.preventDefault(),
760
- onClick: onCommand,
761
- ...rest,
762
- children
763
- });
764
- }
765
-
766
- //#endregion
767
- //#region src/ui/bubble-menu/align-center.tsx
768
- function BubbleMenuAlignCenter({ className, children }) {
769
- const { editor } = useBubbleMenuContext();
770
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
771
- name: "align-center",
772
- isActive: (0, _tiptap_react.useEditorState)({
773
- editor,
774
- selector: ({ editor: editor$1 }) => editor$1?.isActive({ alignment: "center" }) ?? false
775
- }),
776
- onCommand: () => require_set_text_alignment.setTextAlignment(editor, "center"),
777
- className,
778
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlignCenterIcon, {})
779
- });
780
- }
781
-
782
- //#endregion
783
- //#region src/ui/bubble-menu/align-left.tsx
784
- function BubbleMenuAlignLeft({ className, children }) {
785
- const { editor } = useBubbleMenuContext();
786
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
787
- name: "align-left",
788
- isActive: (0, _tiptap_react.useEditorState)({
789
- editor,
790
- selector: ({ editor: editor$1 }) => editor$1?.isActive({ alignment: "left" }) ?? false
791
- }),
792
- onCommand: () => require_set_text_alignment.setTextAlignment(editor, "left"),
793
- className,
794
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlignLeftIcon, {})
795
- });
796
- }
797
-
798
- //#endregion
799
- //#region src/ui/bubble-menu/align-right.tsx
800
- function BubbleMenuAlignRight({ className, children }) {
801
- const { editor } = useBubbleMenuContext();
802
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
803
- name: "align-right",
804
- isActive: (0, _tiptap_react.useEditorState)({
805
- editor,
806
- selector: ({ editor: editor$1 }) => editor$1?.isActive({ alignment: "right" }) ?? false
807
- }),
808
- onCommand: () => require_set_text_alignment.setTextAlignment(editor, "right"),
809
- className,
810
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlignRightIcon, {})
811
- });
812
- }
813
-
814
- //#endregion
815
- //#region src/ui/bubble-menu/create-mark-bubble-item.tsx
816
- function createMarkBubbleItem(config) {
817
- function MarkBubbleItem({ className, children }) {
818
- const { editor } = useBubbleMenuContext();
819
- const isActive = (0, _tiptap_react.useEditorState)({
820
- editor,
821
- selector: ({ editor: editor$1 }) => {
822
- if (config.activeParams) return editor$1?.isActive(config.activeName, config.activeParams) ?? false;
823
- return editor$1?.isActive(config.activeName) ?? false;
824
- }
825
- });
826
- const handleCommand = () => {
827
- const chain = editor.chain().focus();
828
- const method = chain[config.command];
829
- if (method) method.call(chain).run();
830
- };
831
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
832
- name: config.name,
833
- isActive,
834
- onCommand: handleCommand,
835
- className,
836
- children: children ?? config.icon
837
- });
838
- }
839
- MarkBubbleItem.displayName = `BubbleMenu${config.name.charAt(0).toUpperCase() + config.name.slice(1)}`;
840
- return MarkBubbleItem;
841
- }
842
-
843
- //#endregion
844
- //#region src/ui/bubble-menu/bold.tsx
845
- const BubbleMenuBold = createMarkBubbleItem({
846
- name: "bold",
847
- activeName: "bold",
848
- command: "toggleBold",
849
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BoldIcon, {})
850
- });
851
-
852
- //#endregion
853
- //#region src/ui/bubble-menu/code.tsx
854
- const BubbleMenuCode = createMarkBubbleItem({
855
- name: "code",
856
- activeName: "code",
857
- command: "toggleCode",
858
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CodeIcon, {})
859
- });
860
-
861
- //#endregion
862
- //#region src/ui/bubble-menu/group.tsx
863
- function BubbleMenuItemGroup({ className, children }) {
864
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("fieldset", {
865
- className,
866
- "data-re-bubble-menu-group": "",
867
- children
868
- });
869
- }
870
-
871
- //#endregion
872
- //#region src/ui/bubble-menu/italic.tsx
873
- const BubbleMenuItalic = createMarkBubbleItem({
874
- name: "italic",
875
- activeName: "italic",
876
- command: "toggleItalic",
877
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItalicIcon, {})
878
- });
879
-
880
- //#endregion
881
- //#region src/ui/bubble-menu/utils.ts
882
- const SAFE_PROTOCOLS = new Set([
883
- "http:",
884
- "https:",
885
- "mailto:",
886
- "tel:"
887
- ]);
888
- /**
889
- * Basic URL validation and auto-prefixing.
890
- * Rejects dangerous schemes (javascript:, data:, vbscript:, etc.).
891
- * Returns the valid URL string or null.
892
- */
893
- function getUrlFromString(str) {
894
- if (str === "#") return str;
895
- try {
896
- const url = new URL(str);
897
- if (SAFE_PROTOCOLS.has(url.protocol)) return str;
898
- return null;
899
- } catch {}
900
- try {
901
- if (str.includes(".") && !str.includes(" ")) return new URL(`https://${str}`).toString();
902
- } catch {}
903
- return null;
904
- }
905
- function setLinkHref(editor, href) {
906
- if (href.length === 0) {
907
- editor.chain().unsetLink().run();
908
- return;
909
- }
910
- const { from, to } = editor.state.selection;
911
- if (from === to) {
912
- editor.chain().extendMarkRange("link").setLink({ href }).setTextSelection({
913
- from,
914
- to
915
- }).run();
916
- return;
917
- }
918
- editor.chain().setLink({ href }).run();
919
- }
920
- function focusEditor(editor) {
921
- setTimeout(() => {
922
- editor.commands.focus();
923
- }, 0);
924
- }
925
-
926
- //#endregion
927
- //#region src/ui/bubble-menu/link-selector.tsx
928
- function BubbleMenuLinkSelector({ className, showToggle = true, validateUrl, onLinkApply, onLinkRemove, children, open: controlledOpen, onOpenChange }) {
929
- const { editor } = useBubbleMenuContext();
930
- const [uncontrolledOpen, setUncontrolledOpen] = react.useState(false);
931
- const isControlled = controlledOpen !== void 0;
932
- const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
933
- const setIsOpen = react.useCallback((value) => {
934
- if (!isControlled) setUncontrolledOpen(value);
935
- onOpenChange?.(value);
936
- }, [isControlled, onOpenChange]);
937
- const editorState = (0, _tiptap_react.useEditorState)({
938
- editor,
939
- selector: ({ editor: editor$1 }) => ({
940
- isLinkActive: editor$1?.isActive("link") ?? false,
941
- hasLink: Boolean(editor$1?.getAttributes("link").href),
942
- currentHref: editor$1?.getAttributes("link").href || ""
943
- })
944
- });
945
- const setIsOpenRef = react.useRef(setIsOpen);
946
- setIsOpenRef.current = setIsOpen;
947
- react.useEffect(() => {
948
- const subscription = require_columns.editorEventBus.on("bubble-menu:add-link", () => {
949
- setIsOpenRef.current(true);
950
- });
951
- return () => {
952
- setIsOpenRef.current(false);
953
- subscription.unsubscribe();
954
- };
955
- }, []);
956
- if (!editorState) return null;
957
- const handleOpenLink = () => {
958
- setIsOpen(!isOpen);
959
- };
960
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
961
- "data-re-link-selector": "",
962
- ...isOpen ? { "data-open": "" } : {},
963
- ...editorState.hasLink ? { "data-has-link": "" } : {},
964
- className,
965
- children: [showToggle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
966
- type: "button",
967
- "aria-expanded": isOpen,
968
- "aria-haspopup": "true",
969
- "aria-label": "Add link",
970
- "aria-pressed": editorState.isLinkActive && editorState.hasLink,
971
- "data-re-link-selector-trigger": "",
972
- onClick: handleOpenLink,
973
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkIcon, {})
974
- }), isOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkForm, {
975
- editor,
976
- currentHref: editorState.currentHref,
977
- validateUrl,
978
- onLinkApply,
979
- onLinkRemove,
980
- setIsOpen,
981
- children
982
- })]
983
- });
984
- }
985
- function LinkForm({ editor, currentHref, validateUrl, onLinkApply, onLinkRemove, setIsOpen, children }) {
986
- const inputRef = react.useRef(null);
987
- const formRef = react.useRef(null);
988
- const displayHref = currentHref === "#" ? "" : currentHref;
989
- const [inputValue, setInputValue] = react.useState(displayHref);
990
- react.useEffect(() => {
991
- const timeoutId = setTimeout(() => {
992
- inputRef.current?.focus();
993
- }, 0);
994
- return () => clearTimeout(timeoutId);
995
- }, []);
996
- react.useEffect(() => {
997
- const handleKeyDown = (event) => {
998
- if (event.key === "Escape") {
999
- if (editor.getAttributes("link").href === "#") editor.chain().unsetLink().run();
1000
- setIsOpen(false);
1001
- }
1002
- };
1003
- const handleClickOutside = (event) => {
1004
- if (formRef.current && !formRef.current.contains(event.target)) {
1005
- const form = formRef.current;
1006
- const submitEvent = new Event("submit", {
1007
- bubbles: true,
1008
- cancelable: true
1009
- });
1010
- form.dispatchEvent(submitEvent);
1011
- setIsOpen(false);
1012
- }
1013
- };
1014
- document.addEventListener("mousedown", handleClickOutside);
1015
- window.addEventListener("keydown", handleKeyDown);
1016
- return () => {
1017
- window.removeEventListener("keydown", handleKeyDown);
1018
- document.removeEventListener("mousedown", handleClickOutside);
1019
- };
1020
- }, [editor, setIsOpen]);
1021
- function handleSubmit(e) {
1022
- e.preventDefault();
1023
- const value = inputValue.trim();
1024
- if (value === "") {
1025
- setLinkHref(editor, "");
1026
- setIsOpen(false);
1027
- focusEditor(editor);
1028
- onLinkRemove?.();
1029
- return;
1030
- }
1031
- const finalValue = (validateUrl ?? getUrlFromString)(value);
1032
- if (!finalValue) {
1033
- setLinkHref(editor, "");
1034
- setIsOpen(false);
1035
- focusEditor(editor);
1036
- onLinkRemove?.();
1037
- return;
1038
- }
1039
- setLinkHref(editor, finalValue);
1040
- setIsOpen(false);
1041
- focusEditor(editor);
1042
- onLinkApply?.(finalValue);
1043
- }
1044
- function handleUnlink(e) {
1045
- e.stopPropagation();
1046
- setLinkHref(editor, "");
1047
- setIsOpen(false);
1048
- focusEditor(editor);
1049
- onLinkRemove?.();
1050
- }
1051
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1052
- ref: formRef,
1053
- "data-re-link-selector-form": "",
1054
- onMouseDown: (e) => e.stopPropagation(),
1055
- onClick: (e) => e.stopPropagation(),
1056
- onKeyDown: (e) => e.stopPropagation(),
1057
- onSubmit: handleSubmit,
1058
- children: [
1059
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1060
- ref: inputRef,
1061
- "data-re-link-selector-input": "",
1062
- value: inputValue,
1063
- onFocus: (e) => e.stopPropagation(),
1064
- onChange: (e) => setInputValue(e.target.value),
1065
- placeholder: "Paste a link",
1066
- type: "text"
1067
- }),
1068
- children,
1069
- displayHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1070
- type: "button",
1071
- "aria-label": "Remove link",
1072
- "data-re-link-selector-unlink": "",
1073
- onClick: handleUnlink,
1074
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnlinkIcon, {})
1075
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1076
- type: "submit",
1077
- "aria-label": "Apply link",
1078
- "data-re-link-selector-apply": "",
1079
- onMouseDown: (e) => e.stopPropagation(),
1080
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Check, {})
1081
- })
1082
- ]
1083
- });
1084
- }
1085
-
1086
- //#endregion
1087
- //#region src/ui/bubble-menu/node-selector.tsx
1088
- const NodeSelectorContext = react.createContext(null);
1089
- function useNodeSelectorContext() {
1090
- const context = react.useContext(NodeSelectorContext);
1091
- if (!context) throw new Error("NodeSelector compound components must be used within <NodeSelector.Root>");
1092
- return context;
1093
- }
1094
- function NodeSelectorRoot({ omit = [], open: controlledOpen, onOpenChange, className, children }) {
1095
- const { editor } = useBubbleMenuContext();
1096
- const [uncontrolledOpen, setUncontrolledOpen] = react.useState(false);
1097
- const isControlled = controlledOpen !== void 0;
1098
- const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
1099
- const setIsOpen = react.useCallback((value) => {
1100
- if (!isControlled) setUncontrolledOpen(value);
1101
- onOpenChange?.(value);
1102
- }, [isControlled, onOpenChange]);
1103
- const editorState = (0, _tiptap_react.useEditorState)({
1104
- editor,
1105
- selector: ({ editor: editor$1 }) => ({
1106
- isParagraphActive: (editor$1?.isActive("paragraph") ?? false) && !editor$1?.isActive("bulletList") && !editor$1?.isActive("orderedList"),
1107
- isHeading1Active: editor$1?.isActive("heading", { level: 1 }) ?? false,
1108
- isHeading2Active: editor$1?.isActive("heading", { level: 2 }) ?? false,
1109
- isHeading3Active: editor$1?.isActive("heading", { level: 3 }) ?? false,
1110
- isBulletListActive: editor$1?.isActive("bulletList") ?? false,
1111
- isOrderedListActive: editor$1?.isActive("orderedList") ?? false,
1112
- isBlockquoteActive: editor$1?.isActive("blockquote") ?? false,
1113
- isCodeBlockActive: editor$1?.isActive("codeBlock") ?? false
1114
- })
1115
- });
1116
- const allItems = react.useMemo(() => [
1117
- {
1118
- name: "Text",
1119
- icon: TextIcon,
1120
- command: () => editor.chain().focus().clearNodes().toggleNode("paragraph", "paragraph").run(),
1121
- isActive: editorState?.isParagraphActive ?? false
1122
- },
1123
- {
1124
- name: "Title",
1125
- icon: Heading1,
1126
- command: () => editor.chain().focus().clearNodes().toggleHeading({ level: 1 }).run(),
1127
- isActive: editorState?.isHeading1Active ?? false
1128
- },
1129
- {
1130
- name: "Subtitle",
1131
- icon: Heading2,
1132
- command: () => editor.chain().focus().clearNodes().toggleHeading({ level: 2 }).run(),
1133
- isActive: editorState?.isHeading2Active ?? false
1134
- },
1135
- {
1136
- name: "Heading",
1137
- icon: Heading3,
1138
- command: () => editor.chain().focus().clearNodes().toggleHeading({ level: 3 }).run(),
1139
- isActive: editorState?.isHeading3Active ?? false
1140
- },
1141
- {
1142
- name: "Bullet List",
1143
- icon: List,
1144
- command: () => editor.chain().focus().clearNodes().toggleBulletList().run(),
1145
- isActive: editorState?.isBulletListActive ?? false
1146
- },
1147
- {
1148
- name: "Numbered List",
1149
- icon: ListOrdered,
1150
- command: () => editor.chain().focus().clearNodes().toggleOrderedList().run(),
1151
- isActive: editorState?.isOrderedListActive ?? false
1152
- },
1153
- {
1154
- name: "Quote",
1155
- icon: TextQuote,
1156
- command: () => editor.chain().focus().clearNodes().toggleNode("paragraph", "paragraph").toggleBlockquote().run(),
1157
- isActive: editorState?.isBlockquoteActive ?? false
1158
- },
1159
- {
1160
- name: "Code",
1161
- icon: Code,
1162
- command: () => editor.chain().focus().clearNodes().toggleCodeBlock().run(),
1163
- isActive: editorState?.isCodeBlockActive ?? false
1164
- }
1165
- ], [editor, editorState]);
1166
- const items = react.useMemo(() => allItems.filter((item) => !omit.includes(item.name)), [allItems, omit]);
1167
- const activeItem = react.useMemo(() => items.find((item) => item.isActive) ?? { name: "Multiple" }, [items]);
1168
- const contextValue = react.useMemo(() => ({
1169
- items,
1170
- activeItem,
1171
- isOpen,
1172
- setIsOpen
1173
- }), [
1174
- items,
1175
- activeItem,
1176
- isOpen,
1177
- setIsOpen
1178
- ]);
1179
- if (!editorState || items.length === 0) return null;
1180
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NodeSelectorContext.Provider, {
1181
- value: contextValue,
1182
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Root, {
1183
- open: isOpen,
1184
- onOpenChange: setIsOpen,
1185
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1186
- "data-re-node-selector": "",
1187
- ...isOpen ? { "data-open": "" } : {},
1188
- className,
1189
- children
1190
- })
1191
- })
1192
- });
1193
- }
1194
- function NodeSelectorTrigger({ className, children }) {
1195
- const { activeItem, isOpen, setIsOpen } = useNodeSelectorContext();
1196
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Trigger, {
1197
- "data-re-node-selector-trigger": "",
1198
- className,
1199
- onClick: () => setIsOpen(!isOpen),
1200
- 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, {})] })
1201
- });
1202
- }
1203
- function NodeSelectorContent({ className, align = "start", children }) {
1204
- const { items, setIsOpen } = useNodeSelectorContext();
1205
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Content, {
1206
- align,
1207
- "data-re-node-selector-content": "",
1208
- className,
1209
- children: children ? children(items, () => setIsOpen(false)) : items.map((item) => {
1210
- const Icon = item.icon;
1211
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1212
- type: "button",
1213
- "data-re-node-selector-item": "",
1214
- ...item.isActive ? { "data-active": "" } : {},
1215
- onClick: () => {
1216
- item.command();
1217
- setIsOpen(false);
1218
- },
1219
- children: [
1220
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {}),
1221
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: item.name }),
1222
- item.isActive && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Check, {})
1223
- ]
1224
- }, item.name);
1225
- })
1226
- });
1227
- }
1228
- function BubbleMenuNodeSelector({ omit = [], className, triggerContent, open, onOpenChange }) {
1229
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(NodeSelectorRoot, {
1230
- omit,
1231
- open,
1232
- onOpenChange,
1233
- className,
1234
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NodeSelectorTrigger, { children: triggerContent }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NodeSelectorContent, {})]
1235
- });
1236
- }
1237
-
1238
- //#endregion
1239
- //#region src/ui/bubble-menu/root.tsx
1240
- function BubbleMenuRoot({ excludeNodes = [], excludeMarks = [], placement = "bottom", offset: offset$1 = 8, onHide, className, children }) {
1241
- const { editor } = (0, _tiptap_react.useCurrentEditor)();
1242
- if (!editor) return null;
1243
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react_menus.BubbleMenu, {
1244
- editor,
1245
- pluginKey: "textBubbleMenu",
1246
- "data-re-bubble-menu": "",
1247
- shouldShow: ({ editor: editor$1, view, state }) => {
1248
- for (const node of excludeNodes) {
1249
- if (editor$1.isActive(node)) return false;
1250
- const { $from } = state.selection;
1251
- for (let d = $from.depth; d > 0; d--) if ($from.node(d).type.name === node) return false;
1252
- }
1253
- for (const mark of excludeMarks) if (editor$1.isActive(mark)) return false;
1254
- if (view.dom.classList.contains("dragging")) return false;
1255
- return editor$1.view.state.selection.content().size > 0;
1256
- },
1257
- options: {
1258
- placement,
1259
- offset: offset$1,
1260
- onHide
1261
- },
1262
- className,
1263
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuContext.Provider, {
1264
- value: { editor },
1265
- children
1266
- })
1267
- });
1268
- }
1269
-
1270
- //#endregion
1271
- //#region src/ui/bubble-menu/strike.tsx
1272
- const BubbleMenuStrike = createMarkBubbleItem({
1273
- name: "strike",
1274
- activeName: "strike",
1275
- command: "toggleStrike",
1276
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StrikethroughIcon, {})
1277
- });
1278
-
1279
- //#endregion
1280
- //#region src/ui/bubble-menu/underline.tsx
1281
- const BubbleMenuUnderline = createMarkBubbleItem({
1282
- name: "underline",
1283
- activeName: "underline",
1284
- command: "toggleUnderline",
1285
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnderlineIcon, {})
1286
- });
1287
-
1288
- //#endregion
1289
- //#region src/ui/bubble-menu/uppercase.tsx
1290
- const BubbleMenuUppercase = createMarkBubbleItem({
1291
- name: "uppercase",
1292
- activeName: "uppercase",
1293
- command: "toggleUppercase",
1294
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CaseUpperIcon, {})
1295
- });
1296
-
1297
- //#endregion
1298
- //#region src/ui/bubble-menu/default.tsx
1299
- function BubbleMenuDefault({ excludeItems = [], excludeNodes, excludeMarks, placement, offset: offset$1, onHide, className }) {
1300
- const [isNodeSelectorOpen, setIsNodeSelectorOpen] = react.useState(false);
1301
- const [isLinkSelectorOpen, setIsLinkSelectorOpen] = react.useState(false);
1302
- const has = (item) => !excludeItems.includes(item);
1303
- const handleNodeSelectorOpenChange = react.useCallback((open) => {
1304
- setIsNodeSelectorOpen(open);
1305
- if (open) setIsLinkSelectorOpen(false);
1306
- }, []);
1307
- const handleLinkSelectorOpenChange = react.useCallback((open) => {
1308
- setIsLinkSelectorOpen(open);
1309
- if (open) setIsNodeSelectorOpen(false);
1310
- }, []);
1311
- const handleHide = react.useCallback(() => {
1312
- setIsNodeSelectorOpen(false);
1313
- setIsLinkSelectorOpen(false);
1314
- onHide?.();
1315
- }, [onHide]);
1316
- const hasFormattingItems = has("bold") || has("italic") || has("underline") || has("strike") || has("code") || has("uppercase");
1317
- const hasAlignmentItems = has("align-left") || has("align-center") || has("align-right");
1318
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleMenuRoot, {
1319
- excludeNodes,
1320
- excludeMarks,
1321
- placement,
1322
- offset: offset$1,
1323
- onHide: handleHide,
1324
- className,
1325
- children: [
1326
- has("node-selector") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuNodeSelector, {
1327
- open: isNodeSelectorOpen,
1328
- onOpenChange: handleNodeSelectorOpenChange
1329
- }),
1330
- has("link-selector") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuLinkSelector, {
1331
- open: isLinkSelectorOpen,
1332
- onOpenChange: handleLinkSelectorOpenChange
1333
- }),
1334
- hasFormattingItems && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleMenuItemGroup, { children: [
1335
- has("bold") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuBold, {}),
1336
- has("italic") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItalic, {}),
1337
- has("underline") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuUnderline, {}),
1338
- has("strike") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuStrike, {}),
1339
- has("code") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuCode, {}),
1340
- has("uppercase") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuUppercase, {})
1341
- ] }),
1342
- hasAlignmentItems && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleMenuItemGroup, { children: [
1343
- has("align-left") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuAlignLeft, {}),
1344
- has("align-center") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuAlignCenter, {}),
1345
- has("align-right") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuAlignRight, {})
1346
- ] })
1347
- ]
1348
- });
1349
- }
1350
-
1351
- //#endregion
1352
5
  //#region src/ui/bubble-menu/separator.tsx
1353
6
  function BubbleMenuSeparator({ className }) {
1354
7
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", {
@@ -1360,1200 +13,160 @@ function BubbleMenuSeparator({ className }) {
1360
13
  //#endregion
1361
14
  //#region src/ui/bubble-menu/index.ts
1362
15
  const BubbleMenu = {
1363
- Root: BubbleMenuRoot,
1364
- ItemGroup: BubbleMenuItemGroup,
16
+ Root: require_root.BubbleMenuRoot,
17
+ ItemGroup: require_root.BubbleMenuItemGroup,
1365
18
  Separator: BubbleMenuSeparator,
1366
- Item: BubbleMenuItem,
1367
- Bold: BubbleMenuBold,
1368
- Italic: BubbleMenuItalic,
1369
- Underline: BubbleMenuUnderline,
1370
- Strike: BubbleMenuStrike,
1371
- Code: BubbleMenuCode,
1372
- Uppercase: BubbleMenuUppercase,
1373
- AlignLeft: BubbleMenuAlignLeft,
1374
- AlignCenter: BubbleMenuAlignCenter,
1375
- AlignRight: BubbleMenuAlignRight,
1376
- NodeSelector: Object.assign(BubbleMenuNodeSelector, {
1377
- Root: NodeSelectorRoot,
1378
- Trigger: NodeSelectorTrigger,
1379
- Content: NodeSelectorContent
19
+ Item: require_root.BubbleMenuItem,
20
+ Bold: require_root.BubbleMenuBold,
21
+ Italic: require_root.BubbleMenuItalic,
22
+ Underline: require_root.BubbleMenuUnderline,
23
+ Strike: require_root.BubbleMenuStrike,
24
+ Code: require_root.BubbleMenuCode,
25
+ Uppercase: require_root.BubbleMenuUppercase,
26
+ AlignLeft: require_root.BubbleMenuAlignLeft,
27
+ AlignCenter: require_root.BubbleMenuAlignCenter,
28
+ AlignRight: require_root.BubbleMenuAlignRight,
29
+ NodeSelector: Object.assign(require_root.BubbleMenuNodeSelector, {
30
+ Root: require_root.NodeSelectorRoot,
31
+ Trigger: require_root.NodeSelectorTrigger,
32
+ Content: require_root.NodeSelectorContent
1380
33
  }),
1381
- LinkSelector: BubbleMenuLinkSelector,
1382
- Default: BubbleMenuDefault
34
+ LinkSelector: require_root.BubbleMenuLinkSelector,
35
+ Default: require_root.BubbleMenuDefault
1383
36
  };
1384
37
 
1385
- //#endregion
1386
- //#region src/ui/button-bubble-menu/context.tsx
1387
- const ButtonBubbleMenuContext = react.createContext(null);
1388
- function useButtonBubbleMenuContext() {
1389
- const context = react.useContext(ButtonBubbleMenuContext);
1390
- if (!context) throw new Error("ButtonBubbleMenu compound components must be used within <ButtonBubbleMenu.Root>");
1391
- return context;
1392
- }
1393
-
1394
- //#endregion
1395
- //#region src/ui/button-bubble-menu/edit-link.tsx
1396
- function ButtonBubbleMenuEditLink({ className, children, onClick, onMouseDown, ...rest }) {
1397
- const { setIsEditing } = useButtonBubbleMenuContext();
1398
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1399
- ...rest,
1400
- type: "button",
1401
- "aria-label": "Edit link",
1402
- "data-re-btn-bm-item": "",
1403
- "data-item": "edit-link",
1404
- className,
1405
- onMouseDown: (e) => {
1406
- e.preventDefault();
1407
- onMouseDown?.(e);
1408
- },
1409
- onClick: (e) => {
1410
- onClick?.(e);
1411
- setIsEditing(true);
1412
- },
1413
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PencilIcon, {})
1414
- });
1415
- }
1416
-
1417
- //#endregion
1418
- //#region src/ui/button-bubble-menu/form.tsx
1419
- function ButtonBubbleMenuForm({ className, validateUrl, onLinkApply, onLinkRemove }) {
1420
- const { editor, buttonHref, isEditing, setIsEditing } = useButtonBubbleMenuContext();
1421
- const inputRef = react.useRef(null);
1422
- const formRef = react.useRef(null);
1423
- const displayHref = buttonHref === "#" ? "" : buttonHref;
1424
- const [inputValue, setInputValue] = react.useState(displayHref);
1425
- react.useEffect(() => {
1426
- if (!isEditing) return;
1427
- setInputValue(displayHref);
1428
- const timeoutId = setTimeout(() => {
1429
- inputRef.current?.focus();
1430
- }, 0);
1431
- return () => clearTimeout(timeoutId);
1432
- }, [isEditing, displayHref]);
1433
- react.useEffect(() => {
1434
- if (!isEditing) return;
1435
- const handleKeyDown = (event) => {
1436
- if (event.key === "Escape") setIsEditing(false);
1437
- };
1438
- const handleClickOutside = (event) => {
1439
- if (formRef.current && !formRef.current.contains(event.target)) {
1440
- const form = formRef.current;
1441
- const submitEvent = new Event("submit", {
1442
- bubbles: true,
1443
- cancelable: true
1444
- });
1445
- form.dispatchEvent(submitEvent);
1446
- setIsEditing(false);
1447
- }
1448
- };
1449
- document.addEventListener("mousedown", handleClickOutside);
1450
- window.addEventListener("keydown", handleKeyDown);
1451
- return () => {
1452
- window.removeEventListener("keydown", handleKeyDown);
1453
- document.removeEventListener("mousedown", handleClickOutside);
1454
- };
1455
- }, [isEditing, setIsEditing]);
1456
- if (!isEditing) return null;
1457
- function handleSubmit(e) {
1458
- e.preventDefault();
1459
- const value = inputValue.trim();
1460
- if (value === "") {
1461
- editor.commands.updateButton({ href: "#" });
1462
- setIsEditing(false);
1463
- focusEditor(editor);
1464
- onLinkRemove?.();
1465
- return;
1466
- }
1467
- const finalValue = (validateUrl ?? getUrlFromString)(value);
1468
- if (!finalValue) {
1469
- editor.commands.updateButton({ href: "#" });
1470
- setIsEditing(false);
1471
- focusEditor(editor);
1472
- onLinkRemove?.();
1473
- return;
1474
- }
1475
- editor.commands.updateButton({ href: finalValue });
1476
- setIsEditing(false);
1477
- focusEditor(editor);
1478
- onLinkApply?.(finalValue);
1479
- }
1480
- function handleUnlink(e) {
1481
- e.stopPropagation();
1482
- editor.commands.updateButton({ href: "#" });
1483
- setIsEditing(false);
1484
- focusEditor(editor);
1485
- onLinkRemove?.();
1486
- }
1487
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1488
- ref: formRef,
1489
- "data-re-btn-bm-form": "",
1490
- className,
1491
- onMouseDown: (e) => e.stopPropagation(),
1492
- onClick: (e) => e.stopPropagation(),
1493
- onKeyDown: (e) => e.stopPropagation(),
1494
- onSubmit: handleSubmit,
1495
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1496
- ref: inputRef,
1497
- "data-re-btn-bm-input": "",
1498
- value: inputValue,
1499
- onFocus: (e) => e.stopPropagation(),
1500
- onChange: (e) => setInputValue(e.target.value),
1501
- placeholder: "Paste a link",
1502
- type: "text"
1503
- }), displayHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1504
- type: "button",
1505
- "aria-label": "Remove link",
1506
- "data-re-btn-bm-unlink": "",
1507
- onClick: handleUnlink,
1508
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnlinkIcon, {})
1509
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1510
- type: "submit",
1511
- "aria-label": "Apply link",
1512
- "data-re-btn-bm-apply": "",
1513
- onMouseDown: (e) => e.stopPropagation(),
1514
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Check, {})
1515
- })]
1516
- });
1517
- }
1518
-
1519
- //#endregion
1520
- //#region src/ui/button-bubble-menu/root.tsx
1521
- function ButtonBubbleMenuRoot({ onHide, placement = "top", offset: offset$1 = 8, className, children }) {
1522
- const { editor } = (0, _tiptap_react.useCurrentEditor)();
1523
- const [isEditing, setIsEditing] = react.useState(false);
1524
- const buttonHref = (0, _tiptap_react.useEditorState)({
1525
- editor,
1526
- selector: ({ editor: e }) => e?.getAttributes("button").href ?? ""
1527
- });
1528
- if (!editor) return null;
1529
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react_menus.BubbleMenu, {
1530
- editor,
1531
- pluginKey: "buttonBubbleMenu",
1532
- "data-re-btn-bm": "",
1533
- shouldShow: ({ editor: e, view }) => e.isActive("button") && !view.dom.classList.contains("dragging"),
1534
- options: {
1535
- placement,
1536
- offset: offset$1,
1537
- onHide: () => {
1538
- setIsEditing(false);
1539
- onHide?.();
1540
- }
1541
- },
1542
- className,
1543
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonBubbleMenuContext.Provider, {
1544
- value: {
1545
- editor,
1546
- buttonHref: buttonHref ?? "",
1547
- isEditing,
1548
- setIsEditing
1549
- },
1550
- children
1551
- })
1552
- });
1553
- }
1554
-
1555
- //#endregion
1556
- //#region src/ui/button-bubble-menu/toolbar.tsx
1557
- function ButtonBubbleMenuToolbar({ children, ...rest }) {
1558
- const { isEditing } = useButtonBubbleMenuContext();
1559
- if (isEditing) return null;
1560
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1561
- "data-re-btn-bm-toolbar": "",
1562
- ...rest,
1563
- children
1564
- });
1565
- }
1566
-
1567
- //#endregion
1568
- //#region src/ui/button-bubble-menu/unlink.tsx
1569
- function ButtonBubbleMenuUnlink({ className, children, onClick, onMouseDown, onLinkRemove, ...rest }) {
1570
- const { editor } = useButtonBubbleMenuContext();
1571
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1572
- ...rest,
1573
- type: "button",
1574
- "aria-label": "Remove link",
1575
- "data-re-btn-bm-item": "",
1576
- "data-item": "unlink",
1577
- className,
1578
- onMouseDown: (e) => {
1579
- e.preventDefault();
1580
- onMouseDown?.(e);
1581
- },
1582
- onClick: (e) => {
1583
- onClick?.(e);
1584
- editor.commands.updateButton({ href: "#" });
1585
- focusEditor(editor);
1586
- onLinkRemove?.();
1587
- },
1588
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnlinkIcon, {})
1589
- });
1590
- }
1591
-
1592
- //#endregion
1593
- //#region src/ui/button-bubble-menu/default.tsx
1594
- function ButtonBubbleMenuDefaultInner({ validateUrl, onLinkApply, onLinkRemove }) {
1595
- const { buttonHref } = useButtonBubbleMenuContext();
1596
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ButtonBubbleMenuToolbar, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonBubbleMenuEditLink, {}), buttonHref !== "" && buttonHref !== "#" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonBubbleMenuUnlink, { onLinkRemove })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonBubbleMenuForm, {
1597
- validateUrl,
1598
- onLinkApply,
1599
- onLinkRemove
1600
- })] });
1601
- }
1602
- function ButtonBubbleMenuDefault({ placement, offset: offset$1, onHide, className, validateUrl, onLinkApply, onLinkRemove }) {
1603
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonBubbleMenuRoot, {
1604
- placement,
1605
- offset: offset$1,
1606
- onHide,
1607
- className,
1608
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonBubbleMenuDefaultInner, {
1609
- validateUrl,
1610
- onLinkApply,
1611
- onLinkRemove
1612
- })
1613
- });
1614
- }
1615
-
1616
38
  //#endregion
1617
39
  //#region src/ui/button-bubble-menu/index.ts
1618
40
  const ButtonBubbleMenu = {
1619
- Root: ButtonBubbleMenuRoot,
1620
- Toolbar: ButtonBubbleMenuToolbar,
1621
- EditLink: ButtonBubbleMenuEditLink,
1622
- Unlink: ButtonBubbleMenuUnlink,
1623
- Form: ButtonBubbleMenuForm,
1624
- Default: ButtonBubbleMenuDefault
41
+ Root: require_root.ButtonBubbleMenuRoot,
42
+ Toolbar: require_root.ButtonBubbleMenuToolbar,
43
+ EditLink: require_root.ButtonBubbleMenuEditLink,
44
+ Unlink: require_root.ButtonBubbleMenuUnlink,
45
+ Form: require_root.ButtonBubbleMenuForm,
46
+ Default: require_root.ButtonBubbleMenuDefault
1625
47
  };
1626
48
 
1627
- //#endregion
1628
- //#region src/ui/image-bubble-menu/context.tsx
1629
- const ImageBubbleMenuContext = react.createContext(null);
1630
- function useImageBubbleMenuContext() {
1631
- const context = react.useContext(ImageBubbleMenuContext);
1632
- if (!context) throw new Error("ImageBubbleMenu compound components must be used within <ImageBubbleMenu.Root>");
1633
- return context;
1634
- }
1635
-
1636
- //#endregion
1637
- //#region src/ui/image-bubble-menu/edit-link.tsx
1638
- function ImageBubbleMenuEditLink({ className, children, onClick, onMouseDown, ...rest }) {
1639
- const { setIsEditing } = useImageBubbleMenuContext();
1640
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1641
- ...rest,
1642
- type: "button",
1643
- "aria-label": "Edit link",
1644
- "data-re-img-bm-item": "",
1645
- "data-item": "edit-link",
1646
- className,
1647
- onMouseDown: (e) => {
1648
- e.preventDefault();
1649
- onMouseDown?.(e);
1650
- },
1651
- onClick: (e) => {
1652
- onClick?.(e);
1653
- setIsEditing(true);
1654
- },
1655
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkIcon, {})
1656
- });
1657
- }
1658
-
1659
- //#endregion
1660
- //#region src/ui/image-bubble-menu/root.tsx
1661
- function ImageBubbleMenuRoot({ onHide, placement = "top", offset: offset$1 = 8, className, children }) {
1662
- const { editor } = (0, _tiptap_react.useCurrentEditor)();
1663
- const [isEditing, setIsEditing] = react.useState(false);
1664
- if (!editor) return null;
1665
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react_menus.BubbleMenu, {
1666
- editor,
1667
- pluginKey: "imageBubbleMenu",
1668
- "data-re-img-bm": "",
1669
- shouldShow: ({ editor: e, view }) => e.isActive("image") && !view.dom.classList.contains("dragging"),
1670
- options: {
1671
- placement,
1672
- offset: offset$1,
1673
- onHide: () => {
1674
- setIsEditing(false);
1675
- onHide?.();
1676
- }
1677
- },
1678
- className,
1679
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageBubbleMenuContext.Provider, {
1680
- value: {
1681
- editor,
1682
- isEditing,
1683
- setIsEditing
1684
- },
1685
- children
1686
- })
1687
- });
1688
- }
1689
-
1690
- //#endregion
1691
- //#region src/ui/image-bubble-menu/toolbar.tsx
1692
- function ImageBubbleMenuToolbar({ children, ...rest }) {
1693
- const { isEditing } = useImageBubbleMenuContext();
1694
- if (isEditing) return null;
1695
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1696
- "data-re-img-bm-toolbar": "",
1697
- ...rest,
1698
- children
1699
- });
1700
- }
1701
-
1702
- //#endregion
1703
- //#region src/ui/image-bubble-menu/default.tsx
1704
- function ImageBubbleMenuDefault({ excludeItems = [], placement, offset: offset$1, onHide, className }) {
1705
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageBubbleMenuRoot, {
1706
- placement,
1707
- offset: offset$1,
1708
- onHide,
1709
- className,
1710
- children: !excludeItems.includes("edit-link") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageBubbleMenuToolbar, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageBubbleMenuEditLink, {}) })
1711
- });
1712
- }
1713
-
1714
49
  //#endregion
1715
50
  //#region src/ui/image-bubble-menu/index.ts
1716
51
  const ImageBubbleMenu = {
1717
- Root: ImageBubbleMenuRoot,
1718
- Toolbar: ImageBubbleMenuToolbar,
1719
- EditLink: ImageBubbleMenuEditLink,
1720
- Default: ImageBubbleMenuDefault
52
+ Root: require_root.ImageBubbleMenuRoot,
53
+ Toolbar: require_root.ImageBubbleMenuToolbar,
54
+ EditLink: require_root.ImageBubbleMenuEditLink,
55
+ Default: require_root.ImageBubbleMenuDefault
1721
56
  };
1722
57
 
1723
- //#endregion
1724
- //#region src/ui/link-bubble-menu/context.tsx
1725
- const LinkBubbleMenuContext = react.createContext(null);
1726
- function useLinkBubbleMenuContext() {
1727
- const context = react.useContext(LinkBubbleMenuContext);
1728
- if (!context) throw new Error("LinkBubbleMenu compound components must be used within <LinkBubbleMenu.Root>");
1729
- return context;
1730
- }
1731
-
1732
- //#endregion
1733
- //#region src/ui/link-bubble-menu/edit-link.tsx
1734
- function LinkBubbleMenuEditLink({ className, children, onClick, onMouseDown, ...rest }) {
1735
- const { setIsEditing } = useLinkBubbleMenuContext();
1736
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1737
- type: "button",
1738
- "aria-label": "Edit link",
1739
- "data-re-link-bm-item": "",
1740
- "data-item": "edit-link",
1741
- className,
1742
- onMouseDown: (e) => {
1743
- e.preventDefault();
1744
- onMouseDown?.(e);
1745
- },
1746
- onClick: (e) => {
1747
- onClick?.(e);
1748
- setIsEditing(true);
1749
- },
1750
- ...rest,
1751
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PencilIcon, {})
1752
- });
1753
- }
1754
-
1755
- //#endregion
1756
- //#region src/ui/link-bubble-menu/form.tsx
1757
- function LinkBubbleMenuForm({ className, validateUrl, onLinkApply, onLinkRemove, children }) {
1758
- const { editor, linkHref, isEditing, setIsEditing } = useLinkBubbleMenuContext();
1759
- const inputRef = react.useRef(null);
1760
- const formRef = react.useRef(null);
1761
- const displayHref = linkHref === "#" ? "" : linkHref;
1762
- const [inputValue, setInputValue] = react.useState(displayHref);
1763
- react.useEffect(() => {
1764
- if (!isEditing) return;
1765
- setInputValue(displayHref);
1766
- const timeoutId = setTimeout(() => {
1767
- inputRef.current?.focus();
1768
- }, 0);
1769
- return () => clearTimeout(timeoutId);
1770
- }, [isEditing, displayHref]);
1771
- react.useEffect(() => {
1772
- if (!isEditing) return;
1773
- const handleKeyDown = (event) => {
1774
- if (event.key === "Escape") setIsEditing(false);
1775
- };
1776
- const handleClickOutside = (event) => {
1777
- if (formRef.current && !formRef.current.contains(event.target)) {
1778
- const form = formRef.current;
1779
- const submitEvent = new Event("submit", {
1780
- bubbles: true,
1781
- cancelable: true
1782
- });
1783
- form.dispatchEvent(submitEvent);
1784
- setIsEditing(false);
1785
- }
1786
- };
1787
- document.addEventListener("mousedown", handleClickOutside);
1788
- window.addEventListener("keydown", handleKeyDown);
1789
- return () => {
1790
- window.removeEventListener("keydown", handleKeyDown);
1791
- document.removeEventListener("mousedown", handleClickOutside);
1792
- };
1793
- }, [isEditing, setIsEditing]);
1794
- if (!isEditing) return null;
1795
- function handleSubmit(e) {
1796
- e.preventDefault();
1797
- const value = inputValue.trim();
1798
- if (value === "") {
1799
- setLinkHref(editor, "");
1800
- setIsEditing(false);
1801
- focusEditor(editor);
1802
- onLinkRemove?.();
1803
- return;
1804
- }
1805
- const finalValue = (validateUrl ?? getUrlFromString)(value);
1806
- if (!finalValue) {
1807
- setLinkHref(editor, "");
1808
- setIsEditing(false);
1809
- focusEditor(editor);
1810
- onLinkRemove?.();
1811
- return;
1812
- }
1813
- setLinkHref(editor, finalValue);
1814
- setIsEditing(false);
1815
- focusEditor(editor);
1816
- onLinkApply?.(finalValue);
1817
- }
1818
- function handleUnlink(e) {
1819
- e.stopPropagation();
1820
- setLinkHref(editor, "");
1821
- setIsEditing(false);
1822
- focusEditor(editor);
1823
- onLinkRemove?.();
1824
- }
1825
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1826
- ref: formRef,
1827
- "data-re-link-bm-form": "",
1828
- className,
1829
- onMouseDown: (e) => e.stopPropagation(),
1830
- onClick: (e) => e.stopPropagation(),
1831
- onKeyDown: (e) => e.stopPropagation(),
1832
- onSubmit: handleSubmit,
1833
- children: [
1834
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1835
- ref: inputRef,
1836
- "data-re-link-bm-input": "",
1837
- value: inputValue,
1838
- onFocus: (e) => e.stopPropagation(),
1839
- onChange: (e) => setInputValue(e.target.value),
1840
- placeholder: "Paste a link",
1841
- type: "text"
1842
- }),
1843
- children,
1844
- displayHref ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1845
- type: "button",
1846
- "aria-label": "Remove link",
1847
- "data-re-link-bm-unlink": "",
1848
- onClick: handleUnlink,
1849
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnlinkIcon, {})
1850
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1851
- type: "submit",
1852
- "aria-label": "Apply link",
1853
- "data-re-link-bm-apply": "",
1854
- onMouseDown: (e) => e.stopPropagation(),
1855
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Check, {})
1856
- })
1857
- ]
1858
- });
1859
- }
1860
-
1861
- //#endregion
1862
- //#region src/ui/link-bubble-menu/open-link.tsx
1863
- function LinkBubbleMenuOpenLink({ className, children, ...rest }) {
1864
- const { linkHref } = useLinkBubbleMenuContext();
1865
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1866
- ...rest,
1867
- href: linkHref,
1868
- target: "_blank",
1869
- rel: "noopener noreferrer",
1870
- "aria-label": "Open link",
1871
- "data-re-link-bm-item": "",
1872
- "data-item": "open-link",
1873
- className,
1874
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExternalLinkIcon, {})
1875
- });
1876
- }
1877
-
1878
- //#endregion
1879
- //#region src/ui/link-bubble-menu/root.tsx
1880
- function LinkBubbleMenuRoot({ onHide, placement = "top", offset: offset$1 = 8, className, children }) {
1881
- const { editor } = (0, _tiptap_react.useCurrentEditor)();
1882
- const [isEditing, setIsEditing] = react.useState(false);
1883
- const linkHref = (0, _tiptap_react.useEditorState)({
1884
- editor,
1885
- selector: ({ editor: e }) => e?.getAttributes("link").href ?? ""
1886
- });
1887
- if (!editor) return null;
1888
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react_menus.BubbleMenu, {
1889
- editor,
1890
- pluginKey: "linkBubbleMenu",
1891
- "data-re-link-bm": "",
1892
- shouldShow: ({ editor: e }) => e.isActive("link") && e.view.state.selection.content().size === 0,
1893
- options: {
1894
- placement,
1895
- offset: offset$1,
1896
- onHide: () => {
1897
- setIsEditing(false);
1898
- onHide?.();
1899
- }
1900
- },
1901
- className,
1902
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkBubbleMenuContext.Provider, {
1903
- value: {
1904
- editor,
1905
- linkHref: linkHref ?? "",
1906
- isEditing,
1907
- setIsEditing
1908
- },
1909
- children
1910
- })
1911
- });
1912
- }
1913
-
1914
- //#endregion
1915
- //#region src/ui/link-bubble-menu/toolbar.tsx
1916
- function LinkBubbleMenuToolbar({ children, ...rest }) {
1917
- const { isEditing } = useLinkBubbleMenuContext();
1918
- if (isEditing) return null;
1919
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1920
- "data-re-link-bm-toolbar": "",
1921
- ...rest,
1922
- children
1923
- });
1924
- }
1925
-
1926
- //#endregion
1927
- //#region src/ui/link-bubble-menu/unlink.tsx
1928
- function LinkBubbleMenuUnlink({ className, children, onClick, onMouseDown, ...rest }) {
1929
- const { editor } = useLinkBubbleMenuContext();
1930
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1931
- type: "button",
1932
- "aria-label": "Remove link",
1933
- "data-re-link-bm-item": "",
1934
- "data-item": "unlink",
1935
- className,
1936
- onMouseDown: (e) => {
1937
- e.preventDefault();
1938
- onMouseDown?.(e);
1939
- },
1940
- onClick: (e) => {
1941
- onClick?.(e);
1942
- editor.chain().focus().unsetLink().run();
1943
- },
1944
- ...rest,
1945
- children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnlinkIcon, {})
1946
- });
1947
- }
1948
-
1949
- //#endregion
1950
- //#region src/ui/link-bubble-menu/default.tsx
1951
- function LinkBubbleMenuDefault({ excludeItems = [], placement, offset: offset$1, onHide, className, validateUrl, onLinkApply, onLinkRemove }) {
1952
- const has = (item) => !excludeItems.includes(item);
1953
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LinkBubbleMenuRoot, {
1954
- placement,
1955
- offset: offset$1,
1956
- onHide,
1957
- className,
1958
- children: [(has("edit-link") || has("open-link") || has("unlink")) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LinkBubbleMenuToolbar, { children: [
1959
- has("edit-link") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkBubbleMenuEditLink, {}),
1960
- has("open-link") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkBubbleMenuOpenLink, {}),
1961
- has("unlink") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkBubbleMenuUnlink, {})
1962
- ] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkBubbleMenuForm, {
1963
- validateUrl,
1964
- onLinkApply,
1965
- onLinkRemove
1966
- })]
1967
- });
1968
- }
1969
-
1970
58
  //#endregion
1971
59
  //#region src/ui/link-bubble-menu/index.ts
1972
60
  const LinkBubbleMenu = {
1973
- Root: LinkBubbleMenuRoot,
1974
- Toolbar: LinkBubbleMenuToolbar,
1975
- Form: LinkBubbleMenuForm,
1976
- EditLink: LinkBubbleMenuEditLink,
1977
- Unlink: LinkBubbleMenuUnlink,
1978
- OpenLink: LinkBubbleMenuOpenLink,
1979
- Default: LinkBubbleMenuDefault
61
+ Root: require_root.LinkBubbleMenuRoot,
62
+ Toolbar: require_root.LinkBubbleMenuToolbar,
63
+ Form: require_root.LinkBubbleMenuForm,
64
+ EditLink: require_root.LinkBubbleMenuEditLink,
65
+ Unlink: require_root.LinkBubbleMenuUnlink,
66
+ OpenLink: require_root.LinkBubbleMenuOpenLink,
67
+ Default: require_root.LinkBubbleMenuDefault
1980
68
  };
1981
69
 
1982
- //#endregion
1983
- //#region src/ui/slash-command/utils.ts
1984
- function isInsideNode(editor, type) {
1985
- const { $from } = editor.state.selection;
1986
- for (let d = $from.depth; d > 0; d--) if ($from.node(d).type.name === type) return true;
1987
- return false;
1988
- }
1989
- function isAtMaxColumnsDepth(editor) {
1990
- const { from } = editor.state.selection;
1991
- return require_columns.getColumnsDepth(editor.state.doc, from) >= require_columns.MAX_COLUMNS_DEPTH;
1992
- }
1993
- function updateScrollView(container, item) {
1994
- const containerRect = container.getBoundingClientRect();
1995
- const itemRect = item.getBoundingClientRect();
1996
- if (itemRect.top < containerRect.top) container.scrollTop -= containerRect.top - itemRect.top;
1997
- else if (itemRect.bottom > containerRect.bottom) container.scrollTop += itemRect.bottom - containerRect.bottom;
1998
- }
1999
-
2000
- //#endregion
2001
- //#region src/ui/slash-command/command-list.tsx
2002
- const CATEGORY_ORDER = [
2003
- "Text",
2004
- "Media",
2005
- "Layout",
2006
- "Utility"
2007
- ];
2008
- function groupByCategory(items) {
2009
- const seen = /* @__PURE__ */ new Map();
2010
- for (const item of items) {
2011
- const existing = seen.get(item.category);
2012
- if (existing) existing.push(item);
2013
- else seen.set(item.category, [item]);
2014
- }
2015
- const ordered = [];
2016
- for (const cat of CATEGORY_ORDER) {
2017
- const group = seen.get(cat);
2018
- if (group) {
2019
- ordered.push({
2020
- category: cat,
2021
- items: group
2022
- });
2023
- seen.delete(cat);
2024
- }
2025
- }
2026
- for (const [category, group] of seen) ordered.push({
2027
- category,
2028
- items: group
2029
- });
2030
- return ordered;
2031
- }
2032
- function CommandItem({ item, selected, onSelect }) {
2033
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
2034
- "data-re-slash-command-item": "",
2035
- "data-selected": selected || void 0,
2036
- onClick: onSelect,
2037
- type: "button",
2038
- children: [item.icon, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: item.title })]
2039
- });
2040
- }
2041
- function CommandList({ items, query, selectedIndex, onSelect }) {
2042
- const containerRef = (0, react.useRef)(null);
2043
- (0, react.useLayoutEffect)(() => {
2044
- const container = containerRef.current;
2045
- if (!container) return;
2046
- const selected = container.querySelector("[data-selected]");
2047
- if (selected) updateScrollView(container, selected);
2048
- }, [selectedIndex]);
2049
- if (items.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2050
- "data-re-slash-command": "",
2051
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2052
- "data-re-slash-command-empty": "",
2053
- children: "No results"
2054
- })
2055
- });
2056
- if (query.trim().length > 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2057
- "data-re-slash-command": "",
2058
- ref: containerRef,
2059
- children: items.map((item, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandItem, {
2060
- item,
2061
- onSelect: () => onSelect(index),
2062
- selected: index === selectedIndex
2063
- }, item.title))
2064
- });
2065
- const groups = groupByCategory(items);
2066
- let flatIndex = 0;
2067
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2068
- "data-re-slash-command": "",
2069
- ref: containerRef,
2070
- children: groups.map((group) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2071
- "data-re-slash-command-category": "",
2072
- children: group.category
2073
- }), group.items.map((item) => {
2074
- const currentIndex = flatIndex++;
2075
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandItem, {
2076
- item,
2077
- onSelect: () => onSelect(currentIndex),
2078
- selected: currentIndex === selectedIndex
2079
- }, item.title);
2080
- })] }, group.category))
2081
- });
2082
- }
2083
-
2084
- //#endregion
2085
- //#region src/ui/slash-command/commands.tsx
2086
- const TEXT = {
2087
- title: "Text",
2088
- description: "Plain text block",
2089
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, { size: 20 }),
2090
- category: "Text",
2091
- searchTerms: ["p", "paragraph"],
2092
- command: ({ editor, range }) => {
2093
- editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
2094
- }
2095
- };
2096
- const H1 = {
2097
- title: "Title",
2098
- description: "Large heading",
2099
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading1, { size: 20 }),
2100
- category: "Text",
2101
- searchTerms: [
2102
- "title",
2103
- "big",
2104
- "large",
2105
- "h1"
2106
- ],
2107
- command: ({ editor, range }) => {
2108
- editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
2109
- }
2110
- };
2111
- const H2 = {
2112
- title: "Subtitle",
2113
- description: "Medium heading",
2114
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading2, { size: 20 }),
2115
- category: "Text",
2116
- searchTerms: [
2117
- "subtitle",
2118
- "medium",
2119
- "h2"
2120
- ],
2121
- command: ({ editor, range }) => {
2122
- editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
2123
- }
2124
- };
2125
- const H3 = {
2126
- title: "Heading",
2127
- description: "Small heading",
2128
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading3, { size: 20 }),
2129
- category: "Text",
2130
- searchTerms: [
2131
- "subtitle",
2132
- "small",
2133
- "h3"
2134
- ],
2135
- command: ({ editor, range }) => {
2136
- editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
2137
- }
2138
- };
2139
- const BULLET_LIST = {
2140
- title: "Bullet list",
2141
- description: "Unordered list",
2142
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(List, { size: 20 }),
2143
- category: "Text",
2144
- searchTerms: ["unordered", "point"],
2145
- command: ({ editor, range }) => {
2146
- editor.chain().focus().deleteRange(range).toggleBulletList().run();
2147
- }
2148
- };
2149
- const NUMBERED_LIST = {
2150
- title: "Numbered list",
2151
- description: "Ordered list",
2152
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ListOrdered, { size: 20 }),
2153
- category: "Text",
2154
- searchTerms: ["ordered"],
2155
- command: ({ editor, range }) => {
2156
- editor.chain().focus().deleteRange(range).toggleOrderedList().run();
2157
- }
2158
- };
2159
- const QUOTE = {
2160
- title: "Quote",
2161
- description: "Block quote",
2162
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextQuote, { size: 20 }),
2163
- category: "Text",
2164
- searchTerms: ["blockquote"],
2165
- command: ({ editor, range }) => {
2166
- editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").toggleBlockquote().run();
2167
- }
2168
- };
2169
- const CODE = {
2170
- title: "Code block",
2171
- description: "Code snippet",
2172
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SquareCode, { size: 20 }),
2173
- category: "Text",
2174
- searchTerms: ["codeblock"],
2175
- command: ({ editor, range }) => {
2176
- editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
2177
- }
2178
- };
2179
- const BUTTON = {
2180
- title: "Button",
2181
- description: "Clickable button",
2182
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MousePointer, { size: 20 }),
2183
- category: "Layout",
2184
- searchTerms: ["button"],
2185
- command: ({ editor, range }) => {
2186
- editor.chain().focus().deleteRange(range).setButton().run();
2187
- }
2188
- };
2189
- const DIVIDER = {
2190
- title: "Divider",
2191
- description: "Horizontal separator",
2192
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SplitSquareVertical, { size: 20 }),
2193
- category: "Layout",
2194
- searchTerms: [
2195
- "hr",
2196
- "divider",
2197
- "separator"
2198
- ],
2199
- command: ({ editor, range }) => {
2200
- editor.chain().focus().deleteRange(range).setHorizontalRule().run();
2201
- }
2202
- };
2203
- const SECTION = {
2204
- title: "Section",
2205
- description: "Content section",
2206
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Rows2, { size: 20 }),
2207
- category: "Layout",
2208
- searchTerms: [
2209
- "section",
2210
- "row",
2211
- "container"
2212
- ],
2213
- command: ({ editor, range }) => {
2214
- editor.chain().focus().deleteRange(range).insertSection().run();
2215
- }
2216
- };
2217
- const TWO_COLUMNS = {
2218
- title: "2 columns",
2219
- description: "Two column layout",
2220
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Columns2, { size: 20 }),
2221
- category: "Layout",
2222
- searchTerms: [
2223
- "columns",
2224
- "column",
2225
- "layout",
2226
- "grid",
2227
- "split",
2228
- "side-by-side",
2229
- "multi-column",
2230
- "row",
2231
- "two",
2232
- "2"
2233
- ],
2234
- command: ({ editor, range }) => {
2235
- editor.chain().focus().deleteRange(range).insertColumns(2).run();
2236
- }
2237
- };
2238
- const THREE_COLUMNS = {
2239
- title: "3 columns",
2240
- description: "Three column layout",
2241
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Columns3, { size: 20 }),
2242
- category: "Layout",
2243
- searchTerms: [
2244
- "columns",
2245
- "column",
2246
- "layout",
2247
- "grid",
2248
- "split",
2249
- "multi-column",
2250
- "row",
2251
- "three",
2252
- "3"
2253
- ],
2254
- command: ({ editor, range }) => {
2255
- editor.chain().focus().deleteRange(range).insertColumns(3).run();
2256
- }
2257
- };
2258
- const FOUR_COLUMNS = {
2259
- title: "4 columns",
2260
- description: "Four column layout",
2261
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Columns4, { size: 20 }),
2262
- category: "Layout",
2263
- searchTerms: [
2264
- "columns",
2265
- "column",
2266
- "layout",
2267
- "grid",
2268
- "split",
2269
- "multi-column",
2270
- "row",
2271
- "four",
2272
- "4"
2273
- ],
2274
- command: ({ editor, range }) => {
2275
- editor.chain().focus().deleteRange(range).insertColumns(4).run();
2276
- }
2277
- };
2278
- const defaultSlashCommands = [
2279
- TEXT,
2280
- H1,
2281
- H2,
2282
- H3,
2283
- BULLET_LIST,
2284
- NUMBERED_LIST,
2285
- QUOTE,
2286
- CODE,
2287
- BUTTON,
2288
- DIVIDER,
2289
- SECTION,
2290
- TWO_COLUMNS,
2291
- THREE_COLUMNS,
2292
- FOUR_COLUMNS
2293
- ];
2294
-
2295
- //#endregion
2296
- //#region src/ui/slash-command/search.ts
2297
- function scoreItem(item, query) {
2298
- if (!query) return 100;
2299
- const q = query.toLowerCase();
2300
- const title = item.title.toLowerCase();
2301
- const description = item.description.toLowerCase();
2302
- const terms = item.searchTerms?.map((t) => t.toLowerCase()) ?? [];
2303
- if (title === q) return 100;
2304
- if (title.startsWith(q)) return 90;
2305
- if (title.split(/\s+/).some((w) => w.startsWith(q))) return 80;
2306
- if (terms.some((t) => t === q)) return 70;
2307
- if (terms.some((t) => t.startsWith(q))) return 60;
2308
- if (title.includes(q)) return 40;
2309
- if (terms.some((t) => t.includes(q))) return 30;
2310
- if (description.includes(q)) return 20;
2311
- return 0;
2312
- }
2313
- function filterAndRankItems(items, query) {
2314
- const trimmed = query.trim();
2315
- if (!trimmed) return items;
2316
- const scored = items.map((item) => ({
2317
- item,
2318
- score: scoreItem(item, trimmed)
2319
- })).filter(({ score }) => score > 0);
2320
- scored.sort((a, b) => b.score - a.score);
2321
- return scored.map(({ item }) => item);
2322
- }
2323
-
2324
- //#endregion
2325
- //#region src/ui/slash-command/root.tsx
2326
- const pluginKey = new _tiptap_pm_state.PluginKey("slash-command");
2327
- const INITIAL_STATE = {
2328
- active: false,
2329
- query: "",
2330
- items: [],
2331
- clientRect: null
2332
- };
2333
- function defaultFilterItems(items, query, editor) {
2334
- return filterAndRankItems(isAtMaxColumnsDepth(editor) ? items.filter((item) => item.category !== "Layout" || !item.title.includes("column")) : items, query);
2335
- }
2336
- function SlashCommandRoot({ items: itemsProp, filterItems: filterItemsProp, char = "/", allow: allowProp, children }) {
2337
- const { editor } = (0, _tiptap_react.useCurrentEditor)();
2338
- const [state, setState] = (0, react.useState)(INITIAL_STATE);
2339
- const [selectedIndex, setSelectedIndex] = (0, react.useState)(0);
2340
- const itemsRef = (0, react.useRef)(itemsProp ?? defaultSlashCommands);
2341
- const filterRef = (0, react.useRef)(filterItemsProp ?? defaultFilterItems);
2342
- const allowRef = (0, react.useRef)(allowProp ?? (({ editor: e }) => !e.isActive("codeBlock")));
2343
- itemsRef.current = itemsProp ?? defaultSlashCommands;
2344
- filterRef.current = filterItemsProp ?? defaultFilterItems;
2345
- allowRef.current = allowProp ?? (({ editor: e }) => !e.isActive("codeBlock"));
2346
- const commandRef = (0, react.useRef)(null);
2347
- const suggestionItemsRef = (0, react.useRef)([]);
2348
- const selectedIndexRef = (0, react.useRef)(0);
2349
- suggestionItemsRef.current = state.items;
2350
- selectedIndexRef.current = selectedIndex;
2351
- const { refs, floatingStyles } = (0, _floating_ui_react_dom.useFloating)({
2352
- open: state.active,
2353
- placement: "bottom-start",
2354
- middleware: [
2355
- (0, _floating_ui_react_dom.offset)(8),
2356
- (0, _floating_ui_react_dom.flip)(),
2357
- (0, _floating_ui_react_dom.shift)({ padding: 8 })
2358
- ],
2359
- whileElementsMounted: _floating_ui_react_dom.autoUpdate
2360
- });
2361
- (0, react.useEffect)(() => {
2362
- if (!state.clientRect) return;
2363
- refs.setReference({ getBoundingClientRect: state.clientRect });
2364
- }, [state.clientRect, refs]);
2365
- (0, react.useEffect)(() => {
2366
- setSelectedIndex(0);
2367
- }, [state.items]);
2368
- const onSelect = (0, react.useCallback)((index) => {
2369
- const item = suggestionItemsRef.current[index];
2370
- if (item && commandRef.current) commandRef.current(item);
2371
- }, []);
2372
- (0, react.useEffect)(() => {
2373
- if (!editor) return;
2374
- const plugin = (0, _tiptap_suggestion.default)({
2375
- pluginKey,
2376
- editor,
2377
- char,
2378
- allow: ({ editor: e }) => allowRef.current({ editor: e }),
2379
- command: ({ editor: e, range, props }) => {
2380
- props.command({
2381
- editor: e,
2382
- range
2383
- });
2384
- },
2385
- items: ({ query, editor: e }) => filterRef.current(itemsRef.current, query, e),
2386
- render: () => ({
2387
- onStart: (props) => {
2388
- commandRef.current = props.command;
2389
- setState({
2390
- active: true,
2391
- query: props.query,
2392
- items: props.items,
2393
- clientRect: props.clientRect ?? null
2394
- });
2395
- },
2396
- onUpdate: (props) => {
2397
- commandRef.current = props.command;
2398
- setState({
2399
- active: true,
2400
- query: props.query,
2401
- items: props.items,
2402
- clientRect: props.clientRect ?? null
2403
- });
2404
- },
2405
- onKeyDown: ({ event }) => {
2406
- if (event.key === "Escape") {
2407
- setState(INITIAL_STATE);
2408
- return true;
2409
- }
2410
- const items = suggestionItemsRef.current;
2411
- if (items.length === 0) return false;
2412
- if (event.key === "ArrowUp") {
2413
- setSelectedIndex((i) => (i + items.length - 1) % items.length);
2414
- return true;
2415
- }
2416
- if (event.key === "ArrowDown") {
2417
- setSelectedIndex((i) => (i + 1) % items.length);
2418
- return true;
2419
- }
2420
- if (event.key === "Enter") {
2421
- const item = items[selectedIndexRef.current];
2422
- if (item && commandRef.current) commandRef.current(item);
2423
- return true;
2424
- }
2425
- return false;
2426
- },
2427
- onExit: () => {
2428
- setState(INITIAL_STATE);
2429
- requestAnimationFrame(() => {
2430
- commandRef.current = null;
2431
- });
2432
- }
2433
- })
2434
- });
2435
- editor.registerPlugin(plugin, (newPlugin, plugins) => [newPlugin, ...plugins]);
2436
- return () => {
2437
- editor.unregisterPlugin(pluginKey);
2438
- };
2439
- }, [editor, char]);
2440
- if (!editor || !state.active) return null;
2441
- const renderProps = {
2442
- items: state.items,
2443
- query: state.query,
2444
- selectedIndex,
2445
- onSelect
2446
- };
2447
- let content;
2448
- if (children) content = children(renderProps);
2449
- else content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandList, { ...renderProps });
2450
- return (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2451
- ref: refs.setFloating,
2452
- style: floatingStyles,
2453
- children: content
2454
- }), document.body);
2455
- }
2456
-
2457
70
  //#endregion
2458
71
  //#region src/ui/slash-command/index.ts
2459
72
  const SlashCommand = {
2460
- Root: SlashCommandRoot,
2461
- CommandList
73
+ Root: require_root.SlashCommandRoot,
74
+ CommandList: require_root.CommandList
2462
75
  };
2463
76
 
2464
77
  //#endregion
2465
- exports.AlignCenterIcon = AlignCenterIcon;
2466
- exports.AlignLeftIcon = AlignLeftIcon;
2467
- exports.AlignRightIcon = AlignRightIcon;
2468
- exports.BULLET_LIST = BULLET_LIST;
2469
- exports.BUTTON = BUTTON;
2470
- exports.BoldIcon = BoldIcon;
78
+ exports.AlignCenterIcon = require_root.AlignCenterIcon;
79
+ exports.AlignLeftIcon = require_root.AlignLeftIcon;
80
+ exports.AlignRightIcon = require_root.AlignRightIcon;
81
+ exports.BULLET_LIST = require_root.BULLET_LIST;
82
+ exports.BUTTON = require_root.BUTTON;
83
+ exports.BoldIcon = require_root.BoldIcon;
2471
84
  exports.BubbleMenu = BubbleMenu;
2472
- exports.BubbleMenuAlignCenter = BubbleMenuAlignCenter;
2473
- exports.BubbleMenuAlignLeft = BubbleMenuAlignLeft;
2474
- exports.BubbleMenuAlignRight = BubbleMenuAlignRight;
2475
- exports.BubbleMenuBold = BubbleMenuBold;
2476
- exports.BubbleMenuCode = BubbleMenuCode;
2477
- exports.BubbleMenuDefault = BubbleMenuDefault;
2478
- exports.BubbleMenuItalic = BubbleMenuItalic;
2479
- exports.BubbleMenuItem = BubbleMenuItem;
2480
- exports.BubbleMenuItemGroup = BubbleMenuItemGroup;
2481
- exports.BubbleMenuLinkSelector = BubbleMenuLinkSelector;
2482
- exports.BubbleMenuNodeSelector = BubbleMenuNodeSelector;
2483
- exports.BubbleMenuRoot = BubbleMenuRoot;
85
+ exports.BubbleMenuAlignCenter = require_root.BubbleMenuAlignCenter;
86
+ exports.BubbleMenuAlignLeft = require_root.BubbleMenuAlignLeft;
87
+ exports.BubbleMenuAlignRight = require_root.BubbleMenuAlignRight;
88
+ exports.BubbleMenuBold = require_root.BubbleMenuBold;
89
+ exports.BubbleMenuCode = require_root.BubbleMenuCode;
90
+ exports.BubbleMenuDefault = require_root.BubbleMenuDefault;
91
+ exports.BubbleMenuItalic = require_root.BubbleMenuItalic;
92
+ exports.BubbleMenuItem = require_root.BubbleMenuItem;
93
+ exports.BubbleMenuItemGroup = require_root.BubbleMenuItemGroup;
94
+ exports.BubbleMenuLinkSelector = require_root.BubbleMenuLinkSelector;
95
+ exports.BubbleMenuNodeSelector = require_root.BubbleMenuNodeSelector;
96
+ exports.BubbleMenuRoot = require_root.BubbleMenuRoot;
2484
97
  exports.BubbleMenuSeparator = BubbleMenuSeparator;
2485
- exports.BubbleMenuStrike = BubbleMenuStrike;
2486
- exports.BubbleMenuUnderline = BubbleMenuUnderline;
2487
- exports.BubbleMenuUppercase = BubbleMenuUppercase;
98
+ exports.BubbleMenuStrike = require_root.BubbleMenuStrike;
99
+ exports.BubbleMenuUnderline = require_root.BubbleMenuUnderline;
100
+ exports.BubbleMenuUppercase = require_root.BubbleMenuUppercase;
2488
101
  exports.ButtonBubbleMenu = ButtonBubbleMenu;
2489
- exports.ButtonBubbleMenuDefault = ButtonBubbleMenuDefault;
2490
- exports.ButtonBubbleMenuEditLink = ButtonBubbleMenuEditLink;
2491
- exports.ButtonBubbleMenuForm = ButtonBubbleMenuForm;
2492
- exports.ButtonBubbleMenuRoot = ButtonBubbleMenuRoot;
2493
- exports.ButtonBubbleMenuToolbar = ButtonBubbleMenuToolbar;
2494
- exports.ButtonBubbleMenuUnlink = ButtonBubbleMenuUnlink;
2495
- exports.CODE = CODE;
2496
- exports.CaseUpperIcon = CaseUpperIcon;
2497
- exports.Check = Check;
2498
- exports.ChevronDown = ChevronDown;
2499
- exports.Code = Code;
2500
- exports.CodeIcon = CodeIcon;
2501
- exports.Columns2 = Columns2;
2502
- exports.Columns3 = Columns3;
2503
- exports.Columns4 = Columns4;
2504
- exports.CommandList = CommandList;
2505
- exports.DIVIDER = DIVIDER;
2506
- exports.ExternalLinkIcon = ExternalLinkIcon;
2507
- exports.FOUR_COLUMNS = FOUR_COLUMNS;
2508
- exports.H1 = H1;
2509
- exports.H2 = H2;
2510
- exports.H3 = H3;
2511
- exports.Heading1 = Heading1;
2512
- exports.Heading2 = Heading2;
2513
- exports.Heading3 = Heading3;
102
+ exports.ButtonBubbleMenuDefault = require_root.ButtonBubbleMenuDefault;
103
+ exports.ButtonBubbleMenuEditLink = require_root.ButtonBubbleMenuEditLink;
104
+ exports.ButtonBubbleMenuForm = require_root.ButtonBubbleMenuForm;
105
+ exports.ButtonBubbleMenuRoot = require_root.ButtonBubbleMenuRoot;
106
+ exports.ButtonBubbleMenuToolbar = require_root.ButtonBubbleMenuToolbar;
107
+ exports.ButtonBubbleMenuUnlink = require_root.ButtonBubbleMenuUnlink;
108
+ exports.CODE = require_root.CODE;
109
+ exports.CaseUpperIcon = require_root.CaseUpperIcon;
110
+ exports.Check = require_root.Check;
111
+ exports.ChevronDown = require_root.ChevronDown;
112
+ exports.Code = require_root.Code;
113
+ exports.CodeIcon = require_root.CodeIcon;
114
+ exports.Columns2 = require_root.Columns2;
115
+ exports.Columns3 = require_root.Columns3;
116
+ exports.Columns4 = require_root.Columns4;
117
+ exports.CommandList = require_root.CommandList;
118
+ exports.DIVIDER = require_root.DIVIDER;
119
+ exports.ExternalLinkIcon = require_root.ExternalLinkIcon;
120
+ exports.FOUR_COLUMNS = require_root.FOUR_COLUMNS;
121
+ exports.H1 = require_root.H1;
122
+ exports.H2 = require_root.H2;
123
+ exports.H3 = require_root.H3;
124
+ exports.Heading1 = require_root.Heading1;
125
+ exports.Heading2 = require_root.Heading2;
126
+ exports.Heading3 = require_root.Heading3;
2514
127
  exports.ImageBubbleMenu = ImageBubbleMenu;
2515
- exports.ImageBubbleMenuDefault = ImageBubbleMenuDefault;
2516
- exports.ImageBubbleMenuEditLink = ImageBubbleMenuEditLink;
2517
- exports.ImageBubbleMenuRoot = ImageBubbleMenuRoot;
2518
- exports.ImageBubbleMenuToolbar = ImageBubbleMenuToolbar;
2519
- exports.ItalicIcon = ItalicIcon;
128
+ exports.ImageBubbleMenuDefault = require_root.ImageBubbleMenuDefault;
129
+ exports.ImageBubbleMenuEditLink = require_root.ImageBubbleMenuEditLink;
130
+ exports.ImageBubbleMenuRoot = require_root.ImageBubbleMenuRoot;
131
+ exports.ImageBubbleMenuToolbar = require_root.ImageBubbleMenuToolbar;
132
+ exports.ItalicIcon = require_root.ItalicIcon;
2520
133
  exports.LinkBubbleMenu = LinkBubbleMenu;
2521
- exports.LinkBubbleMenuDefault = LinkBubbleMenuDefault;
2522
- exports.LinkBubbleMenuEditLink = LinkBubbleMenuEditLink;
2523
- exports.LinkBubbleMenuForm = LinkBubbleMenuForm;
2524
- exports.LinkBubbleMenuOpenLink = LinkBubbleMenuOpenLink;
2525
- exports.LinkBubbleMenuRoot = LinkBubbleMenuRoot;
2526
- exports.LinkBubbleMenuToolbar = LinkBubbleMenuToolbar;
2527
- exports.LinkBubbleMenuUnlink = LinkBubbleMenuUnlink;
2528
- exports.LinkIcon = LinkIcon;
2529
- exports.List = List;
2530
- exports.ListOrdered = ListOrdered;
2531
- exports.MousePointer = MousePointer;
2532
- exports.NUMBERED_LIST = NUMBERED_LIST;
2533
- exports.NodeSelectorContent = NodeSelectorContent;
2534
- exports.NodeSelectorRoot = NodeSelectorRoot;
2535
- exports.NodeSelectorTrigger = NodeSelectorTrigger;
2536
- exports.PencilIcon = PencilIcon;
2537
- exports.QUOTE = QUOTE;
2538
- exports.Rows2 = Rows2;
2539
- exports.SECTION = SECTION;
134
+ exports.LinkBubbleMenuDefault = require_root.LinkBubbleMenuDefault;
135
+ exports.LinkBubbleMenuEditLink = require_root.LinkBubbleMenuEditLink;
136
+ exports.LinkBubbleMenuForm = require_root.LinkBubbleMenuForm;
137
+ exports.LinkBubbleMenuOpenLink = require_root.LinkBubbleMenuOpenLink;
138
+ exports.LinkBubbleMenuRoot = require_root.LinkBubbleMenuRoot;
139
+ exports.LinkBubbleMenuToolbar = require_root.LinkBubbleMenuToolbar;
140
+ exports.LinkBubbleMenuUnlink = require_root.LinkBubbleMenuUnlink;
141
+ exports.LinkIcon = require_root.LinkIcon;
142
+ exports.List = require_root.List;
143
+ exports.ListOrdered = require_root.ListOrdered;
144
+ exports.MousePointer = require_root.MousePointer;
145
+ exports.NUMBERED_LIST = require_root.NUMBERED_LIST;
146
+ exports.NodeSelectorContent = require_root.NodeSelectorContent;
147
+ exports.NodeSelectorRoot = require_root.NodeSelectorRoot;
148
+ exports.NodeSelectorTrigger = require_root.NodeSelectorTrigger;
149
+ exports.PencilIcon = require_root.PencilIcon;
150
+ exports.QUOTE = require_root.QUOTE;
151
+ exports.Rows2 = require_root.Rows2;
152
+ exports.SECTION = require_root.SECTION;
2540
153
  exports.SlashCommand = SlashCommand;
2541
- exports.SplitSquareVertical = SplitSquareVertical;
2542
- exports.SquareCode = SquareCode;
2543
- exports.StrikethroughIcon = StrikethroughIcon;
2544
- exports.TEXT = TEXT;
2545
- exports.THREE_COLUMNS = THREE_COLUMNS;
2546
- exports.TWO_COLUMNS = TWO_COLUMNS;
2547
- exports.Text = Text;
2548
- exports.TextIcon = TextIcon;
2549
- exports.TextQuote = TextQuote;
2550
- exports.UnderlineIcon = UnderlineIcon;
2551
- exports.UnlinkIcon = UnlinkIcon;
2552
- exports.defaultSlashCommands = defaultSlashCommands;
2553
- exports.filterAndRankItems = filterAndRankItems;
2554
- exports.isAtMaxColumnsDepth = isAtMaxColumnsDepth;
2555
- exports.isInsideNode = isInsideNode;
2556
- exports.scoreItem = scoreItem;
2557
- exports.useButtonBubbleMenuContext = useButtonBubbleMenuContext;
2558
- exports.useImageBubbleMenuContext = useImageBubbleMenuContext;
2559
- exports.useLinkBubbleMenuContext = useLinkBubbleMenuContext;
154
+ exports.SplitSquareVertical = require_root.SplitSquareVertical;
155
+ exports.SquareCode = require_root.SquareCode;
156
+ exports.StrikethroughIcon = require_root.StrikethroughIcon;
157
+ exports.TEXT = require_root.TEXT;
158
+ exports.THREE_COLUMNS = require_root.THREE_COLUMNS;
159
+ exports.TWO_COLUMNS = require_root.TWO_COLUMNS;
160
+ exports.Text = require_root.Text;
161
+ exports.TextIcon = require_root.TextIcon;
162
+ exports.TextQuote = require_root.TextQuote;
163
+ exports.UnderlineIcon = require_root.UnderlineIcon;
164
+ exports.UnlinkIcon = require_root.UnlinkIcon;
165
+ exports.defaultSlashCommands = require_root.defaultSlashCommands;
166
+ exports.filterAndRankItems = require_root.filterAndRankItems;
167
+ exports.isAtMaxColumnsDepth = require_root.isAtMaxColumnsDepth;
168
+ exports.isInsideNode = require_root.isInsideNode;
169
+ exports.scoreItem = require_root.scoreItem;
170
+ exports.useButtonBubbleMenuContext = require_root.useButtonBubbleMenuContext;
171
+ exports.useImageBubbleMenuContext = require_root.useImageBubbleMenuContext;
172
+ exports.useLinkBubbleMenuContext = require_root.useLinkBubbleMenuContext;