@one2x/medeo-rte 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -6510,7 +6510,7 @@ class Hh {
|
|
|
6510
6510
|
drawFocusMark(t, e) {
|
|
6511
6511
|
var f;
|
|
6512
6512
|
const n = (f = this.host) == null ? void 0 : f.closest(".mini-editor"), i = n ? getComputedStyle(n).getPropertyValue("--mini-sel-focus-color").trim() : "", r = n ? parseFloat(getComputedStyle(n).getPropertyValue("--mini-sel-focus-width")) : NaN, o = Number.isFinite(r) && r > 0 ? r : 2, { x: a } = e, l = n ? parseFloat(getComputedStyle(n).getPropertyValue("--mini-sel-height")) : NaN, c = this.selectedId ? this.focusGap() : 0, h = jn(e, l, c), { y: u, h: d } = h;
|
|
6513
|
-
t.save(), t.fillStyle = i || "#2b6cff", t.beginPath(), this.focusRounded ? t.roundRect(a, u, o, d, Math.min(o / 2, d / 2)) : t.rect(a, u, o, d), t.fill(), t.beginPath(), t.arc(a + o / 2, u + 3, 3, 0, Math.PI * 2), t.fill(), t.restore();
|
|
6513
|
+
t.save(), t.fillStyle = i || "#2b6cff", t.beginPath(), this.focusRounded ? t.roundRect(a, u, o, d, Math.min(o / 2, d / 2)) : t.rect(a, u, o, d), t.fill(), (n == null ? void 0 : n.dataset.focusMarkDot) !== "hidden" && (t.beginPath(), t.arc(a + o / 2, u + 3, 3, 0, Math.PI * 2), t.fill()), t.restore();
|
|
6514
6514
|
}
|
|
6515
6515
|
drawCaret(t, e, n) {
|
|
6516
6516
|
var g;
|
|
@@ -7346,7 +7346,7 @@ class ld {
|
|
|
7346
7346
|
}
|
|
7347
7347
|
applyChrome() {
|
|
7348
7348
|
var l, c, h, u;
|
|
7349
|
-
this.root.dataset.caret = this.caretIsSolid() ? "solid" : "rainbow", this.root.dataset.surface = this.chrome.surfaceBackground === "transparent" ? "transparent" : "paper", this.root.style.setProperty("--mini-caret-color", this.chrome.caretColor ?? "#09090b"), this.root.style.setProperty(
|
|
7349
|
+
this.root.dataset.focusMarkDot = this.chrome.focusMarkDot === !1 ? "hidden" : "visible", this.root.dataset.caret = this.caretIsSolid() ? "solid" : "rainbow", this.root.dataset.surface = this.chrome.surfaceBackground === "transparent" ? "transparent" : "paper", this.root.style.setProperty("--mini-caret-color", this.chrome.caretColor ?? "#09090b"), this.root.style.setProperty(
|
|
7350
7350
|
"--mini-caret-width",
|
|
7351
7351
|
`${this.chrome.caretWidth ?? 2}px`
|
|
7352
7352
|
), this.root.style.setProperty(
|
|
@@ -8504,14 +8504,14 @@ class ld {
|
|
|
8504
8504
|
}
|
|
8505
8505
|
/** Visual alignment only; keep the document selection and its affinity unchanged. */
|
|
8506
8506
|
alignSelectedFocus(t) {
|
|
8507
|
-
var
|
|
8507
|
+
var d;
|
|
8508
8508
|
if (!(this.chrome.focusMarkBorderGap && this.chrome.focusMarkBorderGap > 0)) return t;
|
|
8509
8509
|
const e = this.armedWholeMark() ?? this.armedEmptyMark(), n = this.slotAtCaret(), i = (e == null ? void 0 : e.id) ?? (n == null ? void 0 : n.id);
|
|
8510
8510
|
if (!i) return t;
|
|
8511
|
-
const r = e && e.start === e.end ? this.markArmedSide ?? "left" : this.sel.focus > this.sel.anchor ? "right" : "left",
|
|
8511
|
+
const r = e && e.start === e.end ? this.markArmedSide ?? "left" : this.sel.focus > this.sel.anchor ? "right" : "left", o = n ? this.layout.images.filter((f) => f.entity.id === i) : this.layout.lines.flatMap((f) => (f.vblocks ?? []).filter((g) => g.id === i)), a = o.filter((f) => t.y < f.y + f.h && t.y + t.h > f.y), l = (f) => r === "left" ? f.x : f.x + f.w, c = a.sort((f, g) => Math.abs(l(f) - t.x) - Math.abs(l(g) - t.x))[0] ?? (n ? o[0] : void 0);
|
|
8512
8512
|
if (!c) return t;
|
|
8513
|
-
const h = (e == null ? void 0 : e.chrome.selectedBorder) ?? ((
|
|
8514
|
-
return $h(
|
|
8513
|
+
const h = n && a.length === 0 ? { ...t, y: c.y, h: c.h } : t, u = (e == null ? void 0 : e.chrome.selectedBorder) ?? ((d = n == null ? void 0 : n.chrome) == null ? void 0 : d.selectedBorder);
|
|
8514
|
+
return $h(h, c, r, this.chrome.focusMarkWidth ?? 2, (u == null ? void 0 : u.width) ?? 1);
|
|
8515
8515
|
}
|
|
8516
8516
|
/**
|
|
8517
8517
|
* 方向键选中 mark 但还没进入:竖线停在进入侧的外侧。
|