@vscode/markdown-editor 0.0.2-118 → 0.0.2-119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { commands as un } from "./commands.js";
2
2
  import { O as v, S as T, a as _e, c as pi } from "./stringEdit-CVDbCUBY.js";
3
3
  import gi from "katex";
4
- import { observableValue as x, derived as I, transaction as K, Disposable as W, runOnChange as fn, autorun as R, constObservable as Hn } from "@vscode/observables";
5
- import { D as Do, f as Fo, a as Vo, b as Wo, c as Ho, d as _i, i as Je } from "./config-BGeaJqWk.js";
4
+ import { observableValue as x, derived as I, transaction as K, Disposable as W, runOnChange as fn, autorun as R, constObservable as $n } from "@vscode/observables";
5
+ import { D as Do, f as Fo, a as Vo, b as Wo, c as $o, d as _i, i as Je } from "./config-BGeaJqWk.js";
6
6
  import { e as _h } from "./config-BGeaJqWk.js";
7
- import { decodeHTMLAttribute as $n } from "entities/decode";
8
- import { decodeString as $o } from "micromark-util-decode-string";
7
+ import { decodeHTMLAttribute as Hn } from "entities/decode";
8
+ import { decodeString as Ho } from "micromark-util-decode-string";
9
9
  import { parse as Ko, preprocess as zo, postprocess as qo } from "micromark";
10
10
  import { frontmatter as Uo } from "micromark-extension-frontmatter";
11
11
  import { math as Go } from "micromark-extension-math";
@@ -635,7 +635,7 @@ class ve extends te {
635
635
  return new ve(this.content, e);
636
636
  }
637
637
  }
638
- class $ extends te {
638
+ class H extends te {
639
639
  constructor(e, t, s) {
640
640
  super(), this.ordered = e, this.content = t, this.leadingTrivia = s;
641
641
  }
@@ -644,19 +644,19 @@ class $ extends te {
644
644
  return this._withLeading(this.content);
645
645
  }
646
646
  get items() {
647
- return this.content.filter((e) => e instanceof H);
647
+ return this.content.filter((e) => e instanceof $);
648
648
  }
649
649
  mapChildren(e) {
650
- return new $(this.ordered, B(e, this.content), oe(e, this.leadingTrivia));
650
+ return new H(this.ordered, B(e, this.content), oe(e, this.leadingTrivia));
651
651
  }
652
652
  withLeadingTrivia(e) {
653
- return new $(this.ordered, this.content, e);
653
+ return new H(this.ordered, this.content, e);
654
654
  }
655
655
  _localEquals(e) {
656
656
  return this.ordered === e.ordered;
657
657
  }
658
658
  }
659
- class H extends ee {
659
+ class $ extends ee {
660
660
  constructor(e, t, s, i) {
661
661
  super(), this.marker = e, this.content = t, this.checked = s, this.leadingTrivia = i;
662
662
  }
@@ -671,7 +671,7 @@ class H extends ee {
671
671
  return !/[ \t]$/.test(this.marker.content) && this.blocks.length === 0;
672
672
  }
673
673
  mapChildren(e) {
674
- return new H(
674
+ return new $(
675
675
  ue(e, this.marker),
676
676
  B(e, this.content),
677
677
  this.checked,
@@ -679,7 +679,7 @@ class H extends ee {
679
679
  );
680
680
  }
681
681
  withLeadingTrivia(e) {
682
- return new H(this.marker, this.content, this.checked, e);
682
+ return new $(this.marker, this.content, this.checked, e);
683
683
  }
684
684
  _localEquals(e) {
685
685
  return this.checked === e.checked;
@@ -755,7 +755,7 @@ class wn extends ee {
755
755
  }
756
756
  }
757
757
  function bn(n) {
758
- return n instanceof ye || n instanceof ie || n instanceof Ie || n instanceof Ne || n instanceof ae || n instanceof Se || n instanceof xe || n instanceof j || n instanceof ve || n instanceof $ || n instanceof Ae || n instanceof ge;
758
+ return n instanceof ye || n instanceof ie || n instanceof Ie || n instanceof Ne || n instanceof ae || n instanceof Se || n instanceof xe || n instanceof j || n instanceof ve || n instanceof H || n instanceof Ae || n instanceof ge;
759
759
  }
760
760
  function Y(n, e) {
761
761
  if (n.id === e.id)
@@ -803,7 +803,7 @@ function or(n, e) {
803
803
  n.constructs.text[91] = s.map((i) => i.name !== "tasklistCheck" ? i : {
804
804
  ...i,
805
805
  tokenize(o, r, c) {
806
- const a = e.slice(this.now().offset), l = /^\[\](?=[ \t\r\n])/.test(a), d = /^\[[ \txX]?\](?:[ \t]+(?:\r\n?|\n|$)|\r\n?|\n)/.test(a);
806
+ const a = e.slice(this.now().offset), l = /^\[\](?=[ \t\r\n]|$)/.test(a), d = /^\[[ \txX]?\][ \t]*(?:\r\n?|\n|$)/.test(a);
807
807
  let u = !1, h = !1;
808
808
  const f = i.tokenize.call(this, d || l ? {
809
809
  ...o,
@@ -931,13 +931,13 @@ function zn(n) {
931
931
  return q;
932
932
  switch (u.add(h), h) {
933
933
  case "src":
934
- if (f === void 0 || (o = $n(f), lr(o)))
934
+ if (f === void 0 || (o = Hn(f), lr(o)))
935
935
  return q;
936
936
  break;
937
937
  case "title":
938
938
  if (f === void 0)
939
939
  return q;
940
- r = $n(f);
940
+ r = Hn(f);
941
941
  break;
942
942
  case "autoplay":
943
943
  c = !0;
@@ -1007,14 +1007,14 @@ function et(n) {
1007
1007
  return e;
1008
1008
  }
1009
1009
  function yi(n, e) {
1010
- if (n instanceof $) {
1011
- const t = n.content.findIndex((i) => i instanceof H);
1010
+ if (n instanceof H) {
1011
+ const t = n.content.findIndex((i) => i instanceof $);
1012
1012
  if (t < 0)
1013
1013
  return;
1014
1014
  const s = n.content.map((i, o) => o === t ? i.withLeadingTrivia(e) : i);
1015
- return new $(n.ordered, s, n.leadingTrivia);
1015
+ return new H(n.ordered, s, n.leadingTrivia);
1016
1016
  }
1017
- if (n instanceof H || n instanceof te)
1017
+ if (n instanceof $ || n instanceof te)
1018
1018
  return n.withLeadingTrivia(e);
1019
1019
  }
1020
1020
  function hr(n) {
@@ -1113,20 +1113,20 @@ function Ue(n, e) {
1113
1113
  }
1114
1114
  case "list": {
1115
1115
  const t = n;
1116
- return new $(t.ordered, At(t.content, e), t.leadingTrivia);
1116
+ return new H(t.ordered, At(t.content, e), t.leadingTrivia);
1117
1117
  }
1118
1118
  case "listItem": {
1119
1119
  const t = n, s = t.content.length === 0 ? /^[ \t]+/.exec(e.content)?.[0] : void 0;
1120
1120
  if (s) {
1121
1121
  const i = e.content.slice(s.length);
1122
- return new H(
1122
+ return new $(
1123
1123
  new E("listItemMarker", t.marker.content + s),
1124
1124
  i ? [new S(i, e.glueKind)] : [],
1125
1125
  t.checked,
1126
1126
  t.leadingTrivia
1127
1127
  );
1128
1128
  }
1129
- return new H(t.marker, At(t.content, e), t.checked, t.leadingTrivia);
1129
+ return new $(t.marker, At(t.content, e), t.checked, t.leadingTrivia);
1130
1130
  }
1131
1131
  default:
1132
1132
  return;
@@ -1146,9 +1146,9 @@ function fr(n) {
1146
1146
  function En(n, e = !1) {
1147
1147
  if (n instanceof ie)
1148
1148
  return e;
1149
- if (n instanceof $ || n instanceof H || n instanceof ve) {
1149
+ if (n instanceof H || n instanceof $ || n instanceof ve) {
1150
1150
  const t = n.content.at(-1);
1151
- return t !== void 0 && En(t, e || n instanceof $ || n instanceof H);
1151
+ return t !== void 0 && En(t, e || n instanceof H || n instanceof $);
1152
1152
  }
1153
1153
  return !1;
1154
1154
  }
@@ -1211,7 +1211,7 @@ class mr {
1211
1211
  const s = et(e.build(this._source.length)), i = s.at(-1), o = s.at(-2), r = i instanceof S && /^[\r\n \t]*$/.test(i.content) ? /^(?:\r\n|\r|\n)[ \t]*/.exec(i.content)?.[0] : void 0;
1212
1212
  if (this._options?.preserveTrailingListContinuation && i instanceof S && r && o && En(o)) {
1213
1213
  const l = Ei(o, r);
1214
- if (l instanceof $ || l instanceof ve) {
1214
+ if (l instanceof H || l instanceof ve) {
1215
1215
  const d = i.content.slice(r.length);
1216
1216
  s.splice(s.length - 2, 2, l, ...d ? [new S(d, i.glueKind)] : []);
1217
1217
  }
@@ -1513,7 +1513,7 @@ class mr {
1513
1513
  if (o === void 0 || r === void 0 || a === void 0)
1514
1514
  return;
1515
1515
  const f = new E("listItemMarker", this._source.substring(r, c)), m = d ?? c, p = a.build(m - c);
1516
- i.add(new H(f, this._blockGaps(et(p)), l), o);
1516
+ i.add(new $(f, this._blockGaps(et(p)), l), o);
1517
1517
  };
1518
1518
  for (; this._notExit(e); ) {
1519
1519
  const f = this._events[this._idx];
@@ -1536,7 +1536,7 @@ class mr {
1536
1536
  }
1537
1537
  u();
1538
1538
  const h = this._consume("exit", e);
1539
- return new $(t, this._blockGaps(et(i.build(h.endOffset - s.startOffset))));
1539
+ return new H(t, this._blockGaps(et(i.build(h.endOffset - s.startOffset))));
1540
1540
  }
1541
1541
  _parseTable() {
1542
1542
  const e = this._consume("enter", "table"), t = new D(e.startOffset, this._source);
@@ -1813,7 +1813,7 @@ class mr {
1813
1813
  t.add(new E(a ? "closeParen" : "openParen", this._source.substring(l.startOffset, l.endOffset)), l.startOffset), a = !0;
1814
1814
  else if (l.type === "enter" && l.tokenType === "resourceDestinationString") {
1815
1815
  const d = this._source.substring(l.startOffset, l.endOffset);
1816
- i = $o(d), t.add(new E("url", d), l.startOffset);
1816
+ i = Ho(d), t.add(new E("url", d), l.startOffset);
1817
1817
  }
1818
1818
  this._idx++;
1819
1819
  }
@@ -1998,13 +1998,13 @@ function yr(n, e, t = 0) {
1998
1998
  }
1999
1999
  function qn(n) {
2000
2000
  const e = {};
2001
- return n instanceof ye ? e.level = String(n.level) : n instanceof $ ? e.ordered = String(n.ordered) : n instanceof ae ? n.language && (e.language = n.language) : n instanceof Ce ? e.url = n.url : n instanceof Qe ? (e.alt = n.alt, e.url = n.url) : n instanceof j ? (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 H ? n.checked !== void 0 && (e.checked = String(n.checked)) : n instanceof ge ? e.token = n.tokenType : n instanceof S && n.glueKind && (e.kind = n.glueKind), Object.entries(e).map(([t, s]) => ` ${t}="${Si(s)}"`).join("");
2001
+ return n instanceof ye ? e.level = String(n.level) : n instanceof H ? e.ordered = String(n.ordered) : n instanceof ae ? n.language && (e.language = n.language) : n instanceof Ce ? e.url = n.url : n instanceof Qe ? (e.alt = n.alt, e.url = n.url) : n instanceof j ? (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 ge ? e.token = n.tokenType : n instanceof S && n.glueKind && (e.kind = n.glueKind), Object.entries(e).map(([t, s]) => ` ${t}="${Si(s)}"`).join("");
2002
2002
  }
2003
2003
  function Si(n) {
2004
2004
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
2005
2005
  }
2006
2006
  function Er(n) {
2007
- return n instanceof Oe ? `text ${JSON.stringify(n.content)}` : n instanceof S ? `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 ye ? `heading(level=${n.level})` : n instanceof $ ? `list(ordered=${n.ordered})` : n instanceof H ? n.checked === void 0 ? "listItem" : `listItem(checked=${n.checked})` : n instanceof ae ? `codeBlock(language=${JSON.stringify(n.language)})` : n instanceof Se ? "mathBlock" : n instanceof Ce ? `link(url=${JSON.stringify(n.url)})` : n instanceof Qe ? `image(alt=${JSON.stringify(n.alt)}, url=${JSON.stringify(n.url)})` : n instanceof j ? `video(src=${JSON.stringify(n.attributes.src)})` : n.kind;
2007
+ return n instanceof Oe ? `text ${JSON.stringify(n.content)}` : n instanceof S ? `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 ye ? `heading(level=${n.level})` : n instanceof H ? `list(ordered=${n.ordered})` : n instanceof $ ? n.checked === void 0 ? "listItem" : `listItem(checked=${n.checked})` : n instanceof ae ? `codeBlock(language=${JSON.stringify(n.language)})` : n instanceof Se ? "mathBlock" : n instanceof Ce ? `link(url=${JSON.stringify(n.url)})` : n instanceof Qe ? `image(alt=${JSON.stringify(n.alt)}, url=${JSON.stringify(n.url)})` : n instanceof j ? `video(src=${JSON.stringify(n.attributes.src)})` : n.kind;
2008
2008
  }
2009
2009
  const Un = /* @__PURE__ */ new WeakMap();
2010
2010
  let xr = 0;
@@ -2791,7 +2791,7 @@ function Wr(n, e, t) {
2791
2791
  const _ = g.getClientRects();
2792
2792
  if (_.length === 0)
2793
2793
  return;
2794
- const k = Hr(Array.from(_, (b) => t.toLocalRect(b))), w = Kr(p.parentElement);
2794
+ const k = $r(Array.from(_, (b) => t.toLocalRect(b))), w = Kr(p.parentElement);
2795
2795
  if (f.sourceLength === 0) {
2796
2796
  s.push(be.visualLineAnchor(
2797
2797
  m,
@@ -2806,7 +2806,7 @@ function Wr(n, e, t) {
2806
2806
  { textNode: p, textNodeStart: 0, coordinateSpace: e }
2807
2807
  ));
2808
2808
  else {
2809
- const b = $r(p, k, t);
2809
+ const b = Hr(p, k, t);
2810
2810
  for (let C = 0; C < k.length; C++) {
2811
2811
  const A = C === 0 ? 0 : b[C - 1], ne = C < b.length ? b[C] : p.length;
2812
2812
  s.push(new be(
@@ -2855,7 +2855,7 @@ function Mi(n, e, t, s) {
2855
2855
  for (const o of e.children)
2856
2856
  Mi(n, o, i, s), i += o.sourceLength;
2857
2857
  }
2858
- function Hr(n) {
2858
+ function $r(n) {
2859
2859
  const e = [];
2860
2860
  for (const t of n) {
2861
2861
  const s = e[e.length - 1];
@@ -2875,7 +2875,7 @@ function Hr(n) {
2875
2875
  function Oi(n, e) {
2876
2876
  return Math.min(n.bottom, e.bottom) - Math.max(n.top, e.top) > Math.min(n.height, e.height) / 2;
2877
2877
  }
2878
- function $r(n, e, t) {
2878
+ function Hr(n, e, t) {
2879
2879
  const s = [], i = document.createRange();
2880
2880
  for (let o = 0; o < e.length - 1; o++) {
2881
2881
  const r = e[o + 1].y;
@@ -3009,7 +3009,7 @@ function Gr(n) {
3009
3009
  }
3010
3010
  function Ii(n, e, t) {
3011
3011
  for (const s of n.children)
3012
- s instanceof j ? t.set(s, e) : (s instanceof ve || s instanceof $ || s instanceof H) && Ii(s, e, t);
3012
+ s instanceof j ? t.set(s, e) : (s instanceof ve || s instanceof H || s instanceof $) && Ii(s, e, t);
3013
3013
  }
3014
3014
  function Xr(n, e, t) {
3015
3015
  const s = [];
@@ -3417,7 +3417,7 @@ const Ye = {
3417
3417
  };
3418
3418
  if (e.active >= n.text.length)
3419
3419
  return;
3420
- const t = Ho(n.text, e.active, n.wordNavigationConfig), s = new v(e.active, t), i = St(n, s);
3420
+ const t = $o(n.text, e.active, n.wordNavigationConfig), s = new v(e.active, t), i = St(n, s);
3421
3421
  if (!i.isEmpty)
3422
3422
  return {
3423
3423
  edit: i,
@@ -3598,7 +3598,7 @@ function yc(n = Ye) {
3598
3598
  selection: y.collapsed(s.start + m.length)
3599
3599
  };
3600
3600
  }
3601
- const u = $i(e.text, s), h = u.map((m) => _e.insert(m, Pc(n))), f = new T(h);
3601
+ const u = Hi(e.text, s), h = u.map((m) => _e.insert(m, Pc(n))), f = new T(h);
3602
3602
  return {
3603
3603
  edit: f,
3604
3604
  selection: Wc(f, t, new Set(u))
@@ -3626,7 +3626,7 @@ function Fi(n = Ye) {
3626
3626
  }
3627
3627
  }
3628
3628
  const t = [];
3629
- for (const i of $i(e.text, e.selection.range)) {
3629
+ for (const i of Hi(e.text, e.selection.range)) {
3630
3630
  const o = Dc(e.text, i), r = e.text.slice(i, o), c = zi(r, n);
3631
3631
  c !== r && t.push(_e.replace(
3632
3632
  new v(i, o),
@@ -3772,12 +3772,12 @@ function Mc(n, e) {
3772
3772
  return e.htmlComment?.kind !== "complete" ? de(n) : Ve(n) ?? de(n);
3773
3773
  }
3774
3774
  function ut(n, e) {
3775
- return e + n.length - Hc(n);
3775
+ return e + n.length - $c(n);
3776
3776
  }
3777
3777
  function Oc(n) {
3778
3778
  const e = n.selection, t = Wi(n.text, e.active), s = t.prefix ?? "> ";
3779
3779
  if (t.content.slice(s.length).trim() === "")
3780
- return Ve(n) ?? Hi(n, t.start, t.endExclusive);
3780
+ return Ve(n) ?? $i(n, t.start, t.endExclusive);
3781
3781
  const o = `
3782
3782
  ` + s.replace(/\s*$/, " ");
3783
3783
  return Ln(e, o);
@@ -3824,13 +3824,13 @@ function es(n) {
3824
3824
  return de(n);
3825
3825
  if (Nc(n, s, o)) {
3826
3826
  const c = Fi()(n);
3827
- return c ? { kind: "edit", edit: c.edit, selection: c.selection } : Hi(n, o, o + s.length);
3827
+ return c ? { kind: "edit", edit: c.edit, selection: c.selection } : $i(n, o, o + s.length);
3828
3828
  }
3829
3829
  const r = `
3830
3830
  ` + Ic(n, i, s);
3831
3831
  return Ln(e, r);
3832
3832
  }
3833
- function Hi(n, e, t) {
3833
+ function $i(n, e, t) {
3834
3834
  const s = e > 0 ? n.text.lastIndexOf(`
3835
3835
  `, e - 1) : -1;
3836
3836
  return s >= 0 ? {
@@ -3862,7 +3862,7 @@ function Nc(n, e, t) {
3862
3862
  s + e.marker.length,
3863
3863
  t + e.length
3864
3864
  );
3865
- return e.checked === void 0 && i.startsWith("[]") ? !1 : i.trim().length === 0 || /^\[[ xX]?\](?=[ \t\r\n])[ \t\r\n]*$/.test(i);
3865
+ return e.checked === void 0 && i.startsWith("[]") ? !1 : i.trim().length === 0 || (e.checked !== void 0 ? /^\[[ \txX]?\][ \t\r\n]*$/ : /^\[[ xX]?\](?=[ \t\r\n])[ \t\r\n]*$/).test(i);
3866
3866
  }
3867
3867
  function Ln(n, e) {
3868
3868
  return {
@@ -3885,7 +3885,7 @@ function ts(n, e) {
3885
3885
  `, e);
3886
3886
  return t === -1 ? n.length : t;
3887
3887
  }
3888
- function $i(n, e) {
3888
+ function Hi(n, e) {
3889
3889
  const t = [Q(n, e.start)], s = e.endExclusive > e.start && n[e.endExclusive - 1] === `
3890
3890
  ` ? e.endExclusive - 1 : e.endExclusive;
3891
3891
  let i = n.indexOf(`
@@ -3929,10 +3929,10 @@ function Dc(n, e) {
3929
3929
  }
3930
3930
  function Tn(n, e, t) {
3931
3931
  const s = (o, r, c, a) => {
3932
- const l = o instanceof H && c !== void 0 && a !== void 0 ? { list: c, item: o, index: a } : void 0;
3932
+ const l = o instanceof $ && c !== void 0 && a !== void 0 ? { list: c, item: o, index: a } : void 0;
3933
3933
  let d = r, u;
3934
3934
  for (const h of o.children) {
3935
- const f = d + h.length, m = o instanceof $ && h instanceof H ? o : c, p = o instanceof $ && h instanceof H ? o.items.indexOf(h) : a;
3935
+ const f = d + h.length, m = o instanceof H && h instanceof $ ? o : c, p = o instanceof H && h instanceof $ ? o.items.indexOf(h) : a;
3936
3936
  if (d <= t && t < f)
3937
3937
  return s(h, d, m, p) ?? l;
3938
3938
  f === t && (u = s(h, d, m, p) ?? l), d = f;
@@ -3949,7 +3949,7 @@ function Tn(n, e, t) {
3949
3949
  function Ui(n, e, t) {
3950
3950
  let s;
3951
3951
  const i = (o) => {
3952
- if (o instanceof $)
3952
+ if (o instanceof H)
3953
3953
  for (let r = 0; r < o.items.length; r++) {
3954
3954
  const c = o.items[r], a = Y(n, c.marker);
3955
3955
  a !== void 0 && Q(e, a) === Q(e, t) && (s = { list: o, item: c, index: r });
@@ -4029,14 +4029,14 @@ function Mn(n, e) {
4029
4029
  t += s.length;
4030
4030
  }
4031
4031
  }
4032
- function Hc(n) {
4032
+ function $c(n) {
4033
4033
  const e = n.children;
4034
4034
  let t = 0;
4035
4035
  for (let s = e.length - 1; s >= 0 && e[s] instanceof S; s--)
4036
4036
  t += e[s].length;
4037
4037
  return t;
4038
4038
  }
4039
- const $c = (n) => Qi(n, !1), Kc = (n) => Qi(n, !0), zc = (n) => ji(n, !1), qc = (n) => ji(n, !0), Uc = (n) => {
4039
+ const Hc = (n) => Qi(n, !1), Kc = (n) => Qi(n, !0), zc = (n) => ji(n, !1), qc = (n) => ji(n, !0), Uc = (n) => {
4040
4040
  if (n.text.length === 0)
4041
4041
  return;
4042
4042
  const e = Tt(n), t = n.selection.active - Pe(n.text, n.selection.active);
@@ -5954,13 +5954,13 @@ class Wa {
5954
5954
  }
5955
5955
  kind = "image";
5956
5956
  }
5957
- class Ha {
5957
+ class $a {
5958
5958
  constructor(e, t, s, i, o = !1, r = i - 1) {
5959
5959
  this.ast = e, this.isActive = t, this.content = s, this.level = i, this.isRunning = o, this.sourceIndentation = r;
5960
5960
  }
5961
5961
  kind = "listItem";
5962
5962
  }
5963
- class $a {
5963
+ class Ha {
5964
5964
  constructor(e, t, s) {
5965
5965
  this.ast = e, this.isDelimiter = t, this.content = s;
5966
5966
  }
@@ -6075,7 +6075,7 @@ function fo(n, e, t, s, i) {
6075
6075
  return new lo(n, a, l);
6076
6076
  }
6077
6077
  function an(n, e, t) {
6078
- return He(n, e, t);
6078
+ return $e(n, e, t);
6079
6079
  }
6080
6080
  function Qa(n, e, t, s = !1) {
6081
6081
  return mo(n, e, s, t);
@@ -6187,7 +6187,7 @@ function _o(n) {
6187
6187
  return;
6188
6188
  }
6189
6189
  }
6190
- function He(n, e, t, s) {
6190
+ function $e(n, e, t, s) {
6191
6191
  const i = n;
6192
6192
  switch (i.kind) {
6193
6193
  case "text":
@@ -6334,7 +6334,7 @@ function V(n, e, t, s = !1) {
6334
6334
  const a = r.kind === "text" ? {
6335
6335
  left: c > 0 && Is(n[c - 1], "end"),
6336
6336
  right: c < n.length - 1 && Is(n[c + 1], "start")
6337
- } : void 0, l = s && e.selectionInNode ? { ...e, selectionInNode: e.selectionInNode.delta(-o) } : e, d = He(r, l, i?.get(r), a);
6337
+ } : void 0, l = s && e.selectionInNode ? { ...e, selectionInNode: e.selectionInNode.delta(-o) } : e, d = $e(r, l, i?.get(r), a);
6338
6338
  return o += r.length, d;
6339
6339
  });
6340
6340
  }
@@ -6395,7 +6395,7 @@ function sl(n, e, t) {
6395
6395
  };
6396
6396
  a.push(O(s?.get(h), vo(h, m, s?.get(h), c))), l = h;
6397
6397
  } else
6398
- a.push(He(u, e, s?.get(u)));
6398
+ a.push($e(u, e, s?.get(u)));
6399
6399
  d += u.length;
6400
6400
  }
6401
6401
  return new Ia(n, a);
@@ -6409,9 +6409,9 @@ function vo(n, e, t, s = !1) {
6409
6409
  let m = 0;
6410
6410
  for (const p of n.children) {
6411
6411
  const g = h.selectionInNode ? { ...h, selectionInNode: h.selectionInNode.delta(-m) } : h;
6412
- f.push(He(p, g, i?.get(p))), m += p.length;
6412
+ f.push($e(p, g, i?.get(p))), m += p.length;
6413
6413
  }
6414
- return new Ha(n, e.showMarkup, f, e.listLevel ?? 1, u, r);
6414
+ return new $a(n, e.showMarkup, f, e.listLevel ?? 1, u, r);
6415
6415
  }
6416
6416
  function ko(n, e, t) {
6417
6417
  const s = n.leadingTrivia?.glueKind === "indent" ? n.leadingTrivia.length : 0;
@@ -6454,7 +6454,7 @@ function ol(n, e, t) {
6454
6454
  };
6455
6455
  c.push(O(s?.get(d), wo(d, h, u, s?.get(d))));
6456
6456
  } else
6457
- c.push(He(l, e, s?.get(l)));
6457
+ c.push($e(l, e, s?.get(l)));
6458
6458
  a += l.length;
6459
6459
  }
6460
6460
  return new Na(n, c);
@@ -6467,10 +6467,10 @@ function wo(n, e, t, s) {
6467
6467
  const u = d, h = t ? o : r.has(n.cells.indexOf(u)), f = h && e.selectionInNode ? e.selectionInNode.delta(-l) : void 0;
6468
6468
  a.push(bo(u, h, o, f, i?.get(u)));
6469
6469
  } else
6470
- a.push(He(d, e, i?.get(d)));
6470
+ a.push($e(d, e, i?.get(d)));
6471
6471
  l += d.length;
6472
6472
  }
6473
- return new $a(n, t, a);
6473
+ return new Ha(n, t, a);
6474
6474
  }
6475
6475
  function bo(n, e, t, s, i) {
6476
6476
  const o = { showMarkup: e, showTableGlue: t, selectionInNode: s };
@@ -6565,7 +6565,7 @@ function Ot(n, e, t = Number.POSITIVE_INFINITY) {
6565
6565
  }
6566
6566
  return o;
6567
6567
  }
6568
- function Ht(n, e) {
6568
+ function $t(n, e) {
6569
6569
  return Ot(n, e).map((t) => t.range);
6570
6570
  }
6571
6571
  function dl(n, e) {
@@ -6599,14 +6599,14 @@ class hl extends W {
6599
6599
  }
6600
6600
  _repaint(e) {
6601
6601
  const t = [], s = [];
6602
- e.inserted && t.push(...Ht(e.node, e.inserted));
6602
+ e.inserted && t.push(...$t(e.node, e.inserted));
6603
6603
  const i = (o) => {
6604
6604
  if (o instanceof rn)
6605
- o.whole || s.push(...Ht(o.sideNode, o.deletedRanges.map((r) => r.range)));
6605
+ o.whole || s.push(...$t(o.sideNode, o.deletedRanges.map((r) => r.range)));
6606
6606
  else if (o instanceof on)
6607
6607
  for (const r of o.sides)
6608
6608
  for (const c of r.ranges) {
6609
- const a = Ht(r.node, [c.range]);
6609
+ const a = $t(r.node, [c.range]);
6610
6610
  (c.kind === "inserted" ? t : s).push(...a);
6611
6611
  }
6612
6612
  for (const r of o.children)
@@ -6706,14 +6706,14 @@ function yo(n, e, t) {
6706
6706
  if (w <= b)
6707
6707
  continue;
6708
6708
  const C = d.get(f), A = l.get(m);
6709
- if (C === void 0 && $t(e, f) || A === void 0 && $t(e, m))
6709
+ if (C === void 0 && Ht(e, f) || A === void 0 && Ht(e, m))
6710
6710
  continue;
6711
6711
  const ne = C !== void 0 ? a[C] : { left: _.left, right: _.right }, X = A !== void 0 ? a[A] : { left: k.left, right: k.right }, z = Math.max(ne.left, X.left), Le = Math.min(ne.right, X.right);
6712
6712
  Le <= z || c.push(i(z, b, Le, w));
6713
6713
  }
6714
6714
  for (const h of t) {
6715
6715
  const f = v.ofStartAndLength(h.absoluteStart, h.block.length);
6716
- s.intersects(f) && ($t(e, h) || c.push(h.rect));
6716
+ s.intersects(f) && (Ht(e, h) || c.push(h.rect));
6717
6717
  }
6718
6718
  return c;
6719
6719
  }
@@ -6725,7 +6725,7 @@ function vt(n) {
6725
6725
  s.sourceStart < e && (e = s.sourceStart), s.sourceEndExclusive > t && (t = s.sourceEndExclusive);
6726
6726
  return v.fromTo(e, t);
6727
6727
  }
6728
- function $t(n, e) {
6728
+ function Ht(n, e) {
6729
6729
  const t = v.ofStartAndLength(e.absoluteStart, e.block.length);
6730
6730
  for (const s of n.sourceLines) {
6731
6731
  const i = vt(s);
@@ -6994,7 +6994,7 @@ function Ml(n) {
6994
6994
  function Ol(n) {
6995
6995
  const t = n.ownerDocument.defaultView ?? window, s = [];
6996
6996
  for (let i = n.parentElement; i; i = i.parentElement) {
6997
- const o = t.getComputedStyle(i), r = Hs(o.overflowX) && i.scrollWidth > i.clientWidth, c = Hs(o.overflowY) && i.scrollHeight > i.clientHeight;
6997
+ const o = t.getComputedStyle(i), r = $s(o.overflowX) && i.scrollWidth > i.clientWidth, c = $s(o.overflowY) && i.scrollHeight > i.clientHeight;
6998
6998
  (r || c) && s.push(i);
6999
6999
  }
7000
7000
  return s;
@@ -7005,14 +7005,14 @@ function Vs(n, e) {
7005
7005
  function Ws(n) {
7006
7006
  return n === "auto" || n === "scroll" || n === "hidden" || n === "clip";
7007
7007
  }
7008
- function Hs(n) {
7008
+ function $s(n) {
7009
7009
  return n === "auto" || n === "scroll" || n === "hidden";
7010
7010
  }
7011
- const Rl = 900, $e = 2, Oo = 5, Ee = 16;
7011
+ const Rl = 900, He = 2, Oo = 5, Ee = 16;
7012
7012
  class eh extends W {
7013
7013
  constructor(e, t) {
7014
7014
  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);
7015
- const s = this._options?.limitedWidth ?? Hn(Rl);
7015
+ const s = this._options?.limitedWidth ?? $n(Rl);
7016
7016
  this._register(R((h) => {
7017
7017
  const f = s.read(h);
7018
7018
  this._contentContainer.style.maxWidth = f === void 0 ? "" : `${f}px`;
@@ -7020,7 +7020,7 @@ class eh extends W {
7020
7020
  let i = -1, o = -1, r = -1, c = 0;
7021
7021
  this._resizeObserver = new ResizeObserver(() => {
7022
7022
  c || (c = requestAnimationFrame(() => {
7023
- c = 0, this.element.classList.toggle("md-editor-narrow", this.element.clientWidth <= 320);
7023
+ c = 0, this.element.classList.toggle("md-editor-narrow", this.element.clientWidth <= 320), this.element.classList.toggle("md-editor-medium-margins", this.element.clientWidth > 600);
7024
7024
  const h = getComputedStyle(this._contentContainer), f = this._contentContainer.clientWidth - parseFloat(h.paddingLeft) - parseFloat(h.paddingRight);
7025
7025
  this.element.classList.toggle("md-find-compact", f <= 400);
7026
7026
  const m = this._document.get();
@@ -7071,7 +7071,7 @@ class eh extends W {
7071
7071
  selectionStart: 0,
7072
7072
  selectionEnd: 0
7073
7073
  });
7074
- this.editContext = this._options?.textInput?.context ?? u, this._nativeEditContext = this._options?.textInput?.nativeContext ?? Hn(u), this._register(R((h) => {
7074
+ this.editContext = this._options?.textInput?.context ?? u, this._nativeEditContext = this._options?.textInput?.nativeContext ?? $n(u), this._register(R((h) => {
7075
7075
  this._nativeEditContext.read(h), this._syncEditContextAttachment();
7076
7076
  })), this._register(R(this._renderAutorun)), this._setupModifierTracking(), this._setupFocusTracking(), this._setupCaretScrollPadding(), this._register(R((h) => {
7077
7077
  const f = h.readObservable(this._model.selection)?.range;
@@ -7616,45 +7616,48 @@ class eh extends W {
7616
7616
  * is not read here, so there is no feedback loop into the render autorun.
7617
7617
  */
7618
7618
  _publishMeasurements(e) {
7619
+ const t = parseFloat(getComputedStyle(this._contentContainer).paddingLeft);
7620
+ for (const c of e.contentDomNode.querySelectorAll(":scope > .md-heading > .md-marker:first-child"))
7621
+ c.offsetWidth !== 0 && c.style.setProperty("--md-heading-marker-scale", String(Math.min(0.85, Math.max(0, t - 2) / c.offsetWidth)));
7619
7622
  Zi(e.contentDomNode);
7620
- const t = this.coordinateSpace.capture(), s = [];
7621
- for (const r of e.blocks) {
7622
- const c = t.toLocalRect(r.node.element.getBoundingClientRect());
7623
- r.node.recordMeasuredHeight(c.height);
7624
- const a = r.node.scrollElement;
7625
- let l;
7626
- const d = getComputedStyle(a).overflowX;
7627
- if ((d === "auto" || d === "scroll" || d === "hidden" || d === "clip") && a.scrollWidth > a.clientWidth + 1) {
7628
- const m = t.toLocalRect(a.getBoundingClientRect()).left + a.clientLeft;
7629
- l = { left: m, right: m + a.clientWidth };
7623
+ const s = this.coordinateSpace.capture(), i = [];
7624
+ for (const c of e.blocks) {
7625
+ const a = s.toLocalRect(c.node.element.getBoundingClientRect());
7626
+ c.node.recordMeasuredHeight(a.height);
7627
+ const l = c.node.scrollElement;
7628
+ let d;
7629
+ const u = getComputedStyle(l).overflowX;
7630
+ if ((u === "auto" || u === "scroll" || u === "hidden" || u === "clip") && l.scrollWidth > l.clientWidth + 1) {
7631
+ const p = s.toLocalRect(l.getBoundingClientRect()).left + l.clientLeft;
7632
+ d = { left: p, right: p + l.clientWidth };
7630
7633
  }
7631
- const h = je.measure([{
7632
- absoluteStart: r.absoluteStart,
7633
- viewNode: r.node
7634
- }], this.coordinateSpace, t);
7635
- s.push({
7636
- block: r.node.block,
7637
- absoluteStart: r.absoluteStart,
7638
- height: c.height,
7639
- rect: c,
7640
- viewportClip: l,
7634
+ const f = je.measure([{
7635
+ absoluteStart: c.absoluteStart,
7636
+ viewNode: c.node
7637
+ }], this.coordinateSpace, s);
7638
+ i.push({
7639
+ block: c.node.block,
7640
+ absoluteStart: c.absoluteStart,
7641
+ height: a.height,
7642
+ rect: a,
7643
+ viewportClip: d,
7641
7644
  isMeasured: !0,
7642
- visualLineMap: h,
7643
- viewNode: r.node
7645
+ visualLineMap: f,
7646
+ viewNode: c.node
7644
7647
  });
7645
7648
  }
7646
- const i = e.pendingParagraph, o = [];
7647
- if (i) {
7648
- const r = t.toLocalRect(i.element.getBoundingClientRect()), c = t.toLocalRect(i.getCaretClientRect());
7649
- o.push({
7650
- afterBlock: i.anchorBlock,
7649
+ const o = e.pendingParagraph, r = [];
7650
+ if (o) {
7651
+ const c = s.toLocalRect(o.element.getBoundingClientRect()), a = s.toLocalRect(o.getCaretClientRect());
7652
+ r.push({
7653
+ afterBlock: o.anchorBlock,
7651
7654
  line: yt.virtual(
7652
- i.cursorLine,
7653
- L.fromPointSize(c.left, r.top, 0, r.height)
7655
+ o.cursorLine,
7656
+ L.fromPointSize(a.left, c.top, 0, c.height)
7654
7657
  )
7655
7658
  });
7656
7659
  }
7657
- this.measuredLayout.setMeasurements(s, o);
7660
+ this.measuredLayout.setMeasurements(i, r);
7658
7661
  }
7659
7662
  /**
7660
7663
  * Paint the diff highlights via the CSS Custom Highlight API: green over the
@@ -7801,7 +7804,7 @@ class eh extends W {
7801
7804
  }
7802
7805
  _isRevealOccluded(e) {
7803
7806
  for (const t of this._activeRevealOcclusions())
7804
- if ($s(e, t))
7807
+ if (Hs(e, t))
7805
7808
  return !0;
7806
7809
  return !1;
7807
7810
  }
@@ -7830,7 +7833,7 @@ class eh extends W {
7830
7833
  );
7831
7834
  let r = s;
7832
7835
  for (const c of this._activeRevealOcclusions())
7833
- $s(o, c) && (r = Math.max(r, c.bottom - e.top));
7836
+ Hs(o, c) && (r = Math.max(r, c.bottom - e.top));
7834
7837
  if (r === s)
7835
7838
  break;
7836
7839
  s = r;
@@ -7867,7 +7870,7 @@ class eh extends W {
7867
7870
  );
7868
7871
  }
7869
7872
  }
7870
- function $s(n, e) {
7873
+ function Hs(n, e) {
7871
7874
  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);
7872
7875
  return t && s;
7873
7876
  }
@@ -7885,7 +7888,7 @@ function Nl(n) {
7885
7888
  function Ks(n, e) {
7886
7889
  return n === e ? e : L.fromPointPoint(
7887
7890
  n.left,
7888
- n.top - $e,
7891
+ n.top - He,
7889
7892
  n.right,
7890
7893
  n.bottom
7891
7894
  );
@@ -7896,10 +7899,10 @@ function zs(n, e, t, s = Ee) {
7896
7899
  n.left + n.width / 2 - (e.left + e.width / 2),
7897
7900
  n.top + n.height / 2 - (e.top + e.height / 2)
7898
7901
  );
7899
- const i = n.left < e.left ? n.left - e.left - $e : n.right > e.right ? n.right - e.right + $e : 0;
7902
+ const i = n.left < e.left ? n.left - e.left - He : n.right > e.right ? n.right - e.right + He : 0;
7900
7903
  if (t === "top")
7901
7904
  return new se(i, n.top - e.top - s);
7902
- const o = n.height > e.height ? n.top - e.top : n.top < e.top ? n.top - e.top - $e : n.bottom > e.bottom ? n.bottom - e.bottom + $e : 0;
7905
+ const o = n.height > e.height ? n.top - e.top : n.top < e.top ? n.top - e.top - He : n.bottom > e.bottom ? n.bottom - e.bottom + He : 0;
7903
7906
  return new se(i, o);
7904
7907
  }
7905
7908
  function zt(n, e, t) {
@@ -7999,7 +8002,7 @@ class Vl extends W {
7999
8002
  }
8000
8003
  const t = this._view.coordinateSpace.capture(), s = Lo(this._view.overlayContainer), i = t.toLocalRect(s), o = Wl(
8001
8004
  this._view.measuredLayout.visualLineMap.get().sourceLines.flatMap((u) => Math.max(u.rect.top, i.top) >= Math.min(u.rect.bottom, i.bottom) ? [] : u.runs.flatMap((h) => {
8002
- const f = Hl(h, u.rect, i);
8005
+ const f = $l(h, u.rect, i);
8003
8006
  return f ? [f] : [];
8004
8007
  }))
8005
8008
  ), r = Xs(
@@ -8123,7 +8126,7 @@ function Wl(n) {
8123
8126
  }
8124
8127
  return t;
8125
8128
  }
8126
- function Hl(n, e, t) {
8129
+ function $l(n, e, t) {
8127
8130
  if (n.sourceRange.isEmpty)
8128
8131
  return t.left <= n.rect.left && n.rect.left <= t.right ? n.sourceRange : void 0;
8129
8132
  let s = n.sourceStart;
@@ -8160,7 +8163,7 @@ function Ys(n, e, t) {
8160
8163
  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);
8161
8164
  return s < i && o < r ? L.fromPointPoint(s, o, i, r) : void 0;
8162
8165
  }
8163
- const $l = 19999;
8166
+ const Hl = 19999;
8164
8167
  class kt {
8165
8168
  constructor(e, t, s, i, o) {
8166
8169
  this._source = e, this._flags = t, this._wholeWord = s, this._wordSeparators = i, this.isEmpty = o;
@@ -8185,7 +8188,7 @@ class kt {
8185
8188
  pattern: new kt(t, s, e.wholeWord, e.wordSeparators, !1)
8186
8189
  };
8187
8190
  }
8188
- findMatches(e, t, s = $l) {
8191
+ findMatches(e, t, s = Hl) {
8189
8192
  if (this.isEmpty || s <= 0)
8190
8193
  return { matches: [], isCapped: !1 };
8191
8194
  const i = [];
@@ -9273,7 +9276,7 @@ class oh extends W {
9273
9276
  this._executeEditCommand(kc);
9274
9277
  return;
9275
9278
  case "copyLinesUp":
9276
- this._executeEditCommand($c);
9279
+ this._executeEditCommand(Hc);
9277
9280
  return;
9278
9281
  case "copyLinesDown":
9279
9282
  this._executeEditCommand(Kc);
@@ -10568,7 +10571,7 @@ export {
10568
10571
  eh as EditorView,
10569
10572
  gn as EmphasisAstNode,
10570
10573
  Ie as EmptyBlockAstNode,
10571
- $l as FIND_MATCH_LIMIT,
10574
+ Hl as FIND_MATCH_LIMIT,
10572
10575
  Jl as FindController,
10573
10576
  Vl as FindHighlightsView,
10574
10577
  Gl as FindModel,
@@ -10583,8 +10586,8 @@ export {
10583
10586
  Re as LengthEdit,
10584
10587
  mn as LengthReplacement,
10585
10588
  Ce as LinkAstNode,
10586
- $ as ListAstNode,
10587
- H as ListItemAstNode,
10589
+ H as ListAstNode,
10590
+ $ as ListItemAstNode,
10588
10591
  rh as LocalHistoryStrategy,
10589
10592
  br as MarkdownParser,
10590
10593
  E as MarkerAstNode,
@@ -10626,7 +10629,7 @@ export {
10626
10629
  jt as blocksIntersecting,
10627
10630
  un as commands,
10628
10631
  Kc as copyLinesDown,
10629
- $c as copyLinesUp,
10632
+ Hc as copyLinesUp,
10630
10633
  ah as createDefaultMonacoSyntaxHighlighter,
10631
10634
  cc as cursorDocumentEnd,
10632
10635
  rc as cursorDocumentStart,
@@ -10656,7 +10659,7 @@ export {
10656
10659
  Fo as findWordBoundaryLeft,
10657
10660
  Vo as findWordBoundaryRight,
10658
10661
  Wo as findWordDeleteBoundaryLeft,
10659
- Ho as findWordDeleteBoundaryRight,
10662
+ $o as findWordDeleteBoundaryRight,
10660
10663
  yr as getAnnotatedSource,
10661
10664
  Ri as hiddenCursorRanges,
10662
10665
  Cc as insertHardLineBreak,