dictyBase / frontendx

BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Resolve Editor Layout Structure #729

Closed ktun95 closed 2 weeks ago

ktun95 commented 2 months ago

Flex Layout Node Problem

Before I can decide how to implement Image Alignment, it must be decided how to deal with the structure of the existing content pages.

The FlexLayoutNode + FlexLayoutPlugin was created as an attempt to approximate text wrapping behavior around inserted images. Currently, the editor uses the FlexLayoutNode to wrap other nodes in a flexbox, but content written previously is not wrapped like this, which affects how image alignment can be implemented.

Option 1: Wrap ParagraphNodes in FlexLayoutNodes during conversions in headless-content-manager

Option 2: Scrap FlexLayoutNode & Plugin, implement text alignment without flexbox

Option 3: Configure Editor to replace ParagraphNode with FlexLayoutNode

Not sure how this will affect builtin behavior of Lexical, e.g. pressing to insert a new paragraph, what happens when we in an empty paragraph node, changing the editor's selection.