@lvce-editor/editor-worker 19.66.6 → 19.66.7
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.
- package/dist/editorWorkerMain.js +48 -9
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -6433,6 +6433,15 @@ const closeWidgetsMaybe = widgets => {
|
|
|
6433
6433
|
return widgets.filter(widget => isPersistentWidget(widget.id));
|
|
6434
6434
|
};
|
|
6435
6435
|
|
|
6436
|
+
const hasWidget = (widgets, id) => {
|
|
6437
|
+
for (const widget of widgets) {
|
|
6438
|
+
if (widget.id === id) {
|
|
6439
|
+
return true;
|
|
6440
|
+
}
|
|
6441
|
+
}
|
|
6442
|
+
return false;
|
|
6443
|
+
};
|
|
6444
|
+
|
|
6436
6445
|
const logError = async (error, prefix) => {
|
|
6437
6446
|
const prettyError = await invoke$h('Errors.prepare', error);
|
|
6438
6447
|
await invoke$h('Errors.print', prettyError, prefix);
|
|
@@ -6869,9 +6878,13 @@ const handleBlur$1 = async editor => {
|
|
|
6869
6878
|
return editor;
|
|
6870
6879
|
}
|
|
6871
6880
|
const widgetRevision = next(editor.uid);
|
|
6881
|
+
const completionWidgetDismissedOnBlur = hasWidget([...(editor.widgets || [])], Completion);
|
|
6872
6882
|
const newEditor = {
|
|
6873
6883
|
...editor,
|
|
6874
6884
|
additionalFocus: 0,
|
|
6885
|
+
...(completionWidgetDismissedOnBlur && {
|
|
6886
|
+
completionWidgetDismissedOnBlur: true
|
|
6887
|
+
}),
|
|
6875
6888
|
focused: false,
|
|
6876
6889
|
widgetRevision,
|
|
6877
6890
|
widgets: closeWidgetsMaybe(editor.widgets || [])
|
|
@@ -7394,15 +7407,6 @@ const closeSourceAction = editor => {
|
|
|
7394
7407
|
};
|
|
7395
7408
|
};
|
|
7396
7409
|
|
|
7397
|
-
const hasWidget = (widgets, id) => {
|
|
7398
|
-
for (const widget of widgets) {
|
|
7399
|
-
if (widget.id === id) {
|
|
7400
|
-
return true;
|
|
7401
|
-
}
|
|
7402
|
-
}
|
|
7403
|
-
return false;
|
|
7404
|
-
};
|
|
7405
|
-
|
|
7406
7410
|
const addWidgetToEditor = async (widgetId, focusKey, editor, factory, newStateGenerator, fullFocus) => {
|
|
7407
7411
|
const {
|
|
7408
7412
|
widgets = []
|
|
@@ -8640,6 +8644,7 @@ const EditorSelectUp = 'Editor: Select Up';
|
|
|
8640
8644
|
const EditorShowHover = 'Show Hover';
|
|
8641
8645
|
const EditorSortLinesAscending = 'Editor: Sort Lines Ascending';
|
|
8642
8646
|
const EditorToggleComment = 'Editor: Toggle Comment';
|
|
8647
|
+
const EditorToggleSuggestWidget = 'Editor: Toggle Suggest Widget';
|
|
8643
8648
|
const EditorUnindent = 'Editor: Unindent';
|
|
8644
8649
|
const EnterCode = 'Enter Code';
|
|
8645
8650
|
const EscapeToClose = 'Escape to close';
|
|
@@ -8672,6 +8677,9 @@ const goToDefinition$1 = () => {
|
|
|
8672
8677
|
const goToBracket = () => {
|
|
8673
8678
|
return i18nString(GoToBracket);
|
|
8674
8679
|
};
|
|
8680
|
+
const editorToggleSuggestWidget = () => {
|
|
8681
|
+
return i18nString(EditorToggleSuggestWidget);
|
|
8682
|
+
};
|
|
8675
8683
|
const noDefinitionFound = () => {
|
|
8676
8684
|
return i18nString(NoDefinitionFound);
|
|
8677
8685
|
};
|
|
@@ -12698,6 +12706,33 @@ const toggleComment = async editor => {
|
|
|
12698
12706
|
}
|
|
12699
12707
|
};
|
|
12700
12708
|
|
|
12709
|
+
const toggleCompletion = async editor => {
|
|
12710
|
+
if (!editor) {
|
|
12711
|
+
return editor;
|
|
12712
|
+
}
|
|
12713
|
+
const {
|
|
12714
|
+
widgets
|
|
12715
|
+
} = editor;
|
|
12716
|
+
const isCompletionOpen = hasWidget(widgets, Completion);
|
|
12717
|
+
if (isCompletionOpen) {
|
|
12718
|
+
const newEditor = await closeCompletion(editor);
|
|
12719
|
+
if (!editor.completionWidgetDismissedOnBlur) {
|
|
12720
|
+
return newEditor;
|
|
12721
|
+
}
|
|
12722
|
+
return {
|
|
12723
|
+
...newEditor,
|
|
12724
|
+
completionWidgetDismissedOnBlur: false
|
|
12725
|
+
};
|
|
12726
|
+
}
|
|
12727
|
+
if (editor.completionWidgetDismissedOnBlur) {
|
|
12728
|
+
return {
|
|
12729
|
+
...editor,
|
|
12730
|
+
completionWidgetDismissedOnBlur: false
|
|
12731
|
+
};
|
|
12732
|
+
}
|
|
12733
|
+
return openCompletion(editor);
|
|
12734
|
+
};
|
|
12735
|
+
|
|
12701
12736
|
const type = async (editor, text) => {
|
|
12702
12737
|
const changes = editorReplaceSelections(editor, [text], EditorType);
|
|
12703
12738
|
const newEditor = await scheduleDocumentAndCursorsSelections(editor, changes);
|
|
@@ -14508,6 +14543,9 @@ const getQuickPickMenuEntries = () => {
|
|
|
14508
14543
|
}, {
|
|
14509
14544
|
id: 'Editor.toggleMinimap',
|
|
14510
14545
|
label: viewToggleMinimap()
|
|
14546
|
+
}, {
|
|
14547
|
+
id: 'Editor.toggleCompletion',
|
|
14548
|
+
label: editorToggleSuggestWidget()
|
|
14511
14549
|
}];
|
|
14512
14550
|
};
|
|
14513
14551
|
|
|
@@ -17195,6 +17233,7 @@ const commandMap = {
|
|
|
17195
17233
|
'Editor.toggleBlockComment': wrapCommand(toggleBlockComment),
|
|
17196
17234
|
'Editor.toggleBreakpoint': wrapCommand(toggleBreakpoint),
|
|
17197
17235
|
'Editor.toggleComment': wrapCommand(toggleComment),
|
|
17236
|
+
'Editor.toggleCompletion': wrapCommand(toggleCompletion),
|
|
17198
17237
|
'Editor.toggleLineComment': wrapCommand(editorToggleLineComment),
|
|
17199
17238
|
'Editor.toggleMinimap': toggleMinimap,
|
|
17200
17239
|
'Editor.type': wrapCommand(type, true),
|