@opengis/form 0.0.190 → 0.0.191
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { r as
|
|
3
|
-
import { Quote as
|
|
4
|
-
import { notify as
|
|
5
|
-
function
|
|
6
|
-
const t =
|
|
1
|
+
import { ref as $, getCurrentInstance as st, resolveComponent as Z, createElementBlock as w, openBlock as v, normalizeClass as E, createVNode as C, createElementVNode as d, unref as L, createBlock as W, Teleport as Ge, createCommentVNode as U, Transition as Ye, withCtx as q, toDisplayString as Y, renderSlot as we, defineComponent as it, withDirectives as de, mergeProps as ct, vModelDynamic as dt, Fragment as ae, vModelCheckbox as ut, nextTick as ue, watch as me, onMounted as be, onBeforeUnmount as Qe, normalizeStyle as se, vShow as $e, computed as N, renderList as ie, onUnmounted as Le, resolveDynamicComponent as Ee, vModelText as ft, withModifiers as pt, createStaticVNode as gt, mergeModels as ht, useModel as vt, shallowRef as mt, markRaw as bt } from "vue";
|
|
2
|
+
import { r as De, _ as Q, a as yt, b as xt } from "./index-Cc_sXScq.js";
|
|
3
|
+
import { Quote as wt, List as kt, ListOrdered as _t, CodeXml as $t, Bold as Ct, Italic as At, Underline as Ft, Strikethrough as St, X as Pe, Mail as Tt, Search as Lt, Link2 as Bt, ExternalLink as Et, Trash2 as It, Table2 as Pt, AlignJustify as jt, AlignRight as Mt, AlignCenter as Ht, AlignLeft as Nt, Check as ke, Eraser as zt, PaintBucket as Dt, Highlighter as Vt, ChevronDown as je, ALargeSmall as Ot, Superscript as Rt, Subscript as Ut, RemoveFormatting as qt, Image as Kt, Undo2 as Wt, Redo2 as Xt, CircleHelp as Gt, Minus as Yt, Maximize as Qt } from "lucide-vue-next";
|
|
4
|
+
import { notify as Se } from "@opengis/core";
|
|
5
|
+
function Zt() {
|
|
6
|
+
const t = $(!1);
|
|
7
7
|
return {
|
|
8
8
|
isFullscreen: t,
|
|
9
9
|
toggleFullscreen: () => {
|
|
@@ -11,32 +11,32 @@ function Gt() {
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
core:
|
|
16
|
-
starterKit:
|
|
17
|
-
textStyle:
|
|
18
|
-
table:
|
|
19
|
-
highlight:
|
|
20
|
-
subscript:
|
|
21
|
-
superscript:
|
|
22
|
-
link:
|
|
23
|
-
image:
|
|
24
|
-
textAlign:
|
|
25
|
-
heading:
|
|
26
|
-
paragraph:
|
|
27
|
-
pmModel:
|
|
28
|
-
},
|
|
14
|
+
const Jt = "https://esm.sh", le = "3.7.2", Ze = "3.7.2", er = `?deps=@tiptap/core@${le},@tiptap/pm@${Ze}`, te = (t) => `${Jt}/${t}${er}`, re = {
|
|
15
|
+
core: te(`@tiptap/core@${le}`),
|
|
16
|
+
starterKit: te(`@tiptap/starter-kit@${le}`),
|
|
17
|
+
textStyle: te(`@tiptap/extension-text-style@${le}`),
|
|
18
|
+
table: te(`@tiptap/extension-table@${le}`),
|
|
19
|
+
highlight: te(`@tiptap/extension-highlight@${le}`),
|
|
20
|
+
subscript: te(`@tiptap/extension-subscript@${le}`),
|
|
21
|
+
superscript: te(`@tiptap/extension-superscript@${le}`),
|
|
22
|
+
link: te(`@tiptap/extension-link@${le}`),
|
|
23
|
+
image: te(`@tiptap/extension-image@${le}`),
|
|
24
|
+
textAlign: te(`@tiptap/extension-text-align@${le}`),
|
|
25
|
+
heading: te(`@tiptap/extension-heading@${le}`),
|
|
26
|
+
paragraph: te(`@tiptap/extension-paragraph@${le}`),
|
|
27
|
+
pmModel: te(`@tiptap/pm@${Ze}/model`)
|
|
28
|
+
}, ye = "__vs_form_tiptap_loader__", oe = (t) => import(
|
|
29
29
|
/* @vite-ignore */
|
|
30
30
|
t
|
|
31
|
-
),
|
|
31
|
+
), K = (t, e) => t?.[e] || t?.default?.[e] || t?.default?.default?.[e] || t?.default || t, tr = (t) => t.extend({
|
|
32
32
|
addOptions() {
|
|
33
33
|
return {
|
|
34
34
|
...this.parent?.(),
|
|
35
35
|
levels: [1, 2, 3, 4, 5, 6]
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
}),
|
|
39
|
-
const
|
|
38
|
+
}), rr = (t, e, a, s, n) => {
|
|
39
|
+
const o = e.extend({
|
|
40
40
|
addAttributes() {
|
|
41
41
|
return {
|
|
42
42
|
...this.parent?.(),
|
|
@@ -82,7 +82,7 @@ const Yt = "https://esm.sh", te = "3.7.2", Ge = "3.7.2", Qt = `?deps=@tiptap/cor
|
|
|
82
82
|
return t.extend({
|
|
83
83
|
addExtensions() {
|
|
84
84
|
return [
|
|
85
|
-
|
|
85
|
+
o.configure({
|
|
86
86
|
resizable: !0
|
|
87
87
|
}),
|
|
88
88
|
a,
|
|
@@ -91,7 +91,7 @@ const Yt = "https://esm.sh", te = "3.7.2", Ge = "3.7.2", Qt = `?deps=@tiptap/cor
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
},
|
|
94
|
+
}, or = (t) => t.extend({
|
|
95
95
|
addAttributes() {
|
|
96
96
|
return {
|
|
97
97
|
...this.parent?.(),
|
|
@@ -137,7 +137,7 @@ const Yt = "https://esm.sh", te = "3.7.2", Ge = "3.7.2", Qt = `?deps=@tiptap/cor
|
|
|
137
137
|
unsetBackgroundColor: () => ({ chain: e }) => e().setMark("textStyle", { backgroundColor: null }).removeEmptyTextStyle().run()
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
-
}),
|
|
140
|
+
}), lr = (t) => t.create({
|
|
141
141
|
name: "iframe",
|
|
142
142
|
group: "block",
|
|
143
143
|
inline: !1,
|
|
@@ -165,195 +165,195 @@ const Yt = "https://esm.sh", te = "3.7.2", Ge = "3.7.2", Qt = `?deps=@tiptap/cor
|
|
|
165
165
|
return ["iframe", e];
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
|
-
async function
|
|
168
|
+
async function ar() {
|
|
169
169
|
if (typeof window > "u") return null;
|
|
170
170
|
const t = window;
|
|
171
|
-
return t[
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
171
|
+
return t[ye] || (t[ye] = Promise.all([
|
|
172
|
+
oe(re.core),
|
|
173
|
+
oe(re.starterKit),
|
|
174
|
+
oe(re.textStyle),
|
|
175
|
+
oe(re.table),
|
|
176
|
+
oe(re.highlight),
|
|
177
|
+
oe(re.subscript),
|
|
178
|
+
oe(re.superscript),
|
|
179
|
+
oe(re.link),
|
|
180
|
+
oe(re.image),
|
|
181
|
+
oe(re.textAlign),
|
|
182
|
+
oe(re.heading),
|
|
183
|
+
oe(re.paragraph),
|
|
184
|
+
oe(re.pmModel)
|
|
185
185
|
]).then(([
|
|
186
186
|
e,
|
|
187
187
|
a,
|
|
188
188
|
s,
|
|
189
189
|
n,
|
|
190
|
-
|
|
190
|
+
o,
|
|
191
191
|
l,
|
|
192
192
|
c,
|
|
193
|
-
|
|
193
|
+
r,
|
|
194
194
|
i,
|
|
195
|
-
|
|
195
|
+
x,
|
|
196
196
|
b,
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
f,
|
|
198
|
+
p
|
|
199
199
|
]) => {
|
|
200
|
-
const
|
|
201
|
-
if (!
|
|
200
|
+
const I = K(e, "Editor"), V = K(e, "Node"), O = K(a, "StarterKit"), R = K(s, "TextStyle"), J = K(n, "TableKit"), P = K(n, "Table"), ee = K(n, "TableRow"), ne = K(n, "TableCell"), pe = K(n, "TableHeader"), ge = K(o, "Highlight"), m = K(l, "Subscript"), k = K(c, "Superscript"), u = K(r, "Link"), _ = K(i, "Image"), y = K(x, "TextAlign"), T = K(b, "Heading"), h = K(f, "Paragraph"), S = K(p, "DOMParser");
|
|
201
|
+
if (!I || !V || !O || !R || !J || !P || !ee || !ne || !pe || !ge || !m || !k || !u || !_ || !y || !T || !h || !S)
|
|
202
202
|
throw new Error("Failed to resolve one or more Tiptap modules");
|
|
203
203
|
return {
|
|
204
|
-
Editor:
|
|
204
|
+
Editor: I,
|
|
205
205
|
ProseMirrorDOMParser: S,
|
|
206
|
-
StarterKit:
|
|
207
|
-
ExtendedTextStyle:
|
|
208
|
-
Highlight:
|
|
206
|
+
StarterKit: O,
|
|
207
|
+
ExtendedTextStyle: or(R),
|
|
208
|
+
Highlight: ge,
|
|
209
209
|
Subscript: m,
|
|
210
|
-
Superscript:
|
|
211
|
-
Link:
|
|
212
|
-
Image:
|
|
210
|
+
Superscript: k,
|
|
211
|
+
Link: u,
|
|
212
|
+
Image: _,
|
|
213
213
|
TextAlign: y,
|
|
214
|
-
CustomHeading:
|
|
214
|
+
CustomHeading: tr(T),
|
|
215
215
|
CustomParagraph: h,
|
|
216
|
-
CustomTableKit:
|
|
217
|
-
Iframe:
|
|
216
|
+
CustomTableKit: rr(J, P, ee, ne, pe),
|
|
217
|
+
Iframe: lr(V)
|
|
218
218
|
};
|
|
219
219
|
}).catch((e) => {
|
|
220
|
-
throw delete t[
|
|
221
|
-
})), t[
|
|
220
|
+
throw delete t[ye], e;
|
|
221
|
+
})), t[ye];
|
|
222
222
|
}
|
|
223
|
-
const
|
|
224
|
-
let e =
|
|
225
|
-
return e = e.replace(/!\[([^\]]*)]\(([^)\s]+)(?:\s+"([^"]+)")?\)/g, (a, s, n,
|
|
226
|
-
const l =
|
|
227
|
-
return `<img src="${
|
|
228
|
-
}), e = e.replace(/\[([^\]]+)]\(([^)\s]+)(?:\s+"([^"]+)")?\)/g, (a, s, n,
|
|
229
|
-
const l =
|
|
230
|
-
return `<a href="${
|
|
223
|
+
const ce = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), Ce = (t) => {
|
|
224
|
+
let e = ce(t || "");
|
|
225
|
+
return e = e.replace(/!\[([^\]]*)]\(([^)\s]+)(?:\s+"([^"]+)")?\)/g, (a, s, n, o) => {
|
|
226
|
+
const l = o ? ` title="${ce(o)}"` : "";
|
|
227
|
+
return `<img src="${ce(n)}" alt="${ce(s)}"${l}>`;
|
|
228
|
+
}), e = e.replace(/\[([^\]]+)]\(([^)\s]+)(?:\s+"([^"]+)")?\)/g, (a, s, n, o) => {
|
|
229
|
+
const l = o ? ` title="${ce(o)}"` : "";
|
|
230
|
+
return `<a href="${ce(n)}"${l} target="_blank" rel="noopener noreferrer">${s}</a>`;
|
|
231
231
|
}), e = e.replace(/`([^`]+)`/g, "<code>$1</code>"), e = e.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^_]+)__/g, "<strong>$1</strong>"), e = e.replace(/~~([^~]+)~~/g, "<del>$1</del>"), e = e.replace(/\*([^*\n]+)\*/g, "<em>$1</em>"), e = e.replace(/_([^_\n]+)_/g, "<em>$1</em>"), e;
|
|
232
|
-
},
|
|
232
|
+
}, _e = (t) => /^\s*\d+\.\s+/.test(t), Me = (t) => /^\s*[-*+]\s+/.test(t), Je = (t) => /^\s*[-*+]\s+\[[ xX]\]\s+/.test(t), Ie = (t) => /^\s*>\s?/.test(t), He = (t) => /^\s*\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?\s*$/.test(t), Ve = (t) => t.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((e) => Ce(e.trim())), nr = (t, e) => {
|
|
233
233
|
const a = t[e], s = t[e + 1];
|
|
234
|
-
if (!a || !s || !a.includes("|") || !
|
|
234
|
+
if (!a || !s || !a.includes("|") || !He(s))
|
|
235
235
|
return null;
|
|
236
|
-
const n =
|
|
236
|
+
const n = Ve(a), o = [];
|
|
237
237
|
let l = e + 2;
|
|
238
238
|
for (; l < t.length && t[l].includes("|") && t[l].trim() !== ""; ) {
|
|
239
|
-
const i =
|
|
240
|
-
|
|
239
|
+
const i = Ve(t[l]);
|
|
240
|
+
o.push(`<tr>${i.map((x) => `<td>${x}</td>`).join("")}</tr>`), l += 1;
|
|
241
241
|
}
|
|
242
|
-
const c = `<thead><tr>${n.map((i) => `<th>${i}</th>`).join("")}</tr></thead>`,
|
|
242
|
+
const c = `<thead><tr>${n.map((i) => `<th>${i}</th>`).join("")}</tr></thead>`, r = o.length ? `<tbody>${o.join("")}</tbody>` : "";
|
|
243
243
|
return {
|
|
244
|
-
html: `<table>${c}${
|
|
244
|
+
html: `<table>${c}${r}</table>`,
|
|
245
245
|
nextIndex: l
|
|
246
246
|
};
|
|
247
|
-
},
|
|
248
|
-
const a =
|
|
249
|
-
let
|
|
250
|
-
for (;
|
|
251
|
-
const l = t[
|
|
252
|
-
if (l.trim() === "" || !(a ?
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
255
|
-
const i =
|
|
256
|
-
n.push(`<li><input type="checkbox" disabled${i ? " checked" : ""}> ${
|
|
247
|
+
}, sr = (t, e) => {
|
|
248
|
+
const a = _e(t[e]), s = a ? "ol" : "ul", n = [];
|
|
249
|
+
let o = e;
|
|
250
|
+
for (; o < t.length; ) {
|
|
251
|
+
const l = t[o];
|
|
252
|
+
if (l.trim() === "" || !(a ? _e(l) : (Me(l) || Je(l)) && !_e(l))) break;
|
|
253
|
+
const r = l.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.*)$/);
|
|
254
|
+
if (r) {
|
|
255
|
+
const i = r[1].toLowerCase() === "x";
|
|
256
|
+
n.push(`<li><input type="checkbox" disabled${i ? " checked" : ""}> ${Ce(r[2])}</li>`);
|
|
257
257
|
} else {
|
|
258
258
|
const i = l.replace(/^\s*(?:[-*+]|\d+\.)\s+/, "");
|
|
259
|
-
n.push(`<li>${
|
|
259
|
+
n.push(`<li>${Ce(i)}</li>`);
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
o += 1;
|
|
262
262
|
}
|
|
263
263
|
return {
|
|
264
264
|
html: `<${s}>${n.join("")}</${s}>`,
|
|
265
|
-
nextIndex:
|
|
265
|
+
nextIndex: o
|
|
266
266
|
};
|
|
267
|
-
},
|
|
267
|
+
}, ir = (t, e) => {
|
|
268
268
|
const s = t[e].replace(/^```/, "").trim(), n = [];
|
|
269
|
-
let
|
|
270
|
-
for (;
|
|
271
|
-
n.push(t[
|
|
269
|
+
let o = e + 1;
|
|
270
|
+
for (; o < t.length && !t[o].startsWith("```"); )
|
|
271
|
+
n.push(t[o]), o += 1;
|
|
272
272
|
return {
|
|
273
|
-
html: `<pre><code${s ? ` class="language-${
|
|
273
|
+
html: `<pre><code${s ? ` class="language-${ce(s)}"` : ""}>${ce(n.join(`
|
|
274
274
|
`))}</code></pre>`,
|
|
275
|
-
nextIndex:
|
|
275
|
+
nextIndex: o < t.length ? o + 1 : o
|
|
276
276
|
};
|
|
277
|
-
},
|
|
277
|
+
}, cr = (t, e) => {
|
|
278
278
|
const a = [];
|
|
279
279
|
let s = e;
|
|
280
280
|
for (; s < t.length; ) {
|
|
281
281
|
const n = t[s];
|
|
282
|
-
if (n.trim() === "" || n.startsWith("```") || /^#{1,6}\s+/.test(n) || /^---+$/.test(n.trim()) || /^\*\*\*+$/.test(n.trim()) ||
|
|
282
|
+
if (n.trim() === "" || n.startsWith("```") || /^#{1,6}\s+/.test(n) || /^---+$/.test(n.trim()) || /^\*\*\*+$/.test(n.trim()) || Ie(n) || _e(n) || Me(n) || s + 1 < t.length && n.includes("|") && He(t[s + 1]))
|
|
283
283
|
break;
|
|
284
284
|
a.push(n.trim()), s += 1;
|
|
285
285
|
}
|
|
286
286
|
return {
|
|
287
|
-
html: `<p>${
|
|
287
|
+
html: `<p>${Ce(a.join(" "))}</p>`,
|
|
288
288
|
nextIndex: s
|
|
289
289
|
};
|
|
290
|
-
},
|
|
290
|
+
}, et = (t) => {
|
|
291
291
|
const a = (t || "").replace(/\r\n/g, `
|
|
292
292
|
`).split(`
|
|
293
293
|
`), s = [];
|
|
294
294
|
let n = 0;
|
|
295
295
|
for (; n < a.length; ) {
|
|
296
|
-
const
|
|
296
|
+
const o = a[n], l = o.trim();
|
|
297
297
|
if (!l) {
|
|
298
298
|
n += 1;
|
|
299
299
|
continue;
|
|
300
300
|
}
|
|
301
|
-
if (
|
|
302
|
-
const i =
|
|
301
|
+
if (o.startsWith("```")) {
|
|
302
|
+
const i = ir(a, n);
|
|
303
303
|
s.push(i.html), n = i.nextIndex;
|
|
304
304
|
continue;
|
|
305
305
|
}
|
|
306
|
-
const c =
|
|
306
|
+
const c = o.match(/^(#{1,6})\s+(.*)$/);
|
|
307
307
|
if (c) {
|
|
308
308
|
const i = c[1].length;
|
|
309
|
-
s.push(`<h${i}>${
|
|
309
|
+
s.push(`<h${i}>${Ce(c[2])}</h${i}>`), n += 1;
|
|
310
310
|
continue;
|
|
311
311
|
}
|
|
312
312
|
if (/^---+$/.test(l) || /^\*\*\*+$/.test(l)) {
|
|
313
313
|
s.push("<hr>"), n += 1;
|
|
314
314
|
continue;
|
|
315
315
|
}
|
|
316
|
-
if (
|
|
317
|
-
const i =
|
|
316
|
+
if (o.includes("|") && n + 1 < a.length && He(a[n + 1])) {
|
|
317
|
+
const i = nr(a, n);
|
|
318
318
|
if (i) {
|
|
319
319
|
s.push(i.html), n = i.nextIndex;
|
|
320
320
|
continue;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
if (
|
|
323
|
+
if (Ie(o)) {
|
|
324
324
|
const i = [];
|
|
325
|
-
for (; n < a.length &&
|
|
325
|
+
for (; n < a.length && Ie(a[n]); )
|
|
326
326
|
i.push(a[n].replace(/^\s*>\s?/, "")), n += 1;
|
|
327
|
-
s.push(`<blockquote>${
|
|
327
|
+
s.push(`<blockquote>${et(i.join(`
|
|
328
328
|
`))}</blockquote>`);
|
|
329
329
|
continue;
|
|
330
330
|
}
|
|
331
|
-
if (
|
|
332
|
-
const i =
|
|
331
|
+
if (_e(o) || Me(o) || Je(o)) {
|
|
332
|
+
const i = sr(a, n);
|
|
333
333
|
s.push(i.html), n = i.nextIndex;
|
|
334
334
|
continue;
|
|
335
335
|
}
|
|
336
|
-
const
|
|
337
|
-
s.push(
|
|
336
|
+
const r = cr(a, n);
|
|
337
|
+
s.push(r.html), n = r.nextIndex;
|
|
338
338
|
}
|
|
339
339
|
return s.join("");
|
|
340
|
-
},
|
|
340
|
+
}, Be = (t) => (t.textContent || "").replace(/\u00a0/g, " "), tt = (t) => Array.from(t.childNodes).map((e) => Ne(e)).join(""), dr = (t) => {
|
|
341
341
|
const e = Array.from(t.querySelectorAll("tr"));
|
|
342
342
|
if (!e.length) return "";
|
|
343
|
-
const a = (c) => `| ${Array.from(c.children).map((i) =>
|
|
344
|
-
return [a(s),
|
|
343
|
+
const a = (c) => `| ${Array.from(c.children).map((i) => tt(i).trim()).join(" | ")} |`, s = e[0], n = s ? Array.from(s.children).length : 0, o = `| ${Array(Math.max(n, 1)).fill("---").join(" | ")} |`, l = e.slice(1).map((c) => a(c));
|
|
344
|
+
return [a(s), o, ...l].join(`
|
|
345
345
|
`);
|
|
346
|
-
},
|
|
347
|
-
const n = a,
|
|
348
|
-
return
|
|
346
|
+
}, Oe = (t, e = !1) => Array.from(t.children).filter((a) => a.nodeType === Node.ELEMENT_NODE).map((a, s) => {
|
|
347
|
+
const n = a, o = n.querySelector('input[type="checkbox"]'), l = Array.from(n.childNodes).filter((c) => !(c instanceof HTMLInputElement)).map((c) => Ne(c)).join("").trim();
|
|
348
|
+
return o ? `- [${o.checked ? "x" : " "}] ${l}` : e ? `${s + 1}. ${l}` : `- ${l}`;
|
|
349
349
|
}).join(`
|
|
350
350
|
`);
|
|
351
|
-
function
|
|
351
|
+
function Ne(t) {
|
|
352
352
|
if (t.nodeType === Node.TEXT_NODE)
|
|
353
|
-
return
|
|
353
|
+
return Be(t);
|
|
354
354
|
if (t.nodeType !== Node.ELEMENT_NODE)
|
|
355
355
|
return "";
|
|
356
|
-
const e = t, a = e.tagName.toLowerCase(), s =
|
|
356
|
+
const e = t, a = e.tagName.toLowerCase(), s = tt(e);
|
|
357
357
|
switch (a) {
|
|
358
358
|
case "br":
|
|
359
359
|
return `
|
|
@@ -374,9 +374,9 @@ function je(t) {
|
|
|
374
374
|
case "code":
|
|
375
375
|
return e.parentElement?.tagName.toLowerCase() === "pre" ? s : `\`${s}\``;
|
|
376
376
|
case "pre": {
|
|
377
|
-
const n = e.querySelector("code"), c = (n?.className || "").match(/language-([a-z0-9_-]+)/i)?.[1] || "",
|
|
377
|
+
const n = e.querySelector("code"), c = (n?.className || "").match(/language-([a-z0-9_-]+)/i)?.[1] || "", r = Be(n || e);
|
|
378
378
|
return `\`\`\`${c}
|
|
379
|
-
${
|
|
379
|
+
${r}
|
|
380
380
|
\`\`\`
|
|
381
381
|
|
|
382
382
|
`;
|
|
@@ -399,11 +399,11 @@ ${o}
|
|
|
399
399
|
`;
|
|
400
400
|
}
|
|
401
401
|
case "ul":
|
|
402
|
-
return `${
|
|
402
|
+
return `${Oe(e, !1)}
|
|
403
403
|
|
|
404
404
|
`;
|
|
405
405
|
case "ol":
|
|
406
|
-
return `${
|
|
406
|
+
return `${Oe(e, !0)}
|
|
407
407
|
|
|
408
408
|
`;
|
|
409
409
|
case "a": {
|
|
@@ -411,30 +411,30 @@ ${o}
|
|
|
411
411
|
return `[${s || n}](${n})`;
|
|
412
412
|
}
|
|
413
413
|
case "img": {
|
|
414
|
-
const n = e.getAttribute("alt") || "",
|
|
415
|
-
return
|
|
414
|
+
const n = e.getAttribute("alt") || "", o = e.getAttribute("src") || "";
|
|
415
|
+
return o ? `` : "";
|
|
416
416
|
}
|
|
417
417
|
case "hr":
|
|
418
418
|
return `---
|
|
419
419
|
|
|
420
420
|
`;
|
|
421
421
|
case "table":
|
|
422
|
-
return `${
|
|
422
|
+
return `${dr(e)}
|
|
423
423
|
|
|
424
424
|
`;
|
|
425
425
|
default:
|
|
426
426
|
return s;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
const
|
|
429
|
+
const rt = (t) => {
|
|
430
430
|
if (!t) return "";
|
|
431
431
|
if (typeof window > "u" || typeof DOMParser > "u")
|
|
432
432
|
return t;
|
|
433
433
|
const a = new DOMParser().parseFromString(t, "text/html");
|
|
434
|
-
return Array.from(a.body.childNodes).map((s) =>
|
|
434
|
+
return Array.from(a.body.childNodes).map((s) => Ne(s)).join("").replace(/\n{3,}/g, `
|
|
435
435
|
|
|
436
436
|
`).trim();
|
|
437
|
-
},
|
|
437
|
+
}, ur = /* @__PURE__ */ new Set([
|
|
438
438
|
"area",
|
|
439
439
|
"base",
|
|
440
440
|
"br",
|
|
@@ -449,42 +449,42 @@ const Je = (t) => {
|
|
|
449
449
|
"source",
|
|
450
450
|
"track",
|
|
451
451
|
"wbr"
|
|
452
|
-
]),
|
|
452
|
+
]), fr = (t) => {
|
|
453
453
|
if (!t) return "";
|
|
454
454
|
if (typeof window > "u" || typeof DOMParser > "u")
|
|
455
455
|
return t;
|
|
456
|
-
const a = new DOMParser().parseFromString(t, "text/html"), s = " ", n = (
|
|
457
|
-
if (
|
|
458
|
-
const
|
|
459
|
-
return
|
|
456
|
+
const a = new DOMParser().parseFromString(t, "text/html"), s = " ", n = (o, l) => {
|
|
457
|
+
if (o.nodeType === Node.TEXT_NODE) {
|
|
458
|
+
const p = (o.textContent || "").replace(/\s+/g, " ").trim();
|
|
459
|
+
return p ? [`${s.repeat(l)}${p}`] : [];
|
|
460
460
|
}
|
|
461
|
-
if (
|
|
461
|
+
if (o.nodeType !== Node.ELEMENT_NODE)
|
|
462
462
|
return [];
|
|
463
|
-
const c =
|
|
464
|
-
if (
|
|
465
|
-
return [`${s.repeat(l)}${
|
|
466
|
-
const
|
|
467
|
-
if (!
|
|
468
|
-
return [`${s.repeat(l)}${
|
|
469
|
-
if (c.childNodes.length === 1 && c.firstChild?.nodeType === Node.TEXT_NODE &&
|
|
470
|
-
const
|
|
471
|
-
return [`${s.repeat(l)}${
|
|
463
|
+
const c = o, r = c.tagName.toLowerCase(), i = Array.from(c.attributes).map((p) => `${p.name}="${p.value}"`).join(" "), x = i ? `<${r} ${i}>` : `<${r}>`, b = `</${r}>`;
|
|
464
|
+
if (ur.has(r))
|
|
465
|
+
return [`${s.repeat(l)}${x}`];
|
|
466
|
+
const f = Array.from(c.childNodes).flatMap((p) => n(p, l + 1));
|
|
467
|
+
if (!f.length)
|
|
468
|
+
return [`${s.repeat(l)}${x}${b}`];
|
|
469
|
+
if (c.childNodes.length === 1 && c.firstChild?.nodeType === Node.TEXT_NODE && f.length === 1) {
|
|
470
|
+
const p = f[0].trim();
|
|
471
|
+
return [`${s.repeat(l)}${x}${p}${b}`];
|
|
472
472
|
}
|
|
473
473
|
return [
|
|
474
|
-
`${s.repeat(l)}${
|
|
475
|
-
...
|
|
474
|
+
`${s.repeat(l)}${x}`,
|
|
475
|
+
...f,
|
|
476
476
|
`${s.repeat(l)}${b}`
|
|
477
477
|
];
|
|
478
478
|
};
|
|
479
|
-
return Array.from(a.body.childNodes).flatMap((
|
|
479
|
+
return Array.from(a.body.childNodes).flatMap((o) => n(o, 0)).join(`
|
|
480
480
|
`);
|
|
481
|
-
},
|
|
481
|
+
}, pr = (t) => t.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), Te = (t) => {
|
|
482
482
|
if (!t) return "";
|
|
483
483
|
if (typeof window > "u" || typeof DOMParser > "u")
|
|
484
484
|
return t.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "");
|
|
485
485
|
const a = new DOMParser().parseFromString(t, "text/html");
|
|
486
486
|
return a.querySelectorAll("script").forEach((s) => s.remove()), a.body.innerHTML;
|
|
487
|
-
},
|
|
487
|
+
}, Re = (t) => {
|
|
488
488
|
if (!t)
|
|
489
489
|
return { wrapper: null, bodyHtml: "" };
|
|
490
490
|
if (typeof window > "u" || typeof DOMParser > "u")
|
|
@@ -496,18 +496,18 @@ const Je = (t) => {
|
|
|
496
496
|
return !n || n.tagName.toLowerCase() !== "div" ? { wrapper: null, bodyHtml: t } : {
|
|
497
497
|
wrapper: {
|
|
498
498
|
tag: n.tagName.toLowerCase(),
|
|
499
|
-
attributes: Array.from(n.attributes).map((
|
|
500
|
-
name:
|
|
501
|
-
value:
|
|
499
|
+
attributes: Array.from(n.attributes).map((o) => ({
|
|
500
|
+
name: o.name,
|
|
501
|
+
value: o.value
|
|
502
502
|
}))
|
|
503
503
|
},
|
|
504
504
|
bodyHtml: n.innerHTML
|
|
505
505
|
};
|
|
506
|
-
},
|
|
506
|
+
}, Ue = (t, e) => {
|
|
507
507
|
if (!e) return t || "";
|
|
508
|
-
const a = (e.attributes || []).map(({ name: n, value:
|
|
508
|
+
const a = (e.attributes || []).map(({ name: n, value: o }) => `${n}="${pr(o)}"`).join(" ");
|
|
509
509
|
return `${a ? `<${e.tag} ${a}>` : `<${e.tag}>`}${t || ""}</${e.tag}>`;
|
|
510
|
-
},
|
|
510
|
+
}, qe = async (t, e) => e !== "md" ? t || "" : et(t || ""), Ke = async (t, e) => e !== "md" ? fr(t || "") : rt(t || ""), gr = async (t, e) => e !== "md" ? t || "" : rt(t || ""), hr = async (t) => {
|
|
511
511
|
try {
|
|
512
512
|
const e = new FormData();
|
|
513
513
|
return e.append("unique", "true"), e.append("file", t), (await (await fetch("/file/upload/uploads?id=&form=&table=", {
|
|
@@ -517,55 +517,55 @@ const Je = (t) => {
|
|
|
517
517
|
} catch (e) {
|
|
518
518
|
console.error(e);
|
|
519
519
|
}
|
|
520
|
-
},
|
|
520
|
+
}, vr = async (t, e, a) => {
|
|
521
521
|
const s = e.clipboardData?.items;
|
|
522
522
|
if (s) {
|
|
523
|
-
const n = e.clipboardData?.getData("text/html"),
|
|
523
|
+
const n = e.clipboardData?.getData("text/html"), o = e.clipboardData?.getData("text/plain");
|
|
524
524
|
if (n) {
|
|
525
|
-
const { state: l, dispatch: c } = t, { tr:
|
|
526
|
-
return c(
|
|
525
|
+
const { state: l, dispatch: c } = t, { tr: r } = l, i = a.fromSchema(t.state.schema), x = new DOMParser().parseFromString(n, "text/html").body, b = i.parse(x), f = r.replaceSelectionWith(b);
|
|
526
|
+
return c(f), e.preventDefault(), !0;
|
|
527
527
|
}
|
|
528
|
-
if (
|
|
529
|
-
const { state: l, dispatch: c } = t, { tr:
|
|
528
|
+
if (o) {
|
|
529
|
+
const { state: l, dispatch: c } = t, { tr: r } = l, i = r.insertText(o, l.selection.from, l.selection.to);
|
|
530
530
|
return c(i), e.preventDefault(), !0;
|
|
531
531
|
}
|
|
532
532
|
for (let l = 0; l < s.length; l++) {
|
|
533
533
|
const c = s[l];
|
|
534
534
|
if (c.type.startsWith("image/")) {
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
537
|
-
const i = await
|
|
535
|
+
const r = c.getAsFile();
|
|
536
|
+
if (r) {
|
|
537
|
+
const i = await hr(r), { schema: x } = t.state, b = x.nodes.image.create({
|
|
538
538
|
src: i?.file_path
|
|
539
|
-
}),
|
|
540
|
-
return t.dispatch(
|
|
539
|
+
}), f = t.state.tr.replaceSelectionWith(b);
|
|
540
|
+
return t.dispatch(f), e.preventDefault(), !0;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
return !1;
|
|
546
|
-
},
|
|
546
|
+
}, mr = (t) => String(t).trim().toLowerCase().split("-")[0], br = () => typeof window > "u" ? "uk" : mr(
|
|
547
547
|
localStorage.getItem("language") || localStorage.getItem("locale") || navigator.language || "uk"
|
|
548
|
-
),
|
|
548
|
+
), yr = (t, e) => {
|
|
549
549
|
const a = e.replace(/^form\.richtext\./, "");
|
|
550
|
-
return
|
|
551
|
-
},
|
|
552
|
-
function
|
|
553
|
-
const e =
|
|
550
|
+
return De?.[t]?.form?.richtext?.[a] || De?.uk?.form?.richtext?.[a] || e;
|
|
551
|
+
}, We = (t) => t.startsWith("form.richtext.") ? t : `form.richtext.${t}`;
|
|
552
|
+
function ze() {
|
|
553
|
+
const e = st()?.appContext?.config?.globalProperties, a = e?.$i18n;
|
|
554
554
|
return { t: (n) => {
|
|
555
|
-
const
|
|
556
|
-
if (typeof
|
|
557
|
-
const
|
|
558
|
-
if ((typeof l == "function" ? l(
|
|
559
|
-
const
|
|
560
|
-
if (
|
|
561
|
-
return
|
|
555
|
+
const o = e?.$t, l = e?.$te, c = typeof a?.te == "function" ? a.te.bind(a) : null;
|
|
556
|
+
if (typeof o == "function") {
|
|
557
|
+
const r = We(n);
|
|
558
|
+
if ((typeof l == "function" ? l(r) : typeof c == "function" ? c(r) : null) !== !1) {
|
|
559
|
+
const x = o(r);
|
|
560
|
+
if (x && x !== r)
|
|
561
|
+
return x;
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
return
|
|
564
|
+
return yr(br(), We(n));
|
|
565
565
|
} };
|
|
566
566
|
}
|
|
567
|
-
const
|
|
568
|
-
components: { Quote:
|
|
567
|
+
const xr = {
|
|
568
|
+
components: { Quote: wt },
|
|
569
569
|
props: { editor: Object },
|
|
570
570
|
methods: {
|
|
571
571
|
toggleBlockquote() {
|
|
@@ -573,18 +573,18 @@ const mr = {
|
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
};
|
|
576
|
-
function
|
|
577
|
-
const l =
|
|
578
|
-
return v(),
|
|
576
|
+
function wr(t, e, a, s, n, o) {
|
|
577
|
+
const l = Z("Quote");
|
|
578
|
+
return v(), w("button", {
|
|
579
579
|
title: "Blockquote",
|
|
580
|
-
onClick: e[0] || (e[0] = (...c) =>
|
|
580
|
+
onClick: e[0] || (e[0] = (...c) => o.toggleBlockquote && o.toggleBlockquote(...c)),
|
|
581
581
|
class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none", { "bg-gray-100 text-gray-900": a.editor?.isActive("blockquote") }])
|
|
582
582
|
}, [
|
|
583
|
-
|
|
583
|
+
C(l, { class: "h-4 w-4" })
|
|
584
584
|
], 2);
|
|
585
585
|
}
|
|
586
|
-
const
|
|
587
|
-
components: { List:
|
|
586
|
+
const kr = /* @__PURE__ */ Q(xr, [["render", wr]]), _r = {
|
|
587
|
+
components: { List: kt },
|
|
588
588
|
props: { editor: Object },
|
|
589
589
|
methods: {
|
|
590
590
|
toggleBulletList() {
|
|
@@ -592,18 +592,18 @@ const yr = /* @__PURE__ */ X(mr, [["render", br]]), xr = {
|
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
};
|
|
595
|
-
function
|
|
596
|
-
const l =
|
|
597
|
-
return v(),
|
|
595
|
+
function $r(t, e, a, s, n, o) {
|
|
596
|
+
const l = Z("List");
|
|
597
|
+
return v(), w("button", {
|
|
598
598
|
title: "Bullet List",
|
|
599
|
-
onClick: e[0] || (e[0] = (...c) =>
|
|
599
|
+
onClick: e[0] || (e[0] = (...c) => o.toggleBulletList && o.toggleBulletList(...c)),
|
|
600
600
|
class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("bulletList") }])
|
|
601
601
|
}, [
|
|
602
|
-
|
|
602
|
+
C(l, { class: "h-4 w-4" })
|
|
603
603
|
], 2);
|
|
604
604
|
}
|
|
605
|
-
const
|
|
606
|
-
components: { ListOrdered:
|
|
605
|
+
const Cr = /* @__PURE__ */ Q(_r, [["render", $r]]), Ar = {
|
|
606
|
+
components: { ListOrdered: _t },
|
|
607
607
|
props: { editor: Object },
|
|
608
608
|
methods: {
|
|
609
609
|
toggleOrderedList() {
|
|
@@ -611,18 +611,18 @@ const kr = /* @__PURE__ */ X(xr, [["render", wr]]), _r = {
|
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
};
|
|
614
|
-
function
|
|
615
|
-
const l =
|
|
616
|
-
return v(),
|
|
614
|
+
function Fr(t, e, a, s, n, o) {
|
|
615
|
+
const l = Z("ListOrdered");
|
|
616
|
+
return v(), w("button", {
|
|
617
617
|
title: "Ordered List",
|
|
618
|
-
onClick: e[0] || (e[0] = (...c) =>
|
|
618
|
+
onClick: e[0] || (e[0] = (...c) => o.toggleOrderedList && o.toggleOrderedList(...c)),
|
|
619
619
|
class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("orderedList") }])
|
|
620
620
|
}, [
|
|
621
|
-
|
|
621
|
+
C(l, { class: "h-4 w-4" })
|
|
622
622
|
], 2);
|
|
623
623
|
}
|
|
624
|
-
const
|
|
625
|
-
components: { CodeXml:
|
|
624
|
+
const Sr = /* @__PURE__ */ Q(Ar, [["render", Fr]]), Tr = {
|
|
625
|
+
components: { CodeXml: $t },
|
|
626
626
|
props: { editor: Object },
|
|
627
627
|
methods: {
|
|
628
628
|
toggleCodeBlock() {
|
|
@@ -630,18 +630,18 @@ const Cr = /* @__PURE__ */ X(_r, [["render", $r]]), Ar = {
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
};
|
|
633
|
-
function
|
|
634
|
-
const l =
|
|
635
|
-
return v(),
|
|
633
|
+
function Lr(t, e, a, s, n, o) {
|
|
634
|
+
const l = Z("CodeXml");
|
|
635
|
+
return v(), w("button", {
|
|
636
636
|
title: "Code Block",
|
|
637
|
-
onClick: e[0] || (e[0] = (...c) =>
|
|
637
|
+
onClick: e[0] || (e[0] = (...c) => o.toggleCodeBlock && o.toggleCodeBlock(...c)),
|
|
638
638
|
class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("codeBlock") }])
|
|
639
639
|
}, [
|
|
640
|
-
|
|
640
|
+
C(l, { class: "h-4 w-4" })
|
|
641
641
|
], 2);
|
|
642
642
|
}
|
|
643
|
-
const
|
|
644
|
-
components: { Bold:
|
|
643
|
+
const Br = /* @__PURE__ */ Q(Tr, [["render", Lr]]), Er = {
|
|
644
|
+
components: { Bold: Ct },
|
|
645
645
|
props: {
|
|
646
646
|
editor: Object
|
|
647
647
|
},
|
|
@@ -651,19 +651,19 @@ const Sr = /* @__PURE__ */ X(Ar, [["render", Fr]]), Tr = {
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
};
|
|
654
|
-
function
|
|
655
|
-
const l =
|
|
656
|
-
return v(),
|
|
654
|
+
function Ir(t, e, a, s, n, o) {
|
|
655
|
+
const l = Z("Bold");
|
|
656
|
+
return v(), w("button", {
|
|
657
657
|
title: "Bold Text",
|
|
658
|
-
onClick: e[0] || (e[0] = (...c) =>
|
|
658
|
+
onClick: e[0] || (e[0] = (...c) => o.toggleBold && o.toggleBold(...c)),
|
|
659
659
|
class: E(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("bold") }])
|
|
660
660
|
}, [
|
|
661
|
-
|
|
661
|
+
C(l, { class: "h-4 w-4" }),
|
|
662
662
|
e[1] || (e[1] = d("span", { class: "sr-only" }, "Bold", -1))
|
|
663
663
|
], 2);
|
|
664
664
|
}
|
|
665
|
-
const
|
|
666
|
-
components: { Italic:
|
|
665
|
+
const Pr = /* @__PURE__ */ Q(Er, [["render", Ir]]), jr = {
|
|
666
|
+
components: { Italic: At },
|
|
667
667
|
props: {
|
|
668
668
|
editor: Object
|
|
669
669
|
},
|
|
@@ -673,53 +673,53 @@ const Br = /* @__PURE__ */ X(Tr, [["render", Lr]]), Er = {
|
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
675
|
};
|
|
676
|
-
function
|
|
677
|
-
const l =
|
|
678
|
-
return v(),
|
|
676
|
+
function Mr(t, e, a, s, n, o) {
|
|
677
|
+
const l = Z("Italic");
|
|
678
|
+
return v(), w("button", {
|
|
679
679
|
title: "Italic Text",
|
|
680
|
-
onClick: e[0] || (e[0] = (...c) =>
|
|
680
|
+
onClick: e[0] || (e[0] = (...c) => o.toggleItalic && o.toggleItalic(...c)),
|
|
681
681
|
class: E(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("italic") }])
|
|
682
682
|
}, [
|
|
683
|
-
|
|
683
|
+
C(l, { class: "h-4 w-4" }),
|
|
684
684
|
e[1] || (e[1] = d("span", { class: "sr-only" }, "Italic", -1))
|
|
685
685
|
], 2);
|
|
686
686
|
}
|
|
687
|
-
const
|
|
687
|
+
const Hr = /* @__PURE__ */ Q(jr, [["render", Mr]]), Nr = {
|
|
688
688
|
__name: "vs-editor-underline",
|
|
689
689
|
props: { editor: Object },
|
|
690
690
|
setup(t) {
|
|
691
691
|
const e = t, a = () => {
|
|
692
692
|
e.editor && e.editor.chain().focus().toggleUnderline().run();
|
|
693
693
|
};
|
|
694
|
-
return (s, n) => (v(),
|
|
694
|
+
return (s, n) => (v(), w("button", {
|
|
695
695
|
title: "Underline",
|
|
696
696
|
onClick: a,
|
|
697
697
|
class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", [
|
|
698
698
|
t.editor?.isActive("underline") ? "bg-gray-100 text-gray-900" : "text-gray-500"
|
|
699
699
|
]])
|
|
700
700
|
}, [
|
|
701
|
-
|
|
701
|
+
C(L(Ft), { class: "h-4 w-4" })
|
|
702
702
|
], 2));
|
|
703
703
|
}
|
|
704
|
-
},
|
|
704
|
+
}, zr = {
|
|
705
705
|
__name: "vs-editor-strike",
|
|
706
706
|
props: { editor: Object },
|
|
707
707
|
setup(t) {
|
|
708
708
|
const e = t, a = () => {
|
|
709
709
|
e.editor && e.editor.chain().focus().toggleStrike().run();
|
|
710
710
|
};
|
|
711
|
-
return (s, n) => (v(),
|
|
711
|
+
return (s, n) => (v(), w("button", {
|
|
712
712
|
title: "Strikethrough",
|
|
713
713
|
onClick: a,
|
|
714
714
|
class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", [
|
|
715
715
|
t.editor?.isActive("strike") ? "bg-gray-100 text-gray-900" : "text-gray-500"
|
|
716
716
|
]])
|
|
717
717
|
}, [
|
|
718
|
-
|
|
718
|
+
C(L(St), { class: "h-4 w-4" })
|
|
719
719
|
], 2));
|
|
720
720
|
}
|
|
721
|
-
},
|
|
722
|
-
components: { X:
|
|
721
|
+
}, Dr = {
|
|
722
|
+
components: { X: Pe },
|
|
723
723
|
props: {
|
|
724
724
|
visible: { type: Boolean, default: () => !1 },
|
|
725
725
|
modelValue: { type: Boolean, default: () => !1 },
|
|
@@ -761,63 +761,63 @@ const Pr = /* @__PURE__ */ X(Er, [["render", Ir]]), jr = {
|
|
|
761
761
|
e && t.target.classList.contains("vs-dialog-overlay") && this.handleClose();
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
},
|
|
764
|
+
}, Vr = {
|
|
765
765
|
key: 0,
|
|
766
766
|
class: "vsTailwind ui-dialog__wrapper"
|
|
767
|
-
},
|
|
767
|
+
}, Or = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, Rr = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, Ur = { class: "ui-dialog__content p-4" }, qr = {
|
|
768
768
|
key: 0,
|
|
769
769
|
class: "flex justify-end gap-x-2"
|
|
770
770
|
};
|
|
771
|
-
function
|
|
772
|
-
const l =
|
|
773
|
-
return v(),
|
|
774
|
-
a.visible || a.modelValue ? (v(),
|
|
771
|
+
function Kr(t, e, a, s, n, o) {
|
|
772
|
+
const l = Z("X");
|
|
773
|
+
return v(), W(Ge, { to: "body" }, [
|
|
774
|
+
a.visible || a.modelValue ? (v(), w("div", Vr, [
|
|
775
775
|
d("div", {
|
|
776
|
-
onMousedown: e[1] || (e[1] = (c) =>
|
|
776
|
+
onMousedown: e[1] || (e[1] = (c) => o.closeByClickBack(c, a.closeClickBack)),
|
|
777
777
|
class: "vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[100001] bg-black bg-opacity-50"
|
|
778
778
|
}, [
|
|
779
|
-
|
|
779
|
+
C(Ye, {
|
|
780
780
|
name: "content",
|
|
781
781
|
appear: ""
|
|
782
782
|
}, {
|
|
783
|
-
default:
|
|
783
|
+
default: q(() => [
|
|
784
784
|
d("div", {
|
|
785
|
-
class: E(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl", [
|
|
785
|
+
class: E(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl", [o.checkSize]])
|
|
786
786
|
}, [
|
|
787
|
-
d("div",
|
|
788
|
-
d("h3",
|
|
787
|
+
d("div", Or, [
|
|
788
|
+
d("h3", Rr, Y(a.title), 1),
|
|
789
789
|
d("button", {
|
|
790
790
|
type: "button",
|
|
791
791
|
class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",
|
|
792
|
-
onClick: e[0] || (e[0] = (...c) =>
|
|
792
|
+
onClick: e[0] || (e[0] = (...c) => o.handleClose && o.handleClose(...c))
|
|
793
793
|
}, [
|
|
794
794
|
e[2] || (e[2] = d("span", { class: "sr-only" }, "Close", -1)),
|
|
795
|
-
|
|
795
|
+
C(l, { class: "h-4 w-4 flex-shrink-0" })
|
|
796
796
|
])
|
|
797
797
|
]),
|
|
798
|
-
d("div",
|
|
799
|
-
|
|
798
|
+
d("div", Ur, [
|
|
799
|
+
we(t.$slots, "default", {}, void 0, !0)
|
|
800
800
|
]),
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
handleClose:
|
|
804
|
-
handleConfirm:
|
|
805
|
-
handleCancel:
|
|
801
|
+
o.hasSlot ? (v(), w("div", qr, [
|
|
802
|
+
we(t.$slots, "footer", {
|
|
803
|
+
handleClose: o.handleClose,
|
|
804
|
+
handleConfirm: o.handleConfirm,
|
|
805
|
+
handleCancel: o.handleCancel
|
|
806
806
|
}, void 0, !0)
|
|
807
|
-
])) :
|
|
807
|
+
])) : U("", !0)
|
|
808
808
|
], 2)
|
|
809
809
|
]),
|
|
810
810
|
_: 3
|
|
811
811
|
})
|
|
812
812
|
], 32)
|
|
813
|
-
])) :
|
|
813
|
+
])) : U("", !0)
|
|
814
814
|
]);
|
|
815
815
|
}
|
|
816
|
-
const
|
|
816
|
+
const ot = /* @__PURE__ */ Q(Dr, [["render", Kr], ["__scopeId", "data-v-56ad9010"]]), Wr = it({
|
|
817
817
|
components: {
|
|
818
|
-
IconClose:
|
|
819
|
-
IconSearch:
|
|
820
|
-
IconEmail:
|
|
818
|
+
IconClose: Pe,
|
|
819
|
+
IconSearch: Lt,
|
|
820
|
+
IconEmail: Tt
|
|
821
821
|
},
|
|
822
822
|
inheritAttrs: !1,
|
|
823
823
|
props: {
|
|
@@ -896,39 +896,39 @@ const et = /* @__PURE__ */ X(Hr, [["render", Rr], ["__scopeId", "data-v-56ad9010
|
|
|
896
896
|
await this.$refs.vsText?.focus();
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
|
-
}),
|
|
899
|
+
}), Xr = { class: "vs-form-text relative bg-white rounded-lg" }, Gr = {
|
|
900
900
|
key: 2,
|
|
901
901
|
class: "absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"
|
|
902
|
-
},
|
|
903
|
-
function
|
|
904
|
-
const l =
|
|
905
|
-
return v(),
|
|
906
|
-
t.clearable && t.value ? (v(),
|
|
902
|
+
}, Yr = ["disabled", "type", "placeholder"];
|
|
903
|
+
function Qr(t, e, a, s, n, o) {
|
|
904
|
+
const l = Z("IconClose"), c = Z("IconSearch"), r = Z("IconEmail");
|
|
905
|
+
return v(), w("div", Xr, [
|
|
906
|
+
t.clearable && t.value ? (v(), w("div", {
|
|
907
907
|
key: 0,
|
|
908
908
|
class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",
|
|
909
909
|
onClick: e[0] || (e[0] = (...i) => t.clearInput && t.clearInput(...i))
|
|
910
910
|
}, [
|
|
911
|
-
|
|
912
|
-
])) :
|
|
913
|
-
t.icon && t.icon === "search" ? (v(),
|
|
911
|
+
C(l, { class: "h-4 w-4 stroke-gray-500 transition-all hover:stroke-red-500" })
|
|
912
|
+
])) : U("", !0),
|
|
913
|
+
t.icon && t.icon === "search" ? (v(), w("div", {
|
|
914
914
|
key: 1,
|
|
915
915
|
class: E(["absolute bottom-2/4 translate-y-2/4 cursor-pointer", t.iconStylePosition])
|
|
916
916
|
}, [
|
|
917
|
-
|
|
918
|
-
], 2)) : t.icon && t.icon === "email" ? (v(),
|
|
919
|
-
|
|
920
|
-
])) : (v(),
|
|
917
|
+
C(c, { class: "h-4 w-4 stroke-gray-500 transition-all" })
|
|
918
|
+
], 2)) : t.icon && t.icon === "email" ? (v(), w("div", Gr, [
|
|
919
|
+
C(r, { class: "h-4 w-4 stroke-gray-500 transition-all" })
|
|
920
|
+
])) : (v(), w("i", {
|
|
921
921
|
key: 3,
|
|
922
922
|
class: E(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer", ["ti " + t.icon, t.iconStylePosition]])
|
|
923
923
|
}, null, 2)),
|
|
924
|
-
t.clearable && t.value ? (v(),
|
|
924
|
+
t.clearable && t.value ? (v(), w("div", {
|
|
925
925
|
key: 4,
|
|
926
926
|
class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",
|
|
927
927
|
onClick: e[1] || (e[1] = (...i) => t.clearInput && t.clearInput(...i))
|
|
928
928
|
}, [
|
|
929
|
-
|
|
930
|
-
])) :
|
|
931
|
-
|
|
929
|
+
C(l, { class: "h-4 w-4 stroke-gray-500 transition-all hover:stroke-red-500" })
|
|
930
|
+
])) : U("", !0),
|
|
931
|
+
de(d("input", ct({
|
|
932
932
|
ref: "vsText",
|
|
933
933
|
disabled: t.disabled,
|
|
934
934
|
type: t.type,
|
|
@@ -939,109 +939,109 @@ function Xr(t, e, a, s, n, r) {
|
|
|
939
939
|
onFocus: e[4] || (e[4] = (...i) => t.handleFocus && t.handleFocus(...i)),
|
|
940
940
|
onBlur: e[5] || (e[5] = (...i) => t.handleBlur && t.handleBlur(...i)),
|
|
941
941
|
class: [[t.inputStyle, t.checkSize], "py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]
|
|
942
|
-
}), null, 16,
|
|
943
|
-
[
|
|
942
|
+
}), null, 16, Yr), [
|
|
943
|
+
[dt, t.value]
|
|
944
944
|
])
|
|
945
945
|
]);
|
|
946
946
|
}
|
|
947
|
-
const
|
|
947
|
+
const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f"]]), Zr = ["title"], Jr = { class: "flex flex-col gap-3 p-[20px]" }, eo = { class: "relative flex items-center gap-2" }, to = { class: "flex-1" }, ro = {
|
|
948
948
|
key: 0,
|
|
949
949
|
class: "flex items-center gap-2 flex-shrink-0"
|
|
950
|
-
},
|
|
950
|
+
}, oo = ["title"], lo = ["title"], ao = { class: "flex items-center gap-2" }, no = {
|
|
951
951
|
for: "openInNewTab",
|
|
952
952
|
class: "text-sm text-gray-700 cursor-pointer"
|
|
953
|
-
},
|
|
953
|
+
}, so = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, io = /* @__PURE__ */ Object.assign({
|
|
954
954
|
inheritAttrs: !1
|
|
955
955
|
}, {
|
|
956
956
|
__name: "vs-editor-link",
|
|
957
957
|
props: { editor: Object },
|
|
958
958
|
setup(t) {
|
|
959
|
-
const { t: e } =
|
|
959
|
+
const { t: e } = ze(), a = t, s = $(!1), n = $(""), o = $(!1), l = $(!1), c = () => {
|
|
960
960
|
if (!a.editor) return;
|
|
961
961
|
a.editor.chain().focus().extendMarkRange("link").run();
|
|
962
|
-
const
|
|
963
|
-
|
|
964
|
-
},
|
|
965
|
-
s.value = !1, n.value = "",
|
|
962
|
+
const f = a.editor.getAttributes("link");
|
|
963
|
+
f.href ? (o.value = !0, n.value = f.href, l.value = f.target === "_blank") : (o.value = !1, n.value = "", l.value = !1), s.value = !0;
|
|
964
|
+
}, r = () => {
|
|
965
|
+
s.value = !1, n.value = "", o.value = !1, l.value = !1;
|
|
966
966
|
}, i = () => {
|
|
967
967
|
if (!a.editor || !n.value.trim()) return;
|
|
968
|
-
let
|
|
969
|
-
|
|
970
|
-
href:
|
|
968
|
+
let f = n.value.trim();
|
|
969
|
+
f.match(/^https?:\/\//i) || (f = "https://" + f), a.editor.chain().focus().setLink({
|
|
970
|
+
href: f,
|
|
971
971
|
target: l.value ? "_blank" : null
|
|
972
|
-
}).run(),
|
|
973
|
-
},
|
|
974
|
-
a.editor && (a.editor.chain().focus().unsetLink().run(),
|
|
972
|
+
}).run(), r();
|
|
973
|
+
}, x = () => {
|
|
974
|
+
a.editor && (a.editor.chain().focus().unsetLink().run(), r());
|
|
975
975
|
}, b = () => {
|
|
976
976
|
if (!n.value) return;
|
|
977
|
-
let
|
|
978
|
-
|
|
977
|
+
let f = n.value.trim();
|
|
978
|
+
f.match(/^https?:\/\//i) || (f = "https://" + f), window.open(f, "_blank", "noopener,noreferrer");
|
|
979
979
|
};
|
|
980
|
-
return (
|
|
980
|
+
return (f, p) => (v(), w(ae, null, [
|
|
981
981
|
d("button", {
|
|
982
982
|
title: L(e)("form.richtext.link") || "Посилання",
|
|
983
983
|
onClick: c,
|
|
984
984
|
class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none", { "bg-gray-100 text-gray-900": t.editor?.isActive("link") }])
|
|
985
985
|
}, [
|
|
986
|
-
|
|
987
|
-
], 10,
|
|
988
|
-
|
|
989
|
-
title:
|
|
986
|
+
C(L(Bt), { class: "h-4 w-4" })
|
|
987
|
+
], 10, Zr),
|
|
988
|
+
C(ot, {
|
|
989
|
+
title: o.value ? L(e)("form.richtext.editLink") || "Редагувати посилання" : L(e)("form.richtext.linkTitle") || "Додати посилання",
|
|
990
990
|
visible: s.value,
|
|
991
|
-
"onUpdate:visible":
|
|
991
|
+
"onUpdate:visible": p[2] || (p[2] = (I) => s.value = I),
|
|
992
992
|
size: "small"
|
|
993
993
|
}, {
|
|
994
|
-
footer:
|
|
995
|
-
d("div",
|
|
994
|
+
footer: q(() => [
|
|
995
|
+
d("div", so, [
|
|
996
996
|
d("button", {
|
|
997
997
|
style: { border: "1px solid #000" },
|
|
998
|
-
onClick:
|
|
998
|
+
onClick: r,
|
|
999
999
|
class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"
|
|
1000
|
-
},
|
|
1000
|
+
}, Y(L(e)("form.richtext.cancel") || "Скасувати"), 1),
|
|
1001
1001
|
d("button", {
|
|
1002
1002
|
onClick: i,
|
|
1003
1003
|
class: "py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"
|
|
1004
|
-
},
|
|
1004
|
+
}, Y(o.value ? L(e)("form.richtext.update") || "Оновити" : L(e)("form.richtext.create") || "Створити"), 1)
|
|
1005
1005
|
])
|
|
1006
1006
|
]),
|
|
1007
|
-
default:
|
|
1008
|
-
d("div",
|
|
1009
|
-
d("div",
|
|
1010
|
-
d("div",
|
|
1011
|
-
|
|
1007
|
+
default: q(() => [
|
|
1008
|
+
d("div", Jr, [
|
|
1009
|
+
d("div", eo, [
|
|
1010
|
+
d("div", to, [
|
|
1011
|
+
C(lt, {
|
|
1012
1012
|
modelValue: n.value,
|
|
1013
|
-
"onUpdate:modelValue":
|
|
1013
|
+
"onUpdate:modelValue": p[0] || (p[0] = (I) => n.value = I),
|
|
1014
1014
|
placeholder: L(e)("form.richtext.linkUrl") || "Введіть URL",
|
|
1015
1015
|
class: "w-full"
|
|
1016
1016
|
}, null, 8, ["modelValue", "placeholder"])
|
|
1017
1017
|
]),
|
|
1018
|
-
|
|
1018
|
+
o.value ? (v(), w("div", ro, [
|
|
1019
1019
|
d("button", {
|
|
1020
1020
|
onClick: b,
|
|
1021
1021
|
class: "text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none transition-colors",
|
|
1022
1022
|
title: L(e)("form.richtext.openLink") || "Відкрити посилання"
|
|
1023
1023
|
}, [
|
|
1024
|
-
|
|
1025
|
-
], 8,
|
|
1024
|
+
C(L(Et), { class: "h-4 w-4" })
|
|
1025
|
+
], 8, oo),
|
|
1026
1026
|
d("button", {
|
|
1027
|
-
onClick:
|
|
1027
|
+
onClick: x,
|
|
1028
1028
|
class: "text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-red-600 hover:bg-red-50 focus:outline-none transition-colors",
|
|
1029
1029
|
title: L(e)("form.richtext.removeLink") || "Видалити посилання"
|
|
1030
1030
|
}, [
|
|
1031
|
-
|
|
1032
|
-
], 8,
|
|
1033
|
-
])) :
|
|
1031
|
+
C(L(It), { class: "h-4 w-4" })
|
|
1032
|
+
], 8, lo)
|
|
1033
|
+
])) : U("", !0)
|
|
1034
1034
|
]),
|
|
1035
|
-
d("div",
|
|
1036
|
-
|
|
1035
|
+
d("div", ao, [
|
|
1036
|
+
de(d("input", {
|
|
1037
1037
|
type: "checkbox",
|
|
1038
1038
|
id: "openInNewTab",
|
|
1039
|
-
"onUpdate:modelValue":
|
|
1039
|
+
"onUpdate:modelValue": p[1] || (p[1] = (I) => l.value = I),
|
|
1040
1040
|
class: "w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"
|
|
1041
1041
|
}, null, 512), [
|
|
1042
|
-
[
|
|
1042
|
+
[ut, l.value]
|
|
1043
1043
|
]),
|
|
1044
|
-
d("label",
|
|
1044
|
+
d("label", no, Y(L(e)("form.richtext.openInNewTab") || "Відкривати в новій вкладці"), 1)
|
|
1045
1045
|
])
|
|
1046
1046
|
])
|
|
1047
1047
|
]),
|
|
@@ -1049,48 +1049,48 @@ const tt = /* @__PURE__ */ X(Ur, [["render", Xr], ["__scopeId", "data-v-eb21a54f
|
|
|
1049
1049
|
}, 8, ["title", "visible"])
|
|
1050
1050
|
], 64));
|
|
1051
1051
|
}
|
|
1052
|
-
}),
|
|
1052
|
+
}), xe = async (t, e, a, s = 10) => {
|
|
1053
1053
|
if (!e || !a) return;
|
|
1054
|
-
await
|
|
1055
|
-
const n = await a?.getBoundingClientRect(),
|
|
1056
|
-
if (!
|
|
1057
|
-
const l = await parseInt(e?.getBoundingClientRect()?.height), c = await parseInt(e?.getBoundingClientRect()?.width),
|
|
1058
|
-
let
|
|
1059
|
-
const
|
|
1054
|
+
await ue();
|
|
1055
|
+
const n = await a?.getBoundingClientRect(), o = await e?.getBoundingClientRect();
|
|
1056
|
+
if (!o || !n) return;
|
|
1057
|
+
const l = await parseInt(e?.getBoundingClientRect()?.height), c = await parseInt(e?.getBoundingClientRect()?.width), r = await parseInt(a?.getBoundingClientRect()?.height), i = await parseInt(a?.getBoundingClientRect()?.width), x = await window.innerHeight, b = await window.innerWidth;
|
|
1058
|
+
let f = 0, p = 0;
|
|
1059
|
+
const I = o.bottom + s + r;
|
|
1060
1060
|
switch (t) {
|
|
1061
1061
|
case "top":
|
|
1062
|
-
|
|
1062
|
+
o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, b > i + o.right + 30 ? p = o.left - n.width / 2 + o.width / 2 : p = b - 30 - i;
|
|
1063
1063
|
break;
|
|
1064
1064
|
case "bottom":
|
|
1065
|
-
|
|
1065
|
+
x > I ? f = o.bottom + s : f = o.bottom - s - r - l, p = o.left - n.width / 2 + o.width / 2;
|
|
1066
1066
|
break;
|
|
1067
1067
|
case "left":
|
|
1068
|
-
|
|
1068
|
+
f = o.top - n.height / 2 + o.height / 2, o.left - n.width - s > 0 ? p = o.left - n.width - s : p = 10;
|
|
1069
1069
|
break;
|
|
1070
1070
|
case "right":
|
|
1071
|
-
|
|
1071
|
+
f = o.top - n.height / 2 + o.height / 2, b - c > i ? p = o.right + s : p = b - 30 - i;
|
|
1072
1072
|
break;
|
|
1073
1073
|
case "top-right":
|
|
1074
|
-
|
|
1074
|
+
o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, b - c > i ? p = o.right + s : p = b - 30 - i;
|
|
1075
1075
|
break;
|
|
1076
1076
|
case "top-left":
|
|
1077
|
-
|
|
1077
|
+
o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, o.left - n.width - s > 0 ? p = o.left - n.width - s : p = 10;
|
|
1078
1078
|
break;
|
|
1079
1079
|
case "top-start":
|
|
1080
|
-
|
|
1080
|
+
o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, o.left > 0 ? p = o.left : p = 10;
|
|
1081
1081
|
break;
|
|
1082
1082
|
case "bottom-right":
|
|
1083
|
-
|
|
1083
|
+
x > I ? f = o.bottom + s : f = o.bottom - s - r - l, b - c > i ? p = o.left : p = b - 30 - i;
|
|
1084
1084
|
break;
|
|
1085
1085
|
case "bottom-left":
|
|
1086
|
-
|
|
1086
|
+
x > I ? f = o.bottom + s : f = o.bottom - s - r - l, o.left > 0 ? p = o.right - i : p = 10;
|
|
1087
1087
|
break;
|
|
1088
1088
|
case "bottom-start":
|
|
1089
|
-
|
|
1089
|
+
x > I ? f = o.bottom + s : f = o.bottom - s - r - l, o.left > 0 ? p = o.left : p = 10;
|
|
1090
1090
|
break;
|
|
1091
1091
|
}
|
|
1092
|
-
|
|
1093
|
-
},
|
|
1092
|
+
f + r > x ? f = x - r - s : f < 0 && (f = s), p + i > b ? p = b - i - s : p < 0 && (p = s), a instanceof HTMLElement && (a.style.top = `${f}px`, a.style.left = `${p}px`, a.style.position = "fixed");
|
|
1093
|
+
}, co = { class: "text-center" }, uo = { class: "py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, fe = /* @__PURE__ */ Object.assign({
|
|
1094
1094
|
inheritAttrs: !1
|
|
1095
1095
|
}, {
|
|
1096
1096
|
__name: "vs-popover",
|
|
@@ -1105,98 +1105,98 @@ const tt = /* @__PURE__ */ X(Ur, [["render", Xr], ["__scopeId", "data-v-eb21a54f
|
|
|
1105
1105
|
},
|
|
1106
1106
|
emits: ["isvisible"],
|
|
1107
1107
|
setup(t, { expose: e, emit: a }) {
|
|
1108
|
-
const s = t, n = a,
|
|
1109
|
-
|
|
1110
|
-
|
|
1108
|
+
const s = t, n = a, o = $(!1), l = $([]), c = $(null), r = $(null), i = $(null);
|
|
1109
|
+
me(o, (P) => {
|
|
1110
|
+
P ? (x(), window.addEventListener(
|
|
1111
1111
|
"resize",
|
|
1112
|
-
() =>
|
|
1113
|
-
),
|
|
1112
|
+
() => xe(s.placement, r.value, i.value)
|
|
1113
|
+
), xe(s.placement, r.value, i.value)) : window.removeEventListener(
|
|
1114
1114
|
"resize",
|
|
1115
|
-
() =>
|
|
1116
|
-
), n("isvisible",
|
|
1117
|
-
}),
|
|
1118
|
-
window.addEventListener("click",
|
|
1119
|
-
}),
|
|
1120
|
-
window.removeEventListener("click",
|
|
1115
|
+
() => xe(s.placement, r.value, i.value)
|
|
1116
|
+
), n("isvisible", P);
|
|
1117
|
+
}), be(() => {
|
|
1118
|
+
window.addEventListener("click", O), window.addEventListener("popstate", R), window.addEventListener("scroll", J, !0), x();
|
|
1119
|
+
}), Qe(() => {
|
|
1120
|
+
window.removeEventListener("click", O), window.removeEventListener("popstate", R), b();
|
|
1121
1121
|
});
|
|
1122
|
-
const
|
|
1123
|
-
let
|
|
1124
|
-
for (;
|
|
1125
|
-
(
|
|
1126
|
-
document.body && (document.body.addEventListener("scroll",
|
|
1122
|
+
const x = () => {
|
|
1123
|
+
let P = c.value;
|
|
1124
|
+
for (; P && P !== document.body; )
|
|
1125
|
+
(P.scrollHeight > P.clientHeight || P.scrollWidth > P.clientWidth) && (P.addEventListener("scroll", V), l.value.push(P)), P = P.parentElement;
|
|
1126
|
+
document.body && (document.body.addEventListener("scroll", V), l.value.push(document.body));
|
|
1127
1127
|
}, b = () => {
|
|
1128
|
-
l.value.forEach((
|
|
1129
|
-
|
|
1128
|
+
l.value.forEach((P) => {
|
|
1129
|
+
P.removeEventListener("scroll", V);
|
|
1130
1130
|
}), l.value = [];
|
|
1131
|
+
}, f = () => {
|
|
1132
|
+
o.value = !0, xe(s.placement, r.value, i.value);
|
|
1131
1133
|
}, p = () => {
|
|
1132
|
-
|
|
1133
|
-
},
|
|
1134
|
-
r.value = !
|
|
1135
|
-
},
|
|
1136
|
-
|
|
1137
|
-
}, O = () => {
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
if (!I) {
|
|
1141
|
-
r.value = !1;
|
|
1134
|
+
o.value = !1;
|
|
1135
|
+
}, I = async () => {
|
|
1136
|
+
await xe(s.placement, r.value, i.value), o.value = !o.value;
|
|
1137
|
+
}, V = () => {
|
|
1138
|
+
o.value = !1;
|
|
1139
|
+
}, O = (P) => {
|
|
1140
|
+
if (!P) {
|
|
1141
|
+
o.value = !1;
|
|
1142
1142
|
return;
|
|
1143
1143
|
}
|
|
1144
|
-
|
|
1145
|
-
},
|
|
1146
|
-
|
|
1147
|
-
},
|
|
1148
|
-
|
|
1144
|
+
r.value?.contains(P.target) || i.value?.contains(P.target) || (o.value = !1);
|
|
1145
|
+
}, R = () => {
|
|
1146
|
+
o.value && (o.value = !1);
|
|
1147
|
+
}, J = (P) => {
|
|
1148
|
+
o.value && i.value && !i.value.contains(P.target) && (o.value = !1);
|
|
1149
1149
|
};
|
|
1150
1150
|
return e({
|
|
1151
|
-
togglePopover:
|
|
1152
|
-
}), (
|
|
1151
|
+
togglePopover: I
|
|
1152
|
+
}), (P, ee) => (v(), w("div", {
|
|
1153
1153
|
ref_key: "popover",
|
|
1154
1154
|
ref: c,
|
|
1155
1155
|
class: "vs-popover inline-block"
|
|
1156
1156
|
}, [
|
|
1157
|
-
d("div",
|
|
1158
|
-
t.trigger === "click" ? (v(),
|
|
1157
|
+
d("div", co, [
|
|
1158
|
+
t.trigger === "click" ? (v(), w("div", {
|
|
1159
1159
|
key: 0,
|
|
1160
1160
|
ref_key: "popoverRef",
|
|
1161
|
-
ref:
|
|
1162
|
-
onClick:
|
|
1161
|
+
ref: r,
|
|
1162
|
+
onClick: I,
|
|
1163
1163
|
class: E({ "pointer-events-none": t.disabled })
|
|
1164
1164
|
}, [
|
|
1165
|
-
|
|
1166
|
-
|
|
1165
|
+
we(P.$slots, "reference", {}, () => [
|
|
1166
|
+
ee[0] || (ee[0] = d("button", null, "Click me!", -1))
|
|
1167
1167
|
])
|
|
1168
|
-
], 2)) :
|
|
1169
|
-
t.trigger === "hover" ? (v(),
|
|
1168
|
+
], 2)) : U("", !0),
|
|
1169
|
+
t.trigger === "hover" ? (v(), w("div", {
|
|
1170
1170
|
key: 1,
|
|
1171
1171
|
ref_key: "popoverRef",
|
|
1172
|
-
ref:
|
|
1173
|
-
onMouseover:
|
|
1174
|
-
onMouseleave:
|
|
1172
|
+
ref: r,
|
|
1173
|
+
onMouseover: f,
|
|
1174
|
+
onMouseleave: p,
|
|
1175
1175
|
class: E({ "pointer-events-none": t.disabled })
|
|
1176
1176
|
}, [
|
|
1177
|
-
|
|
1178
|
-
|
|
1177
|
+
we(P.$slots, "reference", {}, () => [
|
|
1178
|
+
ee[1] || (ee[1] = d("button", null, "Click me!", -1))
|
|
1179
1179
|
])
|
|
1180
|
-
], 34)) :
|
|
1181
|
-
(v(),
|
|
1182
|
-
|
|
1183
|
-
default:
|
|
1184
|
-
|
|
1180
|
+
], 34)) : U("", !0),
|
|
1181
|
+
(v(), W(Ge, { to: t.teleport }, [
|
|
1182
|
+
C(Ye, { name: "fade" }, {
|
|
1183
|
+
default: q(() => [
|
|
1184
|
+
de(d("div", {
|
|
1185
1185
|
class: E(["vsTailwind vs-popover__content", t.placement]),
|
|
1186
1186
|
ref_key: "contentPop",
|
|
1187
1187
|
ref: i,
|
|
1188
|
-
style:
|
|
1188
|
+
style: se({
|
|
1189
1189
|
width: t.width ? t.width + "px" : "fit-content",
|
|
1190
1190
|
zIndex: 100001
|
|
1191
1191
|
})
|
|
1192
1192
|
}, [
|
|
1193
|
-
d("div",
|
|
1194
|
-
|
|
1195
|
-
|
|
1193
|
+
d("div", uo, [
|
|
1194
|
+
we(P.$slots, "default", {}, () => [
|
|
1195
|
+
ee[2] || (ee[2] = d("span", null, "Popover content", -1))
|
|
1196
1196
|
])
|
|
1197
1197
|
])
|
|
1198
1198
|
], 6), [
|
|
1199
|
-
[
|
|
1199
|
+
[$e, o.value]
|
|
1200
1200
|
])
|
|
1201
1201
|
]),
|
|
1202
1202
|
_: 3
|
|
@@ -1205,126 +1205,126 @@ const tt = /* @__PURE__ */ X(Ur, [["render", Xr], ["__scopeId", "data-v-eb21a54f
|
|
|
1205
1205
|
])
|
|
1206
1206
|
], 512));
|
|
1207
1207
|
}
|
|
1208
|
-
}),
|
|
1208
|
+
}), fo = { class: "flex flex-col gap-[2px] p-[2px]" }, po = ["onClick"], go = {
|
|
1209
1209
|
__name: "vs-editor-table",
|
|
1210
1210
|
props: { editor: Object },
|
|
1211
1211
|
setup(t) {
|
|
1212
|
-
const { t: e } =
|
|
1212
|
+
const { t: e } = ze(), a = t, s = $(!1), n = $("popover"), o = () => {
|
|
1213
1213
|
a.editor && (a.editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: !0 }).run(), n.value.togglePopover());
|
|
1214
1214
|
}, l = () => {
|
|
1215
1215
|
a.editor && (a.editor.chain().focus().addColumnAfter().run(), n.value.togglePopover());
|
|
1216
1216
|
}, c = () => {
|
|
1217
1217
|
a.editor && (a.editor.chain().focus().addRowAfter().run(), n.value.togglePopover());
|
|
1218
|
-
},
|
|
1218
|
+
}, r = () => {
|
|
1219
1219
|
a.editor && (a.editor.chain().focus().deleteColumn().run(), n.value.togglePopover());
|
|
1220
1220
|
}, i = () => {
|
|
1221
1221
|
a.editor && (a.editor.chain().focus().deleteRow().run(), n.value.togglePopover());
|
|
1222
|
-
},
|
|
1222
|
+
}, x = () => {
|
|
1223
1223
|
a.editor && (a.editor.chain().focus().deleteTable().run(), n.value.togglePopover());
|
|
1224
1224
|
}, b = () => {
|
|
1225
1225
|
a.editor && (a.editor.chain().focus().mergeCells().run(), n.value.togglePopover());
|
|
1226
|
-
},
|
|
1226
|
+
}, f = () => {
|
|
1227
1227
|
a.editor && (a.editor.chain().focus().splitCell().run(), n.value.togglePopover());
|
|
1228
|
-
},
|
|
1229
|
-
{ text: e("form.richtext.createTable"), function:
|
|
1228
|
+
}, p = N(() => [
|
|
1229
|
+
{ text: e("form.richtext.createTable"), function: o },
|
|
1230
1230
|
{ text: e("form.richtext.addColumn"), function: l },
|
|
1231
1231
|
{ text: e("form.richtext.addRow"), function: c },
|
|
1232
|
-
{ text: e("form.richtext.deleteColumn"), function:
|
|
1232
|
+
{ text: e("form.richtext.deleteColumn"), function: r },
|
|
1233
1233
|
{ text: e("form.richtext.deleteRow"), function: i },
|
|
1234
|
-
{ text: e("form.richtext.deleteTable"), function:
|
|
1234
|
+
{ text: e("form.richtext.deleteTable"), function: x },
|
|
1235
1235
|
{ text: e("form.richtext.mergeCells"), function: b },
|
|
1236
|
-
{ text: e("form.richtext.splitCells"), function:
|
|
1236
|
+
{ text: e("form.richtext.splitCells"), function: f }
|
|
1237
1237
|
]);
|
|
1238
|
-
return (
|
|
1238
|
+
return (I, V) => (v(), W(fe, {
|
|
1239
1239
|
ref_key: "popover",
|
|
1240
1240
|
ref: n,
|
|
1241
1241
|
placement: "bottom",
|
|
1242
|
-
onIsvisible:
|
|
1242
|
+
onIsvisible: V[0] || (V[0] = (O) => s.value = O)
|
|
1243
1243
|
}, {
|
|
1244
|
-
reference:
|
|
1244
|
+
reference: q(() => [
|
|
1245
1245
|
d("button", {
|
|
1246
1246
|
title: "Table",
|
|
1247
1247
|
class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100", [s.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]])
|
|
1248
1248
|
}, [
|
|
1249
|
-
|
|
1249
|
+
C(L(Pt), { class: "h-4 w-4" })
|
|
1250
1250
|
], 2)
|
|
1251
1251
|
]),
|
|
1252
|
-
default:
|
|
1253
|
-
d("div",
|
|
1254
|
-
(v(!0),
|
|
1255
|
-
key:
|
|
1256
|
-
onClick:
|
|
1252
|
+
default: q(() => [
|
|
1253
|
+
d("div", fo, [
|
|
1254
|
+
(v(!0), w(ae, null, ie(p.value, (O, R) => (v(), w("button", {
|
|
1255
|
+
key: R,
|
|
1256
|
+
onClick: O?.function,
|
|
1257
1257
|
class: "px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"
|
|
1258
|
-
},
|
|
1258
|
+
}, Y(O.text), 9, po))), 128))
|
|
1259
1259
|
])
|
|
1260
1260
|
]),
|
|
1261
1261
|
_: 1
|
|
1262
1262
|
}, 512));
|
|
1263
1263
|
}
|
|
1264
|
-
},
|
|
1264
|
+
}, ho = { class: "flex gap-[4px] p-1" }, vo = ["title", "onClick"], mo = {
|
|
1265
1265
|
__name: "vs-editor-align",
|
|
1266
1266
|
props: { editor: Object },
|
|
1267
1267
|
setup(t) {
|
|
1268
1268
|
const e = t, a = {
|
|
1269
|
-
left:
|
|
1270
|
-
center:
|
|
1271
|
-
right:
|
|
1272
|
-
justify:
|
|
1273
|
-
}, s =
|
|
1274
|
-
c.value ?
|
|
1269
|
+
left: Nt,
|
|
1270
|
+
center: Ht,
|
|
1271
|
+
right: Mt,
|
|
1272
|
+
justify: jt
|
|
1273
|
+
}, s = $(!1), n = $("popover"), o = $("left"), l = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "left" }) || e.editor.isActive("heading", { textAlign: "left" }) : !1), c = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "right" }) || e.editor.isActive("heading", { textAlign: "right" }) : !1), r = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "center" }) || e.editor.isActive("heading", { textAlign: "center" }) : !1), i = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "justify" }) || e.editor.isActive("heading", { textAlign: "justify" }) : !1), x = N(() => l.value || c.value || r.value || i.value), b = () => {
|
|
1274
|
+
c.value ? o.value = "right" : r.value ? o.value = "center" : i.value ? o.value = "justify" : o.value = "left";
|
|
1275
1275
|
};
|
|
1276
|
-
|
|
1276
|
+
me([l, c, r, i], () => {
|
|
1277
1277
|
b();
|
|
1278
|
-
}, { immediate: !0 }),
|
|
1278
|
+
}, { immediate: !0 }), be(() => {
|
|
1279
1279
|
e.editor && (e.editor.on("selectionUpdate", b), e.editor.on("update", b));
|
|
1280
|
-
}),
|
|
1280
|
+
}), Le(() => {
|
|
1281
1281
|
e.editor && (e.editor.off("selectionUpdate", b), e.editor.off("update", b));
|
|
1282
1282
|
});
|
|
1283
|
-
const
|
|
1284
|
-
e.editor && (e.editor.chain().focus().setTextAlign(
|
|
1285
|
-
},
|
|
1283
|
+
const f = (I) => {
|
|
1284
|
+
e.editor && (e.editor.chain().focus().setTextAlign(I).run(), o.value = I);
|
|
1285
|
+
}, p = $([
|
|
1286
1286
|
{ id: "left", isActive: l },
|
|
1287
|
-
{ id: "center", isActive:
|
|
1287
|
+
{ id: "center", isActive: r },
|
|
1288
1288
|
{ id: "right", isActive: c },
|
|
1289
1289
|
{ id: "justify", isActive: i }
|
|
1290
1290
|
]);
|
|
1291
|
-
return (
|
|
1291
|
+
return (I, V) => (v(), W(fe, {
|
|
1292
1292
|
ref_key: "popover",
|
|
1293
1293
|
ref: n,
|
|
1294
1294
|
placement: "bottom",
|
|
1295
|
-
onIsvisible:
|
|
1295
|
+
onIsvisible: V[0] || (V[0] = (O) => s.value = O)
|
|
1296
1296
|
}, {
|
|
1297
|
-
reference:
|
|
1297
|
+
reference: q(() => [
|
|
1298
1298
|
d("button", {
|
|
1299
1299
|
title: "Text Align",
|
|
1300
|
-
class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100", [
|
|
1300
|
+
class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100", [x.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]])
|
|
1301
1301
|
}, [
|
|
1302
|
-
(v(),
|
|
1302
|
+
(v(), W(Ee(a[o.value]), {
|
|
1303
1303
|
height: "16",
|
|
1304
1304
|
width: "16"
|
|
1305
1305
|
}))
|
|
1306
1306
|
], 2)
|
|
1307
1307
|
]),
|
|
1308
|
-
default:
|
|
1309
|
-
d("div",
|
|
1310
|
-
(v(!0),
|
|
1311
|
-
title: "Text align " +
|
|
1312
|
-
class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900":
|
|
1313
|
-
key:
|
|
1314
|
-
onClick: (
|
|
1308
|
+
default: q(() => [
|
|
1309
|
+
d("div", ho, [
|
|
1310
|
+
(v(!0), w(ae, null, ie(p.value, (O) => (v(), w("button", {
|
|
1311
|
+
title: "Text align " + O?.id,
|
|
1312
|
+
class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": O?.isActive }]),
|
|
1313
|
+
key: O?.id,
|
|
1314
|
+
onClick: (R) => f(O?.id)
|
|
1315
1315
|
}, [
|
|
1316
|
-
(v(),
|
|
1316
|
+
(v(), W(Ee(a[O?.id]), {
|
|
1317
1317
|
height: "16",
|
|
1318
1318
|
width: "16"
|
|
1319
1319
|
}))
|
|
1320
|
-
], 10,
|
|
1320
|
+
], 10, vo))), 128))
|
|
1321
1321
|
])
|
|
1322
1322
|
]),
|
|
1323
1323
|
_: 1
|
|
1324
1324
|
}, 512));
|
|
1325
1325
|
}
|
|
1326
|
-
},
|
|
1327
|
-
components: { VsText:
|
|
1326
|
+
}, bo = {
|
|
1327
|
+
components: { VsText: lt },
|
|
1328
1328
|
inheritAttrs: !1,
|
|
1329
1329
|
events: ["update:modelValue"],
|
|
1330
1330
|
props: {
|
|
@@ -1343,43 +1343,43 @@ const tt = /* @__PURE__ */ X(Ur, [["render", Xr], ["__scopeId", "data-v-eb21a54f
|
|
|
1343
1343
|
}
|
|
1344
1344
|
}
|
|
1345
1345
|
}
|
|
1346
|
-
},
|
|
1347
|
-
function
|
|
1348
|
-
const l =
|
|
1349
|
-
return v(),
|
|
1350
|
-
|
|
1351
|
-
"onUpdate:modelValue": e[0] || (e[0] = (c) =>
|
|
1346
|
+
}, yo = { class: "flex items-center w-full max-w-[182px]" }, xo = ["disabled"];
|
|
1347
|
+
function wo(t, e, a, s, n, o) {
|
|
1348
|
+
const l = Z("vs-text");
|
|
1349
|
+
return v(), w("div", yo, [
|
|
1350
|
+
de(d("input", {
|
|
1351
|
+
"onUpdate:modelValue": e[0] || (e[0] = (c) => o.value = c),
|
|
1352
1352
|
type: "color",
|
|
1353
1353
|
class: E(["w-[38px] h-[38px] min-h-[38px] min-w-[38px] py-[2px] px-[3px] -ml-1 dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg", a.disabled ? "cursor-not-allowed" : "cursor-pointer"]),
|
|
1354
1354
|
disabled: a.disabled
|
|
1355
|
-
}, null, 10,
|
|
1356
|
-
[
|
|
1355
|
+
}, null, 10, xo), [
|
|
1356
|
+
[ft, o.value]
|
|
1357
1357
|
]),
|
|
1358
|
-
a.isTextInputShown ? (v(),
|
|
1358
|
+
a.isTextInputShown ? (v(), W(l, {
|
|
1359
1359
|
key: 0,
|
|
1360
|
-
modelValue:
|
|
1361
|
-
"onUpdate:modelValue": e[1] || (e[1] = (c) =>
|
|
1360
|
+
modelValue: o.value,
|
|
1361
|
+
"onUpdate:modelValue": e[1] || (e[1] = (c) => o.value = c),
|
|
1362
1362
|
class: "ml-2 w-full",
|
|
1363
1363
|
disabled: a.disabled,
|
|
1364
1364
|
clearable: a.clearable
|
|
1365
|
-
}, null, 8, ["modelValue", "disabled", "clearable"])) :
|
|
1365
|
+
}, null, 8, ["modelValue", "disabled", "clearable"])) : U("", !0)
|
|
1366
1366
|
]);
|
|
1367
1367
|
}
|
|
1368
|
-
const
|
|
1368
|
+
const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px] mb-[8px]" }, _o = { class: "grid grid-rows-3 grid-cols-7" }, $o = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Co = ["onClick", "title"], Ao = {
|
|
1369
1369
|
__name: "vs-editor-color",
|
|
1370
1370
|
props: {
|
|
1371
1371
|
editor: Object
|
|
1372
1372
|
},
|
|
1373
1373
|
setup(t) {
|
|
1374
|
-
const e = t, a =
|
|
1374
|
+
const e = t, a = $(null), s = $("#000000"), n = N(() => e.editor && e.editor.getAttributes("textStyle").color || "#000000"), o = N(() => n.value !== "#000000"), l = () => {
|
|
1375
1375
|
e.editor && (s.value = n.value);
|
|
1376
1376
|
};
|
|
1377
|
-
|
|
1377
|
+
be(() => {
|
|
1378
1378
|
e.editor && (e.editor.on("selectionUpdate", l), e.editor.on("update", l), l());
|
|
1379
|
-
}),
|
|
1379
|
+
}), Le(() => {
|
|
1380
1380
|
e.editor && (e.editor.off("selectionUpdate", l), e.editor.off("update", l));
|
|
1381
1381
|
});
|
|
1382
|
-
const c =
|
|
1382
|
+
const c = $([
|
|
1383
1383
|
"#172B4D",
|
|
1384
1384
|
"#0747A6",
|
|
1385
1385
|
"#008DA6",
|
|
@@ -1401,11 +1401,11 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
|
|
|
1401
1401
|
"#FFF0B3",
|
|
1402
1402
|
"#FFBDAD",
|
|
1403
1403
|
"#EAE6FF"
|
|
1404
|
-
]),
|
|
1404
|
+
]), r = (b) => {
|
|
1405
1405
|
e.editor && (e.editor.chain().focus().setColor(b).run(), s.value = b, a.value && a.value.togglePopover());
|
|
1406
1406
|
}, i = () => {
|
|
1407
|
-
|
|
1408
|
-
},
|
|
1407
|
+
r(s.value);
|
|
1408
|
+
}, x = (b) => ({
|
|
1409
1409
|
"#172B4D": "Default",
|
|
1410
1410
|
"#0747A6": "Bright blue",
|
|
1411
1411
|
"#008DA6": "Bright blue-green",
|
|
@@ -1428,54 +1428,54 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
|
|
|
1428
1428
|
"#FFBDAD": "Bright red",
|
|
1429
1429
|
"#EAE6FF": "Bright purple"
|
|
1430
1430
|
})[b] || b;
|
|
1431
|
-
return (b,
|
|
1431
|
+
return (b, f) => (v(), W(fe, {
|
|
1432
1432
|
ref_key: "popover",
|
|
1433
1433
|
ref: a,
|
|
1434
1434
|
placement: "bottom"
|
|
1435
1435
|
}, {
|
|
1436
|
-
reference:
|
|
1436
|
+
reference: q(() => [
|
|
1437
1437
|
d("button", {
|
|
1438
1438
|
title: "Text Color",
|
|
1439
|
-
class: E(["flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100":
|
|
1439
|
+
class: E(["flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100": o.value }])
|
|
1440
1440
|
}, [
|
|
1441
|
-
|
|
1441
|
+
f[1] || (f[1] = d("span", { class: "leading-none" }, "A", -1)),
|
|
1442
1442
|
d("span", {
|
|
1443
1443
|
class: "block h-1 w-5",
|
|
1444
|
-
style:
|
|
1444
|
+
style: se({ backgroundColor: s.value })
|
|
1445
1445
|
}, null, 4)
|
|
1446
1446
|
], 2)
|
|
1447
1447
|
]),
|
|
1448
|
-
default:
|
|
1448
|
+
default: q(() => [
|
|
1449
1449
|
d("div", null, [
|
|
1450
|
-
d("div",
|
|
1451
|
-
|
|
1450
|
+
d("div", ko, [
|
|
1451
|
+
C(at, {
|
|
1452
1452
|
modelValue: s.value,
|
|
1453
|
-
"onUpdate:modelValue":
|
|
1453
|
+
"onUpdate:modelValue": f[0] || (f[0] = (p) => s.value = p)
|
|
1454
1454
|
}, null, 8, ["modelValue"]),
|
|
1455
1455
|
d("button", {
|
|
1456
1456
|
onClick: i,
|
|
1457
1457
|
class: "h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"
|
|
1458
1458
|
}, [
|
|
1459
|
-
|
|
1459
|
+
C(L(ke), { class: "h-4 w-4 text-white" })
|
|
1460
1460
|
])
|
|
1461
1461
|
]),
|
|
1462
|
-
d("div",
|
|
1463
|
-
(v(!0),
|
|
1464
|
-
key:
|
|
1462
|
+
d("div", _o, [
|
|
1463
|
+
(v(!0), w(ae, null, ie(c.value, (p) => (v(), w("div", {
|
|
1464
|
+
key: p,
|
|
1465
1465
|
class: "h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"
|
|
1466
1466
|
}, [
|
|
1467
|
-
d("div",
|
|
1467
|
+
d("div", $o, [
|
|
1468
1468
|
d("button", {
|
|
1469
1469
|
class: "flex items-center justify-center w-full h-full",
|
|
1470
|
-
style:
|
|
1471
|
-
onClick: (
|
|
1472
|
-
title:
|
|
1470
|
+
style: se({ backgroundColor: p }),
|
|
1471
|
+
onClick: (I) => r(p),
|
|
1472
|
+
title: x(p)
|
|
1473
1473
|
}, [
|
|
1474
|
-
s.value ===
|
|
1474
|
+
s.value === p ? (v(), W(L(ke), {
|
|
1475
1475
|
key: 0,
|
|
1476
1476
|
class: "h-4 w-4 text-gray-500"
|
|
1477
|
-
})) :
|
|
1478
|
-
], 12,
|
|
1477
|
+
})) : U("", !0)
|
|
1478
|
+
], 12, Co)
|
|
1479
1479
|
])
|
|
1480
1480
|
]))), 128))
|
|
1481
1481
|
])
|
|
@@ -1484,21 +1484,21 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
|
|
|
1484
1484
|
_: 1
|
|
1485
1485
|
}, 512));
|
|
1486
1486
|
}
|
|
1487
|
-
},
|
|
1487
|
+
}, Fo = { class: "flex gap-[4px] mb-[8px]" }, So = { class: "grid grid-rows-3 grid-cols-7" }, To = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Lo = ["onClick", "title"], Bo = ["onClick", "title"], Eo = {
|
|
1488
1488
|
__name: "vs-editor-background-color",
|
|
1489
1489
|
props: {
|
|
1490
1490
|
editor: Object
|
|
1491
1491
|
},
|
|
1492
1492
|
setup(t) {
|
|
1493
|
-
const e = t, a =
|
|
1493
|
+
const e = t, a = $(null), s = $("transparent"), n = N(() => e.editor && e.editor.getAttributes("textStyle").backgroundColor || "transparent"), o = N(() => n.value !== "transparent" && n.value !== ""), l = () => {
|
|
1494
1494
|
e.editor && (s.value = n.value);
|
|
1495
1495
|
};
|
|
1496
|
-
|
|
1496
|
+
be(() => {
|
|
1497
1497
|
e.editor && (e.editor.on("selectionUpdate", l), e.editor.on("update", l), l());
|
|
1498
|
-
}),
|
|
1498
|
+
}), Le(() => {
|
|
1499
1499
|
e.editor && (e.editor.off("selectionUpdate", l), e.editor.off("update", l));
|
|
1500
1500
|
});
|
|
1501
|
-
const c =
|
|
1501
|
+
const c = $([
|
|
1502
1502
|
"#172B4D",
|
|
1503
1503
|
"#0747A6",
|
|
1504
1504
|
"#008DA6",
|
|
@@ -1520,11 +1520,11 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
|
|
|
1520
1520
|
"#FFF0B3",
|
|
1521
1521
|
"#FFBDAD",
|
|
1522
1522
|
"#EAE6FF"
|
|
1523
|
-
]),
|
|
1523
|
+
]), r = (b) => {
|
|
1524
1524
|
e.editor && (e.editor.chain().focus().setBackgroundColor(b).run(), s.value = b, a.value && a.value.togglePopover());
|
|
1525
1525
|
}, i = () => {
|
|
1526
|
-
|
|
1527
|
-
},
|
|
1526
|
+
r(s.value);
|
|
1527
|
+
}, x = (b) => ({
|
|
1528
1528
|
"#172B4D": "Default",
|
|
1529
1529
|
"#0747A6": "Bright blue",
|
|
1530
1530
|
"#008DA6": "Bright blue-green",
|
|
@@ -1547,73 +1547,73 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
|
|
|
1547
1547
|
"#FFBDAD": "Bright red",
|
|
1548
1548
|
"#EAE6FF": "Bright purple"
|
|
1549
1549
|
})[b] || b;
|
|
1550
|
-
return (b,
|
|
1550
|
+
return (b, f) => (v(), W(fe, {
|
|
1551
1551
|
ref_key: "popover",
|
|
1552
1552
|
ref: a,
|
|
1553
1553
|
placement: "bottom"
|
|
1554
1554
|
}, {
|
|
1555
|
-
reference:
|
|
1555
|
+
reference: q(() => [
|
|
1556
1556
|
d("button", {
|
|
1557
1557
|
title: "Background Color",
|
|
1558
|
-
class: E(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100":
|
|
1558
|
+
class: E(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100": o.value }])
|
|
1559
1559
|
}, [
|
|
1560
|
-
|
|
1560
|
+
C(L(Dt), { class: "h-4 w-4" }),
|
|
1561
1561
|
d("span", {
|
|
1562
1562
|
class: "block h-1 w-5",
|
|
1563
|
-
style:
|
|
1563
|
+
style: se({ backgroundColor: s.value })
|
|
1564
1564
|
}, null, 4)
|
|
1565
1565
|
], 2)
|
|
1566
1566
|
]),
|
|
1567
|
-
default:
|
|
1567
|
+
default: q(() => [
|
|
1568
1568
|
d("div", null, [
|
|
1569
|
-
d("div",
|
|
1570
|
-
|
|
1569
|
+
d("div", Fo, [
|
|
1570
|
+
C(at, {
|
|
1571
1571
|
modelValue: s.value,
|
|
1572
|
-
"onUpdate:modelValue":
|
|
1572
|
+
"onUpdate:modelValue": f[0] || (f[0] = (p) => s.value = p)
|
|
1573
1573
|
}, null, 8, ["modelValue"]),
|
|
1574
1574
|
d("button", {
|
|
1575
1575
|
onClick: i,
|
|
1576
1576
|
class: "h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"
|
|
1577
1577
|
}, [
|
|
1578
|
-
|
|
1578
|
+
C(L(ke), { class: "h-4 w-4 text-white" })
|
|
1579
1579
|
])
|
|
1580
1580
|
]),
|
|
1581
|
-
d("div",
|
|
1581
|
+
d("div", So, [
|
|
1582
1582
|
d("button", {
|
|
1583
|
-
onClick:
|
|
1583
|
+
onClick: f[1] || (f[1] = (p) => r("transparent")),
|
|
1584
1584
|
class: "col-span-7 flex items-center justify-center gap-2 bg-gray-100 rounded-md py-1 mb-2 hover:bg-gray-200"
|
|
1585
1585
|
}, [
|
|
1586
|
-
|
|
1587
|
-
|
|
1586
|
+
C(L(zt), { class: "h-4 w-4" }),
|
|
1587
|
+
f[2] || (f[2] = d("p", null, "no color", -1))
|
|
1588
1588
|
]),
|
|
1589
|
-
(v(!0),
|
|
1590
|
-
key:
|
|
1589
|
+
(v(!0), w(ae, null, ie(c.value, (p) => (v(), w("div", {
|
|
1590
|
+
key: p,
|
|
1591
1591
|
class: "h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"
|
|
1592
1592
|
}, [
|
|
1593
|
-
d("div",
|
|
1594
|
-
|
|
1593
|
+
d("div", To, [
|
|
1594
|
+
p !== "transparent" ? (v(), w("button", {
|
|
1595
1595
|
key: 0,
|
|
1596
1596
|
class: "flex items-center justify-center w-full h-full",
|
|
1597
|
-
style:
|
|
1598
|
-
onClick: (
|
|
1599
|
-
title:
|
|
1597
|
+
style: se({ backgroundColor: p }),
|
|
1598
|
+
onClick: (I) => r(p),
|
|
1599
|
+
title: x(p)
|
|
1600
1600
|
}, [
|
|
1601
|
-
s.value ===
|
|
1601
|
+
s.value === p ? (v(), W(L(ke), {
|
|
1602
1602
|
key: 0,
|
|
1603
1603
|
class: "h-4 w-4 text-gray-500"
|
|
1604
|
-
})) :
|
|
1605
|
-
], 12,
|
|
1606
|
-
|
|
1604
|
+
})) : U("", !0)
|
|
1605
|
+
], 12, Lo)) : U("", !0),
|
|
1606
|
+
p === "transparent" ? (v(), w("button", {
|
|
1607
1607
|
key: 1,
|
|
1608
1608
|
class: "flex items-center justify-center w-full h-full",
|
|
1609
|
-
onClick: (
|
|
1610
|
-
title:
|
|
1609
|
+
onClick: (I) => r(p),
|
|
1610
|
+
title: x(p)
|
|
1611
1611
|
}, [
|
|
1612
|
-
s.value ===
|
|
1612
|
+
s.value === p ? (v(), W(L(ke), {
|
|
1613
1613
|
key: 0,
|
|
1614
1614
|
class: "h-4 w-4 text-gray-500"
|
|
1615
|
-
})) :
|
|
1616
|
-
], 8,
|
|
1615
|
+
})) : U("", !0)
|
|
1616
|
+
], 8, Bo)) : U("", !0)
|
|
1617
1617
|
])
|
|
1618
1618
|
]))), 128))
|
|
1619
1619
|
])
|
|
@@ -1622,30 +1622,30 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
|
|
|
1622
1622
|
_: 1
|
|
1623
1623
|
}, 512));
|
|
1624
1624
|
}
|
|
1625
|
-
},
|
|
1625
|
+
}, Io = {
|
|
1626
1626
|
__name: "vs-editor-highlight",
|
|
1627
1627
|
props: {
|
|
1628
1628
|
editor: Object
|
|
1629
1629
|
},
|
|
1630
1630
|
setup(t) {
|
|
1631
|
-
const e = t, a =
|
|
1631
|
+
const e = t, a = N(() => e.editor?.isActive("highlight")), s = () => {
|
|
1632
1632
|
e.editor && e.editor.chain().focus().toggleHighlight().run();
|
|
1633
1633
|
};
|
|
1634
|
-
return (n,
|
|
1634
|
+
return (n, o) => (v(), w("button", {
|
|
1635
1635
|
title: "Highlight",
|
|
1636
1636
|
onClick: s,
|
|
1637
1637
|
class: E(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-200": a.value }])
|
|
1638
1638
|
}, [
|
|
1639
|
-
|
|
1639
|
+
C(L(Vt), { class: "h-4 w-4" })
|
|
1640
1640
|
], 2));
|
|
1641
1641
|
}
|
|
1642
|
-
},
|
|
1642
|
+
}, Po = { class: "truncate" }, jo = { class: "w-[200px]" }, Mo = { class: "max-h-[200px] overflow-y-auto" }, Ho = ["onClick"], No = {
|
|
1643
1643
|
__name: "vs-editor-font-family",
|
|
1644
1644
|
props: {
|
|
1645
1645
|
editor: Object
|
|
1646
1646
|
},
|
|
1647
1647
|
setup(t) {
|
|
1648
|
-
const e = t, a =
|
|
1648
|
+
const e = t, a = $("popover"), s = $(!1), n = $([
|
|
1649
1649
|
{ label: "Arial", value: "Arial, sans-serif" },
|
|
1650
1650
|
{ label: "Helvetica", value: "Helvetica, sans-serif" },
|
|
1651
1651
|
{ label: "Times New Roman", value: "Times New Roman, serif" },
|
|
@@ -1656,61 +1656,61 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
|
|
|
1656
1656
|
{ label: "Impact", value: "Impact, sans-serif" },
|
|
1657
1657
|
{ label: "Trebuchet MS", value: "Trebuchet MS, sans-serif" },
|
|
1658
1658
|
{ label: "Palatino", value: "Palatino, serif" }
|
|
1659
|
-
]),
|
|
1659
|
+
]), o = N(() => {
|
|
1660
1660
|
if (!e.editor) return "Arial, sans-serif";
|
|
1661
1661
|
for (const i of n.value)
|
|
1662
1662
|
if (e.editor.isActive("textStyle", { fontFamily: i.value }))
|
|
1663
1663
|
return i.value;
|
|
1664
1664
|
return "Arial, sans-serif";
|
|
1665
|
-
}), l =
|
|
1665
|
+
}), l = N(() => n.value.find((x) => x.value === o.value)?.label || "Arial"), c = (i) => e.editor ? e.editor.isActive("textStyle", { fontFamily: i }) : !1, r = (i) => {
|
|
1666
1666
|
e.editor && (e.editor.chain().focus().setFontFamily(i).run(), a.value && a.value.togglePopover());
|
|
1667
1667
|
};
|
|
1668
|
-
return (i,
|
|
1668
|
+
return (i, x) => (v(), W(fe, {
|
|
1669
1669
|
ref_key: "popover",
|
|
1670
1670
|
ref: a,
|
|
1671
1671
|
placement: "bottom",
|
|
1672
|
-
onIsvisible:
|
|
1672
|
+
onIsvisible: x[0] || (x[0] = (b) => s.value = b)
|
|
1673
1673
|
}, {
|
|
1674
|
-
reference:
|
|
1674
|
+
reference: q(() => [
|
|
1675
1675
|
d("button", {
|
|
1676
1676
|
title: "Font Family",
|
|
1677
1677
|
class: E(["h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm", [s.value ? "bg-gray-100 text-gray-900" : "text-gray-700"]]),
|
|
1678
|
-
style:
|
|
1678
|
+
style: se({ fontFamily: o.value })
|
|
1679
1679
|
}, [
|
|
1680
|
-
d("span",
|
|
1681
|
-
|
|
1680
|
+
d("span", Po, Y(l.value), 1),
|
|
1681
|
+
C(L(je), { class: "ml-1 h-3 w-3 text-gray-400" })
|
|
1682
1682
|
], 6)
|
|
1683
1683
|
]),
|
|
1684
|
-
default:
|
|
1685
|
-
d("div",
|
|
1686
|
-
d("ul",
|
|
1687
|
-
(v(!0),
|
|
1684
|
+
default: q(() => [
|
|
1685
|
+
d("div", jo, [
|
|
1686
|
+
d("ul", Mo, [
|
|
1687
|
+
(v(!0), w(ae, null, ie(n.value, (b) => (v(), w("li", {
|
|
1688
1688
|
key: b.value,
|
|
1689
1689
|
class: E(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", { "bg-gray-100": c(b.value) }]),
|
|
1690
|
-
style:
|
|
1691
|
-
onClick: (
|
|
1692
|
-
},
|
|
1690
|
+
style: se({ fontFamily: b.value }),
|
|
1691
|
+
onClick: (f) => r(b.value)
|
|
1692
|
+
}, Y(b.label), 15, Ho))), 128))
|
|
1693
1693
|
])
|
|
1694
1694
|
])
|
|
1695
1695
|
]),
|
|
1696
1696
|
_: 1
|
|
1697
1697
|
}, 512));
|
|
1698
1698
|
}
|
|
1699
|
-
},
|
|
1699
|
+
}, zo = { class: "w-[120px]" }, Do = { class: "max-h-[200px] overflow-y-auto" }, Vo = ["onClick"], Oo = {
|
|
1700
1700
|
__name: "vs-editor-font-size",
|
|
1701
1701
|
props: {
|
|
1702
1702
|
editor: Object
|
|
1703
1703
|
},
|
|
1704
1704
|
setup(t) {
|
|
1705
|
-
const e = t, a =
|
|
1705
|
+
const e = t, a = $("popover"), s = $("14px"), n = N(() => e.editor && e.editor.getAttributes("textStyle").fontSize || "14px"), o = N(() => n.value !== "14px"), l = () => {
|
|
1706
1706
|
e.editor && (s.value = n.value);
|
|
1707
1707
|
};
|
|
1708
|
-
|
|
1708
|
+
be(() => {
|
|
1709
1709
|
e.editor && (e.editor.on("selectionUpdate", l), e.editor.on("update", l), l());
|
|
1710
|
-
}),
|
|
1710
|
+
}), Le(() => {
|
|
1711
1711
|
e.editor && (e.editor.off("selectionUpdate", l), e.editor.off("update", l));
|
|
1712
1712
|
});
|
|
1713
|
-
const c =
|
|
1713
|
+
const c = $([
|
|
1714
1714
|
{ label: "8px", value: "8px" },
|
|
1715
1715
|
{ label: "9px", value: "9px" },
|
|
1716
1716
|
{ label: "10px", value: "10px" },
|
|
@@ -1726,39 +1726,39 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
|
|
|
1726
1726
|
{ label: "36px", value: "36px" },
|
|
1727
1727
|
{ label: "48px", value: "48px" },
|
|
1728
1728
|
{ label: "72px", value: "72px" }
|
|
1729
|
-
]),
|
|
1729
|
+
]), r = (i) => {
|
|
1730
1730
|
e.editor && (e.editor.chain().focus().setFontSize(i).run(), s.value = i, a.value && a.value.togglePopover());
|
|
1731
1731
|
};
|
|
1732
|
-
return (i,
|
|
1732
|
+
return (i, x) => (v(), W(fe, {
|
|
1733
1733
|
ref_key: "popover",
|
|
1734
1734
|
ref: a,
|
|
1735
1735
|
placement: "bottom"
|
|
1736
1736
|
}, {
|
|
1737
|
-
reference:
|
|
1737
|
+
reference: q(() => [
|
|
1738
1738
|
d("button", {
|
|
1739
1739
|
title: "Font Size",
|
|
1740
|
-
class: E(["h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1", { "bg-gray-100 text-gray-900":
|
|
1740
|
+
class: E(["h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1", { "bg-gray-100 text-gray-900": o.value }])
|
|
1741
1741
|
}, [
|
|
1742
|
-
|
|
1743
|
-
|
|
1742
|
+
C(L(Ot), { class: "h-4 w-4" }),
|
|
1743
|
+
C(L(je), { class: "h-3 w-3 text-gray-400" })
|
|
1744
1744
|
], 2)
|
|
1745
1745
|
]),
|
|
1746
|
-
default:
|
|
1747
|
-
d("div",
|
|
1748
|
-
d("ul",
|
|
1749
|
-
(v(!0),
|
|
1746
|
+
default: q(() => [
|
|
1747
|
+
d("div", zo, [
|
|
1748
|
+
d("ul", Do, [
|
|
1749
|
+
(v(!0), w(ae, null, ie(c.value, (b) => (v(), w("li", {
|
|
1750
1750
|
key: b.value,
|
|
1751
1751
|
class: "px-3 py-2 hover:bg-gray-100 cursor-pointer",
|
|
1752
|
-
onClick: (
|
|
1753
|
-
},
|
|
1752
|
+
onClick: (f) => r(b.value)
|
|
1753
|
+
}, Y(b.label), 9, Vo))), 128))
|
|
1754
1754
|
])
|
|
1755
1755
|
])
|
|
1756
1756
|
]),
|
|
1757
1757
|
_: 1
|
|
1758
1758
|
}, 512));
|
|
1759
1759
|
}
|
|
1760
|
-
},
|
|
1761
|
-
components: { Superscript:
|
|
1760
|
+
}, Ro = {
|
|
1761
|
+
components: { Superscript: Rt },
|
|
1762
1762
|
props: {
|
|
1763
1763
|
editor: Object
|
|
1764
1764
|
},
|
|
@@ -1768,19 +1768,19 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
|
|
|
1768
1768
|
}
|
|
1769
1769
|
}
|
|
1770
1770
|
};
|
|
1771
|
-
function
|
|
1772
|
-
const l =
|
|
1773
|
-
return v(),
|
|
1771
|
+
function Uo(t, e, a, s, n, o) {
|
|
1772
|
+
const l = Z("Superscript");
|
|
1773
|
+
return v(), w("button", {
|
|
1774
1774
|
title: "Superscript",
|
|
1775
|
-
onClick: e[0] || (e[0] = (...c) =>
|
|
1775
|
+
onClick: e[0] || (e[0] = (...c) => o.toggleSuperscript && o.toggleSuperscript(...c)),
|
|
1776
1776
|
class: E(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("superscript") }])
|
|
1777
1777
|
}, [
|
|
1778
|
-
|
|
1778
|
+
C(l, { class: "h-4 w-4" }),
|
|
1779
1779
|
e[1] || (e[1] = d("span", { class: "sr-only" }, "Superscript", -1))
|
|
1780
1780
|
], 2);
|
|
1781
1781
|
}
|
|
1782
|
-
const
|
|
1783
|
-
components: { Subscript:
|
|
1782
|
+
const qo = /* @__PURE__ */ Q(Ro, [["render", Uo]]), Ko = {
|
|
1783
|
+
components: { Subscript: Ut },
|
|
1784
1784
|
props: {
|
|
1785
1785
|
editor: Object
|
|
1786
1786
|
},
|
|
@@ -1790,71 +1790,71 @@ const Vo = /* @__PURE__ */ X(Do, [["render", Oo]]), Ro = {
|
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
1792
1792
|
};
|
|
1793
|
-
function
|
|
1794
|
-
const l =
|
|
1795
|
-
return v(),
|
|
1793
|
+
function Wo(t, e, a, s, n, o) {
|
|
1794
|
+
const l = Z("Subscript");
|
|
1795
|
+
return v(), w("button", {
|
|
1796
1796
|
title: "Subscript",
|
|
1797
|
-
onClick: e[0] || (e[0] = (...c) =>
|
|
1797
|
+
onClick: e[0] || (e[0] = (...c) => o.toggleSubscript && o.toggleSubscript(...c)),
|
|
1798
1798
|
class: E(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("subscript") }])
|
|
1799
1799
|
}, [
|
|
1800
|
-
|
|
1800
|
+
C(l, { class: "h-4 w-4" }),
|
|
1801
1801
|
e[1] || (e[1] = d("span", { class: "sr-only" }, "Subscript", -1))
|
|
1802
1802
|
], 2);
|
|
1803
1803
|
}
|
|
1804
|
-
const
|
|
1804
|
+
const Xo = /* @__PURE__ */ Q(Ko, [["render", Wo]]), Go = {
|
|
1805
1805
|
title: "Heading",
|
|
1806
1806
|
class: "h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700"
|
|
1807
|
-
},
|
|
1807
|
+
}, Yo = { class: "truncate" }, Qo = { class: "max-h-[200px] overflow-y-auto" }, Zo = ["onClick"], Jo = {
|
|
1808
1808
|
__name: "vs-editor-heading",
|
|
1809
1809
|
props: {
|
|
1810
1810
|
editor: Object
|
|
1811
1811
|
},
|
|
1812
1812
|
setup(t) {
|
|
1813
|
-
const e = t, a =
|
|
1813
|
+
const e = t, a = $("popover"), s = $([
|
|
1814
1814
|
{ label: "Heading 1", value: 1 },
|
|
1815
1815
|
{ label: "Heading 2", value: 2 },
|
|
1816
1816
|
{ label: "Heading 3", value: 3 },
|
|
1817
1817
|
{ label: "Heading 4", value: 4 },
|
|
1818
1818
|
{ label: "Heading 5", value: 5 },
|
|
1819
1819
|
{ label: "Heading 6", value: 6 }
|
|
1820
|
-
]), n =
|
|
1820
|
+
]), n = N(() => {
|
|
1821
1821
|
if (!e.editor) return "Paragraph";
|
|
1822
|
-
for (let
|
|
1823
|
-
if (e.editor.isActive("heading", { level:
|
|
1824
|
-
return `H ${
|
|
1822
|
+
for (let r = 1; r <= 6; r++)
|
|
1823
|
+
if (e.editor.isActive("heading", { level: r }))
|
|
1824
|
+
return `H ${r}`;
|
|
1825
1825
|
return "P";
|
|
1826
|
-
}),
|
|
1826
|
+
}), o = (r) => ({
|
|
1827
1827
|
1: "font-weight:700; font-size:30px;",
|
|
1828
1828
|
2: "font-weight:700; font-size:26px;",
|
|
1829
1829
|
3: "font-weight:700; font-size:22px;",
|
|
1830
1830
|
4: "font-weight:700; font-size:18px;",
|
|
1831
1831
|
5: "font-weight:500; font-size:16px;",
|
|
1832
1832
|
6: "font-weight:400; font-size:14px;"
|
|
1833
|
-
})[
|
|
1834
|
-
e.editor && (e.editor.chain().focus().setHeading({ level:
|
|
1833
|
+
})[r] || "", l = (r) => {
|
|
1834
|
+
e.editor && (e.editor.chain().focus().setHeading({ level: r }).run(), a.value && a.value.togglePopover());
|
|
1835
1835
|
}, c = () => {
|
|
1836
1836
|
e.editor && (e.editor.chain().focus().setParagraph().run(), a.value && a.value.togglePopover());
|
|
1837
1837
|
};
|
|
1838
|
-
return (
|
|
1838
|
+
return (r, i) => (v(), W(fe, {
|
|
1839
1839
|
ref_key: "popover",
|
|
1840
1840
|
ref: a,
|
|
1841
1841
|
placement: "bottom"
|
|
1842
1842
|
}, {
|
|
1843
|
-
reference:
|
|
1844
|
-
d("button",
|
|
1845
|
-
d("span",
|
|
1846
|
-
|
|
1843
|
+
reference: q(() => [
|
|
1844
|
+
d("button", Go, [
|
|
1845
|
+
d("span", Yo, Y(n.value), 1),
|
|
1846
|
+
C(L(je), { class: "ml-1 h-3 w-3 text-gray-400" })
|
|
1847
1847
|
])
|
|
1848
1848
|
]),
|
|
1849
|
-
default:
|
|
1849
|
+
default: q(() => [
|
|
1850
1850
|
d("div", null, [
|
|
1851
|
-
d("ul",
|
|
1852
|
-
(v(!0),
|
|
1853
|
-
key:
|
|
1854
|
-
class: E(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", `heading-level-${
|
|
1855
|
-
style:
|
|
1856
|
-
onClick: (b) => l(
|
|
1857
|
-
},
|
|
1851
|
+
d("ul", Qo, [
|
|
1852
|
+
(v(!0), w(ae, null, ie(s.value, (x) => (v(), w("li", {
|
|
1853
|
+
key: x.value,
|
|
1854
|
+
class: E(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", `heading-level-${x.value}`]),
|
|
1855
|
+
style: se(o(x.value)),
|
|
1856
|
+
onClick: (b) => l(x.value)
|
|
1857
|
+
}, Y(x.label), 15, Zo))), 128)),
|
|
1858
1858
|
d("li", {
|
|
1859
1859
|
class: "px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm border-t border-gray-200 mt-1 pt-2",
|
|
1860
1860
|
onClick: c
|
|
@@ -1865,8 +1865,8 @@ const qo = /* @__PURE__ */ X(Ro, [["render", Uo]]), Ko = {
|
|
|
1865
1865
|
_: 1
|
|
1866
1866
|
}, 512));
|
|
1867
1867
|
}
|
|
1868
|
-
},
|
|
1869
|
-
components: { RemoveFormatting:
|
|
1868
|
+
}, el = /* @__PURE__ */ Q(Jo, [["__scopeId", "data-v-96f02f2a"]]), tl = {
|
|
1869
|
+
components: { RemoveFormatting: qt },
|
|
1870
1870
|
props: {
|
|
1871
1871
|
editor: Object
|
|
1872
1872
|
},
|
|
@@ -1876,27 +1876,27 @@ const qo = /* @__PURE__ */ X(Ro, [["render", Uo]]), Ko = {
|
|
|
1876
1876
|
}
|
|
1877
1877
|
}
|
|
1878
1878
|
};
|
|
1879
|
-
function
|
|
1880
|
-
const l =
|
|
1881
|
-
return v(),
|
|
1879
|
+
function rl(t, e, a, s, n, o) {
|
|
1880
|
+
const l = Z("RemoveFormatting");
|
|
1881
|
+
return v(), w("button", {
|
|
1882
1882
|
title: "Clear Formatting",
|
|
1883
|
-
onClick: e[0] || (e[0] = (...c) =>
|
|
1883
|
+
onClick: e[0] || (e[0] = (...c) => o.clearFormatting && o.clearFormatting(...c)),
|
|
1884
1884
|
class: "h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100"
|
|
1885
1885
|
}, [
|
|
1886
|
-
|
|
1886
|
+
C(l, { class: "h-4 w-4" }),
|
|
1887
1887
|
e[1] || (e[1] = d("span", { class: "sr-only" }, "Clear Formatting", -1))
|
|
1888
1888
|
]);
|
|
1889
1889
|
}
|
|
1890
|
-
const
|
|
1890
|
+
const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" }, al = {
|
|
1891
1891
|
key: 0,
|
|
1892
1892
|
class: "mt-4"
|
|
1893
|
-
},
|
|
1893
|
+
}, nl = ["src", "alt", "title"], sl = {
|
|
1894
1894
|
key: 0,
|
|
1895
1895
|
class: "text-sm text-red-500"
|
|
1896
|
-
},
|
|
1896
|
+
}, il = {
|
|
1897
1897
|
key: 1,
|
|
1898
1898
|
class: "mt-4"
|
|
1899
|
-
},
|
|
1899
|
+
}, cl = { class: "text-sm text-gray-600 mb-2" }, dl = { class: "flex flex-wrap gap-2" }, ul = ["src", "alt", "onError"], fl = ["onClick"], pl = { class: "flex justify-end gap-x-2 p-[20px]" }, gl = /* @__PURE__ */ Object.assign({
|
|
1900
1900
|
inheritAttrs: !1
|
|
1901
1901
|
}, {
|
|
1902
1902
|
__name: "vs-editor-image",
|
|
@@ -1907,7 +1907,7 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
1907
1907
|
}
|
|
1908
1908
|
},
|
|
1909
1909
|
setup(t) {
|
|
1910
|
-
const e = t, a =
|
|
1910
|
+
const e = t, a = $(!1), s = $(!1), n = $({}), o = $(!1), l = $([]), c = $(null), r = $({
|
|
1911
1911
|
src: "",
|
|
1912
1912
|
file: [],
|
|
1913
1913
|
// Завжди масив
|
|
@@ -1917,27 +1917,27 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
1917
1917
|
height: "",
|
|
1918
1918
|
link: "",
|
|
1919
1919
|
openInNewTab: !1
|
|
1920
|
-
}), i =
|
|
1921
|
-
if (Array.isArray(
|
|
1922
|
-
const m =
|
|
1923
|
-
return m.length +
|
|
1920
|
+
}), i = N(() => {
|
|
1921
|
+
if (Array.isArray(r.value.file)) {
|
|
1922
|
+
const m = r.value.file.filter((_) => _ instanceof File), k = r.value.file.filter((_) => typeof _ == "string" && _.trim() !== "");
|
|
1923
|
+
return m.length + k.length > 1;
|
|
1924
1924
|
}
|
|
1925
|
-
return
|
|
1926
|
-
}),
|
|
1925
|
+
return r.value.file instanceof FileList ? r.value.file.length > 1 : !1;
|
|
1926
|
+
}), x = N(() => Array.isArray(r.value.file) ? r.value.file.filter((m) => m instanceof File).length === 1 : r.value.file instanceof FileList ? r.value.file.length === 1 : r.value.file instanceof File), b = N(() => {
|
|
1927
1927
|
if (i.value)
|
|
1928
1928
|
return "";
|
|
1929
|
-
if (
|
|
1930
|
-
return
|
|
1931
|
-
if (
|
|
1929
|
+
if (r.value.src)
|
|
1930
|
+
return r.value.src;
|
|
1931
|
+
if (x.value) {
|
|
1932
1932
|
let m = null;
|
|
1933
|
-
if (Array.isArray(
|
|
1934
|
-
const
|
|
1935
|
-
return
|
|
1933
|
+
if (Array.isArray(r.value.file) || r.value.file instanceof FileList ? m = r.value.file[0] : r.value.file instanceof File && (m = r.value.file), m instanceof File) {
|
|
1934
|
+
const k = l.value.find((u) => u.file === m);
|
|
1935
|
+
return k ? k.preview : "";
|
|
1936
1936
|
} else if (typeof m == "string")
|
|
1937
1937
|
return m;
|
|
1938
1938
|
}
|
|
1939
1939
|
return "";
|
|
1940
|
-
}),
|
|
1940
|
+
}), f = N(() => [
|
|
1941
1941
|
{
|
|
1942
1942
|
name: "src",
|
|
1943
1943
|
label: "URL зображення",
|
|
@@ -1999,24 +1999,24 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
1999
1999
|
type: "switcher",
|
|
2000
2000
|
required: !1
|
|
2001
2001
|
}
|
|
2002
|
-
]),
|
|
2002
|
+
]), p = () => {
|
|
2003
2003
|
if (!e.editor) return;
|
|
2004
2004
|
if (e.editor.isActive("image")) {
|
|
2005
|
-
const { state:
|
|
2006
|
-
let y = null,
|
|
2007
|
-
if (
|
|
2008
|
-
y =
|
|
2005
|
+
const { state: k } = e.editor, { selection: u } = k, { $from: _ } = u;
|
|
2006
|
+
let y = null, T = null;
|
|
2007
|
+
if (_.parent.type.name === "image")
|
|
2008
|
+
y = _.before(_.depth), T = _.parent;
|
|
2009
2009
|
else
|
|
2010
|
-
for (let
|
|
2011
|
-
const
|
|
2012
|
-
|
|
2013
|
-
if (
|
|
2014
|
-
const
|
|
2015
|
-
(y === null || Math.abs(
|
|
2010
|
+
for (let H = _.depth; H > 0; H--) {
|
|
2011
|
+
const X = _.node(H), g = _.before(H);
|
|
2012
|
+
X.type.name === "paragraph" && X.forEach((A, B) => {
|
|
2013
|
+
if (A.type.name === "image") {
|
|
2014
|
+
const D = g + B + 1;
|
|
2015
|
+
(y === null || Math.abs(D - u.$from.pos) < Math.abs(y - u.$from.pos)) && (y = D, T = A);
|
|
2016
2016
|
}
|
|
2017
2017
|
});
|
|
2018
2018
|
}
|
|
2019
|
-
if (y !== null &&
|
|
2019
|
+
if (y !== null && T) {
|
|
2020
2020
|
try {
|
|
2021
2021
|
e.editor.chain().focus().setNodeSelection(y).run();
|
|
2022
2022
|
} catch {
|
|
@@ -2025,18 +2025,18 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2025
2025
|
c.value = y;
|
|
2026
2026
|
} else {
|
|
2027
2027
|
e.editor.chain().focus().selectParentNode().run();
|
|
2028
|
-
const { state:
|
|
2029
|
-
c.value =
|
|
2028
|
+
const { state: H } = e.editor;
|
|
2029
|
+
c.value = H.selection.$from.pos;
|
|
2030
2030
|
}
|
|
2031
|
-
const h =
|
|
2032
|
-
|
|
2031
|
+
const h = T ? T.attrs : e.editor.getAttributes("image");
|
|
2032
|
+
o.value = !0;
|
|
2033
2033
|
let S = "", M = !1;
|
|
2034
|
-
const
|
|
2035
|
-
|
|
2036
|
-
const j = h.src || "",
|
|
2037
|
-
|
|
2034
|
+
const z = e.editor.getAttributes("link");
|
|
2035
|
+
z && z.href && (S = z.href, M = z.target === "_blank");
|
|
2036
|
+
const j = h.src || "", F = j ? [j] : [];
|
|
2037
|
+
r.value = {
|
|
2038
2038
|
src: j,
|
|
2039
|
-
file:
|
|
2039
|
+
file: F,
|
|
2040
2040
|
// Масив з поточним зображенням
|
|
2041
2041
|
alt: h.alt || "",
|
|
2042
2042
|
title: h.title || "",
|
|
@@ -2046,7 +2046,7 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2046
2046
|
openInNewTab: M
|
|
2047
2047
|
};
|
|
2048
2048
|
} else
|
|
2049
|
-
|
|
2049
|
+
o.value = !1, r.value = {
|
|
2050
2050
|
src: "",
|
|
2051
2051
|
file: [],
|
|
2052
2052
|
// Завжди масив
|
|
@@ -2058,8 +2058,8 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2058
2058
|
openInNewTab: !1
|
|
2059
2059
|
};
|
|
2060
2060
|
s.value = !1, a.value = !0;
|
|
2061
|
-
},
|
|
2062
|
-
a.value = !1, s.value = !1,
|
|
2061
|
+
}, I = () => {
|
|
2062
|
+
a.value = !1, s.value = !1, o.value = !1, l.value = [], c.value = null, r.value = {
|
|
2063
2063
|
src: "",
|
|
2064
2064
|
file: [],
|
|
2065
2065
|
// Завжди масив
|
|
@@ -2070,40 +2070,40 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2070
2070
|
link: "",
|
|
2071
2071
|
openInNewTab: !1
|
|
2072
2072
|
};
|
|
2073
|
-
},
|
|
2073
|
+
}, V = async (m) => {
|
|
2074
2074
|
if (!m || m.length === 0)
|
|
2075
2075
|
return;
|
|
2076
|
-
const
|
|
2077
|
-
for (const
|
|
2078
|
-
if (
|
|
2079
|
-
const y = new Promise((
|
|
2076
|
+
const k = [];
|
|
2077
|
+
for (const u of m)
|
|
2078
|
+
if (u && u.type && u.type.startsWith("image/") && !l.value.some((y) => y.file === u)) {
|
|
2079
|
+
const y = new Promise((T, h) => {
|
|
2080
2080
|
const S = new FileReader();
|
|
2081
2081
|
S.onload = (M) => {
|
|
2082
2082
|
l.value.push({
|
|
2083
|
-
file:
|
|
2083
|
+
file: u,
|
|
2084
2084
|
preview: M.target.result,
|
|
2085
2085
|
error: !1
|
|
2086
|
-
}),
|
|
2087
|
-
}, S.onerror = h, S.readAsDataURL(
|
|
2086
|
+
}), T();
|
|
2087
|
+
}, S.onerror = h, S.readAsDataURL(u);
|
|
2088
2088
|
});
|
|
2089
|
-
|
|
2089
|
+
k.push(y);
|
|
2090
2090
|
}
|
|
2091
|
-
await Promise.all(
|
|
2092
|
-
},
|
|
2093
|
-
l.value.splice(m, 1), Array.isArray(
|
|
2094
|
-
},
|
|
2095
|
-
const m =
|
|
2096
|
-
return m &&
|
|
2097
|
-
},
|
|
2098
|
-
const
|
|
2091
|
+
await Promise.all(k);
|
|
2092
|
+
}, O = (m) => {
|
|
2093
|
+
l.value.splice(m, 1), Array.isArray(r.value.file) && r.value.file.splice(m, 1);
|
|
2094
|
+
}, R = () => {
|
|
2095
|
+
const m = r.value.width !== null && r.value.width !== void 0 && r.value.width !== "" && String(r.value.width).trim() !== "" ? String(r.value.width).trim() : "", k = r.value.height !== null && r.value.height !== void 0 && r.value.height !== "" && String(r.value.height).trim() !== "" ? String(r.value.height).trim() : "", u = {};
|
|
2096
|
+
return m && k ? (u.width = m, u.height = k, u.style = `width: ${m}px; height: ${k}px; object-fit: fill;`) : m ? (u.width = m, u.height = void 0) : k ? (u.height = k, u.width = void 0) : (u.width = void 0, u.height = void 0), u;
|
|
2097
|
+
}, J = (m, k = null, u = 50) => {
|
|
2098
|
+
const _ = () => {
|
|
2099
2099
|
const { view: h } = m;
|
|
2100
2100
|
if (!h || !h.dom) return;
|
|
2101
|
-
h.dom.querySelectorAll("img.editor-image[width][height]").forEach((
|
|
2102
|
-
if (
|
|
2103
|
-
const j =
|
|
2104
|
-
j &&
|
|
2101
|
+
h.dom.querySelectorAll("img.editor-image[width][height]").forEach((z) => {
|
|
2102
|
+
if (z instanceof HTMLImageElement) {
|
|
2103
|
+
const j = z.getAttribute("width"), F = z.getAttribute("height");
|
|
2104
|
+
j && F && j !== "auto" && F !== "auto" && j !== "" && F !== "" && !isNaN(Number(j)) && !isNaN(Number(F)) && (z.style.cssText = `
|
|
2105
2105
|
width: ${j}px !important;
|
|
2106
|
-
height: ${
|
|
2106
|
+
height: ${F}px !important;
|
|
2107
2107
|
max-width: none !important;
|
|
2108
2108
|
max-height: none !important;
|
|
2109
2109
|
min-width: auto !important;
|
|
@@ -2112,89 +2112,89 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2112
2112
|
`.replace(/\s+/g, " ").trim());
|
|
2113
2113
|
}
|
|
2114
2114
|
});
|
|
2115
|
-
}, y =
|
|
2116
|
-
y &&
|
|
2117
|
-
setTimeout(
|
|
2118
|
-
}) : (
|
|
2119
|
-
},
|
|
2120
|
-
let m = [],
|
|
2121
|
-
if (Array.isArray(
|
|
2115
|
+
}, y = r.value.width, T = r.value.height;
|
|
2116
|
+
y && T && y !== "" && T !== "" ? [0, u, u * 2, u * 3, u * 4].forEach((S) => {
|
|
2117
|
+
setTimeout(_, S);
|
|
2118
|
+
}) : (_(), setTimeout(_, u));
|
|
2119
|
+
}, P = async () => {
|
|
2120
|
+
let m = [], k = [];
|
|
2121
|
+
if (Array.isArray(r.value.file) ? (m = r.value.file.filter((h) => h instanceof File), k = r.value.file.filter((h) => typeof h == "string" && h.trim() !== "")) : r.value.file instanceof FileList ? m = Array.from(r.value.file) : r.value.file instanceof File ? m = [r.value.file] : typeof r.value.file == "string" && r.value.file.trim() !== "" && (k = [r.value.file]), m.length === 0 && k.length === 0 && n.value && n.value.file) {
|
|
2122
2122
|
const h = n.value.file;
|
|
2123
|
-
Array.isArray(h) ? (m = h.filter((S) => S instanceof File),
|
|
2123
|
+
Array.isArray(h) ? (m = h.filter((S) => S instanceof File), k = h.filter((S) => typeof S == "string" && S.trim() !== "")) : h instanceof FileList ? m = Array.from(h) : h instanceof File ? m = [h] : typeof h == "string" && h.trim() !== "" && (k = [h]);
|
|
2124
2124
|
}
|
|
2125
|
-
if (
|
|
2126
|
-
for (const h of
|
|
2125
|
+
if (k.length > 0 && !o.value) {
|
|
2126
|
+
for (const h of k)
|
|
2127
2127
|
l.value.some((S) => S.url === h) || l.value.push({
|
|
2128
2128
|
url: h,
|
|
2129
2129
|
preview: h,
|
|
2130
2130
|
error: !1
|
|
2131
2131
|
});
|
|
2132
2132
|
if (m.length === 0 && l.value.length > 0) {
|
|
2133
|
-
await
|
|
2133
|
+
await ne();
|
|
2134
2134
|
return;
|
|
2135
2135
|
}
|
|
2136
2136
|
}
|
|
2137
|
-
const
|
|
2138
|
-
if (!(
|
|
2139
|
-
if (
|
|
2137
|
+
const u = m.length, _ = u + k.length;
|
|
2138
|
+
if (!(o.value && u <= 1)) {
|
|
2139
|
+
if (u > 0) {
|
|
2140
2140
|
const h = m.filter(
|
|
2141
2141
|
(S) => !l.value.some((M) => M.file === S)
|
|
2142
2142
|
);
|
|
2143
|
-
h.length > 0 && await
|
|
2143
|
+
h.length > 0 && await V(h);
|
|
2144
2144
|
}
|
|
2145
2145
|
}
|
|
2146
|
-
if (!
|
|
2147
|
-
if (
|
|
2146
|
+
if (!o.value) {
|
|
2147
|
+
if (_ > 1 || i.value || l.value.length > 1) {
|
|
2148
2148
|
if (l.value.length > 0) {
|
|
2149
|
-
await
|
|
2149
|
+
await ne();
|
|
2150
2150
|
return;
|
|
2151
|
-
} else if (
|
|
2152
|
-
if (await
|
|
2153
|
-
await
|
|
2151
|
+
} else if (u > 0) {
|
|
2152
|
+
if (await V(m), l.value.length > 0) {
|
|
2153
|
+
await ne();
|
|
2154
2154
|
return;
|
|
2155
2155
|
}
|
|
2156
|
-
} else if (
|
|
2157
|
-
await
|
|
2156
|
+
} else if (k.length > 0) {
|
|
2157
|
+
await ne();
|
|
2158
2158
|
return;
|
|
2159
2159
|
}
|
|
2160
2160
|
} else if (l.value.length > 1) {
|
|
2161
|
-
await
|
|
2161
|
+
await ne();
|
|
2162
2162
|
return;
|
|
2163
2163
|
}
|
|
2164
2164
|
}
|
|
2165
|
-
let y =
|
|
2166
|
-
if (
|
|
2165
|
+
let y = r.value.src;
|
|
2166
|
+
if (x.value) {
|
|
2167
2167
|
let h = null;
|
|
2168
|
-
if (Array.isArray(
|
|
2168
|
+
if (Array.isArray(r.value.file) || r.value.file instanceof FileList ? h = r.value.file[0] : (r.value.file instanceof File || typeof r.value.file == "string") && (h = r.value.file), h instanceof File)
|
|
2169
2169
|
try {
|
|
2170
|
-
const S = new FileReader(), M = await new Promise((
|
|
2171
|
-
S.onload = (
|
|
2170
|
+
const S = new FileReader(), M = await new Promise((z, j) => {
|
|
2171
|
+
S.onload = (F) => z(F.target.result), S.onerror = j, S.readAsDataURL(h);
|
|
2172
2172
|
});
|
|
2173
|
-
y = M,
|
|
2173
|
+
y = M, o.value && (r.value.src = M);
|
|
2174
2174
|
} catch (S) {
|
|
2175
|
-
console.error("Помилка при читанні файлу:", S),
|
|
2175
|
+
console.error("Помилка при читанні файлу:", S), Se({
|
|
2176
2176
|
type: "error",
|
|
2177
2177
|
title: "Помилка",
|
|
2178
2178
|
message: "Не вдалося прочитати файл"
|
|
2179
2179
|
});
|
|
2180
2180
|
return;
|
|
2181
2181
|
}
|
|
2182
|
-
else typeof h == "string" && h.trim() !== "" && (y = h.trim(),
|
|
2183
|
-
} else if (Array.isArray(
|
|
2184
|
-
const h =
|
|
2185
|
-
typeof h == "string" && h.trim() !== "" && (y = h.trim(), (!
|
|
2186
|
-
} else typeof
|
|
2187
|
-
const
|
|
2188
|
-
if (!y && !
|
|
2189
|
-
|
|
2182
|
+
else typeof h == "string" && h.trim() !== "" && (y = h.trim(), o.value && h.trim() !== r.value.src && (r.value.src = h.trim(), y = h.trim()));
|
|
2183
|
+
} else if (Array.isArray(r.value.file) && r.value.file.length === 1) {
|
|
2184
|
+
const h = r.value.file[0];
|
|
2185
|
+
typeof h == "string" && h.trim() !== "" && (y = h.trim(), (!r.value.src || r.value.src !== h.trim()) && (r.value.src = h.trim()));
|
|
2186
|
+
} else typeof r.value.file == "string" && r.value.file.trim() !== "" && (y = r.value.file.trim(), (!r.value.src || r.value.src !== r.value.file.trim()) && (r.value.src = r.value.file.trim()));
|
|
2187
|
+
const T = y || Array.isArray(r.value.file) && r.value.file.length > 0 && (r.value.file.some((h) => h instanceof File) || r.value.file.some((h) => typeof h == "string" && h.trim() !== "")) || r.value.file instanceof FileList && r.value.file.length > 0 || typeof r.value.file == "string" && r.value.file.trim() !== "";
|
|
2188
|
+
if (!y && !T) {
|
|
2189
|
+
Se({
|
|
2190
2190
|
type: "warning",
|
|
2191
2191
|
title: "Попередження",
|
|
2192
2192
|
message: "Будь ласка, введіть URL зображення або виберіть файл"
|
|
2193
2193
|
});
|
|
2194
2194
|
return;
|
|
2195
2195
|
}
|
|
2196
|
-
if (!i.value && !
|
|
2197
|
-
|
|
2196
|
+
if (!i.value && !T && await n.value.validate()) {
|
|
2197
|
+
Se({
|
|
2198
2198
|
type: "warning",
|
|
2199
2199
|
title: "Попередження",
|
|
2200
2200
|
message: "Будь ласка, заповніть всі обов'язкові поля"
|
|
@@ -2202,301 +2202,301 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2202
2202
|
return;
|
|
2203
2203
|
}
|
|
2204
2204
|
if (e.editor && y)
|
|
2205
|
-
if (
|
|
2205
|
+
if (o.value && c.value !== null) {
|
|
2206
2206
|
const { state: h } = e.editor;
|
|
2207
2207
|
try {
|
|
2208
2208
|
e.editor.chain().focus().setNodeSelection(c.value).run();
|
|
2209
2209
|
} catch {
|
|
2210
2210
|
e.editor.chain().focus().setTextSelection(c.value).run();
|
|
2211
2211
|
}
|
|
2212
|
-
const S = e.editor.getAttributes("link"), M = S && S.href,
|
|
2212
|
+
const S = e.editor.getAttributes("link"), M = S && S.href, z = R(), j = {
|
|
2213
2213
|
src: y,
|
|
2214
|
-
alt:
|
|
2215
|
-
title:
|
|
2216
|
-
...
|
|
2214
|
+
alt: r.value.alt || "",
|
|
2215
|
+
title: r.value.title || "",
|
|
2216
|
+
...z
|
|
2217
2217
|
};
|
|
2218
|
-
if ((!
|
|
2219
|
-
const { view:
|
|
2220
|
-
if (!
|
|
2221
|
-
|
|
2222
|
-
if (
|
|
2223
|
-
const
|
|
2224
|
-
(
|
|
2218
|
+
if ((!r.value.width || r.value.width === "") && (j.width = void 0), (!r.value.height || r.value.height === "") && (j.height = void 0), e.editor.chain().focus().updateAttributes("image", j).run(), setTimeout(() => {
|
|
2219
|
+
const { view: F } = e.editor;
|
|
2220
|
+
if (!F || !F.dom) return;
|
|
2221
|
+
F.dom.querySelectorAll("img.editor-image").forEach((g) => {
|
|
2222
|
+
if (g instanceof HTMLImageElement) {
|
|
2223
|
+
const A = g.getAttribute("src") || g.src;
|
|
2224
|
+
(A === y || A.includes(y.split("/").pop())) && (r.value.width && r.value.height ? (g.style.setProperty("width", `${r.value.width}px`, "important"), g.style.setProperty("height", `${r.value.height}px`, "important"), g.style.setProperty("object-fit", "fill", "important"), g.style.setProperty("max-width", "none", "important"), g.style.setProperty("max-height", "none", "important")) : (g.style.removeProperty("width"), g.style.removeProperty("height"), g.style.removeProperty("object-fit"), g.style.removeProperty("max-width"), g.style.removeProperty("max-height")));
|
|
2225
2225
|
}
|
|
2226
2226
|
});
|
|
2227
|
-
}, 20),
|
|
2228
|
-
let
|
|
2229
|
-
|
|
2230
|
-
href:
|
|
2231
|
-
target:
|
|
2227
|
+
}, 20), r.value.link && r.value.link.trim() !== "") {
|
|
2228
|
+
let F = r.value.link.trim();
|
|
2229
|
+
F.match(/^https?:\/\//i) || (F = "https://" + F), M ? e.editor.chain().focus().extendMarkRange("link").setLink({
|
|
2230
|
+
href: F,
|
|
2231
|
+
target: r.value.openInNewTab ? "_blank" : null
|
|
2232
2232
|
}).run() : e.editor.chain().focus().selectParentNode().setLink({
|
|
2233
|
-
href:
|
|
2234
|
-
target:
|
|
2233
|
+
href: F,
|
|
2234
|
+
target: r.value.openInNewTab ? "_blank" : null
|
|
2235
2235
|
}).run();
|
|
2236
2236
|
} else M && e.editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
2237
2237
|
} else {
|
|
2238
2238
|
const { state: h } = e.editor, { selection: S } = h, { $anchor: M } = S;
|
|
2239
|
-
let
|
|
2240
|
-
for (let
|
|
2241
|
-
const
|
|
2242
|
-
if (
|
|
2243
|
-
|
|
2239
|
+
let z = null;
|
|
2240
|
+
for (let F = M.depth; F > 0; F--) {
|
|
2241
|
+
const H = M.node(F);
|
|
2242
|
+
if (H && H.type.name === "paragraph") {
|
|
2243
|
+
z = H;
|
|
2244
2244
|
break;
|
|
2245
2245
|
}
|
|
2246
2246
|
}
|
|
2247
|
-
if (
|
|
2248
|
-
(
|
|
2247
|
+
if (z && z.content.content.some(
|
|
2248
|
+
(F) => F.type.name === "image"
|
|
2249
2249
|
)) {
|
|
2250
|
-
const
|
|
2251
|
-
if (
|
|
2252
|
-
const
|
|
2250
|
+
const F = ee(z, M.before(M.depth));
|
|
2251
|
+
if (F !== null) {
|
|
2252
|
+
const H = R(), X = h.schema.nodes.image.create({
|
|
2253
2253
|
src: y,
|
|
2254
|
-
alt:
|
|
2255
|
-
title:
|
|
2256
|
-
...
|
|
2254
|
+
alt: r.value.alt || "",
|
|
2255
|
+
title: r.value.title || "",
|
|
2256
|
+
...H
|
|
2257
2257
|
});
|
|
2258
|
-
if (
|
|
2259
|
-
let
|
|
2260
|
-
|
|
2261
|
-
const
|
|
2262
|
-
href:
|
|
2263
|
-
target:
|
|
2264
|
-
}),
|
|
2265
|
-
e.editor.chain().focus().insertContentAt(
|
|
2258
|
+
if (r.value.link && r.value.link.trim() !== "") {
|
|
2259
|
+
let g = r.value.link.trim();
|
|
2260
|
+
g.match(/^https?:\/\//i) || (g = "https://" + g);
|
|
2261
|
+
const A = h.schema.marks.link.create({
|
|
2262
|
+
href: g,
|
|
2263
|
+
target: r.value.openInNewTab ? "_blank" : null
|
|
2264
|
+
}), B = X.type.create(X.attrs, X.content, [A]);
|
|
2265
|
+
e.editor.chain().focus().insertContentAt(F + 1, B).run(), J(e.editor, y);
|
|
2266
2266
|
} else
|
|
2267
|
-
e.editor.chain().focus().insertContentAt(
|
|
2268
|
-
} else if (
|
|
2269
|
-
const
|
|
2267
|
+
e.editor.chain().focus().insertContentAt(F + 1, X).run(), J(e.editor, y);
|
|
2268
|
+
} else if (r.value.link && r.value.link.trim() !== "") {
|
|
2269
|
+
const H = R();
|
|
2270
2270
|
e.editor.chain().focus().setImage({
|
|
2271
2271
|
src: y,
|
|
2272
|
-
alt:
|
|
2273
|
-
title:
|
|
2274
|
-
...
|
|
2272
|
+
alt: r.value.alt || "",
|
|
2273
|
+
title: r.value.title || "",
|
|
2274
|
+
...H
|
|
2275
2275
|
}).run(), setTimeout(() => {
|
|
2276
|
-
let
|
|
2277
|
-
|
|
2278
|
-
href:
|
|
2279
|
-
target:
|
|
2280
|
-
}).run(),
|
|
2276
|
+
let X = r.value.link.trim();
|
|
2277
|
+
X.match(/^https?:\/\//i) || (X = "https://" + X), e.editor.chain().focus().selectParentNode().setLink({
|
|
2278
|
+
href: X,
|
|
2279
|
+
target: r.value.openInNewTab ? "_blank" : null
|
|
2280
|
+
}).run(), J(e.editor, y, 20);
|
|
2281
2281
|
}, 10);
|
|
2282
2282
|
} else {
|
|
2283
|
-
const
|
|
2283
|
+
const H = R();
|
|
2284
2284
|
e.editor.chain().focus().setImage({
|
|
2285
2285
|
src: y,
|
|
2286
|
-
alt:
|
|
2287
|
-
title:
|
|
2288
|
-
...
|
|
2289
|
-
}).run(),
|
|
2286
|
+
alt: r.value.alt || "",
|
|
2287
|
+
title: r.value.title || "",
|
|
2288
|
+
...H
|
|
2289
|
+
}).run(), J(e.editor, y);
|
|
2290
2290
|
}
|
|
2291
|
-
} else if (
|
|
2292
|
-
const
|
|
2291
|
+
} else if (r.value.link && r.value.link.trim() !== "") {
|
|
2292
|
+
const F = R();
|
|
2293
2293
|
e.editor.chain().focus().setImage({
|
|
2294
2294
|
src: y,
|
|
2295
|
-
alt:
|
|
2296
|
-
title:
|
|
2297
|
-
...
|
|
2295
|
+
alt: r.value.alt || "",
|
|
2296
|
+
title: r.value.title || "",
|
|
2297
|
+
...F
|
|
2298
2298
|
}).run(), setTimeout(() => {
|
|
2299
|
-
let
|
|
2300
|
-
|
|
2301
|
-
href:
|
|
2302
|
-
target:
|
|
2303
|
-
}).run(),
|
|
2299
|
+
let H = r.value.link.trim();
|
|
2300
|
+
H.match(/^https?:\/\//i) || (H = "https://" + H), e.editor.chain().focus().selectParentNode().setLink({
|
|
2301
|
+
href: H,
|
|
2302
|
+
target: r.value.openInNewTab ? "_blank" : null
|
|
2303
|
+
}).run(), J(e.editor, y, 20);
|
|
2304
2304
|
}, 10);
|
|
2305
2305
|
} else {
|
|
2306
|
-
const
|
|
2306
|
+
const F = R();
|
|
2307
2307
|
e.editor.chain().focus().setImage({
|
|
2308
2308
|
src: y,
|
|
2309
|
-
alt:
|
|
2310
|
-
title:
|
|
2311
|
-
...
|
|
2312
|
-
}).run(),
|
|
2309
|
+
alt: r.value.alt || "",
|
|
2310
|
+
title: r.value.title || "",
|
|
2311
|
+
...F
|
|
2312
|
+
}).run(), J(e.editor, y);
|
|
2313
2313
|
}
|
|
2314
2314
|
}
|
|
2315
|
-
|
|
2316
|
-
},
|
|
2317
|
-
let
|
|
2318
|
-
return m.forEach((
|
|
2319
|
-
|
|
2320
|
-
}),
|
|
2321
|
-
},
|
|
2315
|
+
I();
|
|
2316
|
+
}, ee = (m, k) => {
|
|
2317
|
+
let u = null;
|
|
2318
|
+
return m.forEach((_, y) => {
|
|
2319
|
+
_.type.name === "image" && (u = k + y + 1);
|
|
2320
|
+
}), u;
|
|
2321
|
+
}, ne = async () => {
|
|
2322
2322
|
if (e.editor) {
|
|
2323
2323
|
if (l.value.length === 0)
|
|
2324
|
-
if (Array.isArray(
|
|
2325
|
-
const m =
|
|
2326
|
-
for (const
|
|
2327
|
-
l.value.some((
|
|
2328
|
-
url:
|
|
2329
|
-
preview:
|
|
2324
|
+
if (Array.isArray(r.value.file) && r.value.file.length > 0) {
|
|
2325
|
+
const m = r.value.file.filter((u) => typeof u == "string" && u.trim() !== ""), k = r.value.file.filter((u) => u instanceof File);
|
|
2326
|
+
for (const u of m)
|
|
2327
|
+
l.value.some((_) => _.url === u || _.preview === u) || l.value.push({
|
|
2328
|
+
url: u,
|
|
2329
|
+
preview: u,
|
|
2330
2330
|
error: !1
|
|
2331
2331
|
});
|
|
2332
|
-
|
|
2333
|
-
} else i.value && await
|
|
2332
|
+
k.length > 0 && await V(k);
|
|
2333
|
+
} else i.value && await V(r.value.file);
|
|
2334
2334
|
if (l.value.length !== 0)
|
|
2335
2335
|
try {
|
|
2336
|
-
const m = [],
|
|
2337
|
-
for (const
|
|
2338
|
-
const
|
|
2339
|
-
if (
|
|
2336
|
+
const m = [], k = R();
|
|
2337
|
+
for (const u of l.value) {
|
|
2338
|
+
const _ = u.url || u.preview || "";
|
|
2339
|
+
if (!_) continue;
|
|
2340
2340
|
const y = e.editor.schema.nodes.image.create({
|
|
2341
|
-
src:
|
|
2342
|
-
alt:
|
|
2343
|
-
title:
|
|
2344
|
-
...
|
|
2341
|
+
src: _,
|
|
2342
|
+
alt: r.value.alt || "",
|
|
2343
|
+
title: r.value.title || "",
|
|
2344
|
+
...k
|
|
2345
2345
|
});
|
|
2346
2346
|
m.push(y);
|
|
2347
2347
|
}
|
|
2348
|
-
m.length > 0 && (e.editor.chain().focus().command(({ tr:
|
|
2349
|
-
if (
|
|
2350
|
-
const { selection: y } =
|
|
2348
|
+
m.length > 0 && (e.editor.chain().focus().command(({ tr: u, dispatch: _ }) => {
|
|
2349
|
+
if (_) {
|
|
2350
|
+
const { selection: y } = u, { $anchor: T } = y;
|
|
2351
2351
|
let h = y.$anchor.pos, S = null, M = null;
|
|
2352
|
-
for (let j =
|
|
2353
|
-
const
|
|
2354
|
-
if (
|
|
2355
|
-
S =
|
|
2352
|
+
for (let j = T.depth; j > 0; j--) {
|
|
2353
|
+
const F = T.node(j);
|
|
2354
|
+
if (F && F.type.name === "paragraph") {
|
|
2355
|
+
S = F, M = T.start(j);
|
|
2356
2356
|
break;
|
|
2357
2357
|
}
|
|
2358
2358
|
}
|
|
2359
2359
|
if (S) {
|
|
2360
2360
|
let j = null;
|
|
2361
|
-
S.forEach((
|
|
2362
|
-
|
|
2361
|
+
S.forEach((F, H) => {
|
|
2362
|
+
F.type.name === "image" && (j = M + H + 1);
|
|
2363
2363
|
}), j !== null ? h = j + 1 : h = M + S.content.size;
|
|
2364
2364
|
}
|
|
2365
|
-
let
|
|
2365
|
+
let z = h;
|
|
2366
2366
|
return m.forEach((j) => {
|
|
2367
|
-
|
|
2367
|
+
u.insert(z, j), z += j.nodeSize;
|
|
2368
2368
|
}), !0;
|
|
2369
2369
|
}
|
|
2370
2370
|
return !1;
|
|
2371
|
-
}).run(),
|
|
2372
|
-
const { view:
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
const M = S.url || S.preview || "",
|
|
2376
|
-
return
|
|
2377
|
-
}) && (
|
|
2371
|
+
}).run(), r.value.width && r.value.height && setTimeout(() => {
|
|
2372
|
+
const { view: u } = e.editor;
|
|
2373
|
+
u && u.dom && u.dom.querySelectorAll("img.editor-image").forEach((T) => {
|
|
2374
|
+
T instanceof HTMLImageElement && Array.from(l.value).some((S) => {
|
|
2375
|
+
const M = S.url || S.preview || "", z = T.src || T.getAttribute("src") || "";
|
|
2376
|
+
return z === M || z.includes(M.split("/").pop());
|
|
2377
|
+
}) && (T.style.setProperty("width", `${r.value.width}px`, "important"), T.style.setProperty("height", `${r.value.height}px`, "important"), T.style.setProperty("object-fit", "fill", "important"), T.style.setProperty("max-width", "none", "important"), T.style.setProperty("max-height", "none", "important"));
|
|
2378
2378
|
});
|
|
2379
|
-
}, 50)),
|
|
2379
|
+
}, 50)), I();
|
|
2380
2380
|
} catch (m) {
|
|
2381
|
-
console.error("Помилка при додаванні зображень:", m),
|
|
2381
|
+
console.error("Помилка при додаванні зображень:", m), Se({
|
|
2382
2382
|
type: "error",
|
|
2383
2383
|
title: "Помилка",
|
|
2384
2384
|
message: "Не вдалося додати зображення"
|
|
2385
2385
|
});
|
|
2386
2386
|
}
|
|
2387
2387
|
}
|
|
2388
|
-
},
|
|
2389
|
-
await
|
|
2390
|
-
},
|
|
2391
|
-
|
|
2388
|
+
}, pe = async () => {
|
|
2389
|
+
await P();
|
|
2390
|
+
}, ge = () => {
|
|
2391
|
+
I();
|
|
2392
2392
|
};
|
|
2393
|
-
return
|
|
2394
|
-
if (s.value = !1, !(
|
|
2393
|
+
return me(() => r.value.file, async (m, k) => {
|
|
2394
|
+
if (s.value = !1, !(o.value && Array.isArray(m) && m.length === 1 && typeof m[0] == "string" && !m.some((_) => _ instanceof File)))
|
|
2395
2395
|
if (Array.isArray(m) && m.length > 0) {
|
|
2396
|
-
const
|
|
2397
|
-
if (
|
|
2396
|
+
const u = m.filter((y) => y instanceof File), _ = m.filter((y) => typeof y == "string" && y.trim() !== "");
|
|
2397
|
+
if (u.length > 0 && (o.value ? o.value && u.length === 1 && _.length === 0 && (l.value = []) : l.value = [], (!o.value || u.length > 1 || _.length > 0) && await V(u), o.value && u.length === 1 && _.length === 0)) {
|
|
2398
2398
|
const y = new FileReader();
|
|
2399
|
-
y.onload = (
|
|
2400
|
-
|
|
2401
|
-
}, y.readAsDataURL(
|
|
2399
|
+
y.onload = (T) => {
|
|
2400
|
+
r.value.src = T.target.result;
|
|
2401
|
+
}, y.readAsDataURL(u[0]);
|
|
2402
2402
|
}
|
|
2403
|
-
if (
|
|
2404
|
-
if (
|
|
2405
|
-
|
|
2403
|
+
if (_.length > 0)
|
|
2404
|
+
if (o.value)
|
|
2405
|
+
o.value && _.length === 1 && u.length === 0 && (r.value.src = _[0]);
|
|
2406
2406
|
else {
|
|
2407
|
-
|
|
2408
|
-
for (const y of
|
|
2409
|
-
l.value.some((
|
|
2407
|
+
u.length === 0 && (l.value = []);
|
|
2408
|
+
for (const y of _)
|
|
2409
|
+
l.value.some((T) => T.url === y || T.preview === y) || l.value.push({
|
|
2410
2410
|
url: y,
|
|
2411
2411
|
preview: y,
|
|
2412
2412
|
error: !1
|
|
2413
2413
|
});
|
|
2414
2414
|
}
|
|
2415
|
-
} else m && typeof m == "object" && m instanceof FileList ? (
|
|
2416
|
-
}, { immediate: !1 }),
|
|
2415
|
+
} else m && typeof m == "object" && m instanceof FileList ? (o.value || (l.value = []), await V(Array.from(m))) : m && typeof m == "object" && !Array.isArray(m) && m instanceof File ? (o.value || (l.value = []), await V([m])) : o.value || (l.value = []);
|
|
2416
|
+
}, { immediate: !1 }), me(() => r.value.src, () => {
|
|
2417
2417
|
s.value = !1;
|
|
2418
|
-
}), (m,
|
|
2418
|
+
}), (m, k) => (v(), w("div", ll, [
|
|
2419
2419
|
d("button", {
|
|
2420
|
-
onClick:
|
|
2420
|
+
onClick: p,
|
|
2421
2421
|
class: E([
|
|
2422
2422
|
"h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",
|
|
2423
2423
|
t.editor?.isActive("image") ? "bg-gray-200 text-gray-900" : ""
|
|
2424
2424
|
]),
|
|
2425
2425
|
title: "Додати зображення"
|
|
2426
2426
|
}, [
|
|
2427
|
-
|
|
2428
|
-
|
|
2427
|
+
C(L(Kt), { class: "h-4 w-4" }),
|
|
2428
|
+
k[4] || (k[4] = d("span", { class: "sr-only" }, "Додати зображення", -1))
|
|
2429
2429
|
], 2),
|
|
2430
|
-
|
|
2430
|
+
C(ot, {
|
|
2431
2431
|
modelValue: a.value,
|
|
2432
|
-
"onUpdate:modelValue":
|
|
2433
|
-
title:
|
|
2432
|
+
"onUpdate:modelValue": k[3] || (k[3] = (u) => a.value = u),
|
|
2433
|
+
title: o.value ? "Редагувати зображення" : "Додати зображення"
|
|
2434
2434
|
}, {
|
|
2435
|
-
footer:
|
|
2436
|
-
d("div",
|
|
2435
|
+
footer: q(() => [
|
|
2436
|
+
d("div", pl, [
|
|
2437
2437
|
d("button", {
|
|
2438
|
-
onClick:
|
|
2438
|
+
onClick: ge,
|
|
2439
2439
|
type: "button",
|
|
2440
2440
|
class: "px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
2441
2441
|
}, " Скасувати "),
|
|
2442
2442
|
d("button", {
|
|
2443
|
-
onClick:
|
|
2443
|
+
onClick: pe,
|
|
2444
2444
|
type: "button",
|
|
2445
2445
|
class: "px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
2446
|
-
},
|
|
2446
|
+
}, Y(o.value ? "Оновити зображення" : "Додати зображення"), 1)
|
|
2447
2447
|
])
|
|
2448
2448
|
]),
|
|
2449
|
-
default:
|
|
2450
|
-
|
|
2451
|
-
modelValue:
|
|
2452
|
-
"onUpdate:modelValue":
|
|
2453
|
-
schema:
|
|
2449
|
+
default: q(() => [
|
|
2450
|
+
C(yt, {
|
|
2451
|
+
modelValue: r.value,
|
|
2452
|
+
"onUpdate:modelValue": k[0] || (k[0] = (u) => r.value = u),
|
|
2453
|
+
schema: f.value,
|
|
2454
2454
|
form: n.value,
|
|
2455
|
-
"onUpdate:form":
|
|
2455
|
+
"onUpdate:form": k[1] || (k[1] = (u) => n.value = u)
|
|
2456
2456
|
}, null, 8, ["modelValue", "schema", "form"]),
|
|
2457
|
-
b.value && !i.value ? (v(),
|
|
2458
|
-
|
|
2459
|
-
|
|
2457
|
+
b.value && !i.value ? (v(), w("div", al, [
|
|
2458
|
+
k[5] || (k[5] = d("p", { class: "text-sm text-gray-600 mb-2" }, "Попередній перегляд:", -1)),
|
|
2459
|
+
de(d("img", {
|
|
2460
2460
|
src: b.value,
|
|
2461
|
-
alt:
|
|
2462
|
-
title:
|
|
2461
|
+
alt: r.value.alt || "Попередній перегляд зображення",
|
|
2462
|
+
title: r.value.title,
|
|
2463
2463
|
class: "max-w-full h-auto max-h-32 rounded border",
|
|
2464
|
-
onError:
|
|
2465
|
-
}, null, 40,
|
|
2466
|
-
[
|
|
2464
|
+
onError: k[2] || (k[2] = (u) => s.value = !0)
|
|
2465
|
+
}, null, 40, nl), [
|
|
2466
|
+
[$e, !s.value]
|
|
2467
2467
|
]),
|
|
2468
|
-
s.value ? (v(),
|
|
2469
|
-
])) :
|
|
2470
|
-
l.value.length > 0 ? (v(),
|
|
2471
|
-
d("p",
|
|
2472
|
-
|
|
2473
|
-
d("div",
|
|
2474
|
-
(v(!0),
|
|
2475
|
-
key:
|
|
2468
|
+
s.value ? (v(), w("p", sl, " Не вдалося завантажити попередній перегляд зображення ")) : U("", !0)
|
|
2469
|
+
])) : U("", !0),
|
|
2470
|
+
l.value.length > 0 ? (v(), w("div", il, [
|
|
2471
|
+
d("p", cl, "Попередній перегляд (" + Y(l.value.length) + " зображень):", 1),
|
|
2472
|
+
k[6] || (k[6] = d("p", { class: "text-xs text-gray-500 mb-2" }, " Зображення будуть розміщені в ряд, якщо вони помістяться по ширині ", -1)),
|
|
2473
|
+
d("div", dl, [
|
|
2474
|
+
(v(!0), w(ae, null, ie(l.value, (u, _) => (v(), w("div", {
|
|
2475
|
+
key: _,
|
|
2476
2476
|
class: "relative"
|
|
2477
2477
|
}, [
|
|
2478
|
-
|
|
2479
|
-
src:
|
|
2480
|
-
alt: `Попередній перегляд ${
|
|
2478
|
+
de(d("img", {
|
|
2479
|
+
src: u.preview,
|
|
2480
|
+
alt: `Попередній перегляд ${_ + 1}`,
|
|
2481
2481
|
class: "max-w-[100px] max-h-[100px] rounded border object-contain",
|
|
2482
|
-
onError: (y) =>
|
|
2483
|
-
}, null, 40,
|
|
2484
|
-
[
|
|
2482
|
+
onError: (y) => u.error = !0
|
|
2483
|
+
}, null, 40, ul), [
|
|
2484
|
+
[$e, !u.error]
|
|
2485
2485
|
]),
|
|
2486
2486
|
d("button", {
|
|
2487
|
-
onClick: (y) =>
|
|
2487
|
+
onClick: (y) => O(_),
|
|
2488
2488
|
class: "absolute -top-2 -right-2 bg-red-500 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",
|
|
2489
2489
|
type: "button"
|
|
2490
|
-
}, " × ", 8,
|
|
2490
|
+
}, " × ", 8, fl)
|
|
2491
2491
|
]))), 128))
|
|
2492
2492
|
])
|
|
2493
|
-
])) :
|
|
2493
|
+
])) : U("", !0)
|
|
2494
2494
|
]),
|
|
2495
2495
|
_: 1
|
|
2496
2496
|
}, 8, ["modelValue", "title"])
|
|
2497
2497
|
]));
|
|
2498
2498
|
}
|
|
2499
|
-
}),
|
|
2499
|
+
}), hl = { class: "flex items-center" }, vl = ["disabled"], ml = ["disabled"], bl = /* @__PURE__ */ Object.assign({
|
|
2500
2500
|
inheritAttrs: !1
|
|
2501
2501
|
}, {
|
|
2502
2502
|
__name: "vs-editor-history",
|
|
@@ -2507,7 +2507,7 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2507
2507
|
}, s = () => {
|
|
2508
2508
|
e.editor?.can().redo() && e.editor.chain().focus().redo().run();
|
|
2509
2509
|
};
|
|
2510
|
-
return (n,
|
|
2510
|
+
return (n, o) => (v(), w("div", hl, [
|
|
2511
2511
|
d("button", {
|
|
2512
2512
|
onClick: a,
|
|
2513
2513
|
class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-l-full hover:text-gray-900 hover:bg-gray-100 border-r border-gray-200", [
|
|
@@ -2516,8 +2516,8 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2516
2516
|
disabled: !t.editor?.can().undo(),
|
|
2517
2517
|
title: "Undo (Ctrl+Z)"
|
|
2518
2518
|
}, [
|
|
2519
|
-
|
|
2520
|
-
], 10,
|
|
2519
|
+
C(L(Wt), { class: "h-4 w-4" })
|
|
2520
|
+
], 10, vl),
|
|
2521
2521
|
d("button", {
|
|
2522
2522
|
onClick: s,
|
|
2523
2523
|
class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-r-full hover:text-gray-900 hover:bg-gray-100", [
|
|
@@ -2526,22 +2526,22 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2526
2526
|
disabled: !t.editor?.can().redo(),
|
|
2527
2527
|
title: "Redo (Ctrl+Y)"
|
|
2528
2528
|
}, [
|
|
2529
|
-
|
|
2530
|
-
], 10,
|
|
2529
|
+
C(L(Xt), { class: "h-4 w-4" })
|
|
2530
|
+
], 10, ml)
|
|
2531
2531
|
]));
|
|
2532
2532
|
}
|
|
2533
|
-
}),
|
|
2533
|
+
}), yl = /* @__PURE__ */ Q(bl, [["__scopeId", "data-v-6a87fc55"]]), xl = { class: "relative" }, wl = { class: "p-6" }, kl = { class: "flex justify-between items-center mb-4" }, _l = /* @__PURE__ */ Object.assign({
|
|
2534
2534
|
inheritAttrs: !1
|
|
2535
2535
|
}, {
|
|
2536
2536
|
__name: "vs-editor-help",
|
|
2537
2537
|
props: { editor: Object },
|
|
2538
2538
|
setup(t) {
|
|
2539
|
-
const e =
|
|
2539
|
+
const e = $(!1), a = $(null), s = () => {
|
|
2540
2540
|
e.value = !e.value;
|
|
2541
2541
|
}, n = () => {
|
|
2542
2542
|
e.value = !1;
|
|
2543
2543
|
};
|
|
2544
|
-
return (
|
|
2544
|
+
return (o, l) => (v(), w("div", xl, [
|
|
2545
2545
|
d("button", {
|
|
2546
2546
|
ref_key: "helpButton",
|
|
2547
2547
|
ref: a,
|
|
@@ -2549,35 +2549,35 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2549
2549
|
class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 text-gray-500", [e.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]]),
|
|
2550
2550
|
title: "Markdown Shortcuts Help"
|
|
2551
2551
|
}, [
|
|
2552
|
-
|
|
2552
|
+
C(L(Gt), { class: "h-4 w-4" })
|
|
2553
2553
|
], 2),
|
|
2554
|
-
e.value ? (v(),
|
|
2554
|
+
e.value ? (v(), w("div", {
|
|
2555
2555
|
key: 0,
|
|
2556
2556
|
class: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[100001]",
|
|
2557
2557
|
onClick: n
|
|
2558
2558
|
}, [
|
|
2559
2559
|
d("div", {
|
|
2560
2560
|
class: "bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] overflow-y-auto",
|
|
2561
|
-
onClick: l[0] || (l[0] =
|
|
2561
|
+
onClick: l[0] || (l[0] = pt(() => {
|
|
2562
2562
|
}, ["stop"]))
|
|
2563
2563
|
}, [
|
|
2564
|
-
d("div",
|
|
2565
|
-
d("div",
|
|
2564
|
+
d("div", wl, [
|
|
2565
|
+
d("div", kl, [
|
|
2566
2566
|
l[1] || (l[1] = d("h2", { class: "text-xl font-semibold text-gray-900" }, "Common Markdown Syntax & Shortcuts", -1)),
|
|
2567
2567
|
d("button", {
|
|
2568
2568
|
onClick: n,
|
|
2569
2569
|
class: "text-gray-400 hover:text-gray-600 transition-colors"
|
|
2570
2570
|
}, [
|
|
2571
|
-
|
|
2571
|
+
C(L(Pe), { class: "h-6 w-6" })
|
|
2572
2572
|
])
|
|
2573
2573
|
]),
|
|
2574
|
-
l[2] || (l[2] =
|
|
2574
|
+
l[2] || (l[2] = gt('<div class="space-y-6" data-v-92c21275><div data-v-92c21275><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-92c21275>Markdown Syntax</h3><div class="overflow-x-auto" data-v-92c21275><table class="w-full border-collapse" data-v-92c21275><thead data-v-92c21275><tr class="bg-gray-50" data-v-92c21275><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Example</th></tr></thead><tbody class="text-sm" data-v-92c21275><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>_italic text_</code></td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>###### Heading 6</code></td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>1. First item</code>). </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Start with a greater-than sign (>) followed by a space. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>`</code>). </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Images</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275></code> syntax. </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Links</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-92c21275><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-92c21275>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-92c21275><table class="w-full border-collapse" data-v-92c21275><thead data-v-92c21275><tr class="bg-gray-50" data-v-92c21275><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Action</th></tr></thead><tbody class="text-sm" data-v-92c21275><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Select all text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Apply bold formatting</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Copy selected text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Apply italic formatting</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Save the current document</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Paste copied text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Cut selected text</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Redo the last action</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Redo the last action</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Undo the last action</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Undo the last action</td></tr></tbody></table></div></div></div>', 1))
|
|
2575
2575
|
])
|
|
2576
2576
|
])
|
|
2577
|
-
])) :
|
|
2577
|
+
])) : U("", !0)
|
|
2578
2578
|
]));
|
|
2579
2579
|
}
|
|
2580
|
-
}),
|
|
2580
|
+
}), $l = /* @__PURE__ */ Q(_l, [["__scopeId", "data-v-92c21275"]]), Cl = {
|
|
2581
2581
|
__name: "vs-editor-horizontal-rule",
|
|
2582
2582
|
props: {
|
|
2583
2583
|
editor: Object
|
|
@@ -2586,15 +2586,15 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2586
2586
|
const e = t, a = () => {
|
|
2587
2587
|
e.editor && e.editor.chain().focus().setHorizontalRule().run();
|
|
2588
2588
|
};
|
|
2589
|
-
return (s, n) => (v(),
|
|
2589
|
+
return (s, n) => (v(), w("button", {
|
|
2590
2590
|
title: "Horizontal Rule",
|
|
2591
2591
|
onClick: a,
|
|
2592
2592
|
class: "flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"
|
|
2593
2593
|
}, [
|
|
2594
|
-
|
|
2594
|
+
C(L(Yt), { class: "h-4 w-4" })
|
|
2595
2595
|
]));
|
|
2596
2596
|
}
|
|
2597
|
-
},
|
|
2597
|
+
}, Al = {
|
|
2598
2598
|
__name: "vs-editor-fullscreen",
|
|
2599
2599
|
props: {
|
|
2600
2600
|
editor: Object
|
|
@@ -2604,41 +2604,41 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2604
2604
|
const a = e, s = () => {
|
|
2605
2605
|
a("toggle-fullscreen");
|
|
2606
2606
|
};
|
|
2607
|
-
return (n,
|
|
2607
|
+
return (n, o) => (v(), w("button", {
|
|
2608
2608
|
title: "Fullscreen",
|
|
2609
2609
|
onClick: s,
|
|
2610
2610
|
class: "w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100"
|
|
2611
2611
|
}, [
|
|
2612
|
-
|
|
2612
|
+
C(L(Qt), { class: "h-4 w-4" })
|
|
2613
2613
|
]));
|
|
2614
2614
|
}
|
|
2615
|
-
},
|
|
2616
|
-
bold:
|
|
2617
|
-
italic:
|
|
2618
|
-
color:
|
|
2619
|
-
background_color:
|
|
2620
|
-
highlight:
|
|
2621
|
-
bullet_list:
|
|
2622
|
-
ordered_list:
|
|
2623
|
-
blockquote:
|
|
2624
|
-
codeblock:
|
|
2625
|
-
underline:
|
|
2626
|
-
strike:
|
|
2627
|
-
link:
|
|
2628
|
-
table:
|
|
2629
|
-
text_align:
|
|
2630
|
-
font_family:
|
|
2631
|
-
font_size:
|
|
2632
|
-
superscript:
|
|
2633
|
-
subscript:
|
|
2634
|
-
heading:
|
|
2635
|
-
clear_formatting:
|
|
2636
|
-
image:
|
|
2637
|
-
history:
|
|
2638
|
-
help:
|
|
2639
|
-
horizontal_rule:
|
|
2640
|
-
fullscreen:
|
|
2641
|
-
},
|
|
2615
|
+
}, Fl = {
|
|
2616
|
+
bold: Pr,
|
|
2617
|
+
italic: Hr,
|
|
2618
|
+
color: Ao,
|
|
2619
|
+
background_color: Eo,
|
|
2620
|
+
highlight: Io,
|
|
2621
|
+
bullet_list: Cr,
|
|
2622
|
+
ordered_list: Sr,
|
|
2623
|
+
blockquote: kr,
|
|
2624
|
+
codeblock: Br,
|
|
2625
|
+
underline: Nr,
|
|
2626
|
+
strike: zr,
|
|
2627
|
+
link: io,
|
|
2628
|
+
table: go,
|
|
2629
|
+
text_align: mo,
|
|
2630
|
+
font_family: No,
|
|
2631
|
+
font_size: Oo,
|
|
2632
|
+
superscript: qo,
|
|
2633
|
+
subscript: Xo,
|
|
2634
|
+
heading: el,
|
|
2635
|
+
clear_formatting: ol,
|
|
2636
|
+
image: gl,
|
|
2637
|
+
history: yl,
|
|
2638
|
+
help: $l,
|
|
2639
|
+
horizontal_rule: Cl,
|
|
2640
|
+
fullscreen: Al
|
|
2641
|
+
}, Xe = {
|
|
2642
2642
|
// Базовий набір - мінімальний функціонал
|
|
2643
2643
|
basic: [
|
|
2644
2644
|
"history",
|
|
@@ -2712,17 +2712,17 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2712
2712
|
"fullscreen",
|
|
2713
2713
|
"help"
|
|
2714
2714
|
]
|
|
2715
|
-
},
|
|
2715
|
+
}, Sl = { class: "flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent" }, Tl = { class: "editor-body" }, Ll = {
|
|
2716
2716
|
key: 0,
|
|
2717
2717
|
class: "richtext-loading text-sm text-gray-500"
|
|
2718
|
-
},
|
|
2718
|
+
}, Bl = {
|
|
2719
2719
|
key: 1,
|
|
2720
2720
|
class: "richtext-error text-sm text-red-600"
|
|
2721
|
-
},
|
|
2721
|
+
}, El = { class: "html-source-editor" }, Il = { class: "flex justify-end border-t border-[#e5e7eb] bg-[#f8fafc] px-4 min-h-[38px] items-start overflow-visible" }, Pl = { class: "inline-flex items-stretch -mt-px" }, zl = /* @__PURE__ */ Object.assign({
|
|
2722
2722
|
inheritAttrs: !1
|
|
2723
2723
|
}, {
|
|
2724
2724
|
__name: "vs-richtext",
|
|
2725
|
-
props: /* @__PURE__ */
|
|
2725
|
+
props: /* @__PURE__ */ ht({
|
|
2726
2726
|
modelValue: { type: String, default: () => "" },
|
|
2727
2727
|
height: { type: String, default: () => "300px" },
|
|
2728
2728
|
format: { type: String, default: () => "html" },
|
|
@@ -2736,28 +2736,28 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2736
2736
|
}),
|
|
2737
2737
|
emits: ["update:modelValue"],
|
|
2738
2738
|
setup(t) {
|
|
2739
|
-
const e = t, a =
|
|
2740
|
-
() => e.format === "md" ?
|
|
2741
|
-
),
|
|
2742
|
-
const
|
|
2743
|
-
return
|
|
2744
|
-
const [
|
|
2745
|
-
!
|
|
2746
|
-
}),
|
|
2747
|
-
}),
|
|
2748
|
-
const
|
|
2749
|
-
return
|
|
2750
|
-
},
|
|
2751
|
-
const
|
|
2752
|
-
|
|
2753
|
-
},
|
|
2754
|
-
if (!
|
|
2755
|
-
|
|
2756
|
-
if (
|
|
2757
|
-
const
|
|
2758
|
-
|
|
2759
|
-
width: ${
|
|
2760
|
-
height: ${
|
|
2739
|
+
const e = t, a = vt(t, "modelValue"), s = $(null), n = $(null), o = mt(null), l = $(!1), c = $(""), r = $(!1), i = $(null), x = $(""), b = $(""), f = $(null), p = $(!1), I = $(!1), { isFullscreen: V, toggleFullscreen: O } = Zt(), { t: R } = ze(), J = N(() => e.format === "md" ? "markdown" : "html"), P = N(
|
|
2740
|
+
() => e.format === "md" ? R("form.richtext.markdown") : R("form.richtext.html")
|
|
2741
|
+
), ee = N(() => o.value || null), ne = N(() => typeof e.toolbar == "string" ? Xe[e.toolbar] || Xe.default : e.toolbar), pe = N(() => ne.value.map((g) => Fl[g]).filter(Boolean)), ge = N(() => (i.value?.attributes || []).find((A) => A.name === "class")?.value || ""), m = N(() => {
|
|
2742
|
+
const A = (i.value?.attributes || []).find((D) => D.name === "style")?.value || "", B = {};
|
|
2743
|
+
return A.split(";").forEach((D) => {
|
|
2744
|
+
const [G, ...Ae] = D.split(":"), he = G?.trim(), ve = Ae.join(":").trim();
|
|
2745
|
+
!he || !ve || he !== "height" && (B[he.replace(/-([a-z])/g, (Fe, nt) => nt.toUpperCase())] = ve);
|
|
2746
|
+
}), B;
|
|
2747
|
+
}), k = (g) => {
|
|
2748
|
+
const A = (g || "").trim();
|
|
2749
|
+
return A ? /^<p(?:\s+[^>]*)?>(?:\s|<br[^>]*>)*<\/p>$/i.test(A) : !0;
|
|
2750
|
+
}, u = (g) => k(g) ? "" : g || "", _ = (g) => {
|
|
2751
|
+
const A = g || "";
|
|
2752
|
+
f.value = A, a.value = A;
|
|
2753
|
+
}, y = (g) => {
|
|
2754
|
+
if (!g || !g.view || !g.view.dom) return;
|
|
2755
|
+
g.view.dom.querySelectorAll("img.editor-image[width][height]").forEach((B) => {
|
|
2756
|
+
if (B instanceof HTMLImageElement) {
|
|
2757
|
+
const D = B.getAttribute("width"), G = B.getAttribute("height");
|
|
2758
|
+
D && G && D !== "auto" && G !== "auto" && D !== "" && G !== "" && !isNaN(Number(D)) && !isNaN(Number(G)) && (B.style.cssText = `
|
|
2759
|
+
width: ${D}px !important;
|
|
2760
|
+
height: ${G}px !important;
|
|
2761
2761
|
max-width: none !important;
|
|
2762
2762
|
max-height: none !important;
|
|
2763
2763
|
min-width: auto !important;
|
|
@@ -2766,64 +2766,67 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2766
2766
|
`.replace(/\s+/g, " ").trim());
|
|
2767
2767
|
}
|
|
2768
2768
|
});
|
|
2769
|
-
},
|
|
2770
|
-
if (
|
|
2771
|
-
|
|
2772
|
-
|
|
2769
|
+
}, T = async (g, { force: A = !1 } = {}) => {
|
|
2770
|
+
if (x.value = g || "", !o.value || r.value && !A) return;
|
|
2771
|
+
u(o.value.getHTML()) !== (g || "") && (o.value.commands.setContent(g || "", !1), ue(() => {
|
|
2772
|
+
y(o.value);
|
|
2773
2773
|
}));
|
|
2774
|
-
},
|
|
2775
|
-
b.value =
|
|
2776
|
-
},
|
|
2777
|
-
const
|
|
2774
|
+
}, h = async (g) => {
|
|
2775
|
+
I.value = !0, b.value = g || "", await ue(), I.value = !1;
|
|
2776
|
+
}, S = async (g) => e.format === "html" ? Te(g || "") : g || "", M = async () => {
|
|
2777
|
+
const g = await S(b.value);
|
|
2778
|
+
g !== (a.value || "") ? _(g) : f.value = g;
|
|
2779
|
+
}, z = async (g) => {
|
|
2780
|
+
const A = g || "";
|
|
2778
2781
|
if (e.format === "html") {
|
|
2779
|
-
const
|
|
2780
|
-
i.value =
|
|
2782
|
+
const B = Te(A), D = Re(B);
|
|
2783
|
+
i.value = D.wrapper, await T(D.bodyHtml || ""), f.value = B;
|
|
2781
2784
|
return;
|
|
2782
2785
|
} else {
|
|
2783
2786
|
i.value = null;
|
|
2784
|
-
const
|
|
2785
|
-
await
|
|
2787
|
+
const B = await qe(A, e.format);
|
|
2788
|
+
await T(B || ""), r.value && await h(A);
|
|
2786
2789
|
}
|
|
2787
|
-
|
|
2788
|
-
},
|
|
2790
|
+
f.value = A;
|
|
2791
|
+
}, j = async () => {
|
|
2789
2792
|
if (e.format === "html") {
|
|
2790
|
-
const
|
|
2791
|
-
return
|
|
2793
|
+
const A = u(o.value?.getHTML() || x.value || ""), B = Ue(A, i.value);
|
|
2794
|
+
return Ke(Te(B), "html");
|
|
2792
2795
|
}
|
|
2793
|
-
const
|
|
2794
|
-
return
|
|
2795
|
-
},
|
|
2796
|
-
if (
|
|
2797
|
-
if (
|
|
2798
|
-
|
|
2796
|
+
const g = u(o.value?.getHTML() || x.value || "");
|
|
2797
|
+
return Ke(g, e.format);
|
|
2798
|
+
}, F = async (g) => {
|
|
2799
|
+
if (r.value !== g) {
|
|
2800
|
+
if (g) {
|
|
2801
|
+
p.value = !0, r.value = !0, await h(await j()), ue(() => {
|
|
2799
2802
|
n.value?.focus?.();
|
|
2800
2803
|
});
|
|
2801
2804
|
return;
|
|
2802
2805
|
}
|
|
2803
|
-
if (e.format === "html") {
|
|
2804
|
-
const
|
|
2805
|
-
i.value =
|
|
2806
|
+
if (await M(), e.format === "html") {
|
|
2807
|
+
const A = Te(b.value || ""), B = Re(A);
|
|
2808
|
+
i.value = B.wrapper, await T(B.bodyHtml || "", { force: !0 });
|
|
2806
2809
|
} else {
|
|
2807
|
-
const
|
|
2808
|
-
await
|
|
2810
|
+
const A = await qe(b.value || "", e.format);
|
|
2811
|
+
await T(A || "", { force: !0 });
|
|
2809
2812
|
}
|
|
2810
|
-
|
|
2811
|
-
|
|
2813
|
+
r.value = !1, p.value = !1, ue(() => {
|
|
2814
|
+
o.value?.commands?.focus?.();
|
|
2812
2815
|
});
|
|
2813
2816
|
}
|
|
2814
|
-
},
|
|
2815
|
-
|
|
2816
|
-
},
|
|
2817
|
+
}, H = () => {
|
|
2818
|
+
r.value || o.value?.commands?.focus?.();
|
|
2819
|
+
}, X = async () => {
|
|
2817
2820
|
if (!s.value) return null;
|
|
2818
2821
|
l.value = !0, c.value = "";
|
|
2819
2822
|
try {
|
|
2820
|
-
const
|
|
2821
|
-
if (!
|
|
2822
|
-
const
|
|
2823
|
+
const g = await ar();
|
|
2824
|
+
if (!g) return null;
|
|
2825
|
+
const A = new g.Editor({
|
|
2823
2826
|
element: s.value,
|
|
2824
|
-
content:
|
|
2827
|
+
content: x.value || "",
|
|
2825
2828
|
extensions: [
|
|
2826
|
-
|
|
2829
|
+
g.StarterKit.configure({
|
|
2827
2830
|
history: {
|
|
2828
2831
|
depth: 100,
|
|
2829
2832
|
newGroupDelay: 500
|
|
@@ -2842,159 +2845,161 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
|
|
|
2842
2845
|
heading: !1,
|
|
2843
2846
|
link: !1
|
|
2844
2847
|
}),
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2848
|
+
g.Superscript,
|
|
2849
|
+
g.Subscript,
|
|
2850
|
+
g.ExtendedTextStyle,
|
|
2851
|
+
g.CustomParagraph,
|
|
2852
|
+
g.CustomHeading,
|
|
2853
|
+
g.Highlight,
|
|
2854
|
+
g.Image.configure({
|
|
2852
2855
|
inline: !0,
|
|
2853
2856
|
allowBase64: !0,
|
|
2854
2857
|
HTMLAttributes: {
|
|
2855
2858
|
class: "editor-image"
|
|
2856
2859
|
}
|
|
2857
2860
|
}),
|
|
2858
|
-
|
|
2861
|
+
g.TextAlign.configure({
|
|
2859
2862
|
types: ["heading", "paragraph"]
|
|
2860
2863
|
}),
|
|
2861
|
-
|
|
2864
|
+
g.Link.configure({
|
|
2862
2865
|
HTMLAttributes: {
|
|
2863
2866
|
class: "editor-link"
|
|
2864
2867
|
},
|
|
2865
2868
|
openOnClick: !1,
|
|
2866
2869
|
autolink: !0
|
|
2867
2870
|
}),
|
|
2868
|
-
|
|
2869
|
-
|
|
2871
|
+
g.CustomTableKit,
|
|
2872
|
+
g.Iframe
|
|
2870
2873
|
],
|
|
2871
2874
|
editorProps: {
|
|
2872
|
-
handlePaste: (
|
|
2873
|
-
handleKeyDown: (
|
|
2874
|
-
if (
|
|
2875
|
-
const
|
|
2876
|
-
let
|
|
2877
|
-
for (let
|
|
2878
|
-
const
|
|
2879
|
-
if (
|
|
2880
|
-
|
|
2875
|
+
handlePaste: (B, D) => vr(B, D, g.ProseMirrorDOMParser),
|
|
2876
|
+
handleKeyDown: (B, D) => {
|
|
2877
|
+
if (D.key === "Tab") {
|
|
2878
|
+
const G = B.state, { $anchor: Ae } = G.selection;
|
|
2879
|
+
let he = !1;
|
|
2880
|
+
for (let ve = Ae.depth; ve > 0; ve--) {
|
|
2881
|
+
const Fe = Ae.node(ve);
|
|
2882
|
+
if (Fe && (Fe.type.name === "bulletList" || Fe.type.name === "orderedList")) {
|
|
2883
|
+
he = !0;
|
|
2881
2884
|
break;
|
|
2882
2885
|
}
|
|
2883
2886
|
}
|
|
2884
|
-
return
|
|
2887
|
+
return he ? !1 : (D.preventDefault(), !0);
|
|
2885
2888
|
}
|
|
2886
2889
|
return !1;
|
|
2887
2890
|
}
|
|
2888
2891
|
}
|
|
2889
2892
|
});
|
|
2890
|
-
return
|
|
2891
|
-
if (
|
|
2892
|
-
const
|
|
2893
|
-
if (
|
|
2894
|
-
const
|
|
2895
|
-
|
|
2893
|
+
return o.value = bt(A), o.value.on("update", async ({ editor: B }) => {
|
|
2894
|
+
if (r.value) return;
|
|
2895
|
+
const D = u(B.getHTML());
|
|
2896
|
+
if (x.value = D, e.format === "html") {
|
|
2897
|
+
const G = Ue(D, i.value);
|
|
2898
|
+
G !== a.value && _(G);
|
|
2896
2899
|
} else {
|
|
2897
|
-
const
|
|
2898
|
-
|
|
2900
|
+
const G = await gr(D, e.format);
|
|
2901
|
+
G !== a.value && _(G);
|
|
2899
2902
|
}
|
|
2900
2903
|
setTimeout(() => {
|
|
2901
|
-
|
|
2904
|
+
y(B);
|
|
2902
2905
|
}, 10);
|
|
2903
|
-
}),
|
|
2904
|
-
|
|
2905
|
-
}),
|
|
2906
|
-
} catch (
|
|
2907
|
-
return c.value = "Failed to load rich text editor dependencies.", console.error("Failed to initialize rich text editor",
|
|
2906
|
+
}), ue(() => {
|
|
2907
|
+
y(o.value);
|
|
2908
|
+
}), A;
|
|
2909
|
+
} catch (g) {
|
|
2910
|
+
return c.value = "Failed to load rich text editor dependencies.", console.error("Failed to initialize rich text editor", g), null;
|
|
2908
2911
|
} finally {
|
|
2909
2912
|
l.value = !1;
|
|
2910
2913
|
}
|
|
2911
2914
|
};
|
|
2912
|
-
return
|
|
2915
|
+
return me(
|
|
2913
2916
|
() => e.modelValue,
|
|
2914
|
-
async (
|
|
2915
|
-
if (
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2917
|
+
async (g) => {
|
|
2918
|
+
if (p.value) return;
|
|
2919
|
+
const A = g || "";
|
|
2920
|
+
A !== f.value && await z(A);
|
|
2918
2921
|
},
|
|
2919
2922
|
{ immediate: !0 }
|
|
2920
|
-
),
|
|
2921
|
-
await
|
|
2922
|
-
|
|
2923
|
-
|
|
2923
|
+
), me(b, async () => {
|
|
2924
|
+
!r.value || !p.value || I.value || await M();
|
|
2925
|
+
}), be(async () => {
|
|
2926
|
+
await X(), ue(() => {
|
|
2927
|
+
o.value && setTimeout(() => {
|
|
2928
|
+
y(o.value);
|
|
2924
2929
|
}, 100);
|
|
2925
2930
|
});
|
|
2926
|
-
}),
|
|
2927
|
-
r.value?.destroy?.(),
|
|
2928
|
-
}), (
|
|
2929
|
-
class: E(["bg-white rounded-md w-full", { "fixed left-0 right-0 top-0 bottom-0 z-[100000]": L(
|
|
2931
|
+
}), Qe(async () => {
|
|
2932
|
+
r.value && p.value && await M(), o.value?.destroy?.(), o.value = null;
|
|
2933
|
+
}), (g, A) => (v(), w("div", {
|
|
2934
|
+
class: E(["bg-white rounded-md w-full", { "fixed left-0 right-0 top-0 bottom-0 z-[100000]": L(V) }])
|
|
2930
2935
|
}, [
|
|
2931
|
-
d("div",
|
|
2932
|
-
(v(!0),
|
|
2933
|
-
|
|
2936
|
+
d("div", Sl, [
|
|
2937
|
+
(v(!0), w(ae, null, ie(pe.value, (B) => (v(), w(ae, { key: B }, [
|
|
2938
|
+
o.value ? (v(), W(Ee(B), {
|
|
2934
2939
|
key: 0,
|
|
2935
|
-
editor:
|
|
2940
|
+
editor: ee.value,
|
|
2936
2941
|
onToggleFullscreen: L(O)
|
|
2937
|
-
}, null, 40, ["editor", "onToggleFullscreen"])) :
|
|
2942
|
+
}, null, 40, ["editor", "onToggleFullscreen"])) : U("", !0)
|
|
2938
2943
|
], 64))), 128))
|
|
2939
2944
|
]),
|
|
2940
2945
|
d("div", {
|
|
2941
|
-
onClick:
|
|
2946
|
+
onClick: H,
|
|
2942
2947
|
class: "relative w-full px-4 py-2 bg-white rounded-b-lg editor-content",
|
|
2943
|
-
style:
|
|
2948
|
+
style: se({ height: L(V) ? "calc(95vh - 44px)" : t.height })
|
|
2944
2949
|
}, [
|
|
2945
|
-
d("div",
|
|
2946
|
-
|
|
2947
|
-
class: E(["rich-text-scroll-wrapper",
|
|
2948
|
-
style:
|
|
2950
|
+
d("div", Tl, [
|
|
2951
|
+
de(d("div", {
|
|
2952
|
+
class: E(["rich-text-scroll-wrapper", ge.value]),
|
|
2953
|
+
style: se(m.value)
|
|
2949
2954
|
}, [
|
|
2950
2955
|
d("div", {
|
|
2951
2956
|
ref_key: "editorElement",
|
|
2952
2957
|
ref: s,
|
|
2953
2958
|
class: "relative w-full"
|
|
2954
2959
|
}, null, 512),
|
|
2955
|
-
l.value ? (v(),
|
|
2956
|
-
c.value ? (v(),
|
|
2960
|
+
l.value ? (v(), w("div", Ll, "Loading editor...")) : U("", !0),
|
|
2961
|
+
c.value ? (v(), w("div", Bl, Y(c.value), 1)) : U("", !0)
|
|
2957
2962
|
], 6), [
|
|
2958
|
-
[
|
|
2963
|
+
[$e, !r.value]
|
|
2959
2964
|
]),
|
|
2960
|
-
|
|
2961
|
-
|
|
2965
|
+
de(d("div", El, [
|
|
2966
|
+
C(xt, {
|
|
2962
2967
|
ref_key: "htmlTextarea",
|
|
2963
2968
|
ref: n,
|
|
2964
2969
|
modelValue: b.value,
|
|
2965
|
-
"onUpdate:modelValue":
|
|
2970
|
+
"onUpdate:modelValue": A[0] || (A[0] = (B) => b.value = B),
|
|
2966
2971
|
height: "100%",
|
|
2967
|
-
syntax:
|
|
2972
|
+
syntax: J.value,
|
|
2968
2973
|
theme: "vs-light"
|
|
2969
2974
|
}, null, 8, ["modelValue", "syntax"])
|
|
2970
2975
|
], 512), [
|
|
2971
|
-
[
|
|
2976
|
+
[$e, r.value]
|
|
2972
2977
|
])
|
|
2973
2978
|
])
|
|
2974
2979
|
], 4),
|
|
2975
|
-
d("div",
|
|
2976
|
-
d("div",
|
|
2980
|
+
d("div", Il, [
|
|
2981
|
+
d("div", Pl, [
|
|
2977
2982
|
d("button", {
|
|
2978
2983
|
type: "button",
|
|
2979
2984
|
class: E([
|
|
2980
2985
|
"min-w-[96px] h-[30px] px-[14px] border border-[#cfd6e0] bg-[#f3f5f8] text-[8px] font-bold uppercase tracking-[0.06em] leading-none cursor-pointer transition-colors duration-200 border-b-[1px] border-b-[#cfd6e0] rounded-none rounded-bl-[8px] hover:bg-[#eef1f5] hover:text-[#667284]",
|
|
2981
|
-
|
|
2986
|
+
r.value ? "text-[#8f99aa]" : "!bg-white text-[#49556a] border-[#cfd6e0] border-t-transparent relative z-[1]"
|
|
2982
2987
|
]),
|
|
2983
|
-
onClick:
|
|
2984
|
-
},
|
|
2988
|
+
onClick: A[1] || (A[1] = (B) => F(!1))
|
|
2989
|
+
}, Y(L(R)("form.richtext.editor")), 3),
|
|
2985
2990
|
d("button", {
|
|
2986
2991
|
type: "button",
|
|
2987
2992
|
class: E([
|
|
2988
2993
|
"min-w-[96px] h-[30px] px-[14px] border border-[#cfd6e0] border-l-0 bg-[#f3f5f8] text-[8px] font-bold uppercase tracking-[0.06em] leading-none cursor-pointer transition-colors duration-200 border-b-[1px] border-b-[#cfd6e0] rounded-none rounded-br-[8px] hover:bg-[#eef1f5] hover:text-[#667284]",
|
|
2989
|
-
|
|
2994
|
+
r.value ? "!bg-white text-[#49556a] border-[#cfd6e0] border-t-transparent relative z-[1]" : "text-[#8f99aa]"
|
|
2990
2995
|
]),
|
|
2991
|
-
onClick:
|
|
2992
|
-
},
|
|
2996
|
+
onClick: A[2] || (A[2] = (B) => F(!0))
|
|
2997
|
+
}, Y(P.value), 3)
|
|
2993
2998
|
])
|
|
2994
2999
|
])
|
|
2995
3000
|
], 2));
|
|
2996
3001
|
}
|
|
2997
3002
|
});
|
|
2998
3003
|
export {
|
|
2999
|
-
|
|
3004
|
+
zl as default
|
|
3000
3005
|
};
|