@one2x/medeo-rte 2.0.0 → 2.0.1
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
|
@@ -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 但还没进入:竖线停在进入侧的外侧。
|