Commit Graph

357 Commits

Author SHA1 Message Date
David Baker
b9719abbc2 Oops, missed some asyncs 2019-01-09 19:36:34 +00:00
David Baker
f269b5fbbc Fix spaceless async in ignored files too 2019-01-09 19:14:30 +00:00
Bruno Windels
254427461d fix PR feedback 2019-01-09 12:48:13 +01:00
Bruno Windels
c8243357ea disable editor history/persistence when in grid to avoid pesky bug 2018-12-13 13:01:59 +01:00
Bruno Windels
44200a6f78 only listen and dispatch to room-local dispatcher in room view, composer 2018-12-13 13:01:59 +01:00
Bruno Windels
df8539d6bc pass the RoomViewStore down with a prop instead of global var.
this will allow to have more than 1 RoomView further on
2018-12-13 12:59:18 +01:00
Aaron Raimist
49ce4ef117
eslint --fix src/
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-26 22:50:38 -05:00
David Baker
156ffd1334 Fix autoreplacement of ascii emoji
More slate API updates in code paths I didn't test

Fixes https://github.com/vector-im/riot-web/issues/7509
2018-10-26 17:01:44 +01:00
David Baker
5e81e5b8b8 Fix variable scope 2018-10-25 15:07:19 +01:00
David Baker
401f6333ed Do...while loops are a thing 2018-10-25 14:54:32 +01:00
David Baker
78d8d22457 Fix emoji replacement in composer
* Re-scan the slate document tree on each emoji replacement since
   doing a replacement will invalidate all the offsets we have.
 * Reset the emoji regex each time we use it.

Fixes https://github.com/vector-im/riot-web/issues/7550
2018-10-24 16:46:06 +01:00
Aaron Raimist
a66dbccef8
Fix lint errors in MessageComposerInput.js
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-11 22:46:55 -05:00
David Baker
3efc09586b More API changes 2018-10-11 10:47:36 +01:00
David Baker
4d1f2cdfa9 Fix quote post slate update
Missed API update
2018-10-11 10:29:55 +01:00
David Baker
4e1fabd140 Remove spurious ...atributes in the wrong place
We already have it above
2018-10-09 16:05:14 +01:00
David Baker
c1f51a76dd Update to new version of slate
Lots of fixes here as a lot of the API has changed (eg. anchorKey /
offsetKey are now anchor.key and offset.key, and collapseFocusToThing
is moveFocusToThing).

Also changes the ref to a function (sorry for lumping this into the
same PR).

Hopefully will fix https://github.com/vector-im/riot-web/issues/7105
2018-10-09 10:55:55 +01:00
Will Hunt
17915b5082
Merge branch 'develop' into hs/purge-irc-hack 2018-10-03 19:39:14 +01:00
Will Hunt
fe788486b7 Drop (IRC) suffix hacks 2018-10-03 19:34:06 +01:00
David Baker
9e64a22884 s/DidMount/WillMount/ in MessageComposerInput
This fixes the tests that broke with https://github.com/matrix-org/matrix-js-sdk/pull/717

This is because of https://github.com/vector-im/riot-web/blob/master/test/app-tests/joining.js#L63
which prevents the DOM nodes from actually ending up in the DOM, even though the react components
get rendered. This means that WillMount and WillUnmount are called, but not DidMount.

Using WillMount is more symmertrical anyway since the resulting teardown code must be in
WillUnmount (since there is no DidUnmount).
2018-09-06 11:44:13 +01:00
Michael Telatynski
f264075369
null-guard history properly
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-26 17:11:32 +01:00
Michael Telatynski
265e4267b8
remove faulty onBlur/onFocus code which caused selection to rollback
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-26 15:00:43 +01:00
Michael Telatynski
020e714b85
fix focus and too many <p>s after a Event>Quote in RT mode
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-24 15:54:24 +01:00
Michael Telatynski
afa19cd60d
make clicking autocomplete suggestions work again
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-24 13:48:05 +01:00
Michael Telatynski
93abb4b74b
workaround to prevent Slate getting too empty when undoing RT pastes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-20 15:06:27 +01:00
Michael Telatynski
855f8871b8
replace heuristic for the time being as it failed with inlines like pills. Fixes vector-im/riot-web#7059
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-18 16:50:07 +01:00
Michael Telatynski
88dddb628d
in MD mode forgo any Magic Rich Pasting conversion as its confusing
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-18 11:50:13 +01:00
Michael Telatynski
6bb88c0548
attempt to fix clash of Cmd-M on Mac. Should fix vector-im/riot-web#7047
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-18 11:28:48 +01:00
Michael Telatynski
3e956514b3
also prevent merge/skip on rich text pastes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-18 11:00:45 +01:00
Michael Telatynski
1a9de3fabe
fix undo on pasting plaintext content
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-18 10:58:27 +01:00
Michael Telatynski
f5856270cc
undo removal of stripping <p>s as it breaks HTML /mes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-18 10:48:54 +01:00
Michael Telatynski
19e5dc5799
do less rewriting for composer quote to prevent breaking pills
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-18 10:10:42 +01:00
Michael Telatynski
8bb08b1b75
fix focus on new editorState as it didn't have focus so broke when alt tab
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-18 10:10:11 +01:00
Michael Telatynski
720a728278
workaround for placeholder being shown when empty text but block. Fixes vector-im/riot-web#7042
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-17 16:13:33 +01:00
Michael Telatynski
1b467f6ca8
fix pasting of plaintext content (prevent loads of <p>s) Fixes vector-im/riot-web#7043
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-17 16:02:37 +01:00
Michael Telatynski
414908611d
prevent exception if there is no text node at anchor
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-17 13:48:15 +01:00
Michael Telatynski
688776bc10
allow enter to remove current block if its empty useful for lists
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-17 13:29:40 +01:00
Michael Telatynski
ff76b6a981
allow user to break out of blockquote/etc by hitting enter twice
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-17 12:30:22 +01:00
Michael Telatynski
1c24f1fd5a
fix 2nd typo in one PR :(
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-16 21:34:25 +01:00
Michael Telatynski
547e0ed52c
check if has some completions, not if >=0
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-16 21:30:04 +01:00
Michael Telatynski
3000099991
add additional checks for hiding autocomplete to prevent text calculation
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-16 21:27:52 +01:00
Michael Telatynski
bdbc2cbd38
disable spellCheck when the placeholder is shown because "unencrypted"
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-16 18:32:50 +01:00
Michael Telatynski
c7859fed1a
add heuristic to compare documents to prevent autocomplete flicker
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-16 18:27:06 +01:00
Michael Telatynski
2f1779751b
make the MessageComposerStore stateless for better performance
and inter-tab composition (by simplifying it. WIN-WIN)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-16 16:56:08 +01:00
Michael Telatynski
7405c5eff2
specify alternate history storage key to prevent conflicts with draft
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-12 16:35:42 +01:00
Michael Telatynski
b4bc09c335
null-guard savedState since now we're accessing its props
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-11 17:13:33 +01:00
Michael Telatynski
3e05bf19c5
hide autocomplete when moving caret to match existing behaviour
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-11 16:30:45 +01:00
Michael Telatynski
c3aef6e3a0
workaround for tommoor/slate-md-serializer#14
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-11 10:29:14 +01:00
Michael Telatynski
fd4f9679df
convert md<->rt if the stored editorState was in a different state
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-11 09:43:39 +01:00
Michael Telatynski
abbb69dc36
fix fn call, fixes usage of SlashCommands
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-10 17:35:13 +01:00
Michael Telatynski
100ecfe7ce
remove trailing spaces to make linter happy (no-trailing-spaces)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-10 10:29:52 +01:00