@lvce-editor/editor-worker 19.66.6 → 19.67.0
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 +50 -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
|
};
|
|
@@ -11210,6 +11218,8 @@ const getPositionAtCursor$1 = editor => {
|
|
|
11210
11218
|
const y$1 = y(editor, rowIndex);
|
|
11211
11219
|
return {
|
|
11212
11220
|
columnIndex,
|
|
11221
|
+
editorWidth: editor.width,
|
|
11222
|
+
editorX: editor.x,
|
|
11213
11223
|
rowIndex,
|
|
11214
11224
|
x: x$1,
|
|
11215
11225
|
y: y$1
|
|
@@ -12698,6 +12708,33 @@ const toggleComment = async editor => {
|
|
|
12698
12708
|
}
|
|
12699
12709
|
};
|
|
12700
12710
|
|
|
12711
|
+
const toggleCompletion = async editor => {
|
|
12712
|
+
if (!editor) {
|
|
12713
|
+
return editor;
|
|
12714
|
+
}
|
|
12715
|
+
const {
|
|
12716
|
+
widgets
|
|
12717
|
+
} = editor;
|
|
12718
|
+
const isCompletionOpen = hasWidget(widgets, Completion);
|
|
12719
|
+
if (isCompletionOpen) {
|
|
12720
|
+
const newEditor = await closeCompletion(editor);
|
|
12721
|
+
if (!editor.completionWidgetDismissedOnBlur) {
|
|
12722
|
+
return newEditor;
|
|
12723
|
+
}
|
|
12724
|
+
return {
|
|
12725
|
+
...newEditor,
|
|
12726
|
+
completionWidgetDismissedOnBlur: false
|
|
12727
|
+
};
|
|
12728
|
+
}
|
|
12729
|
+
if (editor.completionWidgetDismissedOnBlur) {
|
|
12730
|
+
return {
|
|
12731
|
+
...editor,
|
|
12732
|
+
completionWidgetDismissedOnBlur: false
|
|
12733
|
+
};
|
|
12734
|
+
}
|
|
12735
|
+
return openCompletion(editor);
|
|
12736
|
+
};
|
|
12737
|
+
|
|
12701
12738
|
const type = async (editor, text) => {
|
|
12702
12739
|
const changes = editorReplaceSelections(editor, [text], EditorType);
|
|
12703
12740
|
const newEditor = await scheduleDocumentAndCursorsSelections(editor, changes);
|
|
@@ -14508,6 +14545,9 @@ const getQuickPickMenuEntries = () => {
|
|
|
14508
14545
|
}, {
|
|
14509
14546
|
id: 'Editor.toggleMinimap',
|
|
14510
14547
|
label: viewToggleMinimap()
|
|
14548
|
+
}, {
|
|
14549
|
+
id: 'Editor.toggleCompletion',
|
|
14550
|
+
label: editorToggleSuggestWidget()
|
|
14511
14551
|
}];
|
|
14512
14552
|
};
|
|
14513
14553
|
|
|
@@ -17195,6 +17235,7 @@ const commandMap = {
|
|
|
17195
17235
|
'Editor.toggleBlockComment': wrapCommand(toggleBlockComment),
|
|
17196
17236
|
'Editor.toggleBreakpoint': wrapCommand(toggleBreakpoint),
|
|
17197
17237
|
'Editor.toggleComment': wrapCommand(toggleComment),
|
|
17238
|
+
'Editor.toggleCompletion': wrapCommand(toggleCompletion),
|
|
17198
17239
|
'Editor.toggleLineComment': wrapCommand(editorToggleLineComment),
|
|
17199
17240
|
'Editor.toggleMinimap': toggleMinimap,
|
|
17200
17241
|
'Editor.type': wrapCommand(type, true),
|