@templatical/editor 0.0.2 → 0.0.4
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.
- package/dist/{AiChatSidebar-XBj5Rw2l.js → AiChatSidebar-CjfhTZwo.js} +1 -1
- package/dist/{AiFeatureMenu-my1mZ9DL.js → AiFeatureMenu-K44aZa_P.js} +3 -3
- package/dist/CloudEditor-DFyuRxUV.js +926 -0
- package/dist/{CollaboratorBar-BZq_Gv38.js → CollaboratorBar-BuCEcdbB.js} +25 -21
- package/dist/{CommentsSidebar-D9oxqO6l.js → CommentsSidebar-2lcqMfIP.js} +2 -2
- package/dist/{DesignReferenceSidebar-CyHq4SWt.js → DesignReferenceSidebar-CNMu4Zrx.js} +55 -54
- package/dist/{ModuleBrowserModal-Cus2Hdwl.js → ModuleBrowserModal-CvQ0xyQf.js} +6 -6
- package/dist/{ModulePreviewCanvas-DaByXKY_.js → ModulePreviewCanvas-Be2B3Y07.js} +3 -3
- package/dist/ParagraphEditor-CcMPnbDr.js +652 -0
- package/dist/{RichTextEditorContent-BRpjJ6SV.js → RichTextEditorContent-CHJlh7HJ.js} +8 -4
- package/dist/{SaveModuleDialog-BIZBQrd8.js → SaveModuleDialog-BaaeH5Xm.js} +5 -5
- package/dist/{SnapshotHistory-Ds1-QNbx.js → SnapshotHistory-BPfjiuu1.js} +2 -2
- package/dist/{TemplateScoringPanel-C8XSk_Ys.js → TemplateScoringPanel-D58A23Vq.js} +3 -3
- package/dist/{TestEmailModal-CCVfaFgV.js → TestEmailModal-DIAlB3e_.js} +3 -3
- package/dist/{TitleEditor-V4qaEULF.js → TitleEditor-D9DPjQkX.js} +7 -7
- package/dist/{TplModal-LT3FXlgs.js → TplModal-CmTSvCY-.js} +2 -2
- package/dist/{blockTypeIcons-BujoY5Dl.js → blockTypeIcons-D1RTWOkx.js} +1 -1
- package/dist/cdn/chunks/AiChatSidebar-CmPTbTFG.js +2 -0
- package/dist/cdn/chunks/AiFeatureMenu-lxVm1RjH.js +59 -0
- package/dist/cdn/chunks/AiFeatureMenu-lxVm1RjH.js.map +1 -0
- package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js +900 -0
- package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js.map +1 -0
- package/dist/cdn/chunks/CollaboratorBar-D2PKtlOw.js +51 -0
- package/dist/cdn/chunks/CollaboratorBar-D2PKtlOw.js.map +1 -0
- package/dist/cdn/chunks/CommentsSidebar-BOelj4Ca.js +2 -0
- package/dist/cdn/chunks/DesignReferenceSidebar-Bf6rg0A7.js +2 -0
- package/dist/cdn/chunks/ModuleBrowserModal-CxDXzkKS.js +195 -0
- package/dist/cdn/chunks/ModuleBrowserModal-CxDXzkKS.js.map +1 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-DEfHampA.js +107 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-DEfHampA.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js +503 -0
- package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-DWUzizsC.js +106 -0
- package/dist/cdn/chunks/RichTextEditorContent-DWUzizsC.js.map +1 -0
- package/dist/cdn/chunks/SaveModuleDialog-DVna2xUl.js +119 -0
- package/dist/cdn/chunks/SaveModuleDialog-DVna2xUl.js.map +1 -0
- package/dist/cdn/chunks/SnapshotHistory-BFF2SsTN.js +2 -0
- package/dist/cdn/chunks/TemplateScoringPanel-gi8wc_m7.js +2 -0
- package/dist/cdn/chunks/TestEmailModal-Qtd6aC-6.js +2 -0
- package/dist/cdn/chunks/TitleEditor-DDf_OcHS.js +166 -0
- package/dist/cdn/chunks/TitleEditor-DDf_OcHS.js.map +1 -0
- package/dist/cdn/chunks/_rolldown_dynamic_import_helper-DMEI4TQ3.js +9 -0
- package/dist/cdn/chunks/blockTypeIcons-BnobReQm.js +22 -0
- package/dist/cdn/chunks/blockTypeIcons-BnobReQm.js.map +1 -0
- package/dist/cdn/chunks/de-BB3dgVOc.js +700 -0
- package/dist/cdn/chunks/de-BB3dgVOc.js.map +1 -0
- package/dist/cdn/chunks/de-BvYD17KT.js +89 -0
- package/dist/cdn/chunks/de-BvYD17KT.js.map +1 -0
- package/dist/cdn/chunks/dist-B6AUkMyh.js +2 -0
- package/dist/cdn/chunks/dist-B878xb_62.js +457 -0
- package/dist/cdn/chunks/dist-B878xb_62.js.map +1 -0
- package/dist/cdn/chunks/dist-Bf1Op9A1.js +2 -0
- package/dist/cdn/chunks/dist-BkETaOfw.js +2 -0
- package/dist/cdn/chunks/dist-CJcMnY7o.js +2 -0
- package/dist/cdn/chunks/dist-CWsl6S1K.js +2 -0
- package/dist/cdn/chunks/dist-CllLxIMQ.js +2 -0
- package/dist/cdn/chunks/dist-Cs0wFwdw.js +2 -0
- package/dist/cdn/chunks/dist-DLWHlekl.js +2 -0
- package/dist/cdn/chunks/dist-DS3_HVpX.js +2 -0
- package/dist/cdn/chunks/dist-DTXopj1a.js +2 -0
- package/dist/cdn/chunks/dist-DnwLoNLm.js +2 -0
- package/dist/cdn/chunks/draggable-BQNU47zu.js +11544 -0
- package/dist/cdn/chunks/{draggable-ClUwYCFL.js.map → draggable-BQNU47zu.js.map} +1 -1
- package/dist/cdn/chunks/emojiData-BVEJHcNH.js +19 -0
- package/dist/cdn/chunks/{emojiData-6fVLNqeH.js.map → emojiData-BVEJHcNH.js.map} +1 -1
- package/dist/cdn/chunks/en-CpotcOPr.js +89 -0
- package/dist/cdn/chunks/en-CpotcOPr.js.map +1 -0
- package/dist/cdn/chunks/en-DeDcpnoS.js +700 -0
- package/dist/cdn/chunks/en-DeDcpnoS.js.map +1 -0
- package/dist/cdn/chunks/extensions-B_kcV0tK.js +419 -0
- package/dist/cdn/chunks/{extensions-BfjbWqOx.js.map → extensions-B_kcV0tK.js.map} +1 -1
- package/dist/cdn/chunks/features-ofOGnSC0.js +6700 -0
- package/dist/cdn/chunks/features-ofOGnSC0.js.map +1 -0
- package/dist/cdn/chunks/icons-bIb7PBOE.js +653 -0
- package/dist/cdn/chunks/icons-bIb7PBOE.js.map +1 -0
- package/dist/cdn/chunks/liquid.browser-C1VIYISn.js +3272 -0
- package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +1 -0
- package/dist/cdn/chunks/media-library-BIYzV2Y2.js +6005 -0
- package/dist/cdn/chunks/media-library-BIYzV2Y2.js.map +1 -0
- package/dist/cdn/chunks/pusher-DJPhQnE8.js +2505 -0
- package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js +32 -0
- package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-DPITmOBR.js +20 -0
- package/dist/cdn/chunks/src-BuW9oYtm.js +494 -0
- package/dist/cdn/chunks/src-BuW9oYtm.js.map +1 -0
- package/dist/cdn/chunks/styleConstants-1KwsBMxJ.js +57 -0
- package/dist/cdn/chunks/{styleConstants-UTJ94gco.js.map → styleConstants-1KwsBMxJ.js.map} +1 -1
- package/dist/cdn/chunks/styles-DQFExz-T.js +3222 -0
- package/dist/cdn/chunks/styles-DQFExz-T.js.map +1 -0
- package/dist/cdn/chunks/tiptap-DplY-S-k.js +14208 -0
- package/dist/cdn/chunks/{tiptap-Cya4P9CN.js.map → tiptap-DplY-S-k.js.map} +1 -1
- package/dist/cdn/editor.css +2 -1
- package/dist/cdn/editor.js +260 -1
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{de-B4Ob4vCo.js → de-D7TLGIPA.js} +20 -4
- package/dist/{dist-DNjZKe2Z.js → dist-BkIys9zn.js} +1 -1
- package/dist/{en-YXsspZJG.js → en-DvtiEMwP.js} +20 -4
- package/dist/{extensions-BA4NshZQ.js → extensions-DEjfEFhD.js} +3 -3
- package/dist/keys-C0MQRs8d.js +10 -0
- package/dist/readableTextColor-LDlmVEUv.js +30 -0
- package/dist/{styleConstants-CgtFM9hQ.js → styleConstants-D4SOZGBV.js} +53 -2
- package/dist/{styles-hQgJKM4i.js → styles-CgLaxDfu.js} +1091 -1069
- package/dist/templatical-editor.css +1 -1
- package/dist/templatical-editor.js +113 -89
- package/dist/templatical-editor.umd.cjs +59 -59
- package/dist/{useEditorCore-DVp5qmtC.js → useEditorCore-CjwRMl7K.js} +1185 -1043
- package/dist/{useI18n-DzH4KXDk.js → useI18n-D6m7ZUgY.js} +2 -2
- package/dist/{useMergeTag-D9zQVE-e.js → useMergeTag-BZ3X0bNr.js} +2 -2
- package/package.json +2 -2
- package/dist/CloudEditor-BVjgKwq3.js +0 -940
- package/dist/ParagraphEditor-BSyk5B6S.js +0 -670
- package/dist/cdn/chunks/ParagraphEditor-BkJQO-ZW.js +0 -3
- package/dist/cdn/chunks/ParagraphEditor-BkJQO-ZW.js.map +0 -1
- package/dist/cdn/chunks/RichTextEditorContent-UGQorJm_.js +0 -2
- package/dist/cdn/chunks/RichTextEditorContent-UGQorJm_.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-CC3Adjai.js +0 -3
- package/dist/cdn/chunks/TitleEditor-CC3Adjai.js.map +0 -1
- package/dist/cdn/chunks/dist-0UheN8rK.js +0 -1
- package/dist/cdn/chunks/dist-55mmbGQ9.js +0 -1
- package/dist/cdn/chunks/dist-B31mxKyP.js +0 -1
- package/dist/cdn/chunks/dist-B5JI9nIg.js +0 -1
- package/dist/cdn/chunks/dist-B93vLKhU.js +0 -1
- package/dist/cdn/chunks/dist-BDt3FJvj.js +0 -1
- package/dist/cdn/chunks/dist-BJRuFHmi.js +0 -1
- package/dist/cdn/chunks/dist-BKSzrf0L.js +0 -1
- package/dist/cdn/chunks/dist-BL8c5gYQ.js +0 -1
- package/dist/cdn/chunks/dist-CYThWMP5.js +0 -1
- package/dist/cdn/chunks/dist-DxZbPJYt.js +0 -1
- package/dist/cdn/chunks/draggable-ClUwYCFL.js +0 -17
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js +0 -2
- package/dist/cdn/chunks/extensions-BfjbWqOx.js +0 -2
- package/dist/cdn/chunks/icons-vmLJTaJk.js +0 -2
- package/dist/cdn/chunks/icons-vmLJTaJk.js.map +0 -1
- package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +0 -1
- package/dist/cdn/chunks/styleConstants-UTJ94gco.js +0 -2
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js +0 -145
- package/dist/cdn/chunks/useEditorCore-DRhPKq_z.js +0 -2
- package/dist/cdn/chunks/useEditorCore-DRhPKq_z.js.map +0 -1
- package/dist/cdn/chunks/useMergeTag-CBSlcqnk.js +0 -2
- package/dist/cdn/chunks/useMergeTag-CBSlcqnk.js.map +0 -1
- package/dist/i18n-ikyi28RU.js +0 -23
- package/dist/keys-8B5MFafK.js +0 -4
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
import { C as e, b as t, w as n } from "./useEditorCore-CjwRMl7K.js";
|
|
2
|
+
import { t as r } from "./dist-CG-vEqSU.js";
|
|
3
|
+
import { S as i, T as a, p as o, w as s } from "./keys-C0MQRs8d.js";
|
|
4
|
+
import { t as c } from "./useI18n-D6m7ZUgY.js";
|
|
5
|
+
import { n as l } from "./_plugin-vue_export-helper-B1-bu7yR.js";
|
|
6
|
+
import { a as u, i as d, n as f, r as p, t as m } from "./RichTextEditorContent-CHJlh7HJ.js";
|
|
7
|
+
import { t as h } from "./loader-circle-BTQQxC3l.js";
|
|
8
|
+
import { t as g } from "./scan-line-7lZPfOdm.js";
|
|
9
|
+
import { _, a as v, g as y, h as b, o as x, s as S } from "./styleConstants-D4SOZGBV.js";
|
|
10
|
+
import { Fragment as C, Teleport as w, computed as T, createBlock as ee, createCommentVNode as E, createElementBlock as D, createElementVNode as O, createTextVNode as k, createVNode as A, defineComponent as j, inject as M, isRef as N, normalizeClass as P, normalizeStyle as F, openBlock as I, ref as L, renderList as R, toDisplayString as z, unref as B, withKeys as V, withModifiers as H } from "vue";
|
|
11
|
+
var U = l("list-ordered", [
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M11 5h10",
|
|
14
|
+
key: "1cz7ny"
|
|
15
|
+
}],
|
|
16
|
+
["path", {
|
|
17
|
+
d: "M11 12h10",
|
|
18
|
+
key: "1438ji"
|
|
19
|
+
}],
|
|
20
|
+
["path", {
|
|
21
|
+
d: "M11 19h10",
|
|
22
|
+
key: "11t30w"
|
|
23
|
+
}],
|
|
24
|
+
["path", {
|
|
25
|
+
d: "M4 4h1v5",
|
|
26
|
+
key: "10yrso"
|
|
27
|
+
}],
|
|
28
|
+
["path", {
|
|
29
|
+
d: "M4 9h2",
|
|
30
|
+
key: "r1h2o0"
|
|
31
|
+
}],
|
|
32
|
+
["path", {
|
|
33
|
+
d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",
|
|
34
|
+
key: "xtkcd5"
|
|
35
|
+
}]
|
|
36
|
+
]), te = l("list", [
|
|
37
|
+
["path", {
|
|
38
|
+
d: "M3 5h.01",
|
|
39
|
+
key: "18ugdj"
|
|
40
|
+
}],
|
|
41
|
+
["path", {
|
|
42
|
+
d: "M3 12h.01",
|
|
43
|
+
key: "nlz23k"
|
|
44
|
+
}],
|
|
45
|
+
["path", {
|
|
46
|
+
d: "M3 19h.01",
|
|
47
|
+
key: "noohij"
|
|
48
|
+
}],
|
|
49
|
+
["path", {
|
|
50
|
+
d: "M8 5h13",
|
|
51
|
+
key: "1pao27"
|
|
52
|
+
}],
|
|
53
|
+
["path", {
|
|
54
|
+
d: "M8 12h13",
|
|
55
|
+
key: "1za7za"
|
|
56
|
+
}],
|
|
57
|
+
["path", {
|
|
58
|
+
d: "M8 19h13",
|
|
59
|
+
key: "m83p4d"
|
|
60
|
+
}]
|
|
61
|
+
]), ne = l("remove-formatting", [
|
|
62
|
+
["path", {
|
|
63
|
+
d: "M4 7V4h16v3",
|
|
64
|
+
key: "9msm58"
|
|
65
|
+
}],
|
|
66
|
+
["path", {
|
|
67
|
+
d: "M5 20h6",
|
|
68
|
+
key: "1h6pxn"
|
|
69
|
+
}],
|
|
70
|
+
["path", {
|
|
71
|
+
d: "M13 4 8 20",
|
|
72
|
+
key: "kqq6aj"
|
|
73
|
+
}],
|
|
74
|
+
["path", {
|
|
75
|
+
d: "m15 15 5 5",
|
|
76
|
+
key: "me55sn"
|
|
77
|
+
}],
|
|
78
|
+
["path", {
|
|
79
|
+
d: "m20 15-5 5",
|
|
80
|
+
key: "11p7ol"
|
|
81
|
+
}]
|
|
82
|
+
]), W = l("smile", [
|
|
83
|
+
["circle", {
|
|
84
|
+
cx: "12",
|
|
85
|
+
cy: "12",
|
|
86
|
+
r: "10",
|
|
87
|
+
key: "1mglay"
|
|
88
|
+
}],
|
|
89
|
+
["path", {
|
|
90
|
+
d: "M8 14s1.5 2 4 2 4-2 4-2",
|
|
91
|
+
key: "1y1vjs"
|
|
92
|
+
}],
|
|
93
|
+
["line", {
|
|
94
|
+
x1: "9",
|
|
95
|
+
x2: "9.01",
|
|
96
|
+
y1: "9",
|
|
97
|
+
y2: "9",
|
|
98
|
+
key: "yxxnd0"
|
|
99
|
+
}],
|
|
100
|
+
["line", {
|
|
101
|
+
x1: "15",
|
|
102
|
+
x2: "15.01",
|
|
103
|
+
y1: "9",
|
|
104
|
+
y2: "9",
|
|
105
|
+
key: "1p4y9e"
|
|
106
|
+
}]
|
|
107
|
+
]), re = l("strikethrough", [
|
|
108
|
+
["path", {
|
|
109
|
+
d: "M16 4H9a3 3 0 0 0-2.83 4",
|
|
110
|
+
key: "43sutm"
|
|
111
|
+
}],
|
|
112
|
+
["path", {
|
|
113
|
+
d: "M14 12a4 4 0 0 1 0 8H6",
|
|
114
|
+
key: "nlfj13"
|
|
115
|
+
}],
|
|
116
|
+
["line", {
|
|
117
|
+
x1: "4",
|
|
118
|
+
x2: "20",
|
|
119
|
+
y1: "12",
|
|
120
|
+
y2: "12",
|
|
121
|
+
key: "1e0a9i"
|
|
122
|
+
}]
|
|
123
|
+
]), ie = l("subscript", [
|
|
124
|
+
["path", {
|
|
125
|
+
d: "m4 5 8 8",
|
|
126
|
+
key: "1eunvl"
|
|
127
|
+
}],
|
|
128
|
+
["path", {
|
|
129
|
+
d: "m12 5-8 8",
|
|
130
|
+
key: "1ah0jp"
|
|
131
|
+
}],
|
|
132
|
+
["path", {
|
|
133
|
+
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",
|
|
134
|
+
key: "e8ta8j"
|
|
135
|
+
}]
|
|
136
|
+
]), ae = l("superscript", [
|
|
137
|
+
["path", {
|
|
138
|
+
d: "m4 19 8-8",
|
|
139
|
+
key: "hr47gm"
|
|
140
|
+
}],
|
|
141
|
+
["path", {
|
|
142
|
+
d: "m12 19-8-8",
|
|
143
|
+
key: "1dhhmo"
|
|
144
|
+
}],
|
|
145
|
+
["path", {
|
|
146
|
+
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",
|
|
147
|
+
key: "1dfcux"
|
|
148
|
+
}]
|
|
149
|
+
]), oe = l("underline", [["path", {
|
|
150
|
+
d: "M6 4v6a6 6 0 0 0 12 0V4",
|
|
151
|
+
key: "9kb039"
|
|
152
|
+
}], ["line", {
|
|
153
|
+
x1: "4",
|
|
154
|
+
x2: "20",
|
|
155
|
+
y1: "20",
|
|
156
|
+
y2: "20",
|
|
157
|
+
key: "nun2al"
|
|
158
|
+
}]]), G = [
|
|
159
|
+
"aria-label",
|
|
160
|
+
"title",
|
|
161
|
+
"aria-expanded"
|
|
162
|
+
], K = ["aria-label"], q = { class: "tpl:mb-1.5 tpl:text-[10px] tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase" }, J = { class: "tpl:grid tpl:grid-cols-10 tpl:gap-0.5" }, Y = ["aria-label", "onClick"], se = /* @__PURE__ */ j({
|
|
163
|
+
__name: "EmojiPickerDropdown",
|
|
164
|
+
emits: ["insert"],
|
|
165
|
+
setup(t, { emit: i }) {
|
|
166
|
+
let a = i, { categories: o, isOpen: s, toggle: l, close: u } = e(), { t: d, format: f } = c(), p = L(null), m = L(null);
|
|
167
|
+
n(p, T(() => s.value)), r(m, () => {
|
|
168
|
+
s.value && u();
|
|
169
|
+
});
|
|
170
|
+
function h(e) {
|
|
171
|
+
a("insert", e), u();
|
|
172
|
+
}
|
|
173
|
+
return (e, t) => (I(), D("div", {
|
|
174
|
+
ref_key: "rootRef",
|
|
175
|
+
ref: m,
|
|
176
|
+
class: "tpl:relative"
|
|
177
|
+
}, [O("button", {
|
|
178
|
+
type: "button",
|
|
179
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": B(s) }]),
|
|
180
|
+
"aria-label": B(d).paragraphEditor.insertEmoji,
|
|
181
|
+
title: B(d).paragraphEditor.insertEmoji,
|
|
182
|
+
"aria-expanded": B(s),
|
|
183
|
+
"aria-haspopup": "dialog",
|
|
184
|
+
"aria-controls": "tpl-emoji-picker",
|
|
185
|
+
onClick: t[0] ||= (...e) => B(l) && B(l)(...e)
|
|
186
|
+
}, [A(B(W), {
|
|
187
|
+
size: 16,
|
|
188
|
+
"stroke-width": 2
|
|
189
|
+
})], 10, G), B(s) ? (I(), D("div", {
|
|
190
|
+
key: 0,
|
|
191
|
+
id: "tpl-emoji-picker",
|
|
192
|
+
ref_key: "pickerRef",
|
|
193
|
+
ref: p,
|
|
194
|
+
role: "dialog",
|
|
195
|
+
"aria-modal": "false",
|
|
196
|
+
"aria-label": B(d).paragraphEditor.insertEmoji,
|
|
197
|
+
tabindex: "-1",
|
|
198
|
+
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",
|
|
199
|
+
onKeydown: t[1] ||= V(H((...e) => B(u) && B(u)(...e), ["stop", "prevent"]), ["esc"])
|
|
200
|
+
}, [(I(!0), D(C, null, R(B(o), (e) => (I(), D("div", {
|
|
201
|
+
key: e.key,
|
|
202
|
+
class: "tpl:mb-2 tpl:last:mb-0"
|
|
203
|
+
}, [O("div", q, z(B(d).emoji[e.key]), 1), O("div", J, [(I(!0), D(C, null, R(e.emojis, (e) => (I(), D("button", {
|
|
204
|
+
key: e,
|
|
205
|
+
type: "button",
|
|
206
|
+
"aria-label": B(f)(B(d).paragraphEditor.emojiItemLabel, { emoji: e }),
|
|
207
|
+
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)]",
|
|
208
|
+
onClick: (t) => h(e)
|
|
209
|
+
}, z(e), 9, Y))), 128))])]))), 128))], 40, K)) : E("", !0)], 512));
|
|
210
|
+
}
|
|
211
|
+
}), ce = ["data-tpl-theme", "aria-label"], le = { class: "tpl:flex tpl:items-center tpl:gap-1" }, ue = [
|
|
212
|
+
"value",
|
|
213
|
+
"aria-label",
|
|
214
|
+
"title"
|
|
215
|
+
], de = { value: "" }, fe = ["value"], pe = [
|
|
216
|
+
"value",
|
|
217
|
+
"aria-label",
|
|
218
|
+
"title"
|
|
219
|
+
], me = { value: "" }, he = ["value"], ge = { class: "tpl:relative" }, _e = [
|
|
220
|
+
"value",
|
|
221
|
+
"aria-label",
|
|
222
|
+
"title"
|
|
223
|
+
], ve = { class: "tpl:relative" }, ye = [
|
|
224
|
+
"value",
|
|
225
|
+
"aria-label",
|
|
226
|
+
"title"
|
|
227
|
+
], be = ["aria-label", "title"], xe = ["aria-label", "title"], Se = ["aria-label", "title"], Ce = ["aria-label", "title"], we = ["aria-label", "title"], Te = ["aria-label", "title"], Ee = ["aria-label", "title"], De = { class: "tpl:flex tpl:items-center tpl:gap-1" }, Oe = ["aria-label", "title"], ke = ["aria-label", "title"], Ae = ["aria-label", "title"], X = ["aria-label", "title"], je = ["aria-label", "title"], Me = ["value", "title"], Ne = ["value"], Pe = ["value", "title"], Fe = ["value"], Ie = ["aria-label", "title"], Le = {
|
|
228
|
+
key: 0,
|
|
229
|
+
class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]"
|
|
230
|
+
}, Re = ["aria-label", "title"], ze = {
|
|
231
|
+
key: 1,
|
|
232
|
+
class: "tpl:flex tpl:items-center tpl:gap-2 tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
233
|
+
}, Z = /* @__PURE__ */ j({
|
|
234
|
+
__name: "ParagraphToolbar",
|
|
235
|
+
props: {
|
|
236
|
+
editor: {},
|
|
237
|
+
toolbarPosition: {},
|
|
238
|
+
isLoading: { type: Boolean },
|
|
239
|
+
mergeTagEnabled: { type: Boolean }
|
|
240
|
+
},
|
|
241
|
+
emits: ["open-link-dialog", "add-merge-tag"],
|
|
242
|
+
setup(e, { emit: t }) {
|
|
243
|
+
let n = e, r = t, l = M(i, null), f = M(s, null), m = a(o, "ParagraphToolbar"), { t: T } = c(), j = m.fonts;
|
|
244
|
+
function N(e) {
|
|
245
|
+
n.editor?.chain().focus().insertContent(e).run();
|
|
246
|
+
}
|
|
247
|
+
function L() {
|
|
248
|
+
return n.editor?.getAttributes("textStyle").fontFamily || "";
|
|
249
|
+
}
|
|
250
|
+
function V() {
|
|
251
|
+
return n.editor?.getAttributes("textStyle").fontSize || "";
|
|
252
|
+
}
|
|
253
|
+
function H() {
|
|
254
|
+
return n.editor?.getAttributes("textStyle").color || "";
|
|
255
|
+
}
|
|
256
|
+
function W(e) {
|
|
257
|
+
e ? n.editor?.chain().focus().setFontFamily(e).run() : n.editor?.chain().focus().unsetFontFamily().run();
|
|
258
|
+
}
|
|
259
|
+
function G(e) {
|
|
260
|
+
e ? n.editor?.chain().focus().setFontSize(e).run() : n.editor?.chain().focus().unsetFontSize().run();
|
|
261
|
+
}
|
|
262
|
+
function K(e) {
|
|
263
|
+
e ? n.editor?.chain().focus().setColor(e).run() : n.editor?.chain().focus().unsetColor().run();
|
|
264
|
+
}
|
|
265
|
+
function q() {
|
|
266
|
+
return n.editor?.getAttributes("paragraph").lineHeight || "";
|
|
267
|
+
}
|
|
268
|
+
function J(e) {
|
|
269
|
+
e ? n.editor?.chain().focus().setLineHeight(e).run() : n.editor?.chain().focus().unsetLineHeight().run();
|
|
270
|
+
}
|
|
271
|
+
function Y() {
|
|
272
|
+
return n.editor?.getAttributes("textStyle").letterSpacing || "";
|
|
273
|
+
}
|
|
274
|
+
function Z(e) {
|
|
275
|
+
e && e !== "normal" ? n.editor?.chain().focus().setLetterSpacing(e).run() : n.editor?.chain().focus().unsetLetterSpacing().run();
|
|
276
|
+
}
|
|
277
|
+
function Q() {
|
|
278
|
+
return n.editor?.getAttributes("highlight").color || "";
|
|
279
|
+
}
|
|
280
|
+
function $(e) {
|
|
281
|
+
e ? n.editor?.chain().focus().setHighlight({ color: e }).run() : n.editor?.chain().focus().unsetHighlight().run();
|
|
282
|
+
}
|
|
283
|
+
return (t, n) => (I(), ee(w, { to: "body" }, [O("div", {
|
|
284
|
+
"data-tpl-theme": B(f),
|
|
285
|
+
role: "toolbar",
|
|
286
|
+
"aria-label": B(T).paragraphEditor.toolbar,
|
|
287
|
+
class: "tpl tpl-text-toolbar tpl:fixed tpl:z-popover tpl:flex 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",
|
|
288
|
+
style: F({
|
|
289
|
+
...B(l),
|
|
290
|
+
top: `${e.toolbarPosition.top}px`,
|
|
291
|
+
left: `${e.toolbarPosition.left}px`,
|
|
292
|
+
transform: "translateY(-100%)",
|
|
293
|
+
flexDirection: "column"
|
|
294
|
+
})
|
|
295
|
+
}, [!e.isLoading && e.editor ? (I(), D(C, { key: 0 }, [O("div", le, [
|
|
296
|
+
O("select", {
|
|
297
|
+
class: "tpl:h-8 tpl:w-32 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none",
|
|
298
|
+
value: L(),
|
|
299
|
+
"aria-label": B(T).paragraphEditor.fontFamily,
|
|
300
|
+
title: B(T).paragraphEditor.fontFamily,
|
|
301
|
+
onChange: n[0] ||= (e) => W(e.target.value)
|
|
302
|
+
}, [O("option", de, z(B(T).paragraphEditor.defaultFont), 1), (I(!0), D(C, null, R(B(j), (e) => (I(), D("option", {
|
|
303
|
+
key: e.value,
|
|
304
|
+
value: e.value
|
|
305
|
+
}, z(e.label), 9, fe))), 128))], 40, ue),
|
|
306
|
+
O("select", {
|
|
307
|
+
class: "tpl:h-8 tpl:w-20 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none",
|
|
308
|
+
value: V(),
|
|
309
|
+
"aria-label": B(T).paragraphEditor.fontSize,
|
|
310
|
+
title: B(T).paragraphEditor.fontSize,
|
|
311
|
+
onChange: n[1] ||= (e) => G(e.target.value)
|
|
312
|
+
}, [O("option", me, z(B(T).paragraphEditor.defaultSize), 1), (I(!0), D(C, null, R(B(v), (e) => (I(), D("option", {
|
|
313
|
+
key: e,
|
|
314
|
+
value: e
|
|
315
|
+
}, z(e), 9, he))), 128))], 40, pe),
|
|
316
|
+
n[20] ||= O("span", {
|
|
317
|
+
class: "tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
|
|
318
|
+
"aria-hidden": "true"
|
|
319
|
+
}, null, -1),
|
|
320
|
+
O("div", ge, [O("input", {
|
|
321
|
+
type: "color",
|
|
322
|
+
class: "tpl:size-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-1",
|
|
323
|
+
value: H() || B("#000000"),
|
|
324
|
+
"aria-label": B(T).paragraphEditor.textColor,
|
|
325
|
+
title: B(T).paragraphEditor.textColor,
|
|
326
|
+
onInput: n[2] ||= (e) => K(e.target.value)
|
|
327
|
+
}, null, 40, _e)]),
|
|
328
|
+
O("div", ve, [O("input", {
|
|
329
|
+
type: "color",
|
|
330
|
+
class: "tpl:size-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:p-1",
|
|
331
|
+
style: F({ backgroundColor: Q() || "var(--tpl-bg)" }),
|
|
332
|
+
value: Q() || B("#ffff00"),
|
|
333
|
+
"aria-label": B(T).paragraphEditor.highlightColor,
|
|
334
|
+
title: B(T).paragraphEditor.highlightColor,
|
|
335
|
+
onInput: n[3] ||= (e) => $(e.target.value)
|
|
336
|
+
}, null, 44, ye)]),
|
|
337
|
+
n[21] ||= O("span", {
|
|
338
|
+
class: "tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
|
|
339
|
+
"aria-hidden": "true"
|
|
340
|
+
}, null, -1),
|
|
341
|
+
O("button", {
|
|
342
|
+
type: "button",
|
|
343
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("bold") }]),
|
|
344
|
+
"aria-label": B(T).paragraphEditor.bold,
|
|
345
|
+
title: B(T).paragraphEditor.bold,
|
|
346
|
+
onClick: n[4] ||= (t) => e.editor?.chain().focus().toggleBold().run()
|
|
347
|
+
}, [A(B(u), {
|
|
348
|
+
size: 16,
|
|
349
|
+
"stroke-width": 2.5
|
|
350
|
+
})], 10, be),
|
|
351
|
+
O("button", {
|
|
352
|
+
type: "button",
|
|
353
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("italic") }]),
|
|
354
|
+
"aria-label": B(T).paragraphEditor.italic,
|
|
355
|
+
title: B(T).paragraphEditor.italic,
|
|
356
|
+
onClick: n[5] ||= (t) => e.editor?.chain().focus().toggleItalic().run()
|
|
357
|
+
}, [A(B(d), {
|
|
358
|
+
size: 16,
|
|
359
|
+
"stroke-width": 2
|
|
360
|
+
})], 10, xe),
|
|
361
|
+
O("button", {
|
|
362
|
+
type: "button",
|
|
363
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("underline") }]),
|
|
364
|
+
"aria-label": B(T).paragraphEditor.underline,
|
|
365
|
+
title: B(T).paragraphEditor.underline,
|
|
366
|
+
onClick: n[6] ||= (t) => e.editor?.chain().focus().toggleUnderline().run()
|
|
367
|
+
}, [A(B(oe), {
|
|
368
|
+
size: 16,
|
|
369
|
+
"stroke-width": 2
|
|
370
|
+
})], 10, Se),
|
|
371
|
+
O("button", {
|
|
372
|
+
type: "button",
|
|
373
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("strike") }]),
|
|
374
|
+
"aria-label": B(T).paragraphEditor.strikethrough,
|
|
375
|
+
title: B(T).paragraphEditor.strikethrough,
|
|
376
|
+
onClick: n[7] ||= (t) => e.editor?.chain().focus().toggleStrike().run()
|
|
377
|
+
}, [A(B(re), {
|
|
378
|
+
size: 16,
|
|
379
|
+
"stroke-width": 2
|
|
380
|
+
})], 10, Ce),
|
|
381
|
+
n[22] ||= O("span", {
|
|
382
|
+
class: "tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
|
|
383
|
+
"aria-hidden": "true"
|
|
384
|
+
}, null, -1),
|
|
385
|
+
O("button", {
|
|
386
|
+
type: "button",
|
|
387
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("subscript") }]),
|
|
388
|
+
"aria-label": B(T).paragraphEditor.subscript,
|
|
389
|
+
title: B(T).paragraphEditor.subscript,
|
|
390
|
+
onClick: n[8] ||= (t) => e.editor?.chain().focus().toggleSubscript().run()
|
|
391
|
+
}, [A(B(ie), {
|
|
392
|
+
size: 16,
|
|
393
|
+
"stroke-width": 2
|
|
394
|
+
})], 10, we),
|
|
395
|
+
O("button", {
|
|
396
|
+
type: "button",
|
|
397
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("superscript") }]),
|
|
398
|
+
"aria-label": B(T).paragraphEditor.superscript,
|
|
399
|
+
title: B(T).paragraphEditor.superscript,
|
|
400
|
+
onClick: n[9] ||= (t) => e.editor?.chain().focus().toggleSuperscript().run()
|
|
401
|
+
}, [A(B(ae), {
|
|
402
|
+
size: 16,
|
|
403
|
+
"stroke-width": 2
|
|
404
|
+
})], 10, Te),
|
|
405
|
+
n[23] ||= O("span", {
|
|
406
|
+
class: "tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
|
|
407
|
+
"aria-hidden": "true"
|
|
408
|
+
}, null, -1),
|
|
409
|
+
O("button", {
|
|
410
|
+
type: "button",
|
|
411
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("link") }]),
|
|
412
|
+
"aria-label": B(T).paragraphEditor.addLink,
|
|
413
|
+
title: B(T).paragraphEditor.addLink,
|
|
414
|
+
onClick: n[10] ||= (e) => r("open-link-dialog")
|
|
415
|
+
}, [A(B(p), {
|
|
416
|
+
size: 16,
|
|
417
|
+
"stroke-width": 2
|
|
418
|
+
})], 10, Ee)
|
|
419
|
+
]), O("div", De, [
|
|
420
|
+
O("button", {
|
|
421
|
+
type: "button",
|
|
422
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("bulletList") }]),
|
|
423
|
+
"aria-label": B(T).paragraphEditor.bulletList,
|
|
424
|
+
title: B(T).paragraphEditor.bulletList,
|
|
425
|
+
onClick: n[11] ||= (t) => e.editor?.chain().focus().toggleBulletList().run()
|
|
426
|
+
}, [A(B(te), {
|
|
427
|
+
size: 16,
|
|
428
|
+
"stroke-width": 2
|
|
429
|
+
})], 10, Oe),
|
|
430
|
+
O("button", {
|
|
431
|
+
type: "button",
|
|
432
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("orderedList") }]),
|
|
433
|
+
"aria-label": B(T).paragraphEditor.numberedList,
|
|
434
|
+
title: B(T).paragraphEditor.numberedList,
|
|
435
|
+
onClick: n[12] ||= (t) => e.editor?.chain().focus().toggleOrderedList().run()
|
|
436
|
+
}, [A(B(U), {
|
|
437
|
+
size: 16,
|
|
438
|
+
"stroke-width": 2
|
|
439
|
+
})], 10, ke),
|
|
440
|
+
n[26] ||= O("span", {
|
|
441
|
+
class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
|
|
442
|
+
"aria-hidden": "true"
|
|
443
|
+
}, null, -1),
|
|
444
|
+
O("button", {
|
|
445
|
+
type: "button",
|
|
446
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive({ textAlign: "left" }) }]),
|
|
447
|
+
"aria-label": B(T).paragraphEditor.alignLeft,
|
|
448
|
+
title: B(T).paragraphEditor.alignLeft,
|
|
449
|
+
onClick: n[13] ||= (t) => e.editor?.chain().focus().setTextAlign("left").run()
|
|
450
|
+
}, [A(B(b), {
|
|
451
|
+
size: 16,
|
|
452
|
+
"stroke-width": 2
|
|
453
|
+
})], 10, Ae),
|
|
454
|
+
O("button", {
|
|
455
|
+
type: "button",
|
|
456
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive({ textAlign: "center" }) }]),
|
|
457
|
+
"aria-label": B(T).paragraphEditor.alignCenter,
|
|
458
|
+
title: B(T).paragraphEditor.alignCenter,
|
|
459
|
+
onClick: n[14] ||= (t) => e.editor?.chain().focus().setTextAlign("center").run()
|
|
460
|
+
}, [A(B(_), {
|
|
461
|
+
size: 16,
|
|
462
|
+
"stroke-width": 2
|
|
463
|
+
})], 10, X),
|
|
464
|
+
O("button", {
|
|
465
|
+
type: "button",
|
|
466
|
+
class: P(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive({ textAlign: "right" }) }]),
|
|
467
|
+
"aria-label": B(T).paragraphEditor.alignRight,
|
|
468
|
+
title: B(T).paragraphEditor.alignRight,
|
|
469
|
+
onClick: n[15] ||= (t) => e.editor?.chain().focus().setTextAlign("right").run()
|
|
470
|
+
}, [A(B(y), {
|
|
471
|
+
size: 16,
|
|
472
|
+
"stroke-width": 2
|
|
473
|
+
})], 10, je),
|
|
474
|
+
n[27] ||= O("span", {
|
|
475
|
+
class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
|
|
476
|
+
"aria-hidden": "true"
|
|
477
|
+
}, null, -1),
|
|
478
|
+
O("select", {
|
|
479
|
+
class: "tpl:h-8 tpl:w-16 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-1 tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none",
|
|
480
|
+
value: q(),
|
|
481
|
+
title: B(T).paragraphEditor.lineHeight,
|
|
482
|
+
onChange: n[16] ||= (e) => J(e.target.value)
|
|
483
|
+
}, [n[24] ||= O("option", { value: "" }, "LH", -1), (I(!0), D(C, null, R(B(S), (e) => (I(), D("option", {
|
|
484
|
+
key: e,
|
|
485
|
+
value: e
|
|
486
|
+
}, z(e), 9, Ne))), 128))], 40, Me),
|
|
487
|
+
O("select", {
|
|
488
|
+
class: "tpl:h-8 tpl:w-20 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-1 tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none",
|
|
489
|
+
value: Y(),
|
|
490
|
+
title: B(T).paragraphEditor.letterSpacing,
|
|
491
|
+
onChange: n[17] ||= (e) => Z(e.target.value)
|
|
492
|
+
}, [n[25] ||= O("option", { value: "" }, "LS", -1), (I(!0), D(C, null, R(B(x), (e) => (I(), D("option", {
|
|
493
|
+
key: e.value,
|
|
494
|
+
value: e.value
|
|
495
|
+
}, z(e.label), 9, Fe))), 128))], 40, Pe),
|
|
496
|
+
n[28] ||= O("span", {
|
|
497
|
+
class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
|
|
498
|
+
"aria-hidden": "true"
|
|
499
|
+
}, null, -1),
|
|
500
|
+
O("button", {
|
|
501
|
+
type: "button",
|
|
502
|
+
class: "tpl-text-toolbar-btn",
|
|
503
|
+
"aria-label": B(T).paragraphEditor.clearFormatting,
|
|
504
|
+
title: B(T).paragraphEditor.clearFormatting,
|
|
505
|
+
onClick: n[18] ||= (t) => e.editor?.chain().focus().clearNodes().unsetAllMarks().run()
|
|
506
|
+
}, [A(B(ne), {
|
|
507
|
+
size: 16,
|
|
508
|
+
"stroke-width": 2
|
|
509
|
+
})], 8, Ie),
|
|
510
|
+
n[29] ||= O("span", {
|
|
511
|
+
class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
|
|
512
|
+
"aria-hidden": "true"
|
|
513
|
+
}, null, -1),
|
|
514
|
+
A(se, { onInsert: N }),
|
|
515
|
+
e.mergeTagEnabled ? (I(), D("span", Le)) : E("", !0),
|
|
516
|
+
e.mergeTagEnabled ? (I(), D("button", {
|
|
517
|
+
key: 1,
|
|
518
|
+
type: "button",
|
|
519
|
+
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)]",
|
|
520
|
+
"aria-label": B(T).mergeTag.add,
|
|
521
|
+
title: B(T).mergeTag.add,
|
|
522
|
+
onClick: n[19] ||= (e) => r("add-merge-tag")
|
|
523
|
+
}, [A(B(g), {
|
|
524
|
+
size: 16,
|
|
525
|
+
"stroke-width": 2
|
|
526
|
+
}), k(" " + z(B(T).mergeTag.add), 1)], 8, Re)) : E("", !0)
|
|
527
|
+
])], 64)) : (I(), D("div", ze, [A(B(h), {
|
|
528
|
+
class: "tpl-spinner",
|
|
529
|
+
size: 14,
|
|
530
|
+
"stroke-width": 2
|
|
531
|
+
}), k(" " + z(B(T).errors.editorLoading), 1)]))], 12, ce)]));
|
|
532
|
+
}
|
|
533
|
+
}), Q = { class: "tpl-text-editor-wrapper tpl:relative" }, $ = /* @__PURE__ */ j({
|
|
534
|
+
__name: "ParagraphEditor",
|
|
535
|
+
props: {
|
|
536
|
+
block: {},
|
|
537
|
+
toolbarPosition: {}
|
|
538
|
+
},
|
|
539
|
+
emits: ["done"],
|
|
540
|
+
setup(e, { emit: n }) {
|
|
541
|
+
let r = e, i = n, { editor: a, EditorContent: o, isLoading: s, initError: c, retry: l, showLinkDialog: u, linkUrl: d, linkDialogRef: p, mergeTagEnabled: h, openLinkDialog: g, insertLink: _, removeLink: v, closeLinkDialog: y, handleLinkKeydown: b, handleAddMergeTag: x } = t({
|
|
542
|
+
blockId: () => r.block.id,
|
|
543
|
+
blockContent: () => r.block.content,
|
|
544
|
+
onDone: () => i("done"),
|
|
545
|
+
editorName: "ParagraphEditor",
|
|
546
|
+
async loadExtensions({ mergeTags: e, syntax: t }) {
|
|
547
|
+
let [{ Editor: n, EditorContent: r }, { default: i }, { default: a }, { default: o }, { default: s }, { default: c }, { default: l }, { TextStyle: u }, { default: d }, { default: f }, { default: p }, { MergeTagNode: m, LogicMergeTagNode: h, FontSize: g, LineHeight: _, LetterSpacing: v }] = await Promise.all([
|
|
548
|
+
import("./dist-BkIys9zn.js").then((e) => e.r),
|
|
549
|
+
import("./dist-DysAFIPy.js"),
|
|
550
|
+
import("./dist-Bu7veieH.js"),
|
|
551
|
+
import("./dist-C1BIRHCQ.js"),
|
|
552
|
+
import("./dist-ChAGLpWo.js"),
|
|
553
|
+
import("./dist-4LiM9FDd.js"),
|
|
554
|
+
import("./dist-DrvKRSU6.js"),
|
|
555
|
+
import("./dist-D_HQYSY-.js"),
|
|
556
|
+
import("./dist-Dxnd0GRf.js"),
|
|
557
|
+
import("./dist-DkypH7qG.js"),
|
|
558
|
+
import("./dist-DmOE-Ubp.js"),
|
|
559
|
+
import("./extensions-DEjfEFhD.js")
|
|
560
|
+
]);
|
|
561
|
+
return {
|
|
562
|
+
TiptapEditor: n,
|
|
563
|
+
EC: r,
|
|
564
|
+
extensions: [
|
|
565
|
+
i.configure({
|
|
566
|
+
heading: !1,
|
|
567
|
+
codeBlock: !1,
|
|
568
|
+
blockquote: !1,
|
|
569
|
+
horizontalRule: !1
|
|
570
|
+
}),
|
|
571
|
+
o,
|
|
572
|
+
s,
|
|
573
|
+
c,
|
|
574
|
+
a.configure({
|
|
575
|
+
openOnClick: !1,
|
|
576
|
+
HTMLAttributes: {
|
|
577
|
+
target: "_blank",
|
|
578
|
+
rel: "noopener noreferrer"
|
|
579
|
+
}
|
|
580
|
+
}),
|
|
581
|
+
l.configure({ types: ["paragraph"] }),
|
|
582
|
+
u,
|
|
583
|
+
d,
|
|
584
|
+
f,
|
|
585
|
+
p.configure({ multicolor: !0 }),
|
|
586
|
+
g,
|
|
587
|
+
_,
|
|
588
|
+
v,
|
|
589
|
+
m.configure({
|
|
590
|
+
mergeTags: e,
|
|
591
|
+
syntax: t
|
|
592
|
+
}),
|
|
593
|
+
h.configure({ syntax: t })
|
|
594
|
+
]
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
return (t, n) => (I(), D("div", Q, [
|
|
599
|
+
A(Z, {
|
|
600
|
+
editor: B(a),
|
|
601
|
+
"toolbar-position": e.toolbarPosition,
|
|
602
|
+
"is-loading": B(s),
|
|
603
|
+
"merge-tag-enabled": B(h),
|
|
604
|
+
onOpenLinkDialog: B(g),
|
|
605
|
+
onAddMergeTag: B(x)
|
|
606
|
+
}, null, 8, [
|
|
607
|
+
"editor",
|
|
608
|
+
"toolbar-position",
|
|
609
|
+
"is-loading",
|
|
610
|
+
"merge-tag-enabled",
|
|
611
|
+
"onOpenLinkDialog",
|
|
612
|
+
"onAddMergeTag"
|
|
613
|
+
]),
|
|
614
|
+
A(m, {
|
|
615
|
+
editor: B(a),
|
|
616
|
+
"editor-content": B(o),
|
|
617
|
+
"is-loading": B(s),
|
|
618
|
+
"init-error": B(c),
|
|
619
|
+
onRetry: B(l)
|
|
620
|
+
}, null, 8, [
|
|
621
|
+
"editor",
|
|
622
|
+
"editor-content",
|
|
623
|
+
"is-loading",
|
|
624
|
+
"init-error",
|
|
625
|
+
"onRetry"
|
|
626
|
+
]),
|
|
627
|
+
A(f, {
|
|
628
|
+
visible: B(u),
|
|
629
|
+
"is-editing-link": B(a)?.isActive("link") ?? !1,
|
|
630
|
+
"dialog-ref": B(p),
|
|
631
|
+
"onUpdate:dialogRef": n[0] ||= (e) => N(p) ? p.value = e : null,
|
|
632
|
+
"link-url": B(d),
|
|
633
|
+
"onUpdate:linkUrl": n[1] ||= (e) => N(d) ? d.value = e : null,
|
|
634
|
+
onClose: B(y),
|
|
635
|
+
onInsert: B(_),
|
|
636
|
+
onRemove: B(v),
|
|
637
|
+
onKeydown: B(b)
|
|
638
|
+
}, null, 8, [
|
|
639
|
+
"visible",
|
|
640
|
+
"is-editing-link",
|
|
641
|
+
"dialog-ref",
|
|
642
|
+
"link-url",
|
|
643
|
+
"onClose",
|
|
644
|
+
"onInsert",
|
|
645
|
+
"onRemove",
|
|
646
|
+
"onKeydown"
|
|
647
|
+
])
|
|
648
|
+
]));
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
//#endregion
|
|
652
|
+
export { $ as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as n } from "./useI18n-
|
|
1
|
+
import { S as e, w as t } from "./keys-C0MQRs8d.js";
|
|
2
|
+
import { t as n } from "./useI18n-D6m7ZUgY.js";
|
|
3
3
|
import { n as r } from "./_plugin-vue_export-helper-B1-bu7yR.js";
|
|
4
4
|
import { t as i } from "./x-CGlq2XQe.js";
|
|
5
5
|
import { Teleport as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, inject as p, mergeModels as m, normalizeStyle as h, openBlock as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, useModel as b, vModelText as x, withDirectives as S, withModifiers as C } from "vue";
|
|
@@ -37,7 +37,10 @@ var w = r("bold", [["path", {
|
|
|
37
37
|
}]]), D = ["data-tpl-theme"], O = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-5 tpl:py-4" }, k = {
|
|
38
38
|
id: "tpl-link-dialog-title",
|
|
39
39
|
class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
40
|
-
}, A = ["aria-label"], j = { class: "tpl:p-5" }, M = { class: "tpl:mb-4 tpl:last:mb-0" }, N = {
|
|
40
|
+
}, A = ["aria-label"], j = { class: "tpl:p-5" }, M = { class: "tpl:mb-4 tpl:last:mb-0" }, N = {
|
|
41
|
+
for: "tpl-link-dialog-url",
|
|
42
|
+
class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase"
|
|
43
|
+
}, P = ["placeholder"], F = { 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" }, I = { class: "tpl:ml-auto tpl:flex tpl:gap-2" }, L = /* @__PURE__ */ f({
|
|
41
44
|
__name: "RichTextLinkDialog",
|
|
42
45
|
props: /* @__PURE__ */ m({
|
|
43
46
|
visible: { type: Boolean },
|
|
@@ -55,7 +58,7 @@ var w = r("bold", [["path", {
|
|
|
55
58
|
"keydown"
|
|
56
59
|
], ["update:linkUrl", "update:dialogRef"]),
|
|
57
60
|
setup(r, { emit: u }) {
|
|
58
|
-
let f = b(r, "linkUrl"), m = b(r, "dialogRef"), _ = u, w = p(
|
|
61
|
+
let f = b(r, "linkUrl"), m = b(r, "dialogRef"), _ = u, w = p(e, null), T = p(t, null), { t: E } = n();
|
|
59
62
|
return (e, t) => (g(), o(a, { to: "body" }, [r.visible ? (g(), c("div", {
|
|
60
63
|
key: 0,
|
|
61
64
|
"data-tpl-theme": y(T),
|
|
@@ -79,6 +82,7 @@ var w = r("bold", [["path", {
|
|
|
79
82
|
"stroke-width": 2
|
|
80
83
|
})], 8, A)]),
|
|
81
84
|
l("div", j, [l("div", M, [l("label", N, v(y(E).linkDialog.urlLabel), 1), S(l("input", {
|
|
85
|
+
id: "tpl-link-dialog-url",
|
|
82
86
|
"onUpdate:modelValue": t[1] ||= (e) => f.value = e,
|
|
83
87
|
type: "url",
|
|
84
88
|
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)]",
|