@lvce-editor/editor-worker 4.3.0 → 4.4.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.
@@ -1929,7 +1929,7 @@ const applyEdit = async (editor, changes) => {
1929
1929
  return scheduleDocumentAndCursorsSelections(editor, changes);
1930
1930
  };
1931
1931
 
1932
- const handleBlur$1 = editor => {
1932
+ const handleBlur$2 = editor => {
1933
1933
  // for (const listener of state.blurListeners) {
1934
1934
  // listener(editor)
1935
1935
  // }
@@ -2430,6 +2430,7 @@ const EditorCompletion = 9;
2430
2430
  const Empty = 0;
2431
2431
  const FindWidget = 16;
2432
2432
  const FocusEditorHover = 51;
2433
+ const FocusEditorRename = 11;
2433
2434
  const FocusFindWidgetCloseButton = 48;
2434
2435
  const FocusFindWidgetNextMatchButton = 49;
2435
2436
  const FocusFindWidgetPreviousMatchButton = 50;
@@ -4037,15 +4038,12 @@ const handleScrollBarMove = (state, eventY) => {
4037
4038
  };
4038
4039
  const handleScrollBarVerticalPointerMove = handleScrollBarMove;
4039
4040
 
4040
- // @ts-ignore
4041
-
4042
4041
  // TODO scrollbar position can be in interval [0, editor.height - editor.scrollBarHeight]
4043
4042
  // when clicked at y <= editor.scrollbarHeight/2, position is set to zero
4044
4043
  // when clicked at y >= editor.height - editor.scrollBarHeight/2, position is set to (editor.height - scrollBarHeight/2)
4045
4044
  // when clicked at y > editor.height - editor.scrollBarHeight/2, position scrollbar at (y - scrollbarHeight/2)
4046
4045
  // additionally, when clicked on scrollbar, scrollbar position shouldn't move
4047
4046
 
4048
- // @ts-ignore
4049
4047
  const handleScrollBarPointerDown = (state, eventY) => {
4050
4048
  const {
4051
4049
  y,
@@ -5290,7 +5288,7 @@ const focusToggleReplaceButton = state => {
5290
5288
  return setFindWidgetFocus(state, FocusFindWidgetToggleReplace);
5291
5289
  };
5292
5290
 
5293
- const handleBlur = async state => {
5291
+ const handleBlur$1 = async state => {
5294
5292
  await setFocus(Empty);
5295
5293
  return state;
5296
5294
  };
@@ -5535,7 +5533,7 @@ const openRename = async editor => {
5535
5533
  return latestState;
5536
5534
  };
5537
5535
  const fullFocus = true;
5538
- return addWidgetToEditor(Rename, undefined, editor, create$3, newStateGenerator, fullFocus);
5536
+ return addWidgetToEditor(Rename, FocusEditorRename, editor, create$3, newStateGenerator, fullFocus);
5539
5537
  };
5540
5538
 
5541
5539
  const organizeImports = async editor => {
@@ -8019,6 +8017,10 @@ const renderHover = (oldState, newState) => {
8019
8017
  return commands;
8020
8018
  };
8021
8019
 
8020
+ const handleBlur = editor => {
8021
+ return closeRename(editor);
8022
+ };
8023
+
8022
8024
  const replaceTextOccurrences = (editor, matches, oldValue, newValue) => {
8023
8025
  const ranges = [];
8024
8026
  const oldValueLength = oldValue.length;
@@ -9184,7 +9186,7 @@ const commandMap = {
9184
9186
  'Editor.goToTypeDefinition': goToTypeDefinition,
9185
9187
  'Editor.handleBeforeInput': handleBeforeInput,
9186
9188
  'Editor.handleBeforeInputFromContentEditable': handleBeforeInputFromContentEditable,
9187
- 'Editor.handleBlur': handleBlur$1,
9189
+ 'Editor.handleBlur': handleBlur$2,
9188
9190
  'Editor.handleContextMenu': handleContextMenu,
9189
9191
  'Editor.handleDoubleClick': handleDoubleClick,
9190
9192
  'Editor.handleFocus': handleFocus,
@@ -9278,6 +9280,7 @@ const commandMap = {
9278
9280
  'EditorCompletion.selectCurrent': selectCurrent,
9279
9281
  'EditorCompletion.selectIndex': selectIndex,
9280
9282
  'EditorCompletion.toggleDetails': toggleDetails,
9283
+ 'EditorRename.handleBlur': handleBlur,
9281
9284
  'FindWidget.close': close$1,
9282
9285
  'FindWidget.focusCloseButton': focusCloseButton,
9283
9286
  'FindWidget.focusFind': focusFind,
@@ -9292,7 +9295,7 @@ const commandMap = {
9292
9295
  'FindWidget.focusReplaceAllButton': focusReplaceAllButton,
9293
9296
  'FindWidget.focusReplaceButton': focusReplaceButton,
9294
9297
  'FindWidget.focusToggleReplace': focusToggleReplaceButton,
9295
- 'FindWidget.handleBlur': handleBlur,
9298
+ 'FindWidget.handleBlur': handleBlur$1,
9296
9299
  'FindWidget.handleFocus': handleFindWidgetFocus,
9297
9300
  'FindWidget.handleInput': handleInput,
9298
9301
  'FindWidget.handleReplaceAllFocus': handleReplaceAllFocus,
@@ -10786,7 +10789,7 @@ const Commands = {
10786
10789
  'FindWidget.focusLast': focusLast,
10787
10790
  'FindWidget.toggleReplace': toggleReplace,
10788
10791
  'FindWidget.handleFocus': focusFind,
10789
- 'FindWidget.handleBlur': handleBlur
10792
+ 'FindWidget.handleBlur': handleBlur$1
10790
10793
  };
10791
10794
 
10792
10795
  const EditorFindWidget = {
@@ -10831,7 +10834,8 @@ const getRenameVirtualDom = state => {
10831
10834
  type: Input,
10832
10835
  className: 'InputBox RenameInputBox',
10833
10836
  value: state.newValue,
10834
- childCount: 0
10837
+ childCount: 0,
10838
+ onBlur: 'handleBlur'
10835
10839
  }];
10836
10840
  };
10837
10841
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "4.3.0",
3
+ "version": "4.4.0",
4
4
  "description": "",
5
5
  "main": "dist/editorWorkerMain.js",
6
6
  "type": "module",