0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00
Commit graph

17 commits

Author SHA1 Message Date
Chasen Stark
43799dc57d Editor.ts: Revert fix for Grammarly bug
The fix for Grammarly bug prevents pasting text directly from the keyboard on Android if the text to be
inserted contains \n, as pasting from the keyboard does not fire a true paste event. The Grammarly bug seems to have been
fixed in Samsung keyboard as of v5.6.10.4.
2024-02-22 13:28:17 -05:00
Illia Kyselov
4d2c80de92 fix(Editor): make willPaste custom event to be cancelable 2024-02-21 11:51:05 +11:00
Neil Jenkins
6cfd85bd8e Add undo point for automatic list creation
If you do `*` then space or `1. ` then space at the beginning of a line,
we automatically create a list. Now you can use undo to undo just the
automatic list creation, reverting to the plain text you typed.
2023-12-20 14:17:34 +11:00
Chasen Stark
949b5b227e Editor.ts: Update insertText comment to address keyboard 'paste' bug 2023-11-30 13:09:40 -05:00
Neil Jenkins
efdff6c71b Focus editor after undo/redo
This matches the behaviour of all the other commands, and means if you
add toolbar buttons for undo/redo they work as expected.

Fixes #445.
2023-11-08 09:44:16 +01:00
Ioan Moldovan
ff7babcdd3 fix: invalid setKeyHandler key parameter type 2023-10-24 12:45:07 +11:00
Neil Jenkins
1ed32e3db7 Squire: Fix crash removing formatting
The fixer node may get removed when merging adjacent inlines, so move
the cleanup to before this. For safety, also properly check for non-null
nodes so we don't crash if it's still elided for some reason.
2023-10-09 11:52:58 +11:00
Neil Jenkins
57f2d37c1d Work around Chrome bug not rendering text
There seems to be a bug in Chrome where it will sometimes not render
some of the text in the DOM when there are multiple zero-width spaces
around the beginning and ends of inline tags (not sure on the exact
details).

Steps to reproduce (prior to this commit):

1. Turn on bold and underlined text
2. Type something in bold and underlined text
3. Turn off bold and underline
4. Try to type something — it will not show up! That is, until you press
   the enter key and we remove the zero-width spaces.
2023-10-04 12:28:38 +11:00
Neil Jenkins
3937c10b55 Extract getTextContentsOfRange helper fn 2023-10-02 13:12:51 +11:00
Neil Jenkins
9aa62781d0 Add toPlainText config option
This allows you to customise how HTML you cut/copy in the editor is
converted into plain text.
2023-10-02 13:01:16 +11:00
Neil Jenkins
e324748f0f Remove obsolete execCommand calls
Firefox removed the need for this in v64.

Resolves #439.
2023-10-02 12:41:55 +11:00
Callum Skeet
c9f10b297b Make isPaste optional for Squire.insertHTML
This aligns the interface with the spec
2023-07-31 12:49:55 +10:00
Callum Skeet
a74ec739b9 Add autocomplete to config in Squire constructor 2023-07-31 12:49:15 +10:00
Callum Skeet
f1657acbc4 Export SquireConfig as type 2023-07-31 12:48:27 +10:00
Neil Jenkins
137c8f0b17 Consistently focus after removeAllFormatting 2023-02-22 11:14:16 +11:00
Joe Woods
00e3482815 Add secondary path if setBaseAndExtent undefined 2023-01-30 23:50:29 +00:00
Neil Jenkins
fe0dfdf6c4 Squire 2.0
This is a massive refactor to port Squire to TypeScript, fix a bunch of small
bugs and modernise our tooling. The development was done on an internal
repository, so apologies to anyone following externally for the commit dump;
updates from here should come as real commits again.

Co-authored-by: Joe Woods <woods@fastmailteam.com>
2023-01-23 13:18:29 +11:00