Commit graph

338 commits

Author SHA1 Message Date
Matthew Hodgson
864a33f978 switch to using 'code' for both blocks & marks to match md-serializer 2018-05-23 20:12:13 +01:00
Matthew Hodgson
b0ff61f7ef switch code schema to match slate-md-serializer 2018-05-23 14:12:08 +01:00
Matthew Hodgson
fc1c4996fc slate-md-serializer 3.1.0 now escapes correctly 2018-05-23 02:15:34 +01:00
Matthew Hodgson
6fba8311f9 escape blockquotes correctly
and fix NPE
2018-05-23 02:09:37 +01:00
Matthew Hodgson
794a60b9f8 refocus editor immediately after executing commands
and persist selections correctly across blur/focus
2018-05-23 01:36:21 +01:00
Matthew Hodgson
e7a4ffaf45 fix emojioneifying autoconverted emoji 2018-05-23 00:52:00 +01:00
Matthew Hodgson
cace5e8bfc fix bug where selection breaks after inserting emoji 2018-05-23 00:41:46 +01:00
Matthew Hodgson
11cea61661 refocus editor after clicking on autocompletes 2018-05-21 12:28:08 +01:00
Matthew Hodgson
7de45f8b7b make quoting work 2018-05-21 03:48:59 +01:00
Matthew Hodgson
b616fd025e comment out all the tests for now 2018-05-20 23:34:06 +01:00
Matthew Hodgson
e460cf35e0 hide formatting bar for MD editor 2018-05-20 22:48:40 +01:00
Matthew Hodgson
f981d7b729 unify buttons on the node type names, and make them work 2018-05-20 22:39:40 +01:00
Matthew Hodgson
d799b7e424 refactor roundtripping into a single place
and fix isRichTextEnabled to be correctly camelCased everywhere...
2018-05-20 16:30:39 +01:00
Matthew Hodgson
aac6866779 switch back to using commonmark for serialising MD when roundtripping
and escape MD correctly when serialising via slate-md-serializer
2018-05-20 14:33:14 +01:00
Matthew Hodgson
e9cabf0e85 add pill and emoji serialisation to Md 2018-05-20 03:17:51 +01:00
Matthew Hodgson
a0d88a829d support sending inlines from the RTE.
includes a horrific hack for sending emoji until
https://github.com/ianstormtaylor/slate/pull/1854 is merged
or otherwise solved
2018-05-20 02:53:32 +01:00
Matthew Hodgson
d76a2aba9b use <p/> as our root node everywhere and fix blank roundtrip bug 2018-05-20 01:07:25 +01:00
Matthew Hodgson
c3a6a41e5d support links in RTE 2018-05-20 00:49:29 +01:00
Matthew Hodgson
f2116943c8 switch schema to match the MD serializer 2018-05-20 00:17:11 +01:00
Matthew Hodgson
65f0b05719 fix typo 2018-05-19 23:40:22 +01:00
Matthew Hodgson
572a31334f add h4, h5 and h6 2018-05-19 23:34:30 +01:00
Matthew Hodgson
1f05aea884 make HTML pasting work 2018-05-19 23:33:07 +01:00
Matthew Hodgson
1536ab433a make file pasting work again 2018-05-19 22:05:31 +01:00
Matthew Hodgson
d426c3474f fix strikethough & code, improve shift-return & backspace 2018-05-19 21:36:22 +01:00
Matthew Hodgson
58670cc3e5 exit list more sanely on backspace 2018-05-19 21:14:39 +01:00
Matthew Hodgson
a4d9338cf0 let backspace delete list nodes in RTE 2018-05-19 20:38:07 +01:00
Matthew Hodgson
167742d900 make RTE sending work 2018-05-19 20:28:38 +01:00
Matthew Hodgson
089ac337f4 remove unused html serializer 2018-05-18 15:22:24 +01:00
Matthew Hodgson
e51554c626 actually hook up RTE 2018-05-17 02:13:17 +01:00
Matthew Hodgson
ae208da805 nudge towards supporting formatting buttons in MD 2018-05-17 00:01:23 +01:00
Matthew Hodgson
4eb6942211 let onChange set originalEditorState 2018-05-15 01:16:06 +01:00
Matthew Hodgson
12a56e8b8e remove spurious comment 2018-05-15 00:59:55 +01:00
Matthew Hodgson
c1000a7cd5 emojioneify the composer
and also fix up the selectedness CSS for pills and emoji
2018-05-14 03:02:12 +01:00
Matthew Hodgson
7ecb4e3b18 remove dead removeMDLinks code 2018-05-13 23:35:39 +01:00
Matthew Hodgson
7405b49b44 unify setState() and onChange()
also make emoji autocomplete work again
also remove the onInputContentChanged prop
also slateify the onInputStateChanged prop
2018-05-13 23:34:00 +01:00
Matthew Hodgson
a247ea2f77 delete duplicate propTypes(!!!) 2018-05-13 22:43:20 +01:00
Matthew Hodgson
ddfe0691c4 fix insert_mention 2018-05-13 22:41:39 +01:00
Matthew Hodgson
dd0726f068 fix navigating history downwards on tall messages; remove obsolete code 2018-05-13 21:17:43 +01:00
Matthew Hodgson
79f7c5d6ab remove // support, as it never worked
if you want to escape a /, do it with \/ or just precede with a space
2018-05-13 03:29:56 +01:00
Matthew Hodgson
4c3588d260 don't lose focus after a / command 2018-05-13 03:26:22 +01:00
Matthew Hodgson
5605439e76 autocomplete polishing
* suppress autocomplete when navigating through history
* only search for slashcommands if in the first block of the editor
* handle suffix returns from providers correctly
* fix bugs when pressing ctrl-a, typing and then tab to complete a replacement by collapsing selection to anchor when inserting a completion in the editor
2018-05-13 03:17:14 +01:00
Matthew Hodgson
877a6195ae unbreak history scrolling for pills & emoji 2018-05-13 00:54:01 +01:00
Matthew Hodgson
33eaa84bdf fix NPEs when deleting mentions 2018-05-13 00:48:52 +01:00
Matthew Hodgson
c91dcffe82 fix cursor behaviour around pills 2018-05-13 00:40:54 +01:00
Matthew Hodgson
9c0c806af4 correctly send pills in messages 2018-05-12 20:04:58 +01:00
Matthew Hodgson
d7c2c8ba7b include the plaintext representation of a pill within it 2018-05-12 16:21:36 +01:00
Matthew Hodgson
410a1683fe make autocomplete selection work 2018-05-12 01:10:38 +01:00
Matthew Hodgson
8b2eb2c400 make history work again 2018-05-08 01:54:06 +01:00
Matthew Hodgson
ff42ef4a58 make it work for MD mode (modulo history) 2018-05-06 22:08:36 +01:00
Matthew Hodgson
190f6d9483 make slate actually work as a textarea 2018-05-06 15:27:27 +01:00
Matthew Hodgson
a2233a48c2 stub out yet more 2018-05-06 01:18:26 +01:00
Matthew Hodgson
05eba3fa32 stub out more until it loads... 2018-05-06 00:18:11 +01:00
Matthew Hodgson
f4ed820b6f fix stubbing 2018-05-05 23:38:14 +01:00
Matthew Hodgson
e62e43def6 comment out more draft stuff 2018-05-05 23:25:04 +01:00
Matthew Hodgson
02947063d3 Merge branch 'develop' into matthew/slate 2018-05-05 22:45:44 +01:00
Michael Telatynski
db55f87699
avoid .done and .then anti-pattern
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-05-01 18:14:35 +01:00
Michael Telatynski
68dd57f56e
rename two methods
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-04-27 11:47:18 +01:00
Matthew Hodgson
75a2be1a8d WIP (doesn't build yet) replacing draft with slate 2018-04-23 01:13:18 +01:00
Michael Telatynski
f765db7d16
only clear reply_to_event if there was one to begin with
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-04-07 12:18:53 +01:00
Michael Telatynski
9c2e3e25f0
clear reply_to_event at queue not send time
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-04-04 10:34:39 +01:00
Michael Telatynski
0ed3563748
clear quoting event even on send fail, as then we can click retry
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-03-16 00:03:50 +01:00
Michael Telatynski
14f29e4740
fix the bugs Tulir found - THANKS
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-03-09 23:37:42 +00:00
Michael Telatynski
df56a67fda
Add reply fallback and run gen-i18n
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-03-04 12:39:34 +00:00
Michael Telatynski
665ddccb0d
restrict to m.text for now
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-02-20 15:45:25 +00:00
Michael Telatynski
90f9badbf3
s/Reply/ReplyThread/
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-02-20 15:40:19 +00:00
Michael Telatynski
34b427d15e
s/quote_event/reply_to_event/
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-02-19 23:41:07 +00:00
Michael Telatynski
fbb950e064
mass s/Quote/Reply
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-02-10 12:38:25 +00:00
Michael Telatynski
1c3d8cbe6e
initial refactor of Replies to use B explicit over-the-wire format
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-02-10 11:19:43 +00:00
Michael Telatynski
5764280588
Persist contentState when sending SlashCommand via MessageComposerInput
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-01-29 09:09:22 +00:00
Michael Telatynski
23bd612730
Focus composer when clicking Reply (quote event)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-01-11 19:29:00 +00:00
Michael Telatynski
1bc9d344ae
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/nvl/rich_quoting
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

# Conflicts:
#	src/components/views/messages/TextualBody.js
2018-01-10 11:54:58 +00:00
David Baker
5aed77c752
Merge pull request #1677 from aidalgol/PropTypes
Remove use of deprecated React.PropTypes
2018-01-05 11:53:55 +00:00
nostradamos
2189fe9256 removed console.log 2018-01-03 01:52:02 +01:00
nostradamos
e543f55572 refactored code 2018-01-03 01:50:03 +01:00
nostradamos
36df3acf4d Merge remote-tracking branch 'origin/develop' into fix_riot_web_4821 2018-01-02 23:07:47 +01:00
nostradamos
03f88df66e Make the scrolling compatible with our riot-web fix for https://github.com/vector-im/riot-web/issues/4821 2018-01-02 22:44:18 +01:00
Aidan Gauland
35780f5ae0 Remove use of deprecated React.PropTypes
Replace all uses of React.PropTypes with PropTypes and importing PropTypes from
'prop-types'.
2017-12-26 14:03:18 +13:00
Michael Telatynski
5c229b9ef8
DRY matrix.to link generation so it is all changeable in one class
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-12-12 23:33:40 +00:00
Michael Telatynski
4666ac7c83
hide rich quoting behind flags, retaining original quoting for now
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-12-12 23:29:43 +00:00
Michael Telatynski
0f85391587
Implement Rich Quoting/Replies
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-12-10 12:50:41 +00:00
David Baker
0d38e7510d
Merge pull request #1600 from matrix-org/dbkr/udd_no_auto_show
Don't Auto-show UnknownDeviceDialog
2017-12-08 16:33:25 +00:00
Luke Barnard
363fe04a10 isCtrlOrCmdKeyEvent -> isOnlyCtrlOrCmdKeyEvent 2017-12-01 10:44:00 +00:00
Luke Barnard
fe81fcb8c6 Factor out isCtrlOrCmdKeyEvent, use that in TagPanel
as opposed to the incorrect ctrl || meta
2017-12-01 10:30:49 +00:00
David Baker
196eafdc7f Merge remote-tracking branch 'origin/develop' into dbkr/udd_no_auto_show 2017-11-16 15:59:16 +00:00
Luke Barnard
dad797d4a2 Run linting --fix 2017-11-16 13:19:36 +00:00
David Baker
f8fc6dc83e Merge remote-tracking branch 'origin/develop' into dbkr/udd_no_auto_show 2017-11-15 12:11:33 +00:00
David Baker
b1ec430523 Remove now-unused dispatches 2017-11-09 16:09:12 +00:00
Travis Ralston
289b0c2b6a
Merge branch 'develop' into travis/granular-settings 2017-11-07 14:55:12 -07:00
David Baker
df5c6470e8 get dict syntax right 2017-11-06 22:01:23 +00:00
David Baker
08d006d112 PR feedback 2017-11-06 17:15:09 +00:00
David Baker
adc4290451 Pillify room notif pills in composer 2017-11-06 15:11:42 +00:00
Travis Ralston
8282534f87 Add SettingsLevel enum; Move settings to own file.
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-11-03 23:19:45 -06:00
Travis Ralston
893c39bfbe Merge branch 'develop' into travis/granular-settings 2017-11-03 22:00:07 -06:00
David Baker
498b117d5a copyrights 2017-11-02 18:01:28 +00:00
David Baker
4953d4de4d Give autocomplete providers the room they're in
Removes the gut-wrenching that RoomView does to jam the user list
into the user autocomplete provider.
2017-11-02 17:51:08 +00:00
Travis Ralston
ae10a11ac4 Convert synced settings to granular settings
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-10-29 01:43:52 -06:00
Luke Barnard
d3f9a3aeb5 Run eslint --fix
Fixing 1000s of lint issues. Some rules cannot be `--fix`ed but this goes some way to linting the entire codebase.
2017-10-11 17:56:17 +01:00
Stefan Parviainen
d4929b558e Add dummy translation function to mark translatable strings
Signed-off-by: Stefan Parviainen <pafcu@iki.fi>
2017-09-22 21:43:27 +02:00
Luke Barnard
8ed5422a45 Fix click to insert completion
And remedy weird API in the process. Autocomplete now exposes `onSelectionChange` to indicate that the user has selected another completion, rather than returning the chosen completion via onUpArrow etc.

Fixes vector-im/riot-web#4835
2017-08-23 16:22:14 +01:00
Luke Barnard
6b1b643d41 Merge branch 'develop' into luke/store-history-as-raw-content 2017-08-14 16:42:22 +01:00