]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/index.ts
Lexical: Updated tests for node changes
[bookstack] / resources / js / wysiwyg / index.ts
index c5dd151af6789789b39625361cadb2c303b527ad..9066b402f330aa8959e5d69d1221cc95aa9f4214 100644 (file)
@@ -1,4 +1,4 @@
-import {$getSelection, createEditor, CreateEditorArgs, isCurrentlyReadOnlyMode, LexicalEditor} from 'lexical';
+import {$getSelection, createEditor, CreateEditorArgs, LexicalEditor} from 'lexical';
 import {createEmptyHistoryState, registerHistory} from '@lexical/history';
 import {registerRichText} from '@lexical/rich-text';
 import {mergeRegister} from '@lexical/utils';
@@ -42,8 +42,13 @@ export function createPageEditorInstance(container: HTMLElement, htmlContent: st
     const editWrap = el('div', {
         class: 'editor-content-wrap',
     }, [editArea]);
+
     container.append(editWrap);
     container.classList.add('editor-container');
+    container.setAttribute('dir', options.textDirection);
+    if (options.darkMode) {
+        container.classList.add('editor-dark');
+    }
 
     const editor = createEditor(config);
     editor.setRootElement(editArea);