@lvce-editor/editor-worker 3.22.0 → 3.23.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.
@@ -2280,6 +2280,24 @@ const closeCompletion = editor => {
2280
2280
  };
2281
2281
  };
2282
2282
 
2283
+ const isMatchingWidget = widget => {
2284
+ return widget.id === SourceAction;
2285
+ };
2286
+ const closeSourceAction = editor => {
2287
+ const {
2288
+ widgets
2289
+ } = editor;
2290
+ const index = widgets.findIndex(isMatchingWidget);
2291
+ if (index === -1) {
2292
+ return editor;
2293
+ }
2294
+ const newWidgets = [...widgets.slice(0, index), ...widgets.slice(index + 1)];
2295
+ return {
2296
+ ...editor,
2297
+ widgets: newWidgets
2298
+ };
2299
+ };
2300
+
2283
2301
  const hasWidget = (widgets, id) => {
2284
2302
  for (const widget of widgets) {
2285
2303
  if (widget.id === id) {
@@ -2378,7 +2396,7 @@ const FocusFindWidgetCloseButton = 48;
2378
2396
  const FocusFindWidgetNextMatchButton = 49;
2379
2397
  const FocusFindWidgetPreviousMatchButton = 50;
2380
2398
  const FocusEditorHover = 51;
2381
- const SourceActions = 52;
2399
+ const SourceActions = 38;
2382
2400
 
2383
2401
  const newStateGenerator$1 = state => {
2384
2402
  return loadContent$3(state);
@@ -8871,6 +8889,7 @@ const commandMap = {
8871
8889
  'Editor.braceCompletion': braceCompletion,
8872
8890
  'Editor.cancelSelection': cancelSelection,
8873
8891
  'Editor.closeCompletion': closeCompletion,
8892
+ 'Editor.closeSourceAction': closeSourceAction,
8874
8893
  'Editor.compositionEnd': compositionEnd,
8875
8894
  'Editor.compositionStart': compositionStart,
8876
8895
  'Editor.compositionUpdate': compositionUpdate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "3.22.0",
3
+ "version": "3.23.0",
4
4
  "description": "",
5
5
  "main": "dist/editorWorkerMain.js",
6
6
  "type": "module",