0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-21 23:03:11 -05:00

Release v2.1.1

This commit is contained in:
Neil Jenkins 2023-09-27 14:58:41 +10:00
parent 9f5df9e5c0
commit fc38e8affb
10 changed files with 54 additions and 37 deletions

View file

@ -4,6 +4,13 @@ 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.1.1] - 2023-09-27
### Fixed
- If you changed inline formatting in Chrome and then hit space, the formatting
would be lost. This is now fixed.
## [2.1.0] - 2023-09-19
### Added

19
dist/squire-raw.js vendored
View file

@ -982,8 +982,11 @@
const startOffset = range.startOffset;
let nodeAfterCursor;
if (startContainer instanceof Text) {
if (startOffset) {
return false;
const text = startContainer.data;
for (let i = startOffset; i > 0; i -= 1) {
if (text.charAt(i - 1) !== ZWS) {
return false;
}
}
nodeAfterCursor = startContainer;
} else {
@ -1015,9 +1018,12 @@
const endOffset = range.endOffset;
let currentNode;
if (endContainer instanceof Text) {
const length = endContainer.data.length;
if (length && endOffset < length) {
return false;
const text = endContainer.data;
const length = text.length;
for (let i = endOffset; i < length; i += 1) {
if (text.charAt(i) !== ZWS) {
return false;
}
}
currentNode = endContainer;
} else {
@ -1822,7 +1828,6 @@
const root = self._root;
self._recordUndoState(range);
self._getRangeAndRemoveBookmark(range);
self._removeZWS();
if (!range.collapsed) {
deleteContentsOfRange(range, root);
self._ensureBottomLine();
@ -1831,7 +1836,7 @@
} else if (rangeDoesEndAtBlockBoundary(range, root)) {
const block = getStartBlockOfRange(range, root);
if (block && block.nodeName !== "PRE") {
const text = (_a = block.textContent) == null ? void 0 : _a.trimEnd();
const text = (_a = block.textContent) == null ? void 0 : _a.trimEnd().replace(ZWS, "");
if (text === "*" || text === "1.") {
event.preventDefault();
const walker = new TreeIterator(block, SHOW_TEXT);

19
dist/squire-raw.mjs vendored
View file

@ -980,8 +980,11 @@ var rangeDoesStartAtBlockBoundary = (range, root) => {
const startOffset = range.startOffset;
let nodeAfterCursor;
if (startContainer instanceof Text) {
if (startOffset) {
return false;
const text = startContainer.data;
for (let i = startOffset; i > 0; i -= 1) {
if (text.charAt(i - 1) !== ZWS) {
return false;
}
}
nodeAfterCursor = startContainer;
} else {
@ -1013,9 +1016,12 @@ var rangeDoesEndAtBlockBoundary = (range, root) => {
const endOffset = range.endOffset;
let currentNode;
if (endContainer instanceof Text) {
const length = endContainer.data.length;
if (length && endOffset < length) {
return false;
const text = endContainer.data;
const length = text.length;
for (let i = endOffset; i < length; i += 1) {
if (text.charAt(i) !== ZWS) {
return false;
}
}
currentNode = endContainer;
} else {
@ -1819,7 +1825,6 @@ var Space = (self, event, range) => {
const root = self._root;
self._recordUndoState(range);
self._getRangeAndRemoveBookmark(range);
self._removeZWS();
if (!range.collapsed) {
deleteContentsOfRange(range, root);
self._ensureBottomLine();
@ -1828,7 +1833,7 @@ var Space = (self, event, range) => {
} else if (rangeDoesEndAtBlockBoundary(range, root)) {
const block = getStartBlockOfRange(range, root);
if (block && block.nodeName !== "PRE") {
const text = block.textContent?.trimEnd();
const text = block.textContent?.trimEnd().replace(ZWS, "");
if (text === "*" || text === "1.") {
event.preventDefault();
const walker = new TreeIterator(block, SHOW_TEXT);

14
dist/squire.js vendored

File diff suppressed because one or more lines are too long

6
dist/squire.js.map vendored

File diff suppressed because one or more lines are too long

14
dist/squire.mjs vendored

File diff suppressed because one or more lines are too long

6
dist/squire.mjs.map vendored

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":3,"file":"Space.d.ts","sourceRoot":"","sources":["../../../source/keyboard/Space.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAWxC,QAAA,MAAM,KAAK,SAAU,MAAM,SAAS,aAAa,SAAS,KAAK,KAAG,IA+DjE,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,CAAC"}
{"version":3,"file":"Space.d.ts","sourceRoot":"","sources":["../../../source/keyboard/Space.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAWxC,QAAA,MAAM,KAAK,SAAU,MAAM,SAAS,aAAa,SAAS,KAAK,KAAG,IA8DjE,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,CAAC"}

View file

@ -1 +1 @@
{"version":3,"file":"Block.d.ts","sourceRoot":"","sources":["../../../source/range/Block.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,oBAAoB,UACf,KAAK,QACN,OAAO,GAAG,gBAAgB,KACjC,WAAW,GAAG,IAmBhB,CAAC;AAIF,QAAA,MAAM,kBAAkB,UACb,KAAK,QACN,OAAO,GAAG,gBAAgB,KACjC,WAAW,GAAG,IA0BhB,CAAC;AAQF,QAAA,MAAM,6BAA6B,UACxB,KAAK,QACN,OAAO,KACd,OAsCF,CAAC;AAEF,QAAA,MAAM,2BAA2B,UAAW,KAAK,QAAQ,OAAO,KAAG,OA6BlE,CAAC;AAEF,QAAA,MAAM,4BAA4B,UAAW,KAAK,QAAQ,OAAO,KAAG,IAWnE,CAAC;AAIF,OAAO,EACH,oBAAoB,EACpB,kBAAkB,EAClB,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,GAC/B,CAAC"}
{"version":3,"file":"Block.d.ts","sourceRoot":"","sources":["../../../source/range/Block.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,oBAAoB,UACf,KAAK,QACN,OAAO,GAAG,gBAAgB,KACjC,WAAW,GAAG,IAmBhB,CAAC;AAIF,QAAA,MAAM,kBAAkB,UACb,KAAK,QACN,OAAO,GAAG,gBAAgB,KACjC,WAAW,GAAG,IA0BhB,CAAC;AAQF,QAAA,MAAM,6BAA6B,UACxB,KAAK,QACN,OAAO,KACd,OAyCF,CAAC;AAEF,QAAA,MAAM,2BAA2B,UAAW,KAAK,QAAQ,OAAO,KAAG,OAgClE,CAAC;AAEF,QAAA,MAAM,4BAA4B,UAAW,KAAK,QAAQ,OAAO,KAAG,IAWnE,CAAC;AAIF,OAAO,EACH,oBAAoB,EACpB,kBAAkB,EAClB,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,GAC/B,CAAC"}

View file

@ -1,6 +1,6 @@
{
"name": "squire-rte",
"version": "2.1.0",
"version": "2.1.1",
"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",