Skip to content

Commit

Permalink
Upgraded squire 2.3.1 to 2.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad Rezaei committed Sep 14, 2024
1 parent de042ed commit f1468cb
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 29 deletions.
8 changes: 8 additions & 0 deletions vendors/squire-rte/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file, starting fr

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.2] - 2024-08-16

### Fixed

- Fix "pathChange" event not being fired on selection change.
- Fix backspace at beginning of quote was deleting the contents, not just
removing the quote.

## [2.3.1] - 2024-07-23

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion vendors/squire-rte/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Squire
# Squire

Squire is an HTML5 rich text editor, which provides powerful cross-browser normalisation in a flexible lightweight package (only 16KB of JS after minification and gzip, with no dependencies!).

Expand Down
15 changes: 13 additions & 2 deletions vendors/squire-rte/dist/squire-raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -3549,7 +3549,7 @@
this.decreaseListLevel(range);
return this;
} else if (getNearest(block, root, "BLOCKQUOTE")) {
this.removeQuote(range);
this.replaceWithBlankLine(range);
return this;
}
}
Expand Down Expand Up @@ -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", {
Expand Down
15 changes: 13 additions & 2 deletions vendors/squire-rte/dist/squire-raw.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2591,7 +2591,7 @@ var Squire = class {
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
Expand Down Expand Up @@ -3546,7 +3546,7 @@ var Squire = class {
this.decreaseListLevel(range);
return this;
} else if (getNearest(block, root, "BLOCKQUOTE")) {
this.removeQuote(range);
this.replaceWithBlankLine(range);
return this;
}
}
Expand Down Expand Up @@ -3897,6 +3897,17 @@ var Squire = class {
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", {
Expand Down
18 changes: 9 additions & 9 deletions vendors/squire-rte/dist/squire.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vendors/squire-rte/dist/squire.js.map

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions vendors/squire-rte/dist/squire.mjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vendors/squire-rte/dist/squire.mjs.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions vendors/squire-rte/dist/types/Editor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ declare class Squire {
increaseQuoteLevel(range?: Range): Squire;
decreaseQuoteLevel(range?: Range): Squire;
removeQuote(range?: Range): Squire;
replaceWithBlankLine(range?: Range): Squire;
code(): Squire;
removeCode(): Squire;
toggleCode(): Squire;
Expand Down
2 changes: 1 addition & 1 deletion vendors/squire-rte/dist/types/Editor.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendors/squire-rte/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "squire-rte",
"version": "2.3.1",
"version": "2.3.2",
"description": "Squire is an HTML5 rich text editor, which provides powerful cross-browser normalisation, whilst being supremely lightweight and flexible.",
"main": "dist/squire.mjs",
"types": "dist/types/Squire.d.ts",
Expand Down

0 comments on commit f1468cb

Please sign in to comment.