@lvce-editor/editor-worker 19.29.11 → 19.29.12

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.
@@ -5642,18 +5642,6 @@ const getCursorOffset = editor => {
5642
5642
  return offsetAt(editor, editor.selections[0], editor.selections[1]);
5643
5643
  };
5644
5644
 
5645
- const cancelSelection = editor => {
5646
- const {
5647
- selections
5648
- } = editor;
5649
- if (selections.length === 4 && selections[0] === selections[2] && selections[1] === selections[3]) {
5650
- return editor;
5651
- }
5652
- const newSelections = alloc(4);
5653
- moveRangeToPosition$1(newSelections, 0, selections[0], selections[1]);
5654
- return scheduleSelections(editor, newSelections);
5655
- };
5656
-
5657
5645
  const getIndex = (widgets, id) => {
5658
5646
  for (const [i, widget] of widgets.entries()) {
5659
5647
  if (widget.id === id) {
@@ -5668,6 +5656,28 @@ const removeEditorWidget = (widgets, id) => {
5668
5656
  return newWidgets;
5669
5657
  };
5670
5658
 
5659
+ const cancelSelection = editor => {
5660
+ const {
5661
+ selections,
5662
+ widgets = []
5663
+ } = editor;
5664
+ if (widgets.some(widget => widget.id === Hover)) {
5665
+ return {
5666
+ ...editor,
5667
+ additionalFocus: 0,
5668
+ focused: true,
5669
+ widgetRevision: next(editor.uid),
5670
+ widgets: removeEditorWidget(widgets, Hover)
5671
+ };
5672
+ }
5673
+ if (selections.length === 4 && selections[0] === selections[2] && selections[1] === selections[3]) {
5674
+ return editor;
5675
+ }
5676
+ const newSelections = alloc(4);
5677
+ moveRangeToPosition$1(newSelections, 0, selections[0], selections[1]);
5678
+ return scheduleSelections(editor, newSelections);
5679
+ };
5680
+
5671
5681
  const isMatchingWidget$2 = widget => {
5672
5682
  return widget.id === CodeGenerator;
5673
5683
  };
@@ -11499,6 +11509,10 @@ const getKeyBindings = () => {
11499
11509
  command: 'Editor.closeColorPicker',
11500
11510
  key: Escape,
11501
11511
  when: FocusColorPicker
11512
+ }, {
11513
+ command: 'Editor.cancelSelection',
11514
+ key: Escape,
11515
+ when: FocusEditorHover
11502
11516
  }, {
11503
11517
  command: 'Editor.closeSourceAction',
11504
11518
  key: Escape,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.29.11",
3
+ "version": "19.29.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"