Sven Mäder
73130cad02
Refactor latex replace code
2021-04-01 12:09:51 +02:00
Clemens Zeidler
57cd8afbc4
Split ApplySelection into CompleteOrPrevSelection and CompleteOrNextSelection
...
When moving through the autocomplete selection list distinguish between
the following cases:
1) When there is no autocomplete window open, only open one and select
the first item when the CompleteOrPrevSelection /
CompleteOrNextSelection actions are emitted (e.g. by pressing SHIFT +
TAB, TAB)
2) Otherwise navigate through the selection list (e.g. SHIFT + TAB, TAB,
UP, DOWN)
- Remove references to raw keyboard events in autocomplete.ts
- Clarify the purpose of startSelection (previously onTab)
Signed-off-by: Clemens Zeidler <clemens.zeidler@gmail.com>
2021-03-29 13:38:03 +13:00
Travis Ralston
7c8c85161d
Merge pull request #5748 from SimonBrandner/compat-for-non-rich-text-clients
...
Show room alias in plain/formatted body
2021-03-11 11:29:26 -07:00
Šimon Brandner
d4f67d94a4
Use resourceId in plain body
...
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-03-11 18:53:06 +01:00
Šimon Brandner
62fa60f109
Use resourceId in formatted body
...
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-03-11 18:50:54 +01:00
Panagiotis
a1eabde3a3
fix: create a PillCandidatePart on the beginning of a part string
2021-03-11 19:14:04 +02:00
J. Ryan Stinnett
b12cf7912a
Merge pull request #5624 from SimonBrandner/show-room-name
...
Display room name in pills instead of address
2021-03-08 16:27:43 +00:00
Jaiwanth
d731e82fba
Fixed edit for markdown images
...
Signed-off-by: Jaiwanth <jaiwanth2011@gmail.com>
2021-03-01 22:44:48 +05:30
Michael Telatynski
c05eceef7f
Rework composer autocomplete to be smarter and not trap tab
2021-02-17 15:39:07 +00:00
Šimon Brandner
cb5237a18b
Display room name instead of alias
...
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-02-12 14:21:07 +01:00
Sven Mäder
ac1f9b4247
Add config keys for alternative patterns
2021-01-29 15:49:20 +01:00
Sven Mäder
bcc0697710
Remove /tex command
2021-01-29 13:05:49 +01:00
Sven Mäder
c4f0987487
Use TeX and LaTeX delimiters by default for serialize
2021-01-29 00:11:06 +01:00
Sven Mäder
d5c72b9d70
Fix linting error
...
Signed-off-by: Sven Mäder <maeder@phys.ethz.ch>
2020-12-22 13:31:58 +01:00
Sven Mäder
fb57123e25
Improve inline latex regex matching
...
Signed-off-by: Sven Mäder <maeder@phys.ethz.ch>
2020-12-22 12:18:38 +01:00
Sven Mäder
78b3f50bfd
Use LaTeX delimiters by default, add /tex command
...
Since parsing for $'s as maths delimiters is tricky, switch the default
to \(...\) for inline and \[...\] for display maths as it is used in
LaTeX. Add /tex command to explicitly parse in TeX mode, which uses
$...$ for inline and $$...$$ for display maths.
Signed-off-by: Sven Mäder <maeder@phys.ethz.ch>
2020-12-21 00:05:22 +01:00
macekj
0c85cb587d
Merge branch 'develop' into emoji_quick_shortcut
2020-12-04 11:05:50 -05:00
macekj
ba8d02a808
add quick shortcut emoji feature and tests
...
Signed-off-by: macekj <macekj@umich.edu>
2020-11-17 17:36:58 -05:00
Aleks Kissinger
839bae21ae
made single and double $ default delimiters
2020-11-10 18:18:53 +00:00
Aleks Kissinger
2204e6c64e
generate valid block html for commonmark spec
2020-10-25 18:32:24 +00:00
Aleks Kissinger
06b20fad95
removed implicit "this"
2020-10-23 18:49:56 +01:00
Aleks Kissinger
cc713aff72
add fallback output in code block AFTER markdown processing
2020-10-14 09:35:57 +01:00
Aleks Kissinger
aafaf34233
Merge branch 'develop' into katex
2020-10-10 19:31:46 +01:00
Aleks Kissinger
96742fc309
latex math as labs setting
2020-10-10 16:32:49 +01:00
Michael Telatynski
af4c95e267
apply to whitespace in general
...
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-09-29 14:17:44 +01:00
Michael Telatynski
ffa7ceb70e
Trim range when formatting so that it excludes leading/trailing spaces
...
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-09-29 14:15:20 +01:00
Aleks Kissinger
aded3c9de2
cosmetic changes (lint)
2020-09-22 11:54:23 +01:00
Aleks Kissinger
4df8754aad
allow custom latex delimiters in config.json
2020-09-21 11:00:39 +01:00
Aleks Kissinger
24a1834f9b
support multi-line and escaped $
2020-09-21 09:00:24 +01:00
Aleks Kissinger
7e6d7053e0
Revert "send fallback in pre tags, not code" (code looks better)
...
This reverts commit e4448ae1ad
.
2020-09-20 17:02:27 +01:00
Aleks Kissinger
e4448ae1ad
send fallback in pre tags, not code
2020-09-20 16:52:29 +01:00
Aleks Kissinger
428a6b94ff
math off by default, enable with latex_maths flag
2020-09-20 15:07:12 +01:00
Aleks Kissinger
e78734bbf6
Deserialize back to math delimiters for editing
2020-09-20 14:20:35 +01:00
Aleks Kissinger
becc79d67a
send tex math as data-mx-maths attribute
2020-09-20 12:59:22 +01:00
J. Ryan Stinnett
ce226ab534
Replace Riot with Element in docs and comments
...
This only covers the simple cases of references to issues and repos. More
complex areas, such as deployment scripts, will be handled separately.
Part of https://github.com/vector-im/element-web/issues/14864
2020-08-03 18:33:36 +01:00
Michael Telatynski
c578026474
Merge branches 'develop' and 't3chguy/fix/13641' of github.com:matrix-org/matrix-react-sdk into t3chguy/fix/13641
...
Conflicts:
src/editor/parts.ts
2020-07-24 08:18:20 +01:00
Michael Telatynski
c8832f5582
Fix autocompletion of Community IDs
...
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-23 14:47:42 +01:00
Michael Telatynski
adba9415b3
Fix Firefox composer regression exception
...
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-23 09:25:01 +01:00
Hubert Chathi
cbe4f04cd7
Merge pull request #5029 from uhoreg/sanitize_language
...
don't syntax highlight languages that begin with "_"
2020-07-21 13:12:51 -04:00
Michael Telatynski
93884cb89b
Update PlainBasePart to only split on space boundaries
...
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-21 17:50:24 +01:00
Hubert Chathi
2ce493307e
don't syntax highlight languages that begin with "_"
2020-07-21 12:47:40 -04:00
Jorik Schellekens
d86eb5eb9e
Lint new new code
2020-07-20 20:48:27 +01:00
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
Bruno Windels
5014b606db
Merge pull request #3391 from matrix-org/bwindels/cider-format-history
...
New composer: ensure undo history is persisted before applying formatting
2019-09-06 09:28:18 +00:00
Bruno Windels
df4762871a
Merge pull request #3392 from matrix-org/bwindels/cider-paste-plain
...
New composer: fix pasting from word processors
2019-09-06 09:22:37 +00:00
Bruno Windels
6b104f6344
Merge pull request #3393 from matrix-org/bwindels/cider-fix-lastcaret
...
New composer: fix needing to push arrow-up twice after sending first message after switching to a room
2019-09-06 09:22:10 +00:00
Bruno Windels
9dac91a70d
ensure step before formatting is persisted in undo history
2019-09-06 11:20:24 +02:00
Bruno Windels
0252c7ae37
force pasting as plain text in new composer
2019-09-06 11:10:41 +02:00
Bruno Windels
2596281a7c
update last caret from update callback instead of input event
...
many editor updates are not caused by an input event, so
the last caret wasn't always up to date.
Updating the caret from the update callback ensures that every
time the editor contents is changed, the last caret is updated.
2019-09-06 11:09:01 +02:00
Bruno Windels
02681d50b9
Merge pull request #3386 from matrix-org/bwindels/cider-formatbar
...
New composer: show format bar on selection
2019-09-06 08:38:01 +00:00
Bruno Windels
d2949babcd
copyright is solely assigned to matrix foundation now, copy paste error
2019-09-06 10:29:12 +02:00
Bruno Windels
124b7135cd
make sure the update callback gets a caret when calling reset
2019-09-05 17:54:08 +02:00
Bruno Windels
2ea556e0b4
support update callback setting selection instead of caret
2019-09-04 16:40:34 +02:00
Bruno Windels
037ac29c57
be more forgiving with offset that don't have atNodeEnd=true
...
if index is not found, it means the last position should be returned
if there is any.
We still return -1 for empty documents, as index should always point
to a valid part if positive.
2019-09-04 16:40:34 +02:00
Bruno Windels
42c37d8293
fixup: improve quote and code block newline handling
2019-09-04 16:40:34 +02:00
Bruno Windels
e0668e8517
improve algorithm to reduce selection to text node + charactar offset
...
this follows the documentation of {focus|anchor}{Offset|Node} better
and was causing problems for creating ranges from the document selection
when doing ctrl+A in firefox as the anchorNode/Offset was expressed
as childNodes from the editor root.
2019-09-04 16:40:34 +02:00
Bruno Windels
4691108a16
only increase offset if caret hasn't been found yet
...
also rename caret away as this isn't used for the caret solely anymore
2019-09-04 16:40:34 +02:00
Bruno Windels
7a01d1407f
make _replaceRange internal only
2019-09-04 16:40:34 +02:00
Bruno Windels
6e694c113a
add support for inline/block code formatting
2019-09-04 16:40:34 +02:00
Bruno Windels
b35a3531bb
move quote formatting out of react component
2019-09-04 16:40:34 +02:00
Bruno Windels
b72d1a78ec
move inline formatting code out of react component
2019-09-04 16:40:34 +02:00
Bruno Windels
47d8d86bbe
whitespace (in model)
2019-09-04 16:40:23 +02:00
Bruno Windels
c15dfc3c05
make Range start and end public
2019-09-04 16:38:42 +02:00
Bruno Windels
77b14beb1f
add getter for intersecting parts of range, and total length
...
we'll need this when replacing selection, to preserve
newlines, etc ... in the selected range (e.g. we can't just
use range.text).
2019-09-04 16:35:03 +02:00
Bruno Windels
48f1bf1816
sort positions in Range constructor, so start always comes before end
2019-09-04 16:35:03 +02:00
Bruno Windels
4575aaa9f6
Merge pull request #3382 from matrix-org/bwindels/escape-command-slash
...
New composer: allow escaping the first slash to not write a command
2019-09-03 16:04:23 +00:00
Bruno Windels
0d02ab59d6
allow starting a range with both positions known already
...
we'll need this to start a range for the selection
2019-09-03 16:00:50 +02:00
Bruno Windels
eb87301855
allow getting the DocumentOffset for any node+offset, not just focusNode
...
we need this to get both offsets of the selection boundaries
getSelectionOffsetAndText offers the extra flexibility,
getCaretOffsetAndText keeps the old api for focusNode/focusOffset
Also did some renaming here now that it's not just for the caret anymore
2019-09-03 15:58:50 +02:00
Bruno Windels
648ae37ff4
make DocumentOffset compatible with what is returned from dom/getCaret
...
so we can return a DocumentOffset from there without breakage
2019-09-03 15:58:05 +02:00
Bruno Windels
712c3e5450
allow escaping the first slash to not write a command
2019-09-02 17:53:14 +02:00
Bruno Windels
6a0842d1ab
Merge pull request #3379 from matrix-org/bwindels/cider-deserialize-headers
...
Message editing: deserialize headers from html back to markdown
2019-09-02 14:58:54 +00:00
Bruno Windels
c4d7df768d
Merge pull request #3375 from matrix-org/bwindels/cider-colononmention
...
New composer: share user pill postfix between autocomplete and insert mention
2019-09-02 14:58:23 +00:00
Bruno Windels
5b54cf566d
deserialize headers from html back to markdown
2019-09-02 16:23:56 +02:00
Bruno Windels
2683627a82
disable spell check for pills in the new composer
2019-09-02 14:26:15 +02:00
Bruno Windels
c595371845
share user pill postfix between autocomplete and insert mention
...
where we decide to add a colon only if the composer is empty
2019-09-02 14:06:30 +02:00
Bruno Windels
4329d8c4ef
Merge pull request #3372 from matrix-org/bwindels/fix-command-tab-complete
...
New composer: fix tab-complete in commands
2019-09-02 11:38:13 +00:00
Bruno Windels
00d81eece9
don't accept @/#/: as part of command, allow to create pill candidate
...
so if you type these 3 characters, you get the correct autocomplete
2019-09-02 11:26:20 +02:00
Bruno Windels
a4376a76f0
only pass keyboard to autocomplete when it has selections
...
otherwise if tab is pressed, try to tab complete the last word
2019-09-02 11:25:29 +02:00
Bruno Windels
63be16beff
Merge pull request #3366 from matrix-org/bwindels/cider-user-pill-text-fallback
...
New composer: put display name in user pill text fallback instead of mxid
2019-08-30 16:03:28 +00:00
Bruno Windels
ec0d048cf0
Merge pull request #3361 from matrix-org/bwindels/autocomplete-colon
...
New composer: append colon to completed user pill when at start of message
2019-08-30 16:02:58 +00:00
Bruno Windels
b16f983a1f
put display name in user pill text fallback instead of mxid
2019-08-30 11:51:29 +02:00
Bruno Windels
c9572250be
only append colon to user-pill when at start of composer
...
by passing position to autocomplete, so completion
can depend on where the pill-candidate appears.
2019-08-29 17:47:14 +02:00
Bruno Windels
2ff2ff0e75
support autocomplete replacing text with multiple parts
...
and append ": " to user pills
2019-08-29 17:43:18 +02:00
Bruno Windels
80523f5dbe
still convert \n to NewlinePart when pasting/dropping
...
before we skipped the complete validation (which creates NewlineParts)
when pasting or dropping text. We don't want to create PillCandidatePart
when inserting text like this, as it would open the auto-complete, but
newlines should still be applied. So instead of skipping validation,
pass the inputType to the validation code so they can only reject
pill candidate characters when not pasting.
2019-08-29 13:00:31 +02:00
Bruno Windels
e531b29307
don't ignore BR elements when converting to editor dom to text
2019-08-29 13:00:31 +02:00
Bruno Windels
85efb71a23
add visual bell when no replacements are available
...
also add try/catch in _tabCompleteName so errors don't get swallowed
2019-08-28 15:53:16 +02:00
Bruno Windels
c44fbb73d0
fix bug when replacing range starting at end of previous part
2019-08-28 15:52:39 +02:00
Bruno Windels
d8bb9ecedf
bring insert method inline with transform callback, add docs
...
before the insertPartsAt method would call the update callback
on its own, but now we have the concept of a transformation session,
so lets bring the API in line
2019-08-27 16:43:05 +02:00
Bruno Windels
8e66d382de
don't crash on race with room members and initial composer render
...
not ideal, but for now this prevents a crash at startup
when a user-pill is persisted in local storage
2019-08-27 16:43:05 +02:00
Bruno Windels
e0ec827a64
extra docs
2019-08-27 16:43:05 +02:00
Bruno Windels
68c2bb7ca6
introduce transform
method so update can be called with a position
...
and also for multiple transformations at once. This removes
the need to call the update callback from `replaceRange()` as well
2019-08-27 16:43:05 +02:00
Bruno Windels
f76a23d5dd
return promise from updating autocomplete
...
so one can await if needed
2019-08-27 16:43:05 +02:00
Bruno Windels
0f6465a1db
don't close autocomplete when hitting tab
...
that's not what the slate impl does and it's not an improvement
2019-08-27 16:43:05 +02:00
Bruno Windels
713205e0ab
close autocomplete when removing auto-completed part
2019-08-27 16:43:05 +02:00
Bruno Windels
f10e1d7654
fix jsdoc comments
2019-08-27 09:54:13 +02:00
Bruno Windels
5c28b57681
always recalculate position after doing transform step
...
as the amount of characters might not have changed,
parts may still have been merged, removed or added which
requires a new position.
2019-08-27 09:49:22 +02:00
Bruno Windels
4fd4ad41c1
improve editor model documentation
2019-08-26 16:16:27 +02:00
Bruno Windels
f8f0e77bde
add transform step during editor model update
2019-08-26 16:16:27 +02:00
Bruno Windels
0e65f71a37
support incrementing/decrementing doc positions with predicate
2019-08-26 16:16:27 +02:00
Bruno Windels
10291bafe0
add support for selecting ranges in the editor model, and replacing them
...
this to support finding emoticons and replacing them with an emoji
2019-08-26 16:16:27 +02:00
Bruno Windels
5cebce9bbf
fix bug detected by tests
2019-08-22 14:41:40 +01:00