gbrichtext 0.1.1 → 0.1.2
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,5 +1,5 @@
|
|
|
1
|
-
import { getCurrentInstance as xi, getCurrentScope as Li, onScopeDispose as Mi, computed as j, openBlock as N, createElementBlock as D, createBlock as
|
|
2
|
-
import { gbToast as Kt, FONT_SIZES as
|
|
1
|
+
import { getCurrentInstance as xi, getCurrentScope as Li, onScopeDispose as Mi, computed as j, openBlock as N, createElementBlock as D, createBlock as Q, unref as U, normalizeProps as ro, guardReactiveProps as io, ref as S, reactive as Ni, watch as Ie, onBeforeUnmount as Rt, shallowRef as Ri, onMounted as lr, normalizeStyle as J, normalizeClass as be, renderSlot as de, createElementVNode as I, createCommentVNode as F, withModifiers as te, toDisplayString as pe, createVNode as B, Fragment as Ue, renderList as xt, nextTick as rt, withCtx as re, withDirectives as sr, withKeys as tt, vModelText as ar, createTextVNode as wo, Teleport as Oi, Transition as Bi, markRaw as Ii, h as Hi, defineAsyncComponent as zi, createSlots as Di } from "vue";
|
|
2
|
+
import { gbToast as Kt, FONT_SIZES as et, GbImageViewer as $i, GbPopover as _i, RECENT_STYLE_LIMIT as Pi, FONT_FAMILIES as xo, GbAppearancePanel as cr, ALIGN_OPTIONS as Fi, GbTableSizePicker as qi, GbButton as Lo, GbContextMenu as Ui, TEXT_COLORS as Vi, GbFindBar as Gi } from "guabiui";
|
|
3
3
|
const ge = {
|
|
4
4
|
info: (e, t) => Kt.info(e, t),
|
|
5
5
|
success: (e, t) => Kt.success(e, t),
|
|
@@ -92,7 +92,7 @@ function pr(e, t, n) {
|
|
|
92
92
|
o.unshift(r), r = r.parentElement;
|
|
93
93
|
return o.find(n) || null;
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const Xe = (e, t) => pr(e, t, (n) => ol(n, t)), rl = (e, t) => pr(e, t, (n) => on(n) || lo(n));
|
|
96
96
|
function il(e) {
|
|
97
97
|
return lo(e) ? e.parentElement : e;
|
|
98
98
|
}
|
|
@@ -148,7 +148,7 @@ function so(e) {
|
|
|
148
148
|
};
|
|
149
149
|
return e && n(e), t;
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function Ge(e, t) {
|
|
152
152
|
let n = 0, o = null;
|
|
153
153
|
const r = (i) => {
|
|
154
154
|
if (o) return;
|
|
@@ -214,7 +214,7 @@ function gr(e) {
|
|
|
214
214
|
}
|
|
215
215
|
function gn(e, t, n) {
|
|
216
216
|
if (!t?.block?.isConnected || !e.contains(t.block)) return;
|
|
217
|
-
const o =
|
|
217
|
+
const o = Ge(t.block, t.offset ?? 0), r = n?.block?.isConnected && e.contains(n.block) ? Ge(n.block, n.offset ?? 0) : o, i = document.createRange();
|
|
218
218
|
try {
|
|
219
219
|
i.setStart(o.node, o.offset), i.setEnd(r.node, r.offset);
|
|
220
220
|
} catch {
|
|
@@ -292,7 +292,7 @@ function al(e, t, n) {
|
|
|
292
292
|
if (!o) return null;
|
|
293
293
|
const r = o.node.nodeType === Node.TEXT_NODE ? o.node.parentElement : o.node;
|
|
294
294
|
if ($e(r, e)) return null;
|
|
295
|
-
const l =
|
|
295
|
+
const l = Xe(r, e) || yr(e, n);
|
|
296
296
|
return it(l) ? null : l;
|
|
297
297
|
}
|
|
298
298
|
function yr(e, t) {
|
|
@@ -305,7 +305,7 @@ function yr(e, t) {
|
|
|
305
305
|
}
|
|
306
306
|
return o <= 48 ? n : null;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function je(e, t, n) {
|
|
309
309
|
let o = e?.nodeType === Node.TEXT_NODE ? e.parentElement : e;
|
|
310
310
|
for (; o && o !== n && n.contains(o); ) {
|
|
311
311
|
if (t(o)) return o;
|
|
@@ -313,7 +313,7 @@ function Xe(e, t, n) {
|
|
|
313
313
|
}
|
|
314
314
|
return null;
|
|
315
315
|
}
|
|
316
|
-
const zt = (e) => !!e && (e.tagName === "TD" || e.tagName === "TH"), De = (e, t) =>
|
|
316
|
+
const zt = (e) => !!e && (e.tagName === "TD" || e.tagName === "TH"), De = (e, t) => je(e, zt, t), $e = (e, t) => je(e, (n) => n.tagName === "TABLE", t);
|
|
317
317
|
function cl(e) {
|
|
318
318
|
if (!e) return null;
|
|
319
319
|
const t = e.getBoundingClientRect();
|
|
@@ -328,7 +328,7 @@ function Mt(e, t, n) {
|
|
|
328
328
|
e && (n == null || n === "" ? e.style.removeProperty(t) : e.style.setProperty(t, String(n)), e.getAttribute("style") === "" && e.removeAttribute("style"));
|
|
329
329
|
}
|
|
330
330
|
function kr(e, t, n) {
|
|
331
|
-
const o =
|
|
331
|
+
const o = Ge(e, t), r = Ge(e, n), i = document.createRange();
|
|
332
332
|
return i.setStart(o.node, o.offset), i.setEnd(r.node, r.offset), i;
|
|
333
333
|
}
|
|
334
334
|
function he(e, t) {
|
|
@@ -408,7 +408,7 @@ const hl = /^(?:https?:|mailto:|tel:|ftp:|#|\/)/i, Cr = /^(?:https?:|data:image\
|
|
|
408
408
|
ATTACH: "doc-attach",
|
|
409
409
|
REF: "doc-ref",
|
|
410
410
|
EMBED: "doc-embed"
|
|
411
|
-
}, fo = "data-cmt", vn = "data-fn", lt = "data-attach", le = "data-ref-doc",
|
|
411
|
+
}, fo = "data-cmt", vn = "data-fn", lt = "data-attach", le = "data-ref-doc", Ke = "data-ref-block", Dt = "data-ref-sub", Ar = "data-color-theme", Tr = "data-color-theme-tint", Sr = "data-color-theme-shade", wr = ["data-re-runtime", "spellcheck", "autocorrect"], pl = ["x-small", "small", "medium", "large", "x-large", "xx-large", "xxx-large"];
|
|
412
412
|
function bn(e, { editable: t = !1 } = {}) {
|
|
413
413
|
if (fr(e), vl(e), gl(e), El(e), kl(e), Al(e), Tl(e), Sl(e), xl(e), Ll(e), Ml(e), Nl(e), Rl(e), wl(e), t && !e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,blockquote,pre,table,hr,img")) {
|
|
414
414
|
const n = document.createElement("p");
|
|
@@ -581,20 +581,20 @@ const Un = "data-key-scope", Bo = "data-key-active";
|
|
|
581
581
|
function Lr(e) {
|
|
582
582
|
return e?.closest?.(`[${Un}]`) ?? null;
|
|
583
583
|
}
|
|
584
|
-
let
|
|
584
|
+
let nt = null;
|
|
585
585
|
const Mr = (e) => {
|
|
586
|
-
|
|
586
|
+
nt = e.target instanceof Element ? e.target : null;
|
|
587
587
|
};
|
|
588
588
|
function Bl() {
|
|
589
589
|
document.addEventListener("pointerdown", Mr, !0);
|
|
590
590
|
}
|
|
591
591
|
function Il() {
|
|
592
|
-
document.removeEventListener("pointerdown", Mr, !0),
|
|
592
|
+
document.removeEventListener("pointerdown", Mr, !0), nt = null;
|
|
593
593
|
}
|
|
594
594
|
const Hl = (e) => !e || e === document || e === document.documentElement || e === document.body;
|
|
595
595
|
function zl(e) {
|
|
596
596
|
const t = e?.target;
|
|
597
|
-
return Hl(t) ? (
|
|
597
|
+
return Hl(t) ? (nt && !nt.isConnected && (nt = null), nt) : t;
|
|
598
598
|
}
|
|
599
599
|
function Dl(e, t) {
|
|
600
600
|
if (!t) return !0;
|
|
@@ -723,7 +723,7 @@ function es(e) {
|
|
|
723
723
|
const n = Number(t[1]);
|
|
724
724
|
if (!Number.isFinite(n)) return "";
|
|
725
725
|
const o = Math.round(t[2].toLowerCase() === "pt" ? n * (4 / 3) : n);
|
|
726
|
-
return o <
|
|
726
|
+
return o < et[0] || o > et[et.length - 1] ? "" : `${et.reduce((r, i) => Math.abs(i - o) < Math.abs(r - o) ? i : r, et[0])}px`;
|
|
727
727
|
}
|
|
728
728
|
function ts(e) {
|
|
729
729
|
const t = String(e).trim();
|
|
@@ -961,7 +961,7 @@ function Wn(e, t, n) {
|
|
|
961
961
|
n.push({
|
|
962
962
|
ref: {
|
|
963
963
|
docId: o.getAttribute(le) || "",
|
|
964
|
-
blockId: o.getAttribute(
|
|
964
|
+
blockId: o.getAttribute(Ke) || "",
|
|
965
965
|
sub: o.getAttribute(Dt) || "d",
|
|
966
966
|
text: o.textContent || ""
|
|
967
967
|
},
|
|
@@ -1007,7 +1007,7 @@ function bs(e) {
|
|
|
1007
1007
|
}
|
|
1008
1008
|
function ys(e) {
|
|
1009
1009
|
const t = document.createElement("span");
|
|
1010
|
-
return e.attach ? (t.className = H.ATTACH, t.setAttribute(lt, e.attach.id), t.textContent = e.attach.name || "") : (t.className = H.REF, t.setAttribute(le, e.ref.docId), e.ref.blockId && t.setAttribute(
|
|
1010
|
+
return e.attach ? (t.className = H.ATTACH, t.setAttribute(lt, e.attach.id), t.textContent = e.attach.name || "") : (t.className = H.REF, t.setAttribute(le, e.ref.docId), e.ref.blockId && t.setAttribute(Ke, e.ref.blockId), t.setAttribute(Dt, e.ref.sub === "s" ? "s" : "d"), t.textContent = e.ref.text || ""), t.setAttribute("contenteditable", "false"), t;
|
|
1011
1011
|
}
|
|
1012
1012
|
function ks(e, t) {
|
|
1013
1013
|
for (const o of ["code", "strike", "underline", "italic", "superscript", "subscript", "bold"]) {
|
|
@@ -1141,7 +1141,7 @@ function zo(e, t, n) {
|
|
|
1141
1141
|
const o = V(e);
|
|
1142
1142
|
if (!o || !o.collapsed) return !1;
|
|
1143
1143
|
const r = document.createElement("span");
|
|
1144
|
-
t === "attach" ? (r.className = H.ATTACH, r.setAttribute(lt, String(n?.id ?? "")), r.textContent = String(n?.name ?? "")) : (r.className = H.REF, r.setAttribute(le, String(n?.docId ?? "")), n?.blockId && r.setAttribute(
|
|
1144
|
+
t === "attach" ? (r.className = H.ATTACH, r.setAttribute(lt, String(n?.id ?? "")), r.textContent = String(n?.name ?? "")) : (r.className = H.REF, r.setAttribute(le, String(n?.docId ?? "")), n?.blockId && r.setAttribute(Ke, String(n.blockId)), r.setAttribute(Dt, n?.sub === "s" ? "s" : "d"), r.textContent = String(n?.text ?? "")), r.setAttribute("contenteditable", "false"), o.insertNode(r);
|
|
1145
1145
|
const i = document.createRange();
|
|
1146
1146
|
i.setStartAfter(r), i.collapse(!0);
|
|
1147
1147
|
const l = window.getSelection();
|
|
@@ -1162,17 +1162,17 @@ function Ms(e, t) {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
function Ns(e, t, n = "") {
|
|
1164
1164
|
if (!t || !t.hasAttribute(le) || !t.isConnected) return !1;
|
|
1165
|
-
const o = t.getAttribute(le) || "", r = t.getAttribute(
|
|
1165
|
+
const o = t.getAttribute(le) || "", r = t.getAttribute(Ke) || "", i = Ms(e, t);
|
|
1166
1166
|
t.remove();
|
|
1167
1167
|
const l = document.createElement("div");
|
|
1168
|
-
return l.className = H.EMBED, l.setAttribute(le, o), r && l.setAttribute(
|
|
1168
|
+
return l.className = H.EMBED, l.setAttribute(le, o), r && l.setAttribute(Ke, r), l.setAttribute("contenteditable", "false"), n && (l.innerHTML = n), i ? i.after(l) : e.appendChild(l), !0;
|
|
1169
1169
|
}
|
|
1170
1170
|
function Rs(e) {
|
|
1171
1171
|
if (!e || e.tagName !== "DIV" || !e.hasAttribute(le) || !e.isConnected) return !1;
|
|
1172
1172
|
const t = document.createElement("p"), n = document.createElement("span");
|
|
1173
1173
|
n.className = H.REF, n.setAttribute(le, e.getAttribute(le) || "");
|
|
1174
|
-
const o = e.getAttribute(
|
|
1175
|
-
return o && n.setAttribute(
|
|
1174
|
+
const o = e.getAttribute(Ke) || "";
|
|
1175
|
+
return o && n.setAttribute(Ke, o), n.setAttribute(Dt, "d"), n.setAttribute("contenteditable", "false"), t.appendChild(n), t.appendChild(document.createElement("br")), e.replaceWith(t), !0;
|
|
1176
1176
|
}
|
|
1177
1177
|
function Os(e, t) {
|
|
1178
1178
|
return !e || !e.hasAttribute(le) ? !1 : (e.setAttribute(Dt, t === "s" ? "s" : "d"), !0);
|
|
@@ -1225,7 +1225,7 @@ function _t(e) {
|
|
|
1225
1225
|
}
|
|
1226
1226
|
function An(e) {
|
|
1227
1227
|
const t = X(V(e)?.startContainer || e, e);
|
|
1228
|
-
return t ?
|
|
1228
|
+
return t ? Xe(t, e) || t : e.lastElementChild || _t(e);
|
|
1229
1229
|
}
|
|
1230
1230
|
function Fr(e) {
|
|
1231
1231
|
const t = An(e), n = document.createElement("hr");
|
|
@@ -1336,7 +1336,7 @@ function Ks(e) {
|
|
|
1336
1336
|
function Xs(e, t, n = null) {
|
|
1337
1337
|
const o = n && Oe(e, n) || X(V(e)?.startContainer || e, e);
|
|
1338
1338
|
if (!o) return !1;
|
|
1339
|
-
const r =
|
|
1339
|
+
const r = Xe(o, e) || o, i = t === "after";
|
|
1340
1340
|
if (r.tagName === "UL" || r.tagName === "OL") {
|
|
1341
1341
|
const { el: s, caret: a } = Ks(r);
|
|
1342
1342
|
return i ? r.appendChild(s) : r.insertBefore(s, r.firstElementChild), P(a, 0), !0;
|
|
@@ -1392,18 +1392,18 @@ function Ys(e) {
|
|
|
1392
1392
|
const l = Zn(n, e);
|
|
1393
1393
|
return ze(n) ? () => {
|
|
1394
1394
|
const s = ft(o);
|
|
1395
|
-
l &&
|
|
1395
|
+
l && Ve(l), P(s, 0);
|
|
1396
1396
|
} : o.parentElement?.parentElement?.tagName === "LI" ? () => {
|
|
1397
1397
|
Ur(o), P(n, 0);
|
|
1398
1398
|
} : null;
|
|
1399
1399
|
}
|
|
1400
1400
|
const r = Kr(n, e);
|
|
1401
1401
|
if (r) return () => {
|
|
1402
|
-
un(r, n),
|
|
1402
|
+
un(r, n), Ve(r), P(n, 0);
|
|
1403
1403
|
};
|
|
1404
1404
|
const i = Zn(n, e);
|
|
1405
1405
|
return i ? () => {
|
|
1406
|
-
un(i, n),
|
|
1406
|
+
un(i, n), Ve(i), P(n, 0);
|
|
1407
1407
|
} : Ws(n, e);
|
|
1408
1408
|
}
|
|
1409
1409
|
function Qs(e, t) {
|
|
@@ -1454,7 +1454,7 @@ function Ur(e) {
|
|
|
1454
1454
|
Ce(i, r), o && r.setAttribute("style", o), e.remove(), n.after(r);
|
|
1455
1455
|
} else
|
|
1456
1456
|
n.after(e);
|
|
1457
|
-
return
|
|
1457
|
+
return Ve(t), !0;
|
|
1458
1458
|
}
|
|
1459
1459
|
function ta(e, t = !1) {
|
|
1460
1460
|
const n = V(e);
|
|
@@ -1469,17 +1469,17 @@ function ta(e, t = !1) {
|
|
|
1469
1469
|
return ft(r), P(r.nextElementSibling || r, 0), !0;
|
|
1470
1470
|
const i = Kr(o, e);
|
|
1471
1471
|
if (i && ze(o))
|
|
1472
|
-
return un(i, o),
|
|
1472
|
+
return un(i, o), Ve(i), P(o, 0), !0;
|
|
1473
1473
|
const l = Zn(o, e);
|
|
1474
1474
|
if (l && ze(o))
|
|
1475
|
-
return un(l, o),
|
|
1475
|
+
return un(l, o), Ve(l), P(o, 0), !0;
|
|
1476
1476
|
if (l && o === va(l) && ae(o, n.startContainer, n.startOffset) >= Ae(o)) {
|
|
1477
1477
|
const u = document.createElement("p");
|
|
1478
1478
|
return u.appendChild(document.createElement("br")), l.after(u), P(u, 0), !0;
|
|
1479
1479
|
}
|
|
1480
1480
|
const s = document.createRange();
|
|
1481
1481
|
s.setStart(n.startContainer, n.startOffset);
|
|
1482
|
-
const a =
|
|
1482
|
+
const a = Ge(o, Ae(o));
|
|
1483
1483
|
s.setEnd(a.node, a.offset);
|
|
1484
1484
|
const c = s.extractContents();
|
|
1485
1485
|
if (r) {
|
|
@@ -1519,7 +1519,7 @@ function Oe(e, t) {
|
|
|
1519
1519
|
function xn(e, t = null, n = null) {
|
|
1520
1520
|
const o = [], r = (n || (t || ao(e)).map((i) => i.block)).filter((i) => i?.isConnected);
|
|
1521
1521
|
for (const i of r) {
|
|
1522
|
-
const l =
|
|
1522
|
+
const l = Xe(i, e) || i;
|
|
1523
1523
|
o.includes(l) || o.push(l);
|
|
1524
1524
|
}
|
|
1525
1525
|
return o;
|
|
@@ -1585,14 +1585,14 @@ function un(e, t) {
|
|
|
1585
1585
|
o.forEach((i) => r.appendChild(i)), e.after(t, r);
|
|
1586
1586
|
}
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1588
|
+
function Ve(e) {
|
|
1589
1589
|
let t = e;
|
|
1590
1590
|
for (; t && t.tagName && t.nodeType === Node.ELEMENT_NODE && !(!(t.tagName === "UL" || t.tagName === "OL" || t.tagName === "BLOCKQUOTE" || t.tagName === "PRE" || t.tagName === "LI" || Ot(t) || mn(t)) || Lt(t)); ) {
|
|
1591
1591
|
const o = t.parentElement;
|
|
1592
1592
|
t.remove(), t = o;
|
|
1593
1593
|
}
|
|
1594
1594
|
}
|
|
1595
|
-
const yo = (e, t) =>
|
|
1595
|
+
const yo = (e, t) => je(e, (n) => n.tagName === "LI", t), ua = (e, t) => je(e, (n) => n.tagName === "UL" || n.tagName === "OL", t), Kr = (e, t) => je(e, (n) => n.tagName === "BLOCKQUOTE", t);
|
|
1596
1596
|
function ko(e) {
|
|
1597
1597
|
let t = Array.from(e.children).find((n) => n.tagName === "DIV");
|
|
1598
1598
|
if (!t) {
|
|
@@ -1640,7 +1640,7 @@ function ft(e) {
|
|
|
1640
1640
|
const t = e.parentElement, n = document.createElement("p");
|
|
1641
1641
|
dn(e, n);
|
|
1642
1642
|
const o = we(e) ? ko(e) : e;
|
|
1643
|
-
return Ce(o, n), t && (t.tagName === "UL" || t.tagName === "OL") ? (t.before(n), e.remove(),
|
|
1643
|
+
return Ce(o, n), t && (t.tagName === "UL" || t.tagName === "OL") ? (t.before(n), e.remove(), Ve(t)) : e.replaceWith(n), n;
|
|
1644
1644
|
}
|
|
1645
1645
|
function Qn(e) {
|
|
1646
1646
|
return Array.from(e.children).filter((t) => t.tagName === "LI").map((t) => ft(t));
|
|
@@ -1812,7 +1812,7 @@ function Xr(e) {
|
|
|
1812
1812
|
const t = V(e);
|
|
1813
1813
|
if (!t) return null;
|
|
1814
1814
|
const n = X(t.startContainer, e);
|
|
1815
|
-
return n ?
|
|
1815
|
+
return n ? Xe(n, e) || n : null;
|
|
1816
1816
|
}
|
|
1817
1817
|
const Ea = [
|
|
1818
1818
|
{ re: /^#\s$/, kind: "heading1" },
|
|
@@ -1867,7 +1867,7 @@ function Sa(e, t) {
|
|
|
1867
1867
|
if (l)
|
|
1868
1868
|
return P(he(l, e) || l, 0), !0;
|
|
1869
1869
|
if (t) return !0;
|
|
1870
|
-
const s =
|
|
1870
|
+
const s = je(o, (c) => c.tagName === "TR", e), a = document.createElement("tr");
|
|
1871
1871
|
for (const c of Array.from(s.children)) {
|
|
1872
1872
|
const f = document.createElement(c.tagName.toLowerCase());
|
|
1873
1873
|
f.appendChild(document.createElement("br")), a.appendChild(f);
|
|
@@ -1947,7 +1947,7 @@ function Eo(e, t) {
|
|
|
1947
1947
|
o.collapsed || o.deleteContents();
|
|
1948
1948
|
const i = o.startContainer;
|
|
1949
1949
|
if (i.nodeType !== Node.TEXT_NODE && /^(BR|IMG|INPUT)$/.test(i.tagName || "")) {
|
|
1950
|
-
const m =
|
|
1950
|
+
const m = Ge(r, ae(r, i, o.startOffset)), h = document.createRange();
|
|
1951
1951
|
h.setStart(m.node, m.offset), h.collapse(!0), o = h;
|
|
1952
1952
|
}
|
|
1953
1953
|
const l = Array.from(t.children), s = l.length === 1 && /^(SPAN|STRONG|EM|U|S|CODE|A|B|I|FONT)$/.test(l[0].tagName);
|
|
@@ -1983,7 +1983,7 @@ function Eo(e, t) {
|
|
|
1983
1983
|
}
|
|
1984
1984
|
const c = document.createRange();
|
|
1985
1985
|
c.setStart(o.startContainer, o.startOffset);
|
|
1986
|
-
const f =
|
|
1986
|
+
const f = Ge(r, Ae(r));
|
|
1987
1987
|
c.setEnd(f.node, f.offset);
|
|
1988
1988
|
const u = c.extractContents(), p = document.createElement("p");
|
|
1989
1989
|
p.appendChild(u), r.after(p);
|
|
@@ -2601,7 +2601,7 @@ const jo = {
|
|
|
2601
2601
|
},
|
|
2602
2602
|
insertTable: {
|
|
2603
2603
|
run: (e, { rows: t = 2, cols: n = 2, withHeaderRow: o = !0 } = {}) => {
|
|
2604
|
-
const i = e.selectionRanges()[0]?.block, l = i ?
|
|
2604
|
+
const i = e.selectionRanges()[0]?.block, l = i ? Xe(i, e.root) : e.root.lastElementChild;
|
|
2605
2605
|
return !!ec(e.root, { rows: t, cols: n, headerRow: o }, l);
|
|
2606
2606
|
}
|
|
2607
2607
|
},
|
|
@@ -2865,7 +2865,7 @@ const ac = 120, cc = 600, uc = {
|
|
|
2865
2865
|
function hc(e, t) {
|
|
2866
2866
|
if (!t) return null;
|
|
2867
2867
|
const n = t.nodeType === Node.TEXT_NODE ? t.parentElement : t;
|
|
2868
|
-
return
|
|
2868
|
+
return je(n, (o) => o.tagName === "IMG" || o.tagName === "HR", e);
|
|
2869
2869
|
}
|
|
2870
2870
|
const Yo = 6, Qo = dr, mc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], pc = {
|
|
2871
2871
|
/**
|
|
@@ -3080,7 +3080,7 @@ const Yo = 6, Qo = dr, mc = ["onMouseDown", "onHoverColumn", "onLeaveColumn"], p
|
|
|
3080
3080
|
},
|
|
3081
3081
|
/** 工具栏 / 气泡菜单 / 块菜单共用的状态快照(单一口径) */
|
|
3082
3082
|
state() {
|
|
3083
|
-
const e = this.root, t = this.selectionRanges(), n = t.length && this.pending || Yn(e, t).marks, r = dt(e, t)[0] || null, i = r ? ra(r) : { lineHeight: "", textAlign: null, indentLevel: 0, firstLineIndent: !1 }, l = t[0]?.block || null, s = l ?
|
|
3083
|
+
const e = this.root, t = this.selectionRanges(), n = t.length && this.pending || Yn(e, t).marks, r = dt(e, t)[0] || null, i = r ? ra(r) : { lineHeight: "", textAlign: null, indentLevel: 0, firstLineIndent: !1 }, l = t[0]?.block || null, s = l ? Xe(l, e) : null, a = Ft(s), c = l ? Gr(l, e) : "", f = !!$e(l || e, e), u = Number(/^heading([1-6])$/.exec(a)?.[1]) || 0, p = e.textContent.replace(/[\n]/g, "");
|
|
3084
3084
|
return {
|
|
3085
3085
|
ready: !0,
|
|
3086
3086
|
canUndo: this.undoStack.length > 0,
|
|
@@ -3619,7 +3619,7 @@ const Zo = {
|
|
|
3619
3619
|
}, ti = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
3620
3620
|
__name: "ImageViewer",
|
|
3621
3621
|
setup(e) {
|
|
3622
|
-
return (t, n) => (N(),
|
|
3622
|
+
return (t, n) => (N(), Q(U($i), ro(io(t.$attrs)), null, 16));
|
|
3623
3623
|
}
|
|
3624
3624
|
});
|
|
3625
3625
|
function ni() {
|
|
@@ -3690,7 +3690,7 @@ function Rc(e) {
|
|
|
3690
3690
|
r(), l && (n.value = l, l.on("state", o), l.on("selection", o), o());
|
|
3691
3691
|
}, { immediate: !0 }), Rt(r), t;
|
|
3692
3692
|
}
|
|
3693
|
-
const
|
|
3693
|
+
const We = (e, t) => {
|
|
3694
3694
|
const n = e.__vccOpts || e;
|
|
3695
3695
|
for (const [o, r] of t)
|
|
3696
3696
|
n[o] = r;
|
|
@@ -3756,7 +3756,7 @@ const je = (e, t) => {
|
|
|
3756
3756
|
let C = 0;
|
|
3757
3757
|
function d() {
|
|
3758
3758
|
C || (C = requestAnimationFrame(() => {
|
|
3759
|
-
C = 0, W(), b.value && O(),
|
|
3759
|
+
C = 0, W(), b.value && O(), Ye(), mt();
|
|
3760
3760
|
}));
|
|
3761
3761
|
}
|
|
3762
3762
|
const b = S(null), T = S(null);
|
|
@@ -3791,7 +3791,7 @@ const je = (e, t) => {
|
|
|
3791
3791
|
!x || !ie || !ie.isConnected || (x.root.focus({ preventScroll: !0 }), x.beginEdgeGesture(k, ie, v));
|
|
3792
3792
|
}
|
|
3793
3793
|
const ne = S(null);
|
|
3794
|
-
function
|
|
3794
|
+
function Ye() {
|
|
3795
3795
|
const v = a.value, k = v && !v.destroyed ? v.columnBoundaryBox() : null;
|
|
3796
3796
|
if (!k) {
|
|
3797
3797
|
ne.value = null;
|
|
@@ -3804,15 +3804,15 @@ const je = (e, t) => {
|
|
|
3804
3804
|
height: `${Math.round(k.height / x.z)}px`
|
|
3805
3805
|
};
|
|
3806
3806
|
}
|
|
3807
|
-
const
|
|
3807
|
+
const Qe = S(null);
|
|
3808
3808
|
function mt() {
|
|
3809
3809
|
const v = a.value, k = v && !v.destroyed ? v.cellSelectionBox() : null;
|
|
3810
3810
|
if (!k) {
|
|
3811
|
-
|
|
3811
|
+
Qe.value = null;
|
|
3812
3812
|
return;
|
|
3813
3813
|
}
|
|
3814
3814
|
const x = Fe(s.value);
|
|
3815
|
-
|
|
3815
|
+
Qe.value = {
|
|
3816
3816
|
left: `${Math.round((k.left - x.x) / x.z)}px`,
|
|
3817
3817
|
top: `${Math.round((k.top - x.y) / x.z)}px`,
|
|
3818
3818
|
width: `${Math.round(k.width / x.z)}px`,
|
|
@@ -3822,15 +3822,15 @@ const je = (e, t) => {
|
|
|
3822
3822
|
function Nn(v, k) {
|
|
3823
3823
|
const x = f.value, ie = a.value;
|
|
3824
3824
|
if (!x || !ie) return;
|
|
3825
|
-
const oe = x.getBoundingClientRect(), Le = oe.width / Math.max(1, oe.height), Be = Fe(s.value).z,
|
|
3826
|
-
const
|
|
3825
|
+
const oe = x.getBoundingClientRect(), Le = oe.width / Math.max(1, oe.height), Be = Fe(s.value).z, Ze = { x: k.clientX, y: k.clientY, width: oe.width }, Ct = v.endsWith("left") ? -1 : 1, Et = (se) => {
|
|
3826
|
+
const Je = Math.max(zc, Math.round((Ze.width + (se.clientX - Ze.x) * Ct) / Be)), Hn = Math.max(Dc, Math.round(Je / Le));
|
|
3827
3827
|
ie.run(() => {
|
|
3828
|
-
x.setAttribute("width", String(
|
|
3828
|
+
x.setAttribute("width", String(Je)), x.setAttribute("height", String(Hn));
|
|
3829
3829
|
}), d();
|
|
3830
|
-
},
|
|
3831
|
-
document.removeEventListener("mousemove", Et), document.removeEventListener("mouseup",
|
|
3830
|
+
}, Z = () => {
|
|
3831
|
+
document.removeEventListener("mousemove", Et), document.removeEventListener("mouseup", Z);
|
|
3832
3832
|
};
|
|
3833
|
-
document.addEventListener("mousemove", Et), document.addEventListener("mouseup",
|
|
3833
|
+
document.addEventListener("mousemove", Et), document.addEventListener("mouseup", Z);
|
|
3834
3834
|
}
|
|
3835
3835
|
Ie(f, () => d());
|
|
3836
3836
|
const {
|
|
@@ -3928,9 +3928,9 @@ const je = (e, t) => {
|
|
|
3928
3928
|
k && v !== L && v !== k.getHTML() && (A && (clearTimeout(A), A = 0), M = !1, k.setHTML(v || ""), L = k.getHTML());
|
|
3929
3929
|
}
|
|
3930
3930
|
), lr(() => {
|
|
3931
|
-
Gt(), a.value?.on("column-hover",
|
|
3931
|
+
Gt(), a.value?.on("column-hover", Ye), a.value?.on("cell-selection", mt), i.value?.addEventListener("scroll", d), i.value?.addEventListener("mousemove", Ee), i.value?.addEventListener("mouseleave", Y), i.value?.addEventListener("mousedown", kt, !0), window.addEventListener("resize", d);
|
|
3932
3932
|
}), Rt(() => {
|
|
3933
|
-
R(), a.value?.off("column-hover",
|
|
3933
|
+
R(), a.value?.off("column-hover", Ye), a.value?.off("cell-selection", mt), i.value?.removeEventListener("scroll", d), i.value?.removeEventListener("mousemove", Ee), i.value?.removeEventListener("mouseleave", Y), i.value?.removeEventListener("mousedown", kt, !0), document.removeEventListener("mousemove", _e), document.removeEventListener("mouseup", yt), a.value?.blockMarqueeActive && (a.value.blockMarqueeActive = !1, a.value.clearBlockSelection()), window.removeEventListener("resize", d), C && cancelAnimationFrame(C), a.value?.destroy(), a.value = null;
|
|
3934
3934
|
}), t({
|
|
3935
3935
|
/** 内核实例(浮层菜单等外围件取它执行命令) */
|
|
3936
3936
|
editor: a,
|
|
@@ -3948,11 +3948,11 @@ const je = (e, t) => {
|
|
|
3948
3948
|
}
|
|
3949
3949
|
}), (v, k) => (N(), D("div", {
|
|
3950
3950
|
class: be(["rich-edit-surface", { "is-fill": $.value }]),
|
|
3951
|
-
style:
|
|
3951
|
+
style: J(ee.value)
|
|
3952
3952
|
}, [
|
|
3953
3953
|
de(v.$slots, "toolbar", {
|
|
3954
3954
|
editor: a.value,
|
|
3955
|
-
state:
|
|
3955
|
+
state: U(c)
|
|
3956
3956
|
}, void 0, !0),
|
|
3957
3957
|
I("div", {
|
|
3958
3958
|
ref_key: "scrollRef",
|
|
@@ -3967,7 +3967,7 @@ const je = (e, t) => {
|
|
|
3967
3967
|
ref_key: "probeRef",
|
|
3968
3968
|
ref: s,
|
|
3969
3969
|
class: "re-overlay-probe",
|
|
3970
|
-
style:
|
|
3970
|
+
style: J({ width: `${U(oi)}px` }),
|
|
3971
3971
|
"aria-hidden": "true"
|
|
3972
3972
|
}, null, 4),
|
|
3973
3973
|
I("div", {
|
|
@@ -3981,16 +3981,16 @@ const je = (e, t) => {
|
|
|
3981
3981
|
probe: s.value
|
|
3982
3982
|
}, void 0, !0),
|
|
3983
3983
|
e.editable ? (N(), D("div", Oc, [
|
|
3984
|
-
|
|
3984
|
+
Qe.value ? (N(), D("span", {
|
|
3985
3985
|
key: 0,
|
|
3986
3986
|
class: "re-table-select",
|
|
3987
|
-
style:
|
|
3988
|
-
}, null, 4)) :
|
|
3987
|
+
style: J(Qe.value)
|
|
3988
|
+
}, null, 4)) : F("", !0),
|
|
3989
3989
|
T.value ? (N(), D("div", Bc, [
|
|
3990
3990
|
I("button", {
|
|
3991
3991
|
type: "button",
|
|
3992
3992
|
class: "re-table-handle is-column",
|
|
3993
|
-
style:
|
|
3993
|
+
style: J(T.value.column),
|
|
3994
3994
|
title: "点击在右侧插入一列 / 拖拽插入或删除多列",
|
|
3995
3995
|
"aria-label": "在右侧插入一列",
|
|
3996
3996
|
onMousedown: k[0] || (k[0] = te((x) => xe("column", x), ["prevent"]))
|
|
@@ -3998,28 +3998,28 @@ const je = (e, t) => {
|
|
|
3998
3998
|
I("button", {
|
|
3999
3999
|
type: "button",
|
|
4000
4000
|
class: "re-table-handle is-row",
|
|
4001
|
-
style:
|
|
4001
|
+
style: J(T.value.row),
|
|
4002
4002
|
title: "点击在下方插入一行 / 拖拽插入或删除多行",
|
|
4003
4003
|
"aria-label": "在下方插入一行",
|
|
4004
4004
|
onMousedown: k[1] || (k[1] = te((x) => xe("row", x), ["prevent"]))
|
|
4005
4005
|
}, "+", 36)
|
|
4006
|
-
])) :
|
|
4006
|
+
])) : F("", !0),
|
|
4007
4007
|
ne.value ? (N(), D("span", {
|
|
4008
4008
|
key: 2,
|
|
4009
4009
|
class: "re-col-line",
|
|
4010
|
-
style:
|
|
4011
|
-
}, null, 4)) :
|
|
4012
|
-
])) :
|
|
4010
|
+
style: J(ne.value)
|
|
4011
|
+
}, null, 4)) : F("", !0)
|
|
4012
|
+
])) : F("", !0),
|
|
4013
4013
|
h.value ? (N(), D("div", {
|
|
4014
4014
|
key: 1,
|
|
4015
4015
|
class: "re-marquee",
|
|
4016
|
-
style:
|
|
4017
|
-
}, null, 4)) :
|
|
4018
|
-
|
|
4016
|
+
style: J(g.value)
|
|
4017
|
+
}, null, 4)) : F("", !0),
|
|
4018
|
+
U(c).isEmpty && e.placeholder ? (N(), D("div", Ic, pe(e.placeholder), 1)) : F("", !0),
|
|
4019
4019
|
p.value && e.editable ? (N(), D("div", {
|
|
4020
4020
|
key: 3,
|
|
4021
4021
|
class: "re-resize-box",
|
|
4022
|
-
style:
|
|
4022
|
+
style: J(y.value)
|
|
4023
4023
|
}, [
|
|
4024
4024
|
I("button", {
|
|
4025
4025
|
type: "button",
|
|
@@ -4035,27 +4035,27 @@ const je = (e, t) => {
|
|
|
4035
4035
|
size: 13
|
|
4036
4036
|
})
|
|
4037
4037
|
], 32),
|
|
4038
|
-
(N(), D(
|
|
4038
|
+
(N(), D(Ue, null, xt(u, (x) => I("span", {
|
|
4039
4039
|
key: x,
|
|
4040
4040
|
class: be(["re-resize-handle", `is-${x}`]),
|
|
4041
4041
|
onMousedown: te((ie) => Nn(x, ie), ["prevent"])
|
|
4042
4042
|
}, null, 42, Hc)), 64))
|
|
4043
|
-
], 4)) :
|
|
4043
|
+
], 4)) : F("", !0)
|
|
4044
4044
|
], 34),
|
|
4045
4045
|
de(v.$slots, "floaters", {
|
|
4046
4046
|
editor: a.value,
|
|
4047
|
-
state:
|
|
4047
|
+
state: U(c)
|
|
4048
4048
|
}, void 0, !0),
|
|
4049
|
-
|
|
4049
|
+
U(pt).length ? (N(), Q(ti, {
|
|
4050
4050
|
key: 0,
|
|
4051
|
-
images:
|
|
4052
|
-
"initial-index":
|
|
4051
|
+
images: U(pt),
|
|
4052
|
+
"initial-index": U(Ut),
|
|
4053
4053
|
onSwitch: k[3] || (k[3] = (x) => Ut.value = x),
|
|
4054
4054
|
onClose: In
|
|
4055
|
-
}, null, 8, ["images", "initial-index"])) :
|
|
4055
|
+
}, null, 8, ["images", "initial-index"])) : F("", !0)
|
|
4056
4056
|
], 6));
|
|
4057
4057
|
}
|
|
4058
|
-
}, Fc = /* @__PURE__ */
|
|
4058
|
+
}, Fc = /* @__PURE__ */ We(Pc, [["__scopeId", "data-v-ea6f6b3c"]]), qc = ["title", "disabled"], Uc = {
|
|
4059
4059
|
__name: "ToolButton",
|
|
4060
4060
|
props: {
|
|
4061
4061
|
icon: { type: String, default: "text" },
|
|
@@ -4085,7 +4085,7 @@ const je = (e, t) => {
|
|
|
4085
4085
|
], !0)
|
|
4086
4086
|
], 42, qc));
|
|
4087
4087
|
}
|
|
4088
|
-
}, K = /* @__PURE__ */
|
|
4088
|
+
}, K = /* @__PURE__ */ We(Uc, [["__scopeId", "data-v-7af2498b"]]), So = {
|
|
4089
4089
|
__name: "BasePopover",
|
|
4090
4090
|
setup(e, { expose: t }) {
|
|
4091
4091
|
const n = S(null);
|
|
@@ -4094,7 +4094,7 @@ const je = (e, t) => {
|
|
|
4094
4094
|
openAt: (o) => n.value?.openAt?.(o),
|
|
4095
4095
|
close: () => n.value?.close?.(),
|
|
4096
4096
|
isOpen: () => !!n.value?.isOpen?.()
|
|
4097
|
-
}), (o, r) => (N(),
|
|
4097
|
+
}), (o, r) => (N(), Q(U(_i), {
|
|
4098
4098
|
ref_key: "inner",
|
|
4099
4099
|
ref: n
|
|
4100
4100
|
}, {
|
|
@@ -4163,14 +4163,14 @@ const je = (e, t) => {
|
|
|
4163
4163
|
const M = u.value[f.value];
|
|
4164
4164
|
M && h(M);
|
|
4165
4165
|
}
|
|
4166
|
-
return t({ close: m }), (M, L) => (N(),
|
|
4166
|
+
return t({ close: m }), (M, L) => (N(), Q(So, {
|
|
4167
4167
|
ref_key: "popRef",
|
|
4168
4168
|
ref: i,
|
|
4169
4169
|
trigger: "click",
|
|
4170
4170
|
placement: `bottom-${e.align}`,
|
|
4171
4171
|
"show-arrow": !1,
|
|
4172
4172
|
"float-class": "rt-panel",
|
|
4173
|
-
"z-index":
|
|
4173
|
+
"z-index": U(at).RICHTEXT_FLOAT,
|
|
4174
4174
|
onOpen: y,
|
|
4175
4175
|
onClose: E
|
|
4176
4176
|
}, {
|
|
@@ -4195,21 +4195,21 @@ const je = (e, t) => {
|
|
|
4195
4195
|
autocomplete: "off",
|
|
4196
4196
|
spellcheck: "false",
|
|
4197
4197
|
onKeydown: [
|
|
4198
|
-
L[2] || (L[2] =
|
|
4199
|
-
L[3] || (L[3] =
|
|
4200
|
-
|
|
4201
|
-
|
|
4198
|
+
L[2] || (L[2] = tt(te((R) => g(1), ["prevent"]), ["down"])),
|
|
4199
|
+
L[3] || (L[3] = tt(te((R) => g(-1), ["prevent"]), ["up"])),
|
|
4200
|
+
tt(te(A, ["prevent"]), ["enter"]),
|
|
4201
|
+
tt(te(m, ["stop", "prevent"]), ["esc"])
|
|
4202
4202
|
]
|
|
4203
4203
|
}, null, 40, Xc), [
|
|
4204
4204
|
[ar, c.value]
|
|
4205
4205
|
])
|
|
4206
|
-
])) :
|
|
4206
|
+
])) : F("", !0),
|
|
4207
4207
|
I("div", {
|
|
4208
4208
|
ref_key: "listRef",
|
|
4209
4209
|
ref: l,
|
|
4210
4210
|
class: "re-dd-list"
|
|
4211
4211
|
}, [
|
|
4212
|
-
(N(!0), D(
|
|
4212
|
+
(N(!0), D(Ue, null, xt(u.value, (R, z) => (N(), D("div", {
|
|
4213
4213
|
key: String(R.value),
|
|
4214
4214
|
class: be(["re-dd-option", { "is-highlight": z === f.value, "is-selected": p(R) }]),
|
|
4215
4215
|
onMouseenter: ($) => f.value = z,
|
|
@@ -4221,21 +4221,21 @@ const je = (e, t) => {
|
|
|
4221
4221
|
size: 15,
|
|
4222
4222
|
"aria-hidden": "true"
|
|
4223
4223
|
}, null, 8, ["name"])
|
|
4224
|
-
])) :
|
|
4224
|
+
])) : F("", !0),
|
|
4225
4225
|
I("span", {
|
|
4226
4226
|
class: "re-dd-opt-label",
|
|
4227
|
-
style:
|
|
4227
|
+
style: J(R.style)
|
|
4228
4228
|
}, pe(R.label), 5),
|
|
4229
|
-
R.hint ? (N(), D("span", Yc, pe(R.hint), 1)) :
|
|
4230
|
-
p(R) ? (N(),
|
|
4229
|
+
R.hint ? (N(), D("span", Yc, pe(R.hint), 1)) : F("", !0),
|
|
4230
|
+
p(R) ? (N(), Q(ve, {
|
|
4231
4231
|
key: 2,
|
|
4232
4232
|
name: "rte-check",
|
|
4233
4233
|
size: 13,
|
|
4234
4234
|
class: "re-dd-check",
|
|
4235
4235
|
"aria-hidden": "true"
|
|
4236
|
-
})) :
|
|
4236
|
+
})) : F("", !0)
|
|
4237
4237
|
], 42, jc))), 128)),
|
|
4238
|
-
u.value.length ?
|
|
4238
|
+
u.value.length ? F("", !0) : (N(), D("div", Qc, "无匹配项"))
|
|
4239
4239
|
], 512)
|
|
4240
4240
|
], 32)
|
|
4241
4241
|
]),
|
|
@@ -4244,7 +4244,7 @@ const je = (e, t) => {
|
|
|
4244
4244
|
type: "button",
|
|
4245
4245
|
class: be(["re-dd-trigger", { "is-open": a.value }]),
|
|
4246
4246
|
title: e.label,
|
|
4247
|
-
style:
|
|
4247
|
+
style: J({ minWidth: e.minWidth }),
|
|
4248
4248
|
onMousedown: L[0] || (L[0] = te(() => {
|
|
4249
4249
|
}, ["prevent"]))
|
|
4250
4250
|
}, [
|
|
@@ -4260,7 +4260,7 @@ const je = (e, t) => {
|
|
|
4260
4260
|
_: 1
|
|
4261
4261
|
}, 8, ["placement", "z-index"]));
|
|
4262
4262
|
}
|
|
4263
|
-
}, Qt = /* @__PURE__ */
|
|
4263
|
+
}, Qt = /* @__PURE__ */ We(Zc, [["__scopeId", "data-v-b00865fb"]]), ri = [
|
|
4264
4264
|
{ key: "paragraph", title: "正文", icon: "text", shortcut: "Ctrl/Cmd + Alt + 0" },
|
|
4265
4265
|
{ key: "heading1", title: "标题 1", icon: "h1", shortcut: "Ctrl/Cmd + Alt + 1" },
|
|
4266
4266
|
{ key: "heading2", title: "标题 2", icon: "h2", shortcut: "Ctrl/Cmd + Alt + 2" },
|
|
@@ -4501,7 +4501,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4501
4501
|
function s(C, ...d) {
|
|
4502
4502
|
t.editor && (t.editor.focus(), t.editor.exec(C, ...d));
|
|
4503
4503
|
}
|
|
4504
|
-
const a = ri.map((C) => ({ value: C.key, label: C.title, icon: C.icon, hint: C.shortcut })), c = j(() => ii.find((C) => C.key === t.state.blockType)?.title || "正文"), f = (C) => li(t.editor, C), u = { value: "", label: "默认", clear: !0 }, p = [u, ...
|
|
4504
|
+
const a = ri.map((C) => ({ value: C.key, label: C.title, icon: C.icon, hint: C.shortcut })), c = j(() => ii.find((C) => C.key === t.state.blockType)?.title || "正文"), f = (C) => li(t.editor, C), u = { value: "", label: "默认", clear: !0 }, p = [u, ...et.map((C) => ({ value: `${C}px`, label: `${C}px` }))], y = j(() => t.state.fontSize || "字号"), E = (C) => s(C ? "setFontSize" : "unsetFontSize", C), m = j(() => [
|
|
4505
4505
|
u,
|
|
4506
4506
|
...xo.map((C) => ({ value: C.value, label: C.label, style: { fontFamily: C.value } }))
|
|
4507
4507
|
]), h = j(() => t.state.fontFamily ? xo.find((d) => d.value === t.state.fontFamily)?.label || t.state.fontFamily.split(",")[0].replace(/"/g, "") : "字体"), g = (C) => s(C ? "setFontFamily" : "unsetFontFamily", C), A = [u, ...Vn.map((C) => ({ value: C, label: C }))], M = j(() => t.state.lineHeight || "行高"), L = (C) => s("setBlockLineHeight", C || null);
|
|
@@ -4556,7 +4556,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4556
4556
|
B(Qt, {
|
|
4557
4557
|
label: "块类型",
|
|
4558
4558
|
display: c.value,
|
|
4559
|
-
options:
|
|
4559
|
+
options: U(a),
|
|
4560
4560
|
"model-value": e.state.blockType,
|
|
4561
4561
|
"min-width": "76px",
|
|
4562
4562
|
onSelect: f
|
|
@@ -4629,22 +4629,22 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4629
4629
|
e.state.color ? (N(), D("i", {
|
|
4630
4630
|
key: 0,
|
|
4631
4631
|
class: "re-color-bar",
|
|
4632
|
-
style:
|
|
4633
|
-
}, null, 4)) :
|
|
4632
|
+
style: J({ background: e.state.color })
|
|
4633
|
+
}, null, 4)) : F("", !0)
|
|
4634
4634
|
], 512)
|
|
4635
4635
|
]),
|
|
4636
|
-
n.value === "appearance" ? (N(),
|
|
4636
|
+
n.value === "appearance" ? (N(), Q(U(cr), {
|
|
4637
4637
|
key: 0,
|
|
4638
4638
|
anchor: o.value,
|
|
4639
4639
|
state: e.state,
|
|
4640
4640
|
"recent-styles": i.value,
|
|
4641
|
-
"z-index":
|
|
4641
|
+
"z-index": U(at).RICHTEXT_FLOAT,
|
|
4642
4642
|
onSelect: z,
|
|
4643
4643
|
onClose: d[6] || (d[6] = (b) => n.value = "")
|
|
4644
|
-
}, null, 8, ["anchor", "state", "recent-styles", "z-index"])) :
|
|
4644
|
+
}, null, 8, ["anchor", "state", "recent-styles", "z-index"])) : F("", !0),
|
|
4645
4645
|
d[18] || (d[18] = I("span", { class: "re-sep" }, null, -1)),
|
|
4646
4646
|
I("div", fu, [
|
|
4647
|
-
(N(!0), D(
|
|
4647
|
+
(N(!0), D(Ue, null, xt(U(Fi), (b) => (N(), Q(K, {
|
|
4648
4648
|
key: b.value,
|
|
4649
4649
|
icon: b.icon,
|
|
4650
4650
|
title: b.title,
|
|
@@ -4701,8 +4701,8 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4701
4701
|
}, null, 8, ["active"])
|
|
4702
4702
|
]),
|
|
4703
4703
|
d[21] || (d[21] = I("span", { class: "re-sep" }, null, -1)),
|
|
4704
|
-
B(
|
|
4705
|
-
"z-index":
|
|
4704
|
+
B(U(qi), {
|
|
4705
|
+
"z-index": U(at).RICHTEXT_FLOAT,
|
|
4706
4706
|
onSelect: ee
|
|
4707
4707
|
}, {
|
|
4708
4708
|
default: re(() => [
|
|
@@ -4722,7 +4722,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4722
4722
|
})
|
|
4723
4723
|
]));
|
|
4724
4724
|
}
|
|
4725
|
-
}, gu = /* @__PURE__ */
|
|
4725
|
+
}, gu = /* @__PURE__ */ We(pu, [["__scopeId", "data-v-c830d1e7"]]), vu = { class: "re-slash-head" }, bu = { class: "re-slash-query" }, yu = { class: "re-slash-group" }, ku = ["onMouseenter", "onClick"], Cu = { class: "re-slash-icon" }, Eu = { class: "re-slash-title" }, Au = {
|
|
4726
4726
|
key: 0,
|
|
4727
4727
|
class: "re-slash-tip"
|
|
4728
4728
|
}, Tu = {
|
|
@@ -4823,7 +4823,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4823
4823
|
{ immediate: !0 }
|
|
4824
4824
|
), go({ keydown: z }, { priority: yn.FLOAT }), Rt(() => {
|
|
4825
4825
|
W(n.editor);
|
|
4826
|
-
}), t({ close: g, refresh: L }), (d, b) => (N(),
|
|
4826
|
+
}), t({ close: g, refresh: L }), (d, b) => (N(), Q(So, {
|
|
4827
4827
|
ref_key: "popRef",
|
|
4828
4828
|
ref: o,
|
|
4829
4829
|
trigger: "manual",
|
|
@@ -4831,7 +4831,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4831
4831
|
width: 316,
|
|
4832
4832
|
"show-arrow": !1,
|
|
4833
4833
|
"float-class": "rt-panel",
|
|
4834
|
-
"z-index":
|
|
4834
|
+
"z-index": U(at).RICHTEXT_FLOAT,
|
|
4835
4835
|
onOpen: A,
|
|
4836
4836
|
onClose: M
|
|
4837
4837
|
}, {
|
|
@@ -4855,11 +4855,11 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4855
4855
|
ref: a,
|
|
4856
4856
|
class: "re-slash-list"
|
|
4857
4857
|
}, [
|
|
4858
|
-
(N(!0), D(
|
|
4858
|
+
(N(!0), D(Ue, null, xt(y.value, (T) => (N(), D(Ue, {
|
|
4859
4859
|
key: T.title
|
|
4860
4860
|
}, [
|
|
4861
4861
|
I("div", yu, pe(T.title), 1),
|
|
4862
|
-
(N(!0), D(
|
|
4862
|
+
(N(!0), D(Ue, null, xt(T.items, (O) => (N(), D("div", {
|
|
4863
4863
|
key: O.key,
|
|
4864
4864
|
class: be(["re-slash-item", { "is-active": O === m.value }]),
|
|
4865
4865
|
onMouseenter: (Y) => s.value = O.key,
|
|
@@ -4873,10 +4873,10 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4873
4873
|
}, null, 8, ["name"])
|
|
4874
4874
|
]),
|
|
4875
4875
|
I("span", Eu, pe(O.title), 1),
|
|
4876
|
-
O.hint ? (N(), D("span", Au, pe(O.hint), 1)) :
|
|
4876
|
+
O.hint ? (N(), D("span", Au, pe(O.hint), 1)) : F("", !0)
|
|
4877
4877
|
], 42, ku))), 128))
|
|
4878
4878
|
], 64))), 128)),
|
|
4879
|
-
y.value.length ?
|
|
4879
|
+
y.value.length ? F("", !0) : (N(), D("div", Tu, pe(f.value && i.value.trim() ? "正在加载拼音匹配…" : "无匹配命令"), 1))
|
|
4880
4880
|
], 512)
|
|
4881
4881
|
], 32)
|
|
4882
4882
|
]),
|
|
@@ -4922,7 +4922,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4922
4922
|
f.value = !1;
|
|
4923
4923
|
}
|
|
4924
4924
|
}
|
|
4925
|
-
return t({ openAt: E, close: () => n.value?.close() }), (h, g) => (N(),
|
|
4925
|
+
return t({ openAt: E, close: () => n.value?.close() }), (h, g) => (N(), Q(So, {
|
|
4926
4926
|
ref_key: "popRef",
|
|
4927
4927
|
ref: n,
|
|
4928
4928
|
trigger: "manual",
|
|
@@ -4933,7 +4933,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4933
4933
|
}, {
|
|
4934
4934
|
content: re(({ close: A }) => [
|
|
4935
4935
|
I("div", wu, [
|
|
4936
|
-
r.value ? (N(), D("div", xu, pe(r.value), 1)) :
|
|
4936
|
+
r.value ? (N(), D("div", xu, pe(r.value), 1)) : F("", !0),
|
|
4937
4937
|
sr(I("input", {
|
|
4938
4938
|
ref_key: "inputRef",
|
|
4939
4939
|
ref: o,
|
|
@@ -4945,14 +4945,14 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4945
4945
|
autocomplete: "off",
|
|
4946
4946
|
spellcheck: "false",
|
|
4947
4947
|
onKeydown: [
|
|
4948
|
-
|
|
4949
|
-
|
|
4948
|
+
tt(te((M) => m(A), ["prevent"]), ["enter"]),
|
|
4949
|
+
tt(te(A, ["prevent"]), ["esc"])
|
|
4950
4950
|
]
|
|
4951
4951
|
}, null, 40, Lu), [
|
|
4952
4952
|
[ar, l.value]
|
|
4953
4953
|
]),
|
|
4954
4954
|
I("div", Mu, [
|
|
4955
|
-
B(
|
|
4955
|
+
B(U(Lo), {
|
|
4956
4956
|
size: "small",
|
|
4957
4957
|
onClick: A
|
|
4958
4958
|
}, {
|
|
@@ -4961,7 +4961,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4961
4961
|
])]),
|
|
4962
4962
|
_: 1
|
|
4963
4963
|
}, 8, ["onClick"]),
|
|
4964
|
-
B(
|
|
4964
|
+
B(U(Lo), {
|
|
4965
4965
|
size: "small",
|
|
4966
4966
|
type: "primary",
|
|
4967
4967
|
loading: f.value,
|
|
@@ -4978,7 +4978,7 @@ const au = { class: "re-toolbar" }, cu = { class: "re-group" }, uu = { class: "r
|
|
|
4978
4978
|
_: 1
|
|
4979
4979
|
}, 8, ["z-index"]));
|
|
4980
4980
|
}
|
|
4981
|
-
}, Ru = /* @__PURE__ */
|
|
4981
|
+
}, Ru = /* @__PURE__ */ We(Nu, [["__scopeId", "data-v-a7d17bc1"]]);
|
|
4982
4982
|
function Ou(e) {
|
|
4983
4983
|
const t = e.split("-"), n = t[0], o = t[1] || "center";
|
|
4984
4984
|
return { side: n, crossAlign: o };
|
|
@@ -5142,7 +5142,7 @@ const Pu = {
|
|
|
5142
5142
|
window.addEventListener("scroll", $, !0), window.addEventListener("resize", $);
|
|
5143
5143
|
}), Rt(() => {
|
|
5144
5144
|
W(), window.removeEventListener("scroll", $, !0), window.removeEventListener("resize", $);
|
|
5145
|
-
}), t({ refresh: g, openLink: L }), (C, d) => (N(),
|
|
5145
|
+
}), t({ refresh: g, openLink: L }), (C, d) => (N(), Q(Oi, { to: "body" }, [
|
|
5146
5146
|
B(Bi, { name: "re-bubble" }, {
|
|
5147
5147
|
default: re(() => [
|
|
5148
5148
|
o.value ? (N(), D("div", {
|
|
@@ -5150,7 +5150,7 @@ const Pu = {
|
|
|
5150
5150
|
ref_key: "panelRef",
|
|
5151
5151
|
ref: i,
|
|
5152
5152
|
class: "re-bubble",
|
|
5153
|
-
style:
|
|
5153
|
+
style: J(y.value),
|
|
5154
5154
|
onMousedown: d[6] || (d[6] = te(() => {
|
|
5155
5155
|
}, ["prevent"]))
|
|
5156
5156
|
}, [
|
|
@@ -5193,8 +5193,8 @@ const Pu = {
|
|
|
5193
5193
|
e.state.color ? (N(), D("i", {
|
|
5194
5194
|
key: 0,
|
|
5195
5195
|
class: "re-bubble-bar",
|
|
5196
|
-
style:
|
|
5197
|
-
}, null, 4)) :
|
|
5196
|
+
style: J({ background: e.state.color })
|
|
5197
|
+
}, null, 4)) : F("", !0)
|
|
5198
5198
|
], 512),
|
|
5199
5199
|
d[8] || (d[8] = I("span", { class: "re-bubble-sep" }, null, -1)),
|
|
5200
5200
|
I("span", {
|
|
@@ -5213,18 +5213,18 @@ const Pu = {
|
|
|
5213
5213
|
ref_key: "linkPromptRef",
|
|
5214
5214
|
ref: l,
|
|
5215
5215
|
trigger: "manual",
|
|
5216
|
-
"z-index":
|
|
5216
|
+
"z-index": U(at).RICHTEXT_FLOAT
|
|
5217
5217
|
}, null, 8, ["z-index"]),
|
|
5218
|
-
r.value === "appearance" ? (N(),
|
|
5218
|
+
r.value === "appearance" ? (N(), Q(U(cr), {
|
|
5219
5219
|
key: 0,
|
|
5220
5220
|
anchor: s.value,
|
|
5221
5221
|
state: e.state,
|
|
5222
5222
|
"recent-styles": u.value,
|
|
5223
|
-
"z-index":
|
|
5223
|
+
"z-index": U(at).RICHTEXT_FLOAT,
|
|
5224
5224
|
onSelect: R,
|
|
5225
5225
|
onClose: d[5] || (d[5] = (b) => r.value = "")
|
|
5226
|
-
}, null, 8, ["anchor", "state", "recent-styles", "z-index"])) :
|
|
5227
|
-
], 36)) :
|
|
5226
|
+
}, null, 8, ["anchor", "state", "recent-styles", "z-index"])) : F("", !0)
|
|
5227
|
+
], 36)) : F("", !0)
|
|
5228
5228
|
]),
|
|
5229
5229
|
_: 1
|
|
5230
5230
|
})
|
|
@@ -5309,12 +5309,12 @@ const Pu = {
|
|
|
5309
5309
|
function ne() {
|
|
5310
5310
|
i.value = !1, c.value = !1, f.value = "", m = null, T(null);
|
|
5311
5311
|
}
|
|
5312
|
-
function
|
|
5312
|
+
function Ye() {
|
|
5313
5313
|
E || u.value || (Y(), ee = window.setTimeout(() => {
|
|
5314
5314
|
!E && !u.value && ne();
|
|
5315
5315
|
}, 160));
|
|
5316
5316
|
}
|
|
5317
|
-
function
|
|
5317
|
+
function Qe() {
|
|
5318
5318
|
const w = n.editor, _ = m, v = f.value;
|
|
5319
5319
|
!w || !_ || !v || (ne(), w.focus(), w.exec("insertBlockNear", _, v));
|
|
5320
5320
|
}
|
|
@@ -5369,31 +5369,31 @@ const Pu = {
|
|
|
5369
5369
|
}
|
|
5370
5370
|
const k = W(), x = n.domain === "block" ? n.editor?.blockAt(y.x, y.y) : null;
|
|
5371
5371
|
if (x && x !== g && x.parentElement === g.parentElement && !x.contains(g) && !g.contains(x)) {
|
|
5372
|
-
const
|
|
5373
|
-
if (
|
|
5374
|
-
const se = Math.min(
|
|
5375
|
-
if (
|
|
5376
|
-
A = { mode: "super", ref: x, side:
|
|
5372
|
+
const Z = x.getBoundingClientRect();
|
|
5373
|
+
if (Z.height > 0 && Z.width > 0) {
|
|
5374
|
+
const se = Math.min(Z.width * 0.28, 72), Je = y.x <= Z.left + se, Hn = y.x >= Z.right - se;
|
|
5375
|
+
if (Je || Hn) {
|
|
5376
|
+
A = { mode: "super", ref: x, side: Je ? "left" : "right" }, p.value = {
|
|
5377
5377
|
visible: !0,
|
|
5378
5378
|
vertical: !0,
|
|
5379
|
-
left: ((
|
|
5380
|
-
top: (
|
|
5379
|
+
left: ((Je ? Z.left : Z.right) - k.x) / k.z - 1,
|
|
5380
|
+
top: (Z.top - k.y) / k.z,
|
|
5381
5381
|
width: 2,
|
|
5382
|
-
height:
|
|
5382
|
+
height: Z.height / k.z
|
|
5383
5383
|
};
|
|
5384
5384
|
return;
|
|
5385
5385
|
}
|
|
5386
5386
|
}
|
|
5387
5387
|
}
|
|
5388
|
-
const ie = Array.from(g.parentElement.children).filter((
|
|
5389
|
-
let oe = null, Le = !0, Be = 0,
|
|
5390
|
-
for (const
|
|
5391
|
-
const se =
|
|
5388
|
+
const ie = Array.from(g.parentElement.children).filter((Z) => Z !== g && !it(Z));
|
|
5389
|
+
let oe = null, Le = !0, Be = 0, Ze = 0, Ct = 0;
|
|
5390
|
+
for (const Z of ie) {
|
|
5391
|
+
const se = Z.getBoundingClientRect();
|
|
5392
5392
|
if (y.y < (se.top + se.bottom) / 2) {
|
|
5393
|
-
oe =
|
|
5393
|
+
oe = Z, Le = !0, Be = se.top, Ze = se.left, Ct = se.width;
|
|
5394
5394
|
break;
|
|
5395
5395
|
}
|
|
5396
|
-
oe =
|
|
5396
|
+
oe = Z, Le = !1, Be = se.bottom, Ze = se.left, Ct = se.width;
|
|
5397
5397
|
}
|
|
5398
5398
|
if (!oe) {
|
|
5399
5399
|
O(), A = null;
|
|
@@ -5403,7 +5403,7 @@ const Pu = {
|
|
|
5403
5403
|
A = Et ? null : { mode: "move", ref: oe, before: Le }, p.value = {
|
|
5404
5404
|
visible: !Et,
|
|
5405
5405
|
vertical: !1,
|
|
5406
|
-
left: (
|
|
5406
|
+
left: (Ze - k.x) / k.z - 2,
|
|
5407
5407
|
top: (Be - k.y) / k.z - 1,
|
|
5408
5408
|
width: Ct / k.z + 4,
|
|
5409
5409
|
height: 2
|
|
@@ -5428,10 +5428,10 @@ const Pu = {
|
|
|
5428
5428
|
window.removeEventListener("mousemove", pt), window.removeEventListener("mouseup", Vt), bt?.(), bt = null;
|
|
5429
5429
|
}
|
|
5430
5430
|
function yt(w) {
|
|
5431
|
-
w && (w.addEventListener("mousemove", Ee), w.addEventListener("mouseleave",
|
|
5431
|
+
w && (w.addEventListener("mousemove", Ee), w.addEventListener("mouseleave", Ye));
|
|
5432
5432
|
}
|
|
5433
5433
|
function kt(w) {
|
|
5434
|
-
w && (w.removeEventListener("mousemove", Ee), w.removeEventListener("mouseleave",
|
|
5434
|
+
w && (w.removeEventListener("mousemove", Ee), w.removeEventListener("mouseleave", Ye));
|
|
5435
5435
|
}
|
|
5436
5436
|
return Ie(
|
|
5437
5437
|
() => n.scrollEl,
|
|
@@ -5447,7 +5447,7 @@ const Pu = {
|
|
|
5447
5447
|
ref_key: "iconRef",
|
|
5448
5448
|
ref: r,
|
|
5449
5449
|
class: "re-gutter__icon",
|
|
5450
|
-
style:
|
|
5450
|
+
style: J({ left: `${l.value.left}px`, top: `${l.value.top}px` }),
|
|
5451
5451
|
title: a.value,
|
|
5452
5452
|
onMousedown: Nn,
|
|
5453
5453
|
onContextmenu: te(mt, ["prevent"])
|
|
@@ -5456,48 +5456,48 @@ const Pu = {
|
|
|
5456
5456
|
name: s.value,
|
|
5457
5457
|
size: 16
|
|
5458
5458
|
}, null, 8, ["name"])
|
|
5459
|
-
], 44, qu)) :
|
|
5459
|
+
], 44, qu)) : F("", !0),
|
|
5460
5460
|
c.value && !u.value ? (N(), D("span", {
|
|
5461
5461
|
key: 1,
|
|
5462
5462
|
class: be(["re-gutter__line", { "is-hidden": f.value }]),
|
|
5463
|
-
style:
|
|
5463
|
+
style: J(C("before")),
|
|
5464
5464
|
"data-side": "before"
|
|
5465
|
-
}, null, 6)) :
|
|
5465
|
+
}, null, 6)) : F("", !0),
|
|
5466
5466
|
c.value && !u.value ? (N(), D("span", {
|
|
5467
5467
|
key: 2,
|
|
5468
5468
|
class: be(["re-gutter__line", { "is-hidden": f.value }]),
|
|
5469
|
-
style:
|
|
5469
|
+
style: J(C("after")),
|
|
5470
5470
|
"data-side": "after"
|
|
5471
|
-
}, null, 6)) :
|
|
5471
|
+
}, null, 6)) : F("", !0),
|
|
5472
5472
|
f.value && !u.value ? (N(), D("button", {
|
|
5473
5473
|
key: f.value,
|
|
5474
5474
|
type: "button",
|
|
5475
5475
|
class: "re-gutter__plus",
|
|
5476
|
-
style:
|
|
5476
|
+
style: J(d.value),
|
|
5477
5477
|
title: f.value === "before" ? "上方插入块" : "下方插入块",
|
|
5478
5478
|
"aria-label": f.value === "before" ? "上方插入块" : "下方插入块",
|
|
5479
5479
|
onMousedown: _[0] || (_[0] = te(() => {
|
|
5480
5480
|
}, ["prevent"])),
|
|
5481
|
-
onClick:
|
|
5481
|
+
onClick: Qe
|
|
5482
5482
|
}, [
|
|
5483
5483
|
B(ve, {
|
|
5484
5484
|
name: "plus",
|
|
5485
5485
|
size: 16
|
|
5486
5486
|
})
|
|
5487
|
-
], 44, Uu)) :
|
|
5487
|
+
], 44, Uu)) : F("", !0),
|
|
5488
5488
|
p.value.visible ? (N(), D("div", {
|
|
5489
5489
|
key: 4,
|
|
5490
5490
|
class: be(["re-gutter__indicator", { "is-vertical": p.value.vertical }]),
|
|
5491
|
-
style:
|
|
5492
|
-
}, null, 6)) :
|
|
5491
|
+
style: J(b.value)
|
|
5492
|
+
}, null, 6)) : F("", !0)
|
|
5493
5493
|
]));
|
|
5494
5494
|
}
|
|
5495
|
-
}, Wu = /* @__PURE__ */
|
|
5495
|
+
}, Wu = /* @__PURE__ */ We(ju, [["__scopeId", "data-v-002b9bfb"]]), fi = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
5496
5496
|
__name: "ContextMenu",
|
|
5497
5497
|
setup(e) {
|
|
5498
|
-
return (t, n) => (N(),
|
|
5498
|
+
return (t, n) => (N(), Q(U(Ui), ro(io(t.$attrs)), null, 16));
|
|
5499
5499
|
}
|
|
5500
|
-
}),
|
|
5500
|
+
}), q = (e) => Ii(() => Hi(ve, { name: e, size: 15 })), Yu = {
|
|
5501
5501
|
__name: "BlockMenu",
|
|
5502
5502
|
props: {
|
|
5503
5503
|
editor: { type: Object, default: null },
|
|
@@ -5537,7 +5537,7 @@ const Pu = {
|
|
|
5537
5537
|
const M = eu.flatMap((L, R) => {
|
|
5538
5538
|
const z = L.map(($) => ({
|
|
5539
5539
|
label: $.title,
|
|
5540
|
-
icon:
|
|
5540
|
+
icon: q(`rte-${$.icon}`),
|
|
5541
5541
|
shortcut: $.shortcut,
|
|
5542
5542
|
danger: $.danger,
|
|
5543
5543
|
disabled: !u($.key),
|
|
@@ -5551,7 +5551,7 @@ const Pu = {
|
|
|
5551
5551
|
// blockOnly 项(高亮块/超级块)只在 block 档出现:Word/docx 等 basic 档不暴露
|
|
5552
5552
|
children: ii.filter((L) => !L.blockOnly || o.domain === "block").map((L) => ({
|
|
5553
5553
|
label: L.title,
|
|
5554
|
-
icon:
|
|
5554
|
+
icon: q(`rte-${L.icon}`),
|
|
5555
5555
|
shortcut: L.shortcut,
|
|
5556
5556
|
checked: iu(o.editor, L.key, A) || void 0,
|
|
5557
5557
|
onClick: () => E(L.key)
|
|
@@ -5560,18 +5560,18 @@ const Pu = {
|
|
|
5560
5560
|
{ divided: !0 },
|
|
5561
5561
|
// 超级块列操作(block 档专属):目标为超级块时给出 加列/删列
|
|
5562
5562
|
...o.domain === "block" && A.hasAttribute(fe) ? [
|
|
5563
|
-
{ label: "添加一列", icon:
|
|
5564
|
-
{ label: "删除一列", icon:
|
|
5563
|
+
{ label: "添加一列", icon: q("rte-colRight"), onClick: () => o.editor?.exec("addColumn", A) },
|
|
5564
|
+
{ label: "删除一列", icon: q("rte-colDelete"), onClick: () => o.editor?.exec("removeColumn", A) },
|
|
5565
5565
|
{ divided: !0 }
|
|
5566
5566
|
] : [],
|
|
5567
5567
|
...M,
|
|
5568
5568
|
// 属性(block 档专属):块自定义属性走通用 AttrDialog 查看/设置,条目只把目标块交回宿主
|
|
5569
|
-
...o.domain === "block" ? [{ divided: !0 }, { label: "属性", icon:
|
|
5569
|
+
...o.domain === "block" ? [{ divided: !0 }, { label: "属性", icon: q("rte-shape"), onClick: () => r("attr", A) }] : []
|
|
5570
5570
|
], i.value = !0;
|
|
5571
5571
|
}
|
|
5572
5572
|
return t({ open: m, close: () => {
|
|
5573
5573
|
i.value = !1;
|
|
5574
|
-
} }), (h, g) => (N(),
|
|
5574
|
+
} }), (h, g) => (N(), Q(fi, {
|
|
5575
5575
|
visible: i.value,
|
|
5576
5576
|
position: l.value,
|
|
5577
5577
|
items: s.value,
|
|
@@ -5605,13 +5605,13 @@ const Pu = {
|
|
|
5605
5605
|
{ op: "table", key: "valignBottom", title: "底部对齐", group: 2 },
|
|
5606
5606
|
{ op: "table", key: "valignDefault", title: "使用默认垂直对齐", group: 2 }
|
|
5607
5607
|
], ed = [
|
|
5608
|
-
{ op: "inline", command: "toggleBold", title: "加粗", toggle: !0, icon:
|
|
5609
|
-
{ op: "inline", command: "toggleItalic", title: "斜体", toggle: !0, icon:
|
|
5610
|
-
{ op: "inline", command: "toggleUnderline", title: "下划线", toggle: !0, icon:
|
|
5611
|
-
{ op: "inline", command: "toggleStrike", title: "删除线", toggle: !0, icon:
|
|
5612
|
-
{ op: "inline", command: "toggleCode", title: "行内代码", toggle: !0, icon:
|
|
5613
|
-
{ op: "inline", command: "toggleSuperscript", title: "上标", toggle: !0, icon:
|
|
5614
|
-
{ op: "inline", command: "toggleSubscript", title: "下标", toggle: !0, icon:
|
|
5608
|
+
{ op: "inline", command: "toggleBold", title: "加粗", toggle: !0, icon: q("rte-bold"), group: 0 },
|
|
5609
|
+
{ op: "inline", command: "toggleItalic", title: "斜体", toggle: !0, icon: q("rte-italic"), group: 0 },
|
|
5610
|
+
{ op: "inline", command: "toggleUnderline", title: "下划线", toggle: !0, icon: q("rte-underline"), group: 0 },
|
|
5611
|
+
{ op: "inline", command: "toggleStrike", title: "删除线", toggle: !0, icon: q("rte-strike"), group: 0 },
|
|
5612
|
+
{ op: "inline", command: "toggleCode", title: "行内代码", toggle: !0, icon: q("rte-code"), group: 0 },
|
|
5613
|
+
{ op: "inline", command: "toggleSuperscript", title: "上标", toggle: !0, icon: q("rte-superscript"), group: 1 },
|
|
5614
|
+
{ op: "inline", command: "toggleSubscript", title: "下标", toggle: !0, icon: q("rte-subscript"), group: 1 },
|
|
5615
5615
|
{ divided: !0, group: 2 },
|
|
5616
5616
|
{ op: "inline", command: "unsetColor", title: "默认颜色", group: 2 },
|
|
5617
5617
|
// [设计] 调色板取 core/constants/textStyles 的唯一一张表,不在表格域另建第二份
|
|
@@ -5624,27 +5624,27 @@ const Pu = {
|
|
|
5624
5624
|
colorDot: e.value || void 0,
|
|
5625
5625
|
group: t
|
|
5626
5626
|
})), nd = [
|
|
5627
|
-
{ op: "table", key: "resetColumnWidth", title: "使用默认列宽", group: 0, icon:
|
|
5628
|
-
{ op: "table", key: "pinHeader", title: "固定表头", group: 1, toggle: !0, icon:
|
|
5629
|
-
{ op: "table", key: "toggleHeaderRow", title: "标题行", group: 1, toggle: !0, icon:
|
|
5630
|
-
{ op: "table", key: "toggleHeaderColumn", title: "标题列", group: 1, toggle: !0, icon:
|
|
5631
|
-
{ op: "table", key: "transpose", title: "行列转置", group: 2, icon:
|
|
5627
|
+
{ op: "table", key: "resetColumnWidth", title: "使用默认列宽", group: 0, icon: q("rte-resetWidth") },
|
|
5628
|
+
{ op: "table", key: "pinHeader", title: "固定表头", group: 1, toggle: !0, icon: q("rte-pinHead") },
|
|
5629
|
+
{ op: "table", key: "toggleHeaderRow", title: "标题行", group: 1, toggle: !0, icon: q("rte-table") },
|
|
5630
|
+
{ op: "table", key: "toggleHeaderColumn", title: "标题列", group: 1, toggle: !0, icon: q("rte-column") },
|
|
5631
|
+
{ op: "table", key: "transpose", title: "行列转置", group: 2, icon: q("rte-transpose") },
|
|
5632
5632
|
{ op: "table", key: "moveRowUp", title: "向上移", group: 3, icon: "ArrowUp" },
|
|
5633
5633
|
{ op: "table", key: "moveRowDown", title: "向下移", group: 3, icon: "ArrowDown" },
|
|
5634
5634
|
{ op: "table", key: "moveColumnLeft", title: "向左移", group: 3, icon: "ArrowLeft" },
|
|
5635
5635
|
{ op: "table", key: "moveColumnRight", title: "向右移", group: 3, icon: "ArrowRight" },
|
|
5636
5636
|
// [设计] 合并/拆分只在「更多」里出现(对应思源把 cancelMerged 收进 otherMenus):单格态没有框选,
|
|
5637
5637
|
// 顶层挂一个合并项多半是禁用死项,收进「更多」既保留「拆分已合并格」能力又不占主面。
|
|
5638
|
-
{ op: "table", key: "mergeOrSplit", title: "合并 / 拆分单元格", group: 4, icon:
|
|
5639
|
-
], hi = (e) => ({ op: "menu", title: "字体效果", group: e, children: ed, icon:
|
|
5640
|
-
{ op: "clip", key: "paste", title: "粘贴", shortcut: "Ctrl+V", group: e, icon:
|
|
5638
|
+
{ op: "table", key: "mergeOrSplit", title: "合并 / 拆分单元格", group: 4, icon: q("rte-mergeCells") }
|
|
5639
|
+
], hi = (e) => ({ op: "menu", title: "字体效果", group: e, children: ed, icon: q("rte-colorIcon") }), mi = (e) => ({ op: "menu", title: "背景颜色", group: e, children: td, icon: q("rte-bgIcon") }), pi = (e) => ({ op: "menu", title: "对齐方式", group: e, children: Ju, icon: q("rte-alignLeft") }), gi = (e) => ({ op: "menu", title: "更多", group: e, children: nd, icon: "MoreFilled" }), vi = (e) => [
|
|
5640
|
+
{ op: "clip", key: "paste", title: "粘贴", shortcut: "Ctrl+V", group: e, icon: q("rte-copy") },
|
|
5641
5641
|
{ op: "clip", key: "pasteKeepFormat", title: "粘贴并保留源格式", group: e },
|
|
5642
5642
|
{ op: "clip", key: "pasteText", title: "粘贴为纯文本", shortcut: "Ctrl+Shift+V", group: e }
|
|
5643
|
-
], bi = (e) => ({ op: "table", key: "selectAll", title: "全选", shortcut: "Ctrl+A", group: e, icon:
|
|
5644
|
-
{ op: "table", key: "insertRowBefore", title: "在上方插入", unit: "行", input: "rows", group: e, icon:
|
|
5645
|
-
{ op: "table", key: "insertRowAfter", title: "在下方插入", unit: "行", input: "rows", group: e, icon:
|
|
5646
|
-
{ op: "table", key: "insertColumnBefore", title: "在左侧插入", unit: "列", input: "cols", group: e, icon:
|
|
5647
|
-
{ op: "table", key: "insertColumnAfter", title: "在右侧插入", unit: "列", input: "cols", group: e, icon:
|
|
5643
|
+
], bi = (e) => ({ op: "table", key: "selectAll", title: "全选", shortcut: "Ctrl+A", group: e, icon: q("rte-table") }), yi = (e) => [
|
|
5644
|
+
{ op: "table", key: "insertRowBefore", title: "在上方插入", unit: "行", input: "rows", group: e, icon: q("rte-rowAbove") },
|
|
5645
|
+
{ op: "table", key: "insertRowAfter", title: "在下方插入", unit: "行", input: "rows", group: e, icon: q("rte-rowBelow") },
|
|
5646
|
+
{ op: "table", key: "insertColumnBefore", title: "在左侧插入", unit: "列", input: "cols", group: e, icon: q("rte-colLeft") },
|
|
5647
|
+
{ op: "table", key: "insertColumnAfter", title: "在右侧插入", unit: "列", input: "cols", group: e, icon: q("rte-colRight") }
|
|
5648
5648
|
], ki = (e) => [
|
|
5649
5649
|
{ op: "table", key: "deleteRow", title: "删除行", shortcut: "Ctrl+-", group: e, icon: "Delete" },
|
|
5650
5650
|
{ op: "table", key: "deleteColumn", title: "删除列", shortcut: "Ctrl+Shift+-", group: e, icon: "Delete" }
|
|
@@ -5671,7 +5671,7 @@ function ld() {
|
|
|
5671
5671
|
Ai(0),
|
|
5672
5672
|
Ti(0),
|
|
5673
5673
|
{ op: "clip", key: "cut", title: "剪切", shortcut: "Ctrl+X", group: 0 },
|
|
5674
|
-
{ op: "table", key: "clearCell", title: "删除", group: 0, icon:
|
|
5674
|
+
{ op: "table", key: "clearCell", title: "删除", group: 0, icon: q("rte-clear") },
|
|
5675
5675
|
...vi(1),
|
|
5676
5676
|
bi(2),
|
|
5677
5677
|
hi(3),
|
|
@@ -5690,16 +5690,16 @@ function sd() {
|
|
|
5690
5690
|
Ti(0),
|
|
5691
5691
|
{ op: "clip", key: "cut", title: "剪切", shortcut: "Ctrl+X", group: 0 },
|
|
5692
5692
|
{ op: "clip", key: "paste", title: "粘贴", shortcut: "Ctrl+V", group: 0 },
|
|
5693
|
-
{ op: "table", key: "clearCell", title: "清空", group: 0, danger: !0, icon:
|
|
5693
|
+
{ op: "table", key: "clearCell", title: "清空", group: 0, danger: !0, icon: q("rte-clear") },
|
|
5694
5694
|
hi(1),
|
|
5695
5695
|
mi(1),
|
|
5696
5696
|
pi(2),
|
|
5697
5697
|
{ op: "table", key: "deleteRow", title: "删除行", group: 3, icon: "Delete" },
|
|
5698
5698
|
{ op: "table", key: "deleteColumn", title: "删除列", group: 3, icon: "Delete" },
|
|
5699
|
-
{ op: "table", key: "mergeOrSplit", title: "合并单元格", group: 4, icon:
|
|
5699
|
+
{ op: "table", key: "mergeOrSplit", title: "合并单元格", group: 4, icon: q("rte-mergeCells") }
|
|
5700
5700
|
];
|
|
5701
5701
|
}
|
|
5702
|
-
const Ei = (e) => ({ op: "clip", key: "copy", title: "复制", shortcut: "Ctrl+C", group: e, icon:
|
|
5702
|
+
const Ei = (e) => ({ op: "clip", key: "copy", title: "复制", shortcut: "Ctrl+C", group: e, icon: q("rte-copy") }), Ai = (e) => ({ op: "clip", key: "copyRich", title: "复制富文本/HTML", group: e }), Ti = (e) => ({ op: "clip", key: "copyText", title: "复制纯文本", group: e });
|
|
5703
5703
|
function ad(e) {
|
|
5704
5704
|
const { rect: t, grid: n } = e;
|
|
5705
5705
|
if (t.r1 !== t.r2 || t.c1 !== t.c2) return !0;
|
|
@@ -5748,7 +5748,7 @@ const cd = {
|
|
|
5748
5748
|
}
|
|
5749
5749
|
return t({ open: c, close: () => {
|
|
5750
5750
|
o.value = !1;
|
|
5751
|
-
} }), (f, u) => (N(),
|
|
5751
|
+
} }), (f, u) => (N(), Q(fi, {
|
|
5752
5752
|
visible: o.value,
|
|
5753
5753
|
position: r.value,
|
|
5754
5754
|
items: i.value,
|
|
@@ -5827,7 +5827,7 @@ const cd = {
|
|
|
5827
5827
|
return g ? (g.on(m, h), () => g.off(m, h)) : () => {
|
|
5828
5828
|
};
|
|
5829
5829
|
}
|
|
5830
|
-
}), (m, h) => (N(),
|
|
5830
|
+
}), (m, h) => (N(), Q(Fc, {
|
|
5831
5831
|
ref_key: "surfaceRef",
|
|
5832
5832
|
ref: r,
|
|
5833
5833
|
"model-value": e.modelValue,
|
|
@@ -5841,7 +5841,8 @@ const cd = {
|
|
|
5841
5841
|
onContextmenu: E
|
|
5842
5842
|
}, {
|
|
5843
5843
|
toolbar: re(({ editor: g, state: A }) => [
|
|
5844
|
-
|
|
5844
|
+
e.readOnly ? F("", !0) : (N(), Q(gu, {
|
|
5845
|
+
key: 0,
|
|
5845
5846
|
editor: g,
|
|
5846
5847
|
state: A
|
|
5847
5848
|
}, {
|
|
@@ -5863,46 +5864,49 @@ const cd = {
|
|
|
5863
5864
|
de(m.$slots, "toolbar-extra")
|
|
5864
5865
|
]),
|
|
5865
5866
|
_: 3
|
|
5866
|
-
}, 8, ["editor", "state"])
|
|
5867
|
+
}, 8, ["editor", "state"]))
|
|
5867
5868
|
]),
|
|
5868
5869
|
gutter: re(({ editor: g, scrollEl: A, probe: M }) => [
|
|
5869
|
-
|
|
5870
|
+
e.readOnly ? F("", !0) : (N(), Q(Wu, {
|
|
5871
|
+
key: 0,
|
|
5870
5872
|
editor: g,
|
|
5871
5873
|
"scroll-el": A,
|
|
5872
5874
|
probe: M,
|
|
5873
5875
|
domain: e.domain,
|
|
5874
5876
|
onMenu: y
|
|
5875
|
-
}, null, 8, ["editor", "scroll-el", "probe", "domain"])
|
|
5877
|
+
}, null, 8, ["editor", "scroll-el", "probe", "domain"]))
|
|
5876
5878
|
]),
|
|
5877
5879
|
floaters: re(({ editor: g, state: A }) => [
|
|
5878
|
-
B(
|
|
5880
|
+
B(U(Gi), {
|
|
5879
5881
|
ref_key: "findBarRef",
|
|
5880
5882
|
ref: s,
|
|
5881
5883
|
engine: g
|
|
5882
5884
|
}, null, 8, ["engine"]),
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5885
|
+
e.readOnly ? F("", !0) : (N(), D(Ue, { key: 0 }, [
|
|
5886
|
+
B(Su, {
|
|
5887
|
+
editor: g,
|
|
5888
|
+
"open-image": p,
|
|
5889
|
+
domain: e.domain
|
|
5890
|
+
}, null, 8, ["editor", "domain"]),
|
|
5891
|
+
B(Pu, {
|
|
5892
|
+
ref_key: "bubbleRef",
|
|
5893
|
+
ref: a,
|
|
5894
|
+
editor: g,
|
|
5895
|
+
state: A
|
|
5896
|
+
}, null, 8, ["editor", "state"]),
|
|
5897
|
+
B(Yu, {
|
|
5898
|
+
ref_key: "blockMenuRef",
|
|
5899
|
+
ref: i,
|
|
5900
|
+
editor: g,
|
|
5901
|
+
domain: e.domain,
|
|
5902
|
+
onAttr: h[1] || (h[1] = (M) => o("block-attr", M))
|
|
5903
|
+
}, null, 8, ["editor", "domain"]),
|
|
5904
|
+
B(cd, {
|
|
5905
|
+
ref_key: "tableMenuRef",
|
|
5906
|
+
ref: l,
|
|
5907
|
+
editor: g
|
|
5908
|
+
}, null, 8, ["editor"])
|
|
5909
|
+
], 64)),
|
|
5906
5910
|
de(m.$slots, "floaters-extra", {
|
|
5907
5911
|
editor: g,
|
|
5908
5912
|
state: A
|
|
@@ -5926,7 +5930,7 @@ const cd = {
|
|
|
5926
5930
|
},
|
|
5927
5931
|
emits: ["update:modelValue"],
|
|
5928
5932
|
setup(e, { expose: t, emit: n }) {
|
|
5929
|
-
const o = zi(() => import("./AttrDialog-
|
|
5933
|
+
const o = zi(() => import("./AttrDialog-B9-e8HIE.js")), r = e, i = n, l = S(null), s = S(null), a = j(() => r.height ? `${r.height}px` : "100%"), c = j(() => Ki(r.modelValue || "")), { images: f, index: u, openAt: p, close: y } = ni(), E = (b) => {
|
|
5930
5934
|
const T = b.target.closest?.("img");
|
|
5931
5935
|
T && p(s.value, T);
|
|
5932
5936
|
}, m = S(!1), h = S({}), g = S("");
|
|
@@ -5967,7 +5971,7 @@ const cd = {
|
|
|
5967
5971
|
}), (b, T) => (N(), D("div", {
|
|
5968
5972
|
class: be(["gb-rte", { "is-fill": !e.height }])
|
|
5969
5973
|
}, [
|
|
5970
|
-
e.mode === "edit" ? (N(),
|
|
5974
|
+
e.mode === "edit" ? (N(), Q(wi, {
|
|
5971
5975
|
key: 0,
|
|
5972
5976
|
ref_key: "coreRef",
|
|
5973
5977
|
ref: l,
|
|
@@ -6001,18 +6005,18 @@ const cd = {
|
|
|
6001
6005
|
ref_key: "viewRef",
|
|
6002
6006
|
ref: s,
|
|
6003
6007
|
class: "gb-rte__view rich-text-content gb-scroll-thin",
|
|
6004
|
-
style:
|
|
6008
|
+
style: J(e.height ? { maxHeight: `${e.height}px` } : void 0),
|
|
6005
6009
|
innerHTML: c.value,
|
|
6006
6010
|
onClick: E
|
|
6007
6011
|
}, null, 12, ud)),
|
|
6008
|
-
|
|
6012
|
+
U(f).length ? (N(), Q(ti, {
|
|
6009
6013
|
key: 2,
|
|
6010
|
-
images:
|
|
6011
|
-
"initial-index":
|
|
6014
|
+
images: U(f),
|
|
6015
|
+
"initial-index": U(u),
|
|
6012
6016
|
onSwitch: T[1] || (T[1] = (O) => u.value = O),
|
|
6013
|
-
onClose:
|
|
6014
|
-
}, null, 8, ["images", "initial-index", "onClose"])) :
|
|
6015
|
-
m.value && e.mode === "edit" ? (N(),
|
|
6017
|
+
onClose: U(y)
|
|
6018
|
+
}, null, 8, ["images", "initial-index", "onClose"])) : F("", !0),
|
|
6019
|
+
m.value && e.mode === "edit" ? (N(), Q(U(o), {
|
|
6016
6020
|
key: 3,
|
|
6017
6021
|
scene: "richtext_attr",
|
|
6018
6022
|
title: "块属性",
|
|
@@ -6020,16 +6024,20 @@ const cd = {
|
|
|
6020
6024
|
attrs: h.value,
|
|
6021
6025
|
onUpdate: L,
|
|
6022
6026
|
onClose: R
|
|
6023
|
-
}, null, 8, ["subtitle", "attrs"])) :
|
|
6027
|
+
}, null, 8, ["subtitle", "attrs"])) : F("", !0)
|
|
6024
6028
|
], 2));
|
|
6025
6029
|
}
|
|
6026
|
-
}, fd = /* @__PURE__ */
|
|
6030
|
+
}, fd = /* @__PURE__ */ We(dd, [["__scopeId", "data-v-2d725fe4"]]), hd = (e) => {
|
|
6027
6031
|
e.component("GbRichTextEditor", fd), e.component("GbRichEditorCore", wi);
|
|
6028
|
-
}, gd = { install: hd, version: "0.1.
|
|
6032
|
+
}, gd = { install: hd, version: "0.1.2" };
|
|
6029
6033
|
export {
|
|
6030
6034
|
fd as G,
|
|
6031
|
-
|
|
6035
|
+
We as _,
|
|
6032
6036
|
ve as a,
|
|
6033
6037
|
wi as b,
|
|
6034
|
-
|
|
6038
|
+
X as c,
|
|
6039
|
+
so as d,
|
|
6040
|
+
ae as e,
|
|
6041
|
+
gd as i,
|
|
6042
|
+
V as r
|
|
6035
6043
|
};
|