* fix logic error
* update types
* extract message content to variable
* use the new messageContent property
* sort out mention types to make them a map
* update getMentionAttributes to use AllowedMentionAttributes
* add plain text handling
* change type and handling for attributes when creating a mention in plain text
* tidy, add comment
* revert TS config change
* fix broken types in test
* update tests
* bump rte
* fix import and ts errors
* fix broken tests
* get rough funcitonality working
* try to tidy up types
* fix merge error
* fix signature change error
* type wrangling
* use onBeforeInput listener
* add onBeforeInput handler, add logic to onPaste
* fix type error
* bring plain text listeners in line with useInputEventProcessor
* extract common function to util file, move tests
* tidy comment
* tidy comments
* fix typo
* add util tests
* add text paste test
* add comments to rough first solution
* allow eventRelation prop to pass to both composers
* use eventRelation in image paste
* add image pasting to rich text mode of rich text editor
* extract error handling to function
* type the error handler
* add tests
* make behaviour mimic SendMessage
* add sad path tests
* refactor to use catch throughout
* update comments
* tidy up tests
* add special case and change function signature
* add comment
* bump rte to 2.2.2
* insert mentions as links styled as pills
* post merge fix and update test
* update comments, move typeguard out
* create a text node instead of setting innerText
* update test
* update test
* fix broken cypress test, remove .only
* make it able to deal with inserting in middle of blank lines
* update comment
* fix strict null error
* use typeguard
* avoid implicit truth check
* add hook tests
* add comment
* Update test/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners-test.tsx
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
---------
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
* add the handlers for when autocomplete is open plus rough / handling
* hack in using the wysiwyg autocomplete
* switch to using onSelect for the behaviour
* expand comment
* add a handle command function to replace text
* add event firing step
* fix TS errors for RefObject
* extract common functionality to new util
* use util for plain text mode
* use util for rich text mode
* remove unused imports
* make util able to handle either type of keyboard event
* fix TS error for mxClient
* lift all new code into main component prior to extracting to custom hook
* shift logic into custom hook
* rename ref to editorRef for clarity
* remove comment
* try to add cypress test for behaviour
* remove unused imports
* fix various lint/TS errors for CI
* update cypress test
* add test for pressing escape to close autocomplete
* expand cypress tests
* add typing while autocomplete open test
* refactor to single piece of state and update comments
* update comment
* extract functions for testing
* add first tests
* improve tests
* remove console log
* call useSuggestion hook from different location
* update useSuggestion hook tests
* improve cypress tests
* remove unused import
* fix selector in cypress test
* add another set of util tests
* remove .only
* remove .only
* remove import
* improve cypress tests
* remove .only
* add comment
* improve comments
* tidy up tests
* consolidate all cypress tests to one
* add early return
* fix typo, add documentation
* add early return, tidy up comments
* change function expression to function declaration
* add documentation
* fix broken test
* add check to cypress tests
* update types
* update comment
* update comments
* shift ref declaration inside the hook
* remove unused import
* update cypress test and add comments
* update usePlainTextListener comments
* apply suggested changes to useSuggestion
* update tests
---------
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>