@vscode/markdown-editor 0.0.2-142 → 0.0.2-144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +612 -594
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { commands as fn } from "./commands.js";
|
|
2
|
-
import { O as v, S
|
|
2
|
+
import { O as v, S, b as ge, d as fi, R as P, P as Ee, a as mi, e as $n, f as Io, h as No, g as Ao, c as Po, i as Bo, j as Do } from "./scrolling-C4GW1cCQ.js";
|
|
3
3
|
import pi from "katex";
|
|
4
4
|
import { observableValue as x, derived as R, transaction as z, Disposable as W, runOnChange as mn, autorun as T, constObservable as Kn } from "@vscode/observables";
|
|
5
5
|
import { D as Fo, f as Vo, a as Wo, b as $o, c as Ko, d as gi, i as st } from "./config-BGeaJqWk.js";
|
|
6
|
-
import { e as
|
|
6
|
+
import { e as gh } from "./config-BGeaJqWk.js";
|
|
7
7
|
import { decodeHTMLAttribute as Hn } from "entities/decode";
|
|
8
8
|
import { decodeString as zn } from "micromark-util-decode-string";
|
|
9
9
|
import { parse as Ho, preprocess as zo, postprocess as qo } from "micromark";
|
|
@@ -79,12 +79,12 @@ class qn {
|
|
|
79
79
|
return this.value;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
class
|
|
82
|
+
class b {
|
|
83
83
|
constructor(e, t, s) {
|
|
84
84
|
this.anchor = e, this.active = t, s && (this.activeAffinity = s);
|
|
85
85
|
}
|
|
86
86
|
static collapsed(e, t) {
|
|
87
|
-
return new
|
|
87
|
+
return new b(e, e, t);
|
|
88
88
|
}
|
|
89
89
|
get isCollapsed() {
|
|
90
90
|
return this.anchor === this.active;
|
|
@@ -96,10 +96,10 @@ class y {
|
|
|
96
96
|
return this.isForward ? new v(this.anchor, this.active) : new v(this.active, this.anchor);
|
|
97
97
|
}
|
|
98
98
|
collapseToActive() {
|
|
99
|
-
return
|
|
99
|
+
return b.collapsed(this.active, this.activeAffinity);
|
|
100
100
|
}
|
|
101
101
|
withActive(e, t) {
|
|
102
|
-
return new
|
|
102
|
+
return new b(this.anchor, e, t);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
class Zo {
|
|
@@ -215,7 +215,7 @@ class E extends yt {
|
|
|
215
215
|
return this.markerKind === e.markerKind && this.content === e.content;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
class
|
|
218
|
+
class L extends yt {
|
|
219
219
|
constructor(e, t) {
|
|
220
220
|
super(), this.content = e, this.glueKind = t;
|
|
221
221
|
}
|
|
@@ -705,12 +705,12 @@ class bn extends ee {
|
|
|
705
705
|
function yn(n) {
|
|
706
706
|
return n instanceof be || n instanceof se || n instanceof Ae || n instanceof Pe || n instanceof ce || n instanceof Se || n instanceof xe || n instanceof Y || n instanceof _e || n instanceof H || n instanceof Be || n instanceof pe;
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function q(n, e) {
|
|
709
709
|
if (n.id === e.id)
|
|
710
710
|
return 0;
|
|
711
711
|
let t = 0;
|
|
712
712
|
for (const s of n.children) {
|
|
713
|
-
const i =
|
|
713
|
+
const i = q(s, e);
|
|
714
714
|
if (i !== void 0)
|
|
715
715
|
return t + i;
|
|
716
716
|
t += s.length;
|
|
@@ -820,7 +820,7 @@ function En(n, e) {
|
|
|
820
820
|
const cr = /* @__PURE__ */ new Set([
|
|
821
821
|
"setextHeading",
|
|
822
822
|
"definition"
|
|
823
|
-
]), ar = { kind: "notVideo" },
|
|
823
|
+
]), ar = { kind: "notVideo" }, G = { kind: "unsupported" };
|
|
824
824
|
function Un(n) {
|
|
825
825
|
let e = me(n, 0);
|
|
826
826
|
if (!wi(n, e))
|
|
@@ -828,7 +828,7 @@ function Un(n) {
|
|
|
828
828
|
e += 6;
|
|
829
829
|
const t = n[e];
|
|
830
830
|
if (t !== void 0 && t !== ">" && t !== "/" && !jt(t))
|
|
831
|
-
return
|
|
831
|
+
return G;
|
|
832
832
|
const s = [];
|
|
833
833
|
let i = !1;
|
|
834
834
|
for (; e < n.length; ) {
|
|
@@ -838,7 +838,7 @@ function Un(n) {
|
|
|
838
838
|
break;
|
|
839
839
|
}
|
|
840
840
|
if (e === h || !dr(n[e]))
|
|
841
|
-
return
|
|
841
|
+
return G;
|
|
842
842
|
const u = e;
|
|
843
843
|
for (e++; vi(n[e]); )
|
|
844
844
|
e++;
|
|
@@ -852,18 +852,18 @@ function Un(n) {
|
|
|
852
852
|
for (; e < n.length && n[e] !== k; )
|
|
853
853
|
e++;
|
|
854
854
|
if (n[e] !== k)
|
|
855
|
-
return
|
|
855
|
+
return G;
|
|
856
856
|
_ = n.slice(w, e), e++;
|
|
857
857
|
} else {
|
|
858
858
|
const w = e;
|
|
859
859
|
for (; e < n.length && !jt(n[e]) && n[e] !== ">"; ) {
|
|
860
|
-
const
|
|
861
|
-
if (
|
|
862
|
-
return
|
|
860
|
+
const y = n[e];
|
|
861
|
+
if (y === '"' || y === "'" || y === "`" || y === "<" || y === "=")
|
|
862
|
+
return G;
|
|
863
863
|
e++;
|
|
864
864
|
}
|
|
865
865
|
if (e === w)
|
|
866
|
-
return
|
|
866
|
+
return G;
|
|
867
867
|
_ = n.slice(w, e);
|
|
868
868
|
}
|
|
869
869
|
} else
|
|
@@ -871,20 +871,20 @@ function Un(n) {
|
|
|
871
871
|
s.push({ name: m, value: _ });
|
|
872
872
|
}
|
|
873
873
|
if (!i || (e = me(n, e), !ki(n, e, "</video")) || (e += 7, e = me(n, e), n[e] !== ">") || (e = me(n, e + 1), e !== n.length))
|
|
874
|
-
return
|
|
874
|
+
return G;
|
|
875
875
|
let o, r, c = !1, a = !1, l = !1, d = !1;
|
|
876
876
|
const f = /* @__PURE__ */ new Set();
|
|
877
877
|
for (const { name: h, value: u } of s) {
|
|
878
878
|
if (f.has(h))
|
|
879
|
-
return
|
|
879
|
+
return G;
|
|
880
880
|
switch (f.add(h), h) {
|
|
881
881
|
case "src":
|
|
882
882
|
if (u === void 0 || (o = Hn(u), lr(o)))
|
|
883
|
-
return
|
|
883
|
+
return G;
|
|
884
884
|
break;
|
|
885
885
|
case "title":
|
|
886
886
|
if (u === void 0)
|
|
887
|
-
return
|
|
887
|
+
return G;
|
|
888
888
|
r = Hn(u);
|
|
889
889
|
break;
|
|
890
890
|
case "autoplay":
|
|
@@ -900,10 +900,10 @@ function Un(n) {
|
|
|
900
900
|
d = !0;
|
|
901
901
|
break;
|
|
902
902
|
default:
|
|
903
|
-
return
|
|
903
|
+
return G;
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
|
-
return o === void 0 ?
|
|
906
|
+
return o === void 0 ? G : {
|
|
907
907
|
kind: "supported",
|
|
908
908
|
attributes: { src: o, title: r, autoplay: c, controls: a, loop: l, muted: d }
|
|
909
909
|
};
|
|
@@ -936,15 +936,15 @@ function it(n) {
|
|
|
936
936
|
const e = [];
|
|
937
937
|
for (let t = 0; t < n.length; t++) {
|
|
938
938
|
const s = n[t], i = n[t + 1];
|
|
939
|
-
if (s instanceof
|
|
939
|
+
if (s instanceof L && s.glueKind === "indent") {
|
|
940
940
|
const o = i !== void 0 ? bi(i, s) : void 0;
|
|
941
941
|
if (o) {
|
|
942
942
|
e.push(o), t++;
|
|
943
943
|
continue;
|
|
944
944
|
}
|
|
945
945
|
const r = e[e.length - 1];
|
|
946
|
-
if (r instanceof
|
|
947
|
-
e[e.length - 1] = new
|
|
946
|
+
if (r instanceof L && r.glueKind === void 0) {
|
|
947
|
+
e[e.length - 1] = new L(r.content + s.content);
|
|
948
948
|
continue;
|
|
949
949
|
}
|
|
950
950
|
e.push(s);
|
|
@@ -969,8 +969,8 @@ function hr(n) {
|
|
|
969
969
|
const e = [];
|
|
970
970
|
for (let t = 0; t < n.length; t++) {
|
|
971
971
|
const s = n[t];
|
|
972
|
-
if (s instanceof
|
|
973
|
-
const i = e[e.length - 1], o = n[t + 1], r = i instanceof se && o instanceof se, c = new
|
|
972
|
+
if (s instanceof L && (s.glueKind === void 0 || s.glueKind === "blockQuoteSourceGap")) {
|
|
973
|
+
const i = e[e.length - 1], o = n[t + 1], r = i instanceof se && o instanceof se, c = new L(
|
|
974
974
|
s.content,
|
|
975
975
|
s.glueKind === "blockQuoteSourceGap" ? "blockQuoteSourceGap" : r ? "blockBreak" : "blockGap"
|
|
976
976
|
), a = i !== void 0 ? Qe(i, c) : void 0;
|
|
@@ -985,14 +985,14 @@ function ur(n, e) {
|
|
|
985
985
|
const t = [];
|
|
986
986
|
for (let s = 0; s < n.length; s++) {
|
|
987
987
|
const i = n[s];
|
|
988
|
-
if (!(i instanceof
|
|
988
|
+
if (!(i instanceof L) || i.glueKind !== void 0 && i.glueKind !== "blockQuoteSourceGap") {
|
|
989
989
|
t.push(i);
|
|
990
990
|
continue;
|
|
991
991
|
}
|
|
992
992
|
let o = i.content;
|
|
993
993
|
const r = /^[ \t]+/.exec(o);
|
|
994
994
|
if (r) {
|
|
995
|
-
const f = t[t.length - 1], h = f && Qe(f, new
|
|
995
|
+
const f = t[t.length - 1], h = f && Qe(f, new L(r[0], "lineSuffix"));
|
|
996
996
|
h && (t[t.length - 1] = h, o = o.slice(r[0].length));
|
|
997
997
|
}
|
|
998
998
|
const c = e && s + 1 < n.length ? /^(?:\r\n|\r(?!\n)|\n)[ \t]*(?=[\r\n])/.exec(o)?.[0] : void 0, a = t.at(-1);
|
|
@@ -1002,15 +1002,15 @@ function ur(n, e) {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
const l = /^(?:\r\n|\r|\n)/.exec(o), d = t[t.length - 1];
|
|
1004
1004
|
if (l && d) {
|
|
1005
|
-
const f = Qe(d, new
|
|
1005
|
+
const f = Qe(d, new L(l[0], "blockTerminator"));
|
|
1006
1006
|
f && (t[t.length - 1] = f, o = o.slice(l[0].length));
|
|
1007
1007
|
}
|
|
1008
1008
|
for (const f of o.matchAll(/[^\r\n]*(?:\r\n|\r|\n)|[^\r\n]+$/g)) {
|
|
1009
1009
|
const h = f[0];
|
|
1010
1010
|
if (/[\r\n]$/.test(h) || /^[ \t]*$/.test(h))
|
|
1011
|
-
t.push(new Ae([new
|
|
1011
|
+
t.push(new Ae([new L(h, "emptyLine")]));
|
|
1012
1012
|
else {
|
|
1013
|
-
const u = new
|
|
1013
|
+
const u = new L(h, "blockQuotePrefix"), m = n[s + 1], p = m && bi(m, u);
|
|
1014
1014
|
p ? (t.push(p), s++) : t.push(u);
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
@@ -1069,7 +1069,7 @@ function Qe(n, e) {
|
|
|
1069
1069
|
const i = e.content.slice(s.length);
|
|
1070
1070
|
return new $(
|
|
1071
1071
|
new E("listItemMarker", t.marker.content + s),
|
|
1072
|
-
i ? [new
|
|
1072
|
+
i ? [new L(i, e.glueKind)] : [],
|
|
1073
1073
|
t.checked,
|
|
1074
1074
|
t.leadingTrivia
|
|
1075
1075
|
);
|
|
@@ -1089,7 +1089,7 @@ function Bt(n, e) {
|
|
|
1089
1089
|
return [...n, e];
|
|
1090
1090
|
}
|
|
1091
1091
|
function fr(n) {
|
|
1092
|
-
return n.some((e) => !(e instanceof
|
|
1092
|
+
return n.some((e) => !(e instanceof L)) ? n : [new se(n)];
|
|
1093
1093
|
}
|
|
1094
1094
|
function xn(n, e = !1) {
|
|
1095
1095
|
if (n instanceof se)
|
|
@@ -1118,16 +1118,16 @@ class D {
|
|
|
1118
1118
|
const o = this._parentStart + e, r = (c, a) => {
|
|
1119
1119
|
const l = this._source.substring(c, a), d = t ?? (/(?:^|[\r\n])[ \t]*>[ \t]?/.test(l) ? "blockQuoteSourceGap" : void 0), f = s.at(-1), h = f instanceof E && (f.markerKind === "blockQuoteContinuationMarker" || /[\r\n]$/.test(f.content));
|
|
1120
1120
|
if (!d && (c === this._parentStart || h) && this._entries.length > 0 && /^[ \t]+$/.test(l)) {
|
|
1121
|
-
s.push(new
|
|
1121
|
+
s.push(new L(l, "indent"));
|
|
1122
1122
|
return;
|
|
1123
1123
|
}
|
|
1124
1124
|
const u = d ? null : /\n[^\S\n]+$/.exec(l);
|
|
1125
1125
|
if (!u) {
|
|
1126
|
-
s.push(new
|
|
1126
|
+
s.push(new L(l, d));
|
|
1127
1127
|
return;
|
|
1128
1128
|
}
|
|
1129
1129
|
const m = l.slice(u.index + 1);
|
|
1130
|
-
s.push(new
|
|
1130
|
+
s.push(new L(l.slice(0, l.length - m.length))), s.push(new L(m, "indent"));
|
|
1131
1131
|
};
|
|
1132
1132
|
for (const { node: c, start: a } of this._entries)
|
|
1133
1133
|
c.length !== 0 && (a > i && r(i, a), s.push(c), i = a + c.length);
|
|
@@ -1156,16 +1156,16 @@ class mr {
|
|
|
1156
1156
|
} else
|
|
1157
1157
|
this._idx++;
|
|
1158
1158
|
}
|
|
1159
|
-
const s = it(e.build(this._source.length)), i = s.at(-1), o = s.at(-2), r = i instanceof
|
|
1160
|
-
if (this._options?.preserveTrailingListContinuation && i instanceof
|
|
1159
|
+
const s = it(e.build(this._source.length)), i = s.at(-1), o = s.at(-2), r = i instanceof L && /^[\r\n \t]*$/.test(i.content) ? /^(?:\r\n|\r|\n)[ \t]*/.exec(i.content)?.[0] : void 0;
|
|
1160
|
+
if (this._options?.preserveTrailingListContinuation && i instanceof L && r && o && xn(o)) {
|
|
1161
1161
|
const l = yi(o, r);
|
|
1162
1162
|
if (l instanceof H || l instanceof _e) {
|
|
1163
1163
|
const d = i.content.slice(r.length);
|
|
1164
|
-
s.splice(s.length - 2, 2, l, ...d ? [new
|
|
1164
|
+
s.splice(s.length - 2, 2, l, ...d ? [new L(d, i.glueKind)] : []);
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
1167
|
const c = this._blockGaps(s), a = s.at(-1);
|
|
1168
|
-
return this._options?.explicitFinalEmptyLine && (c.length === 0 || a instanceof
|
|
1168
|
+
return this._options?.explicitFinalEmptyLine && (c.length === 0 || a instanceof L && /[\r\n]$/.test(a.content)) && c.push(new Ae([])), new bn(fr(c));
|
|
1169
1169
|
}
|
|
1170
1170
|
_blockGaps(e) {
|
|
1171
1171
|
return this._options?.explicitBlankLineBlocks ? ur(e, this._options.preserveTrailingListContinuation === !0) : hr(e);
|
|
@@ -1301,13 +1301,13 @@ class mr {
|
|
|
1301
1301
|
for (const a of t)
|
|
1302
1302
|
i.add(a.node, a.start);
|
|
1303
1303
|
const o = i.build(s.endOffset - e.startOffset), r = o[0], c = o[1];
|
|
1304
|
-
if (r instanceof
|
|
1304
|
+
if (r instanceof L && r.glueKind === "taskListCheck" && c instanceof L) {
|
|
1305
1305
|
const a = /^[ \t]+/.exec(c.content)?.[0];
|
|
1306
1306
|
a && o.splice(
|
|
1307
1307
|
1,
|
|
1308
1308
|
1,
|
|
1309
1309
|
new Oe(a),
|
|
1310
|
-
...a.length < c.length ? [new
|
|
1310
|
+
...a.length < c.length ? [new L(c.content.slice(a.length), c.glueKind)] : []
|
|
1311
1311
|
);
|
|
1312
1312
|
}
|
|
1313
1313
|
return new se(o);
|
|
@@ -1606,7 +1606,7 @@ class mr {
|
|
|
1606
1606
|
case "blockQuotePrefix": {
|
|
1607
1607
|
const { marker: s, lineEnding: i } = this._parseBlockQuoteContinuationMarker(), o = e[e.length - 1];
|
|
1608
1608
|
i && (!o || o.start + o.node.length <= i.startOffset) && e.push({
|
|
1609
|
-
node: new
|
|
1609
|
+
node: new L(
|
|
1610
1610
|
this._source.substring(i.startOffset, i.endOffset),
|
|
1611
1611
|
"blockQuoteLineBreak"
|
|
1612
1612
|
),
|
|
@@ -1615,7 +1615,7 @@ class mr {
|
|
|
1615
1615
|
return;
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
1618
|
-
t.type === "exit" && (t.tokenType === "data" || t.tokenType === "codeTextData") && e.push({ node: new Oe(this._source.substring(t.startOffset, t.endOffset)), start: t.startOffset }), t.type === "exit" && t.tokenType === "taskListCheck" && (this._checkChecked ??= !1, e.push({ node: new
|
|
1618
|
+
t.type === "exit" && (t.tokenType === "data" || t.tokenType === "codeTextData") && e.push({ node: new Oe(this._source.substring(t.startOffset, t.endOffset)), start: t.startOffset }), t.type === "exit" && t.tokenType === "taskListCheck" && (this._checkChecked ??= !1, e.push({ node: new L(this._source.substring(t.startOffset, t.endOffset), "taskListCheck"), start: t.startOffset })), t.type === "exit" && t.tokenType === "taskListCheckValueChecked" ? this._checkChecked = !0 : t.type === "exit" && t.tokenType === "taskListCheckValueUnchecked" && (this._checkChecked = !1), this._idx++;
|
|
1619
1619
|
}
|
|
1620
1620
|
_parseBlockQuoteContinuationMarker() {
|
|
1621
1621
|
let e = this._events[this._idx].startOffset, t = this._idx - 1;
|
|
@@ -1917,7 +1917,7 @@ function _r(n, e, t) {
|
|
|
1917
1917
|
return !0;
|
|
1918
1918
|
}
|
|
1919
1919
|
function vr(n, e) {
|
|
1920
|
-
return new
|
|
1920
|
+
return new S(n.replacements.map((t) => ge.replace(t.replaceRange.delta(e), t.newText)));
|
|
1921
1921
|
}
|
|
1922
1922
|
function kr(n, e, t) {
|
|
1923
1923
|
return xi(n, 0, new Ei(t), new pr(e), t);
|
|
@@ -1946,13 +1946,13 @@ function yr(n, e, t = 0) {
|
|
|
1946
1946
|
}
|
|
1947
1947
|
function Gn(n) {
|
|
1948
1948
|
const e = {};
|
|
1949
|
-
return n instanceof be ? e.level = String(n.level) : n instanceof H ? e.ordered = String(n.ordered) : n instanceof ce ? n.language && (e.language = n.language) : n instanceof Ce ? e.url = n.url : n instanceof Ze ? (e.alt = n.alt, e.url = n.url) : n instanceof Y ? (e.src = n.attributes.src, n.attributes.title !== void 0 && (e.title = n.attributes.title), n.attributes.autoplay && (e.autoplay = "true"), n.attributes.controls && (e.controls = "true"), n.attributes.loop && (e.loop = "true"), n.attributes.muted && (e.muted = "true")) : n instanceof $ ? n.checked !== void 0 && (e.checked = String(n.checked)) : n instanceof pe ? e.token = n.tokenType : n instanceof
|
|
1949
|
+
return n instanceof be ? e.level = String(n.level) : n instanceof H ? e.ordered = String(n.ordered) : n instanceof ce ? n.language && (e.language = n.language) : n instanceof Ce ? e.url = n.url : n instanceof Ze ? (e.alt = n.alt, e.url = n.url) : n instanceof Y ? (e.src = n.attributes.src, n.attributes.title !== void 0 && (e.title = n.attributes.title), n.attributes.autoplay && (e.autoplay = "true"), n.attributes.controls && (e.controls = "true"), n.attributes.loop && (e.loop = "true"), n.attributes.muted && (e.muted = "true")) : n instanceof $ ? n.checked !== void 0 && (e.checked = String(n.checked)) : n instanceof pe ? e.token = n.tokenType : n instanceof L && n.glueKind && (e.kind = n.glueKind), Object.entries(e).map(([t, s]) => ` ${t}="${Ci(s)}"`).join("");
|
|
1950
1950
|
}
|
|
1951
1951
|
function Ci(n) {
|
|
1952
1952
|
return n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1953
1953
|
}
|
|
1954
1954
|
function Er(n) {
|
|
1955
|
-
return n instanceof Oe ? `text ${JSON.stringify(n.content)}` : n instanceof
|
|
1955
|
+
return n instanceof Oe ? `text ${JSON.stringify(n.content)}` : n instanceof L ? `glue${n.glueKind ? `(${n.glueKind})` : ""} ${JSON.stringify(n.content)}` : n instanceof E ? `marker(${n.markerKind}) ${JSON.stringify(n.content)}` : n instanceof xe ? `thematicBreak ${JSON.stringify(n.content)}` : n instanceof be ? `heading(level=${n.level})` : n instanceof H ? `list(ordered=${n.ordered})` : n instanceof $ ? n.checked === void 0 ? "listItem" : `listItem(checked=${n.checked})` : n instanceof ce ? `codeBlock(language=${JSON.stringify(n.language)})` : n instanceof Se ? "mathBlock" : n instanceof Ce ? `link(url=${JSON.stringify(n.url)})` : n instanceof Ze ? `image(alt=${JSON.stringify(n.alt)}, url=${JSON.stringify(n.url)})` : n instanceof Y ? `video(src=${JSON.stringify(n.attributes.src)})` : n.kind;
|
|
1956
1956
|
}
|
|
1957
1957
|
const Qn = /* @__PURE__ */ new WeakMap();
|
|
1958
1958
|
let xr = 0;
|
|
@@ -1960,7 +1960,7 @@ function Cr(n) {
|
|
|
1960
1960
|
let e = Qn.get(n);
|
|
1961
1961
|
return e === void 0 && (e = xr++, Qn.set(n, e)), e;
|
|
1962
1962
|
}
|
|
1963
|
-
function
|
|
1963
|
+
function Yd(n, e) {
|
|
1964
1964
|
let t = 0;
|
|
1965
1965
|
function s(i) {
|
|
1966
1966
|
const o = t, r = i.children;
|
|
@@ -2016,7 +2016,7 @@ function Rr(n, e) {
|
|
|
2016
2016
|
return Ir(t.edits.stripData());
|
|
2017
2017
|
}
|
|
2018
2018
|
function Ir(n) {
|
|
2019
|
-
return new
|
|
2019
|
+
return new S(n.replacements.map((e) => ge.replace(new v(e.range.start, e.range.endExclusive), e.newText)));
|
|
2020
2020
|
}
|
|
2021
2021
|
const Nr = /* @__PURE__ */ new Set([
|
|
2022
2022
|
"document",
|
|
@@ -2084,7 +2084,7 @@ function mt(n, e, t, s, i) {
|
|
|
2084
2084
|
return o;
|
|
2085
2085
|
}
|
|
2086
2086
|
const Dr = Symbol("NO_ACTIVE_BLOCKS");
|
|
2087
|
-
class
|
|
2087
|
+
class Jd {
|
|
2088
2088
|
_parser = new br();
|
|
2089
2089
|
_sourceEditListeners = /* @__PURE__ */ new Set();
|
|
2090
2090
|
_sourceTextIds = /* @__PURE__ */ new WeakMap();
|
|
@@ -2294,7 +2294,7 @@ class Yd {
|
|
|
2294
2294
|
text: "",
|
|
2295
2295
|
cursorLine: new Zo(e.replaceRange.start, e.replaceRange.endExclusive),
|
|
2296
2296
|
syntheticAst: new se([])
|
|
2297
|
-
}, t), this.selectionSource.set("user", t), this.selection.set(
|
|
2297
|
+
}, t), this.selectionSource.set("user", t), this.selection.set(b.collapsed(e.replaceRange.start), t);
|
|
2298
2298
|
});
|
|
2299
2299
|
}
|
|
2300
2300
|
/** Discard the pending paragraph (if any) without touching the source. */
|
|
@@ -2311,7 +2311,7 @@ class Yd {
|
|
|
2311
2311
|
let o = i;
|
|
2312
2312
|
if (i) {
|
|
2313
2313
|
const r = ot(s.mapOffset(ot(i.anchor, t.value.length)), e.value.length), c = ot(s.mapOffset(ot(i.active, t.value.length)), e.value.length);
|
|
2314
|
-
(r !== i.anchor || c !== i.active) && (o = new
|
|
2314
|
+
(r !== i.anchor || c !== i.active) && (o = new b(r, c));
|
|
2315
2315
|
}
|
|
2316
2316
|
s.isEmpty || (this._pendingEdit = { baseText: t.value, newText: e.value, edit: s }), z((r) => {
|
|
2317
2317
|
this.pendingParagraph.set(void 0, r), s.isEmpty || this.sourceText.set(e, r), o !== i && this.selection.set(o, r);
|
|
@@ -2341,30 +2341,30 @@ class Yd {
|
|
|
2341
2341
|
|
|
2342
2342
|
` : "", o = i + s + (t.atEof ? "" : `
|
|
2343
2343
|
|
|
2344
|
-
`), r = t.replaceRange.start + i.length + s.length, c =
|
|
2345
|
-
this._applySourceEdit(c,
|
|
2344
|
+
`), r = t.replaceRange.start + i.length + s.length, c = S.replace(t.replaceRange, o);
|
|
2345
|
+
this._applySourceEdit(c, b.collapsed(r));
|
|
2346
2346
|
}
|
|
2347
2347
|
/** Sets a rendered task checkbox state in either editing or read-only mode. */
|
|
2348
2348
|
setTaskCheckboxChecked(e, t) {
|
|
2349
2349
|
if (e.checked === t)
|
|
2350
2350
|
return;
|
|
2351
|
-
const s =
|
|
2351
|
+
const s = q(this.document.get(), e), i = sr(e);
|
|
2352
2352
|
if (s === void 0 || i === void 0)
|
|
2353
2353
|
return;
|
|
2354
|
-
const o =
|
|
2355
|
-
this._applySourceEdit(o, this.selection.get() ??
|
|
2354
|
+
const o = S.replace(i.delta(s), t ? "[x]" : "[ ]");
|
|
2355
|
+
this._applySourceEdit(o, this.selection.get() ?? b.collapsed(0));
|
|
2356
2356
|
}
|
|
2357
2357
|
applyEdit(e, t) {
|
|
2358
2358
|
if (this.readonlyMode.get())
|
|
2359
2359
|
return;
|
|
2360
|
-
const s = this.selection.get() ??
|
|
2361
|
-
this._applySourceEdit(e, t ??
|
|
2360
|
+
const s = this.selection.get() ?? b.collapsed(0), i = e.mapOffset(s.active);
|
|
2361
|
+
this._applySourceEdit(e, t ?? b.collapsed(i));
|
|
2362
2362
|
}
|
|
2363
2363
|
applyEditForSelection(e) {
|
|
2364
2364
|
if (this.readonlyMode.get())
|
|
2365
2365
|
return;
|
|
2366
|
-
const t = this.selection.get() ??
|
|
2367
|
-
this._applySourceEdit(e,
|
|
2366
|
+
const t = this.selection.get() ?? b.collapsed(0), s = e.mapOffset(t.range.endExclusive);
|
|
2367
|
+
this._applySourceEdit(e, b.collapsed(s));
|
|
2368
2368
|
}
|
|
2369
2369
|
_applySourceEdit(e, t) {
|
|
2370
2370
|
const s = this.sourceText.get(), i = new qn(e.apply(s.value));
|
|
@@ -2741,7 +2741,7 @@ function Wr(n, e, t) {
|
|
|
2741
2741
|
const _ = g.getClientRects();
|
|
2742
2742
|
if (_.length === 0)
|
|
2743
2743
|
return;
|
|
2744
|
-
const k = $r(Array.from(_, (
|
|
2744
|
+
const k = $r(Array.from(_, (y) => t.toLocalRect(y))), w = Hr(p.parentElement);
|
|
2745
2745
|
if (u.sourceLength === 0) {
|
|
2746
2746
|
s.push(we.visualLineAnchor(
|
|
2747
2747
|
m,
|
|
@@ -2756,9 +2756,9 @@ function Wr(n, e, t) {
|
|
|
2756
2756
|
{ textNode: p, textNodeStart: 0, coordinateSpace: e }
|
|
2757
2757
|
));
|
|
2758
2758
|
else {
|
|
2759
|
-
const
|
|
2759
|
+
const y = Kr(p, k, t);
|
|
2760
2760
|
for (let C = 0; C < k.length; C++) {
|
|
2761
|
-
const N = C === 0 ? 0 :
|
|
2761
|
+
const N = C === 0 ? 0 : y[C - 1], ne = C < y.length ? y[C] : p.length;
|
|
2762
2762
|
s.push(new we(
|
|
2763
2763
|
v.fromTo(m + N, m + ne),
|
|
2764
2764
|
Ft(k[C], w),
|
|
@@ -3123,7 +3123,7 @@ function Sn(n, e, t, s) {
|
|
|
3123
3123
|
o(f) && l.push(v.ofStartAndLength(d, f.length)), d += f.length;
|
|
3124
3124
|
}
|
|
3125
3125
|
function o(c) {
|
|
3126
|
-
return c instanceof
|
|
3126
|
+
return c instanceof L && (c.glueKind === "blockQuoteLineBreak" || c.glueKind === "blockQuoteSourceGap");
|
|
3127
3127
|
}
|
|
3128
3128
|
let r = e;
|
|
3129
3129
|
for (const c of n.children)
|
|
@@ -3319,22 +3319,22 @@ const tt = {
|
|
|
3319
3319
|
const e = n.selection;
|
|
3320
3320
|
if (!e.isCollapsed)
|
|
3321
3321
|
return {
|
|
3322
|
-
edit:
|
|
3323
|
-
selection:
|
|
3322
|
+
edit: S.delete(e.range),
|
|
3323
|
+
selection: b.collapsed(e.range.start)
|
|
3324
3324
|
};
|
|
3325
3325
|
if (e.active === 0)
|
|
3326
3326
|
return;
|
|
3327
3327
|
const t = new v(We(n.document, n.markerVisibleBlocks, e.active, "left", n.markupSelectionRange ?? e.range), e.active);
|
|
3328
3328
|
return {
|
|
3329
|
-
edit:
|
|
3330
|
-
selection:
|
|
3329
|
+
edit: S.delete(t),
|
|
3330
|
+
selection: b.collapsed(t.start)
|
|
3331
3331
|
};
|
|
3332
3332
|
}, pc = (n) => {
|
|
3333
3333
|
const e = n.selection;
|
|
3334
3334
|
if (!e.isCollapsed)
|
|
3335
3335
|
return {
|
|
3336
|
-
edit:
|
|
3337
|
-
selection:
|
|
3336
|
+
edit: S.delete(e.range),
|
|
3337
|
+
selection: b.collapsed(e.range.start)
|
|
3338
3338
|
};
|
|
3339
3339
|
if (e.active >= n.text.length)
|
|
3340
3340
|
return;
|
|
@@ -3342,15 +3342,15 @@ const tt = {
|
|
|
3342
3342
|
`, e.active) ? e.active + 2 : n.text[e.active] === `
|
|
3343
3343
|
` ? e.active + 1 : We(n.document, n.markerVisibleBlocks, e.active, "right", n.markupSelectionRange ?? e.range), s = new v(e.active, t);
|
|
3344
3344
|
return {
|
|
3345
|
-
edit:
|
|
3346
|
-
selection:
|
|
3345
|
+
edit: S.delete(s),
|
|
3346
|
+
selection: b.collapsed(s.start)
|
|
3347
3347
|
};
|
|
3348
3348
|
}, gc = (n) => {
|
|
3349
3349
|
const e = n.selection;
|
|
3350
3350
|
if (!e.isCollapsed)
|
|
3351
3351
|
return {
|
|
3352
|
-
edit:
|
|
3353
|
-
selection:
|
|
3352
|
+
edit: S.delete(e.range),
|
|
3353
|
+
selection: b.collapsed(e.range.start)
|
|
3354
3354
|
};
|
|
3355
3355
|
if (e.active === 0)
|
|
3356
3356
|
return;
|
|
@@ -3358,14 +3358,14 @@ const tt = {
|
|
|
3358
3358
|
if (!i.isEmpty)
|
|
3359
3359
|
return {
|
|
3360
3360
|
edit: i,
|
|
3361
|
-
selection:
|
|
3361
|
+
selection: b.collapsed(i.mapOffset(t))
|
|
3362
3362
|
};
|
|
3363
3363
|
}, _c = (n) => {
|
|
3364
3364
|
const e = n.selection;
|
|
3365
3365
|
if (!e.isCollapsed)
|
|
3366
3366
|
return {
|
|
3367
|
-
edit:
|
|
3368
|
-
selection:
|
|
3367
|
+
edit: S.delete(e.range),
|
|
3368
|
+
selection: b.collapsed(e.range.start)
|
|
3369
3369
|
};
|
|
3370
3370
|
if (e.active >= n.text.length)
|
|
3371
3371
|
return;
|
|
@@ -3373,14 +3373,14 @@ const tt = {
|
|
|
3373
3373
|
if (!i.isEmpty)
|
|
3374
3374
|
return {
|
|
3375
3375
|
edit: i,
|
|
3376
|
-
selection:
|
|
3376
|
+
selection: b.collapsed(i.mapOffset(e.active))
|
|
3377
3377
|
};
|
|
3378
3378
|
}, vc = (n) => {
|
|
3379
3379
|
const e = n.selection;
|
|
3380
3380
|
if (!e.isCollapsed)
|
|
3381
3381
|
return {
|
|
3382
|
-
edit:
|
|
3383
|
-
selection:
|
|
3382
|
+
edit: S.delete(e.range),
|
|
3383
|
+
selection: b.collapsed(e.range.start)
|
|
3384
3384
|
};
|
|
3385
3385
|
if (e.active === 0)
|
|
3386
3386
|
return;
|
|
@@ -3392,14 +3392,14 @@ const tt = {
|
|
|
3392
3392
|
if (!s.isEmpty)
|
|
3393
3393
|
return {
|
|
3394
3394
|
edit: s,
|
|
3395
|
-
selection:
|
|
3395
|
+
selection: b.collapsed(s.mapOffset(t))
|
|
3396
3396
|
};
|
|
3397
3397
|
}, kc = (n) => {
|
|
3398
3398
|
const e = n.selection;
|
|
3399
3399
|
if (!e.isCollapsed)
|
|
3400
3400
|
return {
|
|
3401
|
-
edit:
|
|
3402
|
-
selection:
|
|
3401
|
+
edit: S.delete(e.range),
|
|
3402
|
+
selection: b.collapsed(e.range.start)
|
|
3403
3403
|
};
|
|
3404
3404
|
const t = n.text.indexOf(`
|
|
3405
3405
|
`, e.active), s = t === -1 ? n.text.length : t === e.active ? t + 1 : t;
|
|
@@ -3409,7 +3409,7 @@ const tt = {
|
|
|
3409
3409
|
if (!i.isEmpty)
|
|
3410
3410
|
return {
|
|
3411
3411
|
edit: i,
|
|
3412
|
-
selection:
|
|
3412
|
+
selection: b.collapsed(i.mapOffset(e.active))
|
|
3413
3413
|
};
|
|
3414
3414
|
};
|
|
3415
3415
|
function Lt(n, e) {
|
|
@@ -3425,7 +3425,7 @@ function Lt(n, e) {
|
|
|
3425
3425
|
break;
|
|
3426
3426
|
s < i.start && t.push(ge.delete(new v(s, Math.min(i.start, e.endExclusive)))), s = Math.max(s, i.endExclusive);
|
|
3427
3427
|
}
|
|
3428
|
-
return s < e.endExclusive && t.push(ge.delete(new v(s, e.endExclusive))), t.length === 0 ?
|
|
3428
|
+
return s < e.endExclusive && t.push(ge.delete(new v(s, e.endExclusive))), t.length === 0 ? S.empty : new S(t);
|
|
3429
3429
|
}
|
|
3430
3430
|
function wc(n, e) {
|
|
3431
3431
|
return (t) => {
|
|
@@ -3433,9 +3433,9 @@ function wc(n, e) {
|
|
|
3433
3433
|
if (s.trim() && /^https?:\/\/\S+$/i.test(n) && URL.canParse(n) && !nn(t.document, (i, o) => o < t.selection.range.endExclusive && o + i.length > t.selection.range.start)) {
|
|
3434
3434
|
const i = n.replace(/&/g, "&").replace(/[\\()<>]/g, "\\$&"), o = s.replace(/\\[\s\S]|[\[\]]/g, (r) => r.length === 1 ? `\\${r}` : r);
|
|
3435
3435
|
for (const r of /* @__PURE__ */ new Set([s, o])) {
|
|
3436
|
-
const c = `[${r}](${i})`, a =
|
|
3436
|
+
const c = `[${r}](${i})`, a = S.replace(t.selection.range, c);
|
|
3437
3437
|
if (nn(En(a.apply(t.text)), (l, d) => d === t.selection.range.start && l.length === c.length && l.url === n))
|
|
3438
|
-
return { edit: a, selection:
|
|
3438
|
+
return { edit: a, selection: b.collapsed(t.selection.range.start + c.length) };
|
|
3439
3439
|
}
|
|
3440
3440
|
}
|
|
3441
3441
|
return Bi(n, e)(t);
|
|
@@ -3456,24 +3456,24 @@ function Bi(n, e, t = !1) {
|
|
|
3456
3456
|
const i = bc(s, n, e);
|
|
3457
3457
|
if (i)
|
|
3458
3458
|
return i;
|
|
3459
|
-
const o =
|
|
3459
|
+
const o = S.replace(s.selection.range, n), r = s.selection.range.start + n.length;
|
|
3460
3460
|
if (t && s.selection.isCollapsed && /^`{1,3}$/.test(n)) {
|
|
3461
3461
|
const c = o.apply(s.text), a = c.slice(r - 3, r) === "```" ? Ln(En(c), r) : void 0;
|
|
3462
|
-
if (a?.block.openFence?.content === "```" && !a.block.closeFence && (
|
|
3462
|
+
if (a?.block.openFence?.content === "```" && !a.block.closeFence && (q(a.block, a.block.openFence) ?? -1) + a.block.openFence.length === a.offsetInBlock) {
|
|
3463
3463
|
const l = c.lastIndexOf(`
|
|
3464
3464
|
`, r - 1) + 1, f = c.slice(l, r - 3).replace(/(?:[*+-]|\d+[.)])([ \t]+)/g, (u) => " ".repeat(u.length)), h = s.text.includes(`\r
|
|
3465
3465
|
`) ? `\r
|
|
3466
3466
|
` : `
|
|
3467
3467
|
`;
|
|
3468
3468
|
return {
|
|
3469
|
-
edit:
|
|
3470
|
-
selection:
|
|
3469
|
+
edit: S.replace(s.selection.range, n + h + f + "```"),
|
|
3470
|
+
selection: b.collapsed(r)
|
|
3471
3471
|
};
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
3474
3474
|
return {
|
|
3475
3475
|
edit: o,
|
|
3476
|
-
selection:
|
|
3476
|
+
selection: b.collapsed(r)
|
|
3477
3477
|
};
|
|
3478
3478
|
};
|
|
3479
3479
|
}
|
|
@@ -3502,7 +3502,7 @@ function bc(n, e, t) {
|
|
|
3502
3502
|
const d = l[1];
|
|
3503
3503
|
if (t.start !== o || t.endExclusive > i.start || t.length !== d.length || t.substring(n.text) !== d)
|
|
3504
3504
|
return;
|
|
3505
|
-
const f =
|
|
3505
|
+
const f = q(n.document, s);
|
|
3506
3506
|
if (f === void 0)
|
|
3507
3507
|
return;
|
|
3508
3508
|
const h = n.text.lastIndexOf(`
|
|
@@ -3518,68 +3518,68 @@ function bc(n, e, t) {
|
|
|
3518
3518
|
return;
|
|
3519
3519
|
const _ = g + l[2] + l[3], k = n.text.slice(o, i.start).length + e.length, w = g.length + Math.max(0, k - d.length);
|
|
3520
3520
|
return {
|
|
3521
|
-
edit:
|
|
3522
|
-
selection:
|
|
3521
|
+
edit: S.replace(new v(o, c), _),
|
|
3522
|
+
selection: b.collapsed(o + w)
|
|
3523
3523
|
};
|
|
3524
3524
|
}
|
|
3525
3525
|
function yc(n = tt) {
|
|
3526
3526
|
return Tt(n), (e) => {
|
|
3527
|
-
const t = e.selection, s = t.range, i =
|
|
3528
|
-
if (a && l !== void 0 && d !== void 0 &&
|
|
3527
|
+
const t = e.selection, s = t.range, i = Q(e.text, s.start), o = ss(e.text, s.start), c = s.endExclusive <= o && (s.start !== i || s.endExclusive !== o), a = t.isCollapsed ? Mn(e.document, e.text, t.active) : void 0, l = a ? q(e.document, a.item) : void 0, d = a ? q(e.document, a.item.marker) : void 0;
|
|
3528
|
+
if (a && l !== void 0 && d !== void 0 && Q(e.text, d) === i) {
|
|
3529
3529
|
const m = Ui(
|
|
3530
3530
|
e.text,
|
|
3531
3531
|
l,
|
|
3532
3532
|
l + a.item.length,
|
|
3533
|
-
Gi(e.text,
|
|
3533
|
+
Gi(e.text, Q(e.text, d), d)
|
|
3534
3534
|
), p = m[0];
|
|
3535
3535
|
if (a.index === 0 && d - p >= qe.length)
|
|
3536
3536
|
return;
|
|
3537
|
-
const g = m.filter((k) => k < ss(e.text, k)).map((k) => ge.insert(k, qe)), _ = new
|
|
3537
|
+
const g = m.filter((k) => k < ss(e.text, k)).map((k) => ge.insert(k, qe)), _ = new S(g);
|
|
3538
3538
|
return {
|
|
3539
3539
|
edit: _,
|
|
3540
|
-
selection:
|
|
3540
|
+
selection: b.collapsed(_.mapOffset(t.active))
|
|
3541
3541
|
};
|
|
3542
3542
|
}
|
|
3543
3543
|
if (t.isCollapsed || c) {
|
|
3544
3544
|
const m = Ki(
|
|
3545
|
-
e.text.slice(
|
|
3545
|
+
e.text.slice(Q(e.text, s.start), s.start),
|
|
3546
3546
|
n
|
|
3547
3547
|
);
|
|
3548
3548
|
return {
|
|
3549
|
-
edit:
|
|
3550
|
-
selection:
|
|
3549
|
+
edit: S.replace(s, m),
|
|
3550
|
+
selection: b.collapsed(s.start + m.length)
|
|
3551
3551
|
};
|
|
3552
3552
|
}
|
|
3553
|
-
const f = $i(e.text, s), h = f.map((m) => ge.insert(m,
|
|
3553
|
+
const f = $i(e.text, s), h = f.map((m) => ge.insert(m, Bc(n))), u = new S(h);
|
|
3554
3554
|
return {
|
|
3555
3555
|
edit: u,
|
|
3556
|
-
selection:
|
|
3556
|
+
selection: $c(u, t, new Set(f))
|
|
3557
3557
|
};
|
|
3558
3558
|
};
|
|
3559
3559
|
}
|
|
3560
3560
|
function Di(n = tt) {
|
|
3561
3561
|
return Tt(n), (e) => {
|
|
3562
3562
|
if (e.selection.isCollapsed) {
|
|
3563
|
-
const i = Mn(e.document, e.text, e.selection.active), o = i ?
|
|
3564
|
-
if (i && o !== void 0 && r !== void 0 &&
|
|
3563
|
+
const i = Mn(e.document, e.text, e.selection.active), o = i ? q(e.document, i.item) : void 0, r = i ? q(e.document, i.item.marker) : void 0;
|
|
3564
|
+
if (i && o !== void 0 && r !== void 0 && Q(e.text, r) === Q(e.text, e.selection.active)) {
|
|
3565
3565
|
const c = Ui(
|
|
3566
3566
|
e.text,
|
|
3567
3567
|
o,
|
|
3568
3568
|
o + i.item.length,
|
|
3569
|
-
Gi(e.text,
|
|
3569
|
+
Gi(e.text, Q(e.text, r), r)
|
|
3570
3570
|
).flatMap((l) => e.text.slice(l, l + qe.length) === qe ? [ge.delete(new v(l, l + qe.length))] : []);
|
|
3571
3571
|
if (c.length === 0)
|
|
3572
3572
|
return;
|
|
3573
|
-
const a = new
|
|
3573
|
+
const a = new S(c);
|
|
3574
3574
|
return {
|
|
3575
3575
|
edit: a,
|
|
3576
|
-
selection:
|
|
3576
|
+
selection: b.collapsed(a.mapOffset(e.selection.active))
|
|
3577
3577
|
};
|
|
3578
3578
|
}
|
|
3579
3579
|
}
|
|
3580
3580
|
const t = [];
|
|
3581
3581
|
for (const i of $i(e.text, e.selection.range)) {
|
|
3582
|
-
const o =
|
|
3582
|
+
const o = Fc(e.text, i), r = e.text.slice(i, o), c = Hi(r, n);
|
|
3583
3583
|
c !== r && t.push(ge.replace(
|
|
3584
3584
|
new v(i, o),
|
|
3585
3585
|
c
|
|
@@ -3587,27 +3587,27 @@ function Di(n = tt) {
|
|
|
3587
3587
|
}
|
|
3588
3588
|
if (t.length === 0)
|
|
3589
3589
|
return;
|
|
3590
|
-
const s = new
|
|
3590
|
+
const s = new S(t);
|
|
3591
3591
|
return {
|
|
3592
3592
|
edit: s,
|
|
3593
|
-
selection:
|
|
3593
|
+
selection: Wc(s, e.selection)
|
|
3594
3594
|
};
|
|
3595
3595
|
};
|
|
3596
3596
|
}
|
|
3597
3597
|
const Ec = (n) => {
|
|
3598
|
-
const e =
|
|
3598
|
+
const e = S.replace(n.selection.range, `
|
|
3599
3599
|
|
|
3600
3600
|
`), t = n.selection.range.start + 2;
|
|
3601
3601
|
return {
|
|
3602
3602
|
edit: e,
|
|
3603
|
-
selection:
|
|
3603
|
+
selection: b.collapsed(t)
|
|
3604
3604
|
};
|
|
3605
3605
|
}, xc = (n) => {
|
|
3606
|
-
const e =
|
|
3606
|
+
const e = S.replace(n.selection.range, `
|
|
3607
3607
|
`), t = n.selection.range.start + 1;
|
|
3608
3608
|
return {
|
|
3609
3609
|
edit: e,
|
|
3610
|
-
selection:
|
|
3610
|
+
selection: b.collapsed(t)
|
|
3611
3611
|
};
|
|
3612
3612
|
}, Cc = (n) => {
|
|
3613
3613
|
const e = n.selection.range.start;
|
|
@@ -3615,10 +3615,10 @@ const Ec = (n) => {
|
|
|
3615
3615
|
for (; t < 2 && n.text[e - 1 - t] === " "; )
|
|
3616
3616
|
t++;
|
|
3617
3617
|
const i = " ".repeat(2 - t) + `
|
|
3618
|
-
`, o =
|
|
3618
|
+
`, o = S.replace(n.selection.range, i), r = e + i.length;
|
|
3619
3619
|
return {
|
|
3620
3620
|
edit: o,
|
|
3621
|
-
selection:
|
|
3621
|
+
selection: b.collapsed(r)
|
|
3622
3622
|
};
|
|
3623
3623
|
};
|
|
3624
3624
|
function $e(n) {
|
|
@@ -3654,13 +3654,13 @@ const Sc = (n, e = !1) => {
|
|
|
3654
3654
|
if (!t.isCollapsed || !s)
|
|
3655
3655
|
return le(n);
|
|
3656
3656
|
if (s.kind === "heading") {
|
|
3657
|
-
const i = Mt(n.document, s), o =
|
|
3657
|
+
const i = Mt(n.document, s), o = q(n.document, s.marker);
|
|
3658
3658
|
if (i !== void 0 && o !== void 0 && t.active === o + s.marker.length && t.active < Xe(s, i))
|
|
3659
3659
|
return {
|
|
3660
3660
|
kind: "edit",
|
|
3661
|
-
edit:
|
|
3661
|
+
edit: S.insert(i, `
|
|
3662
3662
|
`),
|
|
3663
|
-
selection:
|
|
3663
|
+
selection: b.collapsed(t.active + 1)
|
|
3664
3664
|
};
|
|
3665
3665
|
}
|
|
3666
3666
|
if (e) {
|
|
@@ -3697,10 +3697,10 @@ function Lc(n, e) {
|
|
|
3697
3697
|
const i = Xe(e, s);
|
|
3698
3698
|
return t.active < i ? {
|
|
3699
3699
|
kind: "edit",
|
|
3700
|
-
edit:
|
|
3700
|
+
edit: S.replace(t.range, `
|
|
3701
3701
|
|
|
3702
3702
|
`),
|
|
3703
|
-
selection:
|
|
3703
|
+
selection: b.collapsed(t.range.start + 2)
|
|
3704
3704
|
} : $e(n) ?? le(n);
|
|
3705
3705
|
}
|
|
3706
3706
|
function Tc(n, e) {
|
|
@@ -3734,7 +3734,7 @@ function Mc(n, e) {
|
|
|
3734
3734
|
return e.htmlComment?.kind !== "complete" ? le(n) : $e(n) ?? le(n);
|
|
3735
3735
|
}
|
|
3736
3736
|
function Xe(n, e) {
|
|
3737
|
-
return e + n.length -
|
|
3737
|
+
return e + n.length - Kc(n);
|
|
3738
3738
|
}
|
|
3739
3739
|
function Oc(n) {
|
|
3740
3740
|
const e = n.selection, t = Vi(n.text, e.active), s = t.prefix ?? "> ";
|
|
@@ -3769,7 +3769,7 @@ function Rc(n) {
|
|
|
3769
3769
|
}
|
|
3770
3770
|
function Vi(n, e) {
|
|
3771
3771
|
const t = n.lastIndexOf(`
|
|
3772
|
-
`, e - 1) + 1, s =
|
|
3772
|
+
`, e - 1) + 1, s = Pc(n, e), i = n.slice(t, s);
|
|
3773
3773
|
return {
|
|
3774
3774
|
start: t,
|
|
3775
3775
|
endExclusive: s,
|
|
@@ -3781,34 +3781,52 @@ function ns(n) {
|
|
|
3781
3781
|
const e = n.selection, t = Mn(n.document, n.text, e.active);
|
|
3782
3782
|
if (!t)
|
|
3783
3783
|
return le(n);
|
|
3784
|
-
const { item: s, list: i } = t, o =
|
|
3784
|
+
const { item: s, list: i } = t, o = q(n.document, s);
|
|
3785
3785
|
if (o === void 0)
|
|
3786
3786
|
return le(n);
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
return
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3787
|
+
const r = Ic(n, s);
|
|
3788
|
+
if (r)
|
|
3789
|
+
return r;
|
|
3790
|
+
if (Ac(n, s, o)) {
|
|
3791
|
+
const a = Di()(n);
|
|
3792
|
+
return a ? { kind: "edit", edit: a.edit, selection: a.selection } : Wi(n, o, o + s.length);
|
|
3793
|
+
}
|
|
3794
|
+
const c = `
|
|
3795
|
+
` + Nc(n, i, s);
|
|
3796
|
+
return Tn(e, c);
|
|
3797
|
+
}
|
|
3798
|
+
function Ic(n, e) {
|
|
3799
|
+
const t = n.selection.active, s = q(n.document, e.marker);
|
|
3800
|
+
if (s === void 0 || t >= s + e.marker.length)
|
|
3801
|
+
return;
|
|
3802
|
+
const i = Q(n.text, s);
|
|
3803
|
+
if (t < i)
|
|
3804
|
+
return;
|
|
3805
|
+
const o = n.text.slice(i, s).trimEnd() + `
|
|
3806
|
+
`;
|
|
3807
|
+
return {
|
|
3808
|
+
kind: "edit",
|
|
3809
|
+
edit: S.insert(i, o),
|
|
3810
|
+
selection: b.collapsed(t + o.length)
|
|
3811
|
+
};
|
|
3794
3812
|
}
|
|
3795
3813
|
function Wi(n, e, t) {
|
|
3796
3814
|
const s = e > 0 ? n.text.lastIndexOf(`
|
|
3797
3815
|
`, e - 1) : -1;
|
|
3798
3816
|
return s >= 0 ? {
|
|
3799
3817
|
kind: "edit",
|
|
3800
|
-
edit:
|
|
3818
|
+
edit: S.replace(new v(s, t), `
|
|
3801
3819
|
|
|
3802
3820
|
`),
|
|
3803
|
-
selection:
|
|
3821
|
+
selection: b.collapsed(s + 2)
|
|
3804
3822
|
} : {
|
|
3805
3823
|
kind: "edit",
|
|
3806
|
-
edit:
|
|
3807
|
-
selection:
|
|
3824
|
+
edit: S.replace(new v(e, t), ""),
|
|
3825
|
+
selection: b.collapsed(e)
|
|
3808
3826
|
};
|
|
3809
3827
|
}
|
|
3810
|
-
function
|
|
3811
|
-
const s =
|
|
3828
|
+
function Nc(n, e, t) {
|
|
3829
|
+
const s = q(n.document, t.marker), i = s === void 0 ? "" : n.text.slice(Q(n.text, s), s), o = t.marker.content.trim();
|
|
3812
3830
|
let r = `${o.charAt(0) || "-"} `;
|
|
3813
3831
|
if (e.ordered) {
|
|
3814
3832
|
const c = /^(\d+)([.)])/.exec(o);
|
|
@@ -3816,8 +3834,8 @@ function Ic(n, e, t) {
|
|
|
3816
3834
|
}
|
|
3817
3835
|
return `${i}${r}${t.checked !== void 0 ? "[ ] " : ""}`;
|
|
3818
3836
|
}
|
|
3819
|
-
function
|
|
3820
|
-
const s =
|
|
3837
|
+
function Ac(n, e, t) {
|
|
3838
|
+
const s = q(n.document, e.marker);
|
|
3821
3839
|
if (s === void 0)
|
|
3822
3840
|
return !1;
|
|
3823
3841
|
const i = n.text.slice(
|
|
@@ -3829,16 +3847,16 @@ function Nc(n, e, t) {
|
|
|
3829
3847
|
function Tn(n, e) {
|
|
3830
3848
|
return {
|
|
3831
3849
|
kind: "edit",
|
|
3832
|
-
edit:
|
|
3833
|
-
selection:
|
|
3850
|
+
edit: S.replace(n.range, e),
|
|
3851
|
+
selection: b.collapsed(n.range.start + e.length)
|
|
3834
3852
|
};
|
|
3835
3853
|
}
|
|
3836
|
-
function
|
|
3854
|
+
function Pc(n, e) {
|
|
3837
3855
|
const t = n.indexOf(`
|
|
3838
3856
|
`, e);
|
|
3839
3857
|
return t === -1 ? n.length : t;
|
|
3840
3858
|
}
|
|
3841
|
-
function
|
|
3859
|
+
function Q(n, e) {
|
|
3842
3860
|
return n.lastIndexOf(`
|
|
3843
3861
|
`, Math.max(0, e - 1)) + 1;
|
|
3844
3862
|
}
|
|
@@ -3848,7 +3866,7 @@ function ss(n, e) {
|
|
|
3848
3866
|
return t === -1 ? n.length : t;
|
|
3849
3867
|
}
|
|
3850
3868
|
function $i(n, e) {
|
|
3851
|
-
const t = [
|
|
3869
|
+
const t = [Q(n, e.start)], s = e.endExclusive > e.start && n[e.endExclusive - 1] === `
|
|
3852
3870
|
` ? e.endExclusive - 1 : e.endExclusive;
|
|
3853
3871
|
let i = n.indexOf(`
|
|
3854
3872
|
`, t[0]) + 1;
|
|
@@ -3863,7 +3881,7 @@ function Ki(n, e = tt) {
|
|
|
3863
3881
|
const t = zi(n, e.tabSize);
|
|
3864
3882
|
return " ".repeat(e.tabSize - t % e.tabSize);
|
|
3865
3883
|
}
|
|
3866
|
-
function
|
|
3884
|
+
function Bc(n) {
|
|
3867
3885
|
return n.insertSpaces ? " ".repeat(n.tabSize) : " ";
|
|
3868
3886
|
}
|
|
3869
3887
|
function Hi(n, e = tt) {
|
|
@@ -3872,9 +3890,9 @@ function Hi(n, e = tt) {
|
|
|
3872
3890
|
if (t === 0)
|
|
3873
3891
|
return n;
|
|
3874
3892
|
const s = t - (t % e.tabSize || e.tabSize);
|
|
3875
|
-
return
|
|
3893
|
+
return Dc(s, e);
|
|
3876
3894
|
}
|
|
3877
|
-
function
|
|
3895
|
+
function Dc(n, e) {
|
|
3878
3896
|
return e.insertSpaces ? " ".repeat(n) : " ".repeat(Math.floor(n / e.tabSize)) + " ".repeat(n % e.tabSize);
|
|
3879
3897
|
}
|
|
3880
3898
|
function zi(n, e) {
|
|
@@ -3883,7 +3901,7 @@ function zi(n, e) {
|
|
|
3883
3901
|
t = s === " " ? t + e - t % e : t + 1;
|
|
3884
3902
|
return t;
|
|
3885
3903
|
}
|
|
3886
|
-
function
|
|
3904
|
+
function Fc(n, e) {
|
|
3887
3905
|
let t = e;
|
|
3888
3906
|
for (; n[t] === " " || n[t] === " "; )
|
|
3889
3907
|
t++;
|
|
@@ -3902,8 +3920,8 @@ function Mn(n, e, t) {
|
|
|
3902
3920
|
return f ?? l;
|
|
3903
3921
|
}, i = s(n, 0, void 0, void 0);
|
|
3904
3922
|
if (i) {
|
|
3905
|
-
const o =
|
|
3906
|
-
if (o !== void 0 &&
|
|
3923
|
+
const o = q(n, i.item.marker);
|
|
3924
|
+
if (o !== void 0 && Q(e, o) === Q(e, t))
|
|
3907
3925
|
return i;
|
|
3908
3926
|
}
|
|
3909
3927
|
return qi(n, e, t) ?? i;
|
|
@@ -3913,8 +3931,8 @@ function qi(n, e, t) {
|
|
|
3913
3931
|
const i = (o) => {
|
|
3914
3932
|
if (o instanceof H)
|
|
3915
3933
|
for (let r = 0; r < o.items.length; r++) {
|
|
3916
|
-
const c = o.items[r], a =
|
|
3917
|
-
a !== void 0 &&
|
|
3934
|
+
const c = o.items[r], a = q(n, c.marker);
|
|
3935
|
+
a !== void 0 && Q(e, a) === Q(e, t) && (s = { list: o, item: c, index: r });
|
|
3918
3936
|
}
|
|
3919
3937
|
for (const r of o.children)
|
|
3920
3938
|
i(r);
|
|
@@ -3923,9 +3941,9 @@ function qi(n, e, t) {
|
|
|
3923
3941
|
}
|
|
3924
3942
|
function Ui(n, e, t, s) {
|
|
3925
3943
|
const i = [];
|
|
3926
|
-
let o =
|
|
3944
|
+
let o = Q(n, e);
|
|
3927
3945
|
for (; o < t; ) {
|
|
3928
|
-
i.push(
|
|
3946
|
+
i.push(Vc(n, o, s));
|
|
3929
3947
|
const r = n.indexOf(`
|
|
3930
3948
|
`, o);
|
|
3931
3949
|
if (r === -1)
|
|
@@ -3946,7 +3964,7 @@ function Gi(n, e, t) {
|
|
|
3946
3964
|
}
|
|
3947
3965
|
return i;
|
|
3948
3966
|
}
|
|
3949
|
-
function
|
|
3967
|
+
function Vc(n, e, t) {
|
|
3950
3968
|
let s = e;
|
|
3951
3969
|
for (let i = 0; i < t; i++) {
|
|
3952
3970
|
let o = s;
|
|
@@ -3958,10 +3976,10 @@ function Fc(n, e, t) {
|
|
|
3958
3976
|
}
|
|
3959
3977
|
return s;
|
|
3960
3978
|
}
|
|
3961
|
-
function
|
|
3962
|
-
return new
|
|
3979
|
+
function Wc(n, e) {
|
|
3980
|
+
return new b(n.mapOffset(e.anchor), n.mapOffset(e.active));
|
|
3963
3981
|
}
|
|
3964
|
-
function
|
|
3982
|
+
function $c(n, e, t) {
|
|
3965
3983
|
const s = (i) => {
|
|
3966
3984
|
if (!t.has(i))
|
|
3967
3985
|
return n.mapOffset(i);
|
|
@@ -3973,7 +3991,7 @@ function Wc(n, e, t) {
|
|
|
3973
3991
|
}
|
|
3974
3992
|
return i + o;
|
|
3975
3993
|
};
|
|
3976
|
-
return new
|
|
3994
|
+
return new b(s(e.anchor), s(e.active));
|
|
3977
3995
|
}
|
|
3978
3996
|
function Tt(n) {
|
|
3979
3997
|
if (!Number.isInteger(n.tabSize) || n.tabSize <= 0)
|
|
@@ -3991,29 +4009,29 @@ function Mt(n, e) {
|
|
|
3991
4009
|
t += s.length;
|
|
3992
4010
|
}
|
|
3993
4011
|
}
|
|
3994
|
-
function
|
|
4012
|
+
function Kc(n) {
|
|
3995
4013
|
const e = n.children;
|
|
3996
4014
|
let t = 0;
|
|
3997
|
-
for (let s = e.length - 1; s >= 0 && e[s] instanceof
|
|
4015
|
+
for (let s = e.length - 1; s >= 0 && e[s] instanceof L; s--)
|
|
3998
4016
|
t += e[s].length;
|
|
3999
4017
|
return t;
|
|
4000
4018
|
}
|
|
4001
|
-
const
|
|
4019
|
+
const Hc = (n) => Qi(n, !1), zc = (n) => Qi(n, !0), qc = (n) => Xi(n, !1), Uc = (n) => Xi(n, !0), Gc = (n) => {
|
|
4002
4020
|
if (n.text.length === 0)
|
|
4003
4021
|
return;
|
|
4004
4022
|
const e = Ot(n), t = n.selection.active - De(n.text, n.selection.active);
|
|
4005
4023
|
let s, i;
|
|
4006
4024
|
e.endExclusive < n.text.length ? (s = new v(e.start, e.endExclusive + 1), i = e.start) : e.start > 0 ? (i = De(n.text, e.start - 1), s = new v(e.start - 1, e.endExclusive)) : (s = new v(0, n.text.length), i = 0);
|
|
4007
|
-
const o =
|
|
4025
|
+
const o = S.delete(s), r = o.apply(n.text), c = Fe(r, i);
|
|
4008
4026
|
return {
|
|
4009
4027
|
edit: o,
|
|
4010
|
-
selection:
|
|
4028
|
+
selection: b.collapsed(Math.min(i + t, c))
|
|
4011
4029
|
};
|
|
4012
|
-
},
|
|
4030
|
+
}, Qc = (n) => {
|
|
4013
4031
|
const e = De(n.text, n.selection.range.start), t = Fe(n.text, e);
|
|
4014
4032
|
if (t === n.text.length)
|
|
4015
4033
|
return;
|
|
4016
|
-
const s = Ot(n), i = s.endExclusive === t ? Fe(n.text, t + 1) : s.endExclusive, { text: o, lines: r } =
|
|
4034
|
+
const s = Ot(n), i = s.endExclusive === t ? Fe(n.text, t + 1) : s.endExclusive, { text: o, lines: r } = Xc(n.text, e, i), c = S.replace(new v(e, i), o), a = n.selection.isCollapsed ? b.collapsed(r[0].outputEndExclusive) : new b(
|
|
4017
4035
|
is(r, n.selection.anchor),
|
|
4018
4036
|
is(r, n.selection.active)
|
|
4019
4037
|
);
|
|
@@ -4024,7 +4042,7 @@ function Qi(n, e) {
|
|
|
4024
4042
|
${t.text}` : `${t.text}
|
|
4025
4043
|
`, i = e ? Math.min(t.endExclusive + 1, n.text.length) : t.start, o = e ? t.start + t.text.length + 1 : t.start, r = !e || t.endExclusive < n.text.length;
|
|
4026
4044
|
return {
|
|
4027
|
-
edit:
|
|
4045
|
+
edit: S.insert(i, s),
|
|
4028
4046
|
selection: sn(
|
|
4029
4047
|
n.selection,
|
|
4030
4048
|
t.start,
|
|
@@ -4040,7 +4058,7 @@ function Xi(n, e) {
|
|
|
4040
4058
|
return;
|
|
4041
4059
|
const o = t.endExclusive + 1, r = Fe(n.text, o), c = n.text.slice(o, r), a = t.start + c.length + 1;
|
|
4042
4060
|
return {
|
|
4043
|
-
edit:
|
|
4061
|
+
edit: S.replace(
|
|
4044
4062
|
new v(t.start, r),
|
|
4045
4063
|
`${c}
|
|
4046
4064
|
${t.text}`
|
|
@@ -4057,7 +4075,7 @@ ${t.text}`
|
|
|
4057
4075
|
return;
|
|
4058
4076
|
const s = De(n.text, t.start - 1), i = n.text.slice(s, t.start - 1);
|
|
4059
4077
|
return {
|
|
4060
|
-
edit:
|
|
4078
|
+
edit: S.replace(
|
|
4061
4079
|
new v(s, t.endExclusive),
|
|
4062
4080
|
`${t.text}
|
|
4063
4081
|
${i}`
|
|
@@ -4080,9 +4098,9 @@ function Ot(n) {
|
|
|
4080
4098
|
}
|
|
4081
4099
|
function sn(n, e, t, s) {
|
|
4082
4100
|
const i = (o) => t + Math.min(o - e, s);
|
|
4083
|
-
return new
|
|
4101
|
+
return new b(i(n.anchor), i(n.active));
|
|
4084
4102
|
}
|
|
4085
|
-
function
|
|
4103
|
+
function Xc(n, e, t) {
|
|
4086
4104
|
const s = [];
|
|
4087
4105
|
let i = e;
|
|
4088
4106
|
for (; i <= t; ) {
|
|
@@ -4125,16 +4143,16 @@ function Fe(n, e) {
|
|
|
4125
4143
|
`, e);
|
|
4126
4144
|
return t === -1 ? n.length : t;
|
|
4127
4145
|
}
|
|
4128
|
-
const
|
|
4146
|
+
const jc = (n) => new b(0, n.text.length), Yc = (n, e) => {
|
|
4129
4147
|
const t = gi(n.text, e, n.wordNavigationConfig);
|
|
4130
|
-
return new
|
|
4148
|
+
return new b(t.start, t.end);
|
|
4131
4149
|
};
|
|
4132
|
-
function
|
|
4133
|
-
return new
|
|
4150
|
+
function Jc(n, e) {
|
|
4151
|
+
return new b(e.start, e.endExclusive);
|
|
4134
4152
|
}
|
|
4135
4153
|
const os = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap();
|
|
4136
4154
|
class re extends W {
|
|
4137
|
-
constructor(e, t, s =
|
|
4155
|
+
constructor(e, t, s = Zc) {
|
|
4138
4156
|
super(), this.ast = e, this.dom = t, this._children = s, os.set(t, this);
|
|
4139
4157
|
for (const i of s)
|
|
4140
4158
|
Wt.set(i, this);
|
|
@@ -4286,7 +4304,7 @@ class re extends W {
|
|
|
4286
4304
|
i.forEachTextLeaf(s, t), s += i.sourceLength;
|
|
4287
4305
|
}
|
|
4288
4306
|
}
|
|
4289
|
-
const
|
|
4307
|
+
const Zc = [];
|
|
4290
4308
|
function ht(n, e) {
|
|
4291
4309
|
const t = n.ownerDocument?.activeElement, s = t instanceof HTMLElement && e.some((r) => r === t || r instanceof Element && r.contains(t));
|
|
4292
4310
|
let i = n.firstChild, o = 0;
|
|
@@ -4305,27 +4323,27 @@ function ht(n, e) {
|
|
|
4305
4323
|
}
|
|
4306
4324
|
}
|
|
4307
4325
|
function ji(n, e = !0) {
|
|
4308
|
-
const t =
|
|
4326
|
+
const t = ea(n), s = e ? ta(n) : 0, i = Math.max(t, n.length - s);
|
|
4309
4327
|
return {
|
|
4310
4328
|
text: n.slice(t, i),
|
|
4311
4329
|
sourceOffset: t
|
|
4312
4330
|
};
|
|
4313
4331
|
}
|
|
4314
|
-
function
|
|
4332
|
+
function ea(n) {
|
|
4315
4333
|
return n.startsWith(`\r
|
|
4316
4334
|
`) ? 2 : n.startsWith("\r") || n.startsWith(`
|
|
4317
4335
|
`) ? 1 : 0;
|
|
4318
4336
|
}
|
|
4319
|
-
function
|
|
4337
|
+
function ta(n) {
|
|
4320
4338
|
return n.endsWith(`\r
|
|
4321
4339
|
`) ? 2 : n.endsWith("\r") || n.endsWith(`
|
|
4322
4340
|
`) ? 1 : 0;
|
|
4323
4341
|
}
|
|
4324
|
-
function
|
|
4342
|
+
function na(n) {
|
|
4325
4343
|
const e = n.codeText ?? n.content.filter((t) => t.kind === "marker" && t.markerKind === "content").map((t) => t.content).join("");
|
|
4326
4344
|
return n.openFence ? ji(e, n.closeFence !== void 0).text : e;
|
|
4327
4345
|
}
|
|
4328
|
-
class
|
|
4346
|
+
class sa extends W {
|
|
4329
4347
|
constructor(e, t) {
|
|
4330
4348
|
super(), this._block = e, this._options = t, this.element.className = "md-code-block-actions", this._button.type = "button", this._button.className = "md-code-block-copy", this._button.title = "Copy code block", this._button.setAttribute("aria-label", "Copy code block"), this._icon.className = "codicon codicon-copy", this._icon.setAttribute("aria-hidden", "true"), this._button.appendChild(this._icon), this._status.className = "md-code-block-copy-status", this._status.setAttribute("role", "status"), this._status.setAttribute("aria-live", "polite"), this.element.append(this._status, this._button);
|
|
4331
4349
|
const s = (c) => {
|
|
@@ -4361,7 +4379,7 @@ class na extends W {
|
|
|
4361
4379
|
this._copying = !0, this._resetFeedback(), this._button.setAttribute("aria-busy", "true");
|
|
4362
4380
|
try {
|
|
4363
4381
|
this._button.ownerDocument.hasFocus() || (this._button.closest(".md-editor[tabindex]") ?? this._button).focus({ preventScroll: !0 });
|
|
4364
|
-
const e =
|
|
4382
|
+
const e = na(this._block);
|
|
4365
4383
|
if (this._options?.writeClipboardText ? await this._options.writeClipboardText(e) : await this._button.ownerDocument.defaultView.navigator.clipboard.writeText(e), this._closed)
|
|
4366
4384
|
return;
|
|
4367
4385
|
this._icon.className = "codicon codicon-check", this._status.textContent = "Code block copied";
|
|
@@ -4375,7 +4393,7 @@ class na extends W {
|
|
|
4375
4393
|
}
|
|
4376
4394
|
}
|
|
4377
4395
|
}
|
|
4378
|
-
function
|
|
4396
|
+
function ia(n) {
|
|
4379
4397
|
if (n === "md:icon-only")
|
|
4380
4398
|
return { iconOnly: !0 };
|
|
4381
4399
|
const e = /^md:max-width=([1-9]\d*)$/.exec(n ?? ""), t = e ? Number(e[1]) : void 0;
|
|
@@ -4383,7 +4401,7 @@ function sa(n) {
|
|
|
4383
4401
|
}
|
|
4384
4402
|
class je {
|
|
4385
4403
|
constructor(e, t, s) {
|
|
4386
|
-
this._displayHints = s, this.element = e, this.authoredLabel = t, this._icon = document.createElement("span"), this._icon.className = "md-rich-link-icon codicon", this._icon.setAttribute("aria-hidden", "true"), this._title = document.createElement("span"), this._title.className = "md-rich-link-title", this._detail = document.createElement("span"), this._detail.className = "md-rich-link-detail", this._reference = document.createElement("span"), this._reference.className = "md-rich-link-reference", this._changes =
|
|
4404
|
+
this._displayHints = s, this.element = e, this.authoredLabel = t, this._icon = document.createElement("span"), this._icon.className = "md-rich-link-icon codicon", this._icon.setAttribute("aria-hidden", "true"), this._title = document.createElement("span"), this._title.className = "md-rich-link-title", this._detail = document.createElement("span"), this._detail.className = "md-rich-link-detail", this._reference = document.createElement("span"), this._reference.className = "md-rich-link-reference", this._changes = aa(), this._status = rs("md-rich-link-primary-status"), this._secondaryStatus = rs("md-rich-link-secondary-status"), this.authoredLabel.className = "md-rich-link-label", this.element.classList.add("md-rich-link"), s?.maxWidthChars !== void 0 ? this.element.style.maxWidth = `min(100%, var(--md-rich-link-line-width, 52rem), ${s.maxWidthChars}ch)` : this.element.style.removeProperty("max-width"), this._setDefaultOrder();
|
|
4387
4405
|
}
|
|
4388
4406
|
static create(e) {
|
|
4389
4407
|
const t = document.createElement("span");
|
|
@@ -4413,7 +4431,7 @@ class je {
|
|
|
4413
4431
|
this._renderUnavailable();
|
|
4414
4432
|
return;
|
|
4415
4433
|
}
|
|
4416
|
-
this.element.classList.remove("md-rich-link-unavailable"), this.element.dataset.mdRichLinkKind = e.kind, this._icon.className = `md-rich-link-icon codicon codicon-${
|
|
4434
|
+
this.element.classList.remove("md-rich-link-unavailable"), this.element.dataset.mdRichLinkKind = e.kind, this._icon.className = `md-rich-link-icon codicon codicon-${ca[e.kind]}`, this.authoredLabel.hidden = !!e.title, this._title.textContent = e.title ?? "", this._title.hidden = !e.title, this._detail.textContent = e.detail ?? "", this._detail.hidden = !e.detail, this._reference.textContent = e.reference ?? "", this._reference.hidden = !e.reference, la(this._changes, e.changes), cs(this.element, e.kind, this._status, e.status, "mdRichLinkStatus"), cs(this.element, e.kind, this._secondaryStatus, e.secondaryStatus, "mdRichLinkSecondaryStatus"), ht(this.element, this._displayHints?.iconOnly ? [this._icon] : ua(e) ? [this._status.root, this.authoredLabel, this._title, this._detail, this._reference, this._changes.root, this._secondaryStatus.root] : [this._icon, this.authoredLabel, this._title, this._detail, this._reference, this._changes.root, this._status.root, this._secondaryStatus.root]);
|
|
4417
4435
|
const t = e.ariaLabel ?? (this._displayHints?.iconOnly ? e.title ?? this.authoredLabel.textContent : void 0);
|
|
4418
4436
|
t ? this.element.setAttribute("aria-label", t) : this.element.removeAttribute("aria-label");
|
|
4419
4437
|
const s = e.tooltip ?? (this._displayHints?.iconOnly ? t : void 0);
|
|
@@ -4450,10 +4468,10 @@ function Yi(n) {
|
|
|
4450
4468
|
s.set(r, c + 1), (t[c] ??= []).push({ link: i, block: o });
|
|
4451
4469
|
}
|
|
4452
4470
|
for (const i of t)
|
|
4453
|
-
|
|
4471
|
+
oa(i);
|
|
4454
4472
|
}
|
|
4455
|
-
function
|
|
4456
|
-
const e = n.filter(({ link: s, block: i }) => i.offsetWidth &&
|
|
4473
|
+
function oa(n) {
|
|
4474
|
+
const e = n.filter(({ link: s, block: i }) => i.offsetWidth && ra(s, i));
|
|
4457
4475
|
for (const { link: s } of e)
|
|
4458
4476
|
s.style.setProperty("--md-rich-link-title-width", "0px");
|
|
4459
4477
|
const t = e.map(({ link: s, block: i }) => {
|
|
@@ -4463,7 +4481,7 @@ function ia(n) {
|
|
|
4463
4481
|
for (const [s, { link: i }] of e.entries())
|
|
4464
4482
|
i.style.removeProperty("--md-rich-link-title-width"), i.style.setProperty("--md-rich-link-line-width", t[s]), i.classList.add("md-rich-link-line-end");
|
|
4465
4483
|
}
|
|
4466
|
-
function
|
|
4484
|
+
function ra(n, e) {
|
|
4467
4485
|
const t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT);
|
|
4468
4486
|
t.currentNode = n;
|
|
4469
4487
|
const s = document.createRange();
|
|
@@ -4489,7 +4507,7 @@ function oa(n, e) {
|
|
|
4489
4507
|
}
|
|
4490
4508
|
return !0;
|
|
4491
4509
|
}
|
|
4492
|
-
const
|
|
4510
|
+
const ca = {
|
|
4493
4511
|
resource: "link",
|
|
4494
4512
|
issue: "issues",
|
|
4495
4513
|
pullRequest: "git-pull-request",
|
|
@@ -4508,7 +4526,7 @@ function rs(n) {
|
|
|
4508
4526
|
const s = document.createElement("span");
|
|
4509
4527
|
return s.className = "md-rich-link-status-label", e.append(t, s), { root: e, icon: t, label: s };
|
|
4510
4528
|
}
|
|
4511
|
-
function
|
|
4529
|
+
function aa() {
|
|
4512
4530
|
const n = document.createElement("span");
|
|
4513
4531
|
n.className = "md-rich-link-changes";
|
|
4514
4532
|
const e = document.createElement("span");
|
|
@@ -4516,7 +4534,7 @@ function ca() {
|
|
|
4516
4534
|
const t = document.createElement("span");
|
|
4517
4535
|
return t.className = "md-rich-link-deletions", n.append(e, t), { root: n, insertions: e, deletions: t };
|
|
4518
4536
|
}
|
|
4519
|
-
function
|
|
4537
|
+
function la(n, e) {
|
|
4520
4538
|
if (!e) {
|
|
4521
4539
|
Ji(n);
|
|
4522
4540
|
return;
|
|
@@ -4532,13 +4550,13 @@ function cs(n, e, t, s, i) {
|
|
|
4532
4550
|
return;
|
|
4533
4551
|
}
|
|
4534
4552
|
n.dataset[i] = s.kind;
|
|
4535
|
-
const o =
|
|
4536
|
-
t.icon.className = `md-rich-link-status-icon codicon codicon-${
|
|
4553
|
+
const o = ha(e, s.kind);
|
|
4554
|
+
t.icon.className = `md-rich-link-status-icon codicon codicon-${fa(e, s.kind)}`, t.icon.hidden = o !== void 0, o ? (t.pixelSpinner ??= da(t.label), t.pixelSpinner.classList.toggle("monaco-pixel-spinner-ring", o === "ring")) : (t.pixelSpinner?.remove(), t.pixelSpinner = void 0), t.label.textContent = s.label, t.root.hidden = !1;
|
|
4537
4555
|
}
|
|
4538
4556
|
function on(n) {
|
|
4539
4557
|
n.icon.hidden = !1, n.pixelSpinner?.remove(), n.pixelSpinner = void 0, n.label.textContent = "", n.root.hidden = !0;
|
|
4540
4558
|
}
|
|
4541
|
-
function
|
|
4559
|
+
function da(n) {
|
|
4542
4560
|
const e = document.createElement("span");
|
|
4543
4561
|
e.className = "md-rich-link-status-icon monaco-pixel-spinner", e.setAttribute("aria-hidden", "true");
|
|
4544
4562
|
for (let t = 0; t < 6; t++) {
|
|
@@ -4547,7 +4565,7 @@ function la(n) {
|
|
|
4547
4565
|
}
|
|
4548
4566
|
return n.before(e), e;
|
|
4549
4567
|
}
|
|
4550
|
-
function
|
|
4568
|
+
function ha(n, e) {
|
|
4551
4569
|
if (n === "session")
|
|
4552
4570
|
switch (e) {
|
|
4553
4571
|
case "pending":
|
|
@@ -4558,7 +4576,7 @@ function da(n, e) {
|
|
|
4558
4576
|
return;
|
|
4559
4577
|
}
|
|
4560
4578
|
}
|
|
4561
|
-
function
|
|
4579
|
+
function ua(n) {
|
|
4562
4580
|
const e = n.status?.kind;
|
|
4563
4581
|
switch (n.kind) {
|
|
4564
4582
|
case "issue":
|
|
@@ -4571,7 +4589,7 @@ function ha(n) {
|
|
|
4571
4589
|
return !1;
|
|
4572
4590
|
}
|
|
4573
4591
|
}
|
|
4574
|
-
function
|
|
4592
|
+
function fa(n, e) {
|
|
4575
4593
|
if (n === "session")
|
|
4576
4594
|
switch (e) {
|
|
4577
4595
|
case "pending":
|
|
@@ -4655,7 +4673,7 @@ function Z(n, e, t) {
|
|
|
4655
4673
|
return t;
|
|
4656
4674
|
switch (n.kind) {
|
|
4657
4675
|
case "text":
|
|
4658
|
-
return
|
|
4676
|
+
return ga(n, e, A(t, In));
|
|
4659
4677
|
case "marker":
|
|
4660
4678
|
return n.ast.markerKind === "hardBreak" ? new us(n, A(t, us)) : new ds(n, A(t, ds));
|
|
4661
4679
|
case "glue":
|
|
@@ -4724,9 +4742,9 @@ function J(n, e, t, s) {
|
|
|
4724
4742
|
const { paired: i, unused: o } = Pn(e, t ?? F), r = e.map((c) => s(c, i.get(c)));
|
|
4725
4743
|
for (const c of o)
|
|
4726
4744
|
c.dispose();
|
|
4727
|
-
return
|
|
4745
|
+
return ma(n, r), r;
|
|
4728
4746
|
}
|
|
4729
|
-
function
|
|
4747
|
+
function ma(n, e) {
|
|
4730
4748
|
K(n, e.map((t) => t.mountNode));
|
|
4731
4749
|
}
|
|
4732
4750
|
const K = ht;
|
|
@@ -4781,13 +4799,13 @@ class cn extends M {
|
|
|
4781
4799
|
}
|
|
4782
4800
|
}
|
|
4783
4801
|
function eo(n) {
|
|
4784
|
-
return "content" in n ? n.content :
|
|
4802
|
+
return "content" in n ? n.content : pa;
|
|
4785
4803
|
}
|
|
4786
|
-
const
|
|
4787
|
-
function
|
|
4804
|
+
const pa = [];
|
|
4805
|
+
function ga(n, e, t) {
|
|
4788
4806
|
const s = n.ast.content;
|
|
4789
4807
|
if (n.hiddenPrefixLength > 0)
|
|
4790
|
-
return
|
|
4808
|
+
return _a(n, s, n.hiddenPrefixLength);
|
|
4791
4809
|
const i = {
|
|
4792
4810
|
leftBoundary: n.leftWordBoundary,
|
|
4793
4811
|
rightBoundary: n.rightWordBoundary,
|
|
@@ -4810,7 +4828,7 @@ function pa(n, e, t) {
|
|
|
4810
4828
|
const r = t?.dom, c = r instanceof globalThis.Text && r.data === s ? r : document.createTextNode(s);
|
|
4811
4829
|
return new In(n, c);
|
|
4812
4830
|
}
|
|
4813
|
-
function
|
|
4831
|
+
function _a(n, e, t) {
|
|
4814
4832
|
const s = document.createElement("span");
|
|
4815
4833
|
s.className = "md-text";
|
|
4816
4834
|
const i = document.createElement("span");
|
|
@@ -4819,16 +4837,16 @@ function ga(n, e, t) {
|
|
|
4819
4837
|
i.appendChild(o), s.appendChild(i);
|
|
4820
4838
|
const r = document.createTextNode(e.slice(t));
|
|
4821
4839
|
return s.appendChild(r), new M(n, s, [
|
|
4822
|
-
new
|
|
4823
|
-
new
|
|
4840
|
+
new X(n.ast, o, F, t),
|
|
4841
|
+
new X(n.ast, r, F, e.length - t)
|
|
4824
4842
|
]);
|
|
4825
4843
|
}
|
|
4826
4844
|
function ls(n) {
|
|
4827
4845
|
return n === " " || n === " " || n === `
|
|
4828
4846
|
` || n === "\r";
|
|
4829
4847
|
}
|
|
4830
|
-
const
|
|
4831
|
-
function
|
|
4848
|
+
const va = { leftBoundary: !1, rightBoundary: !1, decorateNewline: !1 }, ut = { leftBoundary: !1, rightBoundary: !1, decorateNewline: !0 }, On = { leftBoundary: !1, rightBoundary: !1, decorateNewline: !1 };
|
|
4849
|
+
function ka(n, e, t) {
|
|
4832
4850
|
const s = e > 0 ? !ls(n[e - 1]) : t.leftBoundary, i = e < n.length - 1 ? !ls(n[e + 1]) : t.rightBoundary;
|
|
4833
4851
|
return s && i;
|
|
4834
4852
|
}
|
|
@@ -4839,7 +4857,7 @@ function to(n, e, t) {
|
|
|
4839
4857
|
if (s === `
|
|
4840
4858
|
` || s === "\r")
|
|
4841
4859
|
return t.decorateNewline ? "md-ws-newline" : void 0;
|
|
4842
|
-
if (s === " " && !
|
|
4860
|
+
if (s === " " && !ka(n, e, t))
|
|
4843
4861
|
return "md-ws-space";
|
|
4844
4862
|
}
|
|
4845
4863
|
function Rn(n, e) {
|
|
@@ -4851,7 +4869,7 @@ function Rn(n, e) {
|
|
|
4851
4869
|
}
|
|
4852
4870
|
return !1;
|
|
4853
4871
|
}
|
|
4854
|
-
function
|
|
4872
|
+
function wa(n, e) {
|
|
4855
4873
|
const t = [];
|
|
4856
4874
|
let s = -1;
|
|
4857
4875
|
const i = (r) => {
|
|
@@ -4882,14 +4900,14 @@ function ka(n, e) {
|
|
|
4882
4900
|
}
|
|
4883
4901
|
function ue(n, e, t, s) {
|
|
4884
4902
|
const i = [];
|
|
4885
|
-
for (const o of
|
|
4903
|
+
for (const o of wa(e, t)) {
|
|
4886
4904
|
const r = document.createTextNode(o.display ?? o.text);
|
|
4887
4905
|
if (o.cls) {
|
|
4888
4906
|
const c = document.createElement("span");
|
|
4889
4907
|
c.className = o.cls, c.appendChild(r), n.appendChild(c);
|
|
4890
4908
|
} else
|
|
4891
4909
|
n.appendChild(r);
|
|
4892
|
-
i.push(new
|
|
4910
|
+
i.push(new X(s, r, F, o.text.length));
|
|
4893
4911
|
}
|
|
4894
4912
|
return i;
|
|
4895
4913
|
}
|
|
@@ -4898,7 +4916,7 @@ class In extends M {
|
|
|
4898
4916
|
super(e, t, F);
|
|
4899
4917
|
}
|
|
4900
4918
|
}
|
|
4901
|
-
class
|
|
4919
|
+
class X extends re {
|
|
4902
4920
|
_sourceLength;
|
|
4903
4921
|
constructor(e, t, s = F, i = e.length) {
|
|
4904
4922
|
super(e, t, s), this._sourceLength = i;
|
|
@@ -4907,7 +4925,7 @@ class Q extends re {
|
|
|
4907
4925
|
return this._sourceLength;
|
|
4908
4926
|
}
|
|
4909
4927
|
}
|
|
4910
|
-
class Ve extends
|
|
4928
|
+
class Ve extends X {
|
|
4911
4929
|
_span;
|
|
4912
4930
|
constructor(e, t) {
|
|
4913
4931
|
const s = document.createElement("span");
|
|
@@ -5013,7 +5031,7 @@ class us extends M {
|
|
|
5013
5031
|
i.className = "md-hardbreak";
|
|
5014
5032
|
const o = document.createElement("span");
|
|
5015
5033
|
o.className = e.visible ? "md-hardbreak-src" : "md-hardbreak-src md-hardbreak-src-hidden";
|
|
5016
|
-
const r = e.visible ? ue(o, s,
|
|
5034
|
+
const r = e.visible ? ue(o, s, va, e.ast) : Ke(o, s, e.ast);
|
|
5017
5035
|
i.appendChild(o), i.appendChild(document.createElement("br")), super(e, i, r), this._span = i;
|
|
5018
5036
|
}
|
|
5019
5037
|
get mountNode() {
|
|
@@ -5043,7 +5061,7 @@ function so(n, e) {
|
|
|
5043
5061
|
}
|
|
5044
5062
|
function Ke(n, e, t) {
|
|
5045
5063
|
const s = document.createTextNode(e);
|
|
5046
|
-
return n.appendChild(s), [new
|
|
5064
|
+
return n.appendChild(s), [new X(t, s, F, e.length)];
|
|
5047
5065
|
}
|
|
5048
5066
|
class pt extends M {
|
|
5049
5067
|
constructor(e, t, s, i = "div") {
|
|
@@ -5065,14 +5083,14 @@ class ke extends M {
|
|
|
5065
5083
|
!o && s && (r.className = s);
|
|
5066
5084
|
const c = J(r, eo(e), o?._sourceChildren, ve(i));
|
|
5067
5085
|
let a, l = c.length;
|
|
5068
|
-
const d = e.ast.children.at(-1), f = d instanceof
|
|
5069
|
-
if (e.kind === "paragraph" && i?.preserveSourceWhitespace && f instanceof
|
|
5086
|
+
const d = e.ast.children.at(-1), f = d instanceof L && d.glueKind === "blockTerminator" ? e.ast.children.at(-2) : d;
|
|
5087
|
+
if (e.kind === "paragraph" && i?.preserveSourceWhitespace && f instanceof L && f.glueKind === void 0 && /[\r\n]$/.test(f.content)) {
|
|
5070
5088
|
a = o?._anchor?.ast === f ? o._anchor : new Ve(f);
|
|
5071
5089
|
const u = c.findIndex((m) => m.ast === f);
|
|
5072
5090
|
if (u === -1)
|
|
5073
5091
|
throw new Error("Missing paragraph continuation glue");
|
|
5074
5092
|
l = u + 1, r.insertBefore(a.mountNode, c[l]?.mountNode ?? null);
|
|
5075
|
-
} else e.kind === "heading" && e.ast.content.every((u) => u instanceof
|
|
5093
|
+
} else e.kind === "heading" && e.ast.content.every((u) => u instanceof L && (u.glueKind === "blockTerminator" || u.glueKind === "blockGap")) && (a = o?._anchor?.ast === e.ast ? o._anchor : new Ve(e.ast), l = c.findIndex((u) => u.ast === e.ast.marker) + 1, r.insertBefore(a.mountNode, c[l]?.mountNode ?? null));
|
|
5076
5094
|
o?._anchor !== a && o?._anchor?.dispose();
|
|
5077
5095
|
const h = [...c];
|
|
5078
5096
|
a && h.splice(l, 0, a), e.kind === "paragraph" && i?.preserveSourceWhitespace && io(h), super(e, r, h), this._sourceChildren = c, this._anchor = a;
|
|
@@ -5107,7 +5125,7 @@ class fs extends M {
|
|
|
5107
5125
|
constructor(e, t, s) {
|
|
5108
5126
|
const i = s?.element ?? document.createElement("blockquote");
|
|
5109
5127
|
s || (i.className = "md-block md-blockquote");
|
|
5110
|
-
const o = J(i, e.content, s?._sourceChildren, ve(t)), r =
|
|
5128
|
+
const o = J(i, e.content, s?._sourceChildren, ve(t)), r = ba(e.ast), c = e.showFinalMarkerOnlyLine ? r : r.slice(0, -1);
|
|
5111
5129
|
i.classList.toggle("md-blockquote-marker-only-line", c.length > 0);
|
|
5112
5130
|
const a = new Map(s?._anchors.map((m) => [m.ast.id, m])), l = c.map(({ marker: m }) => {
|
|
5113
5131
|
const p = a.get(m.id) ?? new Ve(m, "md-blockquote-line-anchor");
|
|
@@ -5122,17 +5140,17 @@ class fs extends M {
|
|
|
5122
5140
|
if (p) {
|
|
5123
5141
|
f.push(p);
|
|
5124
5142
|
const g = o[m + 1], _ = p.mountNode;
|
|
5125
|
-
g?.ast instanceof
|
|
5143
|
+
g?.ast instanceof L && /^[\r\n]+$/.test(g.ast.content) && _ instanceof HTMLElement ? (K(_, [p.dom, g.mountNode]), u.add(g)) : _ instanceof HTMLElement && K(_, [p.dom]), h.push(_);
|
|
5126
5144
|
}
|
|
5127
5145
|
}
|
|
5128
5146
|
K(i, h), super(e, i, f), this._sourceChildren = o, this._anchors = l;
|
|
5129
5147
|
}
|
|
5130
5148
|
}
|
|
5131
|
-
function
|
|
5149
|
+
function ba(n) {
|
|
5132
5150
|
const e = [];
|
|
5133
5151
|
for (let t = n.children.length - 1; t >= 0; t--) {
|
|
5134
5152
|
const s = n.children[t];
|
|
5135
|
-
if (!(s instanceof
|
|
5153
|
+
if (!(s instanceof L)) {
|
|
5136
5154
|
if (s instanceof E && s.markerKind === "blockQuoteMarker") {
|
|
5137
5155
|
e.push({ index: t, marker: s });
|
|
5138
5156
|
continue;
|
|
@@ -5216,8 +5234,8 @@ class vs extends M {
|
|
|
5216
5234
|
const a = J(c, e.content, i?.children, (l, d) => {
|
|
5217
5235
|
const f = l.ast;
|
|
5218
5236
|
if (l.kind === "marker" && f.markerKind === "content") {
|
|
5219
|
-
const u = (d instanceof
|
|
5220
|
-
return new
|
|
5237
|
+
const u = (d instanceof X && d.dom.nodeType === globalThis.Node.TEXT_NODE && d.dom.data === f.content ? d.dom : void 0) ?? document.createTextNode(f.content);
|
|
5238
|
+
return new X(f, u);
|
|
5221
5239
|
}
|
|
5222
5240
|
return Z(l, t, d);
|
|
5223
5241
|
});
|
|
@@ -5260,7 +5278,7 @@ class ws extends re {
|
|
|
5260
5278
|
K(i, c.map((a) => a.mountNode)), super(e, i, c);
|
|
5261
5279
|
}
|
|
5262
5280
|
}
|
|
5263
|
-
class bs extends
|
|
5281
|
+
class bs extends X {
|
|
5264
5282
|
constructor(e, t, s, i) {
|
|
5265
5283
|
super(e, t, F, i), this._span = s;
|
|
5266
5284
|
}
|
|
@@ -5326,14 +5344,14 @@ class An extends M {
|
|
|
5326
5344
|
const i = e.ast, o = i.code?.content ?? "", r = s instanceof An ? s : void 0, c = t?.embeddedCodeEditorReadOnly ?? !1, a = ji(o);
|
|
5327
5345
|
let l;
|
|
5328
5346
|
!e.showMarkup && i.language && i.code && i.closeFence && a.sourceOffset > 0 && t?.embeddedCodeEditorFactory && (r?._embeddedEditor && Object.is(t.embeddedCodeEditorFactoryVersion, r._embeddedEditorFactoryVersion) && (i === r.ast || i.getDiff(r.ast)) ? (l = r._embeddedEditor, r._embeddedEditor = void 0) : l = t.embeddedCodeEditorFactory.create(i.language, i.infoString, a.text) ?? void 0), r?._embeddedEditor && (r._embeddedEditor.dispose(), r._embeddedEditor = void 0);
|
|
5329
|
-
const d = !l && !e.showMarkup && i.language && i.closeFence && t?.renderCustomCodeBlock ?
|
|
5347
|
+
const d = !l && !e.showMarkup && i.language && i.closeFence && t?.renderCustomCodeBlock ? ya(t.renderCustomCodeBlock, i.language, o) : void 0, f = t?.syntaxHighlighter;
|
|
5330
5348
|
let h;
|
|
5331
5349
|
if (!l && !d && f && i.language) {
|
|
5332
5350
|
if (r?._session && i === r.ast)
|
|
5333
5351
|
h = r._session, r._session = void 0;
|
|
5334
5352
|
else if (r?._session) {
|
|
5335
5353
|
const w = i.getDiff(r.ast);
|
|
5336
|
-
w && (h = r._session, r._session = void 0, z((
|
|
5354
|
+
w && (h = r._session, r._session = void 0, z((y) => h.update(w.stringEdit, y)));
|
|
5337
5355
|
}
|
|
5338
5356
|
h || (h = f.create(i.language, o));
|
|
5339
5357
|
}
|
|
@@ -5343,9 +5361,9 @@ class An extends M {
|
|
|
5343
5361
|
if (l) {
|
|
5344
5362
|
l.element.classList.add("md-block", "md-code-block", "md-embedded-code-editor");
|
|
5345
5363
|
const w = l.estimateHeight?.(a.text);
|
|
5346
|
-
w !== void 0 && (l.element.style.boxSizing = "border-box", l.element.style.minHeight = `${w}px`), l.onEdit = (
|
|
5347
|
-
const C = a.sourceOffset === 0 ?
|
|
5348
|
-
|
|
5364
|
+
w !== void 0 && (l.element.style.boxSizing = "border-box", l.element.style.minHeight = `${w}px`), l.onEdit = (y) => {
|
|
5365
|
+
const C = a.sourceOffset === 0 ? y : new S(
|
|
5366
|
+
y.replacements.map((N) => ge.replace(N.replaceRange.delta(a.sourceOffset), N.newText))
|
|
5349
5367
|
);
|
|
5350
5368
|
t?.onEmbeddedCodeEditorEdit?.(i, C);
|
|
5351
5369
|
}, l.setReadOnly?.(t?.embeddedCodeEditorReadOnly ?? !1), l.setContent(a.text), m = l.element, p = F;
|
|
@@ -5360,45 +5378,45 @@ class An extends M {
|
|
|
5360
5378
|
"md-block md-code-block",
|
|
5361
5379
|
i.language || void 0,
|
|
5362
5380
|
u
|
|
5363
|
-
),
|
|
5381
|
+
), y = w.dom, C = w.children;
|
|
5364
5382
|
if (g = w.contentNode, !i.closeFence && i.code && o.endsWith(`
|
|
5365
5383
|
`)) {
|
|
5366
5384
|
const N = new Ve(i.code);
|
|
5367
|
-
|
|
5385
|
+
y.appendChild(N.mountNode), C.push(N);
|
|
5368
5386
|
}
|
|
5369
|
-
m =
|
|
5387
|
+
m = y, p = C;
|
|
5370
5388
|
} else {
|
|
5371
5389
|
const w = document.createElement("pre");
|
|
5372
5390
|
w.className = "md-block md-code-block";
|
|
5373
|
-
const
|
|
5374
|
-
w.appendChild(
|
|
5391
|
+
const y = document.createElement("code");
|
|
5392
|
+
w.appendChild(y);
|
|
5375
5393
|
const C = [];
|
|
5376
5394
|
for (const N of e.content) {
|
|
5377
5395
|
const ne = N.ast;
|
|
5378
5396
|
if (N.kind === "marker" && ne.markerKind === "content") {
|
|
5379
|
-
const
|
|
5380
|
-
|
|
5397
|
+
const j = document.createTextNode(ne.content);
|
|
5398
|
+
y.appendChild(j), C.push(new X(ne, j));
|
|
5381
5399
|
} else if (N.kind === "marker" && ne.markerKind === "codeIndent") {
|
|
5382
|
-
const
|
|
5400
|
+
const j = ne;
|
|
5383
5401
|
if (N.visible) {
|
|
5384
|
-
const
|
|
5385
|
-
|
|
5386
|
-
const Le = ue(
|
|
5387
|
-
|
|
5402
|
+
const U = document.createElement("span");
|
|
5403
|
+
U.className = "md-marker md-marker-codeIndent";
|
|
5404
|
+
const Le = ue(U, j.content, On, j);
|
|
5405
|
+
y.appendChild(U), C.push(new X(j, U, Le));
|
|
5388
5406
|
} else {
|
|
5389
|
-
const
|
|
5390
|
-
|
|
5407
|
+
const U = Z(N, t, void 0);
|
|
5408
|
+
y.appendChild(U.mountNode), C.push(U);
|
|
5391
5409
|
}
|
|
5392
5410
|
} else {
|
|
5393
|
-
const
|
|
5394
|
-
w.appendChild(
|
|
5411
|
+
const j = Z(N, t, void 0);
|
|
5412
|
+
w.appendChild(j.mountNode), C.push(j);
|
|
5395
5413
|
}
|
|
5396
5414
|
}
|
|
5397
5415
|
m = w, p = C;
|
|
5398
5416
|
}
|
|
5399
5417
|
const _ = r?.dom ?? document.createElement("div");
|
|
5400
5418
|
_.className = "md-block md-code-block-container";
|
|
5401
|
-
const k = r?._copyAction ?? new
|
|
5419
|
+
const k = r?._copyAction ?? new sa(i, t);
|
|
5402
5420
|
r && (r._copyAction = void 0), k.update(i, t), l?.setActions ? (l.setActions(k.element), K(_, [m])) : K(_, [k.element, m]), super(e, _, p), this._contentElement = m, this._copyAction = k, this._session = h, this._embeddedEditor = l, this._embeddedEditorFactoryVersion = t?.embeddedCodeEditorFactoryVersion, this._embeddedEditorReadOnly = c, h && g && (this._snapshotSub = mn(h.snapshot, () => {
|
|
5403
5421
|
const w = h.snapshot.get();
|
|
5404
5422
|
g.refresh(o, w.getTokens(v.ofLength(o.length)).tokens);
|
|
@@ -5411,7 +5429,7 @@ class An extends M {
|
|
|
5411
5429
|
this._copyAction?.dispose(), this._copyAction = void 0, this._snapshotSub?.dispose(), this._snapshotSub = void 0, this._session?.dispose(), this._session = void 0, this._embeddedEditor?.dispose(), this._embeddedEditor = void 0, super.dispose();
|
|
5412
5430
|
}
|
|
5413
5431
|
}
|
|
5414
|
-
function
|
|
5432
|
+
function ya(n, e, t) {
|
|
5415
5433
|
try {
|
|
5416
5434
|
return n(e, t);
|
|
5417
5435
|
} catch (s) {
|
|
@@ -5430,7 +5448,7 @@ function oo(n, e, t, s, i, o, r) {
|
|
|
5430
5448
|
if (e && u.ast === e) {
|
|
5431
5449
|
const m = document.createElement("code");
|
|
5432
5450
|
o && (m.className = `language-${CSS.escape(o)}`);
|
|
5433
|
-
const p =
|
|
5451
|
+
const p = Ea(
|
|
5434
5452
|
e,
|
|
5435
5453
|
t,
|
|
5436
5454
|
m,
|
|
@@ -5444,10 +5462,10 @@ function oo(n, e, t, s, i, o, r) {
|
|
|
5444
5462
|
}
|
|
5445
5463
|
return { dom: c, children: f, contentNode: h };
|
|
5446
5464
|
}
|
|
5447
|
-
function
|
|
5465
|
+
function Ea(n, e, t, s, i) {
|
|
5448
5466
|
if (!s && !i) {
|
|
5449
5467
|
const o = document.createTextNode(e);
|
|
5450
|
-
return t.appendChild(o), new
|
|
5468
|
+
return t.appendChild(o), new X(n, o);
|
|
5451
5469
|
}
|
|
5452
5470
|
return new ro(n, t, e, s ?? [{ length: e.length, className: void 0 }], i);
|
|
5453
5471
|
}
|
|
@@ -5485,7 +5503,7 @@ function Es(n, e, t, s, i) {
|
|
|
5485
5503
|
g.appendChild(p), e.appendChild(g);
|
|
5486
5504
|
} else
|
|
5487
5505
|
e.appendChild(p);
|
|
5488
|
-
o.push(new
|
|
5506
|
+
o.push(new X(n, p, F, m.length));
|
|
5489
5507
|
}
|
|
5490
5508
|
return o;
|
|
5491
5509
|
}
|
|
@@ -5502,10 +5520,10 @@ function ao(n, e, t) {
|
|
|
5502
5520
|
const s = e.filter((c) => c.length > 0 && c.start >= 0 && c.start + c.length <= t).slice().sort((c, a) => c.start - a.start), i = [];
|
|
5503
5521
|
let o = 0;
|
|
5504
5522
|
const r = (c) => {
|
|
5505
|
-
c > 0 && i.push(new
|
|
5523
|
+
c > 0 && i.push(new X(n, document.createTextNode(""), F, c));
|
|
5506
5524
|
};
|
|
5507
5525
|
for (const c of s)
|
|
5508
|
-
c.start < o || (r(c.start - o), i.push(new
|
|
5526
|
+
c.start < o || (r(c.start - o), i.push(new X(n, c.dom, F, c.length)), o = c.start + c.length);
|
|
5509
5527
|
return r(t - o), i;
|
|
5510
5528
|
}
|
|
5511
5529
|
class xs extends M {
|
|
@@ -5520,7 +5538,7 @@ class xs extends M {
|
|
|
5520
5538
|
for (const f of e.content)
|
|
5521
5539
|
if (f.ast === i.code) {
|
|
5522
5540
|
const h = document.createElement("code"), u = document.createTextNode(i.code.content);
|
|
5523
|
-
h.appendChild(u), l.appendChild(h), d.push(new
|
|
5541
|
+
h.appendChild(u), l.appendChild(h), d.push(new X(i.code, u));
|
|
5524
5542
|
} else {
|
|
5525
5543
|
const h = Z(f, t, void 0);
|
|
5526
5544
|
l.appendChild(h.mountNode), d.push(h);
|
|
@@ -5566,7 +5584,7 @@ class Ss extends M {
|
|
|
5566
5584
|
s?._anchor?.mountNode.parentNode?.removeChild(s._anchor.mountNode);
|
|
5567
5585
|
const i = e.ast, o = s?.element ?? document.createElement("li");
|
|
5568
5586
|
o.classList.toggle("md-list-item-active", e.isActive), o.classList.toggle("md-list-item-incomplete", i.isIncomplete), o.classList.toggle("md-task-list-item", i.checked !== void 0), o.classList.toggle("md-markers-hidden", !e.isActive), o.classList.toggle("md-task-list-item-running", e.isRunning), o.style.setProperty("--md-list-level", String(e.level)), o.style.setProperty("--md-list-source-indent", String(e.sourceIndentation)), o.style.setProperty("--md-list-marker-spaces", String(i.marker.content.length - i.marker.content.trimEnd().length || 1));
|
|
5569
|
-
const r =
|
|
5587
|
+
const r = xa(o, e.content, s, t);
|
|
5570
5588
|
let c;
|
|
5571
5589
|
if (i.blocks.length === 0) {
|
|
5572
5590
|
const a = r.findIndex((d) => d.ast === i.marker);
|
|
@@ -5592,7 +5610,7 @@ class Ss extends M {
|
|
|
5592
5610
|
super(e, o, r), this._anchor = c;
|
|
5593
5611
|
}
|
|
5594
5612
|
}
|
|
5595
|
-
function
|
|
5613
|
+
function xa(n, e, t, s) {
|
|
5596
5614
|
const { paired: i, unused: o } = Pn(e, t?.children ?? F), r = e.map((f) => Z(f, s, i.get(f)));
|
|
5597
5615
|
for (const f of o)
|
|
5598
5616
|
f.dispose();
|
|
@@ -5693,7 +5711,7 @@ class Rs extends M {
|
|
|
5693
5711
|
}
|
|
5694
5712
|
let c;
|
|
5695
5713
|
const a = i ? r.querySelector(":scope > .md-rich-link-label") ?? document.createElement("span") : r, l = J(a, e.content, s?.children, ve(t));
|
|
5696
|
-
if (i ? c = je.mount(r, a,
|
|
5714
|
+
if (i ? c = je.mount(r, a, ia(e.ast.title)) : (je.clear(r), K(r, l.map((d) => d.mountNode))), super(e, r, l), i && c) {
|
|
5697
5715
|
this._presentation = i;
|
|
5698
5716
|
const d = () => c.update(i.presentation.get());
|
|
5699
5717
|
d(), this._presentationSubscription = mn(i.presentation, d);
|
|
@@ -5740,7 +5758,7 @@ class Bn extends re {
|
|
|
5740
5758
|
i.classList.add("md-document");
|
|
5741
5759
|
const o = new Map(
|
|
5742
5760
|
e.children.filter((u) => u.kind === "block").map((u) => [u.view, u.isActive])
|
|
5743
|
-
), r = s?.children, c = e.children.map((u) => u.view), { paired: a, unused: l } = Pn(c, r ??
|
|
5761
|
+
), r = s?.children, c = e.children.map((u) => u.view), { paired: a, unused: l } = Pn(c, r ?? Ca);
|
|
5744
5762
|
let d;
|
|
5745
5763
|
const f = c.map((u, m) => {
|
|
5746
5764
|
const p = a.get(u);
|
|
@@ -5804,7 +5822,7 @@ class Ns extends re {
|
|
|
5804
5822
|
return new DOMRect(i?.right ?? e.left, e.top, 0, e.height);
|
|
5805
5823
|
}
|
|
5806
5824
|
}
|
|
5807
|
-
const
|
|
5825
|
+
const Ca = [], rt = 1e-7;
|
|
5808
5826
|
class Rt {
|
|
5809
5827
|
constructor(e) {
|
|
5810
5828
|
this._getLocalToClientMatrix = e;
|
|
@@ -5823,10 +5841,10 @@ class Rt {
|
|
|
5823
5841
|
const e = this._getLocalToClientMatrix();
|
|
5824
5842
|
if (e.is2D === !1 || Math.abs(e.b) > rt || Math.abs(e.c) > rt || e.a <= rt || e.d <= rt)
|
|
5825
5843
|
throw new Error("Markdown editor geometry supports positive axis-aligned scale and translation only");
|
|
5826
|
-
return new
|
|
5844
|
+
return new Sa(e);
|
|
5827
5845
|
}
|
|
5828
5846
|
}
|
|
5829
|
-
class
|
|
5847
|
+
class Sa {
|
|
5830
5848
|
constructor(e) {
|
|
5831
5849
|
this._localToClient = e, this._clientToLocal = e.inverse();
|
|
5832
5850
|
}
|
|
@@ -5856,127 +5874,127 @@ class lo {
|
|
|
5856
5874
|
}
|
|
5857
5875
|
kind = "document";
|
|
5858
5876
|
}
|
|
5859
|
-
class
|
|
5877
|
+
class La {
|
|
5860
5878
|
constructor(e, t) {
|
|
5861
5879
|
this.ast = e, this.content = t;
|
|
5862
5880
|
}
|
|
5863
5881
|
kind = "heading";
|
|
5864
5882
|
}
|
|
5865
|
-
class
|
|
5883
|
+
class Ta {
|
|
5866
5884
|
constructor(e, t) {
|
|
5867
5885
|
this.ast = e, this.content = t;
|
|
5868
5886
|
}
|
|
5869
5887
|
kind = "paragraph";
|
|
5870
5888
|
}
|
|
5871
|
-
class
|
|
5889
|
+
class Ma {
|
|
5872
5890
|
constructor(e, t) {
|
|
5873
5891
|
this.ast = e, this.content = t;
|
|
5874
5892
|
}
|
|
5875
5893
|
kind = "emptyBlock";
|
|
5876
5894
|
}
|
|
5877
|
-
class
|
|
5895
|
+
class Oa {
|
|
5878
5896
|
constructor(e, t, s, i) {
|
|
5879
5897
|
this.ast = e, this.anchorBlock = t, this.cursorLine = s, this.text = i;
|
|
5880
5898
|
}
|
|
5881
5899
|
kind = "pendingParagraph";
|
|
5882
5900
|
}
|
|
5883
|
-
class
|
|
5901
|
+
class Ra {
|
|
5884
5902
|
constructor(e, t, s) {
|
|
5885
5903
|
this.ast = e, this.showMarkup = t, this.content = s;
|
|
5886
5904
|
}
|
|
5887
5905
|
kind = "frontMatter";
|
|
5888
5906
|
}
|
|
5889
|
-
class
|
|
5907
|
+
class Ia {
|
|
5890
5908
|
constructor(e, t, s) {
|
|
5891
5909
|
this.ast = e, this.showMarkup = t, this.content = s;
|
|
5892
5910
|
}
|
|
5893
5911
|
kind = "codeBlock";
|
|
5894
5912
|
}
|
|
5895
|
-
class
|
|
5913
|
+
class Na {
|
|
5896
5914
|
constructor(e, t, s) {
|
|
5897
5915
|
this.ast = e, this.showMarkup = t, this.content = s;
|
|
5898
5916
|
}
|
|
5899
5917
|
kind = "mathBlock";
|
|
5900
5918
|
}
|
|
5901
|
-
class
|
|
5919
|
+
class Aa {
|
|
5902
5920
|
constructor(e, t, s) {
|
|
5903
5921
|
this.ast = e, this.content = t, this.showFinalMarkerOnlyLine = s;
|
|
5904
5922
|
}
|
|
5905
5923
|
kind = "blockQuote";
|
|
5906
5924
|
}
|
|
5907
|
-
class
|
|
5925
|
+
class Pa {
|
|
5908
5926
|
constructor(e, t) {
|
|
5909
5927
|
this.ast = e, this.content = t;
|
|
5910
5928
|
}
|
|
5911
5929
|
kind = "list";
|
|
5912
5930
|
}
|
|
5913
|
-
class
|
|
5931
|
+
class Ba {
|
|
5914
5932
|
constructor(e, t) {
|
|
5915
5933
|
this.ast = e, this.content = t;
|
|
5916
5934
|
}
|
|
5917
5935
|
kind = "table";
|
|
5918
5936
|
}
|
|
5919
|
-
class
|
|
5937
|
+
class Da {
|
|
5920
5938
|
constructor(e, t) {
|
|
5921
5939
|
this.ast = e, this.content = t;
|
|
5922
5940
|
}
|
|
5923
5941
|
kind = "strong";
|
|
5924
5942
|
}
|
|
5925
|
-
class
|
|
5943
|
+
class Fa {
|
|
5926
5944
|
constructor(e, t) {
|
|
5927
5945
|
this.ast = e, this.content = t;
|
|
5928
5946
|
}
|
|
5929
5947
|
kind = "emphasis";
|
|
5930
5948
|
}
|
|
5931
|
-
class
|
|
5949
|
+
class Va {
|
|
5932
5950
|
constructor(e, t) {
|
|
5933
5951
|
this.ast = e, this.content = t;
|
|
5934
5952
|
}
|
|
5935
5953
|
kind = "strikethrough";
|
|
5936
5954
|
}
|
|
5937
|
-
class
|
|
5955
|
+
class Wa {
|
|
5938
5956
|
constructor(e, t) {
|
|
5939
5957
|
this.ast = e, this.content = t;
|
|
5940
5958
|
}
|
|
5941
5959
|
kind = "inlineCode";
|
|
5942
5960
|
}
|
|
5943
|
-
class
|
|
5961
|
+
class $a {
|
|
5944
5962
|
constructor(e, t, s) {
|
|
5945
5963
|
this.ast = e, this.showMarkup = t, this.content = s;
|
|
5946
5964
|
}
|
|
5947
5965
|
kind = "inlineMath";
|
|
5948
5966
|
}
|
|
5949
|
-
class
|
|
5967
|
+
class Ka {
|
|
5950
5968
|
constructor(e, t, s) {
|
|
5951
5969
|
this.ast = e, this.showMarkup = t, this.content = s;
|
|
5952
5970
|
}
|
|
5953
5971
|
kind = "link";
|
|
5954
5972
|
}
|
|
5955
|
-
class
|
|
5973
|
+
class Ha {
|
|
5956
5974
|
constructor(e, t, s) {
|
|
5957
5975
|
this.ast = e, this.showMarkup = t, this.content = s;
|
|
5958
5976
|
}
|
|
5959
5977
|
kind = "image";
|
|
5960
5978
|
}
|
|
5961
|
-
class
|
|
5979
|
+
class za {
|
|
5962
5980
|
constructor(e, t, s, i, o = !1, r = i - 1) {
|
|
5963
5981
|
this.ast = e, this.isActive = t, this.content = s, this.level = i, this.isRunning = o, this.sourceIndentation = r;
|
|
5964
5982
|
}
|
|
5965
5983
|
kind = "listItem";
|
|
5966
5984
|
}
|
|
5967
|
-
class
|
|
5985
|
+
class qa {
|
|
5968
5986
|
constructor(e, t, s) {
|
|
5969
5987
|
this.ast = e, this.isDelimiter = t, this.content = s;
|
|
5970
5988
|
}
|
|
5971
5989
|
kind = "tableRow";
|
|
5972
5990
|
}
|
|
5973
|
-
class
|
|
5991
|
+
class Ua {
|
|
5974
5992
|
constructor(e, t, s, i) {
|
|
5975
5993
|
this.ast = e, this.isActive = t, this.showTableGlue = s, this.content = i;
|
|
5976
5994
|
}
|
|
5977
5995
|
kind = "tableCell";
|
|
5978
5996
|
}
|
|
5979
|
-
class
|
|
5997
|
+
class Ga {
|
|
5980
5998
|
/**
|
|
5981
5999
|
* Whether non-obvious whitespace in this text is revealed (block is active).
|
|
5982
6000
|
* `leftWordBoundary`/`rightWordBoundary` say whether the inline sibling on
|
|
@@ -5989,7 +6007,7 @@ class Ua {
|
|
|
5989
6007
|
}
|
|
5990
6008
|
kind = "text";
|
|
5991
6009
|
}
|
|
5992
|
-
class
|
|
6010
|
+
class Qa {
|
|
5993
6011
|
constructor(e, t, s) {
|
|
5994
6012
|
this.ast = e, this.showMarkup = t, this.content = s;
|
|
5995
6013
|
}
|
|
@@ -6001,13 +6019,13 @@ class ho {
|
|
|
6001
6019
|
}
|
|
6002
6020
|
kind = "video";
|
|
6003
6021
|
}
|
|
6004
|
-
class
|
|
6022
|
+
class Xa {
|
|
6005
6023
|
constructor(e, t, s) {
|
|
6006
6024
|
this.ast = e, this.showMarkup = t, this.content = s;
|
|
6007
6025
|
}
|
|
6008
6026
|
kind = "unhandledBlock";
|
|
6009
6027
|
}
|
|
6010
|
-
class
|
|
6028
|
+
class ja {
|
|
6011
6029
|
constructor(e, t) {
|
|
6012
6030
|
this.ast = e, this.visible = t;
|
|
6013
6031
|
}
|
|
@@ -6019,7 +6037,7 @@ class uo {
|
|
|
6019
6037
|
}
|
|
6020
6038
|
kind = "glue";
|
|
6021
6039
|
}
|
|
6022
|
-
class
|
|
6040
|
+
class Ya {
|
|
6023
6041
|
constructor(e, t, s, i, o) {
|
|
6024
6042
|
this.ast = e, this.side = t, this.deletedRanges = s, this.whole = i, this.originalStart = o;
|
|
6025
6043
|
}
|
|
@@ -6039,7 +6057,7 @@ function fo(n, e, t, s, i) {
|
|
|
6039
6057
|
for (let h = 0; h < r.length; h++) {
|
|
6040
6058
|
const u = r[h];
|
|
6041
6059
|
if (c.has(u)) {
|
|
6042
|
-
const m = u, p = e.has(m), g = o.get(m), _ = m.kind === "emptyBlock" ?
|
|
6060
|
+
const m = u, p = e.has(m), g = o.get(m), _ = m.kind === "emptyBlock" ? cl(f, m) : void 0;
|
|
6043
6061
|
m.kind !== "emptyBlock" && (f = m);
|
|
6044
6062
|
const k = i?.anchorBlock === m ? i.replaceRange.delta(-d) : void 0;
|
|
6045
6063
|
let w;
|
|
@@ -6051,14 +6069,14 @@ function fo(n, e, t, s, i) {
|
|
|
6051
6069
|
pendingReplacementInBlock: k
|
|
6052
6070
|
}, g?.view);
|
|
6053
6071
|
else {
|
|
6054
|
-
const
|
|
6072
|
+
const y = t && t.endExclusive >= d && t.start <= d + m.length ? new v(
|
|
6055
6073
|
Math.max(0, t.start - d),
|
|
6056
6074
|
Math.min(m.length, t.endExclusive - d)
|
|
6057
6075
|
) : void 0;
|
|
6058
6076
|
w = ln(m, {
|
|
6059
6077
|
showMarkup: !0,
|
|
6060
6078
|
showTableGlue: !1,
|
|
6061
|
-
selectionInNode:
|
|
6079
|
+
selectionInNode: y,
|
|
6062
6080
|
listContinuation: _,
|
|
6063
6081
|
pendingAnchorBlock: k ? m : void 0,
|
|
6064
6082
|
pendingReplacementInBlock: k
|
|
@@ -6067,10 +6085,10 @@ function fo(n, e, t, s, i) {
|
|
|
6067
6085
|
a.push({ ast: m, absoluteStart: d, isActive: p, view: w }), l.push({ absoluteStart: d, isActive: p, view: w, kind: "block" }), i && i.anchorBlock === m && l.push({
|
|
6068
6086
|
absoluteStart: d + m.length,
|
|
6069
6087
|
isActive: !0,
|
|
6070
|
-
view: new
|
|
6088
|
+
view: new Oa(i.ast, i.anchorBlock, i.cursorLine, i.text),
|
|
6071
6089
|
kind: "pendingParagraph"
|
|
6072
6090
|
});
|
|
6073
|
-
} else if (u instanceof
|
|
6091
|
+
} else if (u instanceof L) {
|
|
6074
6092
|
const m = o.get(u), p = O(m?.view, new uo(u, !1, !1));
|
|
6075
6093
|
l.push({ absoluteStart: d, isActive: !1, view: p, kind: "glue" });
|
|
6076
6094
|
}
|
|
@@ -6081,14 +6099,14 @@ function fo(n, e, t, s, i) {
|
|
|
6081
6099
|
function ln(n, e, t) {
|
|
6082
6100
|
return He(n, e, t);
|
|
6083
6101
|
}
|
|
6084
|
-
function
|
|
6102
|
+
function Ja(n, e, t, s = !1) {
|
|
6085
6103
|
return mo(n, e, s, t);
|
|
6086
6104
|
}
|
|
6087
6105
|
function mo(n, e, t, s) {
|
|
6088
6106
|
const i = e ? { showMarkup: !0, showTableGlue: !1, selectionInNode: void 0, forceVideoSource: t } : t ? { ...an, forceVideoSource: !0 } : an;
|
|
6089
6107
|
return ln(n, i, s);
|
|
6090
6108
|
}
|
|
6091
|
-
function
|
|
6109
|
+
function Za(n, e, t = !1) {
|
|
6092
6110
|
const s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
6093
6111
|
let o = [];
|
|
6094
6112
|
for (const l of e) {
|
|
@@ -6129,7 +6147,7 @@ function $t(n, e, t, s, i, o) {
|
|
|
6129
6147
|
}
|
|
6130
6148
|
function ft(n, e, t, s, i) {
|
|
6131
6149
|
const o = i || !t || n.kind === "video";
|
|
6132
|
-
return new
|
|
6150
|
+
return new Ya(n, mo(n, o, !0), e, t, s);
|
|
6133
6151
|
}
|
|
6134
6152
|
function po(n, e, t) {
|
|
6135
6153
|
const s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
@@ -6165,7 +6183,7 @@ function _t(n, e, t) {
|
|
|
6165
6183
|
return i;
|
|
6166
6184
|
let o;
|
|
6167
6185
|
if (n.kind === "video") {
|
|
6168
|
-
const c = t ?
|
|
6186
|
+
const c = t ? Ja(n.ast, !0) : n;
|
|
6169
6187
|
if (c.kind !== "video")
|
|
6170
6188
|
throw new Error("Video AST must build video view data");
|
|
6171
6189
|
o = new ho(c.ast, c.showMarkup, c.content, e);
|
|
@@ -6195,7 +6213,7 @@ function He(n, e, t, s) {
|
|
|
6195
6213
|
const i = n;
|
|
6196
6214
|
switch (i.kind) {
|
|
6197
6215
|
case "text":
|
|
6198
|
-
return O(t, new
|
|
6216
|
+
return O(t, new Ga(
|
|
6199
6217
|
i,
|
|
6200
6218
|
e.showMarkup,
|
|
6201
6219
|
s?.left ?? !1,
|
|
@@ -6206,71 +6224,71 @@ function He(n, e, t, s) {
|
|
|
6206
6224
|
// The trailing gap is revealed as `↵` glyphs by virtue of its `blockGap`
|
|
6207
6225
|
// kind (see `GlueViewNode`), so the break needs no inline-flow opt-in.
|
|
6208
6226
|
case "thematicBreak":
|
|
6209
|
-
return O(t, new
|
|
6227
|
+
return O(t, new Qa(i, e.showMarkup, V(i.children, e, t)));
|
|
6210
6228
|
case "video": {
|
|
6211
6229
|
const o = e.forceVideoSource && !e.showMarkup ? { ...e, showMarkup: !0 } : e;
|
|
6212
6230
|
return O(t, new ho(i, o.showMarkup, V(i.children, o, t)));
|
|
6213
6231
|
}
|
|
6214
6232
|
case "unhandledBlock":
|
|
6215
|
-
return O(t, new
|
|
6233
|
+
return O(t, new Xa(i, e.showMarkup, V(i.children, e, t)));
|
|
6216
6234
|
case "marker":
|
|
6217
|
-
return O(t, new
|
|
6235
|
+
return O(t, new ja(i, sl(i.markerKind, e)));
|
|
6218
6236
|
case "glue":
|
|
6219
6237
|
return O(t, new uo(
|
|
6220
6238
|
i,
|
|
6221
|
-
|
|
6239
|
+
il(i.glueKind, e),
|
|
6222
6240
|
e.inlineFlow ?? !1,
|
|
6223
6241
|
e.showMarkup,
|
|
6224
6242
|
i.glueKind === "indent" || i.glueKind === "emptyLine" ? e.listContinuation : void 0
|
|
6225
6243
|
));
|
|
6226
6244
|
case "heading":
|
|
6227
|
-
return O(t, new Sa(i, V(i.children, oe(e), t)));
|
|
6228
|
-
case "paragraph":
|
|
6229
6245
|
return O(t, new La(i, V(i.children, oe(e), t)));
|
|
6230
|
-
case "
|
|
6246
|
+
case "paragraph":
|
|
6231
6247
|
return O(t, new Ta(i, V(i.children, oe(e), t)));
|
|
6248
|
+
case "emptyBlock":
|
|
6249
|
+
return O(t, new Ma(i, V(i.children, oe(e), t)));
|
|
6232
6250
|
case "frontMatter":
|
|
6233
|
-
return O(t, new Oa(i, e.showMarkup, V(i.children, e, t)));
|
|
6234
|
-
case "codeBlock":
|
|
6235
6251
|
return O(t, new Ra(i, e.showMarkup, V(i.children, e, t)));
|
|
6236
|
-
case "
|
|
6252
|
+
case "codeBlock":
|
|
6237
6253
|
return O(t, new Ia(i, e.showMarkup, V(i.children, e, t)));
|
|
6254
|
+
case "mathBlock":
|
|
6255
|
+
return O(t, new Na(i, e.showMarkup, V(i.children, e, t)));
|
|
6238
6256
|
case "blockQuote": {
|
|
6239
|
-
const o =
|
|
6240
|
-
return O(t, new
|
|
6257
|
+
const o = nl(i), r = e.pendingAnchorBlock ? q(e.pendingAnchorBlock, i) : void 0, c = o && r !== void 0 ? o.delta(r) : void 0, a = !c || !e.pendingReplacementInBlock?.containsRange(c);
|
|
6258
|
+
return O(t, new Aa(i, V(i.children, e, t, !0), a));
|
|
6241
6259
|
}
|
|
6242
6260
|
case "list":
|
|
6243
|
-
return O(t,
|
|
6261
|
+
return O(t, rl(i, e, t));
|
|
6244
6262
|
case "listItem":
|
|
6245
6263
|
return O(t, vo(i, e, t));
|
|
6246
6264
|
case "table":
|
|
6247
|
-
return O(t,
|
|
6265
|
+
return O(t, al(i, e, t));
|
|
6248
6266
|
case "tableRow":
|
|
6249
6267
|
return O(t, wo(i, e, !1, t));
|
|
6250
6268
|
case "tableCell":
|
|
6251
6269
|
return O(t, bo(i, e.showMarkup, e.showTableGlue, e.selectionInNode, t));
|
|
6252
6270
|
case "strong":
|
|
6253
|
-
return O(t, new Ba(i, V(i.children, oe(e), t)));
|
|
6254
|
-
case "emphasis":
|
|
6255
6271
|
return O(t, new Da(i, V(i.children, oe(e), t)));
|
|
6256
|
-
case "
|
|
6272
|
+
case "emphasis":
|
|
6257
6273
|
return O(t, new Fa(i, V(i.children, oe(e), t)));
|
|
6258
|
-
case "
|
|
6274
|
+
case "strikethrough":
|
|
6259
6275
|
return O(t, new Va(i, V(i.children, oe(e), t)));
|
|
6276
|
+
case "inlineCode":
|
|
6277
|
+
return O(t, new Wa(i, V(i.children, oe(e), t)));
|
|
6260
6278
|
case "inlineMath":
|
|
6261
|
-
return O(t, new Wa(i, e.showMarkup, V(i.children, oe(e), t)));
|
|
6262
|
-
case "link":
|
|
6263
6279
|
return O(t, new $a(i, e.showMarkup, V(i.children, oe(e), t)));
|
|
6264
|
-
case "
|
|
6280
|
+
case "link":
|
|
6265
6281
|
return O(t, new Ka(i, e.showMarkup, V(i.children, oe(e), t)));
|
|
6282
|
+
case "image":
|
|
6283
|
+
return O(t, new Ha(i, e.showMarkup, V(i.children, oe(e), t)));
|
|
6266
6284
|
case "document":
|
|
6267
6285
|
return fo(i, /* @__PURE__ */ new Set(), v.ofLength(0), void 0);
|
|
6268
6286
|
}
|
|
6269
6287
|
}
|
|
6270
6288
|
function dn(n) {
|
|
6271
|
-
return n.kind === "document" ? n.blocks.map((e) => e.view) : "content" in n ? n.content :
|
|
6289
|
+
return n.kind === "document" ? n.blocks.map((e) => e.view) : "content" in n ? n.content : el;
|
|
6272
6290
|
}
|
|
6273
|
-
const
|
|
6291
|
+
const el = [];
|
|
6274
6292
|
function nt(n) {
|
|
6275
6293
|
if (!n)
|
|
6276
6294
|
return;
|
|
@@ -6280,14 +6298,14 @@ function nt(n) {
|
|
|
6280
6298
|
return e;
|
|
6281
6299
|
}
|
|
6282
6300
|
function O(n, e) {
|
|
6283
|
-
if (n && n.kind === e.kind && n.ast === e.ast &&
|
|
6301
|
+
if (n && n.kind === e.kind && n.ast === e.ast && tl(n, e)) {
|
|
6284
6302
|
const t = dn(n), s = dn(e);
|
|
6285
6303
|
if (t.length === s.length && t.every((i, o) => i === s[o]))
|
|
6286
6304
|
return n;
|
|
6287
6305
|
}
|
|
6288
6306
|
return e;
|
|
6289
6307
|
}
|
|
6290
|
-
function
|
|
6308
|
+
function tl(n, e) {
|
|
6291
6309
|
switch (n.kind) {
|
|
6292
6310
|
case "text":
|
|
6293
6311
|
return n.showWhitespace === e.showWhitespace && n.leftWordBoundary === e.leftWordBoundary && n.rightWordBoundary === e.rightWordBoundary && n.hiddenPrefixLength === e.hiddenPrefixLength && n.taskLabel === e.taskLabel;
|
|
@@ -6325,10 +6343,10 @@ function el(n, e) {
|
|
|
6325
6343
|
return !0;
|
|
6326
6344
|
}
|
|
6327
6345
|
}
|
|
6328
|
-
function
|
|
6346
|
+
function nl(n) {
|
|
6329
6347
|
let e = 0, t;
|
|
6330
6348
|
for (const s of n.children)
|
|
6331
|
-
s instanceof
|
|
6349
|
+
s instanceof L || (t = s instanceof E && s.markerKind === "blockQuoteMarker" ? v.ofStartAndLength(e, s.length) : void 0), e += s.length;
|
|
6332
6350
|
return t;
|
|
6333
6351
|
}
|
|
6334
6352
|
function V(n, e, t, s = !1) {
|
|
@@ -6361,14 +6379,14 @@ function As(n, e) {
|
|
|
6361
6379
|
return !1;
|
|
6362
6380
|
}
|
|
6363
6381
|
}
|
|
6364
|
-
function
|
|
6382
|
+
function sl(n, e) {
|
|
6365
6383
|
return e.showMarkup || n === "tableCellGlue" && e.showTableGlue;
|
|
6366
6384
|
}
|
|
6367
|
-
function
|
|
6385
|
+
function il(n, e) {
|
|
6368
6386
|
return e.showMarkup || n === "tableCellGlue" && e.showTableGlue;
|
|
6369
6387
|
}
|
|
6370
6388
|
const Ps = ":running:";
|
|
6371
|
-
function
|
|
6389
|
+
function ol(n) {
|
|
6372
6390
|
if (n.checked === void 0)
|
|
6373
6391
|
return;
|
|
6374
6392
|
const e = n.blocks[0];
|
|
@@ -6384,8 +6402,8 @@ function il(n) {
|
|
|
6384
6402
|
if (s.startsWith(Ps, i))
|
|
6385
6403
|
return { text: t, hiddenLength: i + Ps.length };
|
|
6386
6404
|
}
|
|
6387
|
-
function
|
|
6388
|
-
const s = nt(t), i =
|
|
6405
|
+
function rl(n, e, t) {
|
|
6406
|
+
const s = nt(t), i = ll(n, e), o = new Set(n.items), r = (e.listLevel ?? 0) + 1, c = n.items.some((f) => f.checked !== void 0), a = [];
|
|
6389
6407
|
let l, d = 0;
|
|
6390
6408
|
for (const f of n.children) {
|
|
6391
6409
|
if (o.has(f)) {
|
|
@@ -6402,27 +6420,27 @@ function ol(n, e, t) {
|
|
|
6402
6420
|
a.push(He(f, e, s?.get(f)));
|
|
6403
6421
|
d += f.length;
|
|
6404
6422
|
}
|
|
6405
|
-
return new
|
|
6423
|
+
return new Pa(n, a);
|
|
6406
6424
|
}
|
|
6407
6425
|
function vo(n, e, t, s = !1) {
|
|
6408
6426
|
const i = nt(t), o = e.listLevel ?? 1, r = ko(n, o, e.listIndentUnit ?? n.marker.length), c = n.blocks[0], a = n.checked !== void 0 && c?.kind === "paragraph" ? c.content[1] : void 0, l = {
|
|
6409
6427
|
...e,
|
|
6410
6428
|
taskLabelNode: a?.kind === "text" ? a : void 0,
|
|
6411
6429
|
listContinuation: { item: n, level: o, indentation: r, mixedTasks: s, outsideList: !1 }
|
|
6412
|
-
}, d = e.showMarkup ? void 0 :
|
|
6430
|
+
}, d = e.showMarkup ? void 0 : ol(n), f = d !== void 0, h = f ? { ...l, hideRunnerMarkerNode: d.text, hideRunnerMarkerLength: d.hiddenLength } : l, u = [];
|
|
6413
6431
|
let m = 0;
|
|
6414
6432
|
for (const p of n.children) {
|
|
6415
6433
|
const g = h.selectionInNode ? { ...h, selectionInNode: h.selectionInNode.delta(-m) } : h;
|
|
6416
6434
|
u.push(He(p, g, i?.get(p))), m += p.length;
|
|
6417
6435
|
}
|
|
6418
|
-
return new
|
|
6436
|
+
return new za(n, e.showMarkup, u, e.listLevel ?? 1, f, r);
|
|
6419
6437
|
}
|
|
6420
6438
|
function ko(n, e, t) {
|
|
6421
6439
|
const s = n.leadingTrivia?.glueKind === "indent" ? n.leadingTrivia.length : 0;
|
|
6422
6440
|
return e === 1 ? s / t : e - 1;
|
|
6423
6441
|
}
|
|
6424
|
-
function
|
|
6425
|
-
const t = /^[ ]+/.exec(e.children.map((r) => r instanceof
|
|
6442
|
+
function cl(n, e) {
|
|
6443
|
+
const t = /^[ ]+/.exec(e.children.map((r) => r instanceof L ? r.content : "").join(""))?.[0].length ?? 0;
|
|
6426
6444
|
if (!t || n?.kind !== "list")
|
|
6427
6445
|
return;
|
|
6428
6446
|
let s = n, i, o = 1;
|
|
@@ -6444,7 +6462,7 @@ function rl(n, e) {
|
|
|
6444
6462
|
s = a, o++;
|
|
6445
6463
|
}
|
|
6446
6464
|
}
|
|
6447
|
-
function
|
|
6465
|
+
function al(n, e, t) {
|
|
6448
6466
|
const s = nt(t), i = e.showMarkup, o = n.delimiterRow, r = new Set(
|
|
6449
6467
|
[n.headerRow, n.delimiterRow, ...n.bodyRows].filter((l) => l !== void 0)
|
|
6450
6468
|
), c = [];
|
|
@@ -6461,10 +6479,10 @@ function cl(n, e, t) {
|
|
|
6461
6479
|
c.push(He(l, e, s?.get(l)));
|
|
6462
6480
|
a += l.length;
|
|
6463
6481
|
}
|
|
6464
|
-
return new
|
|
6482
|
+
return new Ba(n, c);
|
|
6465
6483
|
}
|
|
6466
6484
|
function wo(n, e, t, s) {
|
|
6467
|
-
const i = nt(s), o = e.showMarkup, r = t ? void 0 :
|
|
6485
|
+
const i = nt(s), o = e.showMarkup, r = t ? void 0 : dl(n, e), c = new Set(n.cells), a = [];
|
|
6468
6486
|
let l = 0;
|
|
6469
6487
|
for (const d of n.children) {
|
|
6470
6488
|
if (c.has(d)) {
|
|
@@ -6474,14 +6492,14 @@ function wo(n, e, t, s) {
|
|
|
6474
6492
|
a.push(He(d, e, i?.get(d)));
|
|
6475
6493
|
l += d.length;
|
|
6476
6494
|
}
|
|
6477
|
-
return new
|
|
6495
|
+
return new qa(n, t, a);
|
|
6478
6496
|
}
|
|
6479
6497
|
function bo(n, e, t, s, i) {
|
|
6480
6498
|
const o = { showMarkup: e, showTableGlue: t, selectionInNode: s };
|
|
6481
|
-
return new
|
|
6499
|
+
return new Ua(n, e, t, V(n.children, oe(o), i));
|
|
6482
6500
|
}
|
|
6483
6501
|
const vt = /* @__PURE__ */ new Set();
|
|
6484
|
-
function
|
|
6502
|
+
function ll(n, e) {
|
|
6485
6503
|
if (!e.showMarkup || !e.selectionInNode)
|
|
6486
6504
|
return vt;
|
|
6487
6505
|
const t = e.selectionInNode;
|
|
@@ -6497,12 +6515,12 @@ function al(n, e) {
|
|
|
6497
6515
|
}
|
|
6498
6516
|
return s;
|
|
6499
6517
|
}
|
|
6500
|
-
function
|
|
6518
|
+
function dl(n, e) {
|
|
6501
6519
|
if (!e.showMarkup || !e.selectionInNode)
|
|
6502
6520
|
return vt;
|
|
6503
6521
|
const t = e.selectionInNode;
|
|
6504
6522
|
if (t.isEmpty) {
|
|
6505
|
-
const o =
|
|
6523
|
+
const o = hl(n, t.start);
|
|
6506
6524
|
return o === void 0 ? vt : /* @__PURE__ */ new Set([o]);
|
|
6507
6525
|
}
|
|
6508
6526
|
const s = /* @__PURE__ */ new Set();
|
|
@@ -6513,7 +6531,7 @@ function ll(n, e) {
|
|
|
6513
6531
|
}
|
|
6514
6532
|
return s;
|
|
6515
6533
|
}
|
|
6516
|
-
function
|
|
6534
|
+
function hl(n, e) {
|
|
6517
6535
|
let t = 0;
|
|
6518
6536
|
for (const s of n.children) {
|
|
6519
6537
|
const i = t + s.length, o = n.cells.indexOf(s);
|
|
@@ -6522,7 +6540,7 @@ function dl(n, e) {
|
|
|
6522
6540
|
t = i;
|
|
6523
6541
|
}
|
|
6524
6542
|
}
|
|
6525
|
-
function
|
|
6543
|
+
function ul(n) {
|
|
6526
6544
|
const e = [], t = (s, i) => {
|
|
6527
6545
|
const o = s.children;
|
|
6528
6546
|
if (o.length === 0) {
|
|
@@ -6545,11 +6563,11 @@ function Bs(n, e) {
|
|
|
6545
6563
|
function It(n, e, t = Number.POSITIVE_INFINITY) {
|
|
6546
6564
|
if (t <= 0)
|
|
6547
6565
|
return [];
|
|
6548
|
-
const s =
|
|
6566
|
+
const s = ul(n), i = e.slice().sort((c, a) => c.start - a.start || c.endExclusive - a.endExclusive), o = [];
|
|
6549
6567
|
let r = 0;
|
|
6550
6568
|
for (const c of i) {
|
|
6551
6569
|
if (c.isEmpty) {
|
|
6552
|
-
const a =
|
|
6570
|
+
const a = fl(s, c.start);
|
|
6553
6571
|
if (a && (o.push({ range: Bs(a, c), sourceRange: c }), o.length >= t))
|
|
6554
6572
|
return o;
|
|
6555
6573
|
continue;
|
|
@@ -6572,10 +6590,10 @@ function It(n, e, t = Number.POSITIVE_INFINITY) {
|
|
|
6572
6590
|
function Ht(n, e) {
|
|
6573
6591
|
return It(n, e).map((t) => t.range);
|
|
6574
6592
|
}
|
|
6575
|
-
function
|
|
6593
|
+
function fl(n, e) {
|
|
6576
6594
|
return n.find((t) => t.start <= e && e <= t.start + t.len);
|
|
6577
6595
|
}
|
|
6578
|
-
class
|
|
6596
|
+
class ml extends W {
|
|
6579
6597
|
constructor(e, t) {
|
|
6580
6598
|
super(), this._parent = e, this.element = document.createElement("div"), this.element.className = "md-diff-highlight-layer", t ? (this._coordinateSpace = t, this._coordinateProbe = void 0) : (this._coordinateProbe = document.createElementNS("http://www.w3.org/2000/svg", "svg"), this._coordinateProbe.setAttribute("aria-hidden", "true"), this._coordinateProbe.style.position = "absolute", this._coordinateProbe.style.inset = "0", this._coordinateProbe.style.width = "100%", this._coordinateProbe.style.height = "100%", this._coordinateProbe.style.visibility = "hidden", this._coordinateProbe.style.pointerEvents = "none", this.element.appendChild(this._coordinateProbe), this._coordinateSpace = Rt.forSvgOverlay(this._coordinateProbe)), this._resizeObserver = new ResizeObserver(() => {
|
|
6581
6599
|
this._last && this._repaint(this._last);
|
|
@@ -6635,14 +6653,14 @@ class fl extends W {
|
|
|
6635
6653
|
this.element.replaceChildren(...t);
|
|
6636
6654
|
}
|
|
6637
6655
|
}
|
|
6638
|
-
class
|
|
6656
|
+
class pl extends W {
|
|
6639
6657
|
element;
|
|
6640
6658
|
rendering;
|
|
6641
6659
|
_path;
|
|
6642
6660
|
constructor(e) {
|
|
6643
6661
|
super(), this.element = document.createElementNS("http://www.w3.org/2000/svg", "svg"), this.element.setAttribute("class", "md-selection-layer"), this._path = document.createElementNS("http://www.w3.org/2000/svg", "path"), this._path.setAttribute("class", "md-selection-path"), this.element.appendChild(this._path), this.rendering = R(this, (t) => {
|
|
6644
6662
|
const s = t.readObservable(e.selection), i = t.readObservable(e.visualLineMap), o = t.readObservable(e.blocks);
|
|
6645
|
-
return
|
|
6663
|
+
return gl(this._path, s, i, o);
|
|
6646
6664
|
}), this._register(T((t) => {
|
|
6647
6665
|
t.readObservable(this.rendering);
|
|
6648
6666
|
}));
|
|
@@ -6653,13 +6671,13 @@ class Ds {
|
|
|
6653
6671
|
this.rects = e;
|
|
6654
6672
|
}
|
|
6655
6673
|
}
|
|
6656
|
-
function
|
|
6674
|
+
function gl(n, e, t, s) {
|
|
6657
6675
|
if (!e || e.isCollapsed)
|
|
6658
6676
|
return n.setAttribute("d", ""), new Ds([]);
|
|
6659
6677
|
const i = yo(e.range, t, s);
|
|
6660
|
-
return n.setAttribute("d",
|
|
6678
|
+
return n.setAttribute("d", wl(i, 4)), new Ds(i);
|
|
6661
6679
|
}
|
|
6662
|
-
const
|
|
6680
|
+
const _l = 0.4;
|
|
6663
6681
|
function yo(n, e, t) {
|
|
6664
6682
|
if (n.isEmpty)
|
|
6665
6683
|
return [];
|
|
@@ -6671,7 +6689,7 @@ function yo(n, e, t) {
|
|
|
6671
6689
|
const p = h + 1 < o.length ? kt(o[h + 1]) : void 0, g = !p || p.start > m.endExclusive, _ = s.intersects(m), k = g && s.start <= m.endExclusive && s.endExclusive > m.endExclusive;
|
|
6672
6690
|
if (!_ && !k)
|
|
6673
6691
|
continue;
|
|
6674
|
-
const w = t.find((
|
|
6692
|
+
const w = t.find((y) => v.ofStartAndLength(y.absoluteStart, y.block.length).containsRange(m));
|
|
6675
6693
|
r.push({ line: u, lineRange: m, block: w, hardBreak: g });
|
|
6676
6694
|
}
|
|
6677
6695
|
const c = [], a = [];
|
|
@@ -6682,10 +6700,10 @@ function yo(n, e, t) {
|
|
|
6682
6700
|
w = h.xAtOffset(s.endExclusive);
|
|
6683
6701
|
else {
|
|
6684
6702
|
const C = s.endExclusive > _;
|
|
6685
|
-
w = h.rect.right + (C && m ? h.rect.height *
|
|
6703
|
+
w = h.rect.right + (C && m ? h.rect.height * _l : 0);
|
|
6686
6704
|
}
|
|
6687
|
-
const
|
|
6688
|
-
|
|
6705
|
+
const y = Eo(p);
|
|
6706
|
+
y && (k = Math.max(k, y.left), w = Math.min(w, y.right)), c.push(i(k, h.rect.top, w, h.rect.bottom)), a.push({ left: k, right: w, top: h.rect.top, bottom: h.rect.top + h.rect.height });
|
|
6689
6707
|
}
|
|
6690
6708
|
for (let h = 0; h < a.length - 1; h++) {
|
|
6691
6709
|
const u = a[h], m = a[h + 1];
|
|
@@ -6706,14 +6724,14 @@ function yo(n, e, t) {
|
|
|
6706
6724
|
const u = t[h], m = t[h + 1], p = u.absoluteStart + u.block.length, g = m.absoluteStart;
|
|
6707
6725
|
if (p < g && !s.containsRange(v.fromTo(p, g)) || p >= g && !(f[h] && f[h + 1]))
|
|
6708
6726
|
continue;
|
|
6709
|
-
const _ = u.rect, k = m.rect, w =
|
|
6710
|
-
if (w <=
|
|
6727
|
+
const _ = u.rect, k = m.rect, w = kl(e, m, k.top), y = _.bottom;
|
|
6728
|
+
if (w <= y)
|
|
6711
6729
|
continue;
|
|
6712
6730
|
const C = d.get(u), N = l.get(m);
|
|
6713
6731
|
if (C === void 0 && zt(e, u) || N === void 0 && zt(e, m))
|
|
6714
6732
|
continue;
|
|
6715
|
-
const ne = C !== void 0 ? a[C] : { left: _.left, right: _.right },
|
|
6716
|
-
Le <=
|
|
6733
|
+
const ne = C !== void 0 ? a[C] : { left: _.left, right: _.right }, j = N !== void 0 ? a[N] : { left: k.left, right: k.right }, U = Math.max(ne.left, j.left), Le = Math.min(ne.right, j.right);
|
|
6734
|
+
Le <= U || c.push(i(U, y, Le, w));
|
|
6717
6735
|
}
|
|
6718
6736
|
for (const h of t) {
|
|
6719
6737
|
const u = v.ofStartAndLength(h.absoluteStart, h.block.length);
|
|
@@ -6741,10 +6759,10 @@ function zt(n, e) {
|
|
|
6741
6759
|
function Eo(n) {
|
|
6742
6760
|
return n?.viewportClip;
|
|
6743
6761
|
}
|
|
6744
|
-
function
|
|
6762
|
+
function vl(n, e) {
|
|
6745
6763
|
return n.find((t) => e >= t.absoluteStart && e <= t.absoluteStart + t.block.length);
|
|
6746
6764
|
}
|
|
6747
|
-
function
|
|
6765
|
+
function kl(n, e, t) {
|
|
6748
6766
|
const s = v.ofStartAndLength(e.absoluteStart, e.block.length);
|
|
6749
6767
|
for (const i of n.sourceLines) {
|
|
6750
6768
|
const o = kt(i);
|
|
@@ -6753,7 +6771,7 @@ function vl(n, e, t) {
|
|
|
6753
6771
|
}
|
|
6754
6772
|
return t;
|
|
6755
6773
|
}
|
|
6756
|
-
function
|
|
6774
|
+
function wl(n, e) {
|
|
6757
6775
|
if (n.length === 0)
|
|
6758
6776
|
return "";
|
|
6759
6777
|
const t = n.slice().sort((o, r) => o.y - r.y || o.x - r.x), s = [];
|
|
@@ -6762,9 +6780,9 @@ function kl(n, e) {
|
|
|
6762
6780
|
const r = i[i.length - 1], c = r !== void 0 && o.y <= r.y + r.height + 0.5, a = r !== void 0 && Math.max(r.x, o.x) < Math.min(r.x + r.width, o.x + o.width);
|
|
6763
6781
|
c && a ? i.push(o) : (i.length > 0 && s.push(i), i = [o]);
|
|
6764
6782
|
}
|
|
6765
|
-
return i.length > 0 && s.push(i), s.map((o) =>
|
|
6783
|
+
return i.length > 0 && s.push(i), s.map((o) => bl(o, e)).filter(Boolean).join(" ");
|
|
6766
6784
|
}
|
|
6767
|
-
function
|
|
6785
|
+
function bl(n, e) {
|
|
6768
6786
|
const t = [];
|
|
6769
6787
|
t.push({ x: n[0].x + n[0].width, y: n[0].y, convex: !0 });
|
|
6770
6788
|
for (let i = 0; i < n.length - 1; i++) {
|
|
@@ -6783,9 +6801,9 @@ function wl(n, e) {
|
|
|
6783
6801
|
t.push({ x: o.x, y: c, convex: a }), t.push({ x: r.x, y: c, convex: !a });
|
|
6784
6802
|
}
|
|
6785
6803
|
}
|
|
6786
|
-
return t.push({ x: n[0].x, y: n[0].y, convex: !0 }),
|
|
6804
|
+
return t.push({ x: n[0].x, y: n[0].y, convex: !0 }), yl(t, e);
|
|
6787
6805
|
}
|
|
6788
|
-
function
|
|
6806
|
+
function yl(n, e) {
|
|
6789
6807
|
const t = n.length;
|
|
6790
6808
|
if (t < 3)
|
|
6791
6809
|
return "";
|
|
@@ -6816,7 +6834,7 @@ function qt(n, e, t) {
|
|
|
6816
6834
|
function ae(n) {
|
|
6817
6835
|
return n.toFixed(2);
|
|
6818
6836
|
}
|
|
6819
|
-
class
|
|
6837
|
+
class El extends W {
|
|
6820
6838
|
element;
|
|
6821
6839
|
rendering;
|
|
6822
6840
|
constructor(e) {
|
|
@@ -6827,7 +6845,7 @@ class yl extends W {
|
|
|
6827
6845
|
const o = i.lineIndexOfPosition(s);
|
|
6828
6846
|
if (o === void 0)
|
|
6829
6847
|
return this.element.style.display = "none", new at(s, !1, P.EMPTY);
|
|
6830
|
-
const r = i.lineRect(o).withZeroWidthAt(i.xAtPosition(s)), c = e.blocks ? t.readObservable(e.blocks) : void 0, a = c && s.kind === "source" ? Eo(
|
|
6848
|
+
const r = i.lineRect(o).withZeroWidthAt(i.xAtPosition(s)), c = e.blocks ? t.readObservable(e.blocks) : void 0, a = c && s.kind === "source" ? Eo(vl(c, s.offset)) : void 0;
|
|
6831
6849
|
return a && (r.x < a.left - 0.5 || r.x > a.right + 0.5) ? (this.element.style.display = "none", new at(s, !1, P.EMPTY)) : (this.element.style.left = `${r.x}px`, this.element.style.top = `${r.y}px`, this.element.style.height = `${r.height}px`, this.element.style.display = "", new at(s, !0, r));
|
|
6832
6850
|
}), this._register(T((t) => {
|
|
6833
6851
|
t.readObservable(this.rendering);
|
|
@@ -6841,7 +6859,7 @@ class at {
|
|
|
6841
6859
|
this.position = e, this.visible = t, this.rect = s;
|
|
6842
6860
|
}
|
|
6843
6861
|
}
|
|
6844
|
-
class
|
|
6862
|
+
class xl extends W {
|
|
6845
6863
|
element;
|
|
6846
6864
|
rendering;
|
|
6847
6865
|
constructor(e) {
|
|
@@ -6857,7 +6875,7 @@ class El extends W {
|
|
|
6857
6875
|
return new Fs([]);
|
|
6858
6876
|
const s = [];
|
|
6859
6877
|
for (const i of e) {
|
|
6860
|
-
const o = i.type === "deleted" || i.range.isEmpty ?
|
|
6878
|
+
const o = i.type === "deleted" || i.range.isEmpty ? Sl(i, t) : Cl(i, t);
|
|
6861
6879
|
if (!o)
|
|
6862
6880
|
continue;
|
|
6863
6881
|
const r = document.createElement("div");
|
|
@@ -6871,20 +6889,20 @@ class Fs {
|
|
|
6871
6889
|
this.rects = e;
|
|
6872
6890
|
}
|
|
6873
6891
|
}
|
|
6874
|
-
function
|
|
6892
|
+
function Cl(n, e) {
|
|
6875
6893
|
let t = 1 / 0, s = -1 / 0;
|
|
6876
6894
|
for (const i of e.sourceLines) {
|
|
6877
|
-
const o =
|
|
6895
|
+
const o = Ll(i);
|
|
6878
6896
|
!o || !n.range.intersects(o) || (t = Math.min(t, i.rect.top), s = Math.max(s, i.rect.top + i.rect.height));
|
|
6879
6897
|
}
|
|
6880
6898
|
if (!(s <= t))
|
|
6881
6899
|
return { type: n.type, y: t, height: s - t };
|
|
6882
6900
|
}
|
|
6883
|
-
function
|
|
6901
|
+
function Sl(n, e) {
|
|
6884
6902
|
const t = e.lineIndexOfOffset(n.range.start);
|
|
6885
6903
|
return { type: "deleted", y: e.lineRect(t).top, height: 0 };
|
|
6886
6904
|
}
|
|
6887
|
-
function
|
|
6905
|
+
function Ll(n) {
|
|
6888
6906
|
if (n.runs.length === 0)
|
|
6889
6907
|
return;
|
|
6890
6908
|
let e = 1 / 0, t = -1 / 0;
|
|
@@ -6895,14 +6913,14 @@ function Sl(n) {
|
|
|
6895
6913
|
function Vs(n) {
|
|
6896
6914
|
return n.windowHasFocus && n.focusIsUnclaimed;
|
|
6897
6915
|
}
|
|
6898
|
-
function
|
|
6916
|
+
function Tl(n) {
|
|
6899
6917
|
return !n.windowHasFocus;
|
|
6900
6918
|
}
|
|
6901
|
-
const
|
|
6902
|
-
class
|
|
6919
|
+
const Ml = 900, ze = 2, xo = 5, ye = 16;
|
|
6920
|
+
class Zd extends W {
|
|
6903
6921
|
constructor(e, t) {
|
|
6904
6922
|
super(), this._model = e, this._options = t, this._options?.presentation !== void 0 && this._model.presentation.set(this._options.presentation, void 0), this._register({ dispose: () => this._pendingTopReveal?.dispose() }), this.element = document.createElement("div"), this.element.className = "md-editor", this._options?.classNames && this.element.classList.add(...this._options.classNames), this.element.tabIndex = 0, this._contentContainer = document.createElement("div"), this._contentContainer.className = "md-editor-content", this.element.appendChild(this._contentContainer);
|
|
6905
|
-
const s = this._options?.limitedWidth ?? Kn(
|
|
6923
|
+
const s = this._options?.limitedWidth ?? Kn(Ml);
|
|
6906
6924
|
this._register(T((h) => {
|
|
6907
6925
|
const u = s.read(h);
|
|
6908
6926
|
this._contentContainer.style.maxWidth = u === void 0 ? "" : `${u}px`;
|
|
@@ -6934,18 +6952,18 @@ class Jd extends W {
|
|
|
6934
6952
|
dispose: () => {
|
|
6935
6953
|
this._contentContainer.removeEventListener("scroll", l, { capture: !0 }), a && cancelAnimationFrame(a);
|
|
6936
6954
|
}
|
|
6937
|
-
}), this._selectionView = this._register(new
|
|
6955
|
+
}), this._selectionView = this._register(new pl({
|
|
6938
6956
|
selection: this._model.selection,
|
|
6939
6957
|
visualLineMap: this.measuredLayout.visualLineMap,
|
|
6940
6958
|
blocks: this._selectionBlocksObs
|
|
6941
|
-
})), this._contentContainer.appendChild(this._selectionView.element), this.coordinateSpace = Rt.forSvgOverlay(this._selectionView.element), this._cursorView = this._register(new
|
|
6959
|
+
})), this._contentContainer.appendChild(this._selectionView.element), this.coordinateSpace = Rt.forSvgOverlay(this._selectionView.element), this._cursorView = this._register(new El({
|
|
6942
6960
|
position: this._model.cursorPosition,
|
|
6943
6961
|
visualLineMap: this.measuredLayout.visualLineMap,
|
|
6944
6962
|
blocks: this._selectionBlocksObs
|
|
6945
|
-
})), this._contentContainer.appendChild(this._cursorView.element), this._gutterMarkersView = this._register(new
|
|
6963
|
+
})), this._contentContainer.appendChild(this._cursorView.element), this._gutterMarkersView = this._register(new xl({
|
|
6946
6964
|
markers: this._model.gutterMarkers,
|
|
6947
6965
|
visualLineMap: this.measuredLayout.visualLineMap
|
|
6948
|
-
})), this._contentContainer.appendChild(this._gutterMarkersView.element), this._diffHighlightsView = this._register(new
|
|
6966
|
+
})), this._contentContainer.appendChild(this._gutterMarkersView.element), this._diffHighlightsView = this._register(new ml(this._contentContainer, this.coordinateSpace)), this._contentContainer.appendChild(this._diffHighlightsView.element), this._register(T((h) => {
|
|
6949
6967
|
const u = this._model.readonlyMode.read(h);
|
|
6950
6968
|
this.element.classList.toggle("md-readonly", u), u || this.element.classList.remove("md-readonly-editing-attempt");
|
|
6951
6969
|
})), this.showReadonlyToggle.set(this._options?.showReadonlyToggle !== !1, void 0), this.highlightActiveBlock.set(this._options?.highlightActiveBlock !== !1, void 0), this._register(T((h) => {
|
|
@@ -7100,7 +7118,7 @@ class Jd extends W {
|
|
|
7100
7118
|
if (this._model.presentation.read(e) !== "editing" || this._model.readonlyMode.read(e) || this._model.sourceText.read(e).value.length !== 0)
|
|
7101
7119
|
return;
|
|
7102
7120
|
const t = this._model.selection.read(e);
|
|
7103
|
-
(t?.anchor !== 0 || t.active !== 0) && this._model.selection.set(
|
|
7121
|
+
(t?.anchor !== 0 || t.active !== 0) && this._model.selection.set(b.collapsed(0), void 0);
|
|
7104
7122
|
}));
|
|
7105
7123
|
}
|
|
7106
7124
|
/**
|
|
@@ -7368,7 +7386,7 @@ class Jd extends W {
|
|
|
7368
7386
|
this.focus();
|
|
7369
7387
|
return;
|
|
7370
7388
|
}
|
|
7371
|
-
if (!
|
|
7389
|
+
if (!Tl(e))
|
|
7372
7390
|
return;
|
|
7373
7391
|
const t = this.element.ownerDocument.defaultView ?? window, s = () => {
|
|
7374
7392
|
t.removeEventListener("focus", s), this.tryAutoFocus();
|
|
@@ -7491,7 +7509,7 @@ class Jd extends W {
|
|
|
7491
7509
|
} : void 0
|
|
7492
7510
|
);
|
|
7493
7511
|
this._previousViewData = p;
|
|
7494
|
-
const g = l ?
|
|
7512
|
+
const g = l ? Za(p, l.items, this._options?.diffDecorationsActive) : p;
|
|
7495
7513
|
this._viewData.set(g, void 0);
|
|
7496
7514
|
const _ = {
|
|
7497
7515
|
...this._options,
|
|
@@ -7590,7 +7608,7 @@ class Jd extends W {
|
|
|
7590
7608
|
if (!l)
|
|
7591
7609
|
return;
|
|
7592
7610
|
const d = () => {
|
|
7593
|
-
const f =
|
|
7611
|
+
const f = Ol(r.flatMap((u) => Array.from(u.range.getClientRects())));
|
|
7594
7612
|
if (f || !e.isEmpty)
|
|
7595
7613
|
return f;
|
|
7596
7614
|
const h = this.measuredLayout.visualLineMap.get();
|
|
@@ -7620,12 +7638,12 @@ class Jd extends W {
|
|
|
7620
7638
|
return;
|
|
7621
7639
|
const l = Io(e), d = i === "top" ? /* @__PURE__ */ new Map() : void 0, f = i === "top" ? l.find((w) => No(w)) : void 0;
|
|
7622
7640
|
for (let w = 0; w < l.length; w++) {
|
|
7623
|
-
const
|
|
7641
|
+
const y = l[w];
|
|
7624
7642
|
r = t() ?? r, a = this._isRevealOccluded(r);
|
|
7625
|
-
const C = Ao(
|
|
7626
|
-
if (Nt !==
|
|
7627
|
-
const Pt = d ? Bo(
|
|
7628
|
-
|
|
7643
|
+
const C = Ao(y), N = Ut(r, C, o), ne = y.scrollWidth > y.clientWidth, j = y.scrollHeight > y.clientHeight, U = y === f, Le = i === "top" && !U ? "nearest" : i, Oo = U ? this._topRevealInset(C, r) : ye, Dn = i === "top" && !U ? this._unoccludedViewport(C, r) : C, Fn = $s(Dn, C), Vn = Ks(N, Dn, Le, Oo), Wn = Po(y, Vn.x, Vn.y), Nt = ne && (r.left < C.left || r.right > C.right) ? y.scrollLeft + Wn.x : y.scrollLeft, At = j && (U || N.top < Fn.top || N.bottom > Fn.bottom || a) ? y.scrollTop + Wn.y : y.scrollTop, Ro = At !== y.scrollTop;
|
|
7644
|
+
if (Nt !== y.scrollLeft || Ro) {
|
|
7645
|
+
const Pt = d ? Bo(y, Nt, At) : void 0;
|
|
7646
|
+
y.scrollTo({
|
|
7629
7647
|
left: Nt,
|
|
7630
7648
|
top: At,
|
|
7631
7649
|
behavior: i === "top" && s === "instant" ? "instant" : "auto"
|
|
@@ -7640,10 +7658,10 @@ class Jd extends W {
|
|
|
7640
7658
|
h.documentElement.clientHeight || u.innerHeight
|
|
7641
7659
|
), p = Ut(r, m, o), g = i === "top" && f !== void 0 ? "nearest" : i, _ = g === "top", k = i === "top" && !_ ? this._unoccludedViewport(m, r) : m;
|
|
7642
7660
|
if (_ || !$n($s(k, m), p) || a) {
|
|
7643
|
-
const w = _ ? this._topRevealInset(m, r) : ye,
|
|
7644
|
-
d && d.set(h, Do(u, u.scrollX + C, u.scrollY +
|
|
7661
|
+
const w = _ ? this._topRevealInset(m, r) : ye, y = Ks(p, k, g, w), C = r.left < m.left || r.right > m.right ? y.x : 0;
|
|
7662
|
+
d && d.set(h, Do(u, u.scrollX + C, u.scrollY + y.y)), u.scrollBy({
|
|
7645
7663
|
left: C,
|
|
7646
|
-
top:
|
|
7664
|
+
top: y.y,
|
|
7647
7665
|
behavior: s
|
|
7648
7666
|
});
|
|
7649
7667
|
}
|
|
@@ -7714,7 +7732,7 @@ class Jd extends W {
|
|
|
7714
7732
|
*_activeRevealOcclusions() {
|
|
7715
7733
|
for (const e of this._revealOcclusions) {
|
|
7716
7734
|
const s = e.ownerDocument.defaultView?.getComputedStyle(e).visibility;
|
|
7717
|
-
e.isConnected && e.getClientRects().length > 0 && s !== "hidden" && s !== "collapse" && (yield
|
|
7735
|
+
e.isConnected && e.getClientRects().length > 0 && s !== "hidden" && s !== "collapse" && (yield Rl(e.getBoundingClientRect()));
|
|
7718
7736
|
}
|
|
7719
7737
|
}
|
|
7720
7738
|
/**
|
|
@@ -7776,7 +7794,7 @@ function Ws(n, e) {
|
|
|
7776
7794
|
const t = n.width === 0 ? e.containsX(n.left) : Math.max(n.left, e.left) < Math.min(n.right, e.right), s = n.height === 0 ? e.containsY(n.top) : Math.max(n.top, e.top) < Math.min(n.bottom, e.bottom);
|
|
7777
7795
|
return t && s;
|
|
7778
7796
|
}
|
|
7779
|
-
function
|
|
7797
|
+
function Ol(n) {
|
|
7780
7798
|
if (n.length === 0)
|
|
7781
7799
|
return;
|
|
7782
7800
|
let e = Number.POSITIVE_INFINITY, t = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY, i = Number.NEGATIVE_INFINITY;
|
|
@@ -7784,7 +7802,7 @@ function Ml(n) {
|
|
|
7784
7802
|
e = Math.min(e, o.left), t = Math.min(t, o.top), s = Math.max(s, o.right), i = Math.max(i, o.bottom);
|
|
7785
7803
|
return P.fromPointPoint(e, t, s, i);
|
|
7786
7804
|
}
|
|
7787
|
-
function
|
|
7805
|
+
function Rl(n) {
|
|
7788
7806
|
return P.fromPointPoint(n.left, n.top, n.right, n.bottom);
|
|
7789
7807
|
}
|
|
7790
7808
|
function $s(n, e) {
|
|
@@ -7818,8 +7836,8 @@ function Ut(n, e, t) {
|
|
|
7818
7836
|
n.bottom + o
|
|
7819
7837
|
);
|
|
7820
7838
|
}
|
|
7821
|
-
const
|
|
7822
|
-
class
|
|
7839
|
+
const Il = 1e3, Nl = "md-editor-find-match", Al = "md-editor-find-current", Hs = /* @__PURE__ */ new WeakMap();
|
|
7840
|
+
class Pl {
|
|
7823
7841
|
constructor(e) {
|
|
7824
7842
|
this._registry = e;
|
|
7825
7843
|
}
|
|
@@ -7837,24 +7855,24 @@ class Al {
|
|
|
7837
7855
|
}
|
|
7838
7856
|
_refresh() {
|
|
7839
7857
|
const e = [...this._entries].flatMap((s) => s.matches), t = [...this._entries].flatMap((s) => s.current);
|
|
7840
|
-
this._set(
|
|
7858
|
+
this._set(Nl, e), this._set(Al, t);
|
|
7841
7859
|
}
|
|
7842
7860
|
_set(e, t) {
|
|
7843
7861
|
t.length === 0 ? this._registry.delete(e) : this._registry.set(e, new Highlight(...t));
|
|
7844
7862
|
}
|
|
7845
7863
|
}
|
|
7846
|
-
function
|
|
7864
|
+
function Bl(n) {
|
|
7847
7865
|
const e = n.defaultView?.CSS.highlights;
|
|
7848
7866
|
if (!e)
|
|
7849
7867
|
return { update: () => {
|
|
7850
7868
|
}, dispose: () => {
|
|
7851
7869
|
} };
|
|
7852
7870
|
let t = Hs.get(n);
|
|
7853
|
-
return t || (t = new
|
|
7871
|
+
return t || (t = new Pl(e), Hs.set(n, t)), t.add();
|
|
7854
7872
|
}
|
|
7855
|
-
class
|
|
7873
|
+
class Dl extends W {
|
|
7856
7874
|
constructor(e, t) {
|
|
7857
|
-
super(), this._view = e, this._matchesLayer = qs("md-find-matches-layer"), this._currentLayer = qs("md-find-current-layer"), this._highlightRegistration = this._register(
|
|
7875
|
+
super(), this._view = e, this._matchesLayer = qs("md-find-matches-layer"), this._currentLayer = qs("md-find-current-layer"), this._highlightRegistration = this._register(Bl(this._view.element.ownerDocument)), this._register(this._view.mountOverlay(this._matchesLayer, "below-selection")), this._register(this._view.mountOverlay(this._currentLayer, "above-decorations")), this._register(T((r) => {
|
|
7858
7876
|
const c = t.isRevealed.read(r);
|
|
7859
7877
|
if (!c) {
|
|
7860
7878
|
this._snapshot = void 0, this._schedulePaint();
|
|
@@ -7902,9 +7920,9 @@ class Bl extends W {
|
|
|
7902
7920
|
this._matchesLayer.replaceChildren(), this._currentLayer.replaceChildren(), this._highlightRegistration.update([], []);
|
|
7903
7921
|
return;
|
|
7904
7922
|
}
|
|
7905
|
-
const t = this._view.coordinateSpace.capture(), s = mi(this._view.overlayContainer), i = t.toLocalRect(s), o =
|
|
7923
|
+
const t = this._view.coordinateSpace.capture(), s = mi(this._view.overlayContainer), i = t.toLocalRect(s), o = Fl(
|
|
7906
7924
|
this._view.measuredLayout.visualLineMap.get().sourceLines.flatMap((f) => Math.max(f.rect.top, i.top) >= Math.min(f.rect.bottom, i.bottom) ? [] : f.runs.flatMap((h) => {
|
|
7907
|
-
const u =
|
|
7925
|
+
const u = Vl(h, f.rect, i);
|
|
7908
7926
|
return u ? [u] : [];
|
|
7909
7927
|
}))
|
|
7910
7928
|
), r = Us(
|
|
@@ -7917,7 +7935,7 @@ class Bl extends W {
|
|
|
7917
7935
|
e.measurements,
|
|
7918
7936
|
i,
|
|
7919
7937
|
"md-find-match-rect",
|
|
7920
|
-
|
|
7938
|
+
Il
|
|
7921
7939
|
), d = this._paintRanges(
|
|
7922
7940
|
this._currentLayer,
|
|
7923
7941
|
e.document,
|
|
@@ -8020,7 +8038,7 @@ function Gs(n, e) {
|
|
|
8020
8038
|
return o;
|
|
8021
8039
|
}
|
|
8022
8040
|
}
|
|
8023
|
-
function
|
|
8041
|
+
function Fl(n) {
|
|
8024
8042
|
const e = n.slice().sort((s, i) => s.start - i.start || s.endExclusive - i.endExclusive), t = [];
|
|
8025
8043
|
for (const s of e) {
|
|
8026
8044
|
const i = t[t.length - 1];
|
|
@@ -8028,7 +8046,7 @@ function Dl(n) {
|
|
|
8028
8046
|
}
|
|
8029
8047
|
return t;
|
|
8030
8048
|
}
|
|
8031
|
-
function
|
|
8049
|
+
function Vl(n, e, t) {
|
|
8032
8050
|
if (n.sourceRange.isEmpty)
|
|
8033
8051
|
return t.left <= n.rect.left && n.rect.left <= t.right ? n.sourceRange : void 0;
|
|
8034
8052
|
let s = n.sourceStart;
|
|
@@ -8065,7 +8083,7 @@ function Xs(n, e, t) {
|
|
|
8065
8083
|
const s = Math.max(n.left, e.left, t?.left ?? Number.NEGATIVE_INFINITY), i = Math.min(n.right, e.right, t?.right ?? Number.POSITIVE_INFINITY), o = Math.max(n.top, e.top), r = Math.min(n.bottom, e.bottom);
|
|
8066
8084
|
return s < i && o < r ? P.fromPointPoint(s, o, i, r) : void 0;
|
|
8067
8085
|
}
|
|
8068
|
-
const
|
|
8086
|
+
const Wl = 19999;
|
|
8069
8087
|
class wt {
|
|
8070
8088
|
constructor(e, t, s, i, o) {
|
|
8071
8089
|
this._source = e, this._flags = t, this._wholeWord = s, this._wordSeparators = i, this.isEmpty = o;
|
|
@@ -8076,7 +8094,7 @@ class wt {
|
|
|
8076
8094
|
kind: "valid",
|
|
8077
8095
|
pattern: new wt("", "gmu", e.wholeWord, e.wordSeparators, !0)
|
|
8078
8096
|
};
|
|
8079
|
-
const t = e.isRegex ? e.searchString :
|
|
8097
|
+
const t = e.isRegex ? e.searchString : $l(e.searchString), s = `gmu${e.matchCase ? "" : "i"}`;
|
|
8080
8098
|
try {
|
|
8081
8099
|
new RegExp(t, s);
|
|
8082
8100
|
} catch (i) {
|
|
@@ -8090,7 +8108,7 @@ class wt {
|
|
|
8090
8108
|
pattern: new wt(t, s, e.wholeWord, e.wordSeparators, !1)
|
|
8091
8109
|
};
|
|
8092
8110
|
}
|
|
8093
|
-
findMatches(e, t, s =
|
|
8111
|
+
findMatches(e, t, s = Wl) {
|
|
8094
8112
|
if (this.isEmpty || s <= 0)
|
|
8095
8113
|
return { matches: [], isCapped: !1 };
|
|
8096
8114
|
const i = [];
|
|
@@ -8112,7 +8130,7 @@ class wt {
|
|
|
8112
8130
|
return this._forEachMatch(e, s, (d) => o?.equals(d) ? (l = !0, !0) : (a = d, d.endExclusive <= r && (c = d), !0)), c ?? (i ? a : void 0) ?? (l ? o : void 0);
|
|
8113
8131
|
}
|
|
8114
8132
|
_forEachMatch(e, t, s) {
|
|
8115
|
-
const i =
|
|
8133
|
+
const i = Kl(t, e.length);
|
|
8116
8134
|
if (i?.isEmpty)
|
|
8117
8135
|
return;
|
|
8118
8136
|
const o = new RegExp(this._source, this._flags);
|
|
@@ -8121,29 +8139,29 @@ class wt {
|
|
|
8121
8139
|
if (!r)
|
|
8122
8140
|
return;
|
|
8123
8141
|
const c = v.ofStartAndLength(r.index, r[0].length);
|
|
8124
|
-
if ((!i || i.containsRange(c)) && (!this._wholeWord ||
|
|
8142
|
+
if ((!i || i.containsRange(c)) && (!this._wholeWord || Hl(e, c, this._wordSeparators)) && !s(c))
|
|
8125
8143
|
return;
|
|
8126
|
-
r[0].length === 0 && (o.lastIndex =
|
|
8144
|
+
r[0].length === 0 && (o.lastIndex = zl(e, o.lastIndex));
|
|
8127
8145
|
}
|
|
8128
8146
|
}
|
|
8129
8147
|
}
|
|
8130
8148
|
function Co(n) {
|
|
8131
8149
|
return n.replace(/[\\{}()[\]^$+*?.|]/g, "\\$&");
|
|
8132
8150
|
}
|
|
8133
|
-
function
|
|
8151
|
+
function $l(n) {
|
|
8134
8152
|
return n.split(/\r\n|\r|\n/).map(Co).join("(?:\\r\\n|[\\r\\n])");
|
|
8135
8153
|
}
|
|
8136
|
-
function
|
|
8154
|
+
function Kl(n, e) {
|
|
8137
8155
|
if (!n)
|
|
8138
8156
|
return;
|
|
8139
8157
|
const t = bt(n.start, 0, e), s = bt(n.endExclusive, 0, e);
|
|
8140
8158
|
return t <= s ? new v(t, s) : v.emptyAt(t);
|
|
8141
8159
|
}
|
|
8142
|
-
function
|
|
8160
|
+
function Hl(n, e, t) {
|
|
8143
8161
|
const s = n[e.start - 1], i = n[e.start], o = n[e.endExclusive - 1], r = n[e.endExclusive], c = e.start === 0 || !st(s, t) || e.length > 0 && !st(i, t), a = e.endExclusive === n.length || !st(r, t) || e.length > 0 && !st(o, t);
|
|
8144
8162
|
return c && a;
|
|
8145
8163
|
}
|
|
8146
|
-
function
|
|
8164
|
+
function zl(n, e) {
|
|
8147
8165
|
if (e >= n.length)
|
|
8148
8166
|
return n.length + 1;
|
|
8149
8167
|
const t = n.charCodeAt(e);
|
|
@@ -8180,7 +8198,7 @@ class So {
|
|
|
8180
8198
|
return this._observedSourceTextId = t, { sourceIdentityChanged: i, isExpected: o };
|
|
8181
8199
|
}
|
|
8182
8200
|
}
|
|
8183
|
-
class
|
|
8201
|
+
class ql extends W {
|
|
8184
8202
|
constructor(e) {
|
|
8185
8203
|
super(), this._editorModel = e, this._sourceEditTracker = new So(this._editorModel);
|
|
8186
8204
|
let t = this._inputSnapshot();
|
|
@@ -8194,7 +8212,7 @@ class zl extends W {
|
|
|
8194
8212
|
});
|
|
8195
8213
|
return;
|
|
8196
8214
|
}
|
|
8197
|
-
const d = r.isRevealed && !t.isRevealed, f = !
|
|
8215
|
+
const d = r.isRevealed && !t.isRevealed, f = !Gl(r, t), h = !Ql(r.scope, t.scope) && !a;
|
|
8198
8216
|
if (!r.isRevealed)
|
|
8199
8217
|
t.isRevealed && this.currentMatch.set(void 0, void 0);
|
|
8200
8218
|
else {
|
|
@@ -8205,7 +8223,7 @@ class zl extends W {
|
|
|
8205
8223
|
this._selectFromOrigin(u, this._pendingInitialDirection ?? "next");
|
|
8206
8224
|
else if (a) {
|
|
8207
8225
|
const m = this.currentMatch.get();
|
|
8208
|
-
m && !
|
|
8226
|
+
m && !Ul(u, o, r.scope, m) && this.currentMatch.set(void 0, void 0);
|
|
8209
8227
|
}
|
|
8210
8228
|
}
|
|
8211
8229
|
this._pendingInitialDirection = void 0, this._pendingInitialDirection = void 0, t = r;
|
|
@@ -8311,7 +8329,7 @@ class zl extends W {
|
|
|
8311
8329
|
t && this.searchScope.set(js(e.edit, t), e.transaction);
|
|
8312
8330
|
const s = this.currentMatch.get();
|
|
8313
8331
|
s && this.currentMatch.set(
|
|
8314
|
-
|
|
8332
|
+
Xl(e.edit, s) ? void 0 : js(e.edit, s),
|
|
8315
8333
|
e.transaction
|
|
8316
8334
|
);
|
|
8317
8335
|
}
|
|
@@ -8336,13 +8354,13 @@ class zl extends W {
|
|
|
8336
8354
|
};
|
|
8337
8355
|
}
|
|
8338
8356
|
}
|
|
8339
|
-
function
|
|
8357
|
+
function Ul(n, e, t, s) {
|
|
8340
8358
|
return n.pattern.findNextMatch(e, s.start, t, !1)?.equals(s) ?? !1;
|
|
8341
8359
|
}
|
|
8342
|
-
function
|
|
8360
|
+
function Gl(n, e) {
|
|
8343
8361
|
return n.searchString === e.searchString && n.isRegex === e.isRegex && n.matchCase === e.matchCase && n.wholeWord === e.wholeWord;
|
|
8344
8362
|
}
|
|
8345
|
-
function
|
|
8363
|
+
function Ql(n, e) {
|
|
8346
8364
|
return n === e || !!n && !!e && n.equals(e);
|
|
8347
8365
|
}
|
|
8348
8366
|
function js(n, e) {
|
|
@@ -8363,7 +8381,7 @@ function hn(n, e, t) {
|
|
|
8363
8381
|
}
|
|
8364
8382
|
return e + s;
|
|
8365
8383
|
}
|
|
8366
|
-
function
|
|
8384
|
+
function Xl(n, e) {
|
|
8367
8385
|
return n.replacements.some((t) => {
|
|
8368
8386
|
const s = t.replaceRange;
|
|
8369
8387
|
return s.isEmpty ? e.start < s.start && s.start < e.endExclusive : e.isEmpty ? s.contains(e.start) : s.intersects(e);
|
|
@@ -8372,7 +8390,7 @@ function Ql(n, e) {
|
|
|
8372
8390
|
function Gt(n, e, t) {
|
|
8373
8391
|
return Math.min(Math.max(n, e), t);
|
|
8374
8392
|
}
|
|
8375
|
-
class
|
|
8393
|
+
class jl extends W {
|
|
8376
8394
|
constructor(e, t) {
|
|
8377
8395
|
super(), this._view = e, this._options = t, this.element = document.createElement("div"), this.element.className = "md-find-widget-host", this.element.hidden = !0, this.panelElement = document.createElement("div"), this.panelElement.className = "md-find-widget", this.panelElement.setAttribute("role", "dialog"), this.panelElement.setAttribute("aria-label", "Find"), this.element.appendChild(this.panelElement);
|
|
8378
8396
|
const s = document.createElement("div");
|
|
@@ -8444,16 +8462,16 @@ function lt(n, e) {
|
|
|
8444
8462
|
function dt(n, e) {
|
|
8445
8463
|
n.setAttribute("aria-pressed", String(e)), n.classList.toggle("md-find-option-active", e);
|
|
8446
8464
|
}
|
|
8447
|
-
class
|
|
8465
|
+
class Yl extends W {
|
|
8448
8466
|
constructor(e, t, s) {
|
|
8449
|
-
super(), this._editorModel = e, this._view = t, this._options = s, this._observedSourceTextId = this._editorModel.getSourceTextId(this._editorModel.sourceText.get()), this._sourceEditTracker = new So(this._editorModel), this.model = this._register(new
|
|
8467
|
+
super(), this._editorModel = e, this._view = t, this._options = s, this._observedSourceTextId = this._editorModel.getSourceTextId(this._editorModel.sourceText.get()), this._sourceEditTracker = new So(this._editorModel), this.model = this._register(new ql(this._editorModel)), this._register(this._editorModel.onWillApplySourceEdit((c) => {
|
|
8450
8468
|
this._sourceEditTracker.record(c);
|
|
8451
8469
|
}));
|
|
8452
8470
|
const i = R(this, (c) => {
|
|
8453
8471
|
const a = this._selectionForScope.read(c);
|
|
8454
8472
|
return !!a && !a.isCollapsed;
|
|
8455
8473
|
});
|
|
8456
|
-
this.widget = this._register(new
|
|
8474
|
+
this.widget = this._register(new jl(this._view, {
|
|
8457
8475
|
findModel: this.model,
|
|
8458
8476
|
canFindInSelection: i,
|
|
8459
8477
|
onNext: () => {
|
|
@@ -8464,7 +8482,7 @@ class jl extends W {
|
|
|
8464
8482
|
},
|
|
8465
8483
|
onToggleFindInSelection: () => this._toggleFindInSelection(),
|
|
8466
8484
|
onClose: () => this.close()
|
|
8467
|
-
})), this._register(new
|
|
8485
|
+
})), this._register(new Dl(this._view, this.model));
|
|
8468
8486
|
const o = (c) => this._handleKeyDown(c);
|
|
8469
8487
|
this._view.element.addEventListener("keydown", o, !0), this._register({
|
|
8470
8488
|
dispose: () => this._view.element.removeEventListener("keydown", o, !0)
|
|
@@ -8489,10 +8507,10 @@ class jl extends W {
|
|
|
8489
8507
|
}
|
|
8490
8508
|
const p = !this._selectedMatch?.equals(h);
|
|
8491
8509
|
let g = /* @__PURE__ */ new Set();
|
|
8492
|
-
this._forcedMatch?.equals(h) ? g = new Set(Jt(u, h.start, h.endExclusive)) : (m ?
|
|
8510
|
+
this._forcedMatch?.equals(h) ? g = new Set(Jt(u, h.start, h.endExclusive)) : (m ? Zl(m, h) : !1) ? this._forcedMatch = void 0 : (g = new Set(Jt(u, h.start, h.endExclusive)), this._forcedMatch = h), z((_) => {
|
|
8493
8511
|
Ys(this._view.forcedMarkerVisibleBlocks.get(), g) || this._view.forcedMarkerVisibleBlocks.set(g, _);
|
|
8494
8512
|
const k = this._editorModel.selection.get();
|
|
8495
|
-
p && !d && (!k || !k.range.equals(h)) && (this._editorModel.pendingParagraph.set(void 0, _), this._editorModel.selectionSource.set("find", _), this._editorModel.selection.set(new
|
|
8513
|
+
p && !d && (!k || !k.range.equals(h)) && (this._editorModel.pendingParagraph.set(void 0, _), this._editorModel.selectionSource.set("find", _), this._editorModel.selection.set(new b(h.start, h.endExclusive), _));
|
|
8496
8514
|
}), this._selectedMatch = h, this._observedSourceTextId = l, p && !d && (this._cancelRevealRequest(), this._revealRequest = this._view.revealRangeInCenterIfOutsideViewport(h, "auto"));
|
|
8497
8515
|
})), this._register({
|
|
8498
8516
|
dispose: () => {
|
|
@@ -8516,7 +8534,7 @@ class jl extends W {
|
|
|
8516
8534
|
this.widget.focusAndSelect();
|
|
8517
8535
|
return;
|
|
8518
8536
|
}
|
|
8519
|
-
const e = this._editorModel.selection.get() ??
|
|
8537
|
+
const e = this._editorModel.selection.get() ?? b.collapsed(0);
|
|
8520
8538
|
this._selectionForScope.set(e, void 0);
|
|
8521
8539
|
const { searchString: t, origin: s } = this._querySeed(e, this.model.searchString.get());
|
|
8522
8540
|
this.model.reveal({
|
|
@@ -8533,7 +8551,7 @@ class jl extends W {
|
|
|
8533
8551
|
return;
|
|
8534
8552
|
const t = e.target, s = t instanceof Node && this.widget.panelElement.contains(t);
|
|
8535
8553
|
if (!(t !== this._view.element && !s)) {
|
|
8536
|
-
if (
|
|
8554
|
+
if (Jl(e, this._options.keyboardPlatform)) {
|
|
8537
8555
|
Xt(e), this.openAndFocus();
|
|
8538
8556
|
return;
|
|
8539
8557
|
}
|
|
@@ -8552,7 +8570,7 @@ class jl extends W {
|
|
|
8552
8570
|
e === "next" ? this.model.moveToNextMatch() : this.model.moveToPreviousMatch();
|
|
8553
8571
|
return;
|
|
8554
8572
|
}
|
|
8555
|
-
const t = this._editorModel.selection.get() ??
|
|
8573
|
+
const t = this._editorModel.selection.get() ?? b.collapsed(0);
|
|
8556
8574
|
this._selectionForScope.set(t, void 0);
|
|
8557
8575
|
const s = this.model.searchString.get() || this._querySeed(t).searchString, i = e === "next" ? t.range.endExclusive : t.range.start;
|
|
8558
8576
|
this.model.reveal({ origin: i, searchString: s, direction: e });
|
|
@@ -8591,7 +8609,7 @@ class jl extends W {
|
|
|
8591
8609
|
!e || e.isCollapsed || (this.model.setSearchOrigin(e.range.start), this.model.setSearchScope(e.range));
|
|
8592
8610
|
}
|
|
8593
8611
|
}
|
|
8594
|
-
function
|
|
8612
|
+
function Jl(n, e) {
|
|
8595
8613
|
return n.key.toLowerCase() === "f" && !n.shiftKey && !n.altKey && (e === "macos" ? n.metaKey && !n.ctrlKey : n.ctrlKey && !n.metaKey);
|
|
8596
8614
|
}
|
|
8597
8615
|
function Xt(n) {
|
|
@@ -8600,7 +8618,7 @@ function Xt(n) {
|
|
|
8600
8618
|
function Ys(n, e) {
|
|
8601
8619
|
return n.size === e.size && Array.from(n).every((t) => e.has(t));
|
|
8602
8620
|
}
|
|
8603
|
-
function
|
|
8621
|
+
function Zl(n, e) {
|
|
8604
8622
|
const t = It(n, [e]);
|
|
8605
8623
|
return e.isEmpty ? t.some((i) => Js(i.range)) : t.reduce((i, o) => {
|
|
8606
8624
|
const r = Array.from(o.range.getClientRects()).some((c) => c.width > 0 && c.height > 0) && Js(o.range);
|
|
@@ -8619,7 +8637,7 @@ function Js(n) {
|
|
|
8619
8637
|
}
|
|
8620
8638
|
return !0;
|
|
8621
8639
|
}
|
|
8622
|
-
function
|
|
8640
|
+
function eh(n, e = () => {
|
|
8623
8641
|
n.ownerDocument.execCommand("paste");
|
|
8624
8642
|
}) {
|
|
8625
8643
|
const t = n.ownerDocument, s = Lo(t);
|
|
@@ -8637,7 +8655,7 @@ function Lo(n) {
|
|
|
8637
8655
|
const e = n.createElement("textarea");
|
|
8638
8656
|
return e.tabIndex = -1, e.setAttribute("aria-label", "Clipboard"), e.style.cssText = "position:fixed;left:0;top:0;width:1px;height:1px;opacity:0;pointer-events:none;", e;
|
|
8639
8657
|
}
|
|
8640
|
-
class
|
|
8658
|
+
class ed {
|
|
8641
8659
|
connect(e) {
|
|
8642
8660
|
const t = (r) => {
|
|
8643
8661
|
if (Ie(r.target, e.element) || Ne(r.target, e.element))
|
|
@@ -8663,7 +8681,7 @@ class Zl {
|
|
|
8663
8681
|
};
|
|
8664
8682
|
}
|
|
8665
8683
|
}
|
|
8666
|
-
class
|
|
8684
|
+
class th {
|
|
8667
8685
|
constructor(e = navigator.clipboard, t) {
|
|
8668
8686
|
this._clipboard = e, this._paste = t;
|
|
8669
8687
|
}
|
|
@@ -8708,7 +8726,7 @@ class eh {
|
|
|
8708
8726
|
return;
|
|
8709
8727
|
const p = Ie(u.target, e.element);
|
|
8710
8728
|
if (p) {
|
|
8711
|
-
|
|
8729
|
+
td(u, p, this._clipboard);
|
|
8712
8730
|
return;
|
|
8713
8731
|
}
|
|
8714
8732
|
if (!Ne(u.target, e.element))
|
|
@@ -8758,7 +8776,7 @@ function Ne(n, e) {
|
|
|
8758
8776
|
const s = (n instanceof Element ? n : n.parentElement)?.closest("video, audio");
|
|
8759
8777
|
return s instanceof HTMLMediaElement && e.contains(s);
|
|
8760
8778
|
}
|
|
8761
|
-
function
|
|
8779
|
+
function td(n, e, t) {
|
|
8762
8780
|
switch (n.key.toLowerCase()) {
|
|
8763
8781
|
case "c": {
|
|
8764
8782
|
const s = Zs(e);
|
|
@@ -8816,17 +8834,17 @@ const un = {
|
|
|
8816
8834
|
...e,
|
|
8817
8835
|
action: n.action
|
|
8818
8836
|
})))
|
|
8819
|
-
},
|
|
8837
|
+
}, nh = {
|
|
8820
8838
|
bindings: fn.filter((n) => n.routing === "local").flatMap((n) => n.keybindings.map((e) => ({
|
|
8821
8839
|
...e,
|
|
8822
8840
|
action: n.action
|
|
8823
8841
|
})))
|
|
8824
|
-
},
|
|
8842
|
+
}, sh = {
|
|
8825
8843
|
bindings: fn.filter((n) => n.routing !== "local").flatMap((n) => n.keybindings.map((e) => ({
|
|
8826
8844
|
...e,
|
|
8827
8845
|
action: n.action
|
|
8828
8846
|
})))
|
|
8829
|
-
},
|
|
8847
|
+
}, nd = /* @__PURE__ */ new Set([
|
|
8830
8848
|
"ArrowLeft",
|
|
8831
8849
|
"ArrowRight",
|
|
8832
8850
|
"ArrowUp",
|
|
@@ -8834,10 +8852,10 @@ const un = {
|
|
|
8834
8852
|
"Home",
|
|
8835
8853
|
"End"
|
|
8836
8854
|
]);
|
|
8837
|
-
function nd(n) {
|
|
8838
|
-
return td.has(n);
|
|
8839
|
-
}
|
|
8840
8855
|
function sd(n) {
|
|
8856
|
+
return nd.has(n);
|
|
8857
|
+
}
|
|
8858
|
+
function id(n) {
|
|
8841
8859
|
return n.includes("Macintosh") || n.includes("Mac OS X") ? "macos" : n.includes("Windows") ? "windows" : "linux";
|
|
8842
8860
|
}
|
|
8843
8861
|
function ti(n) {
|
|
@@ -8854,23 +8872,23 @@ function ti(n) {
|
|
|
8854
8872
|
function ni(n, e, t = un) {
|
|
8855
8873
|
if (n.altGraphKey)
|
|
8856
8874
|
return;
|
|
8857
|
-
const s = n.key.length === 1 ? n.key.toLowerCase() : n.key, i = /^[a-z]$/.test(s) ? void 0 :
|
|
8875
|
+
const s = n.key.length === 1 ? n.key.toLowerCase() : n.key, i = /^[a-z]$/.test(s) ? void 0 : od(n.code);
|
|
8858
8876
|
for (const o of t.bindings)
|
|
8859
|
-
if ((o.key === s || o.key === i) && (!o.platforms || o.platforms.includes(e)) &&
|
|
8877
|
+
if ((o.key === s || o.key === i) && (!o.platforms || o.platforms.includes(e)) && rd(n, o.modifiers))
|
|
8860
8878
|
return o.action;
|
|
8861
8879
|
}
|
|
8862
|
-
function
|
|
8880
|
+
function od(n) {
|
|
8863
8881
|
return /^Key([A-Z])$/.exec(n)?.[1].toLowerCase();
|
|
8864
8882
|
}
|
|
8865
|
-
function
|
|
8883
|
+
function rd(n, e = {}) {
|
|
8866
8884
|
return n.shiftKey === !!e.shift && n.altKey === !!e.alt && n.ctrlKey === !!e.ctrl && n.metaKey === !!e.meta;
|
|
8867
8885
|
}
|
|
8868
|
-
const
|
|
8869
|
-
class
|
|
8886
|
+
const cd = 500, si = 5, ad = 120 * 1e3;
|
|
8887
|
+
class ih extends W {
|
|
8870
8888
|
constructor(e, t, s) {
|
|
8871
8889
|
super(), this._model = e, this._view = t;
|
|
8872
8890
|
const i = this._view.element, o = i.ownerDocument.defaultView ?? window;
|
|
8873
|
-
this._keyboardPlatform = s?.keyboardPlatform ??
|
|
8891
|
+
this._keyboardPlatform = s?.keyboardPlatform ?? id(o.navigator.userAgent), this._keyboardProfile = s?.keyboardProfile ?? un, this._forwardedKeyboardProfile = s?.forwardedKeyboardProfile, this._historyStrategy = s?.historyStrategy, this._indentation = s?.indentation ?? tt, this._tabFocusStatus = this._keyboardProfile === un ? this._registerTabFocusAccessibility(i) : void 0, i.addEventListener("pointerdown", this._handlePointerDown), i.addEventListener("keydown", this._handleKeyDown), this._register({
|
|
8874
8892
|
dispose: () => {
|
|
8875
8893
|
i.removeEventListener("pointerdown", this._handlePointerDown), i.removeEventListener("keydown", this._handleKeyDown);
|
|
8876
8894
|
}
|
|
@@ -8879,7 +8897,7 @@ class sh extends W {
|
|
|
8879
8897
|
o.removeEventListener("keydown", this._updateModifierState), o.removeEventListener("keyup", this._updateModifierState), o.removeEventListener("blur", this._clearModifierState), i.ownerDocument.removeEventListener("selectionchange", this._discardNativeSelection);
|
|
8880
8898
|
}
|
|
8881
8899
|
});
|
|
8882
|
-
const r = s?.clipboardStrategy ?? new
|
|
8900
|
+
const r = s?.clipboardStrategy ?? new ed();
|
|
8883
8901
|
r.writeText && this._register(this._view.setClipboardWriter((a) => r.writeText(a))), this._register(r.connect({
|
|
8884
8902
|
element: i,
|
|
8885
8903
|
getSelectedText: () => this._selectedText(),
|
|
@@ -8893,7 +8911,7 @@ class sh extends W {
|
|
|
8893
8911
|
const c = this._view.editContext;
|
|
8894
8912
|
c.addEventListener("textupdate", this._handleTextUpdate), this._register({
|
|
8895
8913
|
dispose: () => c.removeEventListener("textupdate", this._handleTextUpdate)
|
|
8896
|
-
}), this.findController = s?.find === !1 ? void 0 : this._register(new
|
|
8914
|
+
}), this.findController = s?.find === !1 ? void 0 : this._register(new Yl(this._model, this._view, {
|
|
8897
8915
|
keyboardPlatform: this._keyboardPlatform
|
|
8898
8916
|
}));
|
|
8899
8917
|
}
|
|
@@ -8915,7 +8933,7 @@ class sh extends W {
|
|
|
8915
8933
|
/** Timestamp of the last locked-mode reveal caused by a pointer click. */
|
|
8916
8934
|
_lastReadonlyClickRevealTime;
|
|
8917
8935
|
_handleTextUpdate = (e) => {
|
|
8918
|
-
this.insertText(e.text, new
|
|
8936
|
+
this.insertText(e.text, new b(e.updateRangeStart, e.updateRangeEnd));
|
|
8919
8937
|
};
|
|
8920
8938
|
insertText(e, t) {
|
|
8921
8939
|
if (this._model.readonlyMode.get()) {
|
|
@@ -8964,7 +8982,7 @@ class sh extends W {
|
|
|
8964
8982
|
if (this._generatedIndentation = void 0, e.button !== 0)
|
|
8965
8983
|
return;
|
|
8966
8984
|
e.preventDefault(), this._view.stopFollowingCaret(), this._model.cancelPendingParagraph(), this._view.focus(), this._desiredColumn = void 0;
|
|
8967
|
-
const t = new Ee(e.clientX, e.clientY), s = this._lastPointerDown, i = s !== void 0 && e.timeStamp - s.time <
|
|
8985
|
+
const t = new Ee(e.clientX, e.clientY), s = this._lastPointerDown, i = s !== void 0 && e.timeStamp - s.time < cd && Math.abs(t.x - s.point.x) < si && Math.abs(t.y - s.point.y) < si;
|
|
8968
8986
|
if (this._clickCount = i ? this._clickCount + 1 : 1, this._lastPointerDown = { time: e.timeStamp, point: t }, !this._view.isPointInContent(t)) {
|
|
8969
8987
|
this._setUserSelection(void 0);
|
|
8970
8988
|
return;
|
|
@@ -8972,36 +8990,36 @@ class sh extends W {
|
|
|
8972
8990
|
const o = this._view.resolveCursorPositionFromPoint(t) ?? I.source(this._model.sourceText.get().value.length), r = o.offset;
|
|
8973
8991
|
if (this._clickCount === 2) {
|
|
8974
8992
|
const h = this._makeCursorContext();
|
|
8975
|
-
this._setUserSelection(
|
|
8993
|
+
this._setUserSelection(Yc(h, r));
|
|
8976
8994
|
return;
|
|
8977
8995
|
}
|
|
8978
8996
|
if (this._clickCount === 3) {
|
|
8979
|
-
const h =
|
|
8980
|
-
h && this._setUserSelection(
|
|
8997
|
+
const h = dd(this._model.document.get(), r);
|
|
8998
|
+
h && this._setUserSelection(Jc(this._makeCursorContext(), h));
|
|
8981
8999
|
return;
|
|
8982
9000
|
}
|
|
8983
9001
|
const c = this._clickCount === 1 && !e.shiftKey && this._model.readonlyMode.get();
|
|
8984
9002
|
if (e.shiftKey) {
|
|
8985
|
-
const h = this._model.selection.get() ??
|
|
9003
|
+
const h = this._model.selection.get() ?? b.collapsed(r);
|
|
8986
9004
|
this._setUserSelection(h.withActive(r, o.affinity));
|
|
8987
9005
|
} else
|
|
8988
|
-
this._setUserSelection(
|
|
9006
|
+
this._setUserSelection(b.collapsed(r, o.affinity));
|
|
8989
9007
|
const a = this._view.element, l = e.pointerId;
|
|
8990
9008
|
a.setPointerCapture(l), this._model.isSelecting.set(!0, void 0);
|
|
8991
9009
|
const d = (h) => {
|
|
8992
|
-
const u = this._model.selection.get() ??
|
|
9010
|
+
const u = this._model.selection.get() ?? b.collapsed(r), m = this._view.resolveCursorPositionFromPoint(new Ee(h.clientX, h.clientY)) ?? I.source(u.active, u.activeAffinity);
|
|
8993
9011
|
this._setUserSelection(u.withActive(m.offset, m.affinity));
|
|
8994
9012
|
}, f = () => {
|
|
8995
9013
|
if (this._model.isSelecting.set(!1, void 0), c && (this._model.selection.get()?.isCollapsed ?? !0)) {
|
|
8996
9014
|
const h = Date.now();
|
|
8997
|
-
(this._lastReadonlyClickRevealTime === void 0 || h - this._lastReadonlyClickRevealTime >=
|
|
9015
|
+
(this._lastReadonlyClickRevealTime === void 0 || h - this._lastReadonlyClickRevealTime >= ad) && (this._lastReadonlyClickRevealTime = h, this._view.showReadonlyEditingAttempt());
|
|
8998
9016
|
}
|
|
8999
9017
|
a.removeEventListener("pointermove", d), a.removeEventListener("pointerup", f), a.removeEventListener("pointercancel", f), a.removeEventListener("lostpointercapture", f);
|
|
9000
9018
|
};
|
|
9001
9019
|
a.addEventListener("pointermove", d), a.addEventListener("pointerup", f), a.addEventListener("pointercancel", f), a.addEventListener("lostpointercapture", f);
|
|
9002
9020
|
};
|
|
9003
9021
|
_makeCursorContext(e) {
|
|
9004
|
-
const t = this._model.document.get(), s = e ?? this._model.selection.get() ??
|
|
9022
|
+
const t = this._model.document.get(), s = e ?? this._model.selection.get() ?? b.collapsed(0), i = e ? Cn(t, s.active) : this._model.activeBlock.get();
|
|
9005
9023
|
return {
|
|
9006
9024
|
text: this._model.sourceText.get().value,
|
|
9007
9025
|
selection: s,
|
|
@@ -9060,12 +9078,12 @@ class sh extends W {
|
|
|
9060
9078
|
if (t.kind === "virtual") {
|
|
9061
9079
|
if (this._model.pendingParagraph.get()?.cursorLine !== t.line) {
|
|
9062
9080
|
const o = t.line.sourceOffsetBefore;
|
|
9063
|
-
this._setUserSelection(s ? e.withActive(o) :
|
|
9081
|
+
this._setUserSelection(s ? e.withActive(o) : b.collapsed(o)), this._view.revealCaretAfterKeyboardNavigation();
|
|
9064
9082
|
}
|
|
9065
9083
|
return;
|
|
9066
9084
|
}
|
|
9067
9085
|
this._setUserSelection(
|
|
9068
|
-
s ? e.withActive(t.offset, t.affinity) :
|
|
9086
|
+
s ? e.withActive(t.offset, t.affinity) : b.collapsed(t.offset, t.affinity)
|
|
9069
9087
|
), this._view.revealCaretAfterKeyboardNavigation();
|
|
9070
9088
|
}
|
|
9071
9089
|
/** Move the cursor down one visual line (Arrow Down). */
|
|
@@ -9119,7 +9137,7 @@ class sh extends W {
|
|
|
9119
9137
|
}
|
|
9120
9138
|
};
|
|
9121
9139
|
_handleKeyDown = (e) => {
|
|
9122
|
-
if (e.isComposing ||
|
|
9140
|
+
if (e.isComposing || ld(e, this._view.element) || (this._updateModifierState(e), e.key === "Tab" && (this._model.readonlyMode.get() || this._tabMovesFocus)))
|
|
9123
9141
|
return;
|
|
9124
9142
|
if (e.key === "Escape" && !e.defaultPrevented && !e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && (this._model.selection.get() !== void 0 || this._model.pendingParagraph.get() !== void 0)) {
|
|
9125
9143
|
ii(e), this._view.stopFollowingCaret(), this._generatedIndentation = void 0, this._desiredColumn = void 0, this._setUserSelection(void 0);
|
|
@@ -9139,7 +9157,7 @@ class sh extends W {
|
|
|
9139
9157
|
e.preventDefault();
|
|
9140
9158
|
return;
|
|
9141
9159
|
}
|
|
9142
|
-
|
|
9160
|
+
sd(e.key) && e.preventDefault();
|
|
9143
9161
|
return;
|
|
9144
9162
|
}
|
|
9145
9163
|
const s = this._model.pendingParagraph.get() !== void 0;
|
|
@@ -9223,22 +9241,22 @@ class sh extends W {
|
|
|
9223
9241
|
this._executeEditCommand(kc);
|
|
9224
9242
|
return;
|
|
9225
9243
|
case "copyLinesUp":
|
|
9226
|
-
this._executeEditCommand(
|
|
9244
|
+
this._executeEditCommand(Hc);
|
|
9227
9245
|
return;
|
|
9228
9246
|
case "copyLinesDown":
|
|
9229
|
-
this._executeEditCommand(
|
|
9247
|
+
this._executeEditCommand(zc);
|
|
9230
9248
|
return;
|
|
9231
9249
|
case "moveLinesUp":
|
|
9232
|
-
this._executeEditCommand(
|
|
9250
|
+
this._executeEditCommand(qc);
|
|
9233
9251
|
return;
|
|
9234
9252
|
case "moveLinesDown":
|
|
9235
|
-
this._executeEditCommand(
|
|
9253
|
+
this._executeEditCommand(Uc);
|
|
9236
9254
|
return;
|
|
9237
9255
|
case "deleteLines":
|
|
9238
|
-
this._executeEditCommand(
|
|
9256
|
+
this._executeEditCommand(Gc);
|
|
9239
9257
|
return;
|
|
9240
9258
|
case "joinLines":
|
|
9241
|
-
this._executeEditCommand(
|
|
9259
|
+
this._executeEditCommand(Qc);
|
|
9242
9260
|
return;
|
|
9243
9261
|
default:
|
|
9244
9262
|
return Me(t);
|
|
@@ -9246,7 +9264,7 @@ class sh extends W {
|
|
|
9246
9264
|
}
|
|
9247
9265
|
case "selectAll": {
|
|
9248
9266
|
const t = this._makeCursorContext();
|
|
9249
|
-
this._setUserSelection(
|
|
9267
|
+
this._setUserSelection(jc(t));
|
|
9250
9268
|
return;
|
|
9251
9269
|
}
|
|
9252
9270
|
case "history": {
|
|
@@ -9363,10 +9381,10 @@ function Me(n) {
|
|
|
9363
9381
|
function ii(n) {
|
|
9364
9382
|
n.preventDefault(), n.stopPropagation();
|
|
9365
9383
|
}
|
|
9366
|
-
function
|
|
9384
|
+
function ld(n, e) {
|
|
9367
9385
|
return n.target !== e;
|
|
9368
9386
|
}
|
|
9369
|
-
function
|
|
9387
|
+
function dd(n, e) {
|
|
9370
9388
|
const t = new Set(n.blocks);
|
|
9371
9389
|
let s = 0;
|
|
9372
9390
|
for (const i of n.children) {
|
|
@@ -9381,8 +9399,8 @@ function ld(n, e) {
|
|
|
9381
9399
|
function oi(n, e, t) {
|
|
9382
9400
|
t === null ? n.removeAttribute(e) : n.setAttribute(e, t);
|
|
9383
9401
|
}
|
|
9384
|
-
const
|
|
9385
|
-
class
|
|
9402
|
+
const hd = 200;
|
|
9403
|
+
class oh {
|
|
9386
9404
|
constructor(e) {
|
|
9387
9405
|
this._model = e, this._lastKnownText = e.sourceText.get().value;
|
|
9388
9406
|
}
|
|
@@ -9408,7 +9426,7 @@ class ih {
|
|
|
9408
9426
|
redoEdit: c,
|
|
9409
9427
|
beforeSelection: i,
|
|
9410
9428
|
afterSelection: r
|
|
9411
|
-
}), this._past.length >
|
|
9429
|
+
}), this._past.length > hd && this._past.shift(), this._future.length = 0;
|
|
9412
9430
|
}
|
|
9413
9431
|
undo() {
|
|
9414
9432
|
const e = this._peekApplicable(this._past);
|
|
@@ -9441,7 +9459,7 @@ class ih {
|
|
|
9441
9459
|
}
|
|
9442
9460
|
}
|
|
9443
9461
|
const ri = "md-debug-show-line-rects";
|
|
9444
|
-
function
|
|
9462
|
+
function ud(n, e) {
|
|
9445
9463
|
try {
|
|
9446
9464
|
const t = localStorage.getItem(n);
|
|
9447
9465
|
return t === null ? e : t === "true";
|
|
@@ -9449,20 +9467,20 @@ function hd(n, e) {
|
|
|
9449
9467
|
return e;
|
|
9450
9468
|
}
|
|
9451
9469
|
}
|
|
9452
|
-
function
|
|
9470
|
+
function fd(n, e) {
|
|
9453
9471
|
try {
|
|
9454
9472
|
localStorage.setItem(n, String(e));
|
|
9455
9473
|
} catch {
|
|
9456
9474
|
}
|
|
9457
9475
|
}
|
|
9458
|
-
class
|
|
9476
|
+
class rh extends W {
|
|
9459
9477
|
overlayElement;
|
|
9460
9478
|
infoElement;
|
|
9461
9479
|
rendering;
|
|
9462
9480
|
/** Absolute source offsets that map to a rendered DOM character. */
|
|
9463
9481
|
mappedOffsets;
|
|
9464
9482
|
/** Whether the dashed line-bands and run boxes are drawn (persisted). */
|
|
9465
|
-
_showLineRects = x(this,
|
|
9483
|
+
_showLineRects = x(this, ud(ri, !0));
|
|
9466
9484
|
constructor(e, t) {
|
|
9467
9485
|
super(), this.overlayElement = document.createElement("div"), this.overlayElement.className = "md-debug-layout-overlay", Object.assign(this.overlayElement.style, {
|
|
9468
9486
|
position: "absolute",
|
|
@@ -9491,12 +9509,12 @@ class oh extends W {
|
|
|
9491
9509
|
});
|
|
9492
9510
|
const i = document.createElement("input");
|
|
9493
9511
|
i.type = "checkbox", i.checked = this._showLineRects.get(), i.addEventListener("change", () => {
|
|
9494
|
-
this._showLineRects.set(i.checked, void 0),
|
|
9512
|
+
this._showLineRects.set(i.checked, void 0), fd(ri, i.checked);
|
|
9495
9513
|
}), s.appendChild(i), s.appendChild(document.createTextNode("show line rects")), this.infoElement.appendChild(s);
|
|
9496
9514
|
const o = document.createElement("pre");
|
|
9497
9515
|
o.style.margin = "0", o.style.whiteSpace = "pre", this.infoElement.appendChild(o), this.rendering = R(this, (r) => {
|
|
9498
9516
|
const c = r.readObservable(t.model.measurements), a = r.readObservable(this._showLineRects);
|
|
9499
|
-
return
|
|
9517
|
+
return pd(
|
|
9500
9518
|
this.overlayElement,
|
|
9501
9519
|
o,
|
|
9502
9520
|
c,
|
|
@@ -9508,16 +9526,16 @@ class oh extends W {
|
|
|
9508
9526
|
}), this.mappedOffsets = R(this, (r) => r.readObservable(this.rendering).mappedOffsets), this._register(T((r) => {
|
|
9509
9527
|
r.readObservable(this.rendering);
|
|
9510
9528
|
const c = t.hoveredOffset ? r.readObservable(t.hoveredOffset) : void 0;
|
|
9511
|
-
t.hoveredOffset &&
|
|
9529
|
+
t.hoveredOffset && _d(this.overlayElement, c);
|
|
9512
9530
|
}));
|
|
9513
9531
|
}
|
|
9514
9532
|
}
|
|
9515
|
-
class
|
|
9533
|
+
class md {
|
|
9516
9534
|
constructor(e, t, s, i) {
|
|
9517
9535
|
this.blockCount = e, this.mountedCount = t, this.lineCount = s, this.mappedOffsets = i;
|
|
9518
9536
|
}
|
|
9519
9537
|
}
|
|
9520
|
-
function
|
|
9538
|
+
function pd(n, e, t, s, i, o, r) {
|
|
9521
9539
|
n.textContent = "";
|
|
9522
9540
|
const c = s.capture();
|
|
9523
9541
|
let a = 0, l = 0, d = 0;
|
|
@@ -9526,8 +9544,8 @@ function md(n, e, t, s, i, o, r) {
|
|
|
9526
9544
|
const p = t[m], g = p.visualLineMap?.lines ?? [];
|
|
9527
9545
|
if (p.isMeasured && a++, l += g.length, i)
|
|
9528
9546
|
for (let _ = 0; _ < g.length; _++) {
|
|
9529
|
-
const k = g[_], w = k.rect,
|
|
9530
|
-
Object.assign(
|
|
9547
|
+
const k = g[_], w = k.rect, y = document.createElement("div");
|
|
9548
|
+
Object.assign(y.style, {
|
|
9531
9549
|
position: "absolute",
|
|
9532
9550
|
left: "0",
|
|
9533
9551
|
right: "0",
|
|
@@ -9535,7 +9553,7 @@ function md(n, e, t, s, i, o, r) {
|
|
|
9535
9553
|
height: `${w.height}px`,
|
|
9536
9554
|
border: "1px dashed rgba(180, 0, 200, 0.45)",
|
|
9537
9555
|
boxSizing: "border-box"
|
|
9538
|
-
}), n.appendChild(
|
|
9556
|
+
}), n.appendChild(y);
|
|
9539
9557
|
for (const C of k.runs) {
|
|
9540
9558
|
const N = document.createElement("div");
|
|
9541
9559
|
Object.assign(N.style, {
|
|
@@ -9549,16 +9567,16 @@ function md(n, e, t, s, i, o, r) {
|
|
|
9549
9567
|
}), n.appendChild(N);
|
|
9550
9568
|
}
|
|
9551
9569
|
}
|
|
9552
|
-
p.viewNode && (d +=
|
|
9570
|
+
p.viewNode && (d += gd(n, c, p.viewNode, p.absoluteStart, f, o, r));
|
|
9553
9571
|
}
|
|
9554
9572
|
const h = `blocks: ${t.length} mounted: ${a} lines: ${l} chars: ${d}`, u = t.map((m, p) => {
|
|
9555
9573
|
const g = m.isMeasured ? "M" : "e", _ = m.visualLineMap?.lines.length ?? 0;
|
|
9556
9574
|
return `${String(p).padStart(2)} ${g} start=${String(m.absoluteStart).padStart(4)} h=${m.height.toFixed(1).padStart(6)} lines=${_} kind=${m.block.kind}`;
|
|
9557
9575
|
});
|
|
9558
9576
|
return e.textContent = [h, ...u].join(`
|
|
9559
|
-
`), new
|
|
9577
|
+
`), new md(t.length, a, l, f);
|
|
9560
9578
|
}
|
|
9561
|
-
function
|
|
9579
|
+
function gd(n, e, t, s, i, o, r) {
|
|
9562
9580
|
let c = 0;
|
|
9563
9581
|
const a = document.createRange(), l = s + t.sourceLength, d = [];
|
|
9564
9582
|
t.forEachTextLeaf(s, (h, u) => {
|
|
@@ -9591,7 +9609,7 @@ function pd(n, e, t, s, i, o, r) {
|
|
|
9591
9609
|
}
|
|
9592
9610
|
return c;
|
|
9593
9611
|
}
|
|
9594
|
-
function
|
|
9612
|
+
function _d(n, e) {
|
|
9595
9613
|
for (const t of Array.from(n.children)) {
|
|
9596
9614
|
if (!t.style)
|
|
9597
9615
|
continue;
|
|
@@ -9608,7 +9626,7 @@ class Je {
|
|
|
9608
9626
|
this.length = e, this.className = t;
|
|
9609
9627
|
}
|
|
9610
9628
|
}
|
|
9611
|
-
class
|
|
9629
|
+
class vd {
|
|
9612
9630
|
/**
|
|
9613
9631
|
* @param _monaco The Monarch runtime ({@link IMonarchApi}), injected so this
|
|
9614
9632
|
* package depends on `monaco-editor` for types only.
|
|
@@ -9619,7 +9637,7 @@ class _d {
|
|
|
9619
9637
|
}
|
|
9620
9638
|
_tokenizers = /* @__PURE__ */ new Map();
|
|
9621
9639
|
create(e, t) {
|
|
9622
|
-
return new
|
|
9640
|
+
return new kd(this._tokenizerFor(e), t);
|
|
9623
9641
|
}
|
|
9624
9642
|
dispose() {
|
|
9625
9643
|
for (const e of this._tokenizers.values())
|
|
@@ -9631,10 +9649,10 @@ class _d {
|
|
|
9631
9649
|
if (t === void 0)
|
|
9632
9650
|
return;
|
|
9633
9651
|
let s = this._tokenizers.get(e);
|
|
9634
|
-
return s || (s = new this._monaco.MonarchTokenizer(
|
|
9652
|
+
return s || (s = new this._monaco.MonarchTokenizer(Ed, xd, e, this._monaco.compile(e, t), Cd), this._tokenizers.set(e, s)), s;
|
|
9635
9653
|
}
|
|
9636
9654
|
}
|
|
9637
|
-
class
|
|
9655
|
+
class kd {
|
|
9638
9656
|
constructor(e, t) {
|
|
9639
9657
|
this._tokenizer = e, this._initialState = e?.getInitialState(), this._text = t, this._lines = this._tokenizeFrom(0, [], this._initialState, t.split(`
|
|
9640
9658
|
`)), this._lineStarts = this._computeLineStarts(), this._snapshotObs = x("syntaxSnapshot", new ai(this, this._version));
|
|
@@ -9658,7 +9676,7 @@ class vd {
|
|
|
9658
9676
|
const s = li(this._lines), i = e.apply(this._text), o = e.replacements[0].replaceRange.start, r = this._lineIndexAt(o), c = this._lines.slice(0, r), a = r === 0 ? this._initialState : this._lines[r - 1].endState;
|
|
9659
9677
|
this._text = i, this._lines = this._tokenizeFrom(r, c, a, i.split(`
|
|
9660
9678
|
`)), this._lineStarts = this._computeLineStarts(), this._version++;
|
|
9661
|
-
const l =
|
|
9679
|
+
const l = yd(s, li(this._lines));
|
|
9662
9680
|
this._snapshotObs.set(new ai(this, this._version), t, l);
|
|
9663
9681
|
}
|
|
9664
9682
|
dispose() {
|
|
@@ -9676,7 +9694,7 @@ class vd {
|
|
|
9676
9694
|
const a = i[c], l = c < i.length - 1;
|
|
9677
9695
|
if (this._tokenizer && r) {
|
|
9678
9696
|
const d = this._tokenizer.tokenize(a, l, r);
|
|
9679
|
-
o.push({ text: a, tokens:
|
|
9697
|
+
o.push({ text: a, tokens: bd(d.tokens, a.length), endState: d.endState }), r = d.endState;
|
|
9680
9698
|
} else
|
|
9681
9699
|
o.push({ text: a, tokens: a.length === 0 ? [] : [new Je(a.length, void 0)], endState: r });
|
|
9682
9700
|
}
|
|
@@ -9721,16 +9739,16 @@ class ai {
|
|
|
9721
9739
|
return this._doc._getTokens(this._version, e);
|
|
9722
9740
|
}
|
|
9723
9741
|
}
|
|
9724
|
-
function
|
|
9742
|
+
function wd(n) {
|
|
9725
9743
|
return n === "" ? void 0 : n;
|
|
9726
9744
|
}
|
|
9727
|
-
function
|
|
9745
|
+
function bd(n, e) {
|
|
9728
9746
|
if (n.length === 0)
|
|
9729
9747
|
return e === 0 ? [] : [new Je(e, void 0)];
|
|
9730
9748
|
const t = [];
|
|
9731
9749
|
for (let s = 0; s < n.length; s++) {
|
|
9732
9750
|
const i = n[s].offset, o = s + 1 < n.length ? n[s + 1].offset : e;
|
|
9733
|
-
o > i && t.push(new Je(o - i,
|
|
9751
|
+
o > i && t.push(new Je(o - i, wd(n[s].type)));
|
|
9734
9752
|
}
|
|
9735
9753
|
return t;
|
|
9736
9754
|
}
|
|
@@ -9752,7 +9770,7 @@ function hi(n) {
|
|
|
9752
9770
|
e += t.length;
|
|
9753
9771
|
return e;
|
|
9754
9772
|
}
|
|
9755
|
-
function
|
|
9773
|
+
function yd(n, e) {
|
|
9756
9774
|
const t = n.length, s = e.length;
|
|
9757
9775
|
let i = 0, o = 0;
|
|
9758
9776
|
for (; i < t && i < s && di(n[i], e[i]); )
|
|
@@ -9763,21 +9781,21 @@ function bd(n, e) {
|
|
|
9763
9781
|
const a = hi(n), l = hi(e), d = new v(o, a - c), f = l - c - o;
|
|
9764
9782
|
return d.isEmpty && f === 0 ? Re.empty : Re.replace(d, f);
|
|
9765
9783
|
}
|
|
9766
|
-
const
|
|
9784
|
+
const Ed = {
|
|
9767
9785
|
languageIdCodec: { encodeLanguageId: () => 0, decodeLanguageId: () => "" },
|
|
9768
9786
|
isRegisteredLanguageId: () => !1,
|
|
9769
9787
|
getLanguageIdByLanguageName: () => null,
|
|
9770
9788
|
getLanguageIdByMimeType: () => null,
|
|
9771
9789
|
requestBasicLanguageFeatures: () => {
|
|
9772
9790
|
}
|
|
9773
|
-
}, Ed = {
|
|
9774
|
-
getColorTheme: () => ({ tokenTheme: {} })
|
|
9775
9791
|
}, xd = {
|
|
9792
|
+
getColorTheme: () => ({ tokenTheme: {} })
|
|
9793
|
+
}, Cd = {
|
|
9776
9794
|
getValue: () => 2e4,
|
|
9777
9795
|
onDidChangeConfiguration: () => ({ dispose() {
|
|
9778
9796
|
} })
|
|
9779
9797
|
};
|
|
9780
|
-
function
|
|
9798
|
+
function ch(n, e) {
|
|
9781
9799
|
const t = /* @__PURE__ */ new Map([
|
|
9782
9800
|
["typescript", e.typescript],
|
|
9783
9801
|
["ts", e.typescript],
|
|
@@ -9795,14 +9813,14 @@ function rh(n, e) {
|
|
|
9795
9813
|
["yaml", e.yaml],
|
|
9796
9814
|
["yml", e.yaml]
|
|
9797
9815
|
]);
|
|
9798
|
-
return new
|
|
9816
|
+
return new vd(n, t);
|
|
9799
9817
|
}
|
|
9800
9818
|
function To(n) {
|
|
9801
9819
|
const e = document.createElement("span");
|
|
9802
9820
|
return e.className = `codicon codicon-${n}`, e.setAttribute("aria-hidden", "true"), e;
|
|
9803
9821
|
}
|
|
9804
|
-
const
|
|
9805
|
-
class
|
|
9822
|
+
const Sd = 165, Ld = 400, Td = 33;
|
|
9823
|
+
class Md extends W {
|
|
9806
9824
|
constructor(e) {
|
|
9807
9825
|
super(), this._options = e, this.element = document.createElement("div"), this.element.className = "md-comment-input", this._textarea = document.createElement("textarea"), this._textarea.className = "md-comment-input-textarea", this._textarea.rows = 1, this._textarea.placeholder = e?.placeholder ?? "Add comment", this._textarea.setAttribute("aria-label", this._textarea.placeholder), this.element.appendChild(this._textarea), this._measure = document.createElement("span"), this._measure.className = "md-comment-input-measure", this._measure.setAttribute("aria-hidden", "true"), this.element.appendChild(this._measure), this._submitButton = document.createElement("button"), this._submitButton.type = "button", this._submitButton.className = "md-comment-input-submit", this._submitButton.title = "Add comment", this._submitButton.setAttribute("aria-label", "Add comment"), this._submitButton.appendChild(To("add")), this.element.appendChild(this._submitButton);
|
|
9808
9826
|
const t = (r) => {
|
|
@@ -9857,15 +9875,15 @@ class Td extends W {
|
|
|
9857
9875
|
}
|
|
9858
9876
|
_autoSize() {
|
|
9859
9877
|
this._measure.textContent = this._textarea.value || this._textarea.placeholder;
|
|
9860
|
-
const e = this._measure.scrollWidth +
|
|
9861
|
-
this.element.style.width = `${Math.min(Math.max(
|
|
9878
|
+
const e = this._measure.scrollWidth + Td;
|
|
9879
|
+
this.element.style.width = `${Math.min(Math.max(Sd, e), Ld)}px`, this._textarea.style.height = "auto";
|
|
9862
9880
|
const t = this._textarea.scrollHeight;
|
|
9863
9881
|
t > 0 && (this._textarea.style.height = `${Math.min(t, 160)}px`, this._textarea.style.overflowY = t > 160 ? "auto" : "hidden"), this._options?.onDidChangeSize?.();
|
|
9864
9882
|
}
|
|
9865
9883
|
}
|
|
9866
9884
|
class Mo extends W {
|
|
9867
9885
|
constructor(e, t, s) {
|
|
9868
|
-
super(), this._model = e, this._view = t, this._options = s, this._gap = s?.gap ?? 8, this._widget = this._register(new
|
|
9886
|
+
super(), this._model = e, this._view = t, this._options = s, this._gap = s?.gap ?? 8, this._widget = this._register(new Md({
|
|
9869
9887
|
onDidChangeSize: () => {
|
|
9870
9888
|
this._visible && this._layoutHorizontally();
|
|
9871
9889
|
},
|
|
@@ -9898,7 +9916,7 @@ class Mo extends W {
|
|
|
9898
9916
|
case "find":
|
|
9899
9917
|
return !1;
|
|
9900
9918
|
default:
|
|
9901
|
-
return
|
|
9919
|
+
return Od(e);
|
|
9902
9920
|
}
|
|
9903
9921
|
}
|
|
9904
9922
|
_widget;
|
|
@@ -9996,10 +10014,10 @@ class Mo extends W {
|
|
|
9996
10014
|
this._hideAndRefocus(), t && this._options?.onSubmit?.({ text: e, range: t });
|
|
9997
10015
|
}
|
|
9998
10016
|
}
|
|
9999
|
-
function
|
|
10017
|
+
function Od(n) {
|
|
10000
10018
|
throw new Error(`Unhandled selection source: ${JSON.stringify(n)}`);
|
|
10001
10019
|
}
|
|
10002
|
-
class
|
|
10020
|
+
class Rd {
|
|
10003
10021
|
_domNode;
|
|
10004
10022
|
_disposables = [];
|
|
10005
10023
|
get element() {
|
|
@@ -10023,7 +10041,7 @@ class Od {
|
|
|
10023
10041
|
this._domNode.remove();
|
|
10024
10042
|
}
|
|
10025
10043
|
}
|
|
10026
|
-
class
|
|
10044
|
+
class ah {
|
|
10027
10045
|
_comments = x(this, []);
|
|
10028
10046
|
/** Monotonic counter for ids of comments created via {@link create}. */
|
|
10029
10047
|
_sequence = 0;
|
|
@@ -10059,9 +10077,9 @@ class ch {
|
|
|
10059
10077
|
this._comments.set(this._comments.get().filter((t) => t.id !== e), void 0);
|
|
10060
10078
|
}
|
|
10061
10079
|
}
|
|
10062
|
-
const
|
|
10063
|
-
function
|
|
10064
|
-
const t = n.element, s = n.overlayContainer, i = t.clientWidth -
|
|
10080
|
+
const Id = 12, Nd = 8;
|
|
10081
|
+
function Ad(n, e) {
|
|
10082
|
+
const t = n.element, s = n.overlayContainer, i = t.clientWidth - Nd - s.offsetLeft, o = [];
|
|
10065
10083
|
for (const c of e) {
|
|
10066
10084
|
if (c.element.style.setProperty("--md-comment-available-width", `${Math.max(0, i)}px`), c.rects.length === 0) {
|
|
10067
10085
|
c.element.style.visibility = "hidden";
|
|
@@ -10072,11 +10090,11 @@ function Nd(n, e) {
|
|
|
10072
10090
|
o.sort((c, a) => c.y - a.y);
|
|
10073
10091
|
let r = -1 / 0;
|
|
10074
10092
|
for (const c of o) {
|
|
10075
|
-
const a = Math.max(c.y, r +
|
|
10093
|
+
const a = Math.max(c.y, r + Id), l = i - c.element.offsetWidth;
|
|
10076
10094
|
c.element.style.left = `${l}px`, c.element.style.top = `${a}px`, r = a + c.element.offsetHeight;
|
|
10077
10095
|
}
|
|
10078
10096
|
}
|
|
10079
|
-
class
|
|
10097
|
+
class lh extends W {
|
|
10080
10098
|
constructor(e, t) {
|
|
10081
10099
|
super(), this._model = e, this._view = t, this._layer = document.createElement("div"), this._layer.className = "md-comments-layer", this._layer.style.position = "absolute", this._layer.style.inset = "0", this._layer.style.pointerEvents = "none", this._layer.style.overflow = "visible", this._layer.style.background = "transparent", this._view.overlayContainer.appendChild(this._layer), this._register({
|
|
10082
10100
|
dispose: () => {
|
|
@@ -10107,7 +10125,7 @@ class ah extends W {
|
|
|
10107
10125
|
for (const s of e) {
|
|
10108
10126
|
if (this._entries.has(s.id))
|
|
10109
10127
|
continue;
|
|
10110
|
-
const i = new
|
|
10128
|
+
const i = new Rd({
|
|
10111
10129
|
body: s.body,
|
|
10112
10130
|
onDelete: () => this._model.remove(s.id)
|
|
10113
10131
|
});
|
|
@@ -10121,7 +10139,7 @@ class ah extends W {
|
|
|
10121
10139
|
}
|
|
10122
10140
|
_relayout() {
|
|
10123
10141
|
const e = this._order.map((t) => this._entries.get(t)).filter((t) => t !== void 0).map((t) => ({ element: t.widget.element, rects: t.rects.get() }));
|
|
10124
|
-
|
|
10142
|
+
Ad(this._view, e), this._revealPendingComment();
|
|
10125
10143
|
}
|
|
10126
10144
|
_revealPendingComment() {
|
|
10127
10145
|
const e = this._pendingRevealCommentId;
|
|
@@ -10131,7 +10149,7 @@ class ah extends W {
|
|
|
10131
10149
|
!t || t.style.visibility === "hidden" || (this._pendingRevealCommentId = void 0, t.scrollIntoView({ block: "center", inline: "nearest" }));
|
|
10132
10150
|
}
|
|
10133
10151
|
}
|
|
10134
|
-
class
|
|
10152
|
+
class dh {
|
|
10135
10153
|
constructor(e) {
|
|
10136
10154
|
this._options = e;
|
|
10137
10155
|
let t = this.name.get();
|
|
@@ -10227,7 +10245,7 @@ class lh {
|
|
|
10227
10245
|
function ui(n) {
|
|
10228
10246
|
return n instanceof Error && n.message ? n : new Error(String(n) || "Rename failed.");
|
|
10229
10247
|
}
|
|
10230
|
-
class
|
|
10248
|
+
class hh extends W {
|
|
10231
10249
|
constructor(e, t, s = {}) {
|
|
10232
10250
|
super(), this._container = e, this._model = t, this._options = s;
|
|
10233
10251
|
const i = e.ownerDocument;
|
|
@@ -10267,7 +10285,7 @@ class dh extends W {
|
|
|
10267
10285
|
this.element.style.left = `${Math.max(0, Math.min(e.left, t - this.element.offsetWidth))}px`, this.element.style.top = `${Math.max(0, Math.min(r, s - i))}px`;
|
|
10268
10286
|
}
|
|
10269
10287
|
}
|
|
10270
|
-
class
|
|
10288
|
+
class uh {
|
|
10271
10289
|
constructor(e) {
|
|
10272
10290
|
this._callbacks = e;
|
|
10273
10291
|
}
|
|
@@ -10351,7 +10369,7 @@ class hh {
|
|
|
10351
10369
|
s !== t && this._callbacks.onSelect?.(s);
|
|
10352
10370
|
}
|
|
10353
10371
|
}
|
|
10354
|
-
class
|
|
10372
|
+
class fh extends W {
|
|
10355
10373
|
constructor(e) {
|
|
10356
10374
|
if (super(), this._options = e, !e.id || /\s/.test(e.id))
|
|
10357
10375
|
throw new Error("Suggest widget id must be nonempty and contain no whitespace.");
|
|
@@ -10448,7 +10466,7 @@ class uh extends W {
|
|
|
10448
10466
|
const s = this.element.ownerDocument, i = s.createElement("div");
|
|
10449
10467
|
i.className = "md-suggest-row", i.id = `${this.listElement.id}-option-${t}`, i.dataset.suggestId = e.id, i.setAttribute("role", "option"), i.setAttribute("aria-label", [e.label, e.type].filter(Boolean).join(", ")), i.title = [e.label, e.detail, e.type].filter(Boolean).join(" - ");
|
|
10450
10468
|
const o = s.createElement("span");
|
|
10451
|
-
o.className = `md-suggest-icon codicon codicon-${
|
|
10469
|
+
o.className = `md-suggest-icon codicon codicon-${Pd[e.type ?? "Text"] ?? "symbol-property"}`, o.setAttribute("aria-hidden", "true"), i.appendChild(o);
|
|
10452
10470
|
const r = s.createElement("span");
|
|
10453
10471
|
r.className = "md-suggest-label";
|
|
10454
10472
|
const c = Math.max(0, Math.min(e.highlightLength ?? 0, e.label.length)), a = s.createElement("span");
|
|
@@ -10464,7 +10482,7 @@ class uh extends W {
|
|
|
10464
10482
|
this._savedAttributes.clear();
|
|
10465
10483
|
}
|
|
10466
10484
|
}
|
|
10467
|
-
const
|
|
10485
|
+
const Pd = {
|
|
10468
10486
|
Text: "symbol-text",
|
|
10469
10487
|
Method: "symbol-method",
|
|
10470
10488
|
Function: "symbol-method",
|
|
@@ -10493,39 +10511,39 @@ const Ad = {
|
|
|
10493
10511
|
};
|
|
10494
10512
|
export {
|
|
10495
10513
|
ee as AstNode,
|
|
10496
|
-
|
|
10514
|
+
th as AsyncClipboardStrategy,
|
|
10497
10515
|
_e as BlockQuoteAstNode,
|
|
10498
10516
|
M as BlockViewNode,
|
|
10499
10517
|
ce as CodeBlockAstNode,
|
|
10500
10518
|
An as CodeBlockViewNode,
|
|
10501
|
-
|
|
10519
|
+
Md as CommentInputWidget,
|
|
10502
10520
|
Mo as CommentModeController,
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10521
|
+
Rd as CommentWidget,
|
|
10522
|
+
ah as CommentsModel,
|
|
10523
|
+
lh as CommentsView,
|
|
10506
10524
|
I as CursorPosition,
|
|
10507
|
-
|
|
10525
|
+
El as CursorView,
|
|
10508
10526
|
at as CursorViewRendering,
|
|
10509
10527
|
tt as DEFAULT_INDENTATION_CONFIG,
|
|
10510
10528
|
Fo as DEFAULT_WORD_NAVIGATION_CONFIG,
|
|
10511
|
-
|
|
10529
|
+
gh as DEFAULT_WORD_SEPARATORS,
|
|
10512
10530
|
bn as DocumentAstNode,
|
|
10513
10531
|
Bn as DocumentViewNode,
|
|
10514
|
-
|
|
10532
|
+
ih as EditorController,
|
|
10515
10533
|
Rt as EditorCoordinateSpace,
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10534
|
+
Sa as EditorCoordinateTransform,
|
|
10535
|
+
Jd as EditorModel,
|
|
10536
|
+
Zd as EditorView,
|
|
10519
10537
|
_n as EmphasisAstNode,
|
|
10520
10538
|
Ae as EmptyBlockAstNode,
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10539
|
+
Wl as FIND_MATCH_LIMIT,
|
|
10540
|
+
Yl as FindController,
|
|
10541
|
+
Dl as FindHighlightsView,
|
|
10542
|
+
ql as FindModel,
|
|
10525
10543
|
wt as FindPattern,
|
|
10526
|
-
|
|
10544
|
+
jl as FindWidget,
|
|
10527
10545
|
Pe as FrontMatterAstNode,
|
|
10528
|
-
|
|
10546
|
+
L as GlueAstNode,
|
|
10529
10547
|
be as HeadingAstNode,
|
|
10530
10548
|
Ze as ImageAstNode,
|
|
10531
10549
|
kn as InlineCodeAstNode,
|
|
@@ -10535,32 +10553,32 @@ export {
|
|
|
10535
10553
|
Ce as LinkAstNode,
|
|
10536
10554
|
H as ListAstNode,
|
|
10537
10555
|
$ as ListItemAstNode,
|
|
10538
|
-
|
|
10556
|
+
oh as LocalHistoryStrategy,
|
|
10539
10557
|
br as MarkdownParser,
|
|
10540
10558
|
E as MarkerAstNode,
|
|
10541
10559
|
Se as MathBlockAstNode,
|
|
10542
|
-
|
|
10543
|
-
|
|
10560
|
+
md as MeasuredLayoutDebugRendering,
|
|
10561
|
+
rh as MeasuredLayoutDebugView,
|
|
10544
10562
|
qr as MeasuredLayoutModel,
|
|
10545
|
-
|
|
10546
|
-
|
|
10563
|
+
vd as MonacoSyntaxHighlighter,
|
|
10564
|
+
ed as NativeClipboardStrategy,
|
|
10547
10565
|
v as OffsetRange,
|
|
10548
10566
|
se as ParagraphAstNode,
|
|
10549
10567
|
Ee as Point2D,
|
|
10550
10568
|
P as Rect2D,
|
|
10551
|
-
|
|
10552
|
-
|
|
10569
|
+
dh as RenameModel,
|
|
10570
|
+
hh as RenameWidget,
|
|
10553
10571
|
je as RichLink,
|
|
10554
|
-
|
|
10555
|
-
|
|
10572
|
+
b as Selection,
|
|
10573
|
+
pl as SelectionView,
|
|
10556
10574
|
Ds as SelectionViewRendering,
|
|
10557
10575
|
vn as StrikethroughAstNode,
|
|
10558
|
-
|
|
10576
|
+
S as StringEdit,
|
|
10559
10577
|
ge as StringReplacement,
|
|
10560
10578
|
qn as StringValue,
|
|
10561
10579
|
gn as StrongAstNode,
|
|
10562
|
-
|
|
10563
|
-
|
|
10580
|
+
uh as SuggestModel,
|
|
10581
|
+
fh as SuggestWidget,
|
|
10564
10582
|
Be as TableAstNode,
|
|
10565
10583
|
Ge as TableCellAstNode,
|
|
10566
10584
|
Ue as TableRowAstNode,
|
|
@@ -10575,9 +10593,9 @@ export {
|
|
|
10575
10593
|
we as VisualRun,
|
|
10576
10594
|
Jt as blocksIntersecting,
|
|
10577
10595
|
fn as commands,
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
|
|
10596
|
+
zc as copyLinesDown,
|
|
10597
|
+
Hc as copyLinesUp,
|
|
10598
|
+
ch as createDefaultMonacoSyntaxHighlighter,
|
|
10581
10599
|
cc as cursorDocumentEnd,
|
|
10582
10600
|
rc as cursorDocumentStart,
|
|
10583
10601
|
dc as cursorDown,
|
|
@@ -10595,13 +10613,13 @@ export {
|
|
|
10595
10613
|
ts as deleteLeft,
|
|
10596
10614
|
vc as deleteLineLeft,
|
|
10597
10615
|
kc as deleteLineRight,
|
|
10598
|
-
|
|
10616
|
+
Gc as deleteLines,
|
|
10599
10617
|
pc as deleteRight,
|
|
10600
10618
|
gc as deleteWordLeft,
|
|
10601
10619
|
_c as deleteWordRight,
|
|
10602
10620
|
Co as escapeFindRegex,
|
|
10603
10621
|
Cn as findBlockAtOffset,
|
|
10604
|
-
|
|
10622
|
+
q as findNodeOffsetById,
|
|
10605
10623
|
gi as findWordAt,
|
|
10606
10624
|
Vo as findWordBoundaryLeft,
|
|
10607
10625
|
Wo as findWordBoundaryRight,
|
|
@@ -10615,21 +10633,21 @@ export {
|
|
|
10615
10633
|
Sc as insertSmartEnter,
|
|
10616
10634
|
yc as insertTab,
|
|
10617
10635
|
Bi as insertText,
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10636
|
+
Qc as joinLines,
|
|
10637
|
+
Uc as moveLinesDown,
|
|
10638
|
+
qc as moveLinesUp,
|
|
10621
10639
|
We as nextCursorPosition,
|
|
10622
10640
|
fe as normalizeCursorPosition,
|
|
10623
10641
|
Di as outdent,
|
|
10624
10642
|
Sr as presentationPolicies,
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10643
|
+
eh as readNativeClipboard,
|
|
10644
|
+
jc as selectAll,
|
|
10645
|
+
Jc as selectBlock,
|
|
10646
|
+
Yc as selectWord,
|
|
10629
10647
|
sr as taskCheckboxRange,
|
|
10630
|
-
|
|
10631
|
-
|
|
10648
|
+
Yd as visualizeAst,
|
|
10649
|
+
sh as vscodeHostKeyboardProfile,
|
|
10632
10650
|
un as vscodeKeyboardProfile,
|
|
10633
|
-
|
|
10651
|
+
nh as vscodeLocalKeyboardProfile
|
|
10634
10652
|
};
|
|
10635
10653
|
//# sourceMappingURL=index.js.map
|