You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order for the image component to be modularizable, it would be nice if the plugins used by the caption editor could be sent as children of the ImagePlugin or as a property.
In this way, people could customize the behavior of captions without having to modify their internal structure.
I'm thinking something like:
<ImagesPlugincaptionPlugins={<><AutoFocusPlugin/><MentionsPlugin/><LinkPlugin/><EmojisPlugin/><HashtagPlugin/><KeywordsPlugin/>{isCollabActive ? (<CollaborationPluginid={caption.getKey()}providerFactory={createWebsocketProvider}shouldBootstrap={true}/>) : (<HistoryPluginexternalHistoryState={historyState}/>);}<RichTextPlugincontentEditable={<ContentEditableclassName="ImageNode__contentEditable"/>}placeholder={<PlaceholderclassName="ImageNode__placeholder">
Enter a caption...
</Placeholder>}/>;
{showNestedEditorTreeView===true ? <TreeViewPlugin/> : null;}</>;}/>
Note that the new table plugin uses a similar strategy for the cell plugins.
LexicalComposer, LexicalNestedComposer, and TableContext use very similar logic. Considering that similar logic could now be useful for images and that this pattern can plausibly be repeated in almost any nested editor, I think it would be nice to find a way to make all these contexts more reusable.
For my part, I was trying for a while to adapt the TableContext, but some doubts arose.
For example, I don't understand why <TableContext> is created in App.tsx when it is just initialized in <TablePlugin> and I think it is not used by any other plugin. I think it could be simplified to something like <TablePlugin cellPlugins={...}/>.
The text was updated successfully, but these errors were encountered:
In order for the image component to be modularizable, it would be nice if the plugins used by the caption editor could be sent as children of the ImagePlugin or as a property.
In this way, people could customize the behavior of captions without having to modify their internal structure.
I'm thinking something like:
Note that the new table plugin uses a similar strategy for the cell plugins.
LexicalComposer, LexicalNestedComposer, and TableContext use very similar logic. Considering that similar logic could now be useful for images and that this pattern can plausibly be repeated in almost any nested editor, I think it would be nice to find a way to make all these contexts more reusable.
For my part, I was trying for a while to adapt the TableContext, but some doubts arose.
For example, I don't understand why
<TableContext>
is created in App.tsx when it is just initialized in<TablePlugin>
and I think it is not used by any other plugin. I think it could be simplified to something like<TablePlugin cellPlugins={...}/>
.The text was updated successfully, but these errors were encountered: