mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Release v2.0.3
This commit is contained in:
parent
cbde45311a
commit
00f6a4fb8d
9 changed files with 87 additions and 156 deletions
21
CHANGELOG.md
21
CHANGELOG.md
|
@ -4,6 +4,27 @@ 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.0.3] - 2023-04-20
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed an error being thrown when you typed a URL in the middle of a text
|
||||
node. https://github.com/fastmail/Squire/issues/430
|
||||
|
||||
## [2.0.2] - 2023-03-20
|
||||
|
||||
### Changed
|
||||
|
||||
- Let ArrowRight key always break out of <code> if at end. It will add a
|
||||
space afterwards if needed.
|
||||
- Added documentation for pasteImage event.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix backspace can delete two characters.
|
||||
- Consistently focus after calling removeAllFormatting.
|
||||
- Performance improvements.
|
||||
|
||||
## [2.0.1] - 2023-02-14
|
||||
|
||||
### Changed
|
||||
|
|
10
dist/squire-raw.js
vendored
10
dist/squire-raw.js
vendored
|
@ -1637,6 +1637,8 @@
|
|||
self._getRangeAndRemoveBookmark(selection);
|
||||
const index = searchFrom + match.index;
|
||||
const endIndex = index + match[0].length;
|
||||
const needsSelectionUpdate = selection.startContainer === textNode;
|
||||
const newSelectionOffset = selection.startOffset - endIndex;
|
||||
if (index) {
|
||||
textNode = textNode.splitText(index);
|
||||
}
|
||||
|
@ -1652,12 +1654,10 @@
|
|||
);
|
||||
link.textContent = data.slice(index, endIndex);
|
||||
textNode.parentNode.insertBefore(link, textNode);
|
||||
const startOffset = selection.startOffset;
|
||||
textNode.data = data.slice(endIndex);
|
||||
if (selection.startContainer === textNode) {
|
||||
const newOffset = startOffset - endIndex;
|
||||
selection.setStart(textNode, newOffset);
|
||||
selection.setEnd(textNode, newOffset);
|
||||
if (needsSelectionUpdate) {
|
||||
selection.setStart(textNode, newSelectionOffset);
|
||||
selection.setEnd(textNode, newSelectionOffset);
|
||||
}
|
||||
self.setSelection(selection);
|
||||
}
|
||||
|
|
10
dist/squire-raw.mjs
vendored
10
dist/squire-raw.mjs
vendored
|
@ -1639,6 +1639,8 @@ var linkifyText = (self, textNode, offset) => {
|
|||
self._getRangeAndRemoveBookmark(selection);
|
||||
const index = searchFrom + match.index;
|
||||
const endIndex = index + match[0].length;
|
||||
const needsSelectionUpdate = selection.startContainer === textNode;
|
||||
const newSelectionOffset = selection.startOffset - endIndex;
|
||||
if (index) {
|
||||
textNode = textNode.splitText(index);
|
||||
}
|
||||
|
@ -1654,12 +1656,10 @@ var linkifyText = (self, textNode, offset) => {
|
|||
);
|
||||
link.textContent = data.slice(index, endIndex);
|
||||
textNode.parentNode.insertBefore(link, textNode);
|
||||
const startOffset = selection.startOffset;
|
||||
textNode.data = data.slice(endIndex);
|
||||
if (selection.startContainer === textNode) {
|
||||
const newOffset = startOffset - endIndex;
|
||||
selection.setStart(textNode, newOffset);
|
||||
selection.setEnd(textNode, newOffset);
|
||||
if (needsSelectionUpdate) {
|
||||
selection.setStart(textNode, newSelectionOffset);
|
||||
selection.setEnd(textNode, newSelectionOffset);
|
||||
}
|
||||
self.setSelection(selection);
|
||||
}
|
||||
|
|
2
dist/squire.js
vendored
2
dist/squire.js
vendored
File diff suppressed because one or more lines are too long
6
dist/squire.js.map
vendored
6
dist/squire.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/squire.mjs
vendored
2
dist/squire.mjs
vendored
File diff suppressed because one or more lines are too long
6
dist/squire.mjs.map
vendored
6
dist/squire.mjs.map
vendored
File diff suppressed because one or more lines are too long
184
package-lock.json
generated
184
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "squire-rte",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "squire-rte",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.3",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.12",
|
||||
|
@ -1709,14 +1709,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz",
|
||||
"integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"cpu": ["arm"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"os": ["android"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1725,14 +1721,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz",
|
||||
"integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"cpu": ["arm64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"os": ["android"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1741,14 +1733,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz",
|
||||
"integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"os": ["android"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1757,14 +1745,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz",
|
||||
"integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"cpu": ["arm64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"os": ["darwin"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1773,14 +1757,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz",
|
||||
"integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"os": ["darwin"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1789,14 +1769,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz",
|
||||
"integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"cpu": ["arm64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"os": ["freebsd"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1805,14 +1781,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz",
|
||||
"integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"os": ["freebsd"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1821,14 +1793,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz",
|
||||
"integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"cpu": ["arm"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"os": ["linux"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1837,14 +1805,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz",
|
||||
"integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"cpu": ["arm64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"os": ["linux"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1853,14 +1817,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz",
|
||||
"integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"cpu": ["ia32"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"os": ["linux"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1869,14 +1829,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz",
|
||||
"integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"cpu": ["loong64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"os": ["linux"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1885,14 +1841,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz",
|
||||
"integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"cpu": ["mips64el"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"os": ["linux"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1901,14 +1853,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz",
|
||||
"integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"cpu": ["ppc64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"os": ["linux"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1917,14 +1865,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz",
|
||||
"integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"cpu": ["riscv64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"os": ["linux"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1933,14 +1877,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz",
|
||||
"integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"cpu": ["s390x"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"os": ["linux"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1949,14 +1889,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz",
|
||||
"integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"os": ["linux"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1965,14 +1901,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz",
|
||||
"integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"os": ["netbsd"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1981,14 +1913,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz",
|
||||
"integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"os": ["openbsd"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -1997,14 +1925,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz",
|
||||
"integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"sunos"
|
||||
],
|
||||
"os": ["sunos"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -2013,14 +1937,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz",
|
||||
"integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"cpu": ["arm64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"os": ["win32"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -2029,14 +1949,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz",
|
||||
"integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"cpu": ["ia32"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"os": ["win32"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -2045,14 +1961,10 @@
|
|||
"version": "0.16.17",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz",
|
||||
"integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"os": ["win32"],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
|
@ -5018,9 +4930,7 @@
|
|||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"os": ["darwin"],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "squire-rte",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.3",
|
||||
"description": "Squire is an HTML5 rich text editor, which provides powerful cross-browser normalisation, whilst being supremely lightweight and flexible.",
|
||||
"main": "dist/squire.mjs",
|
||||
"type": "module",
|
||||
|
|
Loading…
Reference in a new issue