@templatical/editor 0.0.1

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.
@@ -0,0 +1,780 @@
1
+ import { defineComponent as vt, inject as Y, ref as R, shallowRef as G, watch as bt, onBeforeUnmount as gt, openBlock as a, createElementBlock as u, createBlock as U, Teleport as J, createElementVNode as r, normalizeStyle as Z, unref as e, Fragment as V, normalizeClass as c, createVNode as s, renderList as tt, toDisplayString as g, createCommentVNode as k, createTextVNode as et, resolveDynamicComponent as xt, withModifiers as mt, withDirectives as ht, vModelText as kt } from "vue";
2
+ import { c as v, v as yt, w as ft, u as wt, l as jt, A as zt, x as Lt, y as Mt, z as Ct, X as Et } from "./index-D-iD-7lO.js";
3
+ import "@templatical/types";
4
+ import { L as At } from "./loader-circle-tM9j2mRh.js";
5
+ /**
6
+ * @license lucide-vue-next v0.475.0 - ISC
7
+ *
8
+ * This source code is licensed under the ISC license.
9
+ * See the LICENSE file in the root directory of this source tree.
10
+ */
11
+ const Tt = v("BoldIcon", [
12
+ [
13
+ "path",
14
+ { 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", key: "mg9rjx" }
15
+ ]
16
+ ]);
17
+ /**
18
+ * @license lucide-vue-next v0.475.0 - ISC
19
+ *
20
+ * This source code is licensed under the ISC license.
21
+ * See the LICENSE file in the root directory of this source tree.
22
+ */
23
+ const _t = v("ItalicIcon", [
24
+ ["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
25
+ ["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
26
+ ["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
27
+ ]);
28
+ /**
29
+ * @license lucide-vue-next v0.475.0 - ISC
30
+ *
31
+ * This source code is licensed under the ISC license.
32
+ * See the LICENSE file in the root directory of this source tree.
33
+ */
34
+ const St = v("LinkIcon", [
35
+ ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
36
+ ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
37
+ ]);
38
+ /**
39
+ * @license lucide-vue-next v0.475.0 - ISC
40
+ *
41
+ * This source code is licensed under the ISC license.
42
+ * See the LICENSE file in the root directory of this source tree.
43
+ */
44
+ const It = v("ListOrderedIcon", [
45
+ ["path", { d: "M10 12h11", key: "6m4ad9" }],
46
+ ["path", { d: "M10 18h11", key: "11hvi2" }],
47
+ ["path", { d: "M10 6h11", key: "c7qv1k" }],
48
+ ["path", { d: "M4 10h2", key: "16xx2s" }],
49
+ ["path", { d: "M4 6h1v4", key: "cnovpq" }],
50
+ ["path", { d: "M6 18H4c0-1 2-2 2-3s-1-1.5-2-1", key: "m9a95d" }]
51
+ ]);
52
+ /**
53
+ * @license lucide-vue-next v0.475.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */
58
+ const $t = v("ListIcon", [
59
+ ["path", { d: "M3 12h.01", key: "nlz23k" }],
60
+ ["path", { d: "M3 18h.01", key: "1tta3j" }],
61
+ ["path", { d: "M3 6h.01", key: "1rqtza" }],
62
+ ["path", { d: "M8 12h13", key: "1za7za" }],
63
+ ["path", { d: "M8 18h13", key: "1lx6n3" }],
64
+ ["path", { d: "M8 6h13", key: "ik3vkj" }]
65
+ ]);
66
+ /**
67
+ * @license lucide-vue-next v0.475.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */
72
+ const Dt = v("RemoveFormattingIcon", [
73
+ ["path", { d: "M4 7V4h16v3", key: "9msm58" }],
74
+ ["path", { d: "M5 20h6", key: "1h6pxn" }],
75
+ ["path", { d: "M13 4 8 20", key: "kqq6aj" }],
76
+ ["path", { d: "m15 15 5 5", key: "me55sn" }],
77
+ ["path", { d: "m20 15-5 5", key: "11p7ol" }]
78
+ ]);
79
+ /**
80
+ * @license lucide-vue-next v0.475.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */
85
+ const qt = v("SmileIcon", [
86
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
87
+ ["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
88
+ ["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
89
+ ["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
90
+ ]);
91
+ /**
92
+ * @license lucide-vue-next v0.475.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */
97
+ const Bt = v("StrikethroughIcon", [
98
+ ["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
99
+ ["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
100
+ ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
101
+ ]);
102
+ /**
103
+ * @license lucide-vue-next v0.475.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */
108
+ const Rt = v("SubscriptIcon", [
109
+ ["path", { d: "m4 5 8 8", key: "1eunvl" }],
110
+ ["path", { d: "m12 5-8 8", key: "1ah0jp" }],
111
+ [
112
+ "path",
113
+ {
114
+ d: "M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",
115
+ key: "e8ta8j"
116
+ }
117
+ ]
118
+ ]);
119
+ /**
120
+ * @license lucide-vue-next v0.475.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */
125
+ const Ut = v("SuperscriptIcon", [
126
+ ["path", { d: "m4 19 8-8", key: "hr47gm" }],
127
+ ["path", { d: "m12 19-8-8", key: "1dhhmo" }],
128
+ [
129
+ "path",
130
+ {
131
+ d: "M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",
132
+ key: "1dfcux"
133
+ }
134
+ ]
135
+ ]);
136
+ /**
137
+ * @license lucide-vue-next v0.475.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */
142
+ const Vt = v("UnderlineIcon", [
143
+ ["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
144
+ ["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
145
+ ]), Pt = [
146
+ {
147
+ key: "smileys",
148
+ emojis: [
149
+ "😀",
150
+ "😃",
151
+ "😄",
152
+ "😁",
153
+ "😅",
154
+ "😂",
155
+ "🤣",
156
+ "😊",
157
+ "😇",
158
+ "🙂",
159
+ "😉",
160
+ "😍",
161
+ "🥰",
162
+ "😘",
163
+ "😋",
164
+ "😎",
165
+ "🤩",
166
+ "🥳",
167
+ "😏",
168
+ "😢",
169
+ "😭",
170
+ "😤",
171
+ "😡",
172
+ "🤯",
173
+ "😱",
174
+ "🤔",
175
+ "🤫",
176
+ "🤗",
177
+ "🫡",
178
+ "👋"
179
+ ]
180
+ },
181
+ {
182
+ key: "gestures",
183
+ emojis: [
184
+ "👍",
185
+ "👎",
186
+ "👏",
187
+ "🙌",
188
+ "🤝",
189
+ "✌️",
190
+ "🤞",
191
+ "🫶",
192
+ "❤️",
193
+ "🧡",
194
+ "💛",
195
+ "💚",
196
+ "💙",
197
+ "💜",
198
+ "🖤",
199
+ "💯",
200
+ "✨",
201
+ "⭐",
202
+ "🌟",
203
+ "💫",
204
+ "🔥",
205
+ "💥",
206
+ "💪",
207
+ "👀",
208
+ "👁️",
209
+ "🎉",
210
+ "🎊",
211
+ "🎁",
212
+ "🏆",
213
+ "🥇"
214
+ ]
215
+ },
216
+ {
217
+ key: "objects",
218
+ emojis: [
219
+ "📧",
220
+ "✉️",
221
+ "📨",
222
+ "📩",
223
+ "📬",
224
+ "📱",
225
+ "💻",
226
+ "🖥️",
227
+ "📊",
228
+ "📈",
229
+ "📉",
230
+ "📅",
231
+ "🗓️",
232
+ "⏰",
233
+ "⏳",
234
+ "💡",
235
+ "🔔",
236
+ "📢",
237
+ "🎯",
238
+ "✅",
239
+ "❌",
240
+ "⚠️",
241
+ "💲",
242
+ "💵",
243
+ "💰",
244
+ "🛒",
245
+ "🛍️",
246
+ "📦",
247
+ "🚀",
248
+ "✈️"
249
+ ]
250
+ }
251
+ ];
252
+ function Ht() {
253
+ const [x, I] = yt(!1);
254
+ function y() {
255
+ I();
256
+ }
257
+ function $() {
258
+ x.value = !1;
259
+ }
260
+ return {
261
+ categories: Pt,
262
+ isOpen: x,
263
+ toggle: y,
264
+ close: $
265
+ };
266
+ }
267
+ const Nt = { class: "tpl-text-editor-wrapper tpl:relative" }, Ot = ["title"], Ft = ["title"], Kt = ["title"], Qt = ["title"], Wt = ["title"], Xt = ["title"], Yt = ["title"], Gt = ["title"], Jt = ["title"], Zt = ["title"], te = ["title"], ee = ["title"], le = ["title"], pe = { class: "tpl:relative" }, re = ["title"], ie = {
268
+ key: 0,
269
+ class: "tpl-emoji-picker tpl:absolute tpl:top-full tpl:left-0 tpl:z-10 tpl:mt-2 tpl:w-72 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:shadow-lg"
270
+ }, ne = { class: "tpl:mb-1.5 tpl:text-[10px] tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase" }, oe = { class: "tpl:grid tpl:grid-cols-10 tpl:gap-0.5" }, se = ["onClick"], ae = {
271
+ key: 0,
272
+ class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]"
273
+ }, de = ["title"], ue = {
274
+ key: 1,
275
+ class: "tpl:flex tpl:items-center tpl:gap-2 tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
276
+ }, ce = {
277
+ key: 0,
278
+ class: "tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:border-indigo-500 tpl:p-2"
279
+ }, ve = { class: "tpl:w-[400px] tpl:overflow-hidden tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:shadow-lg" }, be = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-5 tpl:py-4" }, ge = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, xe = { class: "tpl:p-5" }, me = { class: "tpl:mb-4 tpl:last:mb-0" }, he = { class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase" }, ke = ["placeholder"], ye = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:px-5 tpl:py-4" }, fe = { class: "tpl:ml-auto tpl:flex tpl:gap-2" }, Ce = /* @__PURE__ */ vt({
280
+ __name: "TextEditor",
281
+ props: {
282
+ block: {},
283
+ toolbarPosition: {}
284
+ },
285
+ emits: ["done"],
286
+ setup(x, { emit: I }) {
287
+ const y = x, $ = I, P = Y("editor"), H = Y("themeStyles"), {
288
+ mergeTags: lt,
289
+ isEnabled: N,
290
+ isRequesting: pt,
291
+ requestMergeTag: rt,
292
+ syntax: O
293
+ } = ft(), D = R(!1), b = R(""), {
294
+ categories: it,
295
+ isOpen: q,
296
+ toggle: F,
297
+ close: K
298
+ } = Ht(), { t: n } = wt();
299
+ function nt(i) {
300
+ var t;
301
+ (t = l.value) == null || t.chain().focus().insertContent(i).run(), K();
302
+ }
303
+ const l = G(null), B = G(null), j = R(!0);
304
+ async function ot() {
305
+ try {
306
+ const [
307
+ { Editor: i },
308
+ { EditorContent: t },
309
+ { default: z },
310
+ { default: L },
311
+ { default: M },
312
+ { default: C },
313
+ { default: E },
314
+ { default: A },
315
+ { MergeTagNode: T, LogicMergeTagNode: _ }
316
+ ] = await Promise.all([
317
+ import("./index-ZQzHBwkr.js").then((d) => d.aQ),
318
+ import("./index-D-ygXbc8.js"),
319
+ import("./index-DbrWKz-e.js"),
320
+ import("./index-BSc6h5zo.js"),
321
+ import("./index-CrvwWlhN.js"),
322
+ import("./index-4okvXjqk.js"),
323
+ import("./index-Ude6e9RU.js"),
324
+ import("./index-0tWUczNu.js"),
325
+ import("./index-DeUeHy6g.js")
326
+ ]);
327
+ B.value = t;
328
+ const f = [
329
+ z.configure({
330
+ heading: !1,
331
+ codeBlock: !1,
332
+ blockquote: !1,
333
+ horizontalRule: !1
334
+ }),
335
+ M,
336
+ C,
337
+ E,
338
+ L.configure({
339
+ openOnClick: !1,
340
+ HTMLAttributes: {
341
+ target: "_blank",
342
+ rel: "noopener noreferrer"
343
+ }
344
+ }),
345
+ A.configure({
346
+ types: ["paragraph", "heading"]
347
+ }),
348
+ T.configure({
349
+ mergeTags: lt,
350
+ syntax: O
351
+ }),
352
+ _.configure({
353
+ syntax: O
354
+ })
355
+ ], w = /* @__PURE__ */ new Map();
356
+ f.forEach((d, h) => w.set(d.name, h));
357
+ const S = f.filter(
358
+ (d, h) => w.get(d.name) === h
359
+ );
360
+ l.value = new i({
361
+ extensions: S,
362
+ content: y.block.content,
363
+ editable: !0,
364
+ onUpdate: ({ editor: d }) => {
365
+ P && P.updateBlock(y.block.id, {
366
+ content: d.getHTML()
367
+ });
368
+ }
369
+ }), j.value = !1, setTimeout(() => {
370
+ var d;
371
+ (d = l.value) == null || d.commands.focus("end");
372
+ }, 0);
373
+ } catch (i) {
374
+ console.error("[TextEditor] Failed to initialize TipTap editor:", i), j.value = !1;
375
+ }
376
+ }
377
+ ot(), bt(
378
+ () => y.block.content,
379
+ (i) => {
380
+ l.value && l.value.getHTML() !== i && l.value.commands.setContent(i, !1);
381
+ }
382
+ );
383
+ function st(i) {
384
+ if (pt.value) return;
385
+ const t = i.target;
386
+ q.value && !t.closest(".tpl-emoji-picker") && K(), !(t.closest(".tpl-text-editor-wrapper") || t.closest(".tpl-text-toolbar") || t.closest(".tpl-link-dialog")) && $("done");
387
+ }
388
+ jt(document, "mousedown", st), gt(() => {
389
+ var i;
390
+ (i = l.value) == null || i.destroy();
391
+ });
392
+ function at() {
393
+ var t;
394
+ const i = ((t = l.value) == null ? void 0 : t.getAttributes("link").href) || "";
395
+ b.value = i, D.value = !0;
396
+ }
397
+ function Q() {
398
+ var i;
399
+ if (b.value) {
400
+ const t = b.value.startsWith("http") ? b.value : `https://${b.value}`;
401
+ (i = l.value) == null || i.chain().focus().extendMarkRange("link").setLink({ href: t }).run();
402
+ }
403
+ m();
404
+ }
405
+ function dt() {
406
+ var i;
407
+ (i = l.value) == null || i.chain().focus().extendMarkRange("link").unsetLink().run(), m();
408
+ }
409
+ function m() {
410
+ D.value = !1, b.value = "";
411
+ }
412
+ function ut(i) {
413
+ i.key === "Enter" ? (i.preventDefault(), Q()) : i.key === "Escape" && m();
414
+ }
415
+ async function ct() {
416
+ var t;
417
+ const i = await rt();
418
+ i && l.value ? l.value.chain().focus().insertMergeTag({
419
+ label: i.label,
420
+ value: i.value
421
+ }).run() : (t = l.value) == null || t.commands.focus();
422
+ }
423
+ return (i, t) => {
424
+ var z, L, M, C, E, A, T, _, f, w, S, d, h, W, X;
425
+ return a(), u("div", Nt, [
426
+ (a(), U(J, { to: "body" }, [
427
+ r("div", {
428
+ class: "tpl tpl-text-toolbar tpl:fixed tpl:z-[9999] tpl:flex tpl:items-center tpl:gap-1 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:shadow-lg",
429
+ style: Z({
430
+ ...e(H),
431
+ top: `${x.toolbarPosition.top}px`,
432
+ left: `${x.toolbarPosition.left}px`,
433
+ transform: "translateY(-100%)"
434
+ })
435
+ }, [
436
+ !j.value && l.value ? (a(), u(V, { key: 0 }, [
437
+ r("button", {
438
+ type: "button",
439
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
440
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (z = l.value) == null ? void 0 : z.isActive("bold")
441
+ }]),
442
+ title: e(n).textEditor.bold,
443
+ onClick: t[0] || (t[0] = (o) => {
444
+ var p;
445
+ return (p = l.value) == null ? void 0 : p.chain().focus().toggleBold().run();
446
+ })
447
+ }, [
448
+ s(e(Tt), {
449
+ size: 16,
450
+ "stroke-width": 2.5
451
+ })
452
+ ], 10, Ot),
453
+ r("button", {
454
+ type: "button",
455
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
456
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (L = l.value) == null ? void 0 : L.isActive("italic")
457
+ }]),
458
+ title: e(n).textEditor.italic,
459
+ onClick: t[1] || (t[1] = (o) => {
460
+ var p;
461
+ return (p = l.value) == null ? void 0 : p.chain().focus().toggleItalic().run();
462
+ })
463
+ }, [
464
+ s(e(_t), {
465
+ size: 16,
466
+ "stroke-width": 2
467
+ })
468
+ ], 10, Ft),
469
+ r("button", {
470
+ type: "button",
471
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
472
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (M = l.value) == null ? void 0 : M.isActive("underline")
473
+ }]),
474
+ title: e(n).textEditor.underline,
475
+ onClick: t[2] || (t[2] = (o) => {
476
+ var p;
477
+ return (p = l.value) == null ? void 0 : p.chain().focus().toggleUnderline().run();
478
+ })
479
+ }, [
480
+ s(e(Vt), {
481
+ size: 16,
482
+ "stroke-width": 2
483
+ })
484
+ ], 10, Kt),
485
+ r("button", {
486
+ type: "button",
487
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
488
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (C = l.value) == null ? void 0 : C.isActive("strike")
489
+ }]),
490
+ title: e(n).textEditor.strikethrough,
491
+ onClick: t[3] || (t[3] = (o) => {
492
+ var p;
493
+ return (p = l.value) == null ? void 0 : p.chain().focus().toggleStrike().run();
494
+ })
495
+ }, [
496
+ s(e(Bt), {
497
+ size: 16,
498
+ "stroke-width": 2
499
+ })
500
+ ], 10, Qt),
501
+ t[14] || (t[14] = r("span", { class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]" }, null, -1)),
502
+ r("button", {
503
+ type: "button",
504
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
505
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (E = l.value) == null ? void 0 : E.isActive("subscript")
506
+ }]),
507
+ title: e(n).textEditor.subscript,
508
+ onClick: t[4] || (t[4] = (o) => {
509
+ var p;
510
+ return (p = l.value) == null ? void 0 : p.chain().focus().toggleSubscript().run();
511
+ })
512
+ }, [
513
+ s(e(Rt), {
514
+ size: 16,
515
+ "stroke-width": 2
516
+ })
517
+ ], 10, Wt),
518
+ r("button", {
519
+ type: "button",
520
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
521
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (A = l.value) == null ? void 0 : A.isActive("superscript")
522
+ }]),
523
+ title: e(n).textEditor.superscript,
524
+ onClick: t[5] || (t[5] = (o) => {
525
+ var p;
526
+ return (p = l.value) == null ? void 0 : p.chain().focus().toggleSuperscript().run();
527
+ })
528
+ }, [
529
+ s(e(Ut), {
530
+ size: 16,
531
+ "stroke-width": 2
532
+ })
533
+ ], 10, Xt),
534
+ t[15] || (t[15] = r("span", { class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]" }, null, -1)),
535
+ r("button", {
536
+ type: "button",
537
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
538
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (T = l.value) == null ? void 0 : T.isActive("link")
539
+ }]),
540
+ title: e(n).textEditor.addLink,
541
+ onClick: at
542
+ }, [
543
+ s(e(St), {
544
+ size: 16,
545
+ "stroke-width": 2
546
+ })
547
+ ], 10, Yt),
548
+ t[16] || (t[16] = r("span", { class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]" }, null, -1)),
549
+ r("button", {
550
+ type: "button",
551
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
552
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (_ = l.value) == null ? void 0 : _.isActive("bulletList")
553
+ }]),
554
+ title: e(n).textEditor.bulletList,
555
+ onClick: t[6] || (t[6] = (o) => {
556
+ var p;
557
+ return (p = l.value) == null ? void 0 : p.chain().focus().toggleBulletList().run();
558
+ })
559
+ }, [
560
+ s(e($t), {
561
+ size: 16,
562
+ "stroke-width": 2
563
+ })
564
+ ], 10, Gt),
565
+ r("button", {
566
+ type: "button",
567
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
568
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (f = l.value) == null ? void 0 : f.isActive("orderedList")
569
+ }]),
570
+ title: e(n).textEditor.numberedList,
571
+ onClick: t[7] || (t[7] = (o) => {
572
+ var p;
573
+ return (p = l.value) == null ? void 0 : p.chain().focus().toggleOrderedList().run();
574
+ })
575
+ }, [
576
+ s(e(It), {
577
+ size: 16,
578
+ "stroke-width": 2
579
+ })
580
+ ], 10, Jt),
581
+ t[17] || (t[17] = r("span", { class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]" }, null, -1)),
582
+ r("button", {
583
+ type: "button",
584
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
585
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (w = l.value) == null ? void 0 : w.isActive({
586
+ textAlign: "left"
587
+ })
588
+ }]),
589
+ title: e(n).textEditor.alignLeft,
590
+ onClick: t[8] || (t[8] = (o) => {
591
+ var p;
592
+ return (p = l.value) == null ? void 0 : p.chain().focus().setTextAlign("left").run();
593
+ })
594
+ }, [
595
+ s(e(zt), {
596
+ size: 16,
597
+ "stroke-width": 2
598
+ })
599
+ ], 10, Zt),
600
+ r("button", {
601
+ type: "button",
602
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
603
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (S = l.value) == null ? void 0 : S.isActive({
604
+ textAlign: "center"
605
+ })
606
+ }]),
607
+ title: e(n).textEditor.alignCenter,
608
+ onClick: t[9] || (t[9] = (o) => {
609
+ var p;
610
+ return (p = l.value) == null ? void 0 : p.chain().focus().setTextAlign("center").run();
611
+ })
612
+ }, [
613
+ s(e(Lt), {
614
+ size: 16,
615
+ "stroke-width": 2
616
+ })
617
+ ], 10, te),
618
+ r("button", {
619
+ type: "button",
620
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
621
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": (d = l.value) == null ? void 0 : d.isActive({
622
+ textAlign: "right"
623
+ })
624
+ }]),
625
+ title: e(n).textEditor.alignRight,
626
+ onClick: t[10] || (t[10] = (o) => {
627
+ var p;
628
+ return (p = l.value) == null ? void 0 : p.chain().focus().setTextAlign("right").run();
629
+ })
630
+ }, [
631
+ s(e(Mt), {
632
+ size: 16,
633
+ "stroke-width": 2
634
+ })
635
+ ], 10, ee),
636
+ t[18] || (t[18] = r("span", { class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]" }, null, -1)),
637
+ r("button", {
638
+ type: "button",
639
+ class: "tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",
640
+ title: e(n).textEditor.clearFormatting,
641
+ onClick: t[11] || (t[11] = (o) => {
642
+ var p;
643
+ return (p = l.value) == null ? void 0 : p.chain().focus().clearNodes().unsetAllMarks().run();
644
+ })
645
+ }, [
646
+ s(e(Dt), {
647
+ size: 16,
648
+ "stroke-width": 2
649
+ })
650
+ ], 8, le),
651
+ t[19] || (t[19] = r("span", { class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]" }, null, -1)),
652
+ r("div", pe, [
653
+ r("button", {
654
+ type: "button",
655
+ class: c(["tpl:flex tpl:size-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]", {
656
+ "tpl:!bg-[var(--tpl-primary)] tpl:!text-white": e(q)
657
+ }]),
658
+ title: e(n).textEditor.insertEmoji,
659
+ onClick: t[12] || (t[12] = //@ts-ignore
660
+ (...o) => e(F) && e(F)(...o))
661
+ }, [
662
+ s(e(qt), {
663
+ size: 16,
664
+ "stroke-width": 2
665
+ })
666
+ ], 10, re),
667
+ e(q) ? (a(), u("div", ie, [
668
+ (a(!0), u(V, null, tt(e(it), (o) => (a(), u("div", {
669
+ key: o.key,
670
+ class: "tpl:mb-2 tpl:last:mb-0"
671
+ }, [
672
+ r("div", ne, g(e(n).emoji[o.key]), 1),
673
+ r("div", oe, [
674
+ (a(!0), u(V, null, tt(o.emojis, (p) => (a(), u("button", {
675
+ key: p,
676
+ type: "button",
677
+ class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:text-base tpl:transition-all tpl:duration-100 tpl:hover:scale-125 tpl:hover:bg-[var(--tpl-bg-active)]",
678
+ onClick: (we) => nt(p)
679
+ }, g(p), 9, se))), 128))
680
+ ])
681
+ ]))), 128))
682
+ ])) : k("", !0)
683
+ ]),
684
+ e(N) ? (a(), u("span", ae)) : k("", !0),
685
+ e(N) ? (a(), u("button", {
686
+ key: 1,
687
+ type: "button",
688
+ class: "tpl:flex tpl:h-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",
689
+ title: e(n).mergeTag.add,
690
+ onClick: ct
691
+ }, [
692
+ s(e(Ct), {
693
+ size: 16,
694
+ "stroke-width": 2
695
+ }),
696
+ et(" " + g(e(n).mergeTag.add), 1)
697
+ ], 8, de)) : k("", !0)
698
+ ], 64)) : (a(), u("div", ue, [
699
+ s(e(At), {
700
+ class: "tpl-spinner",
701
+ size: 14,
702
+ "stroke-width": 2
703
+ }),
704
+ t[20] || (t[20] = et(" Loading editor... ", -1))
705
+ ]))
706
+ ], 4)
707
+ ])),
708
+ j.value ? (a(), u("div", ce, [...t[21] || (t[21] = [
709
+ r("div", { class: "tpl:animate-pulse tpl:text-zinc-400" }, "Loading...", -1)
710
+ ])])) : B.value && l.value ? (a(), U(xt(B.value), {
711
+ key: 1,
712
+ editor: l.value,
713
+ class: "tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:border-indigo-500 tpl:p-2"
714
+ }, null, 8, ["editor"])) : k("", !0),
715
+ (a(), U(J, { to: "body" }, [
716
+ D.value ? (a(), u("div", {
717
+ key: 0,
718
+ class: "tpl tpl-link-dialog tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/50",
719
+ style: Z(e(H)),
720
+ onClick: mt(m, ["self"])
721
+ }, [
722
+ r("div", ve, [
723
+ r("div", be, [
724
+ r("h4", ge, g((h = l.value) != null && h.isActive("link") ? e(n).linkDialog.editLink : e(n).linkDialog.insertLink), 1),
725
+ r("button", {
726
+ type: "button",
727
+ class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
728
+ onClick: m
729
+ }, [
730
+ s(e(Et), {
731
+ size: 16,
732
+ "stroke-width": 2
733
+ })
734
+ ])
735
+ ]),
736
+ r("div", xe, [
737
+ r("div", me, [
738
+ r("label", he, g(e(n).linkDialog.urlLabel), 1),
739
+ ht(r("input", {
740
+ "onUpdate:modelValue": t[13] || (t[13] = (o) => b.value = o),
741
+ type: "url",
742
+ class: "tpl:w-full tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:outline-none tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]",
743
+ placeholder: e(n).linkDialog.urlPlaceholder,
744
+ autofocus: "",
745
+ onKeydown: ut
746
+ }, null, 40, ke), [
747
+ [kt, b.value]
748
+ ])
749
+ ])
750
+ ]),
751
+ r("div", ye, [
752
+ (W = l.value) != null && W.isActive("link") ? (a(), u("button", {
753
+ key: 0,
754
+ type: "button",
755
+ class: "tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-danger)] tpl:bg-transparent tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-[var(--tpl-danger)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-danger-light)]",
756
+ onClick: dt
757
+ }, g(e(n).linkDialog.removeLink), 1)) : k("", !0),
758
+ r("div", fe, [
759
+ r("button", {
760
+ type: "button",
761
+ class: "tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-transparent tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
762
+ onClick: m
763
+ }, g(e(n).linkDialog.cancel), 1),
764
+ r("button", {
765
+ type: "button",
766
+ class: "tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)]",
767
+ onClick: Q
768
+ }, g((X = l.value) != null && X.isActive("link") ? e(n).linkDialog.updateLink : e(n).linkDialog.insertLink), 1)
769
+ ])
770
+ ])
771
+ ])
772
+ ], 4)) : k("", !0)
773
+ ]))
774
+ ]);
775
+ };
776
+ }
777
+ });
778
+ export {
779
+ Ce as default
780
+ };