mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-05 08:39:55 +03:00
Lexical: Improved nested details interaction
- Set to open by default on insert. - Updated selection handling not to always fully cascade to lowest editable child on selection, so parents can be reliably selected. - Updated mouse handling to treat details panes like the root element, inserting within-details where relevant.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {createEditor, LexicalEditor} from 'lexical';
|
||||
import {createEditor} from 'lexical';
|
||||
import {createEmptyHistoryState, registerHistory} from '@lexical/history';
|
||||
import {registerRichText} from '@lexical/rich-text';
|
||||
import {mergeRegister} from '@lexical/utils';
|
||||
@@ -89,6 +89,9 @@ export function createPageEditorInstance(container: HTMLElement, htmlContent: st
|
||||
window.debugEditorState = () => {
|
||||
return editor.getEditorState().toJSON();
|
||||
};
|
||||
context.manager.onSelectionChange((selection) => {
|
||||
console.log(selection, context.editor.getEditorState());
|
||||
});
|
||||
|
||||
registerCommonNodeMutationListeners(context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user