xiaodao-editor 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ZH.md +5 -2
- package/README.md +2 -1
- package/dist/block-editor.js +713 -713
- package/dist/block-editor.umd.cjs +16 -16
- package/dist/core/command/Keymap.d.ts +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -1
package/dist/block-editor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var pc = Object.defineProperty;
|
|
2
2
|
var hc = (e, t, n) => t in e ? pc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var It = (e, t, n) => hc(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { inject as Zn, ref as j, defineComponent as Ft, shallowRef as ur, onMounted as oo, watch as Tt, openBlock as Z, createElementBlock as te, withModifiers as ie, unref as fe, provide as so, computed as Me, nextTick as qe, onBeforeUnmount as
|
|
4
|
+
import { inject as Zn, ref as j, defineComponent as Ft, shallowRef as ur, onMounted as oo, watch as Tt, openBlock as Z, createElementBlock as te, withModifiers as ie, unref as fe, provide as so, computed as Me, nextTick as qe, onBeforeUnmount as Bn, normalizeStyle as rn, normalizeClass as ze, createElementVNode as C, withKeys as no, createStaticVNode as ji, createBlock as mn, createCommentVNode as De, resolveDynamicComponent as gc, resolveComponent as bc, Fragment as rt, renderList as bn, createVNode as gn, Teleport as Pn, toDisplayString as Rt, reactive as An, withDirectives as bo, vShow as _r, mergeProps as mc, vModelText as Hr, useAttrs as Qi, h as ve, watchEffect as vc } from "vue";
|
|
5
5
|
function X3(e) {
|
|
6
6
|
return typeof e == "string" && e.length > 0;
|
|
7
7
|
}
|
|
@@ -265,7 +265,7 @@ function Sc(e) {
|
|
|
265
265
|
function Wt(e, t) {
|
|
266
266
|
return e.blocks.get(t);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Rn(e, t) {
|
|
269
269
|
const n = e.blocks.get(t);
|
|
270
270
|
if (!n) throw new Error(`BlockEditor: unknown block ${t}`);
|
|
271
271
|
return n;
|
|
@@ -289,11 +289,11 @@ function mr(e, t) {
|
|
|
289
289
|
const o = e.blocks.get(n);
|
|
290
290
|
return o ? o.children : e.root;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function Ln(e, t) {
|
|
293
293
|
return mr(e, t).indexOf(t);
|
|
294
294
|
}
|
|
295
295
|
function es(e, t) {
|
|
296
|
-
const n =
|
|
296
|
+
const n = Ln(e, t);
|
|
297
297
|
if (n <= 0) return;
|
|
298
298
|
const o = mr(e, t);
|
|
299
299
|
return e.blocks.get(o[n - 1]);
|
|
@@ -324,7 +324,7 @@ function vr(e, t) {
|
|
|
324
324
|
return e.blocks.get(n[o + 1]);
|
|
325
325
|
}
|
|
326
326
|
function Ac(e, t) {
|
|
327
|
-
const n =
|
|
327
|
+
const n = Rn(e, t);
|
|
328
328
|
if (n.children.length === 0) return n;
|
|
329
329
|
const o = n.children[n.children.length - 1];
|
|
330
330
|
return Ac(e, o);
|
|
@@ -565,7 +565,7 @@ function Dc(e, t) {
|
|
|
565
565
|
op: "moveBlock",
|
|
566
566
|
id: r.id,
|
|
567
567
|
toParent: jt(t, r.id),
|
|
568
|
-
toIndex:
|
|
568
|
+
toIndex: Ln(t, r.id)
|
|
569
569
|
});
|
|
570
570
|
break;
|
|
571
571
|
}
|
|
@@ -589,11 +589,11 @@ function Dc(e, t) {
|
|
|
589
589
|
}
|
|
590
590
|
function $c(e, t) {
|
|
591
591
|
const n = [], o = (r) => {
|
|
592
|
-
const i =
|
|
592
|
+
const i = Rn(t, r);
|
|
593
593
|
n.push({
|
|
594
594
|
op: "insertBlock",
|
|
595
595
|
parent: jt(t, r),
|
|
596
|
-
index:
|
|
596
|
+
index: Ln(t, r),
|
|
597
597
|
id: r,
|
|
598
598
|
type: i.type,
|
|
599
599
|
attrs: i.attrs,
|
|
@@ -674,7 +674,7 @@ function Xr(e) {
|
|
|
674
674
|
return { blockId: t, offset: n };
|
|
675
675
|
}
|
|
676
676
|
const Tl = 10;
|
|
677
|
-
function
|
|
677
|
+
function On(e, t, n) {
|
|
678
678
|
const o = t.peek();
|
|
679
679
|
if (o.length === 0) return;
|
|
680
680
|
const r = _l(e.doc, o), i = Ic(r.doc, n.registries.schema);
|
|
@@ -688,10 +688,10 @@ function Dr(e) {
|
|
|
688
688
|
let s, c;
|
|
689
689
|
if (t.after) {
|
|
690
690
|
if (!Wt(n.doc, t.after)) return !1;
|
|
691
|
-
s = jt(n.doc, t.after), c =
|
|
691
|
+
s = jt(n.doc, t.after), c = Ln(n.doc, t.after) + 1;
|
|
692
692
|
} else if (t.parent !== void 0) {
|
|
693
693
|
s = t.parent;
|
|
694
|
-
const u = s === null ? n.doc.root :
|
|
694
|
+
const u = s === null ? n.doc.root : Rn(n.doc, s).children;
|
|
695
695
|
c = t.index ?? u.length;
|
|
696
696
|
} else
|
|
697
697
|
s = null, c = n.doc.root.length;
|
|
@@ -711,9 +711,9 @@ function vl(e) {
|
|
|
711
711
|
name: "removeBlock",
|
|
712
712
|
run: (t) => (n, o) => {
|
|
713
713
|
if (!Wt(n.doc, t.id)) return !1;
|
|
714
|
-
const r = yo(n.doc, t.id), i = vr(n.doc, t.id), l = r ?? i, s = bt(), a =
|
|
714
|
+
const r = yo(n.doc, t.id), i = vr(n.doc, t.id), l = r ?? i, s = bt(), a = Rn(n.doc, t.id).children ?? [];
|
|
715
715
|
if (a.length > 0) {
|
|
716
|
-
const d = jt(n.doc, t.id), u =
|
|
716
|
+
const d = jt(n.doc, t.id), u = Ln(n.doc, t.id);
|
|
717
717
|
if ((() => {
|
|
718
718
|
if (!r) return !1;
|
|
719
719
|
const p = e.registries.schema.get(r.type);
|
|
@@ -728,7 +728,7 @@ function vl(e) {
|
|
|
728
728
|
s.moveBlock(f, d, p), p++;
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
|
-
if (s.removeBlock(t.id),
|
|
731
|
+
if (s.removeBlock(t.id), On(n, s, e), l) {
|
|
732
732
|
const d = Fe(l.content);
|
|
733
733
|
s.setSelection(yt(l.id, d.length));
|
|
734
734
|
}
|
|
@@ -742,7 +742,7 @@ function Uc(e) {
|
|
|
742
742
|
run: (t) => (n, o) => {
|
|
743
743
|
if (!Wt(n.doc, t.id)) return !1;
|
|
744
744
|
const i = t.attrs ?? e.registries.schema.defaultAttrsFor(t.type), l = bt();
|
|
745
|
-
return l.replaceBlock(t.id, t.type, i),
|
|
745
|
+
return l.replaceBlock(t.id, t.type, i), On(n, l, e), l.setSelection(yt(t.id, 0)), o == null || o(l.build()), !0;
|
|
746
746
|
}
|
|
747
747
|
};
|
|
748
748
|
}
|
|
@@ -772,7 +772,7 @@ function kl(e) {
|
|
|
772
772
|
run: (t) => (n, o) => {
|
|
773
773
|
const r = Wt(n.doc, t.id);
|
|
774
774
|
if (!r || !e.registries.schema.hasText(r.type)) return !1;
|
|
775
|
-
const i = Fe(r.content).length, l = Math.max(0, Math.min(t.offset, i)), [s, c] = pn(r.content, l), a = jt(n.doc, t.id), d =
|
|
775
|
+
const i = Fe(r.content).length, l = Math.max(0, Math.min(t.offset, i)), [s, c] = pn(r.content, l), a = jt(n.doc, t.id), d = Ln(n.doc, t.id), u = r.children ?? [], h = t.asType ?? e.registries.defaultBlockType, p = t.asAttrs ?? e.registries.schema.defaultAttrsFor(h), f = bt();
|
|
776
776
|
f.setText(t.id, s);
|
|
777
777
|
const m = f.insertBlock({
|
|
778
778
|
parent: a,
|
|
@@ -784,7 +784,7 @@ function kl(e) {
|
|
|
784
784
|
if (u.length > 0)
|
|
785
785
|
for (let T = 0; T < u.length; T++)
|
|
786
786
|
f.moveBlock(u[T], m, T);
|
|
787
|
-
return
|
|
787
|
+
return On(n, f, e), f.setSelection(yt(m, 0)), o == null || o(f.build()), !0;
|
|
788
788
|
}
|
|
789
789
|
};
|
|
790
790
|
}
|
|
@@ -800,7 +800,7 @@ function ts(e) {
|
|
|
800
800
|
c.setText(i.id, s);
|
|
801
801
|
const a = r.children ?? [];
|
|
802
802
|
if (a.length > 0) {
|
|
803
|
-
const d = jt(n.doc, t.id), u =
|
|
803
|
+
const d = jt(n.doc, t.id), u = Ln(n.doc, t.id), h = e.registries.schema.get(i.type);
|
|
804
804
|
if (!!(h != null && h.nestable) && ko(n.doc, i.id) < Tl) {
|
|
805
805
|
let m = (i.children ?? []).length;
|
|
806
806
|
for (const T of a)
|
|
@@ -811,7 +811,7 @@ function ts(e) {
|
|
|
811
811
|
c.moveBlock(m, d, f), f++;
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
|
-
return c.removeBlock(t.id),
|
|
814
|
+
return c.removeBlock(t.id), On(n, c, e), c.setSelection(yt(i.id, l.length)), o == null || o(c.build()), !0;
|
|
815
815
|
}
|
|
816
816
|
};
|
|
817
817
|
}
|
|
@@ -827,7 +827,7 @@ function Kc(e) {
|
|
|
827
827
|
}
|
|
828
828
|
return !1;
|
|
829
829
|
}
|
|
830
|
-
const i =
|
|
830
|
+
const i = Rn(t.doc, r.blockId), l = e.registries.schema.get(i.type);
|
|
831
831
|
if (!e.registries.schema.hasText(i.type))
|
|
832
832
|
return Dr(e).run({ type: e.registries.defaultBlockType, after: i.id })(t, n);
|
|
833
833
|
if (l.isolating) return !1;
|
|
@@ -845,11 +845,11 @@ function Wc(e) {
|
|
|
845
845
|
const s = o.blockIds[0], c = yo(t.doc, s), a = bt();
|
|
846
846
|
for (const u of o.blockIds) a.removeBlock(u);
|
|
847
847
|
const d = c ?? vr(t.doc, o.blockIds[o.blockIds.length - 1]);
|
|
848
|
-
return
|
|
848
|
+
return On(t, a, e), d && a.setSelection(yt(d.id, Fe(d.content).length)), n == null || n(a.build()), !0;
|
|
849
849
|
}
|
|
850
850
|
const r = Xr(o);
|
|
851
851
|
if (!r) return !1;
|
|
852
|
-
const i =
|
|
852
|
+
const i = Rn(t.doc, r.blockId);
|
|
853
853
|
if (No(o) && !vi(o) && o.anchor.blockId === o.focus.blockId) {
|
|
854
854
|
const [s, c] = o.anchor.offset <= o.focus.offset ? [o.anchor.offset, o.focus.offset] : [o.focus.offset, o.anchor.offset], a = Fe(i.content), d = Lo(a.slice(0, s) + a.slice(c)), u = bt();
|
|
855
855
|
return u.setText(i.id, d), u.setSelection(yt(i.id, s)), u.skipDomWrite([i.id]), n == null || n(u.build()), !0;
|
|
@@ -859,11 +859,11 @@ function Wc(e) {
|
|
|
859
859
|
if (c === -1 || a === -1) return !1;
|
|
860
860
|
const [d, u] = c <= a ? [o.anchor, o.focus] : [o.focus, o.anchor], h = s.indexOf(d.blockId), p = s.indexOf(u.blockId);
|
|
861
861
|
if (h === -1 || p === -1 || h >= p) return !1;
|
|
862
|
-
const f =
|
|
862
|
+
const f = Rn(t.doc, d.blockId), m = Rn(t.doc, u.blockId), T = Fe(f.content).length, D = Fe(m.content).length, F = Math.min(d.offset, T), z = Math.min(u.offset, D), [oe] = pn(f.content, F), [, $] = pn(m.content, z), U = [...oe, ...$], ce = Fe(oe).length, G = bt();
|
|
863
863
|
G.setText(d.blockId, U);
|
|
864
864
|
for (let le = p; le > h; le--)
|
|
865
865
|
G.removeBlock(s[le]);
|
|
866
|
-
return G.setSelection(yt(d.blockId, ce)),
|
|
866
|
+
return G.setSelection(yt(d.blockId, ce)), On(t, G, e), n == null || n(G.build()), !0;
|
|
867
867
|
}
|
|
868
868
|
if (r.offset > 0) return !1;
|
|
869
869
|
if (ko(t.doc, i.id) > 0)
|
|
@@ -923,7 +923,7 @@ function Zc() {
|
|
|
923
923
|
run: () => (e, t) => {
|
|
924
924
|
const n = ao(e.doc);
|
|
925
925
|
if (n.length === 0) return !1;
|
|
926
|
-
const o = n[0], r = n[n.length - 1], i =
|
|
926
|
+
const o = n[0], r = n[n.length - 1], i = Rn(e.doc, r), l = Fe(i.content).length, s = {
|
|
927
927
|
kind: "text",
|
|
928
928
|
anchor: { blockId: o, offset: 0 },
|
|
929
929
|
focus: { blockId: r, offset: l }
|
|
@@ -959,7 +959,7 @@ function jc(e) {
|
|
|
959
959
|
if (!(s != null && s.nestable)) return !1;
|
|
960
960
|
}
|
|
961
961
|
const i = bt();
|
|
962
|
-
return i.moveBlock(t.id, t.toParent, t.toIndex),
|
|
962
|
+
return i.moveBlock(t.id, t.toParent, t.toIndex), On(n, i, e), i.setSelection(yt(t.id, 0)), o == null || o(i.build()), !0;
|
|
963
963
|
}
|
|
964
964
|
};
|
|
965
965
|
}
|
|
@@ -979,7 +979,7 @@ function Ur(e) {
|
|
|
979
979
|
"color" in h && (h.color = "default"), "bgColor" in h && (h.bgColor = "default"), l = h;
|
|
980
980
|
}
|
|
981
981
|
const a = n.selection.kind === "caret" && n.selection.blockId === t.id ? n.selection.offset : 0, d = bt();
|
|
982
|
-
d.replaceBlock(t.id, t.type, l), c !== r.content && d.setText(t.id, c),
|
|
982
|
+
d.replaceBlock(t.id, t.type, l), c !== r.content && d.setText(t.id, c), On(n, d, e);
|
|
983
983
|
const u = Fe(c).length;
|
|
984
984
|
return d.setSelection(yt(t.id, Math.min(a, u))), o == null || o(d.build()), !0;
|
|
985
985
|
}
|
|
@@ -991,8 +991,8 @@ function Qc(e) {
|
|
|
991
991
|
run: (t) => (n, o) => {
|
|
992
992
|
const r = yo(n.doc, t.id);
|
|
993
993
|
if (!r) return !1;
|
|
994
|
-
const i = jt(n.doc, r.id), s = (i === null ? n.doc.root :
|
|
995
|
-
return a.moveBlock(t.id, c, Math.max(0, s)),
|
|
994
|
+
const i = jt(n.doc, r.id), s = (i === null ? n.doc.root : Rn(n.doc, i).children).indexOf(r.id), c = i, a = bt();
|
|
995
|
+
return a.moveBlock(t.id, c, Math.max(0, s)), On(n, a, e), a.setSelection(yt(t.id, 0)), o == null || o(a.build()), !0;
|
|
996
996
|
}
|
|
997
997
|
};
|
|
998
998
|
}
|
|
@@ -1002,8 +1002,8 @@ function Jc(e) {
|
|
|
1002
1002
|
run: (t) => (n, o) => {
|
|
1003
1003
|
const r = vr(n.doc, t.id);
|
|
1004
1004
|
if (!r) return !1;
|
|
1005
|
-
const i = jt(n.doc, t.id), l = i === null ? n.doc.root :
|
|
1006
|
-
return a.moveBlock(t.id, c, Math.max(0, Math.min(l.length, u))),
|
|
1005
|
+
const i = jt(n.doc, t.id), l = i === null ? n.doc.root : Rn(n.doc, i).children, s = l.indexOf(r.id), c = i, a = bt(), d = l.indexOf(t.id), u = s > d ? s : s + 1;
|
|
1006
|
+
return a.moveBlock(t.id, c, Math.max(0, Math.min(l.length, u))), On(n, a, e), a.setSelection(yt(t.id, 0)), o == null || o(a.build()), !0;
|
|
1007
1007
|
}
|
|
1008
1008
|
};
|
|
1009
1009
|
}
|
|
@@ -1024,11 +1024,11 @@ function ea(e) {
|
|
|
1024
1024
|
if (i.length === 0) return !1;
|
|
1025
1025
|
const s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), a = bt();
|
|
1026
1026
|
for (const u of i) {
|
|
1027
|
-
const h =
|
|
1027
|
+
const h = Rn(n.doc, u.oldId);
|
|
1028
1028
|
let p, f;
|
|
1029
1029
|
if (u.oldId === t.id) {
|
|
1030
1030
|
p = u.parentOldId;
|
|
1031
|
-
const D = p === null ? n.doc.root :
|
|
1031
|
+
const D = p === null ? n.doc.root : Rn(n.doc, p).children, F = D.indexOf(t.id);
|
|
1032
1032
|
f = F >= 0 ? F + 1 : D.length;
|
|
1033
1033
|
} else {
|
|
1034
1034
|
const D = u.parentOldId, F = s.get(D) ?? null;
|
|
@@ -1044,7 +1044,7 @@ function ea(e) {
|
|
|
1044
1044
|
});
|
|
1045
1045
|
s.set(u.oldId, T);
|
|
1046
1046
|
}
|
|
1047
|
-
|
|
1047
|
+
On(n, a, e);
|
|
1048
1048
|
const d = s.get(t.id) ?? null;
|
|
1049
1049
|
return d && a.setSelection(yt(d, 0)), o == null || o(a.build()), !0;
|
|
1050
1050
|
}
|
|
@@ -1112,7 +1112,7 @@ function la(e) {
|
|
|
1112
1112
|
const l = es(n.doc, r);
|
|
1113
1113
|
if (!l || !e.registries.schema.get(l.type).nestable || ko(n.doc, l.id) >= Tl) return !1;
|
|
1114
1114
|
const c = l.id, a = l.children.length, d = bt();
|
|
1115
|
-
return d.moveBlock(r, c, a),
|
|
1115
|
+
return d.moveBlock(r, c, a), On(n, d, e), d.setSelection(yt(r, 0)), o == null || o(d.build()), !0;
|
|
1116
1116
|
}
|
|
1117
1117
|
};
|
|
1118
1118
|
}
|
|
@@ -1125,7 +1125,7 @@ function ns(e) {
|
|
|
1125
1125
|
const l = jt(n.doc, r);
|
|
1126
1126
|
if (l === null) return !1;
|
|
1127
1127
|
const s = jt(n.doc, l), c = mr(n.doc, l), a = c.indexOf(l), d = a === -1 ? c.length : a + 1, u = bt();
|
|
1128
|
-
return u.moveBlock(r, s, d),
|
|
1128
|
+
return u.moveBlock(r, s, d), On(n, u, e), u.setSelection(yt(r, 0)), o == null || o(u.build()), !0;
|
|
1129
1129
|
}
|
|
1130
1130
|
};
|
|
1131
1131
|
}
|
|
@@ -1149,10 +1149,10 @@ function sa(e) {
|
|
|
1149
1149
|
let a = 0;
|
|
1150
1150
|
for (const m of r.content) {
|
|
1151
1151
|
if (m.type !== "text") continue;
|
|
1152
|
-
const T = (m.marks ?? []).map((oe) => ({ ...oe })), D = a, F = a + m.text.length,
|
|
1153
|
-
l > D && l < F &&
|
|
1154
|
-
for (let oe = 0; oe <
|
|
1155
|
-
const $ =
|
|
1152
|
+
const T = (m.marks ?? []).map((oe) => ({ ...oe })), D = a, F = a + m.text.length, z = [D, F];
|
|
1153
|
+
l > D && l < F && z.push(l), s > D && s < F && z.push(s), z.sort((oe, $) => oe - $);
|
|
1154
|
+
for (let oe = 0; oe < z.length - 1; oe++) {
|
|
1155
|
+
const $ = z[oe], U = z[oe + 1];
|
|
1156
1156
|
$ >= U || c.push({
|
|
1157
1157
|
text: m.text.slice($ - D, U - D),
|
|
1158
1158
|
marks: T.map((ce) => ({ ...ce }))
|
|
@@ -1204,11 +1204,11 @@ function rs(e) {
|
|
|
1204
1204
|
for (const p of r.content) {
|
|
1205
1205
|
if (p.type !== "text") continue;
|
|
1206
1206
|
const f = (p.marks ?? []).map((F) => ({ ...F })), m = a, T = a + p.text.length, D = [m, T];
|
|
1207
|
-
l > m && l < T && D.push(l), s > m && s < T && D.push(s), D.sort((F,
|
|
1207
|
+
l > m && l < T && D.push(l), s > m && s < T && D.push(s), D.sort((F, z) => F - z);
|
|
1208
1208
|
for (let F = 0; F < D.length - 1; F++) {
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
text: p.text.slice(
|
|
1209
|
+
const z = D[F], oe = D[F + 1];
|
|
1210
|
+
z >= oe || c.push({
|
|
1211
|
+
text: p.text.slice(z - m, oe - m),
|
|
1212
1212
|
marks: [...f]
|
|
1213
1213
|
});
|
|
1214
1214
|
}
|
|
@@ -2124,13 +2124,13 @@ function Ua(e) {
|
|
|
2124
2124
|
for (; f != null && !m.has(f); )
|
|
2125
2125
|
m.add(f), p++, f = r.get(f);
|
|
2126
2126
|
if (p = Math.min(d, p), (typeof h.attrs.indent == "number" ? h.attrs.indent : 0) === p) continue;
|
|
2127
|
-
const { indent: D, ...F } = h.attrs,
|
|
2128
|
-
o.set(u, { ...h, attrs:
|
|
2127
|
+
const { indent: D, ...F } = h.attrs, z = p > 0 ? { ...F, indent: p } : F;
|
|
2128
|
+
o.set(u, { ...h, attrs: z });
|
|
2129
2129
|
}
|
|
2130
2130
|
return { id: "doc_" + Math.random().toString(36).slice(2, 10), root: i, blocks: o, parent: r };
|
|
2131
2131
|
}
|
|
2132
2132
|
const ss = Symbol("block-editor-mobile"), Ml = Symbol("block-editor-fixed-toolbar-bridge"), yr = Symbol("block-editor-fixed-toolbar-bottom"), cs = Symbol("block-editor"), as = Symbol("block-editor-editable"), us = Symbol("block-editor-image-upload");
|
|
2133
|
-
function
|
|
2133
|
+
function Hn() {
|
|
2134
2134
|
const e = Zn(cs);
|
|
2135
2135
|
if (!e)
|
|
2136
2136
|
throw new Error("useEditor(): must be called within a <BlockEditor> component tree");
|
|
@@ -2270,7 +2270,7 @@ function Ga(e, t, n, o) {
|
|
|
2270
2270
|
T.setStart(f, 0), T.setEnd(f, m);
|
|
2271
2271
|
const D = T.getBoundingClientRect();
|
|
2272
2272
|
if (D.width <= 0 && D.height <= 0) continue;
|
|
2273
|
-
const F = Math.max(D.left, Math.min(e, D.right)),
|
|
2273
|
+
const F = Math.max(D.left, Math.min(e, D.right)), z = Math.max(D.top, Math.min(t, D.bottom)), oe = Math.hypot(e - F, t - z), $ = D.width > 0 ? Math.round((e - D.left) / D.width * m) : 0, U = u + Math.max(0, Math.min(m, $));
|
|
2274
2274
|
(!d || oe < d.dist) && (d = { offset: U, dist: oe }), u += m;
|
|
2275
2275
|
}
|
|
2276
2276
|
return d ? { blockEl: i, blockId: l, offset: Math.min(d.offset, a) } : { blockEl: i, blockId: l, offset: 0 };
|
|
@@ -2329,17 +2329,17 @@ function sl(e, t, n) {
|
|
|
2329
2329
|
const m = Fe(p.content).length;
|
|
2330
2330
|
let T = 0, D = m;
|
|
2331
2331
|
if (u === c) {
|
|
2332
|
-
const
|
|
2333
|
-
T = Math.min(
|
|
2332
|
+
const z = l === n.anchor.blockId ? n.anchor.offset : n.focus.offset;
|
|
2333
|
+
T = Math.min(z, m);
|
|
2334
2334
|
}
|
|
2335
2335
|
if (u === a) {
|
|
2336
|
-
const
|
|
2337
|
-
D = Math.min(
|
|
2336
|
+
const z = s === n.anchor.blockId ? n.anchor.offset : n.focus.offset;
|
|
2337
|
+
D = Math.min(z, m);
|
|
2338
2338
|
}
|
|
2339
2339
|
const F = ds(f, T, Math.max(T, D));
|
|
2340
2340
|
if (F)
|
|
2341
|
-
for (const
|
|
2342
|
-
|
|
2341
|
+
for (const z of F.getClientRects())
|
|
2342
|
+
z.width > 0 && z.height > 0 && d.push(z);
|
|
2343
2343
|
}
|
|
2344
2344
|
return d;
|
|
2345
2345
|
}
|
|
@@ -2421,20 +2421,20 @@ function $r(e) {
|
|
|
2421
2421
|
for (; (h = tr.exec(c)) !== null; ) {
|
|
2422
2422
|
const p = h[0], f = h[2], m = h.index + p.length - f.length, T = m + f.length;
|
|
2423
2423
|
if (m > u) {
|
|
2424
|
-
const
|
|
2425
|
-
|
|
2424
|
+
const z = c.slice(u, m);
|
|
2425
|
+
z.length > 0 && n.push({
|
|
2426
2426
|
type: "text",
|
|
2427
|
-
text:
|
|
2427
|
+
text: z,
|
|
2428
2428
|
marks: a.length > 0 ? [...a] : void 0
|
|
2429
2429
|
});
|
|
2430
2430
|
}
|
|
2431
2431
|
const D = So(f), F = co(D);
|
|
2432
2432
|
if (F) {
|
|
2433
|
-
const
|
|
2433
|
+
const z = { type: "link", attrs: { href: F } };
|
|
2434
2434
|
n.push({
|
|
2435
2435
|
type: "text",
|
|
2436
2436
|
text: f,
|
|
2437
|
-
marks: [...a,
|
|
2437
|
+
marks: [...a, z]
|
|
2438
2438
|
});
|
|
2439
2439
|
} else
|
|
2440
2440
|
n.push({
|
|
@@ -2503,7 +2503,7 @@ function tu(e) {
|
|
|
2503
2503
|
}
|
|
2504
2504
|
return t;
|
|
2505
2505
|
}
|
|
2506
|
-
function
|
|
2506
|
+
function Nn(e) {
|
|
2507
2507
|
const t = [];
|
|
2508
2508
|
function n(o, r) {
|
|
2509
2509
|
if (o.nodeType === Node.TEXT_NODE) {
|
|
@@ -2658,8 +2658,8 @@ function io(e, t, n, o, r) {
|
|
|
2658
2658
|
}
|
|
2659
2659
|
const F = (h = e.cells[T]) == null ? void 0 : h[D];
|
|
2660
2660
|
if (!F || F.covered) continue;
|
|
2661
|
-
const
|
|
2662
|
-
i > T && (i = T, a = !0), l <
|
|
2661
|
+
const z = T + Math.max(1, F.rowspan) - 1, oe = D + Math.max(1, F.colspan) - 1;
|
|
2662
|
+
i > T && (i = T, a = !0), l < z && (l = z, a = !0), s > D && (s = D, a = !0), c < oe && (c = oe, a = !0);
|
|
2663
2663
|
}
|
|
2664
2664
|
}
|
|
2665
2665
|
return { r1: i, c1: s, r2: l, c2: c };
|
|
@@ -2934,7 +2934,7 @@ function hu(e, t, n, o, r) {
|
|
|
2934
2934
|
}
|
|
2935
2935
|
d -= 1, u = e.cols - 1;
|
|
2936
2936
|
}
|
|
2937
|
-
const h = d >= 0 ? (ce = e.cells[d]) == null ? void 0 : ce[u] : void 0, p = h ? h.content.map((G) => ({ ...G })) : [], f = h == null ? void 0 : h.cellType, m = h == null ? void 0 : h.align, T = h == null ? void 0 : h.verticalAlign, D = h == null ? void 0 : h.bgColor, F = h == null ? void 0 : h.checked,
|
|
2937
|
+
const h = d >= 0 ? (ce = e.cells[d]) == null ? void 0 : ce[u] : void 0, p = h ? h.content.map((G) => ({ ...G })) : [], f = h == null ? void 0 : h.cellType, m = h == null ? void 0 : h.align, T = h == null ? void 0 : h.verticalAlign, D = h == null ? void 0 : h.bgColor, F = h == null ? void 0 : h.checked, z = h == null ? void 0 : h.startNumber;
|
|
2938
2938
|
a[i][s] = {
|
|
2939
2939
|
content: Yo(p, f),
|
|
2940
2940
|
rowspan: l - i + 1,
|
|
@@ -2945,7 +2945,7 @@ function hu(e, t, n, o, r) {
|
|
|
2945
2945
|
verticalAlign: T,
|
|
2946
2946
|
bgColor: D,
|
|
2947
2947
|
checked: F,
|
|
2948
|
-
startNumber:
|
|
2948
|
+
startNumber: z
|
|
2949
2949
|
};
|
|
2950
2950
|
const oe = uo(a, e.rows, e.cols);
|
|
2951
2951
|
return { ...e, cells: oe };
|
|
@@ -3079,7 +3079,7 @@ function ku(e) {
|
|
|
3079
3079
|
for (const f of h) {
|
|
3080
3080
|
for (; p < n && i[u][p].covered; ) p++;
|
|
3081
3081
|
if (p >= n) break;
|
|
3082
|
-
const m = Math.max(1, Math.min(f.rowSpan || 1, r - u)), T = Math.max(1, Math.min(f.colSpan || 1, n - p)), D = Yo(
|
|
3082
|
+
const m = Math.max(1, Math.min(f.rowSpan || 1, r - u)), T = Math.max(1, Math.min(f.colSpan || 1, n - p)), D = Yo(Nn(f));
|
|
3083
3083
|
i[u][p] = {
|
|
3084
3084
|
content: D,
|
|
3085
3085
|
rowspan: m,
|
|
@@ -3087,8 +3087,8 @@ function ku(e) {
|
|
|
3087
3087
|
covered: !1
|
|
3088
3088
|
};
|
|
3089
3089
|
for (let F = u; F < u + m; F++)
|
|
3090
|
-
for (let
|
|
3091
|
-
F === u &&
|
|
3090
|
+
for (let z = p; z < p + T; z++)
|
|
3091
|
+
F === u && z === p || F < r && z < n && (i[F][z] = { content: [], rowspan: 1, colspan: 1, covered: !0 });
|
|
3092
3092
|
p += T;
|
|
3093
3093
|
}
|
|
3094
3094
|
}
|
|
@@ -3288,7 +3288,7 @@ function cr(e, t, n) {
|
|
|
3288
3288
|
}
|
|
3289
3289
|
const c = t.createElement("div");
|
|
3290
3290
|
for (const d of o) c.appendChild(d.cloneNode(!0));
|
|
3291
|
-
const a =
|
|
3291
|
+
const a = Nn(c);
|
|
3292
3292
|
n.push({ type: "paragraph", attrs: {}, content: a }), o = [], r = 0;
|
|
3293
3293
|
}
|
|
3294
3294
|
for (const s of e) {
|
|
@@ -3330,7 +3330,7 @@ function cr(e, t, n) {
|
|
|
3330
3330
|
i(), n.push({
|
|
3331
3331
|
type: "heading",
|
|
3332
3332
|
attrs: { level: El[a] },
|
|
3333
|
-
content:
|
|
3333
|
+
content: Nn(c)
|
|
3334
3334
|
}), r = 0;
|
|
3335
3335
|
continue;
|
|
3336
3336
|
}
|
|
@@ -3340,7 +3340,7 @@ function cr(e, t, n) {
|
|
|
3340
3340
|
}
|
|
3341
3341
|
if (a === "li") {
|
|
3342
3342
|
i();
|
|
3343
|
-
const d = c.parentElement, u = (d == null ? void 0 : d.tagName.toLowerCase()) ?? "", h =
|
|
3343
|
+
const d = c.parentElement, u = (d == null ? void 0 : d.tagName.toLowerCase()) ?? "", h = Nn(c);
|
|
3344
3344
|
u === "ol" ? n.push({ type: "orderedList", attrs: {}, content: h }) : u === "ul" ? n.push({ type: "bulletList", attrs: {}, content: h }) : n.push({ type: "paragraph", attrs: {}, content: h }), r = 0;
|
|
3345
3345
|
continue;
|
|
3346
3346
|
}
|
|
@@ -3349,7 +3349,7 @@ function cr(e, t, n) {
|
|
|
3349
3349
|
const d = Array.from(c.children).some(
|
|
3350
3350
|
(h) => Kr(h.tagName.toLowerCase())
|
|
3351
3351
|
), u = !!c.querySelector("img");
|
|
3352
|
-
d || u ? cr(c.childNodes, t, n) : c.querySelector("br") ? Su(c, t, n) : n.push({ type: "paragraph", attrs: {}, content:
|
|
3352
|
+
d || u ? cr(c.childNodes, t, n) : c.querySelector("br") ? Su(c, t, n) : n.push({ type: "paragraph", attrs: {}, content: Nn(c) }), r = 0;
|
|
3353
3353
|
continue;
|
|
3354
3354
|
}
|
|
3355
3355
|
if (a === "div" || a === "span") {
|
|
@@ -3403,7 +3403,7 @@ function Su(e, t, n) {
|
|
|
3403
3403
|
for (const r of o) {
|
|
3404
3404
|
const i = t.createElement("div");
|
|
3405
3405
|
for (const s of r) i.appendChild(s.cloneNode(!0));
|
|
3406
|
-
const l =
|
|
3406
|
+
const l = Nn(i);
|
|
3407
3407
|
n.push({ type: "paragraph", attrs: {}, content: l });
|
|
3408
3408
|
}
|
|
3409
3409
|
}
|
|
@@ -3622,7 +3622,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
|
|
|
3622
3622
|
},
|
|
3623
3623
|
emits: ["slashTrigger", "inputChanged", "linkClick", "focusIn"],
|
|
3624
3624
|
setup(e, { emit: t }) {
|
|
3625
|
-
const n = e, o = t, r =
|
|
3625
|
+
const n = e, o = t, r = Hn(), i = wo(), l = j(null), s = ur(!1);
|
|
3626
3626
|
function c() {
|
|
3627
3627
|
return Fe(n.block.content).length === 0;
|
|
3628
3628
|
}
|
|
@@ -3687,7 +3687,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
|
|
|
3687
3687
|
if (!V && !me)
|
|
3688
3688
|
W.textContent !== y && (W.textContent = y, I = !0);
|
|
3689
3689
|
else {
|
|
3690
|
-
const ae = xi(
|
|
3690
|
+
const ae = xi(Nn(W)), ye = xi(A.content);
|
|
3691
3691
|
ae !== ye && (W.innerHTML = mo(A.content), I = !0);
|
|
3692
3692
|
}
|
|
3693
3693
|
}
|
|
@@ -3702,7 +3702,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
|
|
|
3702
3702
|
if (!i.value) return;
|
|
3703
3703
|
const W = l.value;
|
|
3704
3704
|
if (!W) return;
|
|
3705
|
-
const _ =
|
|
3705
|
+
const _ = Nn(W), O = Fe(_);
|
|
3706
3706
|
if (a.value = O.length === 0, o("inputChanged", n.block.id, O), s.value || qa({
|
|
3707
3707
|
editor: r,
|
|
3708
3708
|
registry: r.registries.inputRules,
|
|
@@ -3727,7 +3727,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
|
|
|
3727
3727
|
if (s.value = !1, !i.value) return;
|
|
3728
3728
|
const W = l.value;
|
|
3729
3729
|
if (!W) return;
|
|
3730
|
-
const _ =
|
|
3730
|
+
const _ = Nn(W), O = Fe(_);
|
|
3731
3731
|
a.value = O.length === 0, o("inputChanged", n.block.id, O);
|
|
3732
3732
|
const y = r.registries.schema.get(n.block.type).inlineMarks ? $r(_) : _;
|
|
3733
3733
|
(I = (S = r.commands).setText) == null || I.call(S, {
|
|
@@ -3758,7 +3758,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
|
|
|
3758
3758
|
const [, M] = pn(n.block.content, _), [y] = pn(M, O - _), S = Fe(y), I = mo(y);
|
|
3759
3759
|
A.preventDefault(), (V = A.clipboardData) == null || V.setData("text/plain", S), (me = A.clipboardData) == null || me.setData("text/html", I);
|
|
3760
3760
|
}
|
|
3761
|
-
function
|
|
3761
|
+
function z(A) {
|
|
3762
3762
|
var ae, ye, pe, ue;
|
|
3763
3763
|
if (!i.value) {
|
|
3764
3764
|
A.preventDefault();
|
|
@@ -3797,7 +3797,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
|
|
|
3797
3797
|
return W;
|
|
3798
3798
|
}
|
|
3799
3799
|
async function U(A) {
|
|
3800
|
-
var Ht, an, ln, Vt, ut, At, Bt, lt, Ze, Ot, be, Dt, it, He, sn, pt, Lt, P, k,
|
|
3800
|
+
var Ht, an, ln, Vt, ut, At, Bt, lt, Ze, Ot, be, Dt, it, He, sn, pt, Lt, P, k, K, _e, Se, dt, ht, vn, En, Ye, Un, un, Dn, Fn, zn;
|
|
3801
3801
|
if (!i.value) {
|
|
3802
3802
|
A.preventDefault();
|
|
3803
3803
|
return;
|
|
@@ -3936,7 +3936,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
|
|
|
3936
3936
|
et.type,
|
|
3937
3937
|
et.attrs
|
|
3938
3938
|
);
|
|
3939
|
-
(
|
|
3939
|
+
(K = (k = r.commands).insertBlock) == null || K.call(k, {
|
|
3940
3940
|
after: Ie,
|
|
3941
3941
|
type: et.type,
|
|
3942
3942
|
attrs: Je,
|
|
@@ -3993,17 +3993,17 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
|
|
|
3993
3993
|
}
|
|
3994
3994
|
}
|
|
3995
3995
|
if (Oe === -1 && ye.length > 0) {
|
|
3996
|
-
(
|
|
3996
|
+
(Un = (Ye = r.commands).insertBlock) == null || Un.call(Ye, {
|
|
3997
3997
|
after: Ie,
|
|
3998
3998
|
type: "paragraph",
|
|
3999
3999
|
attrs: {},
|
|
4000
4000
|
content: ye
|
|
4001
4001
|
});
|
|
4002
4002
|
const Le = r.getState();
|
|
4003
|
-
Le.selection.kind === "caret" && (Ie = Le.selection.blockId, (
|
|
4003
|
+
Le.selection.kind === "caret" && (Ie = Le.selection.blockId, (Dn = (un = r.commands).setSelection) == null || Dn.call(un, {
|
|
4004
4004
|
selection: yt(Ie, Fe(ye).length)
|
|
4005
4005
|
}));
|
|
4006
|
-
} else Oe === -1 && (ae.length > 0 || ye.length > 0) && ((
|
|
4006
|
+
} else Oe === -1 && (ae.length > 0 || ye.length > 0) && ((zn = (Fn = r.commands).insertBlock) == null || zn.call(Fn, {
|
|
4007
4007
|
after: Ie,
|
|
4008
4008
|
type: "paragraph",
|
|
4009
4009
|
attrs: {},
|
|
@@ -4057,7 +4057,7 @@ const Uu = ["data-block-id", "data-empty", "data-placeholder", "contenteditable"
|
|
|
4057
4057
|
onClick: X,
|
|
4058
4058
|
onPaste: ie(U, ["prevent"]),
|
|
4059
4059
|
onCopy: F,
|
|
4060
|
-
onCut:
|
|
4060
|
+
onCut: z
|
|
4061
4061
|
}, null, 40, Uu));
|
|
4062
4062
|
}
|
|
4063
4063
|
});
|
|
@@ -4458,7 +4458,7 @@ const Ku = {
|
|
|
4458
4458
|
function Gu(e, t) {
|
|
4459
4459
|
so(Ts, e), so(Ms, t);
|
|
4460
4460
|
}
|
|
4461
|
-
function
|
|
4461
|
+
function Tn() {
|
|
4462
4462
|
const e = Zn(Ts, j("zh-CN")), t = Zn(Ms, j("light"));
|
|
4463
4463
|
return {
|
|
4464
4464
|
get locale() {
|
|
@@ -4481,7 +4481,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
|
|
|
4481
4481
|
},
|
|
4482
4482
|
emits: ["openPlusMenu", "openSettingsMenu", "gripPointerDown", "gripPointerUp"],
|
|
4483
4483
|
setup(e, { expose: t, emit: n }) {
|
|
4484
|
-
const o = e, r = n, { t: i } =
|
|
4484
|
+
const o = e, r = n, { t: i } = Tn(), l = wo(), s = j(null), c = j(null), a = j(null), d = j(!1), u = j(!1), h = j(null);
|
|
4485
4485
|
let p = null;
|
|
4486
4486
|
const f = Me(
|
|
4487
4487
|
() => h.value === null ? void 0 : { top: `${h.value}px` }
|
|
@@ -4516,8 +4516,8 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
|
|
|
4516
4516
|
T(), D();
|
|
4517
4517
|
}) : F();
|
|
4518
4518
|
}
|
|
4519
|
-
), oo(T),
|
|
4520
|
-
function
|
|
4519
|
+
), oo(T), Bn(F);
|
|
4520
|
+
function z() {
|
|
4521
4521
|
l.value && c.value && r("openPlusMenu", c.value);
|
|
4522
4522
|
}
|
|
4523
4523
|
let oe = 0, $ = 0, U = 0, ce = !1;
|
|
@@ -4546,10 +4546,10 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
|
|
|
4546
4546
|
tabindex: "0",
|
|
4547
4547
|
title: fe(i)("handle.plus.title"),
|
|
4548
4548
|
"aria-label": fe(i)("handle.plus.ariaLabel"),
|
|
4549
|
-
onMousedown: ie(
|
|
4549
|
+
onMousedown: ie(z, ["prevent", "stop"]),
|
|
4550
4550
|
onKeydown: [
|
|
4551
|
-
no(ie(
|
|
4552
|
-
no(ie(
|
|
4551
|
+
no(ie(z, ["prevent", "stop"]), ["enter"]),
|
|
4552
|
+
no(ie(z, ["prevent", "stop"]), ["space"])
|
|
4553
4553
|
]
|
|
4554
4554
|
}, [...W[0] || (W[0] = [
|
|
4555
4555
|
C("svg", {
|
|
@@ -4600,7 +4600,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
|
|
|
4600
4600
|
},
|
|
4601
4601
|
emits: ["openSettingsMenu", "openPlusMenu", "slashTrigger", "inputChanged", "hoverChange", "gripPointerDown", "gripPointerUp", "linkClick", "focusIn"],
|
|
4602
4602
|
setup(e, { expose: t, emit: n }) {
|
|
4603
|
-
const o = e, r = n, i =
|
|
4603
|
+
const o = e, r = n, i = Hn(), l = wo(), s = j(null), c = j(null), a = Me(() => !l.value || o.hasTextSelection ? !1 : o.hoveredBlockId === o.block.id || o.hoveredBlockId === null && o.focusedBlockId === o.block.id), d = Me(() => o.draggingBlockId === o.block.id), u = Me(() => o.menuOpenBlockId === o.block.id), h = Me(() => o.dropTargetBlockId === o.block.id), p = Me(() => o.dropPosition ?? "after");
|
|
4604
4604
|
function f(X, A, W, _) {
|
|
4605
4605
|
r("gripPointerDown", X, A, W, _);
|
|
4606
4606
|
}
|
|
@@ -4617,7 +4617,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
|
|
|
4617
4617
|
function F() {
|
|
4618
4618
|
r("hoverChange", null);
|
|
4619
4619
|
}
|
|
4620
|
-
function
|
|
4620
|
+
function z(X) {
|
|
4621
4621
|
r("openPlusMenu", o.block.id, X);
|
|
4622
4622
|
}
|
|
4623
4623
|
function oe(X) {
|
|
@@ -4663,7 +4663,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
|
|
|
4663
4663
|
ref: c,
|
|
4664
4664
|
"block-id": e.block.id,
|
|
4665
4665
|
visible: a.value,
|
|
4666
|
-
onOpenPlusMenu:
|
|
4666
|
+
onOpenPlusMenu: z,
|
|
4667
4667
|
onOpenSettingsMenu: oe,
|
|
4668
4668
|
onGripPointerDown: f,
|
|
4669
4669
|
onGripPointerUp: m
|
|
@@ -4742,7 +4742,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
|
|
|
4742
4742
|
function F($) {
|
|
4743
4743
|
r("gripPointerUp", $);
|
|
4744
4744
|
}
|
|
4745
|
-
function
|
|
4745
|
+
function z($, U) {
|
|
4746
4746
|
r("linkClick", $, U);
|
|
4747
4747
|
}
|
|
4748
4748
|
function oe($) {
|
|
@@ -4780,7 +4780,7 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
|
|
|
4780
4780
|
onHoverChange: m,
|
|
4781
4781
|
onGripPointerDown: D,
|
|
4782
4782
|
onGripPointerUp: F,
|
|
4783
|
-
onLinkClick:
|
|
4783
|
+
onLinkClick: z,
|
|
4784
4784
|
onFocusIn: oe
|
|
4785
4785
|
}, null, 8, ["block", "placeholder", "hovered-block-id", "focused-block-id", "has-text-selection", "dragging-block-id", "drop-target-block-id", "drop-position", "menu-open-block-id"]),
|
|
4786
4786
|
G.block.children.length > 0 ? (Z(), mn(ce, {
|
|
@@ -4813,8 +4813,8 @@ const qu = ["title", "aria-label", "onKeydown"], Yu = ["title", "aria-label", "o
|
|
|
4813
4813
|
function Ss(e, t, n, o = 6, r = "auto", i = 0, l = 0) {
|
|
4814
4814
|
const s = t instanceof HTMLElement ? t.getBoundingClientRect() : t, c = document.documentElement.clientHeight, a = nd(), d = Math.max(0, c - s.bottom - o - i), u = Math.max(0, s.top - o - l), h = d >= n.height + o, p = u >= n.height + o, f = r === "down" ? !1 : r === "up" ? !0 : !h && (p || u > d);
|
|
4815
4815
|
let m, T, D;
|
|
4816
|
-
const F = s.bottom + o,
|
|
4817
|
-
f ? (m = Math.max(o + l,
|
|
4816
|
+
const F = s.bottom + o, z = s.top - o;
|
|
4817
|
+
f ? (m = Math.max(o + l, z - n.height), T = z, D = Math.max(120, u)) : (m = F, T = m + n.height, D = Math.max(120, d));
|
|
4818
4818
|
const oe = a - n.width - o, $ = Math.max(o, Math.min(oe, s.left));
|
|
4819
4819
|
return { top: m, left: $, above: f, availableHeight: D, bottom: T, topBaseline: F };
|
|
4820
4820
|
}
|
|
@@ -4863,7 +4863,7 @@ function jr(e, t) {
|
|
|
4863
4863
|
});
|
|
4864
4864
|
},
|
|
4865
4865
|
{ immediate: !0 }
|
|
4866
|
-
),
|
|
4866
|
+
), Bn(() => {
|
|
4867
4867
|
s(c), c = null;
|
|
4868
4868
|
});
|
|
4869
4869
|
}
|
|
@@ -4905,11 +4905,11 @@ function As(e, t, n, o) {
|
|
|
4905
4905
|
{ immediate: !0 }
|
|
4906
4906
|
), oo(() => {
|
|
4907
4907
|
window.addEventListener("mousedown", i, !0), window.addEventListener("touchstart", i, !0), window.addEventListener("wheel", l, !0);
|
|
4908
|
-
}),
|
|
4908
|
+
}), Bn(() => {
|
|
4909
4909
|
window.removeEventListener("mousedown", i, !0), window.removeEventListener("touchstart", i, !0), window.removeEventListener("wheel", l, !0), a(d), d = null;
|
|
4910
4910
|
});
|
|
4911
4911
|
}
|
|
4912
|
-
const od = ["innerHTML"],
|
|
4912
|
+
const od = ["innerHTML"], In = /* @__PURE__ */ Ft({
|
|
4913
4913
|
__name: "SafeHtml",
|
|
4914
4914
|
props: {
|
|
4915
4915
|
html: { default: "" }
|
|
@@ -4938,11 +4938,11 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
|
|
|
4938
4938
|
},
|
|
4939
4939
|
emits: ["close", "commit"],
|
|
4940
4940
|
setup(e, { expose: t, emit: n }) {
|
|
4941
|
-
const o = e, r = n, { t: i } =
|
|
4941
|
+
const o = e, r = n, { t: i } = Tn(), l = Me(() => ({
|
|
4942
4942
|
basic: i("plus.category.basic"),
|
|
4943
4943
|
list: i("plus.category.list"),
|
|
4944
4944
|
other: i("plus.category.other")
|
|
4945
|
-
})), s =
|
|
4945
|
+
})), s = Hn(), c = Zn(yr, j(!1)), a = j(null), d = j(null), u = j(0), h = j({ top: 0, left: 0, availableHeight: 360, above: !1, bottom: 0, topBaseline: 0 }), p = j(!1), f = j(!1), m = j(!1), T = j(!1);
|
|
4946
4946
|
let D = null;
|
|
4947
4947
|
Tt(() => o.visible, (M) => {
|
|
4948
4948
|
M ? (D && (clearTimeout(D), D = null), T.value = !0) : D = setTimeout(() => {
|
|
@@ -4952,12 +4952,12 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
|
|
|
4952
4952
|
function F(M) {
|
|
4953
4953
|
return typeof M == "string" ? M : "•";
|
|
4954
4954
|
}
|
|
4955
|
-
const
|
|
4955
|
+
const z = Me(() => {
|
|
4956
4956
|
const M = o.query.trim().toLowerCase(), y = s.registries.slash.all;
|
|
4957
4957
|
return M ? y.filter((S) => (i(S.title) + " " + (S.keywords ?? []).join(" ")).toLowerCase().includes(M)) : y;
|
|
4958
4958
|
}), oe = Me(() => {
|
|
4959
4959
|
const M = [], y = /* @__PURE__ */ new Map();
|
|
4960
|
-
for (const I of
|
|
4960
|
+
for (const I of z.value) {
|
|
4961
4961
|
const V = I.category ?? "other";
|
|
4962
4962
|
y.has(V) || y.set(V, []), y.get(V).push(I);
|
|
4963
4963
|
}
|
|
@@ -4971,9 +4971,9 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
|
|
|
4971
4971
|
return M;
|
|
4972
4972
|
});
|
|
4973
4973
|
function $(M) {
|
|
4974
|
-
return
|
|
4974
|
+
return z.value.findIndex((y) => y.id === M);
|
|
4975
4975
|
}
|
|
4976
|
-
Tt([
|
|
4976
|
+
Tt([z, () => o.visible], () => {
|
|
4977
4977
|
u.value = 0, qe(() => {
|
|
4978
4978
|
d.value && (d.value.scrollTop = 0), U();
|
|
4979
4979
|
});
|
|
@@ -4996,7 +4996,7 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
|
|
|
4996
4996
|
M && (p.value = !1, h.value = { top: 0, left: 0, availableHeight: 360, above: !1, bottom: 0, topBaseline: 0 });
|
|
4997
4997
|
}
|
|
4998
4998
|
), Tt(
|
|
4999
|
-
[() => o.visible, () => o.anchorEl, a,
|
|
4999
|
+
[() => o.visible, () => o.anchorEl, a, z, f, m],
|
|
5000
5000
|
async () => {
|
|
5001
5001
|
if (!o.visible || !o.anchorEl || !o.rootEl) return;
|
|
5002
5002
|
await qe();
|
|
@@ -5027,8 +5027,8 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
|
|
|
5027
5027
|
return V;
|
|
5028
5028
|
});
|
|
5029
5029
|
function X(M) {
|
|
5030
|
-
if (
|
|
5031
|
-
const y =
|
|
5030
|
+
if (z.value.length === 0) return;
|
|
5031
|
+
const y = z.value.length;
|
|
5032
5032
|
u.value = ((u.value + M) % y + y) % y, A();
|
|
5033
5033
|
}
|
|
5034
5034
|
function A() {
|
|
@@ -5049,7 +5049,7 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
|
|
|
5049
5049
|
case "Home":
|
|
5050
5050
|
return M.preventDefault(), u.value = 0, A(), !0;
|
|
5051
5051
|
case "End":
|
|
5052
|
-
return M.preventDefault(), u.value = Math.max(0,
|
|
5052
|
+
return M.preventDefault(), u.value = Math.max(0, z.value.length - 1), A(), !0;
|
|
5053
5053
|
case "Enter":
|
|
5054
5054
|
return M.preventDefault(), _(), !0;
|
|
5055
5055
|
case "Escape":
|
|
@@ -5059,11 +5059,11 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
|
|
|
5059
5059
|
}
|
|
5060
5060
|
}
|
|
5061
5061
|
function _() {
|
|
5062
|
-
const M =
|
|
5062
|
+
const M = z.value[u.value];
|
|
5063
5063
|
M && r("commit", M, o.mode), r("close");
|
|
5064
5064
|
}
|
|
5065
5065
|
function O(M) {
|
|
5066
|
-
const y =
|
|
5066
|
+
const y = z.value.indexOf(M);
|
|
5067
5067
|
y >= 0 && (u.value = y), _();
|
|
5068
5068
|
}
|
|
5069
5069
|
return t({ onKeyDown: W }), As(
|
|
@@ -5073,9 +5073,9 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
|
|
|
5073
5073
|
() => o.anchorEl
|
|
5074
5074
|
), oo(() => {
|
|
5075
5075
|
window.addEventListener("resize", U);
|
|
5076
|
-
}),
|
|
5076
|
+
}), Bn(() => {
|
|
5077
5077
|
window.removeEventListener("resize", U);
|
|
5078
|
-
}), (M, y) => (Z(), mn(
|
|
5078
|
+
}), (M, y) => (Z(), mn(Pn, { to: "body" }, [
|
|
5079
5079
|
T.value && e.rootEl ? (Z(), te("div", {
|
|
5080
5080
|
key: 0,
|
|
5081
5081
|
ref_key: "menuEl",
|
|
@@ -5113,7 +5113,7 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
|
|
|
5113
5113
|
class: "slash-menu-scroll",
|
|
5114
5114
|
onScroll: U
|
|
5115
5115
|
}, [
|
|
5116
|
-
|
|
5116
|
+
z.value.length === 0 ? (Z(), te("div", ld, Rt(fe(i)("plus.noMatch")), 1)) : (Z(!0), te(rt, { key: 1 }, bn(oe.value, (S) => (Z(), te("div", {
|
|
5117
5117
|
key: S.category,
|
|
5118
5118
|
class: "slash-menu-group"
|
|
5119
5119
|
}, [
|
|
@@ -5126,7 +5126,7 @@ const od = ["innerHTML"], An = /* @__PURE__ */ Ft({
|
|
|
5126
5126
|
onMousedown: ie((V) => O(I), ["prevent"]),
|
|
5127
5127
|
onMouseenter: (V) => u.value = $(I.id)
|
|
5128
5128
|
}, [
|
|
5129
|
-
gn(
|
|
5129
|
+
gn(In, {
|
|
5130
5130
|
class: "slash-menu-icon",
|
|
5131
5131
|
html: F(I.icon)
|
|
5132
5132
|
}, null, 8, ["html"]),
|
|
@@ -5249,7 +5249,7 @@ const Is = [
|
|
|
5249
5249
|
},
|
|
5250
5250
|
emits: ["close"],
|
|
5251
5251
|
setup(e, { expose: t, emit: n }) {
|
|
5252
|
-
const o = e, r = n, { t: i } =
|
|
5252
|
+
const o = e, r = n, { t: i } = Tn(), l = Hn(), s = Zn(yr, j(!1)), c = j(null), a = j(null), d = j("paragraph"), u = j({ top: 0, left: 0, availableHeight: 520, above: !1, bottom: 0, topBaseline: 0 }), h = j(!1), p = j(!1), f = j(!1), m = An({
|
|
5253
5253
|
alignIndent: !1,
|
|
5254
5254
|
indent: !1,
|
|
5255
5255
|
textColor: !1,
|
|
@@ -5262,7 +5262,7 @@ const Is = [
|
|
|
5262
5262
|
}, 300);
|
|
5263
5263
|
}, { immediate: !0 });
|
|
5264
5264
|
const F = ur(l.getState());
|
|
5265
|
-
let
|
|
5265
|
+
let z = null;
|
|
5266
5266
|
const oe = Me(
|
|
5267
5267
|
() => o.blockId != null ? F.value.doc.blocks.get(o.blockId) : void 0
|
|
5268
5268
|
), $ = j(void 0), U = Me(() => {
|
|
@@ -5293,8 +5293,8 @@ const Is = [
|
|
|
5293
5293
|
const O = Me(() => !!$.value), M = Me(() => {
|
|
5294
5294
|
const P = oe.value;
|
|
5295
5295
|
if (!P) return !0;
|
|
5296
|
-
const k = F.value.doc,
|
|
5297
|
-
return !
|
|
5296
|
+
const k = F.value.doc, K = es(k, P.id);
|
|
5297
|
+
return !K || !_(K.type) || ko(k, K.id) >= 10;
|
|
5298
5298
|
}), y = Me(() => W.value <= 0), S = Me(() => {
|
|
5299
5299
|
var k;
|
|
5300
5300
|
const P = (k = oe.value) == null ? void 0 : k.attrs.color;
|
|
@@ -5463,9 +5463,9 @@ const Is = [
|
|
|
5463
5463
|
Tt(
|
|
5464
5464
|
() => o.visible,
|
|
5465
5465
|
(P) => {
|
|
5466
|
-
var
|
|
5466
|
+
var K;
|
|
5467
5467
|
if (!P) return;
|
|
5468
|
-
$.value = o.blockId != null ? (
|
|
5468
|
+
$.value = o.blockId != null ? (K = F.value.doc.blocks.get(o.blockId)) == null ? void 0 : K.type : void 0;
|
|
5469
5469
|
const k = V.value.find((_e) => me(_e.id));
|
|
5470
5470
|
d.value = k ? k.id : "paragraph", m.alignIndent = !1, m.indent = !1, m.textColor = !1, m.bgColor = !1;
|
|
5471
5471
|
},
|
|
@@ -5480,8 +5480,8 @@ const Is = [
|
|
|
5480
5480
|
return G.value || P.push({ id: "align-justify", value: "justify", title: i("align.justify"), run: () => pe("justify") }), P;
|
|
5481
5481
|
});
|
|
5482
5482
|
function pe(P) {
|
|
5483
|
-
var k,
|
|
5484
|
-
(
|
|
5483
|
+
var k, K;
|
|
5484
|
+
(K = (k = l.commands).setBlockAlign) == null || K.call(k, { id: o.blockId, align: P });
|
|
5485
5485
|
}
|
|
5486
5486
|
function ue() {
|
|
5487
5487
|
var P, k;
|
|
@@ -5493,12 +5493,12 @@ const Is = [
|
|
|
5493
5493
|
}
|
|
5494
5494
|
const Ie = Is, et = Ns;
|
|
5495
5495
|
function Ht(P) {
|
|
5496
|
-
var k,
|
|
5497
|
-
(
|
|
5496
|
+
var k, K;
|
|
5497
|
+
(K = (k = l.commands).setBlockColor) == null || K.call(k, { id: o.blockId, color: P });
|
|
5498
5498
|
}
|
|
5499
5499
|
function an(P) {
|
|
5500
|
-
var k,
|
|
5501
|
-
(
|
|
5500
|
+
var k, K;
|
|
5501
|
+
(K = (k = l.commands).setBlockBgColor) == null || K.call(k, { id: o.blockId, bgColor: P });
|
|
5502
5502
|
}
|
|
5503
5503
|
async function ln() {
|
|
5504
5504
|
var dt, ht;
|
|
@@ -5531,16 +5531,16 @@ const Is = [
|
|
|
5531
5531
|
function ut(P) {
|
|
5532
5532
|
const k = document.createElement("textarea");
|
|
5533
5533
|
k.value = P, k.setAttribute("readonly", ""), k.style.position = "fixed", k.style.top = "-9999px", k.style.left = "-9999px", k.style.opacity = "0", document.body.appendChild(k);
|
|
5534
|
-
const
|
|
5534
|
+
const K = document.activeElement;
|
|
5535
5535
|
k.focus(), k.select();
|
|
5536
5536
|
try {
|
|
5537
5537
|
return document.execCommand("copy");
|
|
5538
5538
|
} catch {
|
|
5539
5539
|
return !1;
|
|
5540
5540
|
} finally {
|
|
5541
|
-
if (document.body.removeChild(k),
|
|
5541
|
+
if (document.body.removeChild(k), K && typeof K.focus == "function")
|
|
5542
5542
|
try {
|
|
5543
|
-
|
|
5543
|
+
K.focus();
|
|
5544
5544
|
} catch {
|
|
5545
5545
|
}
|
|
5546
5546
|
}
|
|
@@ -5619,8 +5619,8 @@ const Is = [
|
|
|
5619
5619
|
}
|
|
5620
5620
|
);
|
|
5621
5621
|
function Ot() {
|
|
5622
|
-
const P = o.anchorEl, k = o.rootEl,
|
|
5623
|
-
!o.visible || !P || !k || !
|
|
5622
|
+
const P = o.anchorEl, k = o.rootEl, K = c.value;
|
|
5623
|
+
!o.visible || !P || !k || !K || qe().then(() => {
|
|
5624
5624
|
const _e = c.value;
|
|
5625
5625
|
if (!_e) return;
|
|
5626
5626
|
const Se = _e.getBoundingClientRect(), dt = !!P.closest(".fixed-toolbar"), ht = dt ? s.value ? "up" : "down" : "auto", vn = dt ? 10 : 0, En = Ss(k, P, {
|
|
@@ -5654,7 +5654,7 @@ const Is = [
|
|
|
5654
5654
|
const sn = Me(() => {
|
|
5655
5655
|
if (!o.rootEl) return { display: "none" };
|
|
5656
5656
|
if (!h.value) return { visibility: "hidden", top: "0px", left: "0px", width: `${dl}px`, "--scroll-max-height": "100vh" };
|
|
5657
|
-
const P = u.value.above, k = u.value.left,
|
|
5657
|
+
const P = u.value.above, k = u.value.left, K = (p.value ? Ni : 0) + (f.value ? Ni : 0), _e = u.value.availableHeight - K, Se = {
|
|
5658
5658
|
left: `${k}px`,
|
|
5659
5659
|
width: `${dl}px`,
|
|
5660
5660
|
maxHeight: `${u.value.availableHeight}px`,
|
|
@@ -5669,7 +5669,7 @@ const Is = [
|
|
|
5669
5669
|
});
|
|
5670
5670
|
function pt(P) {
|
|
5671
5671
|
if (P.kind === "turnInto" && ae(P.id)) {
|
|
5672
|
-
const k = V.value.find((
|
|
5672
|
+
const k = V.value.find((K) => K.id === "paragraph");
|
|
5673
5673
|
if (k) {
|
|
5674
5674
|
d.value = "paragraph", k.run(), r("close");
|
|
5675
5675
|
return;
|
|
@@ -5680,14 +5680,14 @@ const Is = [
|
|
|
5680
5680
|
function Lt(P) {
|
|
5681
5681
|
const k = [...V.value, ...Ze.value];
|
|
5682
5682
|
if (k.length === 0) return !1;
|
|
5683
|
-
const
|
|
5683
|
+
const K = k.findIndex((Se) => Se.id === d.value), _e = (Se) => (Se % k.length + k.length) % k.length;
|
|
5684
5684
|
switch (P.key) {
|
|
5685
5685
|
case "ArrowDown":
|
|
5686
|
-
return P.preventDefault(), d.value = k[_e(
|
|
5686
|
+
return P.preventDefault(), d.value = k[_e(K + 1)].id, !0;
|
|
5687
5687
|
case "ArrowUp":
|
|
5688
|
-
return P.preventDefault(), d.value = k[_e(
|
|
5688
|
+
return P.preventDefault(), d.value = k[_e(K - 1)].id, !0;
|
|
5689
5689
|
case "Enter":
|
|
5690
|
-
return P.preventDefault(), pt(k[_e(
|
|
5690
|
+
return P.preventDefault(), pt(k[_e(K)]), !0;
|
|
5691
5691
|
case "Escape":
|
|
5692
5692
|
return P.preventDefault(), r("close"), !0;
|
|
5693
5693
|
default:
|
|
@@ -5700,12 +5700,12 @@ const Is = [
|
|
|
5700
5700
|
() => r("close"),
|
|
5701
5701
|
() => o.anchorEl
|
|
5702
5702
|
), oo(() => {
|
|
5703
|
-
|
|
5703
|
+
z = l.subscribe((P) => {
|
|
5704
5704
|
F.value = P.state;
|
|
5705
5705
|
});
|
|
5706
|
-
}),
|
|
5707
|
-
|
|
5708
|
-
}), (P, k) => (Z(), mn(
|
|
5706
|
+
}), Bn(() => {
|
|
5707
|
+
z == null || z(), z = null;
|
|
5708
|
+
}), (P, k) => (Z(), mn(Pn, { to: "body" }, [
|
|
5709
5709
|
T.value && e.rootEl ? (Z(), te("div", {
|
|
5710
5710
|
key: 0,
|
|
5711
5711
|
ref_key: "menuEl",
|
|
@@ -5746,17 +5746,17 @@ const Is = [
|
|
|
5746
5746
|
!G.value && !le.value ? (Z(), te(rt, { key: 0 }, [
|
|
5747
5747
|
C("div", Md, [
|
|
5748
5748
|
C("div", Sd, [
|
|
5749
|
-
(Z(!0), te(rt, null, bn(V.value, (
|
|
5750
|
-
key:
|
|
5751
|
-
class: ze(["bsm-icon-cell", { active: ae(
|
|
5752
|
-
title:
|
|
5749
|
+
(Z(!0), te(rt, null, bn(V.value, (K) => (Z(), te("button", {
|
|
5750
|
+
key: K.id,
|
|
5751
|
+
class: ze(["bsm-icon-cell", { active: ae(K.id) }]),
|
|
5752
|
+
title: K.title,
|
|
5753
5753
|
role: "menuitem",
|
|
5754
|
-
onMousedown: ie((_e) => pt(
|
|
5755
|
-
onMouseenter: (_e) => d.value =
|
|
5754
|
+
onMousedown: ie((_e) => pt(K), ["prevent"]),
|
|
5755
|
+
onMouseenter: (_e) => d.value = K.id
|
|
5756
5756
|
}, [
|
|
5757
|
-
gn(
|
|
5757
|
+
gn(In, {
|
|
5758
5758
|
class: "bsm-icon-svg",
|
|
5759
|
-
html:
|
|
5759
|
+
html: K.iconHtml
|
|
5760
5760
|
}, null, 8, ["html"])
|
|
5761
5761
|
], 42, Ad))), 128))
|
|
5762
5762
|
])
|
|
@@ -5767,7 +5767,7 @@ const Is = [
|
|
|
5767
5767
|
C("button", {
|
|
5768
5768
|
class: ze(["bsm-collapse-header", { "bsm-disabled": ce.value && !O.value, expanded: m.alignIndent }]),
|
|
5769
5769
|
role: "menuitem",
|
|
5770
|
-
onMousedown: k[0] || (k[0] = ie((
|
|
5770
|
+
onMousedown: k[0] || (k[0] = ie((K) => be("alignIndent"), ["prevent"]))
|
|
5771
5771
|
}, [
|
|
5772
5772
|
C("span", Nd, Rt(fe(i)("bsm.section.alignIndent")), 1),
|
|
5773
5773
|
k[10] || (k[10] = C("svg", {
|
|
@@ -5789,16 +5789,16 @@ const Is = [
|
|
|
5789
5789
|
], 34),
|
|
5790
5790
|
bo(C("div", Rd, [
|
|
5791
5791
|
C("div", Ld, [
|
|
5792
|
-
(Z(!0), te(rt, null, bn(ye.value, (
|
|
5793
|
-
key:
|
|
5794
|
-
class: ze(["bsm-icon-btn", { active: !ce.value && U.value ===
|
|
5792
|
+
(Z(!0), te(rt, null, bn(ye.value, (K) => (Z(), te("button", {
|
|
5793
|
+
key: K.id,
|
|
5794
|
+
class: ze(["bsm-icon-btn", { active: !ce.value && U.value === K.value, "bsm-disabled": ce.value }]),
|
|
5795
5795
|
disabled: ce.value,
|
|
5796
|
-
title:
|
|
5796
|
+
title: K.title,
|
|
5797
5797
|
role: "menuitem",
|
|
5798
|
-
onMousedown: ie((_e) => !ce.value && pt(
|
|
5798
|
+
onMousedown: ie((_e) => !ce.value && pt(K), ["prevent"])
|
|
5799
5799
|
}, [
|
|
5800
5800
|
(Z(), te("svg", Od, [
|
|
5801
|
-
|
|
5801
|
+
K.value === "left" ? (Z(), te(rt, { key: 0 }, [
|
|
5802
5802
|
k[11] || (k[11] = C("line", {
|
|
5803
5803
|
x1: "2",
|
|
5804
5804
|
y1: "4",
|
|
@@ -5826,7 +5826,7 @@ const Is = [
|
|
|
5826
5826
|
"stroke-width": "1.3",
|
|
5827
5827
|
"stroke-linecap": "round"
|
|
5828
5828
|
}, null, -1))
|
|
5829
|
-
], 64)) :
|
|
5829
|
+
], 64)) : K.value === "center" ? (Z(), te(rt, { key: 1 }, [
|
|
5830
5830
|
k[14] || (k[14] = C("line", {
|
|
5831
5831
|
x1: "2",
|
|
5832
5832
|
y1: "4",
|
|
@@ -5854,7 +5854,7 @@ const Is = [
|
|
|
5854
5854
|
"stroke-width": "1.3",
|
|
5855
5855
|
"stroke-linecap": "round"
|
|
5856
5856
|
}, null, -1))
|
|
5857
|
-
], 64)) :
|
|
5857
|
+
], 64)) : K.value === "right" ? (Z(), te(rt, { key: 2 }, [
|
|
5858
5858
|
k[17] || (k[17] = C("line", {
|
|
5859
5859
|
x1: "2",
|
|
5860
5860
|
y1: "4",
|
|
@@ -5920,7 +5920,7 @@ const Is = [
|
|
|
5920
5920
|
disabled: y.value,
|
|
5921
5921
|
title: fe(i)("bsm.indent.decrease"),
|
|
5922
5922
|
role: "menuitem",
|
|
5923
|
-
onMousedown: k[1] || (k[1] = ie((
|
|
5923
|
+
onMousedown: k[1] || (k[1] = ie((K) => !y.value && pt({ id: "outdent", run: Oe }), ["prevent"]))
|
|
5924
5924
|
}, [...k[23] || (k[23] = [
|
|
5925
5925
|
C("svg", {
|
|
5926
5926
|
viewBox: "0 0 1024 1024",
|
|
@@ -5939,7 +5939,7 @@ const Is = [
|
|
|
5939
5939
|
disabled: M.value,
|
|
5940
5940
|
title: fe(i)("bsm.indent.increase"),
|
|
5941
5941
|
role: "menuitem",
|
|
5942
|
-
onMousedown: k[2] || (k[2] = ie((
|
|
5942
|
+
onMousedown: k[2] || (k[2] = ie((K) => !M.value && pt({ id: "indent", run: ue }), ["prevent"]))
|
|
5943
5943
|
}, [...k[24] || (k[24] = [
|
|
5944
5944
|
C("svg", {
|
|
5945
5945
|
viewBox: "0 0 1024 1024",
|
|
@@ -5962,7 +5962,7 @@ const Is = [
|
|
|
5962
5962
|
C("button", {
|
|
5963
5963
|
class: ze(["bsm-collapse-header", { "bsm-disabled": !O.value, expanded: m.indent }]),
|
|
5964
5964
|
role: "menuitem",
|
|
5965
|
-
onMousedown: k[3] || (k[3] = ie((
|
|
5965
|
+
onMousedown: k[3] || (k[3] = ie((K) => be("indent"), ["prevent"]))
|
|
5966
5966
|
}, [
|
|
5967
5967
|
C("span", Ud, Rt(fe(i)("bsm.section.indent")), 1),
|
|
5968
5968
|
k[25] || (k[25] = C("svg", {
|
|
@@ -5989,7 +5989,7 @@ const Is = [
|
|
|
5989
5989
|
disabled: y.value,
|
|
5990
5990
|
title: fe(i)("bsm.indent.decrease"),
|
|
5991
5991
|
role: "menuitem",
|
|
5992
|
-
onMousedown: k[4] || (k[4] = ie((
|
|
5992
|
+
onMousedown: k[4] || (k[4] = ie((K) => !y.value && pt({ id: "outdent", run: Oe }), ["prevent"]))
|
|
5993
5993
|
}, [...k[26] || (k[26] = [
|
|
5994
5994
|
C("svg", {
|
|
5995
5995
|
viewBox: "0 0 1024 1024",
|
|
@@ -6008,7 +6008,7 @@ const Is = [
|
|
|
6008
6008
|
disabled: M.value,
|
|
6009
6009
|
title: fe(i)("bsm.indent.increase"),
|
|
6010
6010
|
role: "menuitem",
|
|
6011
|
-
onMousedown: k[5] || (k[5] = ie((
|
|
6011
|
+
onMousedown: k[5] || (k[5] = ie((K) => !M.value && pt({ id: "indent", run: ue }), ["prevent"]))
|
|
6012
6012
|
}, [...k[27] || (k[27] = [
|
|
6013
6013
|
C("svg", {
|
|
6014
6014
|
viewBox: "0 0 1024 1024",
|
|
@@ -6031,7 +6031,7 @@ const Is = [
|
|
|
6031
6031
|
C("button", {
|
|
6032
6032
|
class: ze(["bsm-collapse-header", { "bsm-disabled": A.value, expanded: m.textColor }]),
|
|
6033
6033
|
role: "menuitem",
|
|
6034
|
-
onMousedown: k[6] || (k[6] = ie((
|
|
6034
|
+
onMousedown: k[6] || (k[6] = ie((K) => !A.value && be("textColor"), ["prevent"]))
|
|
6035
6035
|
}, [
|
|
6036
6036
|
C("span", Gd, Rt(fe(i)("bsm.section.textColor")), 1),
|
|
6037
6037
|
k[28] || (k[28] = C("svg", {
|
|
@@ -6053,13 +6053,13 @@ const Is = [
|
|
|
6053
6053
|
], 34),
|
|
6054
6054
|
bo(C("div", qd, [
|
|
6055
6055
|
C("div", Yd, [
|
|
6056
|
-
(Z(!0), te(rt, null, bn(fe(Ie), (
|
|
6057
|
-
key: "tc-" +
|
|
6058
|
-
class: ze(["bsm-swatch", { active: S.value ===
|
|
6059
|
-
title: fe(i)(
|
|
6060
|
-
style: rn({ backgroundColor:
|
|
6056
|
+
(Z(!0), te(rt, null, bn(fe(Ie), (K) => (Z(), te("button", {
|
|
6057
|
+
key: "tc-" + K.key,
|
|
6058
|
+
class: ze(["bsm-swatch", { active: S.value === K.key, "bsm-disabled": A.value }]),
|
|
6059
|
+
title: fe(i)(K.key === "default" ? "color.default" : "color." + K.key),
|
|
6060
|
+
style: rn({ backgroundColor: K.displayCssValue ?? K.cssValue }),
|
|
6061
6061
|
disabled: A.value,
|
|
6062
|
-
onMousedown: ie((_e) => !A.value && pt({ id: `tc-${
|
|
6062
|
+
onMousedown: ie((_e) => !A.value && pt({ id: `tc-${K.key}`, run: () => Ht(K.key) }), ["prevent"])
|
|
6063
6063
|
}, null, 46, Zd))), 128))
|
|
6064
6064
|
])
|
|
6065
6065
|
], 512), [
|
|
@@ -6070,7 +6070,7 @@ const Is = [
|
|
|
6070
6070
|
C("button", {
|
|
6071
6071
|
class: ze(["bsm-collapse-header", { "bsm-disabled": A.value, expanded: m.bgColor }]),
|
|
6072
6072
|
role: "menuitem",
|
|
6073
|
-
onMousedown: k[7] || (k[7] = ie((
|
|
6073
|
+
onMousedown: k[7] || (k[7] = ie((K) => !A.value && be("bgColor"), ["prevent"]))
|
|
6074
6074
|
}, [
|
|
6075
6075
|
C("span", jd, Rt(fe(i)("bsm.section.bgColor")), 1),
|
|
6076
6076
|
k[29] || (k[29] = C("svg", {
|
|
@@ -6092,16 +6092,16 @@ const Is = [
|
|
|
6092
6092
|
], 34),
|
|
6093
6093
|
bo(C("div", Qd, [
|
|
6094
6094
|
C("div", Jd, [
|
|
6095
|
-
(Z(!0), te(rt, null, bn(fe(et), (
|
|
6096
|
-
key: "bc-" +
|
|
6095
|
+
(Z(!0), te(rt, null, bn(fe(et), (K) => (Z(), te("button", {
|
|
6096
|
+
key: "bc-" + K.key,
|
|
6097
6097
|
class: ze(["bsm-swatch", [
|
|
6098
|
-
{ active: I.value ===
|
|
6099
|
-
|
|
6098
|
+
{ active: I.value === K.key, "bsm-disabled": A.value },
|
|
6099
|
+
K.key === "default" ? "bsm-swatch--none" : ""
|
|
6100
6100
|
]]),
|
|
6101
|
-
title: fe(i)(
|
|
6102
|
-
style: rn({ backgroundColor:
|
|
6101
|
+
title: fe(i)(K.key === "default" ? "color.none" : "color." + K.key),
|
|
6102
|
+
style: rn({ backgroundColor: K.displayCssValue ?? K.cssValue }),
|
|
6103
6103
|
disabled: A.value,
|
|
6104
|
-
onMousedown: ie((_e) => !A.value && pt({ id: `bc-${
|
|
6104
|
+
onMousedown: ie((_e) => !A.value && pt({ id: `bc-${K.key}`, run: () => an(K.key) }), ["prevent"])
|
|
6105
6105
|
}, null, 46, ef))), 128))
|
|
6106
6106
|
])
|
|
6107
6107
|
], 512), [
|
|
@@ -6110,23 +6110,23 @@ const Is = [
|
|
|
6110
6110
|
])) : De("", !0),
|
|
6111
6111
|
k[30] || (k[30] = C("div", { class: "bsm-sep" }, null, -1)),
|
|
6112
6112
|
C("div", tf, [
|
|
6113
|
-
(Z(!0), te(rt, null, bn(Ze.value, (
|
|
6114
|
-
key:
|
|
6115
|
-
class: ze(["bsm-item bsm-action", { danger:
|
|
6113
|
+
(Z(!0), te(rt, null, bn(Ze.value, (K) => (Z(), te("button", {
|
|
6114
|
+
key: K.id,
|
|
6115
|
+
class: ze(["bsm-item bsm-action", { danger: K.danger }]),
|
|
6116
6116
|
role: "menuitem",
|
|
6117
|
-
onMousedown: ie((_e) => pt(
|
|
6118
|
-
onMouseenter: (_e) => d.value =
|
|
6117
|
+
onMousedown: ie((_e) => pt(K), ["prevent"]),
|
|
6118
|
+
onMouseenter: (_e) => d.value = K.id
|
|
6119
6119
|
}, [
|
|
6120
|
-
gn(
|
|
6120
|
+
gn(In, {
|
|
6121
6121
|
class: "bsm-action-icon",
|
|
6122
|
-
html:
|
|
6122
|
+
html: K.iconHtml
|
|
6123
6123
|
}, null, 8, ["html"]),
|
|
6124
|
-
C("span", of, Rt(
|
|
6125
|
-
|
|
6124
|
+
C("span", of, Rt(K.title), 1),
|
|
6125
|
+
K.shortcutHtml ? (Z(), mn(In, {
|
|
6126
6126
|
key: 0,
|
|
6127
6127
|
class: "bsm-shortcut",
|
|
6128
|
-
html:
|
|
6129
|
-
}, null, 8, ["html"])) :
|
|
6128
|
+
html: K.shortcutHtml
|
|
6129
|
+
}, null, 8, ["html"])) : K.shortcut ? (Z(), te("span", rf, Rt(K.shortcut), 1)) : De("", !0)
|
|
6130
6130
|
], 42, nf))), 128))
|
|
6131
6131
|
])
|
|
6132
6132
|
], 544),
|
|
@@ -6236,7 +6236,7 @@ const Is = [
|
|
|
6236
6236
|
function i() {
|
|
6237
6237
|
r("interacting");
|
|
6238
6238
|
}
|
|
6239
|
-
const { t: l } =
|
|
6239
|
+
const { t: l } = Tn(), s = Hn(), c = Zn(yr, j(!1)), a = j(null), d = j(null), u = j(null), h = j(null), p = j(null), f = j(null), m = j(null), T = j(null), D = j(null), F = j({ top: 0, left: 0, above: !1 }), z = j(null), oe = j(!1), $ = j(null), U = j(null), ce = j(!1), G = j(!1), le = j(null), X = j(!1), A = j(!1), W = j(!1), _ = Me(() => ({
|
|
6240
6240
|
maxHeight: $.value !== null ? `${$.value}px` : void 0
|
|
6241
6241
|
})), O = j(null), M = Me(() => {
|
|
6242
6242
|
if (!o.mobile || !O.value) return;
|
|
@@ -6256,8 +6256,8 @@ const Is = [
|
|
|
6256
6256
|
), me = Me(() => {
|
|
6257
6257
|
var b;
|
|
6258
6258
|
if (o.cellEditMode || o.tableMode) {
|
|
6259
|
-
const
|
|
6260
|
-
return typeof
|
|
6259
|
+
const L = o.blockAttrs.align;
|
|
6260
|
+
return typeof L == "string" ? L : "left";
|
|
6261
6261
|
}
|
|
6262
6262
|
const R = (b = V.value) == null ? void 0 : b.attrs.align;
|
|
6263
6263
|
return typeof R == "string" ? R : "left";
|
|
@@ -6273,9 +6273,9 @@ const Is = [
|
|
|
6273
6273
|
return "middle";
|
|
6274
6274
|
}), ye = j(""), pe = j("");
|
|
6275
6275
|
Tt(() => o.visible, (R) => {
|
|
6276
|
-
R || (
|
|
6276
|
+
R || (z.value = null);
|
|
6277
6277
|
}), Tt(() => o.blockId, () => {
|
|
6278
|
-
|
|
6278
|
+
z.value = null;
|
|
6279
6279
|
});
|
|
6280
6280
|
const ue = j(/* @__PURE__ */ new Set()), Oe = j(0);
|
|
6281
6281
|
function Ie() {
|
|
@@ -6284,8 +6284,8 @@ const Is = [
|
|
|
6284
6284
|
if (o.cellEditMode) {
|
|
6285
6285
|
const b = window.getSelection();
|
|
6286
6286
|
if (!b || b.rangeCount === 0) return null;
|
|
6287
|
-
const
|
|
6288
|
-
return (R =
|
|
6287
|
+
const L = b.getRangeAt(0);
|
|
6288
|
+
return (R = L.commonAncestorContainer.nodeType === 1 ? L.commonAncestorContainer : L.commonAncestorContainer.parentElement) == null ? void 0 : R.closest(".table-cell-inner");
|
|
6289
6289
|
}
|
|
6290
6290
|
return o.rootEl.querySelector(`[data-block-id="${o.blockId}"]`);
|
|
6291
6291
|
}
|
|
@@ -6305,9 +6305,9 @@ const Is = [
|
|
|
6305
6305
|
if (v && v.rangeCount > 0) {
|
|
6306
6306
|
const w = v.getRangeAt(0);
|
|
6307
6307
|
if (!w.collapsed && b.contains(w.commonAncestorContainer)) {
|
|
6308
|
-
const x = [],
|
|
6309
|
-
for (;
|
|
6310
|
-
const q =
|
|
6308
|
+
const x = [], B = document.createTreeWalker(b, NodeFilter.SHOW_TEXT);
|
|
6309
|
+
for (; B.nextNode(); ) {
|
|
6310
|
+
const q = B.currentNode;
|
|
6311
6311
|
(q.nodeValue ?? "").length !== 0 && w.intersectsNode(q) && x.push(q);
|
|
6312
6312
|
}
|
|
6313
6313
|
if (x.length > 0) {
|
|
@@ -6336,12 +6336,12 @@ const Is = [
|
|
|
6336
6336
|
}
|
|
6337
6337
|
}
|
|
6338
6338
|
}
|
|
6339
|
-
const
|
|
6339
|
+
const L = S.value, he = o.blockId ? L.doc.blocks.get(o.blockId) : void 0;
|
|
6340
6340
|
if (!he) {
|
|
6341
6341
|
ue.value = R;
|
|
6342
6342
|
return;
|
|
6343
6343
|
}
|
|
6344
|
-
const Ne =
|
|
6344
|
+
const Ne = L.selection;
|
|
6345
6345
|
let Ke = 0, Pe = Fe(he.content).length;
|
|
6346
6346
|
if (Ne.kind === "text" && Ne.anchor.blockId === o.blockId && Ne.focus.blockId === o.blockId)
|
|
6347
6347
|
Ke = Math.min(Ne.anchor.offset, Ne.focus.offset), Pe = Math.max(Ne.anchor.offset, Ne.focus.offset);
|
|
@@ -6355,15 +6355,15 @@ const Is = [
|
|
|
6355
6355
|
}
|
|
6356
6356
|
const Ee = ["bold", "italic", "underline", "strikethrough", "code", "link"];
|
|
6357
6357
|
for (const v of Ee) {
|
|
6358
|
-
let w = !0, x = !1,
|
|
6358
|
+
let w = !0, x = !1, B = 0;
|
|
6359
6359
|
for (const q of he.content) {
|
|
6360
6360
|
if (q.type !== "text") continue;
|
|
6361
|
-
const Q =
|
|
6361
|
+
const Q = B, de = B + q.text.length;
|
|
6362
6362
|
if (de > Ke && Q < Pe && (x = !0, !q.marks || !q.marks.some((Ce) => Ce.type === v))) {
|
|
6363
6363
|
w = !1;
|
|
6364
6364
|
break;
|
|
6365
6365
|
}
|
|
6366
|
-
|
|
6366
|
+
B = de;
|
|
6367
6367
|
}
|
|
6368
6368
|
x && w && R.add(v);
|
|
6369
6369
|
}
|
|
@@ -6401,20 +6401,20 @@ const Is = [
|
|
|
6401
6401
|
{ id: "strikethrough", title: l("mark.strikethrough"), iconHtml: '<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M182.044 490.667h659.911a34.133 34.133 0 0 1 4.642 67.948l-4.597 0.319h-135.395c40.05 37 60.803 81.601 60.803 133.575 0 128.569-147.092 211.171-307.382 192.512-101.717-11.833-173.352-52.565-210.944-122.971a34.133 34.133 0 0 1 60.211-32.176c25.942 48.606 77.46 77.915 158.606 87.381 124.837 14.473 231.242-45.283 231.242-124.746 0-53.339-36.636-96.802-116.736-131.345l-5.279-2.23H182.044a34.133 34.133 0 0 1-33.815-29.492L147.911 524.8a34.133 34.133 0 0 1 29.491-33.815l4.642-0.318z m68.767-176.447c6.918-128.796 128.432-203.343 287.812-184.82 99.579 11.56 175.81 47.923 226.737 109.636a34.133 34.133 0 1 1-52.657 43.463c-38.775-47.013-98.759-75.639-181.999-85.288-123.654-14.381-211.627 36.591-211.627 117.009 0 35.135 10.65 61.349 37.774 90.203l5.826 6.007c4.278 4.369 8.966 8.875 11.377 10.923l1.411 0.91H288.085l-1.092-1.729c-6.508-9.376-38.958-54.386-36.182-106.314z" fill="currentColor"/></svg>' },
|
|
6402
6402
|
{ id: "code", title: l("mark.inlineCode"), iconHtml: '<svg viewBox="0 0 1024 1024" width="15" height="15" aria-hidden="true"><path d="M197.802 747.664v-145.287a58.916 58.916 0 0 0-58.916-58.916h-19.619v-62.922h19.619a58.916 58.916 0 0 0 58.916-58.916V276.336a117.832 117.832 0 0 1 117.832-117.832h39.297v78.535h-39.356a39.297 39.297 0 0 0-39.238 39.297v161.017A78.594 78.594 0 0 1 222.37 512a78.594 78.594 0 0 1 53.967 74.646V747.664a39.238 39.238 0 0 0 39.238 39.238h39.356v78.594h-39.356a117.832 117.832 0 0 1-117.832-117.832z m628.456-145.287V747.664a117.832 117.832 0 0 1-117.832 117.832h-39.356v-78.594h39.356a39.238 39.238 0 0 0 39.238-39.238v-161.017A78.535 78.535 0 0 1 801.63 512a78.594 78.594 0 0 1-53.967-74.646V276.336a39.297 39.297 0 0 0-39.238-39.297h-39.356V158.504h39.356a117.832 117.832 0 0 1 117.832 117.832v145.287a58.916 58.916 0 0 0 58.916 58.916h19.56v62.922h-19.56a58.916 58.916 0 0 0-58.916 58.916z" fill="currentColor"/></svg>' }
|
|
6403
6403
|
]), Bt = Me(() => {
|
|
6404
|
-
const R = o.blockType, b = o.blockAttrs,
|
|
6404
|
+
const R = o.blockType, b = o.blockAttrs, L = (Ne, Ke) => R === Ne && (Ke === void 0 || Number(b.level) === Ke);
|
|
6405
6405
|
return [
|
|
6406
|
-
{ id: "text", label: l("turnInto.paragraph"), iconHtml: Bl, active:
|
|
6407
|
-
{ id: "h1", label: l("turnInto.h1"), iconHtml: Ol, active:
|
|
6408
|
-
{ id: "h2", label: l("turnInto.h2"), iconHtml: Dl, active:
|
|
6409
|
-
{ id: "h3", label: l("turnInto.h3"), iconHtml: $l, active:
|
|
6410
|
-
{ id: "h4", label: l("turnInto.h4"), iconHtml: Pl, active:
|
|
6411
|
-
{ id: "h5", label: l("turnInto.h5"), iconHtml: Hl, active:
|
|
6412
|
-
{ id: "h6", label: l("turnInto.h6"), iconHtml: Ul, active:
|
|
6413
|
-
{ id: "bullet", label: l("turnInto.bullet"), iconHtml: Fl, active:
|
|
6414
|
-
{ id: "ordered", label: l("turnInto.ordered"), iconHtml: zl, active:
|
|
6415
|
-
{ id: "todo", label: l("turnInto.todo"), iconHtml: Kl, active:
|
|
6416
|
-
{ id: "quote", label: l("turnInto.quote"), iconHtml: Wl, active:
|
|
6417
|
-
{ id: "code", label: l("turnInto.code"), iconHtml: Vl, active:
|
|
6406
|
+
{ id: "text", label: l("turnInto.paragraph"), iconHtml: Bl, active: L("paragraph"), convertType: "paragraph" },
|
|
6407
|
+
{ id: "h1", label: l("turnInto.h1"), iconHtml: Ol, active: L("heading", 1), convertType: "heading", convertAttrs: { level: 1 } },
|
|
6408
|
+
{ id: "h2", label: l("turnInto.h2"), iconHtml: Dl, active: L("heading", 2), convertType: "heading", convertAttrs: { level: 2 } },
|
|
6409
|
+
{ id: "h3", label: l("turnInto.h3"), iconHtml: $l, active: L("heading", 3), convertType: "heading", convertAttrs: { level: 3 } },
|
|
6410
|
+
{ id: "h4", label: l("turnInto.h4"), iconHtml: Pl, active: L("heading", 4), convertType: "heading", convertAttrs: { level: 4 } },
|
|
6411
|
+
{ id: "h5", label: l("turnInto.h5"), iconHtml: Hl, active: L("heading", 5), convertType: "heading", convertAttrs: { level: 5 } },
|
|
6412
|
+
{ id: "h6", label: l("turnInto.h6"), iconHtml: Ul, active: L("heading", 6), convertType: "heading", convertAttrs: { level: 6 } },
|
|
6413
|
+
{ id: "bullet", label: l("turnInto.bullet"), iconHtml: Fl, active: L("bulletList"), convertType: "bulletList" },
|
|
6414
|
+
{ id: "ordered", label: l("turnInto.ordered"), iconHtml: zl, active: L("orderedList"), convertType: "orderedList" },
|
|
6415
|
+
{ id: "todo", label: l("turnInto.todo"), iconHtml: Kl, active: L("todoList"), convertType: "todoList", convertAttrs: { checked: !1 } },
|
|
6416
|
+
{ id: "quote", label: l("turnInto.quote"), iconHtml: Wl, active: L("quote"), convertType: "quote" },
|
|
6417
|
+
{ id: "code", label: l("turnInto.code"), iconHtml: Vl, active: L("codeBlock"), convertType: "codeBlock", convertAttrs: { language: "plain" } }
|
|
6418
6418
|
];
|
|
6419
6419
|
}), lt = Me(() => {
|
|
6420
6420
|
const R = Bt.value.find((b) => b.active);
|
|
@@ -6436,13 +6436,13 @@ const Is = [
|
|
|
6436
6436
|
X.value = !1;
|
|
6437
6437
|
return;
|
|
6438
6438
|
}
|
|
6439
|
-
const
|
|
6439
|
+
const L = b.scrollLeft;
|
|
6440
6440
|
b.style.maxWidth = "", b.offsetWidth;
|
|
6441
6441
|
const he = b.scrollWidth, Ne = o.mobile ? Math.max(120, (((Ee = R.parentElement) == null ? void 0 : Ee.clientWidth) ?? R.clientWidth) - 8) : Math.max(200, document.documentElement.clientWidth - 32), Ke = vp * 2, Pe = Ne - Ke;
|
|
6442
6442
|
if (he > Pe) {
|
|
6443
6443
|
X.value = !0, b.style.maxWidth = `${Pe}px`;
|
|
6444
6444
|
const v = Math.max(0, b.scrollWidth - b.clientWidth);
|
|
6445
|
-
b.scrollLeft = Math.min(
|
|
6445
|
+
b.scrollLeft = Math.min(L, v), He();
|
|
6446
6446
|
} else
|
|
6447
6447
|
X.value = !1, b.style.maxWidth = "", A.value = !1, W.value = !1;
|
|
6448
6448
|
}
|
|
@@ -6451,31 +6451,31 @@ const Is = [
|
|
|
6451
6451
|
R && (A.value = R.scrollLeft > 0, W.value = R.scrollLeft + R.clientWidth < R.scrollWidth - 1);
|
|
6452
6452
|
}
|
|
6453
6453
|
function sn(R) {
|
|
6454
|
-
|
|
6454
|
+
z.value = null;
|
|
6455
6455
|
const b = le.value;
|
|
6456
6456
|
b && (b.scrollLeft += R * mp, He());
|
|
6457
6457
|
}
|
|
6458
|
-
let pt = null, Lt = 0, P = 0, k = !1,
|
|
6458
|
+
let pt = null, Lt = 0, P = 0, k = !1, K = !1;
|
|
6459
6459
|
function _e(R) {
|
|
6460
6460
|
if (!k) return;
|
|
6461
6461
|
const b = R.touches[0];
|
|
6462
6462
|
if (!b) return;
|
|
6463
|
-
const
|
|
6464
|
-
(
|
|
6463
|
+
const L = Math.abs(b.clientX - Lt), he = Math.abs(b.clientY - P);
|
|
6464
|
+
(L > Li || he > Li) && (K || (z.value = null), K = !0);
|
|
6465
6465
|
}
|
|
6466
6466
|
function Se(R) {
|
|
6467
6467
|
if (!k) return;
|
|
6468
6468
|
const b = pt;
|
|
6469
6469
|
pt = null, k = !1;
|
|
6470
|
-
const
|
|
6471
|
-
|
|
6470
|
+
const L = K;
|
|
6471
|
+
K = !1, L || (R.cancelable && R.preventDefault(), b && b());
|
|
6472
6472
|
}
|
|
6473
6473
|
function dt(R, b) {
|
|
6474
6474
|
b.cancelable && b.preventDefault(), sn(R);
|
|
6475
6475
|
}
|
|
6476
6476
|
function ht(R, b) {
|
|
6477
|
-
const
|
|
6478
|
-
|
|
6477
|
+
const L = b.touches[0];
|
|
6478
|
+
L && (Lt = L.clientX, P = L.clientY), pt = R, k = !0, K = !1;
|
|
6479
6479
|
}
|
|
6480
6480
|
Tt(
|
|
6481
6481
|
[() => o.visible, () => o.selectionRect, a, () => o.mobile],
|
|
@@ -6488,12 +6488,12 @@ const Is = [
|
|
|
6488
6488
|
const R = a.value;
|
|
6489
6489
|
if (!R) return;
|
|
6490
6490
|
it(), await qe();
|
|
6491
|
-
const b = R.getBoundingClientRect(),
|
|
6491
|
+
const b = R.getBoundingClientRect(), L = b.width, he = Math.max(b.height, fl);
|
|
6492
6492
|
F.value = o.tableMode ? Ai(o.rootEl, o.selectionRect, {
|
|
6493
|
-
width:
|
|
6493
|
+
width: L,
|
|
6494
6494
|
height: he
|
|
6495
6495
|
}) : Si(o.rootEl, o.selectionRect, {
|
|
6496
|
-
width:
|
|
6496
|
+
width: L,
|
|
6497
6497
|
height: he
|
|
6498
6498
|
});
|
|
6499
6499
|
},
|
|
@@ -6505,9 +6505,9 @@ const Is = [
|
|
|
6505
6505
|
width: "100vw",
|
|
6506
6506
|
height: "100vh"
|
|
6507
6507
|
})), En = Me(() => {
|
|
6508
|
-
const R = a.value, b = (R == null ? void 0 : R.offsetWidth) ?? kp,
|
|
6508
|
+
const R = a.value, b = (R == null ? void 0 : R.offsetWidth) ?? kp, L = document.documentElement.clientWidth, he = 8;
|
|
6509
6509
|
let Ne = F.value.left;
|
|
6510
|
-
const Ke = Math.max(he,
|
|
6510
|
+
const Ke = Math.max(he, L - b - he);
|
|
6511
6511
|
Ne = Math.max(he, Math.min(Ke, Ne));
|
|
6512
6512
|
const Pe = {
|
|
6513
6513
|
top: `${F.value.top}px`,
|
|
@@ -6520,14 +6520,14 @@ const Is = [
|
|
|
6520
6520
|
return Pe;
|
|
6521
6521
|
});
|
|
6522
6522
|
async function Ye(R) {
|
|
6523
|
-
|
|
6523
|
+
z.value = z.value === R ? null : R, z.value && (await qe(), Un());
|
|
6524
6524
|
}
|
|
6525
|
-
function
|
|
6526
|
-
const R =
|
|
6525
|
+
function Un() {
|
|
6526
|
+
const R = z.value;
|
|
6527
6527
|
if (!R) return;
|
|
6528
|
-
const b = R === "type" ? d.value : R === "align" ? u.value : R === "verticalAlign" ? h.value : p.value,
|
|
6529
|
-
if (!b || !
|
|
6530
|
-
const he =
|
|
6528
|
+
const b = R === "type" ? d.value : R === "align" ? u.value : R === "verticalAlign" ? h.value : p.value, L = R === "type" ? f.value : R === "align" ? m.value : R === "verticalAlign" ? T.value : D.value;
|
|
6529
|
+
if (!b || !L) return;
|
|
6530
|
+
const he = L.getBoundingClientRect(), Ne = window.innerHeight, Ke = 6, Pe = Math.floor(Ne - he.bottom - Ke), Ee = Math.floor(he.top - Ke), v = b.scrollHeight;
|
|
6531
6531
|
if (o.mobile) {
|
|
6532
6532
|
const q = document.documentElement.clientHeight, Q = 10;
|
|
6533
6533
|
if (c.value) {
|
|
@@ -6536,7 +6536,6 @@ const Is = [
|
|
|
6536
6536
|
if (R === "color") {
|
|
6537
6537
|
const Ce = document.documentElement.clientWidth;
|
|
6538
6538
|
O.value = {
|
|
6539
|
-
left: 8,
|
|
6540
6539
|
bottom: ge,
|
|
6541
6540
|
right: Math.max(8, Ce - he.right)
|
|
6542
6541
|
};
|
|
@@ -6551,7 +6550,6 @@ const Is = [
|
|
|
6551
6550
|
if (R === "color") {
|
|
6552
6551
|
const Ce = document.documentElement.clientWidth;
|
|
6553
6552
|
O.value = {
|
|
6554
|
-
left: 8,
|
|
6555
6553
|
top: ge,
|
|
6556
6554
|
right: Math.max(8, Ce - he.right)
|
|
6557
6555
|
};
|
|
@@ -6570,8 +6568,8 @@ const Is = [
|
|
|
6570
6568
|
const q = o.rootEl.getBoundingClientRect(), Q = a.value.getBoundingClientRect();
|
|
6571
6569
|
q.bottom - Q.bottom < Bi && Ee > Bi && (w = !0);
|
|
6572
6570
|
}
|
|
6573
|
-
let x = !1,
|
|
6574
|
-
w ? (x = !0,
|
|
6571
|
+
let x = !1, B;
|
|
6572
|
+
w ? (x = !0, B = Ee) : v <= Pe ? (x = !1, B = Pe) : Ee > Pe ? (x = !0, B = Ee) : (x = !1, B = Pe), oe.value = x, $.value = Math.max(120, Math.min(B, 360)), qe(un);
|
|
6575
6573
|
}
|
|
6576
6574
|
function un() {
|
|
6577
6575
|
const R = U.value;
|
|
@@ -6581,19 +6579,19 @@ const Is = [
|
|
|
6581
6579
|
}
|
|
6582
6580
|
ce.value = R.scrollTop > 1, G.value = R.scrollTop + R.clientHeight < R.scrollHeight - 1;
|
|
6583
6581
|
}
|
|
6584
|
-
function
|
|
6582
|
+
function Dn() {
|
|
6585
6583
|
const R = U.value;
|
|
6586
6584
|
R && (R.scrollTop -= R.clientHeight * 0.8);
|
|
6587
6585
|
}
|
|
6588
|
-
function
|
|
6586
|
+
function Fn() {
|
|
6589
6587
|
const R = U.value;
|
|
6590
6588
|
R && (R.scrollTop += R.clientHeight * 0.8);
|
|
6591
6589
|
}
|
|
6592
6590
|
jr(U, un);
|
|
6593
|
-
function
|
|
6594
|
-
var
|
|
6591
|
+
function zn(R) {
|
|
6592
|
+
var L, he, Ne, Ke, Pe;
|
|
6595
6593
|
if (r("interacting"), o.tableMode || o.cellEditMode) {
|
|
6596
|
-
R.convertType === "heading" && ((
|
|
6594
|
+
R.convertType === "heading" && ((L = R.convertAttrs) != null && L.level) ? r("tableType", `heading${R.convertAttrs.level}`) : r("tableType", R.convertType), z.value = null, o.tableMode && r("close");
|
|
6597
6595
|
return;
|
|
6598
6596
|
}
|
|
6599
6597
|
const b = Et();
|
|
@@ -6604,41 +6602,41 @@ const Is = [
|
|
|
6604
6602
|
type: R.convertType,
|
|
6605
6603
|
attrs: R.convertAttrs ?? {}
|
|
6606
6604
|
});
|
|
6607
|
-
|
|
6605
|
+
z.value = null, r("close");
|
|
6608
6606
|
return;
|
|
6609
6607
|
}
|
|
6610
6608
|
y.value && ((Pe = (Ke = s.commands).convertBlock) == null || Pe.call(Ke, {
|
|
6611
6609
|
id: y.value,
|
|
6612
6610
|
type: R.convertType,
|
|
6613
6611
|
attrs: R.convertAttrs ?? {}
|
|
6614
|
-
}),
|
|
6612
|
+
}), z.value = null, r("close"));
|
|
6615
6613
|
}
|
|
6616
6614
|
function Le(R) {
|
|
6617
|
-
var
|
|
6615
|
+
var L, he, Ne, Ke;
|
|
6618
6616
|
if (r("interacting"), o.tableMode || o.cellEditMode) {
|
|
6619
|
-
r("tableAlign", R),
|
|
6617
|
+
r("tableAlign", R), z.value = null;
|
|
6620
6618
|
return;
|
|
6621
6619
|
}
|
|
6622
6620
|
const b = Et();
|
|
6623
6621
|
if (b) {
|
|
6624
6622
|
for (const Pe of b.ranges)
|
|
6625
|
-
(he = (
|
|
6626
|
-
|
|
6623
|
+
(he = (L = s.commands).setBlockAlign) == null || he.call(L, { id: Pe.id, align: R });
|
|
6624
|
+
z.value = null;
|
|
6627
6625
|
return;
|
|
6628
6626
|
}
|
|
6629
|
-
y.value && ((Ke = (Ne = s.commands).setBlockAlign) == null || Ke.call(Ne, { id: y.value, align: R }),
|
|
6627
|
+
y.value && ((Ke = (Ne = s.commands).setBlockAlign) == null || Ke.call(Ne, { id: y.value, align: R }), z.value = null);
|
|
6630
6628
|
}
|
|
6631
6629
|
function $e(R) {
|
|
6632
6630
|
if (o.tableMode || o.cellEditMode) {
|
|
6633
|
-
r("tableVerticalAlign", R),
|
|
6631
|
+
r("tableVerticalAlign", R), z.value = null;
|
|
6634
6632
|
return;
|
|
6635
6633
|
}
|
|
6636
|
-
|
|
6634
|
+
z.value = null;
|
|
6637
6635
|
}
|
|
6638
6636
|
function tt(R) {
|
|
6639
6637
|
var he, Ne, Ke, Pe;
|
|
6640
6638
|
if (r("interacting"), o.tableMode) {
|
|
6641
|
-
r("tableTextColor", R === "default" ? null : R),
|
|
6639
|
+
r("tableTextColor", R === "default" ? null : R), z.value = null;
|
|
6642
6640
|
return;
|
|
6643
6641
|
}
|
|
6644
6642
|
if (o.cellEditMode) {
|
|
@@ -6648,8 +6646,8 @@ const Is = [
|
|
|
6648
6646
|
if (R === "default") {
|
|
6649
6647
|
const w = v.extractContents();
|
|
6650
6648
|
w.querySelectorAll('span[class*="be-color-"]').forEach((x) => {
|
|
6651
|
-
const
|
|
6652
|
-
if (
|
|
6649
|
+
const B = x.className.replace(/be-color-\w+/g, "").trim();
|
|
6650
|
+
if (B) x.className = B;
|
|
6653
6651
|
else {
|
|
6654
6652
|
for (; x.firstChild; ) x.parentNode.insertBefore(x.firstChild, x);
|
|
6655
6653
|
x.parentNode.removeChild(x);
|
|
@@ -6662,7 +6660,7 @@ const Is = [
|
|
|
6662
6660
|
x.selectNodeContents(w), Ee.addRange(x);
|
|
6663
6661
|
}
|
|
6664
6662
|
}
|
|
6665
|
-
|
|
6663
|
+
z.value = null, Je();
|
|
6666
6664
|
return;
|
|
6667
6665
|
}
|
|
6668
6666
|
const b = Et();
|
|
@@ -6678,21 +6676,21 @@ const Is = [
|
|
|
6678
6676
|
return;
|
|
6679
6677
|
}
|
|
6680
6678
|
if (!y.value) return;
|
|
6681
|
-
const
|
|
6682
|
-
|
|
6679
|
+
const L = $t();
|
|
6680
|
+
L && ((Pe = (Ke = s.commands).setInlineMark) == null || Pe.call(Ke, {
|
|
6683
6681
|
id: y.value,
|
|
6684
6682
|
markType: "color",
|
|
6685
6683
|
attrs: R === "default" ? null : { color: R },
|
|
6686
|
-
from:
|
|
6687
|
-
to:
|
|
6684
|
+
from: L.from,
|
|
6685
|
+
to: L.to
|
|
6688
6686
|
}), qe(() => {
|
|
6689
6687
|
var Q;
|
|
6690
|
-
const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v,
|
|
6688
|
+
const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v, B = !!(w && v && v.contains(w.commonAncestorContainer)), q = !!(w && !w.collapsed && B);
|
|
6691
6689
|
if (!x) {
|
|
6692
6690
|
r("close");
|
|
6693
6691
|
return;
|
|
6694
6692
|
}
|
|
6695
|
-
if (!q && !
|
|
6693
|
+
if (!q && !B) {
|
|
6696
6694
|
r("close");
|
|
6697
6695
|
return;
|
|
6698
6696
|
}
|
|
@@ -6702,7 +6700,7 @@ const Is = [
|
|
|
6702
6700
|
function mt(R) {
|
|
6703
6701
|
var he, Ne, Ke, Pe;
|
|
6704
6702
|
if (r("interacting"), o.tableMode) {
|
|
6705
|
-
r("tableBgColor", R === "default" ? null : R),
|
|
6703
|
+
r("tableBgColor", R === "default" ? null : R), z.value = null;
|
|
6706
6704
|
return;
|
|
6707
6705
|
}
|
|
6708
6706
|
if (o.cellEditMode) {
|
|
@@ -6712,8 +6710,8 @@ const Is = [
|
|
|
6712
6710
|
if (R === "default") {
|
|
6713
6711
|
const w = v.extractContents();
|
|
6714
6712
|
w.querySelectorAll('span[class*="be-bg-"]').forEach((x) => {
|
|
6715
|
-
const
|
|
6716
|
-
if (
|
|
6713
|
+
const B = x.className.replace(/be-bg-\w+/g, "").trim();
|
|
6714
|
+
if (B) x.className = B;
|
|
6717
6715
|
else {
|
|
6718
6716
|
for (; x.firstChild; ) x.parentNode.insertBefore(x.firstChild, x);
|
|
6719
6717
|
x.parentNode.removeChild(x);
|
|
@@ -6726,7 +6724,7 @@ const Is = [
|
|
|
6726
6724
|
x.selectNodeContents(w), Ee.addRange(x);
|
|
6727
6725
|
}
|
|
6728
6726
|
}
|
|
6729
|
-
|
|
6727
|
+
z.value = null, Je();
|
|
6730
6728
|
return;
|
|
6731
6729
|
}
|
|
6732
6730
|
const b = Et();
|
|
@@ -6742,21 +6740,21 @@ const Is = [
|
|
|
6742
6740
|
return;
|
|
6743
6741
|
}
|
|
6744
6742
|
if (!y.value) return;
|
|
6745
|
-
const
|
|
6746
|
-
|
|
6743
|
+
const L = $t();
|
|
6744
|
+
L && ((Pe = (Ke = s.commands).setInlineMark) == null || Pe.call(Ke, {
|
|
6747
6745
|
id: y.value,
|
|
6748
6746
|
markType: "bgColor",
|
|
6749
6747
|
attrs: R === "default" ? null : { bgColor: R },
|
|
6750
|
-
from:
|
|
6751
|
-
to:
|
|
6748
|
+
from: L.from,
|
|
6749
|
+
to: L.to
|
|
6752
6750
|
}), qe(() => {
|
|
6753
6751
|
var Q;
|
|
6754
|
-
const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v,
|
|
6752
|
+
const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v, B = !!(w && v && v.contains(w.commonAncestorContainer)), q = !!(w && !w.collapsed && B);
|
|
6755
6753
|
if (!x) {
|
|
6756
6754
|
r("close");
|
|
6757
6755
|
return;
|
|
6758
6756
|
}
|
|
6759
|
-
if (!q && !
|
|
6757
|
+
if (!q && !B) {
|
|
6760
6758
|
r("close");
|
|
6761
6759
|
return;
|
|
6762
6760
|
}
|
|
@@ -6773,7 +6771,7 @@ const Is = [
|
|
|
6773
6771
|
if (v && w && w.rangeCount > 0) {
|
|
6774
6772
|
const x = w.getRangeAt(0);
|
|
6775
6773
|
if (!x.collapsed && v.contains(x.commonAncestorContainer)) {
|
|
6776
|
-
const
|
|
6774
|
+
const B = /* @__PURE__ */ new Set(), q = /* @__PURE__ */ new Set(), Q = [], de = document.createTreeWalker(v, NodeFilter.SHOW_TEXT);
|
|
6777
6775
|
for (; de.nextNode(); ) {
|
|
6778
6776
|
const ge = de.currentNode;
|
|
6779
6777
|
(ge.nodeValue ?? "").length !== 0 && x.intersectsNode(ge) && Q.push(ge);
|
|
@@ -6785,7 +6783,7 @@ const Is = [
|
|
|
6785
6783
|
const ke = Ce.className;
|
|
6786
6784
|
if (typeof ke == "string") {
|
|
6787
6785
|
const Re = ke.match(/be-color-(\w+)/);
|
|
6788
|
-
Re &&
|
|
6786
|
+
Re && B.add(Re[1]);
|
|
6789
6787
|
const Be = ke.match(/be-bg-(\w+)/);
|
|
6790
6788
|
Be && q.add(Be[1]);
|
|
6791
6789
|
}
|
|
@@ -6793,8 +6791,8 @@ const Is = [
|
|
|
6793
6791
|
Ce = Ce.parentNode;
|
|
6794
6792
|
}
|
|
6795
6793
|
}
|
|
6796
|
-
if (
|
|
6797
|
-
ye.value =
|
|
6794
|
+
if (B.size > 0 || q.size > 0) {
|
|
6795
|
+
ye.value = B.size === 1 ? [...B][0] : "", pe.value = q.size === 1 ? [...q][0] : "";
|
|
6798
6796
|
return;
|
|
6799
6797
|
}
|
|
6800
6798
|
}
|
|
@@ -6805,10 +6803,10 @@ const Is = [
|
|
|
6805
6803
|
ye.value = "", pe.value = "";
|
|
6806
6804
|
return;
|
|
6807
6805
|
}
|
|
6808
|
-
const
|
|
6806
|
+
const L = R.selection;
|
|
6809
6807
|
let he, Ne;
|
|
6810
|
-
if (
|
|
6811
|
-
he = Math.min(
|
|
6808
|
+
if (L.kind === "text" && L.anchor.blockId === o.blockId && L.focus.blockId === o.blockId)
|
|
6809
|
+
he = Math.min(L.anchor.offset, L.focus.offset), Ne = Math.max(L.anchor.offset, L.focus.offset);
|
|
6812
6810
|
else {
|
|
6813
6811
|
const v = $t();
|
|
6814
6812
|
he = v ? v.from : 0, Ne = v ? v.to : Fe(b.content).length;
|
|
@@ -6823,8 +6821,8 @@ const Is = [
|
|
|
6823
6821
|
if (v.type !== "text") continue;
|
|
6824
6822
|
const w = Ee, x = Ee + v.text.length;
|
|
6825
6823
|
if (x > he && w < Ne && v.marks)
|
|
6826
|
-
for (const
|
|
6827
|
-
|
|
6824
|
+
for (const B of v.marks)
|
|
6825
|
+
B.type === "color" && B.attrs && typeof B.attrs.color == "string" && Ke.add(B.attrs.color), B.type === "bgColor" && B.attrs && typeof B.attrs.bgColor == "string" && Pe.add(B.attrs.bgColor);
|
|
6828
6826
|
Ee = x;
|
|
6829
6827
|
}
|
|
6830
6828
|
ye.value = Ke.size === 1 ? [...Ke][0] : "", pe.value = Pe.size === 1 ? [...Pe][0] : "";
|
|
@@ -6835,29 +6833,29 @@ const Is = [
|
|
|
6835
6833
|
if (!R) return null;
|
|
6836
6834
|
const b = window.getSelection();
|
|
6837
6835
|
if (!b || b.rangeCount === 0) return null;
|
|
6838
|
-
const
|
|
6839
|
-
if (
|
|
6836
|
+
const L = b.getRangeAt(0);
|
|
6837
|
+
if (L.collapsed || !R.contains(L.commonAncestorContainer)) return null;
|
|
6840
6838
|
const he = document.createRange();
|
|
6841
|
-
he.selectNodeContents(R), he.setEnd(
|
|
6839
|
+
he.selectNodeContents(R), he.setEnd(L.startContainer, L.startOffset);
|
|
6842
6840
|
const Ne = he.toString().length;
|
|
6843
|
-
he.setEnd(
|
|
6841
|
+
he.setEnd(L.endContainer, L.endOffset);
|
|
6844
6842
|
const Ke = he.toString().length;
|
|
6845
6843
|
return { from: Math.min(Ne, Ke), to: Math.max(Ne, Ke) };
|
|
6846
6844
|
}
|
|
6847
6845
|
function Et() {
|
|
6848
6846
|
const R = S.value.selection;
|
|
6849
6847
|
if (R.kind !== "text" || !on(R)) return null;
|
|
6850
|
-
const b = S.value.doc,
|
|
6848
|
+
const b = S.value.doc, L = ao(b), he = L.indexOf(R.anchor.blockId), Ne = L.indexOf(R.focus.blockId);
|
|
6851
6849
|
if (he === -1 || Ne === -1) return null;
|
|
6852
|
-
const [Ke, Pe] = he <= Ne ? [R.anchor, R.focus] : [R.focus, R.anchor], Ee =
|
|
6850
|
+
const [Ke, Pe] = he <= Ne ? [R.anchor, R.focus] : [R.focus, R.anchor], Ee = L.indexOf(Ke.blockId), v = L.indexOf(Pe.blockId);
|
|
6853
6851
|
if (Ee === -1 || v === -1 || Ee > v) return null;
|
|
6854
6852
|
const w = [];
|
|
6855
6853
|
for (let x = Ee; x <= v; x++) {
|
|
6856
|
-
const
|
|
6854
|
+
const B = L[x], q = b.blocks.get(B);
|
|
6857
6855
|
if (!q) continue;
|
|
6858
6856
|
const Q = Fe(q.content).length;
|
|
6859
6857
|
let de = 0, ge = Q;
|
|
6860
|
-
x === Ee && (de = Math.min(Ke.offset, Q)), x === v && (ge = Math.min(Pe.offset, Q)), w.push({ id:
|
|
6858
|
+
x === Ee && (de = Math.min(Ke.offset, Q)), x === v && (ge = Math.min(Pe.offset, Q)), w.push({ id: B, from: de, to: ge });
|
|
6861
6859
|
}
|
|
6862
6860
|
return { ranges: w };
|
|
6863
6861
|
}
|
|
@@ -6866,9 +6864,9 @@ const Is = [
|
|
|
6866
6864
|
if (R.kind !== "text" || !on(R)) return null;
|
|
6867
6865
|
const b = Et();
|
|
6868
6866
|
if (!b) return null;
|
|
6869
|
-
const
|
|
6867
|
+
const L = S.value.doc, he = [], Ne = [];
|
|
6870
6868
|
for (const Ke of b.ranges) {
|
|
6871
|
-
const Pe =
|
|
6869
|
+
const Pe = L.blocks.get(Ke.id);
|
|
6872
6870
|
if (!Pe) continue;
|
|
6873
6871
|
const [, Ee] = pn(Pe.content, Ke.from), [v] = pn(Ee, Ke.to - Ke.from);
|
|
6874
6872
|
he.push(Fe(v)), Ne.push(mo(v));
|
|
@@ -6893,11 +6891,11 @@ const Is = [
|
|
|
6893
6891
|
if (v === "insertHTML") {
|
|
6894
6892
|
const w = window.getSelection();
|
|
6895
6893
|
if (w && w.rangeCount > 0 && !w.isCollapsed) {
|
|
6896
|
-
const x = w.getRangeAt(0),
|
|
6894
|
+
const x = w.getRangeAt(0), B = document.createElement("code");
|
|
6897
6895
|
try {
|
|
6898
|
-
|
|
6896
|
+
B.appendChild(x.extractContents()), x.insertNode(B), w.removeAllRanges();
|
|
6899
6897
|
const q = document.createRange();
|
|
6900
|
-
q.selectNodeContents(
|
|
6898
|
+
q.selectNodeContents(B), w.addRange(q);
|
|
6901
6899
|
} catch {
|
|
6902
6900
|
}
|
|
6903
6901
|
}
|
|
@@ -6917,21 +6915,21 @@ const Is = [
|
|
|
6917
6915
|
return;
|
|
6918
6916
|
}
|
|
6919
6917
|
if (!y.value) return;
|
|
6920
|
-
const
|
|
6921
|
-
|
|
6918
|
+
const L = $t();
|
|
6919
|
+
L && ((Pe = (Ke = s.commands).toggleMark) == null || Pe.call(Ke, {
|
|
6922
6920
|
id: y.value,
|
|
6923
6921
|
markType: R,
|
|
6924
|
-
from:
|
|
6925
|
-
to:
|
|
6922
|
+
from: L.from,
|
|
6923
|
+
to: L.to
|
|
6926
6924
|
}), qe(() => {
|
|
6927
6925
|
var Q;
|
|
6928
6926
|
Oe.value++;
|
|
6929
|
-
const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v,
|
|
6927
|
+
const Ee = window.getSelection(), v = (Q = o.rootEl) == null ? void 0 : Q.querySelector(`[data-block-id="${o.blockId}"]`), w = Ee && Ee.rangeCount > 0 ? Ee.getRangeAt(0) : null, x = !!v, B = !!(w && v && v.contains(w.commonAncestorContainer)), q = !!(w && !w.collapsed && B);
|
|
6930
6928
|
if (!x) {
|
|
6931
6929
|
r("close");
|
|
6932
6930
|
return;
|
|
6933
6931
|
}
|
|
6934
|
-
if (!q && !
|
|
6932
|
+
if (!q && !B) {
|
|
6935
6933
|
r("close");
|
|
6936
6934
|
return;
|
|
6937
6935
|
}
|
|
@@ -6939,7 +6937,7 @@ const Is = [
|
|
|
6939
6937
|
}));
|
|
6940
6938
|
}
|
|
6941
6939
|
function Cn() {
|
|
6942
|
-
if (r("interacting"),
|
|
6940
|
+
if (r("interacting"), z.value = null, o.cellEditMode) {
|
|
6943
6941
|
r("linkClick", y.value ?? "", 0, 0);
|
|
6944
6942
|
return;
|
|
6945
6943
|
}
|
|
@@ -6959,13 +6957,13 @@ const Is = [
|
|
|
6959
6957
|
(he = navigator.clipboard) == null || he.writeText(R.text), r("close");
|
|
6960
6958
|
return;
|
|
6961
6959
|
}
|
|
6962
|
-
const b = window.getSelection(),
|
|
6963
|
-
|
|
6960
|
+
const b = window.getSelection(), L = b ? b.toString() : "";
|
|
6961
|
+
L && ((Ne = navigator.clipboard) == null || Ne.writeText(L)), r("close");
|
|
6964
6962
|
}
|
|
6965
6963
|
t({});
|
|
6966
|
-
async function
|
|
6964
|
+
async function Mn() {
|
|
6967
6965
|
if (o.mobile) {
|
|
6968
|
-
o.visible && it(),
|
|
6966
|
+
o.visible && it(), z.value && Un(), un(), et(), Je();
|
|
6969
6967
|
return;
|
|
6970
6968
|
}
|
|
6971
6969
|
if (o.visible && o.selectionRect && o.rootEl && a.value) {
|
|
@@ -6979,51 +6977,53 @@ const Is = [
|
|
|
6979
6977
|
height: Math.max(R.height, fl)
|
|
6980
6978
|
});
|
|
6981
6979
|
}
|
|
6982
|
-
|
|
6980
|
+
z.value && Un(), un(), et(), Je();
|
|
6983
6981
|
}
|
|
6984
|
-
function
|
|
6985
|
-
if (!
|
|
6986
|
-
const b = [d.value, u.value, h.value, p.value],
|
|
6982
|
+
function xn(R) {
|
|
6983
|
+
if (!z.value) return;
|
|
6984
|
+
const b = [d.value, u.value, h.value, p.value], L = [f.value, m.value, T.value, D.value];
|
|
6987
6985
|
for (const he of b)
|
|
6988
6986
|
if (he && he.contains(R)) return;
|
|
6989
|
-
for (const he of
|
|
6987
|
+
for (const he of L)
|
|
6990
6988
|
if (he && he.contains(R)) return;
|
|
6991
|
-
|
|
6989
|
+
z.value = null;
|
|
6992
6990
|
}
|
|
6993
6991
|
function Kn(R) {
|
|
6994
6992
|
if (!o.visible) return;
|
|
6995
6993
|
const b = a.value;
|
|
6996
6994
|
if (b && b.contains(R.target)) {
|
|
6997
|
-
R.preventDefault();
|
|
6995
|
+
R.preventDefault(), z.value && xn(R.target);
|
|
6998
6996
|
return;
|
|
6999
6997
|
}
|
|
7000
|
-
|
|
6998
|
+
xn(R.target);
|
|
7001
6999
|
}
|
|
7002
|
-
function
|
|
7000
|
+
function _n(R) {
|
|
7003
7001
|
if (!o.visible || !R.touches[0]) return;
|
|
7004
|
-
const
|
|
7005
|
-
if (he && he.contains(
|
|
7002
|
+
const L = R.target, he = a.value;
|
|
7003
|
+
if (he && he.contains(L)) {
|
|
7006
7004
|
const Ne = le.value;
|
|
7007
|
-
if (Ne && Ne.contains(
|
|
7005
|
+
if (Ne && Ne.contains(L)) {
|
|
7006
|
+
z.value && xn(L);
|
|
7008
7007
|
return;
|
|
7009
|
-
|
|
7008
|
+
}
|
|
7009
|
+
R.preventDefault(), z.value && xn(L);
|
|
7010
7010
|
return;
|
|
7011
7011
|
}
|
|
7012
|
-
|
|
7012
|
+
xn(L);
|
|
7013
7013
|
}
|
|
7014
7014
|
Tt(() => o.visible, (R) => {
|
|
7015
7015
|
R && qe(() => {
|
|
7016
7016
|
et(), Je();
|
|
7017
7017
|
});
|
|
7018
7018
|
}), oo(() => {
|
|
7019
|
-
window.addEventListener("scroll",
|
|
7019
|
+
window.addEventListener("scroll", Mn, !0), window.addEventListener("resize", Mn), window.addEventListener("mousedown", Kn, !0), window.addEventListener("touchstart", _n, !0), document.addEventListener("selectionchange", po), I = s.subscribe(() => {
|
|
7020
7020
|
qe(() => {
|
|
7021
7021
|
const R = s.getState();
|
|
7022
7022
|
S.value = R, Oe.value++, et(), Je();
|
|
7023
7023
|
});
|
|
7024
7024
|
});
|
|
7025
|
-
}),
|
|
7026
|
-
window.removeEventListener("scroll",
|
|
7025
|
+
}), Bn(() => {
|
|
7026
|
+
window.removeEventListener("scroll", Mn, !0), window.removeEventListener("resize", Mn), window.removeEventListener("mousedown", Kn, !0), window.removeEventListener("touchstart", _n, !0), document.removeEventListener("selectionchange", po), I == null || I(), I = null;
|
|
7027
7027
|
});
|
|
7028
7028
|
function po() {
|
|
7029
7029
|
o.visible && Wn === null && (Wn = requestAnimationFrame(() => {
|
|
@@ -7031,7 +7031,7 @@ const Is = [
|
|
|
7031
7031
|
}));
|
|
7032
7032
|
}
|
|
7033
7033
|
let Wn = null;
|
|
7034
|
-
return (R, b) => (Z(), mn(
|
|
7034
|
+
return (R, b) => (Z(), mn(Pn, {
|
|
7035
7035
|
to: "body",
|
|
7036
7036
|
disabled: e.mobile
|
|
7037
7037
|
}, [
|
|
@@ -7059,10 +7059,10 @@ const Is = [
|
|
|
7059
7059
|
class: ze(["ht-nav-btn ht-nav-left", { disabled: !A.value }]),
|
|
7060
7060
|
title: fe(l)("ui.scrollLeft"),
|
|
7061
7061
|
"aria-label": fe(l)("ui.scrollLeft"),
|
|
7062
|
-
onMousedown: b[0] || (b[0] = ie((
|
|
7062
|
+
onMousedown: b[0] || (b[0] = ie((L) => sn(-1), ["prevent", "stop"])),
|
|
7063
7063
|
onTouchstart: b[1] || (b[1] = ie(() => {
|
|
7064
7064
|
}, ["stop"])),
|
|
7065
|
-
onTouchend: b[2] || (b[2] = ie((
|
|
7065
|
+
onTouchend: b[2] || (b[2] = ie((L) => dt(-1, L), ["stop"])),
|
|
7066
7066
|
onClick: b[3] || (b[3] = ie(() => {
|
|
7067
7067
|
}, ["prevent", "stop"]))
|
|
7068
7068
|
}, [...b[39] || (b[39] = [
|
|
@@ -7085,7 +7085,7 @@ const Is = [
|
|
|
7085
7085
|
C("div", {
|
|
7086
7086
|
ref_key: "htContentEl",
|
|
7087
7087
|
ref: le,
|
|
7088
|
-
class: ze(["ht-content", { "dropdown-open": !e.mobile && !!
|
|
7088
|
+
class: ze(["ht-content", { "dropdown-open": !e.mobile && !!z.value }]),
|
|
7089
7089
|
onScroll: He,
|
|
7090
7090
|
onTouchmovePassive: _e,
|
|
7091
7091
|
onTouchend: ie(Se, ["stop"])
|
|
@@ -7094,14 +7094,14 @@ const Is = [
|
|
|
7094
7094
|
C("button", {
|
|
7095
7095
|
ref_key: "typeBtnEl",
|
|
7096
7096
|
ref: f,
|
|
7097
|
-
class: ze(["ht-btn ht-type-btn", { open:
|
|
7097
|
+
class: ze(["ht-btn ht-type-btn", { open: z.value === "type", disabled: ln.value }]),
|
|
7098
7098
|
title: fe(l)("hoverToolbar.typeBtnTitle"),
|
|
7099
7099
|
disabled: ln.value,
|
|
7100
|
-
onMousedown: b[4] || (b[4] = ie((
|
|
7101
|
-
onTouchstart: b[5] || (b[5] = ie((
|
|
7100
|
+
onMousedown: b[4] || (b[4] = ie((L) => !ln.value && Ye("type"), ["prevent", "stop"])),
|
|
7101
|
+
onTouchstart: b[5] || (b[5] = ie((L) => {
|
|
7102
7102
|
ht(() => {
|
|
7103
7103
|
ln.value || Ye("type");
|
|
7104
|
-
},
|
|
7104
|
+
}, L);
|
|
7105
7105
|
}, ["stop"])),
|
|
7106
7106
|
onClick: b[6] || (b[6] = ie(() => {
|
|
7107
7107
|
}, ["prevent", "stop"]))
|
|
@@ -7124,11 +7124,11 @@ const Is = [
|
|
|
7124
7124
|
})
|
|
7125
7125
|
], -1))
|
|
7126
7126
|
], 42, Mf),
|
|
7127
|
-
(Z(), mn(
|
|
7127
|
+
(Z(), mn(Pn, {
|
|
7128
7128
|
to: "body",
|
|
7129
7129
|
disabled: !e.mobile
|
|
7130
7130
|
}, [
|
|
7131
|
-
|
|
7131
|
+
z.value === "type" ? (Z(), te("div", {
|
|
7132
7132
|
key: 0,
|
|
7133
7133
|
ref_key: "typeDropdownEl",
|
|
7134
7134
|
ref: d,
|
|
@@ -7140,7 +7140,7 @@ const Is = [
|
|
|
7140
7140
|
class: "menu-scroll-btn menu-scroll-up",
|
|
7141
7141
|
type: "button",
|
|
7142
7142
|
"aria-label": fe(l)("ui.scrollUp"),
|
|
7143
|
-
onMousedown: ie(
|
|
7143
|
+
onMousedown: ie(Dn, ["prevent"])
|
|
7144
7144
|
}, [...b[41] || (b[41] = [
|
|
7145
7145
|
C("svg", {
|
|
7146
7146
|
viewBox: "0 0 12 12",
|
|
@@ -7164,17 +7164,17 @@ const Is = [
|
|
|
7164
7164
|
class: "ht-dropdown-scroll",
|
|
7165
7165
|
onScroll: un
|
|
7166
7166
|
}, [
|
|
7167
|
-
(Z(!0), te(rt, null, bn(Bt.value, (
|
|
7168
|
-
key:
|
|
7169
|
-
class: ze(["ht-dropdown-item", { active:
|
|
7170
|
-
onMousedown: ie((he) =>
|
|
7167
|
+
(Z(!0), te(rt, null, bn(Bt.value, (L) => (Z(), te("button", {
|
|
7168
|
+
key: L.id,
|
|
7169
|
+
class: ze(["ht-dropdown-item", { active: L.active }]),
|
|
7170
|
+
onMousedown: ie((he) => zn(L), ["prevent", "stop"])
|
|
7171
7171
|
}, [
|
|
7172
|
-
gn(
|
|
7172
|
+
gn(In, {
|
|
7173
7173
|
class: "ht-dropdown-icon",
|
|
7174
|
-
html:
|
|
7174
|
+
html: L.iconHtml
|
|
7175
7175
|
}, null, 8, ["html"]),
|
|
7176
|
-
C("span", null, Rt(
|
|
7177
|
-
|
|
7176
|
+
C("span", null, Rt(L.label), 1),
|
|
7177
|
+
L.active ? (Z(), te("svg", Nf, [...b[42] || (b[42] = [
|
|
7178
7178
|
C("path", {
|
|
7179
7179
|
d: "M2.5 6L5 8.5L9.5 4",
|
|
7180
7180
|
stroke: "currentColor",
|
|
@@ -7191,7 +7191,7 @@ const Is = [
|
|
|
7191
7191
|
class: "menu-scroll-btn menu-scroll-down",
|
|
7192
7192
|
type: "button",
|
|
7193
7193
|
"aria-label": fe(l)("ui.scrollDown"),
|
|
7194
|
-
onMousedown: ie(
|
|
7194
|
+
onMousedown: ie(Fn, ["prevent"])
|
|
7195
7195
|
}, [...b[43] || (b[43] = [
|
|
7196
7196
|
C("svg", {
|
|
7197
7197
|
viewBox: "0 0 12 12",
|
|
@@ -7216,14 +7216,14 @@ const Is = [
|
|
|
7216
7216
|
C("button", {
|
|
7217
7217
|
ref_key: "alignBtnEl",
|
|
7218
7218
|
ref: m,
|
|
7219
|
-
class: ze(["ht-btn ht-icon-only", { open:
|
|
7219
|
+
class: ze(["ht-btn ht-icon-only", { open: z.value === "align", disabled: Vt.value }]),
|
|
7220
7220
|
title: fe(l)("hoverToolbar.alignBtnTitle"),
|
|
7221
7221
|
disabled: Vt.value,
|
|
7222
|
-
onMousedown: b[7] || (b[7] = ie((
|
|
7223
|
-
onTouchstart: b[8] || (b[8] = ie((
|
|
7222
|
+
onMousedown: b[7] || (b[7] = ie((L) => !Vt.value && Ye("align"), ["prevent", "stop"])),
|
|
7223
|
+
onTouchstart: b[8] || (b[8] = ie((L) => {
|
|
7224
7224
|
ht(() => {
|
|
7225
7225
|
Vt.value || Ye("align");
|
|
7226
|
-
},
|
|
7226
|
+
}, L);
|
|
7227
7227
|
}, ["stop"])),
|
|
7228
7228
|
onClick: b[9] || (b[9] = ie(() => {
|
|
7229
7229
|
}, ["prevent", "stop"]))
|
|
@@ -7344,11 +7344,11 @@ const Is = [
|
|
|
7344
7344
|
], 64))
|
|
7345
7345
|
]))
|
|
7346
7346
|
], 42, Bf),
|
|
7347
|
-
(Z(), mn(
|
|
7347
|
+
(Z(), mn(Pn, {
|
|
7348
7348
|
to: "body",
|
|
7349
7349
|
disabled: !e.mobile
|
|
7350
7350
|
}, [
|
|
7351
|
-
|
|
7351
|
+
z.value === "align" ? (Z(), te("div", {
|
|
7352
7352
|
key: 0,
|
|
7353
7353
|
ref_key: "alignDropdownEl",
|
|
7354
7354
|
ref: u,
|
|
@@ -7360,7 +7360,7 @@ const Is = [
|
|
|
7360
7360
|
class: "menu-scroll-btn menu-scroll-up",
|
|
7361
7361
|
type: "button",
|
|
7362
7362
|
"aria-label": fe(l)("ui.scrollUp"),
|
|
7363
|
-
onMousedown: ie(
|
|
7363
|
+
onMousedown: ie(Dn, ["prevent"])
|
|
7364
7364
|
}, [...b[56] || (b[56] = [
|
|
7365
7365
|
C("svg", {
|
|
7366
7366
|
viewBox: "0 0 12 12",
|
|
@@ -7384,13 +7384,13 @@ const Is = [
|
|
|
7384
7384
|
class: "ht-dropdown-scroll",
|
|
7385
7385
|
onScroll: un
|
|
7386
7386
|
}, [
|
|
7387
|
-
(Z(!0), te(rt, null, bn(Ze.value, (
|
|
7388
|
-
key:
|
|
7389
|
-
class: ze(["ht-dropdown-item ht-align-item", { active: me.value ===
|
|
7390
|
-
onMousedown: ie((he) => Le(
|
|
7387
|
+
(Z(!0), te(rt, null, bn(Ze.value, (L) => (Z(), te("button", {
|
|
7388
|
+
key: L.id,
|
|
7389
|
+
class: ze(["ht-dropdown-item ht-align-item", { active: me.value === L.value }]),
|
|
7390
|
+
onMousedown: ie((he) => Le(L.value), ["prevent", "stop"])
|
|
7391
7391
|
}, [
|
|
7392
7392
|
(Z(), te("svg", Pf, [
|
|
7393
|
-
|
|
7393
|
+
L.value === "left" ? (Z(), te(rt, { key: 0 }, [
|
|
7394
7394
|
b[57] || (b[57] = C("line", {
|
|
7395
7395
|
x1: "2",
|
|
7396
7396
|
y1: "4",
|
|
@@ -7418,7 +7418,7 @@ const Is = [
|
|
|
7418
7418
|
"stroke-width": "1.3",
|
|
7419
7419
|
"stroke-linecap": "round"
|
|
7420
7420
|
}, null, -1))
|
|
7421
|
-
], 64)) :
|
|
7421
|
+
], 64)) : L.value === "center" ? (Z(), te(rt, { key: 1 }, [
|
|
7422
7422
|
b[60] || (b[60] = C("line", {
|
|
7423
7423
|
x1: "2",
|
|
7424
7424
|
y1: "4",
|
|
@@ -7446,7 +7446,7 @@ const Is = [
|
|
|
7446
7446
|
"stroke-width": "1.3",
|
|
7447
7447
|
"stroke-linecap": "round"
|
|
7448
7448
|
}, null, -1))
|
|
7449
|
-
], 64)) :
|
|
7449
|
+
], 64)) : L.value === "right" ? (Z(), te(rt, { key: 2 }, [
|
|
7450
7450
|
b[63] || (b[63] = C("line", {
|
|
7451
7451
|
x1: "2",
|
|
7452
7452
|
y1: "4",
|
|
@@ -7504,8 +7504,8 @@ const Is = [
|
|
|
7504
7504
|
}, null, -1))
|
|
7505
7505
|
], 64))
|
|
7506
7506
|
])),
|
|
7507
|
-
C("span", null, Rt(
|
|
7508
|
-
me.value ===
|
|
7507
|
+
C("span", null, Rt(L.label), 1),
|
|
7508
|
+
me.value === L.value ? (Z(), te("svg", Hf, [...b[69] || (b[69] = [
|
|
7509
7509
|
C("path", {
|
|
7510
7510
|
d: "M2.5 6L5 8.5L9.5 4",
|
|
7511
7511
|
stroke: "currentColor",
|
|
@@ -7522,7 +7522,7 @@ const Is = [
|
|
|
7522
7522
|
class: "menu-scroll-btn menu-scroll-down",
|
|
7523
7523
|
type: "button",
|
|
7524
7524
|
"aria-label": fe(l)("ui.scrollDown"),
|
|
7525
|
-
onMousedown: ie(
|
|
7525
|
+
onMousedown: ie(Fn, ["prevent"])
|
|
7526
7526
|
}, [...b[70] || (b[70] = [
|
|
7527
7527
|
C("svg", {
|
|
7528
7528
|
viewBox: "0 0 12 12",
|
|
@@ -7547,14 +7547,14 @@ const Is = [
|
|
|
7547
7547
|
C("button", {
|
|
7548
7548
|
ref_key: "verticalAlignBtnEl",
|
|
7549
7549
|
ref: T,
|
|
7550
|
-
class: ze(["ht-btn ht-icon-only", { open:
|
|
7550
|
+
class: ze(["ht-btn ht-icon-only", { open: z.value === "verticalAlign", disabled: Vt.value }]),
|
|
7551
7551
|
title: fe(l)("hoverToolbar.verticalAlignBtnTitle"),
|
|
7552
7552
|
disabled: Vt.value,
|
|
7553
|
-
onMousedown: b[10] || (b[10] = ie((
|
|
7554
|
-
onTouchstart: b[11] || (b[11] = ie((
|
|
7553
|
+
onMousedown: b[10] || (b[10] = ie((L) => !Vt.value && Ye("verticalAlign"), ["prevent", "stop"])),
|
|
7554
|
+
onTouchstart: b[11] || (b[11] = ie((L) => {
|
|
7555
7555
|
ht(() => {
|
|
7556
7556
|
Vt.value || Ye("verticalAlign");
|
|
7557
|
-
},
|
|
7557
|
+
}, L);
|
|
7558
7558
|
}, ["stop"])),
|
|
7559
7559
|
onClick: b[12] || (b[12] = ie(() => {
|
|
7560
7560
|
}, ["prevent", "stop"]))
|
|
@@ -7647,11 +7647,11 @@ const Is = [
|
|
|
7647
7647
|
], 64))
|
|
7648
7648
|
]))
|
|
7649
7649
|
], 42, zf),
|
|
7650
|
-
(Z(), mn(
|
|
7650
|
+
(Z(), mn(Pn, {
|
|
7651
7651
|
to: "body",
|
|
7652
7652
|
disabled: !e.mobile
|
|
7653
7653
|
}, [
|
|
7654
|
-
|
|
7654
|
+
z.value === "verticalAlign" ? (Z(), te("div", {
|
|
7655
7655
|
key: 0,
|
|
7656
7656
|
ref_key: "verticalAlignDropdownEl",
|
|
7657
7657
|
ref: h,
|
|
@@ -7663,7 +7663,7 @@ const Is = [
|
|
|
7663
7663
|
class: "menu-scroll-btn menu-scroll-up",
|
|
7664
7664
|
type: "button",
|
|
7665
7665
|
"aria-label": fe(l)("ui.scrollUp"),
|
|
7666
|
-
onMousedown: ie(
|
|
7666
|
+
onMousedown: ie(Dn, ["prevent"])
|
|
7667
7667
|
}, [...b[80] || (b[80] = [
|
|
7668
7668
|
C("svg", {
|
|
7669
7669
|
viewBox: "0 0 12 12",
|
|
@@ -7687,13 +7687,13 @@ const Is = [
|
|
|
7687
7687
|
class: "ht-dropdown-scroll",
|
|
7688
7688
|
onScroll: un
|
|
7689
7689
|
}, [
|
|
7690
|
-
(Z(!0), te(rt, null, bn(Ot.value, (
|
|
7691
|
-
key:
|
|
7692
|
-
class: ze(["ht-dropdown-item ht-align-item", { active: ae.value ===
|
|
7693
|
-
onMousedown: ie((he) => $e(
|
|
7690
|
+
(Z(!0), te(rt, null, bn(Ot.value, (L) => (Z(), te("button", {
|
|
7691
|
+
key: L.id,
|
|
7692
|
+
class: ze(["ht-dropdown-item ht-align-item", { active: ae.value === L.value }]),
|
|
7693
|
+
onMousedown: ie((he) => $e(L.value), ["prevent", "stop"])
|
|
7694
7694
|
}, [
|
|
7695
7695
|
(Z(), te("svg", Gf, [
|
|
7696
|
-
|
|
7696
|
+
L.value === "top" ? (Z(), te(rt, { key: 0 }, [
|
|
7697
7697
|
b[81] || (b[81] = C("line", {
|
|
7698
7698
|
x1: "2",
|
|
7699
7699
|
y1: "3",
|
|
@@ -7721,7 +7721,7 @@ const Is = [
|
|
|
7721
7721
|
"stroke-width": "1.3",
|
|
7722
7722
|
"stroke-linecap": "round"
|
|
7723
7723
|
}, null, -1))
|
|
7724
|
-
], 64)) :
|
|
7724
|
+
], 64)) : L.value === "bottom" ? (Z(), te(rt, { key: 1 }, [
|
|
7725
7725
|
b[84] || (b[84] = C("line", {
|
|
7726
7726
|
x1: "5",
|
|
7727
7727
|
y1: "5",
|
|
@@ -7779,8 +7779,8 @@ const Is = [
|
|
|
7779
7779
|
}, null, -1))
|
|
7780
7780
|
], 64))
|
|
7781
7781
|
])),
|
|
7782
|
-
C("span", null, Rt(
|
|
7783
|
-
ae.value ===
|
|
7782
|
+
C("span", null, Rt(L.label), 1),
|
|
7783
|
+
ae.value === L.value ? (Z(), te("svg", qf, [...b[90] || (b[90] = [
|
|
7784
7784
|
C("path", {
|
|
7785
7785
|
d: "M2.5 6L5 8.5L9.5 4",
|
|
7786
7786
|
stroke: "currentColor",
|
|
@@ -7797,7 +7797,7 @@ const Is = [
|
|
|
7797
7797
|
class: "menu-scroll-btn menu-scroll-down",
|
|
7798
7798
|
type: "button",
|
|
7799
7799
|
"aria-label": fe(l)("ui.scrollDown"),
|
|
7800
|
-
onMousedown: ie(
|
|
7800
|
+
onMousedown: ie(Fn, ["prevent"])
|
|
7801
7801
|
}, [...b[91] || (b[91] = [
|
|
7802
7802
|
C("svg", {
|
|
7803
7803
|
viewBox: "0 0 12 12",
|
|
@@ -7819,22 +7819,22 @@ const Is = [
|
|
|
7819
7819
|
], 8, ["disabled"]))
|
|
7820
7820
|
])) : De("", !0),
|
|
7821
7821
|
b[100] || (b[100] = C("div", { class: "ht-sep" }, null, -1)),
|
|
7822
|
-
(Z(!0), te(rt, null, bn(At.value, (
|
|
7823
|
-
key:
|
|
7824
|
-
class: ze(["ht-btn ht-icon-only", { active: ue.value.has(
|
|
7825
|
-
title:
|
|
7826
|
-
disabled: ut(
|
|
7827
|
-
onMousedown: ie((he) => !ut(
|
|
7822
|
+
(Z(!0), te(rt, null, bn(At.value, (L) => (Z(), te("button", {
|
|
7823
|
+
key: L.id,
|
|
7824
|
+
class: ze(["ht-btn ht-icon-only", { active: ue.value.has(L.id), disabled: ut(L.id) }]),
|
|
7825
|
+
title: L.title,
|
|
7826
|
+
disabled: ut(L.id),
|
|
7827
|
+
onMousedown: ie((he) => !ut(L.id) && zt(L.id), ["prevent", "stop"]),
|
|
7828
7828
|
onTouchstart: ie((he) => {
|
|
7829
7829
|
ht(() => {
|
|
7830
|
-
ut(
|
|
7830
|
+
ut(L.id) || zt(L.id);
|
|
7831
7831
|
}, he);
|
|
7832
7832
|
}, ["stop"]),
|
|
7833
7833
|
onClick: b[13] || (b[13] = ie(() => {
|
|
7834
7834
|
}, ["prevent", "stop"]))
|
|
7835
7835
|
}, [
|
|
7836
|
-
gn(
|
|
7837
|
-
html:
|
|
7836
|
+
gn(In, {
|
|
7837
|
+
html: L.iconHtml
|
|
7838
7838
|
}, null, 8, ["html"])
|
|
7839
7839
|
], 42, Zf))), 128)),
|
|
7840
7840
|
e.tableMode ? De("", !0) : (Z(), te("button", {
|
|
@@ -7842,11 +7842,11 @@ const Is = [
|
|
|
7842
7842
|
class: ze(["ht-btn ht-icon-only", { active: ue.value.has("link"), disabled: ut("link") }]),
|
|
7843
7843
|
title: fe(l)("hoverToolbar.linkBtnTitle"),
|
|
7844
7844
|
disabled: ut("link"),
|
|
7845
|
-
onMousedown: b[14] || (b[14] = ie((
|
|
7846
|
-
onTouchstart: b[15] || (b[15] = ie((
|
|
7845
|
+
onMousedown: b[14] || (b[14] = ie((L) => !ut("link") && Cn(), ["prevent", "stop"])),
|
|
7846
|
+
onTouchstart: b[15] || (b[15] = ie((L) => {
|
|
7847
7847
|
ht(() => {
|
|
7848
7848
|
ut("link") || Cn();
|
|
7849
|
-
},
|
|
7849
|
+
}, L);
|
|
7850
7850
|
}, ["stop"])),
|
|
7851
7851
|
onClick: b[16] || (b[16] = ie(() => {
|
|
7852
7852
|
}, ["prevent", "stop"]))
|
|
@@ -7868,14 +7868,14 @@ const Is = [
|
|
|
7868
7868
|
C("button", {
|
|
7869
7869
|
ref_key: "colorBtnEl",
|
|
7870
7870
|
ref: D,
|
|
7871
|
-
class: ze(["ht-btn ht-icon-only", { open:
|
|
7871
|
+
class: ze(["ht-btn ht-icon-only", { open: z.value === "color", disabled: ut("color") }]),
|
|
7872
7872
|
title: fe(l)("hoverToolbar.colorBtnTitle"),
|
|
7873
7873
|
disabled: ut("color"),
|
|
7874
|
-
onMousedown: b[17] || (b[17] = ie((
|
|
7875
|
-
onTouchstart: b[18] || (b[18] = ie((
|
|
7874
|
+
onMousedown: b[17] || (b[17] = ie((L) => !ut("color") && Ye("color"), ["prevent", "stop"])),
|
|
7875
|
+
onTouchstart: b[18] || (b[18] = ie((L) => {
|
|
7876
7876
|
ht(() => {
|
|
7877
7877
|
ut("color") || Ye("color");
|
|
7878
|
-
},
|
|
7878
|
+
}, L);
|
|
7879
7879
|
}, ["stop"])),
|
|
7880
7880
|
onClick: b[19] || (b[19] = ie(() => {
|
|
7881
7881
|
}, ["prevent", "stop"]))
|
|
@@ -7892,11 +7892,11 @@ const Is = [
|
|
|
7892
7892
|
})
|
|
7893
7893
|
], -1)
|
|
7894
7894
|
])], 42, Qf),
|
|
7895
|
-
(Z(), mn(
|
|
7895
|
+
(Z(), mn(Pn, {
|
|
7896
7896
|
to: "body",
|
|
7897
7897
|
disabled: !e.mobile
|
|
7898
7898
|
}, [
|
|
7899
|
-
|
|
7899
|
+
z.value === "color" ? (Z(), te("div", {
|
|
7900
7900
|
key: 0,
|
|
7901
7901
|
ref_key: "colorDropdownEl",
|
|
7902
7902
|
ref: p,
|
|
@@ -7908,7 +7908,7 @@ const Is = [
|
|
|
7908
7908
|
class: "menu-scroll-btn menu-scroll-up",
|
|
7909
7909
|
type: "button",
|
|
7910
7910
|
"aria-label": fe(l)("ui.scrollUp"),
|
|
7911
|
-
onMousedown: ie(
|
|
7911
|
+
onMousedown: ie(Dn, ["prevent"])
|
|
7912
7912
|
}, [...b[94] || (b[94] = [
|
|
7913
7913
|
C("svg", {
|
|
7914
7914
|
viewBox: "0 0 12 12",
|
|
@@ -7935,27 +7935,27 @@ const Is = [
|
|
|
7935
7935
|
C("div", ep, [
|
|
7936
7936
|
C("div", tp, Rt(fe(l)("hoverToolbar.textColor")), 1),
|
|
7937
7937
|
C("div", np, [
|
|
7938
|
-
(Z(!0), te(rt, null, bn(fe(be), (
|
|
7939
|
-
key: "tc-" +
|
|
7940
|
-
class: ze(["ht-swatch", { active: ye.value ===
|
|
7941
|
-
title: fe(l)(
|
|
7942
|
-
style: rn({ backgroundColor:
|
|
7943
|
-
onMousedown: ie((he) => tt(
|
|
7938
|
+
(Z(!0), te(rt, null, bn(fe(be), (L) => (Z(), te("button", {
|
|
7939
|
+
key: "tc-" + L.key,
|
|
7940
|
+
class: ze(["ht-swatch", { active: ye.value === L.key }]),
|
|
7941
|
+
title: fe(l)(L.key === "default" ? "color.default" : "color." + L.key),
|
|
7942
|
+
style: rn({ backgroundColor: L.displayCssValue ?? L.cssValue }),
|
|
7943
|
+
onMousedown: ie((he) => tt(L.key), ["prevent", "stop"])
|
|
7944
7944
|
}, null, 46, op))), 128))
|
|
7945
7945
|
])
|
|
7946
7946
|
]),
|
|
7947
7947
|
C("div", rp, [
|
|
7948
7948
|
C("div", lp, Rt(fe(l)("hoverToolbar.bgColor")), 1),
|
|
7949
7949
|
C("div", ip, [
|
|
7950
|
-
(Z(!0), te(rt, null, bn(fe(Dt), (
|
|
7951
|
-
key: "bc-" +
|
|
7950
|
+
(Z(!0), te(rt, null, bn(fe(Dt), (L) => (Z(), te("button", {
|
|
7951
|
+
key: "bc-" + L.key,
|
|
7952
7952
|
class: ze(["ht-swatch", [
|
|
7953
|
-
{ active: pe.value ===
|
|
7954
|
-
|
|
7953
|
+
{ active: pe.value === L.key },
|
|
7954
|
+
L.key === "default" ? "ht-swatch--none" : ""
|
|
7955
7955
|
]]),
|
|
7956
|
-
title: fe(l)(
|
|
7957
|
-
style: rn({ backgroundColor:
|
|
7958
|
-
onMousedown: ie((he) => mt(
|
|
7956
|
+
title: fe(l)(L.key === "default" ? "color.none" : "color." + L.key),
|
|
7957
|
+
style: rn({ backgroundColor: L.displayCssValue ?? L.cssValue }),
|
|
7958
|
+
onMousedown: ie((he) => mt(L.key), ["prevent", "stop"])
|
|
7959
7959
|
}, null, 46, sp))), 128))
|
|
7960
7960
|
])
|
|
7961
7961
|
])
|
|
@@ -7965,7 +7965,7 @@ const Is = [
|
|
|
7965
7965
|
class: "menu-scroll-btn menu-scroll-down",
|
|
7966
7966
|
type: "button",
|
|
7967
7967
|
"aria-label": fe(l)("ui.scrollDown"),
|
|
7968
|
-
onMousedown: ie(
|
|
7968
|
+
onMousedown: ie(Fn, ["prevent"])
|
|
7969
7969
|
}, [...b[95] || (b[95] = [
|
|
7970
7970
|
C("svg", {
|
|
7971
7971
|
viewBox: "0 0 12 12",
|
|
@@ -7992,11 +7992,11 @@ const Is = [
|
|
|
7992
7992
|
title: fe(l)("hoverToolbar.copySelection"),
|
|
7993
7993
|
"aria-label": fe(l)("hoverToolbar.copySelection"),
|
|
7994
7994
|
disabled: Ht.value,
|
|
7995
|
-
onMousedown: b[20] || (b[20] = ie((
|
|
7996
|
-
onTouchstart: b[21] || (b[21] = ie((
|
|
7995
|
+
onMousedown: b[20] || (b[20] = ie((L) => !Ht.value && Gt(), ["prevent", "stop"])),
|
|
7996
|
+
onTouchstart: b[21] || (b[21] = ie((L) => {
|
|
7997
7997
|
ht(() => {
|
|
7998
7998
|
Ht.value || Gt();
|
|
7999
|
-
},
|
|
7999
|
+
}, L);
|
|
8000
8000
|
}, ["stop"])),
|
|
8001
8001
|
onClick: b[22] || (b[22] = ie(() => {
|
|
8002
8002
|
}, ["prevent", "stop"]))
|
|
@@ -8032,8 +8032,8 @@ const Is = [
|
|
|
8032
8032
|
key: 1,
|
|
8033
8033
|
class: "ht-btn ht-icon-only",
|
|
8034
8034
|
title: fe(l)("table.mergeCells"),
|
|
8035
|
-
onMousedown: b[23] || (b[23] = ie((
|
|
8036
|
-
onTouchstart: b[24] || (b[24] = ie((
|
|
8035
|
+
onMousedown: b[23] || (b[23] = ie((L) => r("merge"), ["prevent", "stop"])),
|
|
8036
|
+
onTouchstart: b[24] || (b[24] = ie((L) => ht(() => r("merge"), L), ["stop"])),
|
|
8037
8037
|
onClick: b[25] || (b[25] = ie(() => {
|
|
8038
8038
|
}, ["prevent", "stop"]))
|
|
8039
8039
|
}, [...b[97] || (b[97] = [
|
|
@@ -8051,8 +8051,8 @@ const Is = [
|
|
|
8051
8051
|
key: 2,
|
|
8052
8052
|
class: "ht-btn ht-icon-only",
|
|
8053
8053
|
title: fe(l)("table.splitCell"),
|
|
8054
|
-
onMousedown: b[26] || (b[26] = ie((
|
|
8055
|
-
onTouchstart: b[27] || (b[27] = ie((
|
|
8054
|
+
onMousedown: b[26] || (b[26] = ie((L) => r("split"), ["prevent", "stop"])),
|
|
8055
|
+
onTouchstart: b[27] || (b[27] = ie((L) => ht(() => r("split"), L), ["stop"])),
|
|
8056
8056
|
onClick: b[28] || (b[28] = ie(() => {
|
|
8057
8057
|
}, ["prevent", "stop"]))
|
|
8058
8058
|
}, [...b[98] || (b[98] = [
|
|
@@ -8071,8 +8071,8 @@ const Is = [
|
|
|
8071
8071
|
key: 3,
|
|
8072
8072
|
class: ze(["ht-btn ht-icon-only", { active: e.headerRowActive }]),
|
|
8073
8073
|
title: fe(l)("table.toggleHeader"),
|
|
8074
|
-
onMousedown: b[29] || (b[29] = ie((
|
|
8075
|
-
onTouchstart: b[30] || (b[30] = ie((
|
|
8074
|
+
onMousedown: b[29] || (b[29] = ie((L) => r("tableHeaderRow"), ["prevent", "stop"])),
|
|
8075
|
+
onTouchstart: b[30] || (b[30] = ie((L) => ht(() => r("tableHeaderRow"), L), ["stop"])),
|
|
8076
8076
|
onClick: b[31] || (b[31] = ie(() => {
|
|
8077
8077
|
}, ["prevent", "stop"]))
|
|
8078
8078
|
}, [...b[99] || (b[99] = [
|
|
@@ -8103,12 +8103,12 @@ const Is = [
|
|
|
8103
8103
|
C("button", {
|
|
8104
8104
|
class: "ht-btn ht-danger ht-icon-only",
|
|
8105
8105
|
title: e.deleteLabel || fe(l)("hoverToolbar.deleteBlock"),
|
|
8106
|
-
onMousedown: b[32] || (b[32] = ie((
|
|
8107
|
-
onTouchstart: b[33] || (b[33] = ie((
|
|
8106
|
+
onMousedown: b[32] || (b[32] = ie((L) => r("delete"), ["prevent", "stop"])),
|
|
8107
|
+
onTouchstart: b[33] || (b[33] = ie((L) => ht(() => r("delete"), L), ["stop"])),
|
|
8108
8108
|
onClick: b[34] || (b[34] = ie(() => {
|
|
8109
8109
|
}, ["prevent", "stop"]))
|
|
8110
8110
|
}, [
|
|
8111
|
-
gn(
|
|
8111
|
+
gn(In, {
|
|
8112
8112
|
html: e.deleteIcon || "<svg viewBox='0 0 1024 1024' width='15' height='15' fill='currentColor' aria-hidden='true'><path d='M128 266.666667A138.666667 138.666667 0 0 1 266.666667 128h490.666666A138.666667 138.666667 0 0 1 896 266.666667v246.272a276.096 276.096 0 0 0-64-30.250667V426.666667h-170.666667v56.021333a276.096 276.096 0 0 0-64 30.250667V426.666667h-170.666666v170.666666h86.272a276.096 276.096 0 0 0-30.250667 64H426.666667v170.666667h56.021333c7.381333 22.784 17.578667 44.245333 30.250667 64H266.666667A138.666667 138.666667 0 0 1 128 757.333333V266.666667zM266.666667 192A74.666667 74.666667 0 0 0 192 266.666667V362.666667h170.666667v-170.666667H266.666667zM192 426.666667v170.666666h170.666667v-170.666666h-170.666667z m469.333333-64h170.666667V266.666667a74.666667 74.666667 0 0 0-74.666667-74.666667H661.333333v170.666667z m-64-170.666667h-170.666666v170.666667h170.666666v-170.666667z m-405.333333 469.333333v96c0 41.216 33.450667 74.666667 74.666667 74.666667H362.666667v-170.666667h-170.666667z'/><path d='M981.333333 746.666667a234.666667 234.666667 0 1 1-469.333333 0 234.666667 234.666667 0 0 1 469.333333 0z m-234.666666-30.165334l-70.229334-70.272a21.333333 21.333333 0 0 0-30.208 30.208l70.272 70.229334-70.272 70.229333a21.333333 21.333333 0 0 0 30.208 30.208l70.229334-70.272 70.229333 70.272a21.333333 21.333333 0 0 0 30.208-30.208L776.832 746.666667l70.272-70.229334a21.333333 21.333333 0 0 0-30.208-30.208L746.666667 716.501333z'/></svg>"
|
|
8113
8113
|
}, null, 8, ["html"])
|
|
8114
8114
|
], 40, gp)
|
|
@@ -8120,10 +8120,10 @@ const Is = [
|
|
|
8120
8120
|
class: ze(["ht-nav-btn ht-nav-right", { disabled: !W.value }]),
|
|
8121
8121
|
title: fe(l)("ui.scrollRight"),
|
|
8122
8122
|
"aria-label": fe(l)("ui.scrollRight"),
|
|
8123
|
-
onMousedown: b[35] || (b[35] = ie((
|
|
8123
|
+
onMousedown: b[35] || (b[35] = ie((L) => sn(1), ["prevent", "stop"])),
|
|
8124
8124
|
onTouchstart: b[36] || (b[36] = ie(() => {
|
|
8125
8125
|
}, ["stop"])),
|
|
8126
|
-
onTouchend: b[37] || (b[37] = ie((
|
|
8126
|
+
onTouchend: b[37] || (b[37] = ie((L) => dt(1, L), ["stop"])),
|
|
8127
8127
|
onClick: b[38] || (b[38] = ie(() => {
|
|
8128
8128
|
}, ["prevent", "stop"]))
|
|
8129
8129
|
}, [...b[103] || (b[103] = [
|
|
@@ -8170,7 +8170,7 @@ const Is = [
|
|
|
8170
8170
|
function r($) {
|
|
8171
8171
|
o("toolbarInteracting");
|
|
8172
8172
|
}
|
|
8173
|
-
const { t: i } =
|
|
8173
|
+
const { t: i } = Tn(), l = wo(), s = Hn(), c = Zn(ss, j(!1)), a = Me(() => n.position === "top" ? !1 : n.position === "bottom" ? !0 : c.value);
|
|
8174
8174
|
so(yr, a);
|
|
8175
8175
|
const d = Zn(Ml, j(null)), u = j(null), h = ($) => {
|
|
8176
8176
|
var G;
|
|
@@ -8283,7 +8283,7 @@ const Is = [
|
|
|
8283
8283
|
const $ = d.value;
|
|
8284
8284
|
return $ && $.visible ? $.blockId : n.hoverVisible && n.hoverBlockId ? n.hoverBlockId : n.focusBlockId;
|
|
8285
8285
|
}), D = j(null), F = j(null);
|
|
8286
|
-
function
|
|
8286
|
+
function z() {
|
|
8287
8287
|
const $ = T.value, U = D.value;
|
|
8288
8288
|
!$ || !U || o("openPlusMenu", $, U);
|
|
8289
8289
|
}
|
|
@@ -8312,7 +8312,7 @@ const Is = [
|
|
|
8312
8312
|
disabled: !T.value,
|
|
8313
8313
|
title: fe(i)("handle.plus.title"),
|
|
8314
8314
|
"aria-label": fe(i)("handle.plus.ariaLabel"),
|
|
8315
|
-
onMousedown: ie(
|
|
8315
|
+
onMousedown: ie(z, ["prevent", "stop"]),
|
|
8316
8316
|
onTouchstart: U[0] || (U[0] = ie(() => {
|
|
8317
8317
|
}, ["stop"]))
|
|
8318
8318
|
}, [...U[3] || (U[3] = [
|
|
@@ -8363,7 +8363,7 @@ const Is = [
|
|
|
8363
8363
|
},
|
|
8364
8364
|
emits: ["continue", "startNew", "modify", "close"],
|
|
8365
8365
|
setup(e, { emit: t }) {
|
|
8366
|
-
const n = e, o = t, { t: r } =
|
|
8366
|
+
const n = e, o = t, { t: r } = Tn(), i = j(null), l = j({ top: 0, left: 0, above: !1 });
|
|
8367
8367
|
Tt(
|
|
8368
8368
|
[() => n.visible, () => n.anchor, i],
|
|
8369
8369
|
async () => {
|
|
@@ -8394,7 +8394,7 @@ const Is = [
|
|
|
8394
8394
|
function d() {
|
|
8395
8395
|
o("modify", n.currentNumber);
|
|
8396
8396
|
}
|
|
8397
|
-
return (u, h) => (Z(), mn(
|
|
8397
|
+
return (u, h) => (Z(), mn(Pn, { to: "body" }, [
|
|
8398
8398
|
e.visible && e.anchor && e.rootEl ? (Z(), te("div", {
|
|
8399
8399
|
key: 0,
|
|
8400
8400
|
ref_key: "menuEl",
|
|
@@ -8469,7 +8469,7 @@ const Is = [
|
|
|
8469
8469
|
},
|
|
8470
8470
|
emits: ["confirm", "close"],
|
|
8471
8471
|
setup(e, { emit: t }) {
|
|
8472
|
-
const n = e, o = t, { t: r } =
|
|
8472
|
+
const n = e, o = t, { t: r } = Tn(), i = j(null), l = j(n.initialValue), s = j({ top: 0, left: 0 });
|
|
8473
8473
|
Tt(
|
|
8474
8474
|
[() => n.visible, () => n.anchor, () => n.initialValue],
|
|
8475
8475
|
async () => {
|
|
@@ -8495,7 +8495,7 @@ const Is = [
|
|
|
8495
8495
|
let d = l.value;
|
|
8496
8496
|
Number.isFinite(d) || (d = n.initialValue), d = Math.max(1, Math.floor(d)), o("confirm", d);
|
|
8497
8497
|
}
|
|
8498
|
-
return (d, u) => (Z(), mn(
|
|
8498
|
+
return (d, u) => (Z(), mn(Pn, { to: "body" }, [
|
|
8499
8499
|
e.visible && e.anchor && e.rootEl ? (Z(), te("div", {
|
|
8500
8500
|
key: 0,
|
|
8501
8501
|
class: "number-picker",
|
|
@@ -8554,7 +8554,7 @@ const Is = [
|
|
|
8554
8554
|
},
|
|
8555
8555
|
emits: ["confirm", "close"],
|
|
8556
8556
|
setup(e, { emit: t }) {
|
|
8557
|
-
const n = e, o = t, { t: r } =
|
|
8557
|
+
const n = e, o = t, { t: r } = Tn(), i = [
|
|
8558
8558
|
"plain",
|
|
8559
8559
|
"javascript",
|
|
8560
8560
|
"typescript",
|
|
@@ -8615,7 +8615,7 @@ const Is = [
|
|
|
8615
8615
|
const le = c.value;
|
|
8616
8616
|
le && (le.scrollTop -= le.clientHeight * 0.8);
|
|
8617
8617
|
}
|
|
8618
|
-
function
|
|
8618
|
+
function z() {
|
|
8619
8619
|
const le = c.value;
|
|
8620
8620
|
le && (le.scrollTop += le.clientHeight * 0.8);
|
|
8621
8621
|
}
|
|
@@ -8642,7 +8642,7 @@ const Is = [
|
|
|
8642
8642
|
left: `${h.value.left}px`,
|
|
8643
8643
|
maxHeight: `${h.value.maxHeight}px`
|
|
8644
8644
|
}));
|
|
8645
|
-
return (le, X) => (Z(), mn(
|
|
8645
|
+
return (le, X) => (Z(), mn(Pn, { to: "body" }, [
|
|
8646
8646
|
e.visible && e.anchor && e.rootEl ? (Z(), te("div", {
|
|
8647
8647
|
key: 0,
|
|
8648
8648
|
ref_key: "menuEl",
|
|
@@ -8742,7 +8742,7 @@ const Is = [
|
|
|
8742
8742
|
class: "menu-scroll-btn menu-scroll-down",
|
|
8743
8743
|
type: "button",
|
|
8744
8744
|
"aria-label": fe(r)("ui.scrollDown"),
|
|
8745
|
-
onMousedown: ie(
|
|
8745
|
+
onMousedown: ie(z, ["prevent"])
|
|
8746
8746
|
}, [...X[6] || (X[6] = [
|
|
8747
8747
|
C("svg", {
|
|
8748
8748
|
viewBox: "0 0 12 12",
|
|
@@ -8792,10 +8792,10 @@ const Is = [
|
|
|
8792
8792
|
},
|
|
8793
8793
|
emits: ["close"],
|
|
8794
8794
|
setup(e, { expose: t, emit: n }) {
|
|
8795
|
-
const o = e, r = n, { t: i } =
|
|
8795
|
+
const o = e, r = n, { t: i } = Tn(), l = Hn(), s = j(null), c = j(null), a = j(!1), d = j(!1), u = j("view"), h = j(""), p = j(""), f = j({ top: 0, left: 0 }), m = j(""), T = Me(() => o.showTextInput ?? !1), D = Me(() => u.value === "edit" ? h.value : o.href), F = Me(() => {
|
|
8796
8796
|
const _ = So(D.value);
|
|
8797
8797
|
return co(_) ?? "#";
|
|
8798
|
-
}),
|
|
8798
|
+
}), z = Me(() => {
|
|
8799
8799
|
const _ = D.value;
|
|
8800
8800
|
return _ ? _.length > 60 ? _.slice(0, 57) + "..." : _ : i("link.emptyUrl");
|
|
8801
8801
|
}), oe = Me(() => ({
|
|
@@ -8881,13 +8881,13 @@ const Is = [
|
|
|
8881
8881
|
const _ = So(o.href), O = co(_);
|
|
8882
8882
|
O && O !== "#" && window.open(O, "_blank", "noopener,noreferrer");
|
|
8883
8883
|
}
|
|
8884
|
-
return
|
|
8884
|
+
return Bn(() => {
|
|
8885
8885
|
a.value = !1;
|
|
8886
8886
|
}), t({
|
|
8887
8887
|
isEditing: () => u.value === "edit",
|
|
8888
8888
|
save: G,
|
|
8889
8889
|
cancel: le
|
|
8890
|
-
}), (_, O) => (Z(), mn(
|
|
8890
|
+
}), (_, O) => (Z(), mn(Pn, { to: "body" }, [
|
|
8891
8891
|
a.value ? (Z(), te("div", {
|
|
8892
8892
|
key: 0,
|
|
8893
8893
|
ref_key: "popoverEl",
|
|
@@ -8909,7 +8909,7 @@ const Is = [
|
|
|
8909
8909
|
class: "link-popover-url",
|
|
8910
8910
|
title: D.value,
|
|
8911
8911
|
onClick: W
|
|
8912
|
-
}, Rt(
|
|
8912
|
+
}, Rt(z.value), 9, Zp),
|
|
8913
8913
|
C("div", Xp, [
|
|
8914
8914
|
C("button", {
|
|
8915
8915
|
class: "link-popover-btn",
|
|
@@ -9066,7 +9066,7 @@ const Is = [
|
|
|
9066
9066
|
validate: (e) => e == null ? !0 : Number.isInteger(e) && e >= 1
|
|
9067
9067
|
};
|
|
9068
9068
|
function Os(e, t) {
|
|
9069
|
-
const n = mr(e, t), o =
|
|
9069
|
+
const n = mr(e, t), o = Ln(e, t);
|
|
9070
9070
|
if (o < 0) return 1;
|
|
9071
9071
|
const r = e.blocks.get(t);
|
|
9072
9072
|
if (!r) return 1;
|
|
@@ -9092,14 +9092,14 @@ const ah = Ft({
|
|
|
9092
9092
|
placeholder: { type: String, default: void 0 }
|
|
9093
9093
|
},
|
|
9094
9094
|
setup(e) {
|
|
9095
|
-
const t =
|
|
9095
|
+
const t = Hn(), n = wo(), o = j(null), r = Qi(), i = {
|
|
9096
9096
|
...typeof r.onLinkClick == "function" ? { onLinkClick: r.onLinkClick } : {},
|
|
9097
9097
|
...typeof r.onSlashTrigger == "function" ? { onSlashTrigger: r.onSlashTrigger } : {},
|
|
9098
9098
|
...typeof r.onInputChanged == "function" ? { onInputChanged: r.onInputChanged } : {}
|
|
9099
9099
|
}, l = j(0), s = t.subscribe(() => {
|
|
9100
9100
|
l.value++;
|
|
9101
9101
|
});
|
|
9102
|
-
return
|
|
9102
|
+
return Bn(s), () => {
|
|
9103
9103
|
l.value;
|
|
9104
9104
|
const c = t.getState().doc, a = Os(c, e.block.id), d = ve(
|
|
9105
9105
|
"div",
|
|
@@ -9362,7 +9362,7 @@ const Ko = (e, t, n, o, r, i) => ({
|
|
|
9362
9362
|
placeholder: { type: String, default: void 0 }
|
|
9363
9363
|
},
|
|
9364
9364
|
setup(e) {
|
|
9365
|
-
const t =
|
|
9365
|
+
const t = Hn(), n = Qi(), o = {
|
|
9366
9366
|
...typeof n.onLinkClick == "function" ? { onLinkClick: n.onLinkClick } : {},
|
|
9367
9367
|
...typeof n.onSlashTrigger == "function" ? { onSlashTrigger: n.onSlashTrigger } : {},
|
|
9368
9368
|
...typeof n.onInputChanged == "function" ? { onInputChanged: n.onInputChanged } : {}
|
|
@@ -10178,8 +10178,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
|
|
|
10178
10178
|
}
|
|
10179
10179
|
function u(y, S, I, V) {
|
|
10180
10180
|
const me = /* @__PURE__ */ Object.create(null);
|
|
10181
|
-
function ae(k,
|
|
10182
|
-
return k.keywords[
|
|
10181
|
+
function ae(k, K) {
|
|
10182
|
+
return k.keywords[K];
|
|
10183
10183
|
}
|
|
10184
10184
|
function ye() {
|
|
10185
10185
|
if (!be.keywords) {
|
|
@@ -10188,21 +10188,21 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
|
|
|
10188
10188
|
}
|
|
10189
10189
|
let k = 0;
|
|
10190
10190
|
be.keywordPatternRe.lastIndex = 0;
|
|
10191
|
-
let
|
|
10192
|
-
for (;
|
|
10193
|
-
_e += He.substring(k,
|
|
10194
|
-
const Se = lt.case_insensitive ?
|
|
10191
|
+
let K = be.keywordPatternRe.exec(He), _e = "";
|
|
10192
|
+
for (; K; ) {
|
|
10193
|
+
_e += He.substring(k, K.index);
|
|
10194
|
+
const Se = lt.case_insensitive ? K[0].toLowerCase() : K[0], dt = ae(be, Se);
|
|
10195
10195
|
if (dt) {
|
|
10196
10196
|
const [ht, vn] = dt;
|
|
10197
10197
|
if (it.addText(_e), _e = "", me[Se] = (me[Se] || 0) + 1, me[Se] <= gg && (sn += vn), ht.startsWith("_"))
|
|
10198
|
-
_e +=
|
|
10198
|
+
_e += K[0];
|
|
10199
10199
|
else {
|
|
10200
10200
|
const En = lt.classNameAliases[ht] || ht;
|
|
10201
|
-
Oe(
|
|
10201
|
+
Oe(K[0], En);
|
|
10202
10202
|
}
|
|
10203
10203
|
} else
|
|
10204
|
-
_e +=
|
|
10205
|
-
k = be.keywordPatternRe.lastIndex,
|
|
10204
|
+
_e += K[0];
|
|
10205
|
+
k = be.keywordPatternRe.lastIndex, K = be.keywordPatternRe.exec(He);
|
|
10206
10206
|
}
|
|
10207
10207
|
_e += He.substring(k), it.addText(_e);
|
|
10208
10208
|
}
|
|
@@ -10223,30 +10223,30 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
|
|
|
10223
10223
|
function ue() {
|
|
10224
10224
|
be.subLanguage != null ? pe() : ye(), He = "";
|
|
10225
10225
|
}
|
|
10226
|
-
function Oe(k,
|
|
10227
|
-
k !== "" && (it.startScope(
|
|
10226
|
+
function Oe(k, K) {
|
|
10227
|
+
k !== "" && (it.startScope(K), it.addText(k), it.endScope());
|
|
10228
10228
|
}
|
|
10229
|
-
function Ie(k,
|
|
10229
|
+
function Ie(k, K) {
|
|
10230
10230
|
let _e = 1;
|
|
10231
|
-
const Se =
|
|
10231
|
+
const Se = K.length - 1;
|
|
10232
10232
|
for (; _e <= Se; ) {
|
|
10233
10233
|
if (!k._emit[_e]) {
|
|
10234
10234
|
_e++;
|
|
10235
10235
|
continue;
|
|
10236
10236
|
}
|
|
10237
|
-
const dt = lt.classNameAliases[k[_e]] || k[_e], ht =
|
|
10237
|
+
const dt = lt.classNameAliases[k[_e]] || k[_e], ht = K[_e];
|
|
10238
10238
|
dt ? Oe(ht, dt) : (He = ht, ye(), He = ""), _e++;
|
|
10239
10239
|
}
|
|
10240
10240
|
}
|
|
10241
|
-
function et(k,
|
|
10242
|
-
return k.scope && typeof k.scope == "string" && it.openNode(lt.classNameAliases[k.scope] || k.scope), k.beginScope && (k.beginScope._wrap ? (Oe(He, lt.classNameAliases[k.beginScope._wrap] || k.beginScope._wrap), He = "") : k.beginScope._multi && (Ie(k.beginScope,
|
|
10241
|
+
function et(k, K) {
|
|
10242
|
+
return k.scope && typeof k.scope == "string" && it.openNode(lt.classNameAliases[k.scope] || k.scope), k.beginScope && (k.beginScope._wrap ? (Oe(He, lt.classNameAliases[k.beginScope._wrap] || k.beginScope._wrap), He = "") : k.beginScope._multi && (Ie(k.beginScope, K), He = "")), be = Object.create(k, { parent: { value: be } }), be;
|
|
10243
10243
|
}
|
|
10244
|
-
function Ht(k,
|
|
10244
|
+
function Ht(k, K, _e) {
|
|
10245
10245
|
let Se = Nh(k.endRe, _e);
|
|
10246
10246
|
if (Se) {
|
|
10247
10247
|
if (k["on:end"]) {
|
|
10248
10248
|
const dt = new Di(k);
|
|
10249
|
-
k["on:end"](
|
|
10249
|
+
k["on:end"](K, dt), dt.isMatchIgnored && (Se = !1);
|
|
10250
10250
|
}
|
|
10251
10251
|
if (Se) {
|
|
10252
10252
|
for (; k.endsParent && k.parent; )
|
|
@@ -10255,61 +10255,61 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
|
|
|
10255
10255
|
}
|
|
10256
10256
|
}
|
|
10257
10257
|
if (k.endsWithParent)
|
|
10258
|
-
return Ht(k.parent,
|
|
10258
|
+
return Ht(k.parent, K, _e);
|
|
10259
10259
|
}
|
|
10260
10260
|
function an(k) {
|
|
10261
10261
|
return be.matcher.regexIndex === 0 ? (He += k[0], 1) : (P = !0, 0);
|
|
10262
10262
|
}
|
|
10263
10263
|
function ln(k) {
|
|
10264
|
-
const
|
|
10264
|
+
const K = k[0], _e = k.rule, Se = new Di(_e), dt = [_e.__beforeBegin, _e["on:begin"]];
|
|
10265
10265
|
for (const ht of dt)
|
|
10266
10266
|
if (ht && (ht(k, Se), Se.isMatchIgnored))
|
|
10267
|
-
return an(
|
|
10268
|
-
return _e.skip ? He +=
|
|
10267
|
+
return an(K);
|
|
10268
|
+
return _e.skip ? He += K : (_e.excludeBegin && (He += K), ue(), !_e.returnBegin && !_e.excludeBegin && (He = K)), et(_e, k), _e.returnBegin ? 0 : K.length;
|
|
10269
10269
|
}
|
|
10270
10270
|
function Vt(k) {
|
|
10271
|
-
const
|
|
10271
|
+
const K = k[0], _e = S.substring(k.index), Se = Ht(be, k, _e);
|
|
10272
10272
|
if (!Se)
|
|
10273
10273
|
return zi;
|
|
10274
10274
|
const dt = be;
|
|
10275
|
-
be.endScope && be.endScope._wrap ? (ue(), Oe(
|
|
10275
|
+
be.endScope && be.endScope._wrap ? (ue(), Oe(K, be.endScope._wrap)) : be.endScope && be.endScope._multi ? (ue(), Ie(be.endScope, k)) : dt.skip ? He += K : (dt.returnEnd || dt.excludeEnd || (He += K), ue(), dt.excludeEnd && (He = K));
|
|
10276
10276
|
do
|
|
10277
10277
|
be.scope && it.closeNode(), !be.skip && !be.subLanguage && (sn += be.relevance), be = be.parent;
|
|
10278
10278
|
while (be !== Se.parent);
|
|
10279
|
-
return Se.starts && et(Se.starts, k), dt.returnEnd ? 0 :
|
|
10279
|
+
return Se.starts && et(Se.starts, k), dt.returnEnd ? 0 : K.length;
|
|
10280
10280
|
}
|
|
10281
10281
|
function ut() {
|
|
10282
10282
|
const k = [];
|
|
10283
|
-
for (let
|
|
10284
|
-
|
|
10285
|
-
k.forEach((
|
|
10283
|
+
for (let K = be; K !== lt; K = K.parent)
|
|
10284
|
+
K.scope && k.unshift(K.scope);
|
|
10285
|
+
k.forEach((K) => it.openNode(K));
|
|
10286
10286
|
}
|
|
10287
10287
|
let At = {};
|
|
10288
|
-
function Bt(k,
|
|
10289
|
-
const _e =
|
|
10288
|
+
function Bt(k, K) {
|
|
10289
|
+
const _e = K && K[0];
|
|
10290
10290
|
if (He += k, _e == null)
|
|
10291
10291
|
return ue(), 0;
|
|
10292
|
-
if (At.type === "begin" &&
|
|
10293
|
-
if (He += S.slice(
|
|
10292
|
+
if (At.type === "begin" && K.type === "end" && At.index === K.index && _e === "") {
|
|
10293
|
+
if (He += S.slice(K.index, K.index + 1), !r) {
|
|
10294
10294
|
const Se = new Error(`0 width match regex (${y})`);
|
|
10295
10295
|
throw Se.languageName = y, Se.badRule = At.rule, Se;
|
|
10296
10296
|
}
|
|
10297
10297
|
return 1;
|
|
10298
10298
|
}
|
|
10299
|
-
if (At =
|
|
10300
|
-
return ln(
|
|
10301
|
-
if (
|
|
10299
|
+
if (At = K, K.type === "begin")
|
|
10300
|
+
return ln(K);
|
|
10301
|
+
if (K.type === "illegal" && !I) {
|
|
10302
10302
|
const Se = new Error('Illegal lexeme "' + _e + '" for mode "' + (be.scope || "<unnamed>") + '"');
|
|
10303
10303
|
throw Se.mode = be, Se;
|
|
10304
|
-
} else if (
|
|
10305
|
-
const Se = Vt(
|
|
10304
|
+
} else if (K.type === "end") {
|
|
10305
|
+
const Se = Vt(K);
|
|
10306
10306
|
if (Se !== zi)
|
|
10307
10307
|
return Se;
|
|
10308
10308
|
}
|
|
10309
|
-
if (
|
|
10309
|
+
if (K.type === "illegal" && _e === "")
|
|
10310
10310
|
return He += `
|
|
10311
10311
|
`, 1;
|
|
10312
|
-
if (Lt > 1e5 && Lt >
|
|
10312
|
+
if (Lt > 1e5 && Lt > K.index * 3)
|
|
10313
10313
|
throw new Error("potential infinite loop, way more iterations than matches");
|
|
10314
10314
|
return He += _e, _e.length;
|
|
10315
10315
|
}
|
|
@@ -10329,7 +10329,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
|
|
|
10329
10329
|
Lt++, P ? P = !1 : be.matcher.considerAll(), be.matcher.lastIndex = pt;
|
|
10330
10330
|
const k = be.matcher.exec(S);
|
|
10331
10331
|
if (!k) break;
|
|
10332
|
-
const
|
|
10332
|
+
const K = S.substring(pt, k.index), _e = Bt(K, k);
|
|
10333
10333
|
pt = k.index + _e;
|
|
10334
10334
|
}
|
|
10335
10335
|
Bt(S.substring(pt));
|
|
@@ -10440,13 +10440,13 @@ https://github.com/highlightjs/highlight.js/issues/2277`), me = y, V = S), I ===
|
|
|
10440
10440
|
function F() {
|
|
10441
10441
|
oe(), Wo("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
|
|
10442
10442
|
}
|
|
10443
|
-
let
|
|
10443
|
+
let z = !1;
|
|
10444
10444
|
function oe() {
|
|
10445
10445
|
function y() {
|
|
10446
10446
|
oe();
|
|
10447
10447
|
}
|
|
10448
10448
|
if (document.readyState === "loading") {
|
|
10449
|
-
|
|
10449
|
+
z || window.addEventListener("DOMContentLoaded", y, !1), z = !0;
|
|
10450
10450
|
return;
|
|
10451
10451
|
}
|
|
10452
10452
|
document.querySelectorAll(s.cssSelector).forEach(m);
|
|
@@ -10853,7 +10853,7 @@ function wg(e) {
|
|
|
10853
10853
|
e.C_BLOCK_COMMENT_MODE,
|
|
10854
10854
|
e.C_LINE_COMMENT_MODE
|
|
10855
10855
|
]
|
|
10856
|
-
},
|
|
10856
|
+
}, z = [
|
|
10857
10857
|
e.APOS_STRING_MODE,
|
|
10858
10858
|
e.QUOTE_STRING_MODE,
|
|
10859
10859
|
p,
|
|
@@ -10867,7 +10867,7 @@ function wg(e) {
|
|
|
10867
10867
|
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
10868
10868
|
// hljs.REGEXP_MODE
|
|
10869
10869
|
];
|
|
10870
|
-
h.contains =
|
|
10870
|
+
h.contains = z.concat({
|
|
10871
10871
|
// we need to pair up {} inside our subst to prevent
|
|
10872
10872
|
// it from ending too early by matching another }
|
|
10873
10873
|
begin: /\{/,
|
|
@@ -10875,7 +10875,7 @@ function wg(e) {
|
|
|
10875
10875
|
keywords: s,
|
|
10876
10876
|
contains: [
|
|
10877
10877
|
"self"
|
|
10878
|
-
].concat(
|
|
10878
|
+
].concat(z)
|
|
10879
10879
|
});
|
|
10880
10880
|
const oe = [].concat(F, h.contains), $ = oe.concat([
|
|
10881
10881
|
// eat recursive parens in sub expressions
|
|
@@ -11508,7 +11508,7 @@ function Eg(e) {
|
|
|
11508
11508
|
e.C_BLOCK_COMMENT_MODE,
|
|
11509
11509
|
e.C_LINE_COMMENT_MODE
|
|
11510
11510
|
]
|
|
11511
|
-
},
|
|
11511
|
+
}, z = [
|
|
11512
11512
|
e.APOS_STRING_MODE,
|
|
11513
11513
|
e.QUOTE_STRING_MODE,
|
|
11514
11514
|
p,
|
|
@@ -11522,7 +11522,7 @@ function Eg(e) {
|
|
|
11522
11522
|
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
11523
11523
|
// hljs.REGEXP_MODE
|
|
11524
11524
|
];
|
|
11525
|
-
h.contains =
|
|
11525
|
+
h.contains = z.concat({
|
|
11526
11526
|
// we need to pair up {} inside our subst to prevent
|
|
11527
11527
|
// it from ending too early by matching another }
|
|
11528
11528
|
begin: /\{/,
|
|
@@ -11530,7 +11530,7 @@ function Eg(e) {
|
|
|
11530
11530
|
keywords: s,
|
|
11531
11531
|
contains: [
|
|
11532
11532
|
"self"
|
|
11533
|
-
].concat(
|
|
11533
|
+
].concat(z)
|
|
11534
11534
|
});
|
|
11535
11535
|
const oe = [].concat(F, h.contains), $ = oe.concat([
|
|
11536
11536
|
// eat recursive parens in sub expressions
|
|
@@ -11918,7 +11918,7 @@ function Cg(e) {
|
|
|
11918
11918
|
className: "meta",
|
|
11919
11919
|
begin: "@" + o
|
|
11920
11920
|
}, u = (m, T, D) => {
|
|
11921
|
-
const F = m.contains.findIndex((
|
|
11921
|
+
const F = m.contains.findIndex((z) => z.label === T);
|
|
11922
11922
|
if (F === -1)
|
|
11923
11923
|
throw new Error("can not find mode to replace");
|
|
11924
11924
|
m.contains.splice(F, 1, D);
|
|
@@ -12764,7 +12764,7 @@ function Tg(e) {
|
|
|
12764
12764
|
}
|
|
12765
12765
|
]),
|
|
12766
12766
|
relevance: 0
|
|
12767
|
-
},
|
|
12767
|
+
}, z = {
|
|
12768
12768
|
begin: "(" + l + "[\\*&\\s]+)+" + p,
|
|
12769
12769
|
returnBegin: !0,
|
|
12770
12770
|
end: /[{;=]/,
|
|
@@ -12835,7 +12835,7 @@ function Tg(e) {
|
|
|
12835
12835
|
illegal: "</",
|
|
12836
12836
|
contains: [].concat(
|
|
12837
12837
|
F,
|
|
12838
|
-
|
|
12838
|
+
z,
|
|
12839
12839
|
D,
|
|
12840
12840
|
[
|
|
12841
12841
|
u,
|
|
@@ -13608,7 +13608,7 @@ function Sg(e) {
|
|
|
13608
13608
|
{ beginKeywords: "in out" },
|
|
13609
13609
|
s
|
|
13610
13610
|
]
|
|
13611
|
-
},
|
|
13611
|
+
}, z = e.IDENT_RE + "(<" + e.IDENT_RE + "(\\s*,\\s*" + e.IDENT_RE + ")*>)?(\\[\\])?", oe = {
|
|
13612
13612
|
// prevents expressions like `@class` from incorrect flagging
|
|
13613
13613
|
// `class` as a keyword
|
|
13614
13614
|
begin: "@" + e.IDENT_RE,
|
|
@@ -13715,7 +13715,7 @@ function Sg(e) {
|
|
|
13715
13715
|
},
|
|
13716
13716
|
{
|
|
13717
13717
|
className: "function",
|
|
13718
|
-
begin: "(" +
|
|
13718
|
+
begin: "(" + z + "\\s+)+" + e.IDENT_RE + "\\s*(<[^=]+>\\s*)?\\(",
|
|
13719
13719
|
returnBegin: !0,
|
|
13720
13720
|
end: /\s*[{;=]/,
|
|
13721
13721
|
excludeEnd: !0,
|
|
@@ -15555,7 +15555,7 @@ function Ug(e) {
|
|
|
15555
15555
|
}, T = [
|
|
15556
15556
|
f,
|
|
15557
15557
|
m
|
|
15558
|
-
], D = "([0-9]_*)+", F = "([0-9a-fA-F]_*)+",
|
|
15558
|
+
], D = "([0-9]_*)+", F = "([0-9a-fA-F]_*)+", z = {
|
|
15559
15559
|
className: "number",
|
|
15560
15560
|
relevance: 0,
|
|
15561
15561
|
variants: [
|
|
@@ -15663,7 +15663,7 @@ function Ug(e) {
|
|
|
15663
15663
|
keywords: Hg,
|
|
15664
15664
|
contains: [
|
|
15665
15665
|
...T,
|
|
15666
|
-
|
|
15666
|
+
z,
|
|
15667
15667
|
le
|
|
15668
15668
|
]
|
|
15669
15669
|
}
|
|
@@ -15739,7 +15739,7 @@ function Ug(e) {
|
|
|
15739
15739
|
...d,
|
|
15740
15740
|
...p,
|
|
15741
15741
|
...T,
|
|
15742
|
-
|
|
15742
|
+
z,
|
|
15743
15743
|
le,
|
|
15744
15744
|
...S,
|
|
15745
15745
|
...ae,
|
|
@@ -15779,7 +15779,7 @@ function Ug(e) {
|
|
|
15779
15779
|
...o,
|
|
15780
15780
|
...d,
|
|
15781
15781
|
...T,
|
|
15782
|
-
|
|
15782
|
+
z,
|
|
15783
15783
|
le,
|
|
15784
15784
|
...ae,
|
|
15785
15785
|
ye,
|
|
@@ -15904,7 +15904,7 @@ function Ug(e) {
|
|
|
15904
15904
|
...d,
|
|
15905
15905
|
...p,
|
|
15906
15906
|
...T,
|
|
15907
|
-
|
|
15907
|
+
z,
|
|
15908
15908
|
le,
|
|
15909
15909
|
...S
|
|
15910
15910
|
];
|
|
@@ -15942,7 +15942,7 @@ function Ug(e) {
|
|
|
15942
15942
|
...d,
|
|
15943
15943
|
...p,
|
|
15944
15944
|
...T,
|
|
15945
|
-
|
|
15945
|
+
z,
|
|
15946
15946
|
le,
|
|
15947
15947
|
...S,
|
|
15948
15948
|
...ae,
|
|
@@ -17949,7 +17949,7 @@ function o3(e) {
|
|
|
17949
17949
|
"trap",
|
|
17950
17950
|
"umask",
|
|
17951
17951
|
"unset"
|
|
17952
|
-
],
|
|
17952
|
+
], z = [
|
|
17953
17953
|
"alias",
|
|
17954
17954
|
"bind",
|
|
17955
17955
|
"builtin",
|
|
@@ -18158,7 +18158,7 @@ function o3(e) {
|
|
|
18158
18158
|
literal: T,
|
|
18159
18159
|
built_in: [
|
|
18160
18160
|
...F,
|
|
18161
|
-
...
|
|
18161
|
+
...z,
|
|
18162
18162
|
// Shell modifiers
|
|
18163
18163
|
"set",
|
|
18164
18164
|
"shopt",
|
|
@@ -18344,7 +18344,7 @@ function r3(e) {
|
|
|
18344
18344
|
className: "selector-tag",
|
|
18345
18345
|
begin: /@\B/,
|
|
18346
18346
|
relevance: 0
|
|
18347
|
-
},
|
|
18347
|
+
}, z = {
|
|
18348
18348
|
className: "function",
|
|
18349
18349
|
begin: /\[.*\]\s*[\w]+[ ]??\(/,
|
|
18350
18350
|
end: /$/,
|
|
@@ -18367,7 +18367,7 @@ function r3(e) {
|
|
|
18367
18367
|
]
|
|
18368
18368
|
}, oe = [
|
|
18369
18369
|
// STATIC_MEMBER,
|
|
18370
|
-
|
|
18370
|
+
z,
|
|
18371
18371
|
h,
|
|
18372
18372
|
l,
|
|
18373
18373
|
e.NUMBER_MODE,
|
|
@@ -18399,7 +18399,7 @@ function r3(e) {
|
|
|
18399
18399
|
}
|
|
18400
18400
|
)
|
|
18401
18401
|
};
|
|
18402
|
-
return
|
|
18402
|
+
return z.contains.unshift($), {
|
|
18403
18403
|
name: "PowerShell",
|
|
18404
18404
|
aliases: [
|
|
18405
18405
|
"pwsh",
|
|
@@ -19140,7 +19140,7 @@ function i3(e) {
|
|
|
19140
19140
|
/\b/
|
|
19141
19141
|
);
|
|
19142
19142
|
}
|
|
19143
|
-
const
|
|
19143
|
+
const z = {
|
|
19144
19144
|
scope: "keyword",
|
|
19145
19145
|
match: F(h),
|
|
19146
19146
|
relevance: 0
|
|
@@ -19169,7 +19169,7 @@ function i3(e) {
|
|
|
19169
19169
|
scope: "type",
|
|
19170
19170
|
match: F(l)
|
|
19171
19171
|
},
|
|
19172
|
-
|
|
19172
|
+
z,
|
|
19173
19173
|
D,
|
|
19174
19174
|
m,
|
|
19175
19175
|
o,
|
|
@@ -19505,7 +19505,7 @@ const d3 = Ft({
|
|
|
19505
19505
|
placeholder: { type: String, default: void 0 }
|
|
19506
19506
|
},
|
|
19507
19507
|
setup(e) {
|
|
19508
|
-
const t = j(null), n =
|
|
19508
|
+
const t = j(null), n = Tn(), o = wo(), r = Me(
|
|
19509
19509
|
() => u3(
|
|
19510
19510
|
Fe(e.block.content),
|
|
19511
19511
|
e.block.attrs.language ?? "plain"
|
|
@@ -19631,10 +19631,10 @@ const d3 = Ft({
|
|
|
19631
19631
|
},
|
|
19632
19632
|
setup(e) {
|
|
19633
19633
|
e.placeholder;
|
|
19634
|
-
const t =
|
|
19634
|
+
const t = Hn(), n = wo(), o = Tn(), r = e.block.id, i = j(go(r)), l = Es((A, W) => {
|
|
19635
19635
|
A === r && (i.value = W);
|
|
19636
19636
|
});
|
|
19637
|
-
|
|
19637
|
+
Bn(() => {
|
|
19638
19638
|
l();
|
|
19639
19639
|
});
|
|
19640
19640
|
const s = j(null), c = j(null), a = j(!1);
|
|
@@ -19667,7 +19667,7 @@ const d3 = Ft({
|
|
|
19667
19667
|
const me = M / Math.max(1, y);
|
|
19668
19668
|
M = O, y = Math.round(M / me);
|
|
19669
19669
|
}
|
|
19670
|
-
d = M, u = y, h = A.clientX, p = d / Math.max(1, u), a.value = !0, document.addEventListener("mousemove", D, !0), document.addEventListener("mouseup", F, !0), document.addEventListener("selectstart",
|
|
19670
|
+
d = M, u = y, h = A.clientX, p = d / Math.max(1, u), a.value = !0, document.addEventListener("mousemove", D, !0), document.addEventListener("mouseup", F, !0), document.addEventListener("selectstart", z, !0);
|
|
19671
19671
|
}
|
|
19672
19672
|
const T = 600;
|
|
19673
19673
|
function D(A) {
|
|
@@ -19691,9 +19691,9 @@ const d3 = Ft({
|
|
|
19691
19691
|
});
|
|
19692
19692
|
}
|
|
19693
19693
|
function F() {
|
|
19694
|
-
a.value = !1, document.removeEventListener("mousemove", D, !0), document.removeEventListener("mouseup", F, !0), document.removeEventListener("selectstart",
|
|
19694
|
+
a.value = !1, document.removeEventListener("mousemove", D, !0), document.removeEventListener("mouseup", F, !0), document.removeEventListener("selectstart", z, !0);
|
|
19695
19695
|
}
|
|
19696
|
-
function
|
|
19696
|
+
function z(A) {
|
|
19697
19697
|
A.preventDefault();
|
|
19698
19698
|
}
|
|
19699
19699
|
const oe = j(null);
|
|
@@ -19781,20 +19781,20 @@ const d3 = Ft({
|
|
|
19781
19781
|
onClick: (Ie) => {
|
|
19782
19782
|
Ie.stopPropagation(), $();
|
|
19783
19783
|
}
|
|
19784
|
-
}, [ve(
|
|
19784
|
+
}, [ve(In, { html: xd })]),
|
|
19785
19785
|
ve("button", {
|
|
19786
19786
|
class: "image-block-btn",
|
|
19787
19787
|
title: o.t("image.remove"),
|
|
19788
19788
|
onClick: (Ie) => {
|
|
19789
19789
|
Ie.stopPropagation(), G();
|
|
19790
19790
|
}
|
|
19791
|
-
}, [ve(
|
|
19791
|
+
}, [ve(In, { html: Cd })])
|
|
19792
19792
|
])
|
|
19793
19793
|
), (_ == null ? void 0 : _.status) === "pending") {
|
|
19794
19794
|
const Ie = Math.round(_.progress * 100);
|
|
19795
19795
|
V.push(
|
|
19796
19796
|
ve("div", { class: "image-block-upload-overlay" }, [
|
|
19797
|
-
ve(
|
|
19797
|
+
ve(In, { html: wd, class: "image-block-spinner" }),
|
|
19798
19798
|
ve("div", { class: "image-block-upload-label" }, o.t("image.uploading")),
|
|
19799
19799
|
ve("div", { class: "image-block-progress-track" }, [
|
|
19800
19800
|
ve("div", {
|
|
@@ -19817,7 +19817,7 @@ const d3 = Ft({
|
|
|
19817
19817
|
Ie.stopPropagation(), ce();
|
|
19818
19818
|
}
|
|
19819
19819
|
}, [
|
|
19820
|
-
ve(
|
|
19820
|
+
ve(In, { html: Ed }),
|
|
19821
19821
|
" ",
|
|
19822
19822
|
o.t("image.retry")
|
|
19823
19823
|
])
|
|
@@ -19829,7 +19829,7 @@ const d3 = Ft({
|
|
|
19829
19829
|
Ie.stopPropagation(), n.value && $();
|
|
19830
19830
|
}
|
|
19831
19831
|
}, [
|
|
19832
|
-
ve(
|
|
19832
|
+
ve(In, { html: _d, class: "image-block-empty-icon" }),
|
|
19833
19833
|
ve("div", { class: "image-block-empty-title" }, o.t("image.emptyTitle")),
|
|
19834
19834
|
ve("div", { class: "image-block-empty-sub" }, o.t("image.emptySub"))
|
|
19835
19835
|
])
|
|
@@ -19994,7 +19994,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
19994
19994
|
},
|
|
19995
19995
|
setup(e, { expose: t }) {
|
|
19996
19996
|
e.placeholder;
|
|
19997
|
-
const n =
|
|
19997
|
+
const n = Hn(), o = wo(), r = Tn(), i = e.block.id, l = Zn(Ml, null);
|
|
19998
19998
|
let s = "__none__";
|
|
19999
19999
|
function c(v) {
|
|
20000
20000
|
if (!v) return "null";
|
|
@@ -20033,10 +20033,10 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20033
20033
|
function F() {
|
|
20034
20034
|
return Date.now() - T < D;
|
|
20035
20035
|
}
|
|
20036
|
-
function
|
|
20037
|
-
var
|
|
20036
|
+
function z(v) {
|
|
20037
|
+
var B;
|
|
20038
20038
|
const w = v.target;
|
|
20039
|
-
!!(w && (w.nodeType === 1 ? w.closest(".hover-toolbar") : (
|
|
20039
|
+
!!(w && (w.nodeType === 1 ? w.closest(".hover-toolbar") : (B = w.parentElement) != null && B.closest(".hover-toolbar"))) && (T = Date.now());
|
|
20040
20040
|
}
|
|
20041
20041
|
function oe() {
|
|
20042
20042
|
T = Date.now();
|
|
@@ -20047,7 +20047,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20047
20047
|
let X = !1;
|
|
20048
20048
|
const A = j(null);
|
|
20049
20049
|
let W = null, _ = null, O = !1, M = !1;
|
|
20050
|
-
const y =
|
|
20050
|
+
const y = An({
|
|
20051
20051
|
blockType: "paragraph",
|
|
20052
20052
|
blockAttrs: { align: "left" },
|
|
20053
20053
|
marks: /* @__PURE__ */ new Set(),
|
|
@@ -20061,10 +20061,10 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20061
20061
|
showSplit: !1,
|
|
20062
20062
|
showHeaderRow: !1,
|
|
20063
20063
|
headerRowActive: !1
|
|
20064
|
-
}), S = j(null), I =
|
|
20064
|
+
}), S = j(null), I = An({
|
|
20065
20065
|
visible: !1,
|
|
20066
20066
|
selectionRect: null
|
|
20067
|
-
}), V =
|
|
20067
|
+
}), V = An({
|
|
20068
20068
|
visible: !1,
|
|
20069
20069
|
anchorRect: null,
|
|
20070
20070
|
href: "",
|
|
@@ -20073,7 +20073,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20073
20073
|
showTextInput: !1
|
|
20074
20074
|
});
|
|
20075
20075
|
let me = null, ae = null, ye = !1;
|
|
20076
|
-
const pe =
|
|
20076
|
+
const pe = An({
|
|
20077
20077
|
visible: !1,
|
|
20078
20078
|
row: -1,
|
|
20079
20079
|
col: -1,
|
|
@@ -20085,7 +20085,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20085
20085
|
function ue() {
|
|
20086
20086
|
pe.visible = !1, pe.anchor = null, pe.row = -1, pe.col = -1;
|
|
20087
20087
|
}
|
|
20088
|
-
const Oe =
|
|
20088
|
+
const Oe = An({
|
|
20089
20089
|
visible: !1,
|
|
20090
20090
|
row: -1,
|
|
20091
20091
|
col: -1,
|
|
@@ -20098,9 +20098,9 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20098
20098
|
function et(v, w, x) {
|
|
20099
20099
|
var ke, Re;
|
|
20100
20100
|
if (!o.value) return;
|
|
20101
|
-
const
|
|
20102
|
-
if (!
|
|
20103
|
-
const q = wl(u.value, v, w), Q = typeof
|
|
20101
|
+
const B = (ke = u.value.cells[v]) == null ? void 0 : ke[w];
|
|
20102
|
+
if (!B || B.covered || B.cellType !== "orderedList") return;
|
|
20103
|
+
const q = wl(u.value, v, w), Q = typeof B.startNumber == "number";
|
|
20104
20104
|
let de = !1;
|
|
20105
20105
|
for (let Be = v - 1; Be >= 0; Be--) {
|
|
20106
20106
|
const nt = (Re = u.value.cells[Be]) == null ? void 0 : Re[w];
|
|
@@ -20126,17 +20126,17 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20126
20126
|
}
|
|
20127
20127
|
function ln() {
|
|
20128
20128
|
if (pe.row < 0 || pe.col < 0) return;
|
|
20129
|
-
const v = pe.anchor, w = pe.row, x = pe.col,
|
|
20130
|
-
ue(), v && (Oe.visible = !0, Oe.initialValue =
|
|
20129
|
+
const v = pe.anchor, w = pe.row, x = pe.col, B = pe.currentNumber;
|
|
20130
|
+
ue(), v && (Oe.visible = !0, Oe.initialValue = B, Oe.anchor = v, Oe.row = w, Oe.col = x);
|
|
20131
20131
|
}
|
|
20132
20132
|
function Vt(v) {
|
|
20133
|
-
var x,
|
|
20133
|
+
var x, B;
|
|
20134
20134
|
if (Oe.row < 0 || Oe.col < 0) {
|
|
20135
20135
|
Ie();
|
|
20136
20136
|
return;
|
|
20137
20137
|
}
|
|
20138
20138
|
const w = or(u.value, Oe.row, Oe.col, { startNumber: v });
|
|
20139
|
-
(
|
|
20139
|
+
(B = (x = n.commands).setAttrs) == null || B.call(x, { id: i, attrs: w }), Ie();
|
|
20140
20140
|
}
|
|
20141
20141
|
function ut() {
|
|
20142
20142
|
if (!V.visible) return;
|
|
@@ -20153,8 +20153,8 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20153
20153
|
function At() {
|
|
20154
20154
|
const v = window.getSelection();
|
|
20155
20155
|
if (!v || v.rangeCount === 0) return null;
|
|
20156
|
-
const x = v.getRangeAt(0).commonAncestorContainer,
|
|
20157
|
-
return
|
|
20156
|
+
const x = v.getRangeAt(0).commonAncestorContainer, B = x.nodeType === 1 ? x : x.parentElement;
|
|
20157
|
+
return B ? B.closest("a") : null;
|
|
20158
20158
|
}
|
|
20159
20159
|
function Bt() {
|
|
20160
20160
|
const v = window.getSelection();
|
|
@@ -20162,20 +20162,20 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20162
20162
|
const w = v.getRangeAt(0), x = w.getBoundingClientRect();
|
|
20163
20163
|
if (x.width === 0 && x.height === 0) return;
|
|
20164
20164
|
me = w.cloneRange();
|
|
20165
|
-
const
|
|
20165
|
+
const B = At(), q = (B == null ? void 0 : B.getAttribute("href")) ?? "", Q = v.toString();
|
|
20166
20166
|
V.anchorRect = x, V.href = q, V.text = Q, V.initialMode = q ? "view" : "edit", V.showTextInput = !Q && !q, V.visible = !0, I.visible = !1;
|
|
20167
20167
|
}
|
|
20168
20168
|
function lt(v) {
|
|
20169
|
-
const w = v.getAttribute("href") || "", x = v.textContent || "",
|
|
20170
|
-
V.anchorRect =
|
|
20169
|
+
const w = v.getAttribute("href") || "", x = v.textContent || "", B = v.getBoundingClientRect();
|
|
20170
|
+
V.anchorRect = B, V.href = w, V.text = x, V.initialMode = "view", V.showTextInput = !1, V.visible = !0, ye = !0, ae = v, I.visible = !1, I.selectionRect = null;
|
|
20171
20171
|
}
|
|
20172
20172
|
function Ze(v) {
|
|
20173
20173
|
const w = v.closest(".table-cell-inner");
|
|
20174
20174
|
if (!w) return;
|
|
20175
20175
|
const x = w.closest(".table-cell");
|
|
20176
20176
|
if (!x) return;
|
|
20177
|
-
const
|
|
20178
|
-
!Number.isFinite(
|
|
20177
|
+
const B = Number(x.getAttribute("data-row")), q = Number(x.getAttribute("data-col"));
|
|
20178
|
+
!Number.isFinite(B) || !Number.isFinite(q) || Se(B, q, w);
|
|
20179
20179
|
}
|
|
20180
20180
|
function Ot(v, w) {
|
|
20181
20181
|
if (ae && ae.isConnected) {
|
|
@@ -20188,9 +20188,9 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20188
20188
|
const q = m.value, Q = q ? h.get(`${q.row}-${q.col}`) : null;
|
|
20189
20189
|
Q && Q.isConnected && (x.removeAllRanges(), x.addRange(me));
|
|
20190
20190
|
}
|
|
20191
|
-
const
|
|
20192
|
-
if (
|
|
20193
|
-
|
|
20191
|
+
const B = At();
|
|
20192
|
+
if (B)
|
|
20193
|
+
B.setAttribute("href", v), B.setAttribute("target", "_blank"), B.setAttribute("rel", "noopener noreferrer"), w !== void 0 && w !== B.textContent && (B.textContent = w);
|
|
20194
20194
|
else {
|
|
20195
20195
|
if (x.rangeCount === 0) return;
|
|
20196
20196
|
const q = x.getRangeAt(0), Q = document.createElement("a");
|
|
@@ -20206,19 +20206,19 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20206
20206
|
}
|
|
20207
20207
|
function be() {
|
|
20208
20208
|
if (ae && ae.isConnected) {
|
|
20209
|
-
const
|
|
20209
|
+
const B = ae, q = B.parentElement;
|
|
20210
20210
|
if (q) {
|
|
20211
|
-
for (;
|
|
20212
|
-
q.insertBefore(
|
|
20213
|
-
q.removeChild(
|
|
20211
|
+
for (; B.firstChild; )
|
|
20212
|
+
q.insertBefore(B.firstChild, B);
|
|
20213
|
+
q.removeChild(B);
|
|
20214
20214
|
}
|
|
20215
|
-
Ze(
|
|
20215
|
+
Ze(B);
|
|
20216
20216
|
return;
|
|
20217
20217
|
}
|
|
20218
20218
|
const v = window.getSelection();
|
|
20219
20219
|
if (!v) return;
|
|
20220
20220
|
if (me) {
|
|
20221
|
-
const
|
|
20221
|
+
const B = m.value, q = B ? h.get(`${B.row}-${B.col}`) : null;
|
|
20222
20222
|
q && q.isConnected && (v.removeAllRanges(), v.addRange(me));
|
|
20223
20223
|
}
|
|
20224
20224
|
const w = At();
|
|
@@ -20306,21 +20306,21 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20306
20306
|
const v = S.value;
|
|
20307
20307
|
v && v.focus();
|
|
20308
20308
|
}
|
|
20309
|
-
function
|
|
20310
|
-
var x,
|
|
20309
|
+
function K(v) {
|
|
20310
|
+
var x, B;
|
|
20311
20311
|
const w = v.target;
|
|
20312
20312
|
if (w.closest("a") && w.closest(".table-cell-inner")) {
|
|
20313
20313
|
v.preventDefault();
|
|
20314
20314
|
return;
|
|
20315
20315
|
}
|
|
20316
|
-
w.closest(".table-cell, .table-wrapper, table, .table-row-strip, .table-col-strip, .table-insert-dot, .table-corner-handle") || (v.stopPropagation(), G.value = { kind: "none" }, f.value = null, P(0), (
|
|
20316
|
+
w.closest(".table-cell, .table-wrapper, table, .table-row-strip, .table-col-strip, .table-insert-dot, .table-corner-handle") || (v.stopPropagation(), G.value = { kind: "none" }, f.value = null, P(0), (B = (x = n.commands).selectBlock) == null || B.call(x, { id: i }));
|
|
20317
20317
|
}
|
|
20318
20318
|
function _e(v, w) {
|
|
20319
20319
|
if (v.length !== w.length) return !1;
|
|
20320
20320
|
for (let x = 0; x < v.length; x++) {
|
|
20321
|
-
const
|
|
20322
|
-
if (
|
|
20323
|
-
const Q =
|
|
20321
|
+
const B = v[x], q = w[x];
|
|
20322
|
+
if (B.type !== q.type || "text" in B && B.text !== q.text) return !1;
|
|
20323
|
+
const Q = B.marks ?? [], de = q.marks ?? [];
|
|
20324
20324
|
if (Q.length !== de.length) return !1;
|
|
20325
20325
|
for (let ge = 0; ge < Q.length; ge++) {
|
|
20326
20326
|
const Ce = Q[ge], ke = de[ge];
|
|
@@ -20334,19 +20334,19 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20334
20334
|
}
|
|
20335
20335
|
function Se(v, w, x) {
|
|
20336
20336
|
var Ce, ke, Re;
|
|
20337
|
-
const
|
|
20337
|
+
const B = Nn(x), q = $r(B), Q = u.value, de = (Ce = Q.cells[v]) == null ? void 0 : Ce[w];
|
|
20338
20338
|
if (de && _e(de.content, q)) return;
|
|
20339
20339
|
const ge = nr(Q, v, w, q);
|
|
20340
|
-
if ((Re = (ke = n.commands).setAttrs) == null || Re.call(ke, { id: i, attrs: ge }), q !==
|
|
20340
|
+
if ((Re = (ke = n.commands).setAttrs) == null || Re.call(ke, { id: i, attrs: ge }), q !== B) {
|
|
20341
20341
|
const Be = mo(q);
|
|
20342
20342
|
x.innerHTML !== Be && (x.innerHTML = Be);
|
|
20343
20343
|
}
|
|
20344
20344
|
}
|
|
20345
|
-
function dt(v, w, x,
|
|
20345
|
+
function dt(v, w, x, B) {
|
|
20346
20346
|
var Q, de, ge;
|
|
20347
20347
|
if (I.visible && F())
|
|
20348
20348
|
return;
|
|
20349
|
-
const q =
|
|
20349
|
+
const q = B == null ? void 0 : B.relatedTarget;
|
|
20350
20350
|
if (!(q != null && q.closest(".link-popover")) && !(q != null && q.closest(".hover-toolbar"))) {
|
|
20351
20351
|
if (I.visible) {
|
|
20352
20352
|
const Ce = window.getSelection();
|
|
@@ -20359,7 +20359,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20359
20359
|
}
|
|
20360
20360
|
}
|
|
20361
20361
|
function ht(v) {
|
|
20362
|
-
var
|
|
20362
|
+
var B;
|
|
20363
20363
|
if (I.visible && F()) {
|
|
20364
20364
|
f.value && (f.value = null), G.value.kind !== "none" && (G.value = { kind: "none" }, P(0)), ue(), Ie();
|
|
20365
20365
|
return;
|
|
@@ -20370,7 +20370,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20370
20370
|
const q = window.getSelection();
|
|
20371
20371
|
if (q && q.rangeCount > 0 && !q.isCollapsed) {
|
|
20372
20372
|
const Q = q.getRangeAt(0);
|
|
20373
|
-
if ((
|
|
20373
|
+
if ((B = Q.commonAncestorContainer.nodeType === 1 ? Q.commonAncestorContainer : Q.commonAncestorContainer.parentElement) == null ? void 0 : B.closest(".table-cell-inner")) {
|
|
20374
20374
|
f.value && (f.value = null), G.value.kind !== "none" && (G.value = { kind: "none" }, P(0)), ue(), Ie();
|
|
20375
20375
|
return;
|
|
20376
20376
|
}
|
|
@@ -20379,12 +20379,12 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20379
20379
|
f.value && (f.value = null), G.value.kind !== "none" && (G.value = { kind: "none" }, P(0)), m.value && (m.value = null), ut(), ue(), Ie();
|
|
20380
20380
|
}
|
|
20381
20381
|
}
|
|
20382
|
-
function vn(v, w, x,
|
|
20382
|
+
function vn(v, w, x, B) {
|
|
20383
20383
|
var q, Q, de, ge, Ce, ke, Re, Be, nt, st, vt, cn, dn;
|
|
20384
|
-
if (
|
|
20384
|
+
if (B.key === "Enter" && !B.shiftKey && !B.ctrlKey && !B.metaKey) {
|
|
20385
20385
|
const qt = (q = u.value.cells[v]) == null ? void 0 : q[w];
|
|
20386
20386
|
if ((qt == null ? void 0 : qt.cellType) === "codeBlock") {
|
|
20387
|
-
|
|
20387
|
+
B.preventDefault(), B.stopPropagation();
|
|
20388
20388
|
const Xe = window.getSelection();
|
|
20389
20389
|
let ot = ((Q = x.textContent) == null ? void 0 : Q.length) ?? 0;
|
|
20390
20390
|
if (Xe && Xe.rangeCount > 0) {
|
|
@@ -20431,18 +20431,18 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20431
20431
|
});
|
|
20432
20432
|
return;
|
|
20433
20433
|
}
|
|
20434
|
-
|
|
20434
|
+
B.preventDefault(), B.stopPropagation(), Se(v, w, x), m.value = null, I.visible = !1, I.selectionRect = null, ut(), x.blur(), G.value = { kind: "cell", rect: { r1: v, c1: w, r2: v, c2: w } }, f.value = { anchor: { row: v, col: w }, focus: { row: v, col: w } }, k(), qe(() => {
|
|
20435
20435
|
const Xe = mt(v, w, v, w);
|
|
20436
20436
|
Xe && Lt(Xe);
|
|
20437
20437
|
});
|
|
20438
20438
|
return;
|
|
20439
20439
|
}
|
|
20440
|
-
if (
|
|
20441
|
-
|
|
20442
|
-
const qt = w3(u.value, v, w,
|
|
20440
|
+
if (B.key === "Tab") {
|
|
20441
|
+
B.preventDefault(), B.stopPropagation(), ut();
|
|
20442
|
+
const qt = w3(u.value, v, w, B.shiftKey);
|
|
20443
20443
|
if (!qt) {
|
|
20444
|
-
if (E3(u.value, v, w) && !
|
|
20445
|
-
const Yt =
|
|
20444
|
+
if (E3(u.value, v, w) && !B.shiftKey) {
|
|
20445
|
+
const Yt = Nn(x), Qn = u.value, Qt = nr(Qn, v, w, Yt), Jn = hs(Qt, Qt.rows);
|
|
20446
20446
|
(Ce = (ge = n.commands).setAttrs) == null || Ce.call(ge, { id: i, attrs: Jn }), qe(() => {
|
|
20447
20447
|
const Jt = `${Jn.rows - 1}-0`, Zt = h.get(Jt);
|
|
20448
20448
|
Zt == null || Zt.focus(), ml(Zt);
|
|
@@ -20451,15 +20451,15 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20451
20451
|
}
|
|
20452
20452
|
return;
|
|
20453
20453
|
}
|
|
20454
|
-
const { r: Xe, c: ot } = qt, fn =
|
|
20454
|
+
const { r: Xe, c: ot } = qt, fn = Nn(x), wt = u.value, Pt = (ke = wt.cells[v]) == null ? void 0 : ke[w];
|
|
20455
20455
|
let hn = wt;
|
|
20456
20456
|
Pt && (_e(Pt.content, fn) || (hn = nr(wt, v, w, fn))), hn !== wt && ((Be = (Re = n.commands).setAttrs) == null || Be.call(Re, { id: i, attrs: hn })), qe(() => {
|
|
20457
20457
|
const Xt = `${Xe}-${ot}`, Yt = h.get(Xt);
|
|
20458
|
-
Yt == null || Yt.focus(),
|
|
20458
|
+
Yt == null || Yt.focus(), B.shiftKey ? Xi(Yt) : ml(Yt);
|
|
20459
20459
|
});
|
|
20460
20460
|
return;
|
|
20461
20461
|
}
|
|
20462
|
-
if (
|
|
20462
|
+
if (B.key === "Backspace") {
|
|
20463
20463
|
const qt = (nt = u.value.cells[v]) == null ? void 0 : nt[w], Xe = qt == null ? void 0 : qt.cellType;
|
|
20464
20464
|
if (Xe && Xe !== "paragraph") {
|
|
20465
20465
|
const ot = window.getSelection();
|
|
@@ -20477,8 +20477,8 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20477
20477
|
}
|
|
20478
20478
|
}
|
|
20479
20479
|
if (fn === 0 && (!x.textContent || x.textContent.trim() === "" || (Xe === "bulletList" || Xe === "orderedList" || Xe === "todoList"))) {
|
|
20480
|
-
|
|
20481
|
-
const hn =
|
|
20480
|
+
B.preventDefault(), B.stopPropagation(), ut(), ue(), Ie();
|
|
20481
|
+
const hn = Nn(x), Xt = u.value, Yt = nr(Xt, v, w, hn), Qn = or(Yt, v, w, { cellType: "paragraph" });
|
|
20482
20482
|
(dn = (cn = n.commands).setAttrs) == null || dn.call(cn, { id: i, attrs: Qn }), qe(() => {
|
|
20483
20483
|
const Qt = h.get(`${v}-${w}`);
|
|
20484
20484
|
Qt && (Qt.focus(), Xi(Qt));
|
|
@@ -20487,7 +20487,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20487
20487
|
}
|
|
20488
20488
|
}
|
|
20489
20489
|
}
|
|
20490
|
-
|
|
20490
|
+
B.key === "Escape" && (B.preventDefault(), B.stopPropagation(), Se(v, w, x), m.value = null, I.visible = !1, I.selectionRect = null, ut(), x.blur());
|
|
20491
20491
|
}
|
|
20492
20492
|
function En(v, w, x) {
|
|
20493
20493
|
m.value = { row: v, col: w }, f.value && (f.value = null), G.value.kind !== "none" && (G.value = { kind: "none" }, P(0));
|
|
@@ -20497,18 +20497,18 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20497
20497
|
if (!w) return null;
|
|
20498
20498
|
const x = w.closest(".table-cell");
|
|
20499
20499
|
if (!x) return null;
|
|
20500
|
-
const
|
|
20501
|
-
return !Number.isFinite(
|
|
20500
|
+
const B = Number(x.getAttribute("data-row") ?? x.dataset.row), q = Number(x.getAttribute("data-col") ?? x.dataset.col);
|
|
20501
|
+
return !Number.isFinite(B) || !Number.isFinite(q) ? null : { r: B, c: q, el: x };
|
|
20502
20502
|
}
|
|
20503
|
-
function
|
|
20503
|
+
function Un(v) {
|
|
20504
20504
|
if (!o.value) return;
|
|
20505
20505
|
const w = v.target;
|
|
20506
20506
|
if (!w) return;
|
|
20507
20507
|
const x = w.closest(".table-cell-inner");
|
|
20508
20508
|
if (!x) return;
|
|
20509
|
-
const
|
|
20510
|
-
if (!
|
|
20511
|
-
const q = Number(
|
|
20509
|
+
const B = x.closest(".table-cell");
|
|
20510
|
+
if (!B) return;
|
|
20511
|
+
const q = Number(B.getAttribute("data-row")), Q = Number(B.getAttribute("data-col"));
|
|
20512
20512
|
!Number.isFinite(q) || !Number.isFinite(Q) || vn(q, Q, x, v);
|
|
20513
20513
|
}
|
|
20514
20514
|
function un(v) {
|
|
@@ -20522,45 +20522,45 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20522
20522
|
return;
|
|
20523
20523
|
}
|
|
20524
20524
|
V.visible && ut();
|
|
20525
|
-
const
|
|
20526
|
-
if (!
|
|
20525
|
+
const B = Ye(v);
|
|
20526
|
+
if (!B || v.button !== 0) return;
|
|
20527
20527
|
const q = m.value;
|
|
20528
|
-
if (q && q.row ===
|
|
20528
|
+
if (q && q.row === B.r && q.col === B.c) {
|
|
20529
20529
|
it = !0, document.addEventListener("mouseup", sn, { once: !0, capture: !0 });
|
|
20530
20530
|
return;
|
|
20531
20531
|
}
|
|
20532
20532
|
v.preventDefault(), v.stopPropagation();
|
|
20533
|
-
const { r: Q, c: de } =
|
|
20533
|
+
const { r: Q, c: de } = B, ge = document.activeElement;
|
|
20534
20534
|
ge && ge.closest(".table-cell-inner") && ge.blur(), m.value = null, (Re = (ke = n.commands).selectBlock) == null || Re.call(ke, { id: i }), k(), M = A.value !== null, M && (O = !0, W && (clearTimeout(W), W = null), _ && (clearTimeout(_), _ = null)), G.value = { kind: "none" }, X = !0;
|
|
20535
20535
|
const Ce = { row: Q, col: de };
|
|
20536
|
-
le.value = { start: Ce, current: Ce }, f.value = { anchor: Ce, focus: Ce }, document.addEventListener("mouseup",
|
|
20536
|
+
le.value = { start: Ce, current: Ce }, f.value = { anchor: Ce, focus: Ce }, document.addEventListener("mouseup", zn, !0);
|
|
20537
20537
|
}
|
|
20538
|
-
function
|
|
20538
|
+
function Dn(v) {
|
|
20539
20539
|
if (!X || !le.value) return;
|
|
20540
20540
|
const w = Ye(v);
|
|
20541
20541
|
if (!w) return;
|
|
20542
|
-
const { r: x, c:
|
|
20543
|
-
if (x === q.row &&
|
|
20544
|
-
le.value = { ...le.value, current: { row: x, col:
|
|
20542
|
+
const { r: x, c: B } = w, q = le.value.current;
|
|
20543
|
+
if (x === q.row && B === q.col) return;
|
|
20544
|
+
le.value = { ...le.value, current: { row: x, col: B } };
|
|
20545
20545
|
const Q = le.value.start;
|
|
20546
|
-
f.value = { anchor: Q, focus: { row: x, col:
|
|
20546
|
+
f.value = { anchor: Q, focus: { row: x, col: B } };
|
|
20547
20547
|
}
|
|
20548
|
-
function
|
|
20548
|
+
function Fn(v) {
|
|
20549
20549
|
if (!o.value) return;
|
|
20550
20550
|
const w = v.target;
|
|
20551
20551
|
if (w.tagName === "INPUT" && w.classList.contains("table-cell-todo-checkbox") || w.classList.contains("table-cell-ol-marker"))
|
|
20552
20552
|
return;
|
|
20553
20553
|
const x = Ye(v);
|
|
20554
20554
|
if (!x) return;
|
|
20555
|
-
const { r:
|
|
20556
|
-
Q && Q.row ===
|
|
20557
|
-
const de = `${
|
|
20555
|
+
const { r: B, c: q } = x, Q = m.value;
|
|
20556
|
+
Q && Q.row === B && Q.col === q || (v.preventDefault(), v.stopPropagation(), _ && (clearTimeout(_), _ = null), O = !1, X = !1, le.value = null, f.value = null, G.value = { kind: "none" }, P(0), document.removeEventListener("mouseup", zn, !0), m.value = { row: B, col: q }, qe(() => {
|
|
20557
|
+
const de = `${B}-${q}`, ge = h.get(de);
|
|
20558
20558
|
ge && (ge.focus(), ml(ge));
|
|
20559
20559
|
}));
|
|
20560
20560
|
}
|
|
20561
|
-
function
|
|
20561
|
+
function zn(v) {
|
|
20562
20562
|
if (X && le.value) {
|
|
20563
|
-
const w = le.value.start, x = le.value.current,
|
|
20563
|
+
const w = le.value.start, x = le.value.current, B = Math.min(w.row, x.row), q = Math.min(w.col, x.col), Q = Math.max(w.row, x.row), de = Math.max(w.col, x.col), ge = io(u.value, B, q, Q, de), { r1: Ce, c1: ke, r2: Re, c2: Be } = ge;
|
|
20564
20564
|
if (G.value = { kind: "cell", rect: { r1: Ce, c1: ke, r2: Re, c2: Be } }, f.value = {
|
|
20565
20565
|
anchor: { row: Ce, col: ke },
|
|
20566
20566
|
focus: { row: Re, col: Be }
|
|
@@ -20579,7 +20579,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20579
20579
|
st && Lt(st);
|
|
20580
20580
|
}, 250);
|
|
20581
20581
|
}
|
|
20582
|
-
X = !1, le.value = null, document.removeEventListener("mouseup",
|
|
20582
|
+
X = !1, le.value = null, document.removeEventListener("mouseup", zn, !0);
|
|
20583
20583
|
}
|
|
20584
20584
|
function Le(v) {
|
|
20585
20585
|
if (G.value.kind === "row" && G.value.row === v) {
|
|
@@ -20587,7 +20587,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20587
20587
|
return;
|
|
20588
20588
|
}
|
|
20589
20589
|
A.value !== null && (O = !0);
|
|
20590
|
-
const w = u.value, x = w.cols,
|
|
20590
|
+
const w = u.value, x = w.cols, B = v, q = 0, Q = v, de = Math.max(0, x - 1), ge = x > 0 ? io(w, B, q, Q, de) : { r1: B, c1: q, r2: Q, c2: de };
|
|
20591
20591
|
G.value = { kind: "row", row: v }, f.value = x > 0 ? { anchor: { row: ge.r1, col: ge.c1 }, focus: { row: ge.r2, col: ge.c2 } } : null, m.value = null;
|
|
20592
20592
|
const Ce = document.activeElement;
|
|
20593
20593
|
Ce && Ce.closest(".table-cell-inner") && Ce.blur(), k(), qe(() => {
|
|
@@ -20601,7 +20601,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20601
20601
|
return;
|
|
20602
20602
|
}
|
|
20603
20603
|
A.value !== null && (O = !0);
|
|
20604
|
-
const w = u.value, x = w.rows,
|
|
20604
|
+
const w = u.value, x = w.rows, B = 0, q = v, Q = Math.max(0, x - 1), de = v, ge = x > 0 ? io(w, B, q, Q, de) : { r1: B, c1: q, r2: Q, c2: de };
|
|
20605
20605
|
G.value = { kind: "col", col: v }, f.value = x > 0 ? { anchor: { row: ge.r1, col: ge.c1 }, focus: { row: ge.r2, col: ge.c2 } } : null, m.value = null;
|
|
20606
20606
|
const Ce = document.activeElement;
|
|
20607
20607
|
Ce && Ce.closest(".table-cell-inner") && Ce.blur(), k(), qe(() => {
|
|
@@ -20625,16 +20625,16 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20625
20625
|
}, m.value = null;
|
|
20626
20626
|
const x = document.activeElement;
|
|
20627
20627
|
x && x.closest(".table-cell-inner") && x.blur(), k(), qe(() => {
|
|
20628
|
-
const
|
|
20628
|
+
const B = zt.value, q = B.rowTops[0] ?? 0, Q = B.colLefts[0] ?? 0, de = B.colWidths.length > 0 ? B.colWidths.reduce((Re, Be) => Re + Be, 0) : v.colWidths.reduce((Re, Be) => Re + Be, 0), ge = B.rowTops[v.rows - 1] ?? 0, Ce = B.rowHeights[v.rows - 1] ?? 32, ke = new DOMRect(Q, q, de, ge + Ce - q);
|
|
20629
20629
|
Lt(ke);
|
|
20630
20630
|
});
|
|
20631
20631
|
}
|
|
20632
|
-
function mt(v, w, x,
|
|
20633
|
-
const q = zt.value, Q = q.rowTops[v] ?? 0, de = q.rowTops[x] ?? 0, ge = q.rowHeights[x] ?? 32, Ce = de + ge, ke = q.colLefts[w] ?? 0, Re = q.colLefts[
|
|
20632
|
+
function mt(v, w, x, B) {
|
|
20633
|
+
const q = zt.value, Q = q.rowTops[v] ?? 0, de = q.rowTops[x] ?? 0, ge = q.rowHeights[x] ?? 32, Ce = de + ge, ke = q.colLefts[w] ?? 0, Re = q.colLefts[B] ?? 0, Be = q.colWidths[B] ?? 80, nt = Re + Be;
|
|
20634
20634
|
return new DOMRect(ke, Q, nt - ke, Ce - Q);
|
|
20635
20635
|
}
|
|
20636
|
-
|
|
20637
|
-
document.removeEventListener("mouseup",
|
|
20636
|
+
Bn(() => {
|
|
20637
|
+
document.removeEventListener("mouseup", zn, !0), document.removeEventListener("mouseup", sn, !0), document.removeEventListener("mousemove", xn, !0), document.removeEventListener("mouseup", Kn, !0), document.removeEventListener("keydown", Je, !0), document.removeEventListener("selectionchange", He), document.removeEventListener("mousedown", $t, !0), window.removeEventListener("scroll", Et, !0), document.removeEventListener("touchmove", Et, !0), document.removeEventListener("mousedown", z, !0), document.removeEventListener("mouseup", oe, !0), _ && (clearTimeout(_), _ = null);
|
|
20638
20638
|
});
|
|
20639
20639
|
function Je(v) {
|
|
20640
20640
|
var q, Q;
|
|
@@ -20687,7 +20687,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20687
20687
|
}
|
|
20688
20688
|
}
|
|
20689
20689
|
oo(() => {
|
|
20690
|
-
document.addEventListener("keydown", Je, !0), document.addEventListener("selectionchange", He), document.addEventListener("mousedown", $t, !0), document.addEventListener("mousedown",
|
|
20690
|
+
document.addEventListener("keydown", Je, !0), document.addEventListener("selectionchange", He), document.addEventListener("mousedown", $t, !0), document.addEventListener("mousedown", z, !0), document.addEventListener("mouseup", oe, !0), window.addEventListener("scroll", Et, !0), document.addEventListener("touchmove", Et, { passive: !0, capture: !0 });
|
|
20691
20691
|
});
|
|
20692
20692
|
const _t = j(null), zt = j({
|
|
20693
20693
|
rowTops: [],
|
|
@@ -20702,12 +20702,12 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20702
20702
|
function Cn() {
|
|
20703
20703
|
const v = p.value, w = _t.value, x = S.value;
|
|
20704
20704
|
if (!v || !w || !x) return;
|
|
20705
|
-
const
|
|
20705
|
+
const B = u.value.rows, q = u.value.cols, Q = w.getBoundingClientRect(), de = x.getBoundingClientRect(), ge = Math.round(Q.left - de.left), Ce = Math.round(Q.top - de.top), ke = Array.from(v.querySelectorAll("tr")), Re = [], Be = [];
|
|
20706
20706
|
for (const Xe of ke) {
|
|
20707
20707
|
const ot = Xe.getBoundingClientRect();
|
|
20708
20708
|
Re.push(Math.round(ot.top - Q.top)), Be.push(Math.round(ot.height));
|
|
20709
20709
|
}
|
|
20710
|
-
for (; Re.length <
|
|
20710
|
+
for (; Re.length < B; ) {
|
|
20711
20711
|
const Xe = Re.length > 0 ? Re[Re.length - 1] + Be[Be.length - 1] : 0;
|
|
20712
20712
|
Re.push(Xe), Be.push(Be.length > 0 ? Be[Be.length - 1] : 32);
|
|
20713
20713
|
}
|
|
@@ -20747,22 +20747,22 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20747
20747
|
}), _t.value && Gt.observe(_t.value), p.value && Gt.observe(p.value);
|
|
20748
20748
|
const v = (w = S.value) == null ? void 0 : w.closest(".block-editor");
|
|
20749
20749
|
v && Gt.observe(v), _t.value && _t.value.addEventListener("scroll", Ne, { passive: !0 }), he();
|
|
20750
|
-
}),
|
|
20750
|
+
}), Bn(() => {
|
|
20751
20751
|
var v;
|
|
20752
|
-
Gt == null || Gt.disconnect(), _t.value && _t.value.removeEventListener("scroll", Ne), b && cancelAnimationFrame(b),
|
|
20752
|
+
Gt == null || Gt.disconnect(), _t.value && _t.value.removeEventListener("scroll", Ne), b && cancelAnimationFrame(b), L && clearTimeout(L), l && ((v = l.value) == null ? void 0 : v.blockId) === i && (l.value = null);
|
|
20753
20753
|
});
|
|
20754
|
-
function
|
|
20754
|
+
function Mn(v, w) {
|
|
20755
20755
|
if (!o.value) return;
|
|
20756
|
-
w.preventDefault(), w.stopPropagation(), $.value = v, ce = zt.value.colWidths[v] ?? 80, U = w.clientX, document.addEventListener("mousemove",
|
|
20756
|
+
w.preventDefault(), w.stopPropagation(), $.value = v, ce = zt.value.colWidths[v] ?? 80, U = w.clientX, document.addEventListener("mousemove", xn, !0), document.addEventListener("mouseup", Kn, !0), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
20757
20757
|
}
|
|
20758
|
-
function
|
|
20758
|
+
function xn(v) {
|
|
20759
20759
|
var Q, de;
|
|
20760
20760
|
if ($.value === null) return;
|
|
20761
20761
|
const w = v.clientX - U;
|
|
20762
20762
|
let x = Math.max(40, Math.round(ce + w));
|
|
20763
|
-
const
|
|
20764
|
-
if (
|
|
20765
|
-
const ge =
|
|
20763
|
+
const B = _t.value;
|
|
20764
|
+
if (B) {
|
|
20765
|
+
const ge = B.clientWidth - 4, Ce = u.value.colWidths.reduce((Re, Be, nt) => nt === $.value ? Re : Re + Be, 0);
|
|
20766
20766
|
if (Ce + x <= ge) {
|
|
20767
20767
|
const Re = Math.max(40, ge - Ce);
|
|
20768
20768
|
x = Math.min(x, Re);
|
|
@@ -20772,32 +20772,32 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20772
20772
|
(de = (Q = n.commands).setAttrs) == null || de.call(Q, { id: i, attrs: q });
|
|
20773
20773
|
}
|
|
20774
20774
|
function Kn() {
|
|
20775
|
-
$.value = null, document.removeEventListener("mousemove",
|
|
20775
|
+
$.value = null, document.removeEventListener("mousemove", xn, !0), document.removeEventListener("mouseup", Kn, !0), document.body.style.cursor = "", document.body.style.userSelect = "", qe(() => {
|
|
20776
20776
|
Cn(), he();
|
|
20777
20777
|
});
|
|
20778
20778
|
}
|
|
20779
|
-
const
|
|
20780
|
-
let b = 0,
|
|
20779
|
+
const _n = j(0), po = j(0), Wn = j(0), R = j(!1);
|
|
20780
|
+
let b = 0, L;
|
|
20781
20781
|
function he() {
|
|
20782
20782
|
const v = _t.value;
|
|
20783
|
-
v && (
|
|
20783
|
+
v && (_n.value = v.scrollLeft, po.value = v.clientWidth, Wn.value = v.scrollWidth);
|
|
20784
20784
|
}
|
|
20785
20785
|
function Ne() {
|
|
20786
20786
|
R.value || (R.value = !0), b && cancelAnimationFrame(b), b = requestAnimationFrame(() => {
|
|
20787
20787
|
b = 0, he();
|
|
20788
|
-
}),
|
|
20788
|
+
}), L && clearTimeout(L), L = setTimeout(() => {
|
|
20789
20789
|
R.value = !1, he();
|
|
20790
20790
|
}, 130);
|
|
20791
20791
|
}
|
|
20792
20792
|
const Ke = Me(() => {
|
|
20793
20793
|
if (!o.value) return [];
|
|
20794
|
-
const v = zt.value, w = u.value.cols, x = v.colLefts,
|
|
20795
|
-
if (w === 0 || x.length < w ||
|
|
20796
|
-
const q =
|
|
20794
|
+
const v = zt.value, w = u.value.cols, x = v.colLefts, B = v.colWidths;
|
|
20795
|
+
if (w === 0 || x.length < w || B.length < w) return [];
|
|
20796
|
+
const q = _n.value, Q = po.value, de = Wn.value;
|
|
20797
20797
|
if (Q <= 0) return [];
|
|
20798
20798
|
const ge = q <= 0, Ce = q + Q >= de - 1, ke = de <= Q + 1, Re = 6, Be = [];
|
|
20799
20799
|
for (let nt = 0; nt <= w; nt++) {
|
|
20800
|
-
const vt = (nt === 0 ? x[0] ?? 0 : nt === w ? (x[w - 1] ?? 0) + (
|
|
20800
|
+
const vt = (nt === 0 ? x[0] ?? 0 : nt === w ? (x[w - 1] ?? 0) + (B[w - 1] ?? 0) : x[nt] ?? 0) - q;
|
|
20801
20801
|
let cn = vt >= -1 && vt <= Q + 1;
|
|
20802
20802
|
if (nt === 0 && (ge || ke) && (cn = !0), nt === w && (Ce || ke) && (cn = !0), !cn) continue;
|
|
20803
20803
|
const dn = Math.max(Re, Math.min(vt, Q - Re)) + (nt > 0 ? 2 : -2);
|
|
@@ -20806,18 +20806,18 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20806
20806
|
return Be;
|
|
20807
20807
|
});
|
|
20808
20808
|
function Pe(v, w) {
|
|
20809
|
-
var
|
|
20809
|
+
var B, q;
|
|
20810
20810
|
const x = { id: i, ...w };
|
|
20811
|
-
(q = (
|
|
20811
|
+
(q = (B = n.commands)[v]) == null || q.call(B, x);
|
|
20812
20812
|
}
|
|
20813
20813
|
function Ee() {
|
|
20814
20814
|
m.value = null, f.value = null, G.value.kind !== "none" && (G.value = { kind: "none" }), P(0), ue(), Ie();
|
|
20815
20815
|
}
|
|
20816
20816
|
return t({ clearInnerFocus: Ee }), () => {
|
|
20817
20817
|
var ho, jo, Po, Ql, Jl, ei, ti, ni, oi, ri, li;
|
|
20818
|
-
const v = u.value, w = v.rows, x = v.cols,
|
|
20818
|
+
const v = u.value, w = v.rows, x = v.cols, B = lr(f.value), q = B ? io(v, B.r1, B.c1, B.r2, B.c2) : null, Q = zt.value, de = G.value, ge = [], Ce = ve("div", { class: "table-toolbar" }, [
|
|
20819
20819
|
ve("div", { class: "table-toolbar-title" }, [
|
|
20820
|
-
ve(
|
|
20820
|
+
ve(In, { html: Pr, class: "table-toolbar-icon" }),
|
|
20821
20821
|
ve("span", r.t("table.title"))
|
|
20822
20822
|
])
|
|
20823
20823
|
]), ke = [];
|
|
@@ -20842,10 +20842,10 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
20842
20842
|
ii !== "top" && (si = { verticalAlign: ii });
|
|
20843
20843
|
const ci = !uc && ((jo = m.value) == null ? void 0 : jo.row) === Y && ((Po = m.value) == null ? void 0 : Po.col) === Ae;
|
|
20844
20844
|
ci && Co.push("table-cell-focused");
|
|
20845
|
-
const
|
|
20846
|
-
kn === "heading" || kn === "heading1" ?
|
|
20845
|
+
const Sn = ["table-cell-inner"], kn = xe.cellType;
|
|
20846
|
+
kn === "heading" || kn === "heading1" ? Sn.push("table-cell-heading", "table-cell-h1") : kn === "heading2" ? Sn.push("table-cell-heading", "table-cell-h2") : kn === "heading3" ? Sn.push("table-cell-heading", "table-cell-h3") : kn === "heading4" ? Sn.push("table-cell-heading", "table-cell-h4") : kn === "heading5" ? Sn.push("table-cell-heading", "table-cell-h5") : kn === "heading6" ? Sn.push("table-cell-heading", "table-cell-h6") : kn === "bulletList" ? Sn.push("table-cell-bullet") : kn === "orderedList" ? Sn.push("table-cell-ordered") : kn === "todoList" ? (Sn.push("table-cell-todo"), xe.checked && Sn.push("todo-checked")) : kn === "quote" ? Sn.push("table-cell-quote") : kn === "codeBlock" && Sn.push("table-cell-code");
|
|
20847
20847
|
const ai = kn === "orderedList" ? wl(v, Y, Ae) : -1, rl = ve("div", {
|
|
20848
|
-
class:
|
|
20848
|
+
class: Sn,
|
|
20849
20849
|
// contenteditable is ONLY true when this cell is in editing
|
|
20850
20850
|
// mode (set via focusedCell after dblclick) AND the editor is
|
|
20851
20851
|
// in editable mode. Otherwise false → clicks won't grab focus,
|
|
@@ -21013,7 +21013,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
21013
21013
|
ve("div", {
|
|
21014
21014
|
class: "table-col-resizer",
|
|
21015
21015
|
title: r.t("table.resizeCol"),
|
|
21016
|
-
onMousedown: (xe) =>
|
|
21016
|
+
onMousedown: (xe) => Mn(Y, xe)
|
|
21017
21017
|
})
|
|
21018
21018
|
]));
|
|
21019
21019
|
}
|
|
@@ -21221,7 +21221,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
21221
21221
|
let ft = "paragraph";
|
|
21222
21222
|
const nn = {};
|
|
21223
21223
|
Ge === "heading" || Ge === "heading1" ? (ft = "heading", nn.level = 1) : Ge === "heading2" ? (ft = "heading", nn.level = 2) : Ge === "heading3" ? (ft = "heading", nn.level = 3) : Ge === "heading4" ? (ft = "heading", nn.level = 4) : Ge === "heading5" ? (ft = "heading", nn.level = 5) : Ge === "heading6" ? (ft = "heading", nn.level = 6) : Ge === "bulletList" ? ft = "bulletList" : Ge === "orderedList" ? ft = "orderedList" : Ge === "todoList" ? ft = "todoList" : Ge === "quote" ? ft = "quote" : Ge === "codeBlock" && (ft = "codeBlock"), typeof (tn == null ? void 0 : tn.align) == "string" && (nn.align = tn.align), typeof (tn == null ? void 0 : tn.verticalAlign) == "string" && (nn.verticalAlign = tn.verticalAlign);
|
|
21224
|
-
const
|
|
21224
|
+
const $n = {
|
|
21225
21225
|
visible: I.visible && !!I.selectionRect,
|
|
21226
21226
|
selectionRect: I.selectionRect,
|
|
21227
21227
|
blockId: i,
|
|
@@ -21254,7 +21254,7 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
21254
21254
|
Bt();
|
|
21255
21255
|
}
|
|
21256
21256
|
};
|
|
21257
|
-
return l && (
|
|
21257
|
+
return l && ($n.visible ? d($n) : ((ri = l.value) == null ? void 0 : ri.blockId) === i && ((li = l.value) != null && li.cellEditMode) && d(null)), ge.push(
|
|
21258
21258
|
ve(Bs, {
|
|
21259
21259
|
visible: V.visible,
|
|
21260
21260
|
anchorRect: V.anchorRect,
|
|
@@ -21305,12 +21305,12 @@ const Pr = '<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="
|
|
|
21305
21305
|
class: ["block-table-container", "block-focus-root", ...jn(e.block.attrs)],
|
|
21306
21306
|
ref: S,
|
|
21307
21307
|
tabindex: "-1",
|
|
21308
|
-
onClick:
|
|
21308
|
+
onClick: K,
|
|
21309
21309
|
onMousedown: un,
|
|
21310
|
-
onMouseover:
|
|
21311
|
-
onDblclick:
|
|
21310
|
+
onMouseover: Dn,
|
|
21311
|
+
onDblclick: Fn,
|
|
21312
21312
|
onFocusout: ht,
|
|
21313
|
-
onKeydown:
|
|
21313
|
+
onKeydown: Un
|
|
21314
21314
|
},
|
|
21315
21315
|
ge
|
|
21316
21316
|
);
|
|
@@ -21518,13 +21518,13 @@ function B3() {
|
|
|
21518
21518
|
const $ = t.selection, U = $.kind === "caret" ? $.blockId : $.kind === "text" ? $.focus.blockId : $.blockIds[0] ?? null;
|
|
21519
21519
|
U && (h = U);
|
|
21520
21520
|
}
|
|
21521
|
-
if (h && (t.doc.blocks.get(h) ? (d = jt(t.doc, h), u =
|
|
21521
|
+
if (h && (t.doc.blocks.get(h) ? (d = jt(t.doc, h), u = Ln(t.doc, h)) : h = null), !h)
|
|
21522
21522
|
if (e.after) {
|
|
21523
21523
|
if (!t.doc.blocks.get(e.after)) return !1;
|
|
21524
|
-
d = jt(t.doc, e.after), u =
|
|
21524
|
+
d = jt(t.doc, e.after), u = Ln(t.doc, e.after) + 1;
|
|
21525
21525
|
} else {
|
|
21526
21526
|
const $ = t.selection, U = $.kind === "caret" ? $.blockId : $.kind === "text" ? $.focus.blockId : $.blockIds[0] ?? null;
|
|
21527
|
-
U && (d = jt(t.doc, U), u =
|
|
21527
|
+
U && (d = jt(t.doc, U), u = Ln(t.doc, U) + 1);
|
|
21528
21528
|
}
|
|
21529
21529
|
const p = bt();
|
|
21530
21530
|
h && p.removeBlock(h);
|
|
@@ -21534,7 +21534,7 @@ function B3() {
|
|
|
21534
21534
|
type: "table",
|
|
21535
21535
|
attrs: m,
|
|
21536
21536
|
content: []
|
|
21537
|
-
}), D = _l(t.doc, p.peek()), F = vr(D.doc, T),
|
|
21537
|
+
}), D = _l(t.doc, p.peek()), F = vr(D.doc, T), z = yo(D.doc, T), oe = F ?? z;
|
|
21538
21538
|
return oe ? p.setSelection(yt(oe.id, 0)) : p.setSelection(yt(T, 0)), n == null || n(p.build()), !0;
|
|
21539
21539
|
}
|
|
21540
21540
|
};
|
|
@@ -21707,13 +21707,13 @@ const H3 = Ft({
|
|
|
21707
21707
|
},
|
|
21708
21708
|
setup(e) {
|
|
21709
21709
|
e.block, e.placeholder;
|
|
21710
|
-
const t =
|
|
21710
|
+
const t = Hn(), n = Tn(), o = j(null), r = j(0), i = Me(() => (r.value, P3(t.getState().doc)));
|
|
21711
21711
|
let l = null;
|
|
21712
21712
|
oo(() => {
|
|
21713
21713
|
l = t.subscribe(() => {
|
|
21714
21714
|
r.value++;
|
|
21715
21715
|
});
|
|
21716
|
-
}),
|
|
21716
|
+
}), Bn(() => {
|
|
21717
21717
|
l == null || l();
|
|
21718
21718
|
});
|
|
21719
21719
|
function s(c) {
|
|
@@ -21833,7 +21833,7 @@ const H3 = Ft({
|
|
|
21833
21833
|
c.value = g, a.value = E;
|
|
21834
21834
|
}
|
|
21835
21835
|
);
|
|
21836
|
-
const d =
|
|
21836
|
+
const d = Tn(), u = Me(() => `theme-${s.value}`), h = Me(() => {
|
|
21837
21837
|
const g = {};
|
|
21838
21838
|
return g.width = o.width !== void 0 ? typeof o.width == "number" ? `${o.width}px` : o.width : "100%", g.height = o.height !== void 0 ? typeof o.height == "number" ? `${o.height}px` : o.height : "100%", g;
|
|
21839
21839
|
});
|
|
@@ -21858,8 +21858,8 @@ const H3 = Ft({
|
|
|
21858
21858
|
function F() {
|
|
21859
21859
|
D.value = !!(T != null && T.matches);
|
|
21860
21860
|
}
|
|
21861
|
-
const
|
|
21862
|
-
so(ss, D), so(Ml,
|
|
21861
|
+
const z = j(null);
|
|
21862
|
+
so(ss, D), so(Ml, z);
|
|
21863
21863
|
const oe = Me(() => o.toolbarPosition === "top" ? "top" : o.toolbarPosition === "bottom" || D.value ? "bottom" : "top");
|
|
21864
21864
|
so(yr, Me(() => oe.value === "bottom")), Tt(
|
|
21865
21865
|
() => o.editable,
|
|
@@ -21959,19 +21959,19 @@ const H3 = Ft({
|
|
|
21959
21959
|
type: "image",
|
|
21960
21960
|
attrs: To(Ge)
|
|
21961
21961
|
});
|
|
21962
|
-
const
|
|
21963
|
-
|
|
21962
|
+
const $n = f.getState().selection;
|
|
21963
|
+
$n.kind === "caret" ? ne = $n.blockId : $n.kind === "text" && (ne = $n.anchor.blockId);
|
|
21964
21964
|
}
|
|
21965
21965
|
if (!ne) return null;
|
|
21966
21966
|
if (typeof g == "string") {
|
|
21967
21967
|
const Ge = g;
|
|
21968
21968
|
try {
|
|
21969
|
-
const ft = await new Promise((
|
|
21970
|
-
if (typeof document > "u") return
|
|
21969
|
+
const ft = await new Promise(($n) => {
|
|
21970
|
+
if (typeof document > "u") return $n({});
|
|
21971
21971
|
const ho = document.createElement("img");
|
|
21972
21972
|
let jo = !1;
|
|
21973
21973
|
const Po = () => {
|
|
21974
|
-
jo || (jo = !0,
|
|
21974
|
+
jo || (jo = !0, $n({
|
|
21975
21975
|
width: ho.naturalWidth || void 0,
|
|
21976
21976
|
height: ho.naturalHeight || void 0
|
|
21977
21977
|
}));
|
|
@@ -22012,17 +22012,17 @@ const H3 = Ft({
|
|
|
22012
22012
|
H && E.push({ id: N, block: H });
|
|
22013
22013
|
}
|
|
22014
22014
|
return E;
|
|
22015
|
-
}), _ =
|
|
22015
|
+
}), _ = An({
|
|
22016
22016
|
visible: !1,
|
|
22017
22017
|
anchorEl: null,
|
|
22018
22018
|
blockId: "",
|
|
22019
22019
|
query: "",
|
|
22020
22020
|
mode: "slash"
|
|
22021
|
-
}), O = j(null), M =
|
|
22021
|
+
}), O = j(null), M = An({
|
|
22022
22022
|
visible: !1,
|
|
22023
22023
|
anchorEl: null,
|
|
22024
22024
|
blockId: null
|
|
22025
|
-
}), y = j(null), S =
|
|
22025
|
+
}), y = j(null), S = An({
|
|
22026
22026
|
visible: !1,
|
|
22027
22027
|
selectionRect: null,
|
|
22028
22028
|
blockId: null,
|
|
@@ -22035,24 +22035,24 @@ const H3 = Ft({
|
|
|
22035
22035
|
I = !1, V = null, st({ force: !0 });
|
|
22036
22036
|
}, 500);
|
|
22037
22037
|
}
|
|
22038
|
-
const ae =
|
|
22038
|
+
const ae = An({
|
|
22039
22039
|
visible: !1,
|
|
22040
22040
|
blockId: null,
|
|
22041
22041
|
anchor: null,
|
|
22042
22042
|
canContinue: !1,
|
|
22043
22043
|
canStartNew: !1,
|
|
22044
22044
|
currentNumber: 1
|
|
22045
|
-
}), ye =
|
|
22045
|
+
}), ye = An({
|
|
22046
22046
|
visible: !1,
|
|
22047
22047
|
initialValue: 1,
|
|
22048
22048
|
anchor: null,
|
|
22049
22049
|
blockId: null
|
|
22050
|
-
}), pe =
|
|
22050
|
+
}), pe = An({
|
|
22051
22051
|
visible: !1,
|
|
22052
22052
|
initialValue: "plain",
|
|
22053
22053
|
anchor: null,
|
|
22054
22054
|
blockId: null
|
|
22055
|
-
}), ue =
|
|
22055
|
+
}), ue = An({
|
|
22056
22056
|
visible: !1,
|
|
22057
22057
|
anchorRect: null,
|
|
22058
22058
|
blockId: null,
|
|
@@ -22128,7 +22128,7 @@ const H3 = Ft({
|
|
|
22128
22128
|
function Ht() {
|
|
22129
22129
|
var E;
|
|
22130
22130
|
if (!m.value) return;
|
|
22131
|
-
|
|
22131
|
+
Dn();
|
|
22132
22132
|
const g = f.getState().selection;
|
|
22133
22133
|
if (g.kind === "caret") {
|
|
22134
22134
|
const N = Ie(g.blockId, g.offset);
|
|
@@ -22213,9 +22213,9 @@ const H3 = Ft({
|
|
|
22213
22213
|
Dt = 0, it && P(it);
|
|
22214
22214
|
})));
|
|
22215
22215
|
}
|
|
22216
|
-
function
|
|
22216
|
+
function K() {
|
|
22217
22217
|
if (!be) return;
|
|
22218
|
-
be = null, Dt && (cancelAnimationFrame(Dt), Dt = 0), it = null, document.removeEventListener("mousemove", k, !0), document.removeEventListener("mouseup",
|
|
22218
|
+
be = null, Dt && (cancelAnimationFrame(Dt), Dt = 0), it = null, document.removeEventListener("mousemove", k, !0), document.removeEventListener("mouseup", K, !0), document.removeEventListener("selectstart", Lt, !0), pt();
|
|
22219
22219
|
const g = f.getState().selection;
|
|
22220
22220
|
g.kind === "text" && on(g) && dn(g);
|
|
22221
22221
|
}
|
|
@@ -22307,8 +22307,8 @@ const H3 = Ft({
|
|
|
22307
22307
|
},
|
|
22308
22308
|
{ deep: !0 }
|
|
22309
22309
|
);
|
|
22310
|
-
const Ye = j(null),
|
|
22311
|
-
function
|
|
22310
|
+
const Ye = j(null), Un = j(null), un = () => Un.value;
|
|
22311
|
+
function Dn() {
|
|
22312
22312
|
const g = Ye.value;
|
|
22313
22313
|
if (!g) return;
|
|
22314
22314
|
const E = yi(g, f.getState().doc);
|
|
@@ -22320,7 +22320,7 @@ const H3 = Ft({
|
|
|
22320
22320
|
};
|
|
22321
22321
|
X = !0, f.dispatch(N), X = !1;
|
|
22322
22322
|
}
|
|
22323
|
-
function
|
|
22323
|
+
function Fn(g) {
|
|
22324
22324
|
var ne, se, re, ee, we, Ve, We, gt, Qe, ct, je, kt;
|
|
22325
22325
|
if (_.visible && ((ne = O.value) != null && ne.onKeyDown(g)) || M.visible && ((se = y.value) != null && se.onKeyDown(g))) return;
|
|
22326
22326
|
if (!m.value) {
|
|
@@ -22366,7 +22366,7 @@ const H3 = Ft({
|
|
|
22366
22366
|
if (E && E.classList.contains("image-block-caption") || E && E.closest(".table-cell-inner"))
|
|
22367
22367
|
return;
|
|
22368
22368
|
const N = f.getState().selection;
|
|
22369
|
-
N.kind === "text" && on(N) ||
|
|
22369
|
+
N.kind === "text" && on(N) || Dn();
|
|
22370
22370
|
const H = f.getState().selection;
|
|
22371
22371
|
if (H.kind === "text" && on(H) && !g.isComposing) {
|
|
22372
22372
|
const Ue = g.key, Kt = Ue.length === 1 && !g.ctrlKey && !g.metaKey && !g.altKey;
|
|
@@ -22422,8 +22422,8 @@ const H3 = Ft({
|
|
|
22422
22422
|
if (Mt && f.registries.schema.get(Mt.type).isolating) {
|
|
22423
22423
|
const Ut = Fe(Mt.content), en = Ut.slice(0, Ct), St = Ut.slice(Ct), tn = en.lastIndexOf(`
|
|
22424
22424
|
`) + 1, Ge = St.indexOf(`
|
|
22425
|
-
`), ft = Ge === -1 ? Ut.length : Ct + Ge, nn = tn === 0,
|
|
22426
|
-
if (g.key === "ArrowUp" && !nn || g.key === "ArrowDown" &&
|
|
22425
|
+
`), ft = Ge === -1 ? Ut.length : Ct + Ge, nn = tn === 0, $n = ft === Ut.length;
|
|
22426
|
+
if (g.key === "ArrowUp" && !nn || g.key === "ArrowDown" && !$n)
|
|
22427
22427
|
return;
|
|
22428
22428
|
}
|
|
22429
22429
|
}
|
|
@@ -22436,11 +22436,11 @@ const H3 = Ft({
|
|
|
22436
22436
|
const Ue = f.getState().selection;
|
|
22437
22437
|
if (Ue.kind === "caret" || Ue.kind === "text") {
|
|
22438
22438
|
const Kt = Ue.kind === "caret" ? Ue.blockId : Ue.focus.blockId, Ct = Ue.kind === "caret" ? Ue.offset : Ue.focus.offset, Mt = f.getState().doc.blocks.get(Kt);
|
|
22439
|
-
Mt && f.registries.schema.get(Mt.type).isolating && (g.preventDefault(),
|
|
22439
|
+
Mt && f.registries.schema.get(Mt.type).isolating && (g.preventDefault(), zn(Kt, Ct));
|
|
22440
22440
|
}
|
|
22441
22441
|
}
|
|
22442
22442
|
}
|
|
22443
|
-
function
|
|
22443
|
+
function zn(g, E) {
|
|
22444
22444
|
const N = f.getState().doc.blocks.get(g);
|
|
22445
22445
|
if (!N) return;
|
|
22446
22446
|
const [H, J] = pn(N.content, E), ne = [...H, { type: "text", text: `
|
|
@@ -22468,23 +22468,23 @@ const H3 = Ft({
|
|
|
22468
22468
|
f.dispatch(Ve);
|
|
22469
22469
|
}
|
|
22470
22470
|
const Le = j(null), $e = j("after");
|
|
22471
|
-
let tt = "idle", mt = 0, Je = 0, $t = 4, Et = null, _t = null, zt = 0, Cn = 0, Gt = null,
|
|
22472
|
-
function
|
|
22473
|
-
Kn !== null && (clearTimeout(Kn), Kn = null),
|
|
22471
|
+
let tt = "idle", mt = 0, Je = 0, $t = 4, Et = null, _t = null, zt = 0, Cn = 0, Gt = null, Mn = null, xn = null, Kn = null;
|
|
22472
|
+
function _n() {
|
|
22473
|
+
Kn !== null && (clearTimeout(Kn), Kn = null), xn = null;
|
|
22474
22474
|
}
|
|
22475
22475
|
function po() {
|
|
22476
22476
|
var g;
|
|
22477
|
-
Gt && (Gt.classList.remove("block-being-dragged"), Gt = null), _t && (_t.remove(), _t = null),
|
|
22477
|
+
Gt && (Gt.classList.remove("block-being-dragged"), Gt = null), _t && (_t.remove(), _t = null), Mn !== null && ((g = un()) == null || g.setBlockHandleDragging(Mn, !1)), Mn = null, Et = null, tt = "idle", Bt.value = null, Le.value = null, $e.value = "after", _n();
|
|
22478
22478
|
}
|
|
22479
22479
|
function Wn() {
|
|
22480
|
-
document.removeEventListener("mousemove", he, !0), document.removeEventListener("mouseup", Ne, !0), document.removeEventListener("selectstart",
|
|
22480
|
+
document.removeEventListener("mousemove", he, !0), document.removeEventListener("mouseup", Ne, !0), document.removeEventListener("selectstart", L, !0);
|
|
22481
22481
|
}
|
|
22482
22482
|
function R(g, E, N, H) {
|
|
22483
|
-
m.value && (tt !== "idle" && (Wn(), po()), tt = "pending", Et = g, mt = E, Je = N, $t = H.thresholdPx, document.addEventListener("selectstart",
|
|
22483
|
+
m.value && (tt !== "idle" && (Wn(), po()), tt = "pending", Et = g, mt = E, Je = N, $t = H.thresholdPx, document.addEventListener("selectstart", L, !0), document.addEventListener("mousemove", he, !0), document.addEventListener("mouseup", Ne, !0));
|
|
22484
22484
|
}
|
|
22485
22485
|
function b(g) {
|
|
22486
22486
|
}
|
|
22487
|
-
function
|
|
22487
|
+
function L(g) {
|
|
22488
22488
|
g.preventDefault();
|
|
22489
22489
|
}
|
|
22490
22490
|
function he(g) {
|
|
@@ -22500,7 +22500,7 @@ const H3 = Ft({
|
|
|
22500
22500
|
} catch {
|
|
22501
22501
|
}
|
|
22502
22502
|
_t && (_t.style.left = `${g.clientX + zt}px`, _t.style.top = `${g.clientY + Cn}px`);
|
|
22503
|
-
const E =
|
|
22503
|
+
const E = Mn;
|
|
22504
22504
|
if (!E) return;
|
|
22505
22505
|
const N = Array.from(document.querySelectorAll(".block-host"));
|
|
22506
22506
|
if (N.length <= 1) {
|
|
@@ -22509,26 +22509,26 @@ const H3 = Ft({
|
|
|
22509
22509
|
}
|
|
22510
22510
|
const H = N[0].getBoundingClientRect(), J = N[N.length - 1].getBoundingClientRect();
|
|
22511
22511
|
if (g.clientY < H.top + H.height / 2) {
|
|
22512
|
-
|
|
22512
|
+
_n(), Le.value = null, $e.value = "first";
|
|
22513
22513
|
return;
|
|
22514
22514
|
}
|
|
22515
22515
|
if (g.clientY > J.bottom - J.height / 2) {
|
|
22516
|
-
|
|
22516
|
+
_n(), Le.value = null, $e.value = "last";
|
|
22517
22517
|
return;
|
|
22518
22518
|
}
|
|
22519
22519
|
const ne = document.elementFromPoint(g.clientX, g.clientY);
|
|
22520
22520
|
if (!ne) {
|
|
22521
|
-
|
|
22521
|
+
_n(), Le.value = null;
|
|
22522
22522
|
return;
|
|
22523
22523
|
}
|
|
22524
22524
|
const se = ne.closest(".block-host");
|
|
22525
22525
|
if (!se) {
|
|
22526
|
-
|
|
22526
|
+
_n(), Le.value = null;
|
|
22527
22527
|
return;
|
|
22528
22528
|
}
|
|
22529
22529
|
const re = se.dataset.blockId;
|
|
22530
22530
|
if (!re || re === E) {
|
|
22531
|
-
|
|
22531
|
+
_n(), Le.value = null;
|
|
22532
22532
|
return;
|
|
22533
22533
|
}
|
|
22534
22534
|
const ee = se.getBoundingClientRect(), we = ee.height === 0 ? 0 : (g.clientY - ee.top) / ee.height;
|
|
@@ -22550,18 +22550,18 @@ const H3 = Ft({
|
|
|
22550
22550
|
if (we > V3 && we < G3 && Ve) {
|
|
22551
22551
|
Le.value = re;
|
|
22552
22552
|
const je = we < 0.5;
|
|
22553
|
-
|
|
22554
|
-
|
|
22553
|
+
xn !== re && (_n(), xn = re, Kn = setTimeout(() => {
|
|
22554
|
+
xn === re && (Le.value = re, $e.value = "into");
|
|
22555
22555
|
}, W3)), $e.value !== "into" && ($e.value = je ? "before" : "after");
|
|
22556
22556
|
} else
|
|
22557
|
-
|
|
22557
|
+
_n(), Le.value = re, $e.value = we < 0.5 ? "before" : "after";
|
|
22558
22558
|
}
|
|
22559
22559
|
function Ne(g) {
|
|
22560
22560
|
if (Wn(), tt === "pending") {
|
|
22561
22561
|
tt = "idle", Et = null;
|
|
22562
22562
|
return;
|
|
22563
22563
|
}
|
|
22564
|
-
const E =
|
|
22564
|
+
const E = Mn, N = Le.value, H = $e.value;
|
|
22565
22565
|
po(), E && (H === "into" && !N || !N && H !== "first" && H !== "last" || Pe(E, N, H));
|
|
22566
22566
|
}
|
|
22567
22567
|
function Ke() {
|
|
@@ -22574,7 +22574,7 @@ const H3 = Ft({
|
|
|
22574
22574
|
We && We.removeAllRanges();
|
|
22575
22575
|
} catch {
|
|
22576
22576
|
}
|
|
22577
|
-
be && (be = null, Dt && (cancelAnimationFrame(Dt), Dt = 0), it = null, document.removeEventListener("mousemove", k, !0), document.removeEventListener("mouseup",
|
|
22577
|
+
be && (be = null, Dt && (cancelAnimationFrame(Dt), Dt = 0), it = null, document.removeEventListener("mousemove", k, !0), document.removeEventListener("mouseup", K, !0), document.removeEventListener("selectstart", Lt, !0), He.value = []), Ot(null);
|
|
22578
22578
|
const H = document.querySelector(`.block-host[data-block-id="${g}"]`);
|
|
22579
22579
|
if (!H) {
|
|
22580
22580
|
Wn(), tt = "idle", Et = null;
|
|
@@ -22591,7 +22591,7 @@ const H3 = Ft({
|
|
|
22591
22591
|
const re = document.createElement("div");
|
|
22592
22592
|
re.className = "drag-ghost";
|
|
22593
22593
|
const ee = J.firstElementChild;
|
|
22594
|
-
ee && re.appendChild(ee.cloneNode(!0)), re.style.width = `${se.width}px`, re.style.left = `${E + zt}px`, re.style.top = `${N + Cn}px`, document.body.appendChild(re), _t = re, Bt.value = g,
|
|
22594
|
+
ee && re.appendChild(ee.cloneNode(!0)), re.style.width = `${se.width}px`, re.style.left = `${E + zt}px`, re.style.top = `${N + Cn}px`, document.body.appendChild(re), _t = re, Bt.value = g, Mn = g, Le.value = null, $e.value = "after", (Ve = un()) == null || Ve.setBlockHandleDragging(g, !0), tt = "active";
|
|
22595
22595
|
}
|
|
22596
22596
|
function Pe(g, E, N) {
|
|
22597
22597
|
var We, gt, Qe;
|
|
@@ -22605,7 +22605,7 @@ const H3 = Ft({
|
|
|
22605
22605
|
ct = jt(H, ct);
|
|
22606
22606
|
}
|
|
22607
22607
|
}
|
|
22608
|
-
const ne = jt(H, g), se =
|
|
22608
|
+
const ne = jt(H, g), se = Ln(H, g);
|
|
22609
22609
|
if (se === -1) return;
|
|
22610
22610
|
let re = null, ee;
|
|
22611
22611
|
if (N === "first")
|
|
@@ -22624,7 +22624,7 @@ const H3 = Ft({
|
|
|
22624
22624
|
}
|
|
22625
22625
|
re = E, ee = 0;
|
|
22626
22626
|
} else if ((N === "before" || N === "after") && E) {
|
|
22627
|
-
const ct = jt(H, E), je =
|
|
22627
|
+
const ct = jt(H, E), je = Ln(H, E);
|
|
22628
22628
|
if (je === -1) return;
|
|
22629
22629
|
re = ct, ee = N === "before" ? je : je + 1;
|
|
22630
22630
|
} else
|
|
@@ -22696,7 +22696,7 @@ const H3 = Ft({
|
|
|
22696
22696
|
const E = g.relatedTarget, N = Ye.value;
|
|
22697
22697
|
N && E && N.contains(E) || Ee.value && (Ee.value = !1, Le.value = null, $e.value = "after");
|
|
22698
22698
|
}
|
|
22699
|
-
async function
|
|
22699
|
+
async function B(g) {
|
|
22700
22700
|
if (Bt.value) return;
|
|
22701
22701
|
const E = g.dataTransfer;
|
|
22702
22702
|
if (!E) return;
|
|
@@ -22939,7 +22939,7 @@ const H3 = Ft({
|
|
|
22939
22939
|
re && (H.kind === "text" && on(H) && (X = !0, (ne = (J = f.commands).setSelection) == null || ne.call(J, { selection: yt(re.blockId, re.offset) }), X = !1), be = {
|
|
22940
22940
|
start: { blockId: re.blockId, offset: re.offset },
|
|
22941
22941
|
crossBlock: !1
|
|
22942
|
-
}, document.addEventListener("mousemove", k, !0), document.addEventListener("mouseup",
|
|
22942
|
+
}, document.addEventListener("mousemove", k, !0), document.addEventListener("mouseup", K, !0));
|
|
22943
22943
|
}
|
|
22944
22944
|
}
|
|
22945
22945
|
function Xe() {
|
|
@@ -23171,7 +23171,7 @@ const H3 = Ft({
|
|
|
23171
23171
|
const E = f.getState().selection;
|
|
23172
23172
|
Ei(g, E), g.addEventListener("ordered-list-marker-click", Jn), g.addEventListener("code-lang-click", Er), g.addEventListener("click", eo), g.addEventListener("click", nl);
|
|
23173
23173
|
}), document.addEventListener("selectionchange", st), document.addEventListener("mousedown", qt, !0), document.addEventListener("mouseup", Xe, !0), document.addEventListener("mousedown", Do, !0), document.addEventListener("touchstart", Do, !0), window.addEventListener("scroll", vt, !0), window.addEventListener("resize", vt), window.addEventListener("scroll", $o, !0), document.addEventListener("touchmove", $o, { passive: !0, capture: !0 }), document.addEventListener("keydown", Cr, !0), T == null || T.addEventListener("change", F), document.addEventListener("touchstart", wt, { passive: !1, capture: !0 });
|
|
23174
|
-
}),
|
|
23174
|
+
}), Bn(() => {
|
|
23175
23175
|
const g = Ye.value;
|
|
23176
23176
|
g && (g.removeEventListener("ordered-list-marker-click", Jn), g.removeEventListener("code-lang-click", Er), g.removeEventListener("click", eo), g.removeEventListener("click", nl)), document.removeEventListener("selectionchange", st), document.removeEventListener("mousedown", qt, !0), document.removeEventListener("mouseup", Xe, !0), document.removeEventListener("mousedown", Do, !0), document.removeEventListener("touchstart", Do, !0), window.removeEventListener("scroll", vt, !0), window.removeEventListener("resize", vt), window.removeEventListener("scroll", $o, !0), document.removeEventListener("touchmove", $o, !0), document.removeEventListener("keydown", Cr, !0), T == null || T.removeEventListener("change", F), document.removeEventListener("touchstart", wt, !0), document.removeEventListener("touchmove", Pt, !0), document.removeEventListener("touchend", Xt, !0), document.removeEventListener("touchcancel", Xt, !0), vn(), f.destroy(), U(), Nu(), Ru();
|
|
23177
23177
|
}), t({ editor: f }), (g, E) => (Z(), te("div", {
|
|
@@ -23180,12 +23180,12 @@ const H3 = Ft({
|
|
|
23180
23180
|
class: ze(["block-editor", [u.value, { "block-editor-dragging": Bt.value !== null, "is-mobile": D.value }]]),
|
|
23181
23181
|
style: rn(h.value),
|
|
23182
23182
|
contenteditable: !1,
|
|
23183
|
-
onKeydown:
|
|
23183
|
+
onKeydown: Fn,
|
|
23184
23184
|
onCopy: Qn,
|
|
23185
23185
|
onCut: Qt,
|
|
23186
23186
|
onDragover: ie(w, ["prevent"]),
|
|
23187
23187
|
onDragleave: x,
|
|
23188
|
-
onDrop: ie(
|
|
23188
|
+
onDrop: ie(B, ["prevent"])
|
|
23189
23189
|
}, [
|
|
23190
23190
|
gn(Tp, {
|
|
23191
23191
|
"root-el": Ye.value,
|
|
@@ -23207,7 +23207,7 @@ const H3 = Ft({
|
|
|
23207
23207
|
C("div", z3, [
|
|
23208
23208
|
gn(td, {
|
|
23209
23209
|
ref_key: "blockListRef",
|
|
23210
|
-
ref:
|
|
23210
|
+
ref: Un,
|
|
23211
23211
|
items: W.value,
|
|
23212
23212
|
"blocks-map": G.value.doc.blocks,
|
|
23213
23213
|
"first-block-placeholder": p.value,
|
|
@@ -23229,7 +23229,7 @@ const H3 = Ft({
|
|
|
23229
23229
|
onFocusIn: Vt
|
|
23230
23230
|
}, null, 8, ["items", "blocks-map", "first-block-placeholder", "hovered-block-id", "focused-block-id", "has-text-selection", "dragging-block-id", "drop-target-block-id", "drop-position", "menu-open-block-id"])
|
|
23231
23231
|
]),
|
|
23232
|
-
(Z(), mn(
|
|
23232
|
+
(Z(), mn(Pn, { to: "body" }, [
|
|
23233
23233
|
He.value.length > 0 ? (Z(), te("div", K3, [
|
|
23234
23234
|
(Z(!0), te(rt, null, bn(He.value, (N, H) => (Z(), te("div", {
|
|
23235
23235
|
key: H,
|
|
@@ -23360,7 +23360,7 @@ export {
|
|
|
23360
23360
|
ob as focusOffset,
|
|
23361
23361
|
Wt as getBlock,
|
|
23362
23362
|
Cc as hasText,
|
|
23363
|
-
|
|
23363
|
+
Ln as indexOf,
|
|
23364
23364
|
Lo as inlineFromString,
|
|
23365
23365
|
Fe as inlineText,
|
|
23366
23366
|
Dc as invertSteps,
|
|
@@ -23382,12 +23382,12 @@ export {
|
|
|
23382
23382
|
jt as parentOf,
|
|
23383
23383
|
es as prevSibling,
|
|
23384
23384
|
Pc as primaryBlock,
|
|
23385
|
-
|
|
23385
|
+
Rn as requireBlock,
|
|
23386
23386
|
mr as siblingList,
|
|
23387
23387
|
pn as splitInline,
|
|
23388
23388
|
mi as textSelection,
|
|
23389
|
-
|
|
23390
|
-
|
|
23389
|
+
Hn as useEditor,
|
|
23390
|
+
Tn as useI18n,
|
|
23391
23391
|
tb as withAttrs,
|
|
23392
23392
|
eb as withContent
|
|
23393
23393
|
};
|