From b86512f8844d686db3f0b5393106c71d9aedc459 Mon Sep 17 00:00:00 2001 From: antmicrobot Date: Wed, 18 Sep 2024 07:28:32 +0000 Subject: [PATCH] deploy: 7b19c4e9528f410d7aac03587dce1508011f31e5 --- MystEditor.js | 40 ++++++++++++++++++++-------------------- docs/collaboration.html | 2 +- docs/comments.html | 2 +- docs/genindex.html | 2 +- docs/index.html | 2 +- docs/introduction.html | 2 +- docs/mermaid.html | 2 +- docs/rich-links.html | 2 +- docs/topbar.html | 2 +- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/MystEditor.js b/MystEditor.js index ce9d582..650505d 100644 --- a/MystEditor.js +++ b/MystEditor.js @@ -48139,11 +48139,11 @@ const b_t = (t, e) => { }, scroll: (s, a) => { !n || r || (window.requestAnimationFrame(() => { - const o = a.state.doc.lineAt(a.state.selection.main.head).number, l = a.dom.parentElement.getBoundingClientRect(), u = a.lineBlockAtHeight(l.top - a.documentTop), h = a.state.doc.lineAt(u.from).number + 1, f = Math.max(o, h), [d, p] = mT(f, t, e.current); - d && Gce({ + const o = a.state.doc.lineAt(a.state.selection.main.head).number, l = a.dom.parentElement.getBoundingClientRect(), u = a.lineBlockAtHeight(l.top - a.documentTop), h = a.state.doc.lineAt(u.from).number + 1, f = a.lineBlockAtHeight(l.bottom - a.documentTop), d = a.state.doc.lineAt(f.from).number, p = o < h || o > d ? h : o, [g, m] = mT(p, t, e.current); + g && Gce({ view: a, - matchingLine: p, - matchingElem: d, + matchingLine: m, + matchingElem: g, preview: e.current }), r = !1; }), r = !0); @@ -48158,31 +48158,31 @@ function x_t(t, e, r) { }, 200); }, t.onscroll = () => { !i || n || (window.requestAnimationFrame(() => { - const a = r.state.doc.lineAt(r.state.selection.main.head).number, o = r.dom.parentElement.getBoundingClientRect(), l = r.lineBlockAtHeight(o.top - r.documentTop), u = r.state.doc.lineAt(l.from).number + 1; - if (a >= u) { - const [h, f] = mT(a, e, t); - if (h) { - const d = t.getBoundingClientRect(), p = r.lineBlockAt(r.state.doc.line(f).from), m = h.getBoundingClientRect().top, v = p.top - m + d.top + pL; + const a = r.state.doc.lineAt(r.state.selection.main.head).number, o = r.dom.parentElement.getBoundingClientRect(), l = r.lineBlockAtHeight(o.top - r.documentTop), u = r.state.doc.lineAt(l.from).number + 1, h = r.lineBlockAtHeight(o.bottom - o.top + r.dom.parentElement.scrollTop), f = r.state.doc.lineAt(h.from).number - 2; + if (a >= u && a <= f) { + const [d, p] = mT(a, e, t); + if (d) { + const g = t.getBoundingClientRect(), m = r.lineBlockAt(r.state.doc.line(p).from), y = d.getBoundingClientRect().top, b = m.top - y + g.top + pL; r.dom.parentElement.scrollTo({ - top: v, + top: b, behavior: "auto" }); } } else { - let h; - const f = t.getElementsByTagName("*"); - for (const g of f) { - if (g.classList.contains("cm-previewFocus") || !g.hasAttribute("data-line-id")) + let d; + const p = t.getElementsByTagName("*"); + for (const v of p) { + if (v.classList.contains("cm-previewFocus") || !v.hasAttribute("data-line-id")) continue; - if (g.getBoundingClientRect().top - t.getBoundingClientRect().top >= 0) { - h = g; + if (v.getBoundingClientRect().top - t.getBoundingClientRect().top >= 0) { + d = v; break; } } - const d = h.getAttribute("data-line-id"); - let p = rie(e.current, d); - p && r.dom.parentElement.scrollTo({ - top: r.lineBlockAt(r.state.doc.line(p).from).top + pL, + const g = d.getAttribute("data-line-id"); + let m = rie(e.current, g); + m && r.dom.parentElement.scrollTo({ + top: r.lineBlockAt(r.state.doc.line(m).from).top + pL, behavior: "auto" }); } diff --git a/docs/collaboration.html b/docs/collaboration.html index eeed702..0bd766d 100644 --- a/docs/collaboration.html +++ b/docs/collaboration.html @@ -472,7 +472,7 @@

Other Collaborative Featurescee9e4a3 + 7b19c4e9 @ main diff --git a/docs/comments.html b/docs/comments.html index 340b2c9..20521dc 100644 --- a/docs/comments.html +++ b/docs/comments.html @@ -622,7 +622,7 @@

Suggestions - cee9e4a3 + 7b19c4e9 @ main diff --git a/docs/genindex.html b/docs/genindex.html index 90c9608..b8ef634 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -367,7 +367,7 @@ - cee9e4a3 + 7b19c4e9 @ main diff --git a/docs/index.html b/docs/index.html index 689a573..6f3b974 100644 --- a/docs/index.html +++ b/docs/index.html @@ -426,7 +426,7 @@

MyST Editor - User Manual - cee9e4a3 + 7b19c4e9 @ main diff --git a/docs/introduction.html b/docs/introduction.html index eb3533b..bbc2c18 100644 --- a/docs/introduction.html +++ b/docs/introduction.html @@ -426,7 +426,7 @@

Introduction - cee9e4a3 + 7b19c4e9 @ main diff --git a/docs/mermaid.html b/docs/mermaid.html index ae25f1a..3e2293b 100644 --- a/docs/mermaid.html +++ b/docs/mermaid.html @@ -430,7 +430,7 @@

Mermaid Diagramscee9e4a3 + 7b19c4e9 @ main diff --git a/docs/rich-links.html b/docs/rich-links.html index 006184f..d838375 100644 --- a/docs/rich-links.html +++ b/docs/rich-links.html @@ -506,7 +506,7 @@

View Mode Buttonscee9e4a3 + 7b19c4e9 @ main