-
Notifications
You must be signed in to change notification settings - Fork 14
chore: add 'better rendering' RFC #1964
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
base: main
Are you sure you want to change the base?
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
||
| ## Open Questions | ||
|
|
||
| - Should we provide convenience hooks like `useNodeFocused(nodeKey)` and `useNodeSelected(nodeKey)`? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh, that would be neat!
| } | ||
|
|
||
| // Register via plugin component | ||
| <RendererPlugin renderers={[imageRenderer, videoRenderer]} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this showing two different ways of registering them, e.g. editor.registerRenderer vs through plugin, or both would be required (e.g. register and enable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<RendererPlugin /> would be a convenient plugin a la <BehaviorPlugin /> to abstract over editor.registerRenderer(...).
https://github.com/portabletext/editor/blob/main/packages/editor/src/plugins/plugin.behavior.tsx#L8
|
|
||
| ## Resolution Order | ||
|
|
||
| 1. Registered renderers (by priority, highest first) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is priority defined? (order of registration? order in the renderer plugin? first defined executes first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order of registration and then the first defined wins. Like Behaviors. (Until we add a Priority API which we would want for Behaviors as well at one point)
d25c73b to
915ae95
Compare
915ae95 to
5a3a7a7
Compare
No description provided.