facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.51k stars 1.65k forks source link

Feature: Column Resizing Support in Layouts Plugin #6740

Open harshmetkel24 opened 4 days ago

harshmetkel24 commented 4 days ago

Description

In one of our projects, we needed to support column resizing within the Layouts plugin. We were able to achieve this by adapting some of the logic already implemented for table resizing. Given that this is a fairly common requirement for projects dealing with dynamic layouts, it might be beneficial for other users as well.

Our specific use case involved a Reports module where we originally supported multiple widgets in a row. Previously, we used an external library to handle the resizing of these widgets. However, as we have now migrated fully to Lexical, we wanted to retain the same functionality using Lexical’s layout system. We used the columns layout to manage multiple widgets in a row, and by adding resizing functionality, we successfully mimicked the behavior we had with the external library.

Benefits

•   Consistency: Having built-in column resizing would create a seamless experience for projects that use the Layouts plugin.
•   Usability: Many users may have similar requirements for flexible grid layouts where content is dynamically adjusted by users. Having this as a built-in feature would save the effort of manually implementing or integrating external libraries.
•   Expandability: It provides more customization for layouts and makes the Layouts plugin more powerful in building complex, interactive content like reports, dashboards, and editors.
harshmetkel24 commented 4 days ago

I wanted to work on this!

ivailop7 commented 4 days ago

This would be an interesting improvement to the plugin. Feel free to give it a go! If you are are going to use a library for the drag and resize side of things, my advice is to go for atlassian's https://github.com/atlassian/pragmatic-drag-and-drop Which is really small and performant.