0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00
Commit graph

619 commits

Author SHA1 Message Date
Neil Jenkins
9f5df9e5c0 Fix format intent lost after pressing Space
On Chrome, if you made an inline formatting change, this would insert a
new <span> with a ZWS inside so we could focus it. Pressing Space would
remove this ZWS resulting in the focus ending up outside and so the
formatting would be lost. We were removing the ZWS so we could check
if we were at a block boundary correctly; instead, I've made it so the
boundary check can handle trailing or leading ZWS (see previous commit).
2023-09-27 14:56:00 +10:00
Neil Jenkins
2d37608aac Ignore ZWS when determining if at block boundary
These are just added to allow Chrome to focus an empty text node, but
they should not be considered "real" content.
2023-09-27 14:51:26 +10:00
Neil Jenkins
ee01d36a0f Update npm packages to latest versions 2023-09-20 09:00:36 +08:00
Neil Jenkins
befb652039 Release v2.1.0 2023-09-19 14:45:15 +08:00
Neil Jenkins
edde44a924 Auto-format list if starting line with * or 1. 2023-09-19 14:45:15 +08:00
Neil Jenkins
02cc7baacc Fix error in readme 2023-09-19 14:34:46 +08:00
Callum Skeet
8ee145ede6 Remove usage of private fields/methods in spec 2023-08-01 12:41:48 +10:00
Callum Skeet
e9ffde9a65 Bundle types with build 2023-07-31 12:55:53 +10: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
39b759de1c Fix variable shadowing in spec 2023-07-31 12:49:38 +10:00
Callum Skeet
3dcd940a20 Type editor in spec
This makes it easier to catch inconsistencies between the spec and
interface for Squire.
2023-07-31 12:49:31 +10:00
Callum Skeet
54914dd5d5 Add non-null assertions to element queries in spec 2023-07-31 12:49:20 +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
00f6a4fb8d Release v2.0.3 2023-04-20 11:05:35 +10:00
Neil Jenkins
cbde45311a Fix crash linkifying text in middle of node
We were looking at the selection properties after we had mutated the DOM, and
trying to manipulate them based on some numbers cached from before mutating
the DOM, which could result in trying to set a negative index for the selection
offset. Instead, calculate all our values before we do any mutations.

Fixes #430
2023-04-20 10:57:05 +10:00
Seth Falco
a8cd95a688 Release v2.0.2 2023-03-20 20:32:50 +11:00
Seth Falco
c84f48e480 docs: add pasteImage to demo and document the event 2023-03-20 20:31:39 +11:00
Neil Jenkins
8304fd3e04 Let ArrowRight key always break out of <code> 2023-02-22 16:01:23 +11:00
Neil Jenkins
cf30a69b89 Fix backspace can delete two characters
If we're handling the backspace completely ourselves, must prevent
default to stop the browser also having a go.
2023-02-22 11:27:16 +11:00
Neil Jenkins
137c8f0b17 Consistently focus after removeAllFormatting 2023-02-22 11:14:16 +11:00
Neil Jenkins
474847872c Use Array.from for older browser support 2023-02-22 11:13:38 +11:00
Neil Jenkins
4306cecb6e Remove multiple adjacent empty text nodes
Fix the loop condition so this will remove multiple adjacent empty
text nodes if necessary.
2023-02-20 10:17:56 +11:00
Neil Jenkins
9f258f2561 Code style fix 2023-02-20 09:46:56 +11:00
djmaze
cdb57ebda0 Don't use live NodeList 2023-02-20 09:34:59 +11:00
Neil Jenkins
27f19c4782 Release v2.0.1 2023-02-14 15:17:01 +11:00
Neil Jenkins
1904405ab8 Auto delink if backspacing inside auto-linked URL
This means if you make a mistake and backspace, you don't end up
accidentally fixing the text but leaving the link to the wrong URL.
2023-02-01 14:20:53 +11:00
Neil Jenkins
b85754ca50 Handle empty nodes in moveRangeBoundariesDownTree
Empty text nodes next to another text node can always be safely
eliminated.
2023-02-01 14:19:52 +11:00
Neil Jenkins
e4ae7c2b81 Remove redundant <span> after replacing styles
It no CSS left after replacing with semantic equivalent, remove the
whole span.
2023-02-01 13:52:53 +11:00
Neil Jenkins
168033d25d Fix duplicate CSS created when replacing styles
When extracting the <span> CSS, a bug in refactoring meant we were not
removing it from the original node.
2023-02-01 13:52:11 +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
Neil Jenkins
c2df8eba45 Release v1.11.3
Now with updated build files…
2021-11-01 06:53:04 +11:00
Neil Jenkins
25d958f695 Update build files 2021-11-01 06:52:33 +11:00
Neil Jenkins
94210eee74 Release v1.11.2 2021-11-01 06:50:39 +11:00
Limon Monte
59a03a0f9a Do not publish unnecessary files to npm 2021-10-25 21:36:14 +11:00
Limon Monte
c045ec0df5 allow leading tabs when pasting 2021-10-25 21:35:34 +11:00
Robert O'Leary
8ff042dd22 Add Teamwork Desk to list of production uses
Hi,

We've been successfully using Squire in Teamwork Desk for several years. We've really found it to be the best tool for the job, in terms of formatting and simplicity when it comes to sending emails (which is the main driver of Teamwork Desk). So it'd be cool if you could add it to the list of places it is being used in production successfully!
2021-04-08 10:36:23 +10:00
Neil Jenkins
2687063248 Add SnappyMail to list of Squire users 2021-02-05 15:54:22 +11:00
Neil Jenkins
660a90afc7 Add Google Earth to list of Squire users 2021-02-05 15:24:52 +11:00
Neil Jenkins
3dd46c85df Release v1.11.1 2021-02-05 14:28:45 +11:00
Neil Jenkins
108ff8f475 Use sanitizeToDOMFragment fn for undo/redo
The content should be safe anyway as it will already have been sanitised,
however mXSS attacks are still a slight risk so safer to always run it through
the sanitiser.
2021-02-05 14:26:38 +11:00
Neil Jenkins
df2201038b Release v1.11.0 2021-02-03 13:40:40 +11:00
Limon Monte
c6e2498639 support \ in setKeyHandler() 2021-02-02 15:36:02 +11:00
Limon Monte
a9d8e60714 support / in setKeyHandler() 2021-02-02 15:36:02 +11:00
djmaze
724611477d Bugfix: decreaseBlockQuoteLevel removed all levels 2020-09-09 16:29:34 +10:00
Neil Jenkins
19f73d162f Fix Android Chromium 85 closes keyboard on selection change
The previous workaround no longer works. You still can't use removeAllRanges
(that closes the keyboard too), but we can use the setBaseAndExtent API instead.
2020-09-02 15:39:29 +10:00
Neil Jenkins
c78bd4aac9 If text == html, only copy as plain text
It must be plain text if they're the same, and this helps avoid a Safari bug
(when we can) where when you copy HTML and then paste it in Pages/Numbers, it
gets the charset wrong and mangles non-ASCII characters.
2020-07-27 11:16:47 +10:00
Jasper Spaans
42572d71e4 Add StartMail to list of providers using Squire.
Also fixes a typo.
2020-07-23 22:08:38 +10:00
Neil Jenkins
e46b2e4881 Only cleanupBrs on copy if using innerText
This is a fix for Firefox's inner text handling, so if we're not using that
don't bother.
2020-07-20 10:56:23 +10:00