autumnnote 2.7.0 → 2.7.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/README.md +7 -0
- package/dist/autumnnote.cjs +9 -9
- package/dist/autumnnote.core.es.js +47 -42
- package/dist/autumnnote.core.es.js.map +1 -1
- package/dist/autumnnote.es.js +93 -81
- package/dist/autumnnote.es.js.map +1 -1
- package/dist/autumnnote.min.js +9 -9
- package/dist/autumnnote.umd.js +9 -9
- package/dist/autumnnote.umd.js.map +1 -1
- package/package.json +9 -9
- package/src/js/core/func.js +10 -4
- package/types/index.d.ts +42 -0
package/dist/autumnnote.es.js
CHANGED
|
@@ -36,7 +36,7 @@ function s(e) {
|
|
|
36
36
|
function c(e, t) {
|
|
37
37
|
let n = {};
|
|
38
38
|
for (let t of Object.keys(e)) n[t] = Array.isArray(e[t]) ? [...e[t]] : e[t];
|
|
39
|
-
if (l(e) && l(t)) for (let r of Object.keys(t)) l(t[r]) ?
|
|
39
|
+
if (l(e) && l(t)) for (let r of Object.keys(t)) n[r] = l(t[r]) ? c(l(e[r]) ? e[r] : {}, t[r]) : Array.isArray(t[r]) ? [...t[r]] : t[r];
|
|
40
40
|
return n;
|
|
41
41
|
}
|
|
42
42
|
function l(e) {
|
|
@@ -447,7 +447,7 @@ function et(e) {
|
|
|
447
447
|
let t = e.closest(".an-checklist");
|
|
448
448
|
if (!t) return;
|
|
449
449
|
let n = Array.from(t.children), r = n.indexOf(e), i = n.slice(r + 1), a = document.createElement("p");
|
|
450
|
-
for (let t of e.childNodes) t.nodeType
|
|
450
|
+
for (let t of e.childNodes) (t.nodeType !== 1 || t.tagName !== "INPUT") && a.appendChild(t.cloneNode(!0));
|
|
451
451
|
if (a.innerHTML = a.innerHTML.replaceAll("", ""), (!a.hasChildNodes() || !a.textContent.trim()) && (a.innerHTML = "", a.appendChild(document.createTextNode("\xA0"))), i.length > 0) {
|
|
452
452
|
let e = document.createElement("ul");
|
|
453
453
|
e.className = "an-checklist", i.forEach((t) => e.appendChild(t)), t.parentNode.insertBefore(e, t.nextSibling);
|
|
@@ -580,28 +580,29 @@ function ut() {
|
|
|
580
580
|
let t = e.getRangeAt(0), n = t.commonAncestorContainer;
|
|
581
581
|
n.nodeType === 3 && (n = n.parentElement);
|
|
582
582
|
let r = n?.closest("ul, ol");
|
|
583
|
-
if (r)
|
|
584
|
-
if (r.
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
583
|
+
if (r) {
|
|
584
|
+
if (r.classList.contains("an-checklist")) {
|
|
585
|
+
if (r.parentNode) {
|
|
586
|
+
let t = Array.from(r.children), n = null;
|
|
587
|
+
if (t.forEach((e) => {
|
|
588
|
+
let t = document.createElement("p");
|
|
589
|
+
for (let n of e.childNodes) (n.nodeType !== 1 || n.tagName !== "INPUT") && t.appendChild(n.cloneNode(!0));
|
|
590
|
+
t.innerHTML = t.innerHTML.replaceAll("", "").replaceAll("", ""), (!t.hasChildNodes() || !t.textContent.trim()) && (t.innerHTML = "", t.appendChild(document.createTextNode("\xA0"))), r.before(t), n ||= t;
|
|
591
|
+
}), r.remove(), n) {
|
|
592
|
+
let t = document.createRange();
|
|
593
|
+
t.setStart(n.firstChild || n, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
} else {
|
|
597
|
+
let t = ct(r, "ul");
|
|
598
|
+
t.classList.add("an-checklist"), lt(t);
|
|
599
|
+
let n = t.querySelector("li");
|
|
600
|
+
if (n) {
|
|
591
601
|
let t = document.createRange();
|
|
592
|
-
t.
|
|
602
|
+
t.selectNodeContents(n), t.collapse(!1), e.removeAllRanges(), e.addRange(t);
|
|
593
603
|
}
|
|
594
604
|
}
|
|
595
605
|
} else {
|
|
596
|
-
let t = ct(r, "ul");
|
|
597
|
-
t.classList.add("an-checklist"), lt(t);
|
|
598
|
-
let n = t.querySelector("li");
|
|
599
|
-
if (n) {
|
|
600
|
-
let t = document.createRange();
|
|
601
|
-
t.selectNodeContents(n), t.collapse(!1), e.removeAllRanges(), e.addRange(t);
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
else {
|
|
605
606
|
let r = n?.closest("[contenteditable=\"true\"]");
|
|
606
607
|
if (t.collapsed) {
|
|
607
608
|
let t = /* @__PURE__ */ new Set([
|
|
@@ -996,7 +997,7 @@ var ht = O("bold", "bold", "Bold (Ctrl+B)", () => Fe(), () => document.queryComm
|
|
|
996
997
|
externalAssetReferrerPolicy: "no-referrer",
|
|
997
998
|
markdownPaste: !0,
|
|
998
999
|
historyLimit: 100,
|
|
999
|
-
historyMaxBytes:
|
|
1000
|
+
historyMaxBytes: 10485760,
|
|
1000
1001
|
defaultFontFamily: "Arial",
|
|
1001
1002
|
defaultFontSize: "14px",
|
|
1002
1003
|
fontFamilies: [
|
|
@@ -1041,7 +1042,7 @@ var ht = O("bold", "bold", "Bold (Ctrl+B)", () => Fe(), () => document.queryComm
|
|
|
1041
1042
|
collaborationAdapter: null,
|
|
1042
1043
|
imageProcessor: null,
|
|
1043
1044
|
blockIds: !1,
|
|
1044
|
-
maxPasteSize:
|
|
1045
|
+
maxPasteSize: 5242880,
|
|
1045
1046
|
minImageSize: 20,
|
|
1046
1047
|
bubbleToolbar: !1,
|
|
1047
1048
|
bubbleToolbarItems: [
|
|
@@ -1565,12 +1566,14 @@ function vn(e, { allowIframes: t = !1 } = {}) {
|
|
|
1565
1566
|
t.name === "src" && !xn(t.value) && e.removeAttribute(t.name);
|
|
1566
1567
|
}
|
|
1567
1568
|
}
|
|
1568
|
-
if (t === "a" && e.getAttribute("target") === "_blank" && e.setAttribute("rel", "noopener noreferrer"), t === "input")
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1569
|
+
if (t === "a" && e.getAttribute("target") === "_blank" && e.setAttribute("rel", "noopener noreferrer"), t === "input") {
|
|
1570
|
+
if (e.closest("ul.an-checklist") === null || e.closest("li") === null || e.getAttribute("type") !== "checkbox") e.remove();
|
|
1571
|
+
else for (let t of Array.from(e.attributes)) [
|
|
1572
|
+
"type",
|
|
1573
|
+
"checked",
|
|
1574
|
+
"contenteditable"
|
|
1575
|
+
].includes(t.name) || e.removeAttribute(t.name);
|
|
1576
|
+
}
|
|
1574
1577
|
}
|
|
1575
1578
|
return n.body;
|
|
1576
1579
|
}
|
|
@@ -1676,12 +1679,14 @@ var Dn = /* @__PURE__ */ new Map(), On = class {
|
|
|
1676
1679
|
for (let { name: e, Class: t, enabled: n } of Tn) {
|
|
1677
1680
|
if (typeof n != "function") continue;
|
|
1678
1681
|
let r = n(this.options);
|
|
1679
|
-
if (r !== this._modules.has(e))
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1682
|
+
if (r !== this._modules.has(e)) {
|
|
1683
|
+
if (r) {
|
|
1684
|
+
let n = new t(this);
|
|
1685
|
+
this._modules.set(e, n), n.initialize();
|
|
1686
|
+
} else {
|
|
1687
|
+
let t = this._modules.get(e);
|
|
1688
|
+
typeof t?.destroy == "function" && t.destroy(), this._modules.delete(e);
|
|
1689
|
+
}
|
|
1685
1690
|
}
|
|
1686
1691
|
}
|
|
1687
1692
|
}
|
|
@@ -1980,7 +1985,7 @@ function kn(e, t) {
|
|
|
1980
1985
|
return r;
|
|
1981
1986
|
}
|
|
1982
1987
|
var An = class {
|
|
1983
|
-
constructor(e, t = 100, n =
|
|
1988
|
+
constructor(e, t = 100, n = 10485760) {
|
|
1984
1989
|
this.editable = e, this._limit = t, this._maxBytes = n, this._bytes = 0, this.stack = [], this.stackOffset = -1, this._savePoint();
|
|
1985
1990
|
}
|
|
1986
1991
|
_entrySize(e) {
|
|
@@ -2223,7 +2228,7 @@ function F(e, t) {
|
|
|
2223
2228
|
}
|
|
2224
2229
|
//#endregion
|
|
2225
2230
|
//#region src/js/editing/Typing.js
|
|
2226
|
-
var Nn = /\bfa-/, I = (e) => !!(e?.nodeName === "I" && Nn.test(e.className || "")), Pn = (e) => e?.nodeType
|
|
2231
|
+
var Nn = /\bfa-/, I = (e) => !!(e?.nodeName === "I" && Nn.test(e.className || "")), Pn = (e) => !(e?.nodeType !== Node.TEXT_NODE || e.textContent !== "" && e.textContent !== "");
|
|
2227
2232
|
function Fn(e, t, n) {
|
|
2228
2233
|
let r = (e?.nodeType === Node.ELEMENT_NODE ? e : e?.parentElement ?? null)?.closest("td, th") ?? null;
|
|
2229
2234
|
if (!r || !t.contains(r)) return !1;
|
|
@@ -2338,8 +2343,8 @@ function Rn(e, t, n = {}) {
|
|
|
2338
2343
|
if (Fn(r.sc, t, e.shiftKey)) return e.preventDefault(), !0;
|
|
2339
2344
|
let i = C(r.sc, t);
|
|
2340
2345
|
if (i && _(i)) return e.preventDefault(), e.shiftKey ? Qe() : Xe(), !0;
|
|
2341
|
-
if (i?.nodeName.toUpperCase() === "PRE") return e.shiftKey
|
|
2342
|
-
if (n.tabSize) return e.shiftKey
|
|
2346
|
+
if (i?.nodeName.toUpperCase() === "PRE") return !e.shiftKey && (e.preventDefault(), D("insertText", " ".repeat(n.tabSize || 4)), !0);
|
|
2347
|
+
if (n.tabSize) return !e.shiftKey && (e.preventDefault(), D("insertText", " ".repeat(n.tabSize)), !0);
|
|
2343
2348
|
}
|
|
2344
2349
|
if (P(e, N.ENTER) && e.shiftKey) return e.preventDefault(), D("insertLineBreak"), !0;
|
|
2345
2350
|
if (P(e, N.ENTER) && !e.shiftKey) {
|
|
@@ -2366,7 +2371,7 @@ function Rn(e, t, n = {}) {
|
|
|
2366
2371
|
if (o) {
|
|
2367
2372
|
e.preventDefault();
|
|
2368
2373
|
let t = o.closest(".an-checklist"), n = globalThis.getSelection(), r = n.getRangeAt(0);
|
|
2369
|
-
if (!((e) => Array.from(e.childNodes).filter((e) =>
|
|
2374
|
+
if (!((e) => Array.from(e.childNodes).filter((e) => e.nodeType !== 1 || e.tagName !== "INPUT").map((e) => e.textContent).join("").replace(/[\u00a0\u200B]/g, " ").trim())(o)) {
|
|
2370
2375
|
let e = document.createElement("p");
|
|
2371
2376
|
e.innerHTML = "\xA0", t.parentNode.insertBefore(e, t.nextSibling), o.remove(), t.children.length === 0 && t.remove();
|
|
2372
2377
|
let r = document.createRange();
|
|
@@ -3593,7 +3598,7 @@ var Jr = /* @__PURE__ */ new Set([
|
|
|
3593
3598
|
}
|
|
3594
3599
|
initialize() {
|
|
3595
3600
|
let e = this.context.layoutInfo.editable;
|
|
3596
|
-
return this._history = new An(e, this.options.historyLimit || 100, this.options.historyMaxBytes ||
|
|
3601
|
+
return this._history = new An(e, this.options.historyLimit || 100, this.options.historyMaxBytes || 10485760), this._bindEvents(e), this;
|
|
3597
3602
|
}
|
|
3598
3603
|
destroy() {
|
|
3599
3604
|
this._disposers.forEach((e) => e()), this._disposers = [], this._history = null, clearTimeout(this._snapshotTimer), this._snapshotTimer = null;
|
|
@@ -4053,7 +4058,7 @@ var Jr = /* @__PURE__ */ new Set([
|
|
|
4053
4058
|
"aria-haspopup": "true",
|
|
4054
4059
|
"aria-expanded": "false"
|
|
4055
4060
|
});
|
|
4056
|
-
this._faReady ?
|
|
4061
|
+
n.innerHTML = this._faReady ? `<i class="${this.options.fontAwesomeClass || "fas"} fa-table" aria-hidden="true"></i>` : "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"display:block\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"1\"/><line x1=\"3\" y1=\"9\" x2=\"21\" y2=\"9\"/><line x1=\"3\" y1=\"15\" x2=\"21\" y2=\"15\"/><line x1=\"9\" y1=\"3\" x2=\"9\" y2=\"21\"/><line x1=\"15\" y1=\"3\" x2=\"15\" y2=\"21\"/></svg>";
|
|
4057
4062
|
let r = w("div", {
|
|
4058
4063
|
class: "an-table-picker-popup",
|
|
4059
4064
|
role: "dialog",
|
|
@@ -4938,7 +4943,7 @@ var oi = [
|
|
|
4938
4943
|
}
|
|
4939
4944
|
], si = class {
|
|
4940
4945
|
constructor(e) {
|
|
4941
|
-
this.context = e, this.options = e.options
|
|
4946
|
+
this.context = e, this.options = e.options, this._items = this.options.contextMenu?.items || oi, this.el = null, this._disposers = [], this._menuDisposers = [], this._lastX = 0, this._lastY = 0, this._copiedFormat = null, this._savedRange = null;
|
|
4942
4947
|
}
|
|
4943
4948
|
initialize() {
|
|
4944
4949
|
this.el = w("div", {
|
|
@@ -4993,20 +4998,22 @@ var oi = [
|
|
|
4993
4998
|
class: "an-context-item an-context-submenu",
|
|
4994
4999
|
"data-name": e.name || ""
|
|
4995
5000
|
});
|
|
4996
|
-
if (e.icon)
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5001
|
+
if (e.icon) {
|
|
5002
|
+
if (e.colorStrip) {
|
|
5003
|
+
let n = w("span", {
|
|
5004
|
+
class: "an-context-icon an-context-icon--color",
|
|
5005
|
+
"aria-hidden": "true"
|
|
5006
|
+
}), r = w("span", { class: "an-context-icon-svg" });
|
|
5007
|
+
r.innerHTML = e.icon;
|
|
5008
|
+
let i = w("span", { class: "an-context-color-strip" });
|
|
5009
|
+
i.style.background = this._getSelectionColor(e.colorStrip), n.appendChild(r), n.appendChild(i), t.appendChild(n);
|
|
5010
|
+
} else {
|
|
5011
|
+
let n = w("span", {
|
|
5012
|
+
class: "an-context-icon",
|
|
5013
|
+
"aria-hidden": "true"
|
|
5014
|
+
});
|
|
5015
|
+
n.innerHTML = e.icon, t.appendChild(n);
|
|
5016
|
+
}
|
|
5010
5017
|
}
|
|
5011
5018
|
t.appendChild(w("span", { class: "an-context-label" }, [this.context.locale.contextMenu[e.name] || e.label || e.name]));
|
|
5012
5019
|
let n = w("span", {
|
|
@@ -5950,7 +5957,7 @@ var ui = class {
|
|
|
5950
5957
|
})), r;
|
|
5951
5958
|
}
|
|
5952
5959
|
_scheduleShow(e) {
|
|
5953
|
-
this._activeAnchor
|
|
5960
|
+
(this._activeAnchor !== e || this._el.style.display === "none") && (clearTimeout(this._hideTimer), this._hideTimer = null, clearTimeout(this._showTimer), this._showTimer = setTimeout(() => {
|
|
5954
5961
|
this._activeAnchor = e, this._show(e);
|
|
5955
5962
|
}, wi));
|
|
5956
5963
|
}
|
|
@@ -6025,7 +6032,7 @@ var ui = class {
|
|
|
6025
6032
|
})), i;
|
|
6026
6033
|
}
|
|
6027
6034
|
_scheduleShow(e) {
|
|
6028
|
-
this._active
|
|
6035
|
+
(this._active !== e || this._el.style.display === "none") && (clearTimeout(this._hideTimer), this._hideTimer = null, clearTimeout(this._showTimer), this._showTimer = setTimeout(() => {
|
|
6029
6036
|
this._active = e, this._show(e);
|
|
6030
6037
|
}, 100));
|
|
6031
6038
|
}
|
|
@@ -6353,7 +6360,7 @@ var Ni = 120, Pi = 200, Fi = [
|
|
|
6353
6360
|
return this._editable = e, this._disposers.push(E(e, "mousedown", (t) => {
|
|
6354
6361
|
if (!this._selectMode) return;
|
|
6355
6362
|
let n = t.target.closest("td, th");
|
|
6356
|
-
!n || !e.contains(n) || n.style.cursor
|
|
6363
|
+
!n || !e.contains(n) || n.style.cursor !== "col-resize" && n.style.cursor !== "row-resize" && (t.preventDefault(), this._activeTable = n.closest("table"), this._selectStart = n, this._selectDragging = !0, this._setSelection([n]));
|
|
6357
6364
|
}), E(e, "mousemove", (t) => {
|
|
6358
6365
|
if (!this._selectMode || !this._selectDragging || !this._selectStart) return;
|
|
6359
6366
|
let n = t.target.closest("td, th");
|
|
@@ -6471,7 +6478,7 @@ var Ni = 120, Pi = 200, Fi = [
|
|
|
6471
6478
|
})), i;
|
|
6472
6479
|
}
|
|
6473
6480
|
_scheduleShow(e) {
|
|
6474
|
-
this._activeTable
|
|
6481
|
+
(this._activeTable !== e || this._el.style.display === "none") && (clearTimeout(this._hideTimer), this._hideTimer = null, clearTimeout(this._showTimer), this._showTimer = setTimeout(() => {
|
|
6475
6482
|
this._activeTable = e, this._show();
|
|
6476
6483
|
}, Ni));
|
|
6477
6484
|
}
|
|
@@ -7019,7 +7026,7 @@ var Wi = class {
|
|
|
7019
7026
|
})), i;
|
|
7020
7027
|
}
|
|
7021
7028
|
_scheduleShow(e) {
|
|
7022
|
-
this._activePre
|
|
7029
|
+
(this._activePre !== e || this._el.style.display === "none") && (clearTimeout(this._hideTimer), this._hideTimer = null, clearTimeout(this._showTimer), this._showTimer = setTimeout(() => {
|
|
7023
7030
|
this._activePre = e, this._syncWrapBtn(), this._syncLineNumbersBtn(), this._syncLangSelect(), this._show(e);
|
|
7024
7031
|
}, Ri));
|
|
7025
7032
|
}
|
|
@@ -7106,7 +7113,8 @@ var Wi = class {
|
|
|
7106
7113
|
}
|
|
7107
7114
|
this._loadPrismComponent(t, i);
|
|
7108
7115
|
return;
|
|
7109
|
-
}
|
|
7116
|
+
}
|
|
7117
|
+
if (this._prismScript) {
|
|
7110
7118
|
this._onScriptLoad(this._prismScript, () => {
|
|
7111
7119
|
n.Prism.languages[t] ? i() : this._loadPrismComponent(t, i);
|
|
7112
7120
|
});
|
|
@@ -7460,7 +7468,7 @@ var $i = class extends W {
|
|
|
7460
7468
|
let l = c.startContainer, u = (l.nodeType === 1 ? l : l.parentElement)?.closest("td, th");
|
|
7461
7469
|
c.deleteContents(), u?.isConnected && !u.contains(c.startContainer) && (c.setStart(u, 0), c.collapse(!0)), c.insertNode(i);
|
|
7462
7470
|
let d = i.nextSibling;
|
|
7463
|
-
d?.nodeType === Node.TEXT_NODE ? d.textContent
|
|
7471
|
+
d?.nodeType === Node.TEXT_NODE ? d.textContent || (d.textContent = "") : (d = document.createTextNode(""), i.parentNode.insertBefore(d, i.nextSibling));
|
|
7464
7472
|
let f = +!!(d.textContent || "").startsWith(""), p = document.createRange();
|
|
7465
7473
|
p.setStart(d, Math.min(f, d.textContent.length)), p.collapse(!0), s && (s.removeAllRanges(), s.addRange(p)), this._close(), o.focus(), s && (s.removeAllRanges(), s.addRange(p)), this.context.invoke("editor.afterCommand");
|
|
7466
7474
|
}
|
|
@@ -7948,7 +7956,7 @@ var oa = class {
|
|
|
7948
7956
|
}, e);
|
|
7949
7957
|
}, { passive: !1 })), this._handles[e] = i, t.appendChild(i);
|
|
7950
7958
|
}), this._disposers.push(E(t, "mousedown", (e) => {
|
|
7951
|
-
e.target.classList.contains("an-crop-handle") || e.target
|
|
7959
|
+
e.target.classList.contains("an-crop-handle") || (e.target === t || e.target === n) && (e.preventDefault(), e.stopPropagation(), this._startBoxMove(e));
|
|
7952
7960
|
}), E(t, "touchstart", (e) => {
|
|
7953
7961
|
if (e.target.classList.contains("an-crop-handle") || e.target !== t && e.target !== n) return;
|
|
7954
7962
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -8761,15 +8769,17 @@ var oa = class {
|
|
|
8761
8769
|
}, this._cfg.debounce);
|
|
8762
8770
|
}
|
|
8763
8771
|
_onKeydown(e) {
|
|
8764
|
-
if (!(!this._cfg || !this._open))
|
|
8765
|
-
e.
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
e.
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8772
|
+
if (!(!this._cfg || !this._open)) {
|
|
8773
|
+
if (e.key === "ArrowDown") {
|
|
8774
|
+
e.preventDefault();
|
|
8775
|
+
let t = (this._activeIndex + 1) % this._items.length;
|
|
8776
|
+
this._highlightItem(t);
|
|
8777
|
+
} else if (e.key === "ArrowUp") {
|
|
8778
|
+
e.preventDefault();
|
|
8779
|
+
let t = (this._activeIndex - 1 + this._items.length) % this._items.length;
|
|
8780
|
+
this._highlightItem(t);
|
|
8781
|
+
} else e.key === "Enter" || e.key === "Tab" ? this._activeIndex >= 0 && (e.preventDefault(), this._select(this._activeIndex)) : e.key === "Escape" && this._hideDropdown();
|
|
8782
|
+
}
|
|
8773
8783
|
}
|
|
8774
8784
|
_onDocClick(e) {
|
|
8775
8785
|
this._open && (this._dropdown?.contains(e.target) || this._hideDropdown());
|
|
@@ -8975,13 +8985,15 @@ var oa = class {
|
|
|
8975
8985
|
this._textNode = e.textNode, this._triggerOffset = e.triggerOffset, this._query = e.query, this._caretRect = this._captureCaretRect(e.textNode, e.triggerOffset), this._open ? (this._filterAndRender(), this._position()) : this._open_();
|
|
8976
8986
|
}
|
|
8977
8987
|
_onKeydown(e) {
|
|
8978
|
-
if (this._open)
|
|
8979
|
-
if (e.
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
if (e.
|
|
8983
|
-
|
|
8984
|
-
|
|
8988
|
+
if (this._open) {
|
|
8989
|
+
if (e.key === "ArrowDown") {
|
|
8990
|
+
if (e.preventDefault(), this._filtered.length === 0) return;
|
|
8991
|
+
this._highlight((this._activeIndex + 1) % this._filtered.length);
|
|
8992
|
+
} else if (e.key === "ArrowUp") {
|
|
8993
|
+
if (e.preventDefault(), this._filtered.length === 0) return;
|
|
8994
|
+
this._highlight((this._activeIndex - 1 + this._filtered.length) % this._filtered.length);
|
|
8995
|
+
} else e.key === "Enter" || e.key === "Tab" ? this._activeIndex >= 0 && (e.preventDefault(), this._select(this._activeIndex)) : e.key === "Escape" && (e.preventDefault(), this._close());
|
|
8996
|
+
}
|
|
8985
8997
|
}
|
|
8986
8998
|
_onDocClick(e) {
|
|
8987
8999
|
this._open && (this._menu?.contains(e.target) || this._close());
|
|
@@ -9021,7 +9033,7 @@ var oa = class {
|
|
|
9021
9033
|
},
|
|
9022
9034
|
enabled: (e) => e.slashMenu !== !1
|
|
9023
9035
|
}
|
|
9024
|
-
], ga = "2.7.
|
|
9036
|
+
], ga = "2.7.1";
|
|
9025
9037
|
//#endregion
|
|
9026
9038
|
//#region src/js/core/lists.js
|
|
9027
9039
|
function _a(e) {
|