Commit Graph

21 Commits (678fd37549c81f17d09669171a17b37cf4d34ae9)

Author SHA1 Message Date
Bruno Windels 23465c696f dont jump to next part when inserting at *start* of uneditable part 2019-05-24 10:08:47 +02:00
Bruno Windels 6b1134bdf0 add matrix foundation copyright header 2019-05-22 16:16:32 +02:00
Bruno Windels 690ee63bb4 prevent zero-length removals from deleting uneditable parts
This solves an issue where, when backspacing the proceeding character next to a pill,
chrome reports the caret as being in the pill node, not at
the start of the proceeding text node. This would cause the pill
to be removed together with proceeding character.

This is a bug in any case, removing 0 characters
shouldn't remove the part
2019-05-16 19:14:24 +01:00
Bruno Windels 245f48a22c set caret on mount as we usually do, so FF doesn't enter 2 newlines 🤯 2019-05-16 18:39:20 +01:00
Bruno Windels f27607a74c don't put cursor position in NewlinePart after adding it
You can't append to it anyway, so mark it uneditable and skip
uneditable parts if that's where an edit ended up.

This has the added advantage that if there is text after a newly
insert pill, the cursor will be put just before it rather than
in the pill, after the last character.
2019-05-16 17:58:22 +01:00
Bruno Windels d83e278f6b PR feedback, cleanup 2019-05-15 09:46:08 +01:00
Bruno Windels fd31e793d1 fix lint 2019-05-14 15:49:53 +01:00
Bruno Windels a3b02cf0cc make logging quiet 2019-05-14 15:38:16 +01:00
Bruno Windels 7ebb6ce621 WIP commit, newlines sort of working 2019-05-14 15:38:16 +01:00
Bruno Windels 7a85dd4e61 after completion, set caret in next part at start
instead of end of current part
2019-05-14 15:38:16 +01:00
Bruno Windels 2c3453d307 put caret after replaced part if no caretOffset is given by autocomplete 2019-05-14 15:38:16 +01:00
Bruno Windels 1a577eed11 take non-editable parts into account for new caret position 2019-05-14 15:38:16 +01:00
Bruno Windels 580a89875a fix autocompl. not always appearing/being updated when there is no part 2019-05-14 15:38:16 +01:00
Bruno Windels 22587da5ff close autocomplete on enter 2019-05-14 15:38:16 +01:00
Bruno Windels 64b171198c rerender through callback instead of after modifying model
this way rendering is centralized and we can better rerender
from interaction in the autocompleter
(we didn't have access to caret before)
2019-05-14 15:38:16 +01:00
Bruno Windels aa1b4bb91e keep auto complete code close to each other 2019-05-14 15:38:16 +01:00
Bruno Windels 5e6367ab57 basic support for non-editable parts
e.g. pills, they get deleted when any character of them is removed
later on we also shouldn't allow the caret to be set inside of them
2019-05-14 15:38:16 +01:00
Bruno Windels 1330b438d6 initial support for auto complete in model and parts
also move part creation out of model, into partcreator, which
can then also contain dependencies for creating the auto completer.
2019-05-14 15:38:16 +01:00
Bruno Windels 0f38753dba some comments 2019-05-14 15:38:16 +01:00
Bruno Windels 76bb56a2bf initial hookup editor code with react component 2019-05-14 15:38:16 +01:00
Bruno Windels 9f98a6c0e6 add converted prototype code 2019-05-14 15:38:16 +01:00