Repository navigation
Mixed-direction rendering fixtures for read-only Lexical consumers #9165
CodeinScrubs
started this conversation in
Show and tell
Replies: 0 comments
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.
Hi — I maintain BidiLens, an MIT toolkit for mixed-direction text, and wanted to share it as a possible fixture resource for applications consuming Lexical content.
I read the discussion in #2610, including the work on manual direction and browser-native behavior. I am not proposing to replace that work or change Lexical's defaults. The remaining distinctions around explicit auto, inheritance and serialization need Lexical-specific decisions.
Our most relevant use case is a read-only preview or AI-generated prose displayed outside the editable surface: Persian paragraphs containing Latin technical names, English paragraphs quoting Persian, punctuation, and direction independent of physical alignment. First-strong is often appropriate; where intent is ambiguous, an explicit author choice is preferable to pretending a heuristic always knows.
BidiLens is not a Lexical editor plugin. Attaching a DOM observer inside contenteditable could interfere with reconciliation, selection, undo and IME, so that is not a recommended integration. Any editor-side change needs those tests plus serialization/collaboration compatibility; our renderer checks do not establish that coverage.
A recent concrete example is our native mixed-direction message documentation contribution, now merged into PersianLabs without a new dependency. It illustrates the kind of small, source-preserving contribution we aim for, not a claim of BidiLens adoption.
If a read-only fixture/example would be useful to Lexical consumers, I would be glad to scope one around your preferred boundary. Otherwise, the existing native direction work may already be the right solution for a given application.
All reactions