@lvce-editor/editor-worker 3.23.0 → 3.24.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,14 +2280,14 @@ const closeCompletion = editor => {
2280
2280
  };
2281
2281
  };
2282
2282
 
2283
- const isMatchingWidget = widget => {
2283
+ const isMatchingWidget$1 = widget => {
2284
2284
  return widget.id === SourceAction;
2285
2285
  };
2286
2286
  const closeSourceAction = editor => {
2287
2287
  const {
2288
2288
  widgets
2289
2289
  } = editor;
2290
- const index = widgets.findIndex(isMatchingWidget);
2290
+ const index = widgets.findIndex(isMatchingWidget$1);
2291
2291
  if (index === -1) {
2292
2292
  return editor;
2293
2293
  }
@@ -7599,6 +7599,24 @@ const toggleDetails = editor => {
7599
7599
  return closeDetails(editor);
7600
7600
  };
7601
7601
 
7602
+ const isMatchingWidget = widget => {
7603
+ return widget.id === Find;
7604
+ };
7605
+ const closeFind = editor => {
7606
+ const {
7607
+ widgets
7608
+ } = editor;
7609
+ const index = widgets.findIndex(isMatchingWidget);
7610
+ if (index === -1) {
7611
+ return editor;
7612
+ }
7613
+ const newWidgets = [...widgets.slice(0, index), ...widgets.slice(index + 1)];
7614
+ return {
7615
+ ...editor,
7616
+ widgets: newWidgets
7617
+ };
7618
+ };
7619
+
7602
7620
  const loadContent = async (editorUid, state, position) => {
7603
7621
  const hoverInfo = await getEditorHoverInfo(editorUid, position);
7604
7622
  if (!hoverInfo) {
@@ -8890,6 +8908,7 @@ const commandMap = {
8890
8908
  'Editor.cancelSelection': cancelSelection,
8891
8909
  'Editor.closeCompletion': closeCompletion,
8892
8910
  'Editor.closeSourceAction': closeSourceAction,
8911
+ 'Editor.closeFind': closeFind,
8893
8912
  'Editor.compositionEnd': compositionEnd,
8894
8913
  'Editor.compositionStart': compositionStart,
8895
8914
  'Editor.compositionUpdate': compositionUpdate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "3.23.0",
3
+ "version": "3.24.0",
4
4
  "description": "",
5
5
  "main": "dist/editorWorkerMain.js",
6
6
  "type": "module",