@juit/vue-tiny-editor 1.0.47 → 1.0.49
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/index.js +391 -410
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- /package/dist/{style.css → index.css} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
2
|
-
function ie(
|
|
3
|
-
return
|
|
1
|
+
import { createElementBlock as y, openBlock as w, createElementVNode as b, defineComponent as Ge, mergeModels as Xe, useModel as Je, watch as N, shallowRef as q, ref as T, computed as _, onMounted as Qe, nextTick as Oe, onUnmounted as Ye, normalizeClass as j, createCommentVNode as me, Fragment as Ze, renderList as et, createTextVNode as tt, toDisplayString as z, createVNode as H, withDirectives as je, unref as $, vModelText as Le, createBlock as nt } from "vue";
|
|
2
|
+
function ie(t, e) {
|
|
3
|
+
return t instanceof Node && (t = F(t)), t.isPointInRange(e.startContainer, e.startOffset) && t.isPointInRange(e.endContainer, e.endOffset) ? e : null;
|
|
4
4
|
}
|
|
5
|
-
function ot(
|
|
5
|
+
function ot(t) {
|
|
6
6
|
const e = document.createRange();
|
|
7
|
-
return e.selectNode(
|
|
7
|
+
return e.selectNode(t), e;
|
|
8
8
|
}
|
|
9
|
-
function F(
|
|
9
|
+
function F(t) {
|
|
10
10
|
const e = document.createRange();
|
|
11
|
-
return e.selectNodeContents(
|
|
11
|
+
return e.selectNodeContents(t), e;
|
|
12
12
|
}
|
|
13
|
-
function Ce(
|
|
14
|
-
if (!F(
|
|
13
|
+
function Ce(t, e, l) {
|
|
14
|
+
if (!F(t).isPointInRange(e, l))
|
|
15
15
|
throw new Error("Range out of bounds");
|
|
16
|
-
const
|
|
17
|
-
return
|
|
16
|
+
const o = document.createRange();
|
|
17
|
+
return o.setStart(t, 0), o.setEnd(e, l), o.toString();
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function U(t, e) {
|
|
20
20
|
const l = { start: 0, end: 0, backwards: e.backwards };
|
|
21
|
-
return l.start = l.end = Ce(
|
|
21
|
+
return l.start = l.end = Ce(t, e.startContainer, e.startOffset).length, e.collapsed || (l.end = Ce(t, e.endContainer, e.endOffset).length), l;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
const l = F(
|
|
23
|
+
function V(t, e) {
|
|
24
|
+
const l = F(t);
|
|
25
25
|
e.backwards && (l.backwards = !0);
|
|
26
|
-
let { start: s, end:
|
|
27
|
-
const
|
|
28
|
-
for (let
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
if (s >= 0 && s <
|
|
32
|
-
return
|
|
33
|
-
if (
|
|
34
|
-
return f = "extra", l.setStart(
|
|
35
|
-
s -=
|
|
26
|
+
let { start: s, end: o } = e, i = null, a = null, f = !1, c = !1;
|
|
27
|
+
const m = document.createNodeIterator(t, NodeFilter.SHOW_TEXT);
|
|
28
|
+
for (let p = m.nextNode(); p && (s >= 0 || o > 0); p = m.nextNode()) {
|
|
29
|
+
i || (i = p), a = p;
|
|
30
|
+
const d = p.nodeValue.length;
|
|
31
|
+
if (s >= 0 && s < d && (f = !0, l.setStart(p, s), s === o))
|
|
32
|
+
return c = "extra", l.setEnd(p, o), l;
|
|
33
|
+
if (o > 0 && o <= d && (c = !0, l.setEnd(p, o), o === s))
|
|
34
|
+
return f = "extra", l.setStart(p, s), l;
|
|
35
|
+
s -= d, o -= d;
|
|
36
36
|
}
|
|
37
|
-
return !f &&
|
|
37
|
+
return !f && i && l.setStart(i, 0), !c && a && l.setEnd(a, a.length), l;
|
|
38
38
|
}
|
|
39
39
|
const rt = /* @__PURE__ */ new Set([
|
|
40
40
|
"button",
|
|
@@ -48,178 +48,174 @@ const rt = /* @__PURE__ */ new Set([
|
|
|
48
48
|
"style",
|
|
49
49
|
"textarea"
|
|
50
50
|
]);
|
|
51
|
-
function Me(
|
|
52
|
-
if (!
|
|
51
|
+
function Me(t) {
|
|
52
|
+
if (!t || !t.match(/^https?:\/\/[^\s]+$/)) return null;
|
|
53
53
|
try {
|
|
54
|
-
return new URL(
|
|
54
|
+
return new URL(t).href;
|
|
55
55
|
} catch {
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function De(
|
|
60
|
-
if (l) return
|
|
59
|
+
function De(t, e, l = !1) {
|
|
60
|
+
if (l) return t;
|
|
61
61
|
const s = document.createElement(e);
|
|
62
|
-
return s.append(
|
|
62
|
+
return s.append(t), s;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
var s;
|
|
64
|
+
function Y(t, e = {}) {
|
|
66
65
|
const l = document.createDocumentFragment();
|
|
67
|
-
for (const
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
else if (
|
|
71
|
-
const
|
|
72
|
-
if (rt.has(
|
|
73
|
-
const
|
|
66
|
+
for (const s of t.childNodes)
|
|
67
|
+
if (s.nodeType === Node.TEXT_NODE)
|
|
68
|
+
s.nodeValue && l.append(s.cloneNode());
|
|
69
|
+
else if (s.nodeType === Node.ELEMENT_NODE) {
|
|
70
|
+
const o = s, i = o.tagName.toLowerCase();
|
|
71
|
+
if (rt.has(i)) continue;
|
|
72
|
+
const a = l.lastChild?.nodeType === Node.ELEMENT_NODE ? {
|
|
74
73
|
element: l.lastChild,
|
|
75
74
|
tagName: l.lastChild.tagName.toLowerCase()
|
|
76
|
-
} : null,
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
if (!
|
|
80
|
-
|
|
81
|
-
} else if (
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
84
|
-
|
|
85
|
-
} else if (
|
|
86
|
-
|
|
87
|
-
else if (
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
} else if (
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
if (!(
|
|
95
|
-
const
|
|
96
|
-
|
|
75
|
+
} : null, f = document.createDocumentFragment();
|
|
76
|
+
if (i === "b" || i === "strong") {
|
|
77
|
+
const c = Y(o, { ...e, bold: !0 });
|
|
78
|
+
if (!c.hasChildNodes()) continue;
|
|
79
|
+
a?.tagName === "b" ? a.element.append(c) : f.append(De(c, "b", e.bold));
|
|
80
|
+
} else if (i === "i" || i === "em") {
|
|
81
|
+
const c = Y(o, { ...e, italic: !0 });
|
|
82
|
+
if (!c.hasChildNodes()) continue;
|
|
83
|
+
a?.tagName === "i" ? a.element.append(c) : f.append(De(c, "i", e.italic));
|
|
84
|
+
} else if (i === "br")
|
|
85
|
+
f.append(document.createElement("br"));
|
|
86
|
+
else if (i === "div" || i === "p" || i === "pre" || i === "h1" || i === "h2" || i === "h3" || i === "h4" || i === "h5" || i === "h6" || i === "ul" || i === "ol" || i === "li") {
|
|
87
|
+
f.append(document.createElement("br"));
|
|
88
|
+
const c = Y(o, e);
|
|
89
|
+
c.hasChildNodes() && (f.append(c), f.append(document.createElement("br")));
|
|
90
|
+
} else if (i === "link") {
|
|
91
|
+
if (o.getAttribute("rel") !== "mention") continue;
|
|
92
|
+
const m = o.getAttribute("name"), p = o.getAttribute("title");
|
|
93
|
+
if (!(m && p)) continue;
|
|
94
|
+
const d = document.createElement("link");
|
|
95
|
+
d.setAttribute("rel", "mention"), d.setAttribute("title", p), d.setAttribute("name", m), f.append(d);
|
|
97
96
|
} else
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
f.append(Y(o, e));
|
|
98
|
+
f.hasChildNodes() && l.append(f);
|
|
100
99
|
}
|
|
101
100
|
return l;
|
|
102
101
|
}
|
|
103
|
-
function lt(
|
|
104
|
-
const e =
|
|
105
|
-
e.sort((s,
|
|
106
|
-
s.index <
|
|
102
|
+
function lt(t) {
|
|
103
|
+
const e = t.map((s, o) => ({ ...s, index: o }));
|
|
104
|
+
e.sort((s, o) => s.start < o.start ? -1 : s.start > o.start || s.end < o.end ? 1 : s.end > o.end || /* v8 ignore next 3 */
|
|
105
|
+
s.index < o.index ? -1 : s.index > o.index ? 1 : 0);
|
|
107
106
|
const l = /* @__PURE__ */ new Set();
|
|
108
107
|
for (let s = 0; s < e.length; s++) {
|
|
109
|
-
const
|
|
110
|
-
for (let
|
|
111
|
-
const a = e[
|
|
112
|
-
l.has(a) || (a.start === a.end || a.start >=
|
|
108
|
+
const o = e[s];
|
|
109
|
+
for (let i = s + 1; i < e.length; i++) {
|
|
110
|
+
const a = e[i];
|
|
111
|
+
l.has(a) || (a.start === a.end || a.start >= o.start && a.start < o.end || a.end >= o.start && a.end < o.end) && l.add(a);
|
|
113
112
|
}
|
|
114
113
|
}
|
|
115
|
-
return e.filter((s) => !l.has(s)).filter((s,
|
|
116
|
-
const a =
|
|
117
|
-
return
|
|
114
|
+
return e.filter((s) => !l.has(s)).filter((s, o, i) => {
|
|
115
|
+
const a = i[o - 1];
|
|
116
|
+
return a?.end === s.start && a.href === s.href ? (a.end = s.end, !1) : !0;
|
|
118
117
|
});
|
|
119
118
|
}
|
|
120
|
-
function st(
|
|
121
|
-
const e = [], l = /(https?:\/\/[^\s]+)/gm, s =
|
|
119
|
+
function st(t) {
|
|
120
|
+
const e = [], l = /(https?:\/\/[^\s]+)/gm, s = t.textContent;
|
|
122
121
|
for (let a = l.exec(s); a; a = l.exec(s)) {
|
|
123
|
-
const f = a[1],
|
|
124
|
-
|
|
122
|
+
const f = a[1], c = Me(f);
|
|
123
|
+
c && e.push({ start: a.index, end: a.index + f.length, href: c });
|
|
125
124
|
}
|
|
126
|
-
const
|
|
127
|
-
for (let a =
|
|
128
|
-
const f = a,
|
|
129
|
-
if (
|
|
130
|
-
const
|
|
131
|
-
|
|
125
|
+
const o = [], i = document.createNodeIterator(t, NodeFilter.SHOW_ELEMENT, (a) => a.nodeName.toLowerCase() === "a" ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP);
|
|
126
|
+
for (let a = i.nextNode(); a; a = i.nextNode()) {
|
|
127
|
+
const f = a, c = Me(f.getAttribute("href"));
|
|
128
|
+
if (c) {
|
|
129
|
+
const m = F(f);
|
|
130
|
+
o.push({ ...U(t, m), href: c });
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
|
-
return lt([...e, ...
|
|
133
|
+
return lt([...e, ...o]);
|
|
135
134
|
}
|
|
136
|
-
function at(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
n.normalize(), n.hasChildNodes() || n.append(document.createElement("br"));
|
|
135
|
+
function at(t) {
|
|
136
|
+
t.normalize();
|
|
137
|
+
const e = document.createNodeIterator(t, NodeFilter.SHOW_ELEMENT);
|
|
138
|
+
for (let l = e.nextNode(); l; l = e.nextNode())
|
|
139
|
+
l !== t && l.nodeName.toLowerCase() !== "link" && (l.hasChildNodes() || (l.nodeName.toLowerCase() === "br" && l.parentNode.replaceChild(document.createTextNode(`
|
|
140
|
+
`), l), l.parentNode?.removeChild(l)));
|
|
141
|
+
t.normalize(), t.hasChildNodes() || t.append(document.createElement("br"));
|
|
144
142
|
}
|
|
145
|
-
function
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}), at(n), n;
|
|
143
|
+
function Z(t) {
|
|
144
|
+
if (t.innerHTML === "<br>") return t;
|
|
145
|
+
t.normalize();
|
|
146
|
+
const e = st(t), l = Y(t);
|
|
147
|
+
return l.lastChild?.nodeName.toLowerCase() === "link" && l.append(document.createTextNode(" ")), t.replaceChildren(l), e.forEach((s) => {
|
|
148
|
+
const o = V(t, s), i = o.extractContents(), a = document.createElement("a");
|
|
149
|
+
a.setAttribute("href", s.href), a.append(i), o.insertNode(a);
|
|
150
|
+
}), at(t), t;
|
|
154
151
|
}
|
|
155
|
-
function he(
|
|
156
|
-
var p, x;
|
|
152
|
+
function he(t, e, l) {
|
|
157
153
|
if (typeof l == "string") {
|
|
158
|
-
if (!ie(
|
|
159
|
-
const
|
|
160
|
-
l = document.createDocumentFragment(), l.append(...
|
|
154
|
+
if (!ie(t, e)) throw new Error("Range out of bounds");
|
|
155
|
+
const d = new DOMParser().parseFromString(l, "text/html").body;
|
|
156
|
+
l = document.createDocumentFragment(), l.append(...d.childNodes);
|
|
161
157
|
}
|
|
162
|
-
const s =
|
|
163
|
-
a.setStart(
|
|
158
|
+
const s = U(t, e), o = t.textContent?.length || 0, i = F(t), a = document.createRange();
|
|
159
|
+
a.setStart(i.startContainer, i.startOffset), a.setEnd(e.startContainer, e.startOffset);
|
|
164
160
|
const f = document.createRange();
|
|
165
|
-
f.setStart(e.endContainer, e.endOffset), f.setEnd(
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
return { ...s, end: s.end +
|
|
161
|
+
f.setStart(e.endContainer, e.endOffset), f.setEnd(i.endContainer, i.endOffset);
|
|
162
|
+
const c = a.extractContents(), m = f.extractContents();
|
|
163
|
+
t.replaceChildren(), t.append(c, l, m), Z(t);
|
|
164
|
+
const p = t.textContent?.length || 0;
|
|
165
|
+
return { ...s, end: s.end + p - o };
|
|
170
166
|
}
|
|
171
|
-
function xe(
|
|
167
|
+
function xe(t) {
|
|
172
168
|
const e = document.getSelection();
|
|
173
|
-
if (!
|
|
169
|
+
if (!e?.rangeCount) return null;
|
|
174
170
|
const l = e.getRangeAt(0);
|
|
175
|
-
if (!ie(
|
|
171
|
+
if (!ie(t, l)) return null;
|
|
176
172
|
const s = e.isCollapsed ? !1 : e.anchorNode === e.focusNode ? e.anchorOffset > e.focusOffset : e.anchorNode.compareDocumentPosition(e.focusNode) === Node.DOCUMENT_POSITION_PRECEDING;
|
|
177
173
|
return Object.assign(l, { backwards: s });
|
|
178
174
|
}
|
|
179
|
-
function ge(
|
|
180
|
-
const e = xe(
|
|
181
|
-
return e ?
|
|
175
|
+
function ge(t) {
|
|
176
|
+
const e = xe(t);
|
|
177
|
+
return e ? U(t, e) : null;
|
|
182
178
|
}
|
|
183
|
-
function be(
|
|
179
|
+
function be(t, e, l = !1) {
|
|
184
180
|
l && (e = { start: e.end, end: e.end });
|
|
185
|
-
const s =
|
|
186
|
-
return
|
|
181
|
+
const s = V(t, e), { startContainer: o, startOffset: i, endContainer: a, endOffset: f, backwards: c } = s, m = document.getSelection();
|
|
182
|
+
return m && (c ? m.setBaseAndExtent(a, f, o, i) : m.setBaseAndExtent(o, i, a, f)), s;
|
|
187
183
|
}
|
|
188
|
-
function ae(
|
|
189
|
-
const s = F(
|
|
190
|
-
if (!ie(
|
|
191
|
-
let
|
|
192
|
-
for (;
|
|
193
|
-
if (
|
|
194
|
-
return
|
|
195
|
-
|
|
184
|
+
function ae(t, e, l) {
|
|
185
|
+
const s = F(t);
|
|
186
|
+
if (!ie(t, e)) return null;
|
|
187
|
+
let o = e.commonAncestorContainer;
|
|
188
|
+
for (; o && s.intersectsNode(o); ) {
|
|
189
|
+
if (o.nodeType === Node.ELEMENT_NODE && o.nodeName.toLowerCase() === l)
|
|
190
|
+
return o;
|
|
191
|
+
o = o.parentNode;
|
|
196
192
|
}
|
|
197
193
|
return null;
|
|
198
194
|
}
|
|
199
|
-
function Be(
|
|
200
|
-
if (e.collapsed || !ie(
|
|
201
|
-
const
|
|
202
|
-
a.setStart(
|
|
195
|
+
function Be(t, e, l, s = {}) {
|
|
196
|
+
if (e.collapsed || !ie(t, e)) return;
|
|
197
|
+
const o = ae(t, e, l), i = o ? ot(o) : F(e.commonAncestorContainer), a = document.createRange();
|
|
198
|
+
a.setStart(i.startContainer, i.startOffset), a.setEnd(e.startContainer, e.startOffset);
|
|
203
199
|
const f = document.createRange();
|
|
204
|
-
f.setStart(e.endContainer, e.endOffset), f.setEnd(
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
|
|
200
|
+
f.setStart(e.endContainer, e.endOffset), f.setEnd(i.endContainer, i.endOffset);
|
|
201
|
+
const c = f.extractContents(), m = e.extractContents(), p = a.extractContents();
|
|
202
|
+
i.deleteContents();
|
|
203
|
+
const d = document.createDocumentFragment();
|
|
204
|
+
if (d.append(p), o)
|
|
205
|
+
d.append(m);
|
|
210
206
|
else {
|
|
211
|
-
const
|
|
212
|
-
Object.entries(s).forEach((
|
|
207
|
+
const k = document.createElement(l);
|
|
208
|
+
Object.entries(s).forEach((ee) => k.setAttribute(...ee)), k.append(m), d.append(k);
|
|
213
209
|
}
|
|
214
|
-
|
|
210
|
+
d.append(c), i.insertNode(d), Z(t);
|
|
215
211
|
}
|
|
216
212
|
const it = {
|
|
217
213
|
xmlns: "http://www.w3.org/2000/svg",
|
|
218
214
|
fill: "currentColor",
|
|
219
215
|
viewBox: "0 -960 960 960"
|
|
220
216
|
};
|
|
221
|
-
function ut(
|
|
222
|
-
return w(),
|
|
217
|
+
function ut(t, e) {
|
|
218
|
+
return w(), y("svg", it, [...e[0] || (e[0] = [
|
|
223
219
|
b("path", { d: "M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200zm121-112h104q48 0 58.5-24.5T566-372t-10.5-35.5T494-432H393zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95z" }, null, -1)
|
|
224
220
|
])]);
|
|
225
221
|
}
|
|
@@ -228,18 +224,18 @@ const ct = { render: ut }, dt = {
|
|
|
228
224
|
fill: "currentColor",
|
|
229
225
|
viewBox: "0 -960 960 960"
|
|
230
226
|
};
|
|
231
|
-
function ft(
|
|
232
|
-
return w(),
|
|
227
|
+
function ft(t, e) {
|
|
228
|
+
return w(), y("svg", dt, [...e[0] || (e[0] = [
|
|
233
229
|
b("path", { d: "M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100z" }, null, -1)
|
|
234
230
|
])]);
|
|
235
231
|
}
|
|
236
|
-
const
|
|
232
|
+
const pt = { render: ft }, vt = {
|
|
237
233
|
xmlns: "http://www.w3.org/2000/svg",
|
|
238
234
|
fill: "currentColor",
|
|
239
235
|
viewBox: "0 -960 960 960"
|
|
240
236
|
};
|
|
241
|
-
function mt(
|
|
242
|
-
return w(),
|
|
237
|
+
function mt(t, e) {
|
|
238
|
+
return w(), y("svg", vt, [...e[0] || (e[0] = [
|
|
243
239
|
b("path", { d: "M440-280H280q-83 0-141.5-58.5T80-480t58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85 35 85 85 35h160zM320-440v-80h320v80zm200 160v-80h160q50 0 85-35t35-85-35-85-85-35H520v-80h160q83 0 141.5 58.5T880-480t-58.5 141.5T680-280z" }, null, -1)
|
|
244
240
|
])]);
|
|
245
241
|
}
|
|
@@ -248,8 +244,8 @@ const qe = { render: mt }, ht = {
|
|
|
248
244
|
fill: "currentColor",
|
|
249
245
|
viewBox: "0 -960 960 960"
|
|
250
246
|
};
|
|
251
|
-
function gt(
|
|
252
|
-
return w(),
|
|
247
|
+
function gt(t, e) {
|
|
248
|
+
return w(), y("svg", ht, [...e[0] || (e[0] = [
|
|
253
249
|
b("path", { d: "M480-80q-83 0-156-31.5T197-197t-85.5-127T80-480t31.5-156T197-763t127-85.5T480-880t156 31.5T763-763t85.5 127T880-480v58q0 59-40.5 100.5T740-280q-35 0-66-15t-52-43q-29 29-65.5 43.5T480-280q-83 0-141.5-58.5T280-480t58.5-141.5T480-680t141.5 58.5T680-480v58q0 26 17 44t43 18 43-18 17-44v-58q0-134-93-227t-227-93-227 93-93 227 93 227 227 93h200v80zm0-280q50 0 85-35t35-85-35-85-85-35-85 35-35 85 35 85 85 35" }, null, -1)
|
|
254
250
|
])]);
|
|
255
251
|
}
|
|
@@ -258,22 +254,22 @@ const bt = { render: gt }, Ct = {
|
|
|
258
254
|
fill: "currentColor",
|
|
259
255
|
viewBox: "0 -960 960 960"
|
|
260
256
|
};
|
|
261
|
-
function xt(
|
|
262
|
-
return w(),
|
|
257
|
+
function xt(t, e) {
|
|
258
|
+
return w(), y("svg", Ct, [...e[0] || (e[0] = [
|
|
263
259
|
b("path", { d: "M792-443 176-183q-20 8-38-3.5T120-220v-520q0-22 18-33.5t38-3.5l616 260q25 11 25 37t-25 37M200-280l474-200-474-200v140l240 60-240 60zm0 0v-400z" }, null, -1)
|
|
264
260
|
])]);
|
|
265
261
|
}
|
|
266
|
-
const
|
|
262
|
+
const wt = { render: xt }, yt = {
|
|
267
263
|
xmlns: "http://www.w3.org/2000/svg",
|
|
268
264
|
fill: "currentColor",
|
|
269
265
|
viewBox: "0 -960 960 960"
|
|
270
266
|
};
|
|
271
|
-
function Nt(
|
|
272
|
-
return w(),
|
|
267
|
+
function Nt(t, e) {
|
|
268
|
+
return w(), y("svg", yt, [...e[0] || (e[0] = [
|
|
273
269
|
b("path", { d: "M280-160v-520H80v-120h520v120H400v520zm360 0v-320H520v-120h360v120H760v320z" }, null, -1)
|
|
274
270
|
])]);
|
|
275
271
|
}
|
|
276
|
-
const Tt = { render: Nt }, Et = ["onMousedown"],
|
|
272
|
+
const Tt = { render: Nt }, Et = ["onMousedown"], kt = { class: "-jte-mentions-entry" }, Rt = { class: "-jte-mentions-ref" }, St = {
|
|
277
273
|
key: 0,
|
|
278
274
|
class: "-jte-mentions-waiting"
|
|
279
275
|
}, Ot = {
|
|
@@ -331,352 +327,337 @@ const Tt = { render: Nt }, Et = ["onMousedown"], Rt = { class: "-jte-mentions-en
|
|
|
331
327
|
modelModifiers: {}
|
|
332
328
|
}),
|
|
333
329
|
emits: ["update:modelValue"],
|
|
334
|
-
setup(
|
|
335
|
-
const e = Je(
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
(t = s.value) == null || t.style.setProperty("color-scheme", o ? "dark light" : "light dark");
|
|
330
|
+
setup(t) {
|
|
331
|
+
const e = Je(t, "modelValue"), l = t;
|
|
332
|
+
N(() => l.dark, (r) => {
|
|
333
|
+
s.value?.style.setProperty("color-scheme", r ? "dark light" : "light dark");
|
|
339
334
|
});
|
|
340
|
-
const s = q(null),
|
|
341
|
-
|
|
342
|
-
return ((
|
|
343
|
-
}),
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
T(K, (o) => o && (te.value = o));
|
|
348
|
-
const ne = E(""), S = E(""), $e = z(() => {
|
|
349
|
-
if (!S.value) return !0;
|
|
335
|
+
const s = q(null), o = q(null), i = q(null), a = q(null), f = q(null), c = q(null), m = T(""), p = T(0), d = q(null), k = _(() => d.value?.toString() || ""), ee = _(() => !!l.mentions), L = _(() => {
|
|
336
|
+
const r = k.value.substring(1).toLowerCase();
|
|
337
|
+
return l.mentions ? Object.entries(l.mentions).filter(([n, u]) => u.toLowerCase().startsWith(r)).sort(([n, u], [h, g]) => u.localeCompare(g)).map(([n, u]) => ({ name: n, value: u })) : [];
|
|
338
|
+
}), W = T(null), K = T(null), te = T(null), P = _(() => W.value || K.value);
|
|
339
|
+
N(W, (r) => r && (te.value = r));
|
|
340
|
+
const ne = T(""), R = T(""), $e = _(() => {
|
|
341
|
+
if (!R.value) return !0;
|
|
350
342
|
try {
|
|
351
|
-
return new URL(
|
|
343
|
+
return new URL(R.value), !0;
|
|
352
344
|
} catch {
|
|
353
345
|
return !1;
|
|
354
346
|
}
|
|
355
347
|
});
|
|
356
|
-
|
|
357
|
-
|
|
348
|
+
N([ne, R], ([r, n]) => {
|
|
349
|
+
P.value && (P.value.textContent = r, P.value.setAttribute("href", n), D());
|
|
358
350
|
});
|
|
359
|
-
const ue =
|
|
360
|
-
let
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
351
|
+
const ue = T(null), ce = T(null), oe = T(0), Fe = _(() => "." + ".".repeat(oe.value % 5));
|
|
352
|
+
let G = null;
|
|
353
|
+
const M = T("");
|
|
354
|
+
N(c, (r, n) => {
|
|
355
|
+
n !== null && r !== null && (n.startContainer == r.startContainer && n.startOffset == r.startOffset && n.endContainer == r.endContainer && n.endOffset == r.endOffset && n?.backwards == r?.backwards || (M.value = ""));
|
|
364
356
|
});
|
|
365
|
-
const
|
|
366
|
-
function de(
|
|
367
|
-
return
|
|
357
|
+
const A = [];
|
|
358
|
+
function de(r, n) {
|
|
359
|
+
return c.value ? n ? r && M.value === n ? "" : r || M.value === n ? "-jte-active" : "" : r ? "-jte-active" : c.value.collapsed ? "-jte-disabled" : "" : "-jte-disabled";
|
|
368
360
|
}
|
|
369
|
-
function
|
|
370
|
-
if (!
|
|
371
|
-
const
|
|
372
|
-
|
|
361
|
+
function D() {
|
|
362
|
+
if (!o.value) return void (m.value = "");
|
|
363
|
+
const r = o.value.innerHTML;
|
|
364
|
+
m.value = r === "<br>" ? "" : (
|
|
373
365
|
// edge case: empty editor
|
|
374
|
-
|
|
366
|
+
r.replaceAll(" ", " ").trimEnd()
|
|
375
367
|
);
|
|
376
368
|
}
|
|
377
369
|
function fe() {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
I.push({ ...t, content: v.value }), I.length > 100 && I.shift();
|
|
370
|
+
if (o.value && A[A.length - 1]?.content !== m.value) {
|
|
371
|
+
const r = ge(o.value) || { start: 0, end: 0 };
|
|
372
|
+
A.push({ ...r, content: m.value }), A.length > 100 && A.shift();
|
|
382
373
|
}
|
|
383
374
|
}
|
|
384
375
|
function Pe() {
|
|
385
|
-
if (!
|
|
386
|
-
const
|
|
387
|
-
if (!
|
|
388
|
-
const
|
|
389
|
-
|
|
376
|
+
if (!o.value || !c.value) return;
|
|
377
|
+
const r = A.pop();
|
|
378
|
+
if (!r) return;
|
|
379
|
+
const n = new DOMParser().parseFromString(r.content, "text/html").body;
|
|
380
|
+
o.value.replaceChildren(...n.childNodes), be(o.value, r);
|
|
390
381
|
}
|
|
391
|
-
function
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
p.value = t;
|
|
382
|
+
function we() {
|
|
383
|
+
if (d.value && c.value?.collapsed) {
|
|
384
|
+
const r = d.value.cloneRange();
|
|
385
|
+
if (r.setEnd(c.value.startContainer, c.value.startOffset), r.toString().match(/^@[^\r\n]*$/)) {
|
|
386
|
+
d.value = r;
|
|
397
387
|
return;
|
|
398
388
|
}
|
|
399
389
|
}
|
|
400
|
-
|
|
390
|
+
d.value = null;
|
|
401
391
|
}
|
|
402
|
-
function
|
|
403
|
-
if (!
|
|
404
|
-
const
|
|
392
|
+
function ye(r, n) {
|
|
393
|
+
if (!o.value || !d.value) return;
|
|
394
|
+
const u = o.value;
|
|
405
395
|
fe();
|
|
406
|
-
const
|
|
407
|
-
g.setAttribute("rel", "mention"), g.setAttribute("name",
|
|
408
|
-
const
|
|
409
|
-
|
|
396
|
+
const h = document.createDocumentFragment(), g = document.createElement("link");
|
|
397
|
+
g.setAttribute("rel", "mention"), g.setAttribute("name", r), g.setAttribute("title", n), h.append(g, " ");
|
|
398
|
+
const v = he(u, d.value, h);
|
|
399
|
+
I(v, !0), d.value = null, D();
|
|
410
400
|
}
|
|
411
|
-
function
|
|
412
|
-
if (!
|
|
413
|
-
const
|
|
414
|
-
if (
|
|
415
|
-
|
|
401
|
+
function X(r, n = {}) {
|
|
402
|
+
if (!o.value || !c.value) return;
|
|
403
|
+
const u = o.value;
|
|
404
|
+
if (c.value.collapsed) {
|
|
405
|
+
M.value = r, u.focus();
|
|
416
406
|
return;
|
|
417
407
|
}
|
|
418
408
|
fe();
|
|
419
|
-
const
|
|
420
|
-
Be(
|
|
409
|
+
const h = U(u, c.value);
|
|
410
|
+
Be(u, c.value, r, n), I(h), D();
|
|
421
411
|
}
|
|
422
412
|
function Ae() {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
i.value.insertNode(m), t.end += 1, p.value = U(o, t), t.start += 1, _(t);
|
|
413
|
+
if (!o.value || !c.value?.collapsed) return;
|
|
414
|
+
const r = o.value, n = U(r, c.value), u = document.createTextNode("@");
|
|
415
|
+
c.value.insertNode(u), n.end += 1, d.value = V(r, n), n.start += 1, I(n);
|
|
427
416
|
}
|
|
428
|
-
function
|
|
429
|
-
if (!
|
|
430
|
-
const
|
|
431
|
-
|
|
417
|
+
function I(r, n) {
|
|
418
|
+
if (!o.value) return;
|
|
419
|
+
const u = o.value;
|
|
420
|
+
c.value = be(u, r, n), u.focus();
|
|
432
421
|
}
|
|
433
422
|
function Ie() {
|
|
434
|
-
|
|
435
|
-
v.value && ((o = l.onSubmit) == null || o.call(l, v.value));
|
|
423
|
+
m.value && l.onSubmit?.(m.value);
|
|
436
424
|
}
|
|
437
|
-
function _e(
|
|
438
|
-
if (
|
|
439
|
-
switch (
|
|
425
|
+
function _e(r) {
|
|
426
|
+
if (r.metaKey || r.ctrlKey)
|
|
427
|
+
switch (r.key) {
|
|
440
428
|
case "b":
|
|
441
|
-
|
|
429
|
+
X("b"), r.preventDefault();
|
|
442
430
|
break;
|
|
443
431
|
case "i":
|
|
444
|
-
|
|
432
|
+
X("i"), r.preventDefault();
|
|
445
433
|
break;
|
|
446
434
|
case "z":
|
|
447
|
-
Pe(),
|
|
435
|
+
Pe(), r.preventDefault();
|
|
448
436
|
break;
|
|
449
437
|
}
|
|
450
|
-
else if (
|
|
451
|
-
switch (
|
|
438
|
+
else if (d.value)
|
|
439
|
+
switch (r.key) {
|
|
452
440
|
case "Home":
|
|
453
|
-
|
|
441
|
+
p.value = 0, r.preventDefault();
|
|
454
442
|
break;
|
|
455
443
|
case "ArrowUp":
|
|
456
|
-
|
|
444
|
+
p.value = Math.max(p.value - 1, 0), r.preventDefault();
|
|
457
445
|
break;
|
|
458
446
|
case "PageUp":
|
|
459
|
-
|
|
447
|
+
p.value = Math.max(p.value - 4, 0), r.preventDefault();
|
|
460
448
|
break;
|
|
461
449
|
case "ArrowDown":
|
|
462
|
-
|
|
450
|
+
p.value = Math.min(p.value + 1, L.value.length - 1), r.preventDefault();
|
|
463
451
|
break;
|
|
464
452
|
case "PageDown":
|
|
465
|
-
|
|
453
|
+
p.value = Math.min(p.value + 4, L.value.length - 1), r.preventDefault();
|
|
466
454
|
break;
|
|
467
455
|
case "End":
|
|
468
|
-
|
|
456
|
+
p.value = L.value.length - 1, r.preventDefault();
|
|
469
457
|
break;
|
|
470
458
|
case "Escape":
|
|
471
|
-
|
|
459
|
+
d.value = null, r.preventDefault();
|
|
472
460
|
break;
|
|
473
461
|
case "Enter": {
|
|
474
|
-
const
|
|
475
|
-
|
|
462
|
+
const n = L.value[p.value];
|
|
463
|
+
n && ye(n.name, n.value), r.preventDefault();
|
|
476
464
|
break;
|
|
477
465
|
}
|
|
478
466
|
}
|
|
479
467
|
}
|
|
480
|
-
function ze(
|
|
481
|
-
if (
|
|
482
|
-
const
|
|
483
|
-
if (!
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
486
|
-
const
|
|
487
|
-
|
|
468
|
+
function ze(r) {
|
|
469
|
+
if (r.preventDefault(), !o.value || !c.value) return;
|
|
470
|
+
const n = r.clipboardData;
|
|
471
|
+
if (!n) return;
|
|
472
|
+
const u = n.getData("text/html") || n.getData("text/plain");
|
|
473
|
+
if (!u) return;
|
|
474
|
+
const h = he(o.value, c.value, u);
|
|
475
|
+
I(h, !0), D();
|
|
488
476
|
}
|
|
489
|
-
function He(
|
|
490
|
-
if (
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
|
|
477
|
+
function He(r) {
|
|
478
|
+
if (o.value && c.value && (fe(), !c.value.collapsed && (r.inputType === "deleteContentBackward" || r.inputType === "deleteContentForward"))) {
|
|
479
|
+
r.preventDefault(), r.stopPropagation();
|
|
480
|
+
const n = he(o.value, c.value, "");
|
|
481
|
+
I(n, !0), D();
|
|
494
482
|
}
|
|
495
483
|
}
|
|
496
|
-
function Ve(
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
Be(t, d, D.value);
|
|
484
|
+
function Ve(r) {
|
|
485
|
+
const n = o.value;
|
|
486
|
+
if (!n) return;
|
|
487
|
+
const u = d.value ? U(n, d.value) : null, h = ge(n);
|
|
488
|
+
if (M.value && h && h.start === h.end && r.inputType === "insertText" && r.data !== "@" && !d.value) {
|
|
489
|
+
const g = V(n, { start: h.start - 1, end: h.end });
|
|
490
|
+
Be(n, g, M.value);
|
|
504
491
|
}
|
|
505
|
-
if (
|
|
506
|
-
const
|
|
507
|
-
if (!
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
510
|
-
const
|
|
511
|
-
|
|
492
|
+
if (M.value = "", Z(n), u && (d.value = V(n, u)), h && (n.innerHTML === "<br>" ? (document.getSelection()?.setBaseAndExtent(n, 0, n, 0), n.focus()) : I(h)), !P.value && !d.value && r.data === "@" && r.inputType === "insertText") {
|
|
493
|
+
const g = document.getSelection();
|
|
494
|
+
if (!g?.anchorNode) return;
|
|
495
|
+
const v = Ce(n, g.anchorNode, g.anchorOffset);
|
|
496
|
+
if (v.match(/(\s|^)@$/)) {
|
|
497
|
+
const C = v.length === 1 ? 0 : v.length - 1, x = v.length, S = { start: C, end: x };
|
|
498
|
+
d.value = V(n, S);
|
|
512
499
|
}
|
|
513
500
|
} else
|
|
514
|
-
|
|
515
|
-
|
|
501
|
+
we();
|
|
502
|
+
D();
|
|
516
503
|
}
|
|
517
|
-
function Ne(
|
|
518
|
-
s.value && xe(s.value) || (
|
|
504
|
+
function Ne(r) {
|
|
505
|
+
s.value && xe(s.value) || (W.value = null, te.value = null, K.value = null), c.value = o.value ? xe(o.value) : null, we();
|
|
519
506
|
}
|
|
520
|
-
return
|
|
521
|
-
var t;
|
|
522
|
-
return o && ((t = l.onMention) == null ? void 0 : t.call(l, o));
|
|
523
|
-
}), Qe(() => {
|
|
507
|
+
return N(k, (r) => r && l.onMention?.(r)), Qe(() => {
|
|
524
508
|
if (document.addEventListener("selectionchange", Ne), !s.value) throw new Error("Root not referenced");
|
|
525
|
-
if (!
|
|
526
|
-
if (!
|
|
509
|
+
if (!o.value) throw new Error("Editor not referenced");
|
|
510
|
+
if (!i.value) throw new Error("Popup not referenced");
|
|
527
511
|
if (!a.value) throw new Error("List not referenced");
|
|
528
512
|
if (!f.value) throw new Error("Popup not referenced");
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
}),
|
|
533
|
-
if (
|
|
534
|
-
const C = `<html><body>${
|
|
535
|
-
|
|
536
|
-
}, { immediate: !0 }),
|
|
537
|
-
oe.value = 0,
|
|
538
|
-
}, { immediate: !0 }),
|
|
539
|
-
if (ne.value =
|
|
540
|
-
const C = ge(
|
|
541
|
-
|
|
513
|
+
const r = s.value, n = o.value, u = i.value, h = a.value, g = f.value;
|
|
514
|
+
N(m, (v) => {
|
|
515
|
+
v !== e.value && (e.value = v);
|
|
516
|
+
}), N(e, (v) => {
|
|
517
|
+
if (v === m.value) return;
|
|
518
|
+
const C = `<html><body>${v}</body></html>`, x = new DOMParser().parseFromString(C, "text/html").body;
|
|
519
|
+
Z(x), n.replaceChildren(...x.childNodes), D();
|
|
520
|
+
}, { immediate: !0 }), N(ee, (v) => {
|
|
521
|
+
oe.value = 0, v ? G && clearInterval(G) : G = setInterval(() => oe.value = oe.value + 1, 200);
|
|
522
|
+
}, { immediate: !0 }), N(P, (v) => {
|
|
523
|
+
if (ne.value = v?.textContent || "", R.value = v?.getAttribute("href") || "", R.value === "http://__placeholder__/" && (v?.setAttribute("href", ""), R.value = ""), !v) {
|
|
524
|
+
const C = ge(n);
|
|
525
|
+
Z(n), C && be(n, C), g.style.display = "none", g.style.top = "0", g.style.left = "0";
|
|
542
526
|
return;
|
|
543
527
|
}
|
|
544
528
|
Oe(() => {
|
|
545
529
|
g.style.display = "flex";
|
|
546
|
-
const C =
|
|
547
|
-
g.style.top = !le && re ? `${
|
|
530
|
+
const C = r.getBoundingClientRect(), x = v.getBoundingClientRect(), S = n.getBoundingClientRect(), B = getComputedStyle(g), E = parseInt(B.width), O = parseInt(B.height), re = x.top - O - 6 > S.top, le = x.bottom + O + 3 < S.bottom, J = x.left + E < S.right;
|
|
531
|
+
g.style.top = !le && re ? `${x.top - O - C.top - 6}px` : (
|
|
548
532
|
// over the link
|
|
549
|
-
`${
|
|
550
|
-
), g.style.left =
|
|
533
|
+
`${x.bottom - C.top + 3}px`
|
|
534
|
+
), g.style.left = J ? `${x.left - C.left}px` : (
|
|
551
535
|
// right of the link
|
|
552
|
-
`${
|
|
536
|
+
`${S.right - E - C.left}px`
|
|
553
537
|
);
|
|
554
538
|
});
|
|
555
|
-
}, { immediate: !0 }),
|
|
556
|
-
if (
|
|
539
|
+
}, { immediate: !0 }), N([p, d, L], ([v, C, x], [S = -1]) => {
|
|
540
|
+
if (v >= x.length && (v = Math.max(x.length - 1, 0)), p.value = v, !!u && h) {
|
|
557
541
|
if (!C) {
|
|
558
|
-
|
|
542
|
+
p.value = 0, u.style.display = "none", u.style.top = "0", u.style.left = "0", h.scrollTop = 0;
|
|
559
543
|
return;
|
|
560
544
|
}
|
|
561
545
|
Oe(() => {
|
|
562
|
-
|
|
563
|
-
const
|
|
564
|
-
|
|
546
|
+
u.style.display = "block";
|
|
547
|
+
const B = r.getBoundingClientRect(), E = C.getBoundingClientRect(), O = n.getBoundingClientRect(), re = getComputedStyle(u), le = parseInt(re.width), J = parseInt(re.height), Ue = E.top - J - 6 > O.top, We = E.bottom + J + 3 < O.bottom, Ke = E.left + le < O.right;
|
|
548
|
+
u.style.top = !We && Ue ? `${E.top - J - B.top - 6}px` : (
|
|
565
549
|
// over the link
|
|
566
|
-
`${
|
|
567
|
-
),
|
|
550
|
+
`${E.bottom - B.top + 3}px`
|
|
551
|
+
), u.style.left = Ke ? `${E.left - B.left}px` : (
|
|
568
552
|
// right of the link
|
|
569
|
-
`${
|
|
553
|
+
`${O.right - le - B.left}px`
|
|
570
554
|
);
|
|
571
|
-
const
|
|
572
|
-
if (!
|
|
573
|
-
const Te = getComputedStyle(
|
|
574
|
-
|
|
555
|
+
const pe = h.querySelectorAll("li")[p.value];
|
|
556
|
+
if (!pe) return;
|
|
557
|
+
const Te = getComputedStyle(pe), Ee = parseFloat(Te.getPropertyValue("border-top-width")) || 0, ke = parseFloat(Te.getPropertyValue("border-bottom-width")) || 0, Q = h.getBoundingClientRect(), ve = pe.getBoundingClientRect(), se = ve.top - Q.top, Re = ve.bottom - Q.bottom, Se = ve.bottom - Q.top;
|
|
558
|
+
v > S ? Se > Q.height ? h.scrollTop += Re - ke : se < 0 && (h.scrollTop += se + Ee) : se < 0 ? h.scrollTop += se + Ee : Re > 0 && (h.scrollTop += Se - Q.height - ke);
|
|
575
559
|
});
|
|
576
560
|
}
|
|
577
|
-
}, { immediate: !0 }),
|
|
578
|
-
|
|
561
|
+
}, { immediate: !0 }), N(c, (v) => {
|
|
562
|
+
v ? (W.value = ae(n, v, "a"), ue.value = ae(n, v, "b"), ce.value = ae(n, v, "i")) : (W.value = null, ue.value = null, ce.value = null);
|
|
579
563
|
}, { immediate: !0 });
|
|
580
564
|
}), Ye(() => {
|
|
581
|
-
document.removeEventListener("selectionchange", Ne),
|
|
582
|
-
}), (
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
565
|
+
document.removeEventListener("selectionchange", Ne), G && clearInterval(G);
|
|
566
|
+
}), (r, n) => (w(), y("div", {
|
|
567
|
+
class: j(["juit-tiny-edit", { "-jte-editable": t.editable, "-jte-dark": t.dark }])
|
|
568
|
+
}, [
|
|
569
|
+
b("div", {
|
|
570
|
+
ref_key: "rootRef",
|
|
571
|
+
ref: s,
|
|
572
|
+
class: "-jte-root"
|
|
586
573
|
}, [
|
|
587
574
|
b("div", {
|
|
588
|
-
ref_key: "
|
|
589
|
-
ref:
|
|
590
|
-
class: "-jte-
|
|
575
|
+
ref_key: "mentionsPopupRef",
|
|
576
|
+
ref: i,
|
|
577
|
+
class: "-jte-mentions-popup"
|
|
591
578
|
}, [
|
|
592
|
-
b("
|
|
593
|
-
ref_key: "
|
|
594
|
-
ref:
|
|
595
|
-
class: "-jte-mentions-popup"
|
|
579
|
+
b("ul", {
|
|
580
|
+
ref_key: "mentionsListRef",
|
|
581
|
+
ref: a
|
|
596
582
|
}, [
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
583
|
+
(w(!0), y(Ze, null, et(L.value, (u, h) => (w(), y("li", {
|
|
584
|
+
key: h,
|
|
585
|
+
class: j({ "-jte-mentions-selected": p.value === h }),
|
|
586
|
+
onMousedown: (g) => ye(u.name, u.value)
|
|
600
587
|
}, [
|
|
601
|
-
(
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
b("div", Rt, [
|
|
607
|
-
tt(H(u.value) + " ", 1),
|
|
608
|
-
b("span", kt, H(u.name), 1)
|
|
609
|
-
])
|
|
610
|
-
], 42, Et))), 128))
|
|
611
|
-
], 512),
|
|
612
|
-
P.value ? M.value.length ? me("", !0) : (w(), N("div", Ot, H(x.value), 1)) : (w(), N("div", St, H(x.value) + H(Fe.value), 1))
|
|
588
|
+
b("div", kt, [
|
|
589
|
+
tt(z(u.value) + " ", 1),
|
|
590
|
+
b("span", Rt, z(u.name), 1)
|
|
591
|
+
])
|
|
592
|
+
], 42, Et))), 128))
|
|
613
593
|
], 512),
|
|
594
|
+
ee.value ? L.value.length ? me("", !0) : (w(), y("div", Ot, z(k.value), 1)) : (w(), y("div", St, z(k.value) + z(Fe.value), 1))
|
|
595
|
+
], 512),
|
|
596
|
+
b("div", {
|
|
597
|
+
ref_key: "linksPopupRef",
|
|
598
|
+
ref: f,
|
|
599
|
+
class: "-jte-links-popup",
|
|
600
|
+
onClick: n[2] || (n[2] = (u) => K.value = te.value),
|
|
601
|
+
onFocusin: n[3] || (n[3] = (u) => K.value = te.value)
|
|
602
|
+
}, [
|
|
603
|
+
b("div", null, [
|
|
604
|
+
H($(Tt), { class: "-jte-icon" }),
|
|
605
|
+
je(b("input", {
|
|
606
|
+
"onUpdate:modelValue": n[0] || (n[0] = (u) => ne.value = u),
|
|
607
|
+
type: "text"
|
|
608
|
+
}, null, 512), [
|
|
609
|
+
[Le, ne.value]
|
|
610
|
+
])
|
|
611
|
+
]),
|
|
614
612
|
b("div", {
|
|
615
|
-
|
|
616
|
-
ref: f,
|
|
617
|
-
class: "-jte-links-popup",
|
|
618
|
-
onClick: t[2] || (t[2] = (u) => G.value = te.value),
|
|
619
|
-
onFocusin: t[3] || (t[3] = (u) => G.value = te.value)
|
|
613
|
+
class: j({ "-jte-error": !$e.value })
|
|
620
614
|
}, [
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
V($(qe), {
|
|
668
|
-
class: L(["-jte-icon -jte-icon-href", de(A.value)]),
|
|
669
|
-
onClick: t[11] || (t[11] = (u) => J("a", { href: "http://__placeholder__/" }))
|
|
670
|
-
}, null, 8, ["class"]),
|
|
671
|
-
n.onSubmit ? (w(), nt($(yt), {
|
|
672
|
-
key: 0,
|
|
673
|
-
class: L(["-jte-icon -jte-icon-send", { "-jte-disabled": !v.value, "-jte-active": !!v.value }]),
|
|
674
|
-
onClick: Ie
|
|
675
|
-
}, null, 8, ["class"])) : me("", !0)
|
|
676
|
-
])
|
|
677
|
-
], 512)
|
|
678
|
-
], 2);
|
|
679
|
-
};
|
|
615
|
+
H($(qe), { class: "-jte-icon" }),
|
|
616
|
+
je(b("input", {
|
|
617
|
+
"onUpdate:modelValue": n[1] || (n[1] = (u) => R.value = u),
|
|
618
|
+
type: "text"
|
|
619
|
+
}, null, 512), [
|
|
620
|
+
[Le, R.value]
|
|
621
|
+
])
|
|
622
|
+
], 2)
|
|
623
|
+
], 544),
|
|
624
|
+
t.placeholder && !m.value ? (w(), y("div", jt, z(t.placeholder), 1)) : me("", !0),
|
|
625
|
+
b("div", {
|
|
626
|
+
ref_key: "editorRef",
|
|
627
|
+
ref: o,
|
|
628
|
+
class: "-jte-editor",
|
|
629
|
+
contenteditable: t.editable ? "plaintext-only" : "false",
|
|
630
|
+
onBeforeinput: n[4] || (n[4] = (u) => He(u)),
|
|
631
|
+
onInput: n[5] || (n[5] = (u) => Ve(u)),
|
|
632
|
+
onKeydown: n[6] || (n[6] = (u) => _e(u)),
|
|
633
|
+
onPaste: n[7] || (n[7] = (u) => ze(u)),
|
|
634
|
+
onFocusin: n[8] || (n[8] = (u) => K.value = null)
|
|
635
|
+
}, null, 40, Lt),
|
|
636
|
+
b("div", Mt, [
|
|
637
|
+
H($(bt), {
|
|
638
|
+
class: j(["-jte-icon -jte-icon-mention", { "-jte-disabled": !c.value?.collapsed }]),
|
|
639
|
+
onClick: Ae
|
|
640
|
+
}, null, 8, ["class"]),
|
|
641
|
+
H($(ct), {
|
|
642
|
+
class: j(["-jte-icon -jte-icon-bold", de(ue.value, "b")]),
|
|
643
|
+
onClick: n[9] || (n[9] = (u) => X("b"))
|
|
644
|
+
}, null, 8, ["class"]),
|
|
645
|
+
H($(pt), {
|
|
646
|
+
class: j(["-jte-icon -jte-icon-italic", de(ce.value, "i")]),
|
|
647
|
+
onClick: n[10] || (n[10] = (u) => X("i"))
|
|
648
|
+
}, null, 8, ["class"]),
|
|
649
|
+
H($(qe), {
|
|
650
|
+
class: j(["-jte-icon -jte-icon-href", de(P.value)]),
|
|
651
|
+
onClick: n[11] || (n[11] = (u) => X("a", { href: "http://__placeholder__/" }))
|
|
652
|
+
}, null, 8, ["class"]),
|
|
653
|
+
t.onSubmit ? (w(), nt($(wt), {
|
|
654
|
+
key: 0,
|
|
655
|
+
class: j(["-jte-icon -jte-icon-send", { "-jte-disabled": !m.value, "-jte-active": !!m.value }]),
|
|
656
|
+
onClick: Ie
|
|
657
|
+
}, null, 8, ["class"])) : me("", !0)
|
|
658
|
+
])
|
|
659
|
+
], 512)
|
|
660
|
+
], 2));
|
|
680
661
|
}
|
|
681
662
|
});
|
|
682
663
|
export {
|