@worktile/theia 19.1.5 → 19.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10810,7 +10810,7 @@ const cleanHeadingEffect = (editor, path) => {
|
|
|
10810
10810
|
}
|
|
10811
10811
|
};
|
|
10812
10812
|
const withHeading = (editor) => {
|
|
10813
|
-
const { insertBreak, isVisible, apply, deleteBackward,
|
|
10813
|
+
const { insertBreak, isVisible, apply, deleteBackward, mousedown } = editor;
|
|
10814
10814
|
editor.apply = operation => {
|
|
10815
10815
|
try {
|
|
10816
10816
|
if (operation.type === 'merge_node' && operation.path.length === 1) {
|
|
@@ -10926,7 +10926,7 @@ const withHeading = (editor) => {
|
|
|
10926
10926
|
}
|
|
10927
10927
|
return isVisible(node);
|
|
10928
10928
|
};
|
|
10929
|
-
editor.
|
|
10929
|
+
editor.mousedown = (event) => {
|
|
10930
10930
|
const target = event.target;
|
|
10931
10931
|
if (target instanceof HTMLElement && target.classList.contains('slate-editable-container')) {
|
|
10932
10932
|
const index = editor.children.length - 1;
|
|
@@ -10935,6 +10935,7 @@ const withHeading = (editor) => {
|
|
|
10935
10935
|
const path = [index];
|
|
10936
10936
|
const collapsedStandardHeadings = getCollapsedStandardHeadingAbove(editor, path);
|
|
10937
10937
|
if (collapsedStandardHeadings.length > 0) {
|
|
10938
|
+
event.preventDefault();
|
|
10938
10939
|
const headingPath = collapsedStandardHeadings[collapsedStandardHeadings.length - 1];
|
|
10939
10940
|
const headingNode = editor.children[headingPath[0]];
|
|
10940
10941
|
const dom = AngularEditor.toDOMNode(editor, headingNode);
|
|
@@ -10951,10 +10952,13 @@ const withHeading = (editor) => {
|
|
|
10951
10952
|
Transforms.insertNodes(editor, createEmptyParagraph(), { at: [index + 1] });
|
|
10952
10953
|
Transforms.select(editor, [index + 1]);
|
|
10953
10954
|
}
|
|
10955
|
+
AngularEditor.focus(editor);
|
|
10954
10956
|
}
|
|
10955
10957
|
}
|
|
10958
|
+
return;
|
|
10956
10959
|
}
|
|
10957
10960
|
}
|
|
10961
|
+
mousedown(event);
|
|
10958
10962
|
};
|
|
10959
10963
|
return editor;
|
|
10960
10964
|
};
|