Commit Graph

236 Commits (c0ce6e8161bea837a9e4ce59dc99aaf9600c290b)

Author SHA1 Message Date
Jorik Schellekens c0ce6e8161 Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into joriks/eslint-config 2020-07-20 20:44:52 +01:00
Michael Telatynski 7a05476c50 add missing types
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-20 17:10:08 +01:00
Michael Telatynski 06cc76f7d8 mark some things as public
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-20 16:34:52 +01:00
Michael Telatynski ed0d9973b7 Switch to a discriminated unions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-20 16:33:53 +01:00
Michael Telatynski 2bf5e4b142 clean up
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-15 09:49:02 +01:00
Michael Telatynski 8812f98b35 Convert editor to TypeScript
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-15 09:45:45 +01:00
Jorik Schellekens 7699aafcaf Use new eslint package- fix lint issues in ts and js 2020-06-23 17:01:19 +01:00
Travis Ralston 803b7bb30f
Merge pull request #4694 from justin-sleep/remove-escape-backslashes
Remove escape backslashes in non-Markdown messages
2020-06-17 11:06:04 -06:00
Michael Telatynski ef80a0b0b4
avoid negatives 2020-06-16 14:06:42 +01:00
Michael Telatynski fcd3ebe051 Fix case-sensitivity of /me to match rest of slash commands
also better error handling for attempted runs of unimplemented commands
2020-06-16 00:41:21 +01:00
Justin Sleep bdc451d66b Remove escape backslashes in non-Markdown messages 2020-06-03 17:08:13 -05:00
Bruno Windels 0c5c2501e6 remove prefixes as we're using data urls now 2020-05-06 12:23:03 +02:00
Sergey Shpikin a97a3cea51 Make avatars in pills occupy the entire space using cropping
Signed-off-by: Sergey Shpikin <rkfg@rkfg.me>
2020-04-23 10:55:49 +03:00
Michael Telatynski 9c1939b756 match all, not just first instance of tokens to escape
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-04-15 02:31:30 +01:00
Michael Telatynski 4454db30d6 Escape opening square bracket too
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-04-15 01:02:08 +01:00
Michael Telatynski cb10640eaf detslint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-04-15 00:53:35 +01:00
Michael Telatynski c72139fc3f Convert serialize and deserialize to TypeScript
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-04-15 00:49:08 +01:00
Michael Telatynski 95eaf94cd8 Fix pills being broken by unescaped characters
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-04-15 00:40:38 +01:00
J. Ryan Stinnett 7ad8eeb906 Fix composer touch bar flickering on keypress in Chrome
This changes our selection state handling to leave things alone if the browser's
state already matches what we want. This avoids strange side effects like the
touch bar flickering on each key press in Chrome.

Fixes https://github.com/vector-im/riot-web/issues/9299
2020-03-04 14:35:11 +00:00
Bruno Windels dc85346e5c
Merge pull request #4102 from matrix-org/bwindels/aliasautocomplete
Use alt_aliases for pills and autocomplete
2020-02-24 12:18:07 +00:00
Bruno Windels 13b08b5fcc
Revert "Fix escaped markdown passing backslashes through" 2020-02-24 11:27:22 +00:00
Michael Telatynski e799691573 Apply null-guard to room pills for when we can't fetch the room
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-21 14:14:24 +00:00
Bruno Windels 16815a752b use alt_aliases instead of aliases to match a pill to a room
when deserializing a pill
2020-02-21 13:02:41 +01:00
Bruno Windels 8870da6c24 Add alt_aliases to room completion candidates
but don't match on name otherwise you see multiple entries per room
when searching for a room name

Also pass the roomId to the composer autocomplete, so
it's easier to we don't need to loop through all the rooms and
it's also easier accept room with local aliases as well in the future
2020-02-21 13:02:41 +01:00
Bob 9cf53aa9d8 Only return formatted text when necessary (for escaped chars)
Signed-off-by: Bob Rao <bob+git@vulpin.com>
2020-02-02 16:34:19 +11:00
BobVul fde30577e4 Fix escaped markdown passing backslashes through
Fixes https://github.com/vector-im/riot-web/issues/11230

Signed-off-by: Bob Rao <bob+git@vulpin.com>
2020-01-31 12:33:57 +11:00
Michael Telatynski 7e45979e00 change order of if or conditions as micro-optimization
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-01-30 20:59:30 +00:00
Michael Telatynski b84fd245b1 Fix room completion for invited rooms and upgraded rooms
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-01-30 18:03:45 +00:00
Michael Telatynski d7a4698db8
Merge pull request #3891 from matrix-org/t3chguy/fix_multi_paragraph_formatting
Fix paragraph-awareness of the composer formatting features
2020-01-23 13:31:12 +00:00
Michael Telatynski 13bb719a89 Add comment for operations loop 2020-01-23 11:22:22 +00:00
Michael Telatynski 832da062cc Improve trailing spurious breaks + tests 2020-01-22 13:37:27 +00:00
Michael Telatynski b5e902e1f2 Fix escaping commands using double-slash //, e.g //plain sends `/plain` 2020-01-21 15:55:21 +00:00
Michael Telatynski b2aba6db35 Initial attempt to make toggleInlineFormat paragraph-aware 2020-01-21 15:32:32 +00:00
Travis Ralston 1b4ab856c9 Assume the position is at the end when the offset has no last part
We get an NPE when the user cuts their entire message, and this fixes it.
2020-01-15 21:05:00 -07:00
Travis Ralston d56f0f2a25 Convert many imports to handle ES6 exports
Reliant upon https://github.com/matrix-org/matrix-react-sdk/pull/3761
2019-12-22 21:04:42 -07:00
Michael Telatynski 93ecc9839b Fix linty failures 2019-10-22 13:49:02 +01:00
Tulir Asokan 75bcc3f849
Update src/editor/deserialize.js
Co-Authored-By: Bruno Windels <bruno@windels.cloud>
2019-10-18 19:58:55 +03:00
Tulir Asokan a95f7be22d Persist list indexes when editing
Signed-off-by: Tulir Asokan <tulir@maunium.net>
2019-10-13 14:31:32 +03:00
Tulir Asokan 29367766fd Fix "decend" typo
Signed-off-by: Tulir Asokan <tulir@maunium.net>
2019-10-13 14:31:32 +03:00
Tulir Asokan a160bdf4df Persist code block language when editing
Signed-off-by: Tulir Asokan <tulir@maunium.net>
2019-10-13 14:31:32 +03:00
Bruno Windels 905aa81bf8 safeguard if the offsetnode is null when determining caret position 2019-10-10 16:39:41 +02:00
Travis Ralston fc66e69c02 Rename RoomPermalinkCreator -> Permalinks due to scope
The file handles more than just a RoomPermalinkCreator, so we should name it accordingly.
2019-09-30 20:39:58 -06:00
Travis Ralston ce0a534db1 Fix pills for CIDER too 2019-09-30 20:37:24 -06:00
Bruno Windels 4933b9b050
Merge pull request #3468 from matrix-org/bwindels/cider-autocomplete-fixes
Fix: when using autocomplete, ensure command is not sent as text, and @room notifs gets needed suffix
2019-09-23 13:57:07 +00:00
Bruno Windels 04720db2a3 don't append extra newline after blockquote anymore
now that P prepends newline when not first element
2019-09-23 15:33:30 +02:00
Bruno Windels 2445421270 add extra newline before P tags (when not first node) 2019-09-23 15:06:22 +02:00
Bruno Windels 0a663398ed Use underscore for <em> when doing html > md
to be consistent with the format bar, which also uses underscores for italics
2019-09-23 14:59:53 +02:00
Bruno Windels 40f7fa8f94 add suffixes from provider to room and @room completions
this prevents the @room not working when not typing an extra space
2019-09-23 14:40:41 +02:00
Bruno Windels 228905bec2 insert command completion as command part (instead of plain)
this prevents the command being sent as plain text

this adds a `type` property to completions to decide which
parts should be inserted into the composer, hence deciding how
they will be rendered.
2019-09-23 14:39:19 +02:00
Bruno Windels 26bd694c6a support toggling inline formatting 2019-09-06 16:25:55 +02:00