Lexical: Updated toolbar & text node exporting

- Updated toolbar to match existing editor, including dynamic RTL/LTR
  controls.
- Updated text node handling to not include spans and extra classes when
  not needed. Added & update tests to cover.
This commit is contained in:
Dan Brown
2024-09-23 17:36:16 +01:00
parent 8b32e6c15a
commit a62d8381be
16 changed files with 152 additions and 51 deletions

View File

@ -163,6 +163,10 @@ export class EditorUIManager {
});
}
getDefaultDirection(): 'rtl' | 'ltr' {
return this.getContext().options.textDirection === 'rtl' ? 'rtl' : 'ltr';
}
protected updateContextToolbars(update: EditorUiStateUpdate): void {
for (let i = this.activeContextToolbars.length - 1; i >= 0; i--) {
const toolbar = this.activeContextToolbars[i];