Upgraded squire 2.3.1 to 2.3.2

This commit is contained in:
Mohammad Rezaei 2024-09-14 09:44:46 +03:30
parent de042ed365
commit f1468cb08b
11 changed files with 60 additions and 29 deletions

View file

@ -2594,7 +2594,7 @@
this._lastAnchorNode = anchor;
this._lastFocusNode = focus;
newPath = anchor && focus ? anchor === focus ? this._getPath(focus) : "(selection)" : "";
if (this._path !== newPath) {
if (this._path !== newPath || anchor !== focus) {
this._path = newPath;
this.fireEvent("pathChange", {
path: newPath
@ -3549,7 +3549,7 @@
this.decreaseListLevel(range);
return this;
} else if (getNearest(block, root, "BLOCKQUOTE")) {
this.removeQuote(range);
this.replaceWithBlankLine(range);
return this;
}
}
@ -3900,6 +3900,17 @@
return this.focus();
}
removeQuote(range) {
this.modifyBlocks((frag) => {
Array.from(frag.querySelectorAll("blockquote")).forEach(
(el) => {
replaceWith(el, empty(el));
}
);
return frag;
}, range);
return this.focus();
}
replaceWithBlankLine(range) {
this.modifyBlocks(
() => this.createDefaultBlock([
createElement("INPUT", {