-
Notifications
You must be signed in to change notification settings - Fork 9
Begin work on rich text editor #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
|
Experimented with stubbing in https://github.com/curvenote/editor/tree/main/packages/prosemirror-autocomplete. Problems
|
We build up plugin state once and then use it for rendering, as well as (soon) looking up active suggestion.
|
Progress:
|
|
Got menu positioning working with https://prosemirror.net/docs/ref/#view.EditorView.coordsAtPos and https://floating-ui.com/docs/virtual-elements |
It's a basic proof of concept, but it's working.
This will encourage us to write the menu layer using lit html / stateless rendering.
this will mean we have to track with scrolling
Reducer gets access to view (state) and msg. It returns a boolean indicating whether editor should prevent default action.
...and destroy editor on disconnected. This ties editor lifecycle to component internals lifecycle.
Also switch to ReactiveElement. We don't want Lit's render() method, since we manage the editor's creation and destruction ourselves.
This allows menu to track with scrolling.
Store is wired to component and keeper of state. We'll use this to coordinate between the stateless lit world and the stateful ProseMirror world.
Component takes an anchor viewport position and an open state and positions itself using absolute strategy.
...and in prep for wiring up enter and tab.
...simpler.
- Get/set editor state via prop - Assign version cid to each state via plugin - Check for version difference before setting state via prop - input events are relayed as custom EditorStateChange events containing th state. - Helper functions like verPlugin.updateState to create states with new versions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #188
Goals
@mentionswith callback for hooking into type-ahead search menu#hashtagsNon-goals:
Use-cases
Prior art