Replies: 1 comment
-
I have to mention that I like lexical but the features looks a little complex. However I would like to learn it and try to contribute to the comunity. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Lately, I've been on a mission to create a new feature for Lexical, aiming to enhance the editor's flexibility and reusability. My goal is to develop a collection named "UI Blocks Templates" where preconfigured Lexical blocks can be stored and easily reused across different Lexical editors of the project. Essentially, I envision a centralized collection where the CMS management can save Lexical templates and effortlessly integrate them into other Lexical Rich Text editors across the domain.
What I’ve Achieved So Far
I’ve successfully managed to visualize these UI Blocks by utilizing a block coupled with a relation field. This setup allows the CMS to display the UI Blocks within various editors across the project. With a custom block I achieved to incorporate it with a relation but not copying like a template. The first image is the UI Block Template, the second and third ones are how it's incorporated in Lexical with a custom block and his renderer. That system works well, but it requires to make an additional request and doesn't work like a template copying the content. Another issue of this approach is that you can cause a infinite loop recursion if you set a UI Block inside the same UI Block 🤣 , that's not good. That's in the 4º image.
What I am locking for
One discarded that I can implement what I wanted using only Blocks I turned into Lexical Features, and there is where my nightmare started. My idea is to show that same relationship field but not storing it. Also creating a Lexical feature from scratch has proven to be more complex than anticipated. For instance, I attempted to develop other features like Layouts, which are showcased in Lexical’s official playground examples. Unfortunately, these attempts didn’t pan out as expected. The only success I’ve had so far is the introduction of embeds, which seems relatively straightforward compared to more intricate features like UI Blocks Templates.
Beta Was this translation helpful? Give feedback.
All reactions