@lvce-editor/renderer-process 1.1.0 → 2.0.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.
@@ -3213,7 +3213,7 @@ const create$Menu$1 = () => {
3213
3213
  // })
3214
3214
  $Menu.onkeydown = handleKeyDown$5;
3215
3215
  $Menu.addEventListener(FocusOut, handleFocusOut$1);
3216
- $Menu.oncontextmenu = handleContextMenu$9;
3216
+ $Menu.oncontextmenu = handleContextMenu$a;
3217
3217
  // $ContextMenu.onfocus = handleFocus
3218
3218
  // $ContextMenu.onblur = handleBlur
3219
3219
  return $Menu;
@@ -3242,14 +3242,14 @@ const handleBackDropMouseDown = event => {
3242
3242
  stopPropagation(event);
3243
3243
  send( /* Menu.hide */'Menu.hide');
3244
3244
  };
3245
- const handleContextMenu$9 = event => {
3245
+ const handleContextMenu$a = event => {
3246
3246
  preventDefault(event);
3247
3247
  };
3248
3248
  const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mouseBlocking = false) => {
3249
3249
  if (mouseBlocking) {
3250
3250
  const $BackDrop = create$BackDrop();
3251
3251
  $BackDrop.onmousedown = handleBackDropMouseDown;
3252
- $BackDrop.oncontextmenu = handleContextMenu$9;
3252
+ $BackDrop.oncontextmenu = handleContextMenu$a;
3253
3253
  // @ts-expect-error
3254
3254
  state$2.$BackDrop = $BackDrop;
3255
3255
  append$1($BackDrop);
@@ -5665,7 +5665,7 @@ const handleFocus$c = () => {
5665
5665
 
5666
5666
  // TODO use context menu events function again
5667
5667
 
5668
- const handleContextMenu$8 = event => {
5668
+ const handleContextMenu$9 = event => {
5669
5669
  preventDefault(event);
5670
5670
  const {
5671
5671
  button,
@@ -5679,7 +5679,7 @@ const returnValue$5 = true;
5679
5679
  const ViewletActivityBarEvents = {
5680
5680
  __proto__: null,
5681
5681
  handleBlur: handleBlur$9,
5682
- handleContextMenu: handleContextMenu$8,
5682
+ handleContextMenu: handleContextMenu$9,
5683
5683
  handleFocus: handleFocus$c,
5684
5684
  handleMouseDown: handleMouseDown$3,
5685
5685
  returnValue: returnValue$5
@@ -5709,10 +5709,10 @@ forwardViewletCommand('clearFilter');
5709
5709
  const close = forwardViewletCommand('close');
5710
5710
  forwardViewletCommand('closeEditor');
5711
5711
  const closeMenu$1 = forwardViewletCommand('closeMenu');
5712
- const compositionEnd = forwardViewletCommand('compositionEnd');
5713
- const compositionStart = forwardViewletCommand('compositionStart');
5714
- const compositionUpdate = forwardViewletCommand('compositionUpdate');
5715
- const cut = forwardViewletCommand('cut');
5712
+ forwardViewletCommand('compositionEnd');
5713
+ forwardViewletCommand('compositionStart');
5714
+ forwardViewletCommand('compositionUpdate');
5715
+ forwardViewletCommand('cut');
5716
5716
  forwardViewletCommand('focus');
5717
5717
  forwardViewletCommand('focusIndex');
5718
5718
  const focusNext = forwardViewletCommand('focusNext');
@@ -5734,7 +5734,7 @@ forwardViewletCommand('handleClickOpenFile');
5734
5734
  forwardViewletCommand('handleClickRestore');
5735
5735
  const handleClickTab$2 = forwardViewletCommand('handleClickTab');
5736
5736
  forwardViewletCommand('handleClickToggleMaximize');
5737
- const handleContextMenu$7 = forwardViewletCommand('handleContextMenu');
5737
+ const handleContextMenu$8 = forwardViewletCommand('handleContextMenu');
5738
5738
  const handleDoubleClick = forwardViewletCommand('handleDoubleClick');
5739
5739
  const handleDragEnd$1 = forwardViewletCommand('handleDragEnd');
5740
5740
  const handleDragLeave$1 = forwardViewletCommand('handleDragLeave');
@@ -5754,10 +5754,10 @@ forwardViewletCommand('handleListFocus');
5754
5754
  const handleMenuClick$1 = forwardViewletCommand('handleMenuClick');
5755
5755
  const handleMenuMouseOver$1 = forwardViewletCommand('handleMenuMouseOver');
5756
5756
  const handleMouseDown$2 = forwardViewletCommand('handleMouseDown');
5757
- const handleMouseMove$1 = forwardViewletCommand('handleMouseMove');
5757
+ forwardViewletCommand('handleMouseMove');
5758
5758
  const handleMouseOut$1 = forwardViewletCommand('handleMouseOut');
5759
5759
  const handleMouseOver$1 = forwardViewletCommand('handleMouseOver');
5760
- const handlePointerCaptureLost$3 = forwardViewletCommand('handlePointerCaptureLost');
5760
+ forwardViewletCommand('handlePointerCaptureLost');
5761
5761
  const handlePointerDown$7 = forwardViewletCommand('handlePointerDown');
5762
5762
  const handlePointerMove$1 = forwardViewletCommand('handlePointerMove');
5763
5763
  forwardViewletCommand('handlePointerOver');
@@ -5768,12 +5768,12 @@ const handleResizerClick = forwardViewletCommand('handleResizerClick');
5768
5768
  const handleResizerMove = forwardViewletCommand('handleResizerMove');
5769
5769
  const handleScrollBarCaptureLost = forwardViewletCommand('handleScrollBarCaptureLost');
5770
5770
  const handleScrollBarClick = forwardViewletCommand('handleScrollBarClick');
5771
- const handleScrollBarHorizontalMove = forwardViewletCommand('handleScrollBarHorizontalMove');
5772
- const handleScrollBarHorizontalPointerDown$1 = forwardViewletCommand('handleScrollBarHorizontalPointerDown');
5771
+ forwardViewletCommand('handleScrollBarHorizontalMove');
5772
+ forwardViewletCommand('handleScrollBarHorizontalPointerDown');
5773
5773
  const handleScrollBarMove = forwardViewletCommand('handleScrollBarMove');
5774
5774
  const handleScrollBarThumbPointerMove$3 = forwardViewletCommand('handleScrollBarThumbPointerMove');
5775
- const handleScrollBarVerticalMove = forwardViewletCommand('handleScrollBarMove');
5776
- const handleScrollBarVerticalPointerDown$1 = forwardViewletCommand('handleScrollBarVerticalPointerDown');
5775
+ forwardViewletCommand('handleScrollBarMove');
5776
+ forwardViewletCommand('handleScrollBarVerticalPointerDown');
5777
5777
  forwardViewletCommand('handleSliderPointerDown');
5778
5778
  const handleSliderPointerMove$1 = forwardViewletCommand('handleSliderPointerMove');
5779
5779
  const handleTabClick = forwardViewletCommand('handleTabClick');
@@ -5786,19 +5786,19 @@ const handleTouchMove$1 = forwardViewletCommand('handleTouchMove');
5786
5786
  const handleTouchStart$1 = forwardViewletCommand('handleTouchStart');
5787
5787
  const handleWheel$4 = forwardViewletCommand('handleWheel');
5788
5788
  const hidePanel = forwardViewletCommand('hidePanel');
5789
- const moveRectangleSelectionPx = forwardViewletCommand('moveRectangleSelectionPx');
5790
- const moveSelectionPx = forwardViewletCommand('moveSelectionPx');
5791
- const paste = forwardViewletCommand('paste');
5789
+ forwardViewletCommand('moveRectangleSelectionPx');
5790
+ forwardViewletCommand('moveSelectionPx');
5791
+ forwardViewletCommand('paste');
5792
5792
  forwardViewletCommand('replaceAll');
5793
5793
  const selectIndex = forwardViewletCommand('selectIndex');
5794
- const setDelta = forwardViewletCommand('setDelta');
5794
+ forwardViewletCommand('setDelta');
5795
5795
  forwardViewletCommand('toggleMatchCase');
5796
5796
  forwardViewletCommand('toggleMatchWholeWord');
5797
5797
  const toggleMaximize = forwardViewletCommand('toggleMaximize');
5798
5798
  const toggleReplace = forwardViewletCommand('toggleReplace');
5799
5799
  forwardViewletCommand('toggleUseRegularExpression');
5800
5800
  forwardViewletCommand('type');
5801
- const typeWithAutoClosing = forwardViewletCommand('typeWithAutoClosing');
5801
+ forwardViewletCommand('typeWithAutoClosing');
5802
5802
  const updateEditingValue = forwardViewletCommand('updateEditingValue');
5803
5803
 
5804
5804
  const handleAudioError = event => {
@@ -6526,7 +6526,7 @@ const handleWheel$2 = event => {
6526
6526
  *
6527
6527
  * @param {MouseEvent} event
6528
6528
  */
6529
- const handleContextMenu$6 = event => {
6529
+ const handleContextMenu$7 = event => {
6530
6530
  preventDefault(event);
6531
6531
  const {
6532
6532
  button,
@@ -6534,7 +6534,7 @@ const handleContextMenu$6 = event => {
6534
6534
  clientY
6535
6535
  } = event;
6536
6536
  const uid = fromEvent(event);
6537
- handleContextMenu$7(uid, button, clientX, clientY);
6537
+ handleContextMenu$8(uid, button, clientX, clientY);
6538
6538
  };
6539
6539
  const handleError$5 = event => {
6540
6540
  const uid = fromEvent(event);
@@ -6559,7 +6559,7 @@ const attachEvents$a = state => {
6559
6559
  attachEvents$c($Viewlet, {
6560
6560
  [PointerDown]: handlePointerDown$5,
6561
6561
  [PointerUp]: handlePointerUp,
6562
- [ContextMenu]: handleContextMenu$6,
6562
+ [ContextMenu]: handleContextMenu$7,
6563
6563
  [FocusIn]: handleFocus$9
6564
6564
  });
6565
6565
  $Viewlet.addEventListener(Error$3, handleError$5, Capture);
@@ -6623,12 +6623,26 @@ const QuickInput = 'Quick Input';
6623
6623
  const SideBar = 'Side Bar';
6624
6624
  const StatusBar = 'Status Bar';
6625
6625
 
6626
+ const attachEventsFunctional = ($Node, eventMap) => {
6627
+ for (const [key] of Object.entries(eventMap)) {
6628
+ if (key === 'returnValue') {
6629
+ continue;
6630
+ }
6631
+ attachEvent($Node, eventMap, key, key);
6632
+ }
6633
+ };
6634
+
6626
6635
  const Text$1 = 'text';
6627
6636
 
6628
6637
  const getText = clipBoardData => {
6629
6638
  return clipBoardData.getData(Text$1);
6630
6639
  };
6631
6640
 
6641
+ const detachEvent = ($Node, key, listener) => {
6642
+ const wrapped = getWrappedListener(listener, true);
6643
+ $Node.removeEventListener(key, wrapped);
6644
+ };
6645
+
6632
6646
  const None = 0;
6633
6647
  const Ctrl = 1;
6634
6648
  const Alt$1 = 2;
@@ -6643,8 +6657,6 @@ const getModifierKey = event => {
6643
6657
  return None;
6644
6658
  };
6645
6659
 
6646
- const InsertText = 'insertText';
6647
-
6648
6660
  const toSimpleTouch = touch => {
6649
6661
  return {
6650
6662
  x: touch.clientX,
@@ -6668,17 +6680,6 @@ const toSimpleTouchEvent = event => {
6668
6680
  };
6669
6681
  };
6670
6682
 
6671
- const handleContextMenu$5 = event => {
6672
- preventDefault(event);
6673
- const {
6674
- button,
6675
- clientX,
6676
- clientY
6677
- } = event;
6678
- const uid = fromEvent(event);
6679
- handleContextMenu$7(uid, button, clientX, clientY);
6680
- };
6681
-
6682
6683
  // TODO so many things in this file
6683
6684
 
6684
6685
 
@@ -6687,23 +6688,20 @@ const handleContextMenu$5 = event => {
6687
6688
  // TODO tree shake out mobile support when targeting electron -> less code -> less event listeners -> less memory -> less cpu
6688
6689
 
6689
6690
  const handleFocus$8 = event => {
6690
- const uid = fromEvent(event);
6691
- handleFocus$b(uid);
6691
+ return ['handleFocus'];
6692
6692
  };
6693
6693
  const handleMouseMove = event => {
6694
- const uid = fromEvent(event);
6695
6694
  const {
6696
6695
  clientX,
6697
6696
  clientY,
6698
6697
  altKey
6699
6698
  } = event;
6700
- handleMouseMove$1(uid, clientX, clientY, altKey);
6699
+ return ['handleMouseMove', clientX, clientY, altKey];
6701
6700
  };
6702
6701
  const handleBlur$6 = event => {
6703
6702
  // needed for save on blur
6704
6703
  // also needed to close completions on blur
6705
- const uid = fromEvent(event);
6706
- handleBlur$8(uid);
6704
+ return ['handleBlur'];
6707
6705
  };
6708
6706
 
6709
6707
  /**
@@ -6712,19 +6710,11 @@ const handleBlur$6 = event => {
6712
6710
  */
6713
6711
  const handleBeforeInput$1 = event => {
6714
6712
  preventDefault(event);
6715
- const uid = fromEvent(event);
6716
6713
  const {
6717
6714
  inputType,
6718
6715
  data
6719
6716
  } = event;
6720
- switch (inputType) {
6721
- case InsertText:
6722
- typeWithAutoClosing(uid, data);
6723
- break;
6724
- }
6725
- // if (!event.data) {
6726
- // return
6727
- // }
6717
+ return ['handleBeforeInput', inputType, data];
6728
6718
  };
6729
6719
 
6730
6720
  // TODO composition should be better supported,
@@ -6735,36 +6725,31 @@ const handleBeforeInput$1 = event => {
6735
6725
  // - vscode does not draw a line, but displays characters during composition
6736
6726
 
6737
6727
  const handleCompositionStart = event => {
6738
- const uid = fromEvent(event);
6739
6728
  const {
6740
6729
  data
6741
6730
  } = event;
6742
- compositionStart(uid, data);
6731
+ return ['compositionStart', data];
6743
6732
  };
6744
6733
  const handleCompositionUpdate = event => {
6745
- const uid = fromEvent(event);
6746
6734
  const {
6747
6735
  data
6748
6736
  } = event;
6749
- compositionUpdate(uid, data);
6737
+ return ['compositionUpdate', data];
6750
6738
  };
6751
6739
  const handleCompositionEnd = event => {
6752
- const uid = fromEvent(event);
6753
6740
  const {
6754
6741
  data
6755
6742
  } = event;
6756
- compositionEnd(uid, data);
6743
+ return ['compositionEnd', data];
6757
6744
  };
6758
6745
  const handleCut = event => {
6759
6746
  preventDefault(event);
6760
- const uid = fromEvent(event);
6761
- cut(uid);
6747
+ return ['cut'];
6762
6748
  };
6763
6749
  const isRightClick = event => {
6764
6750
  return event.button === RightClick;
6765
6751
  };
6766
6752
  const handleEditorPointerMove = event => {
6767
- const uid = fromEvent(event);
6768
6753
  const {
6769
6754
  clientX,
6770
6755
  clientY,
@@ -6772,19 +6757,17 @@ const handleEditorPointerMove = event => {
6772
6757
  } = event;
6773
6758
  // TODO if/else should be in renderer worker
6774
6759
  if (altKey) {
6775
- moveRectangleSelectionPx(uid, clientX, clientY);
6776
- } else {
6777
- moveSelectionPx(uid, clientX, clientY);
6760
+ return ['moveRectangleSelectionPx', clientX, clientY];
6778
6761
  }
6762
+ return ['moveSelectionPx', clientX, clientY];
6779
6763
  };
6780
6764
  const handleEditorLostPointerCapture = event => {
6781
- const uid = fromEvent(event);
6782
6765
  const {
6783
6766
  target
6784
6767
  } = event;
6785
- target.removeEventListener(PointerMove, handleEditorPointerMove);
6786
- target.removeEventListener(LostPointerCapture, handleEditorLostPointerCapture);
6787
- handlePointerCaptureLost$3(uid);
6768
+ detachEvent(target, PointerMove, handleEditorPointerMove);
6769
+ detachEvent(target, LostPointerCapture, handleEditorLostPointerCapture);
6770
+ return ['handlePointerCaptureLost'];
6788
6771
  };
6789
6772
 
6790
6773
  /**
@@ -6797,14 +6780,17 @@ const handleEditorPointerDown = event => {
6797
6780
  pointerId
6798
6781
  } = event;
6799
6782
  target.setPointerCapture(pointerId);
6800
- target.addEventListener(PointerMove, handleEditorPointerMove, Active);
6801
- target.addEventListener(LostPointerCapture, handleEditorLostPointerCapture);
6783
+ attachEventsFunctional(target, {
6784
+ [PointerMove]: handleEditorPointerMove,
6785
+ [LostPointerCapture]: handleEditorLostPointerCapture,
6786
+ returnValue: true
6787
+ });
6788
+ return [];
6802
6789
  };
6803
6790
  const handleMouseDown$1 = event => {
6804
6791
  if (isRightClick(event)) {
6805
- return;
6792
+ return [];
6806
6793
  }
6807
- const uid = fromEvent(event);
6808
6794
  preventDefault(event);
6809
6795
  const {
6810
6796
  clientX,
@@ -6812,7 +6798,7 @@ const handleMouseDown$1 = event => {
6812
6798
  detail
6813
6799
  } = event;
6814
6800
  const modifier = getModifierKey(event);
6815
- handleMouseDown$2(uid, modifier, clientX, clientY, detail);
6801
+ return ['handleMouseDown', modifier, clientX, clientY, detail];
6816
6802
  };
6817
6803
 
6818
6804
  // TODO figure out whether it is possible to register hover provider without mousemove
@@ -6823,7 +6809,6 @@ const handleMouseDown$1 = event => {
6823
6809
  * @param {WheelEvent} event
6824
6810
  */
6825
6811
  const handleWheel$1 = event => {
6826
- const uid = fromEvent(event);
6827
6812
  const {
6828
6813
  deltaMode,
6829
6814
  deltaX,
@@ -6832,16 +6817,15 @@ const handleWheel$1 = event => {
6832
6817
  // event.preventDefault()
6833
6818
  // const state = EditorHelper.getStateFromEvent(event)
6834
6819
  // TODO send editor id
6835
- setDelta(uid, deltaMode, deltaX, deltaY);
6820
+ return ['setDelta', deltaMode, deltaX, deltaY];
6836
6821
  };
6837
6822
  const handlePaste = event => {
6838
6823
  preventDefault(event);
6839
- const uid = fromEvent(event);
6840
6824
  const {
6841
6825
  clipboardData
6842
6826
  } = event;
6843
6827
  const text = getText(clipboardData);
6844
- paste(uid, text);
6828
+ return ['paste', text];
6845
6829
  };
6846
6830
 
6847
6831
  /**
@@ -6849,11 +6833,10 @@ const handlePaste = event => {
6849
6833
  * @param {PointerEvent} event
6850
6834
  */
6851
6835
  const handleScrollBarThumbVerticalPointerMove = event => {
6852
- const uid = fromEvent(event);
6853
6836
  const {
6854
6837
  clientY
6855
6838
  } = event;
6856
- handleScrollBarVerticalMove(uid, clientY);
6839
+ return ['handleScrollBarVerticalMove', clientY];
6857
6840
  };
6858
6841
 
6859
6842
  /**
@@ -6866,6 +6849,7 @@ const handleScrollBarVerticalPointerUp = event => {
6866
6849
  pointerId
6867
6850
  } = event;
6868
6851
  stopTracking(target, pointerId, handleScrollBarThumbVerticalPointerMove, handleScrollBarVerticalPointerUp);
6852
+ return [];
6869
6853
  };
6870
6854
 
6871
6855
  /**
@@ -6873,14 +6857,13 @@ const handleScrollBarVerticalPointerUp = event => {
6873
6857
  * @param {PointerEvent} event
6874
6858
  */
6875
6859
  const handleScrollBarVerticalPointerDown = event => {
6876
- const uid = fromEvent(event);
6877
6860
  const {
6878
6861
  target,
6879
6862
  pointerId,
6880
6863
  clientY
6881
6864
  } = event;
6882
6865
  startTracking(target, pointerId, handleScrollBarThumbVerticalPointerMove, handleScrollBarVerticalPointerUp);
6883
- handleScrollBarVerticalPointerDown$1(uid, clientY);
6866
+ return ['handleScrollBarVerticalPointerDown', clientY];
6884
6867
  };
6885
6868
 
6886
6869
  /**
@@ -6891,8 +6874,7 @@ const handleScrollBarThumbHorizontalPointerMove = event => {
6891
6874
  const {
6892
6875
  clientX
6893
6876
  } = event;
6894
- const uid = fromEvent(event);
6895
- handleScrollBarHorizontalMove(uid, clientX);
6877
+ return ['handleScrollBarHorizontalMove', clientX];
6896
6878
  };
6897
6879
 
6898
6880
  /**
@@ -6905,6 +6887,7 @@ const handleScrollBarHorizontalPointerUp = event => {
6905
6887
  pointerId
6906
6888
  } = event;
6907
6889
  stopTracking(target, pointerId, handleScrollBarThumbHorizontalPointerMove, handleScrollBarHorizontalPointerUp);
6890
+ return [];
6908
6891
  };
6909
6892
 
6910
6893
  /**
@@ -6918,12 +6901,21 @@ const handleScrollBarHorizontalPointerDown = event => {
6918
6901
  clientX
6919
6902
  } = event;
6920
6903
  startTracking(target, pointerId, handleScrollBarThumbHorizontalPointerMove, handleScrollBarHorizontalPointerUp);
6921
- handleScrollBarHorizontalPointerDown$1(clientX);
6904
+ return ['handleScrollBarHorizontalPointerDown', clientX];
6922
6905
  };
6923
6906
  const handleScrollBarContextMenu = event => {
6924
6907
  preventDefault(event);
6925
6908
  stopPropagation(event);
6926
6909
  };
6910
+ const handleContextMenu$6 = event => {
6911
+ preventDefault(event);
6912
+ const {
6913
+ button,
6914
+ clientX,
6915
+ clientY
6916
+ } = event;
6917
+ return ['handleContextMenu', button, clientX, clientY];
6918
+ };
6927
6919
 
6928
6920
  const setCursors = (state, dom) => {
6929
6921
  object(state);
@@ -6996,7 +6988,7 @@ const create$n = () => {
6996
6988
  $EditorInput.setAttribute('spellcheck', False);
6997
6989
  $EditorInput.role = TextBox;
6998
6990
  // TODO where to best put listeners (side effects)
6999
- attachEvents$c($EditorInput, {
6991
+ attachEventsFunctional($EditorInput, {
7000
6992
  [BeforeInput]: handleBeforeInput$1,
7001
6993
  [CompositionStart]: handleCompositionStart,
7002
6994
  [CompositionUpdate]: handleCompositionUpdate,
@@ -7004,7 +6996,8 @@ const create$n = () => {
7004
6996
  [Focus]: handleFocus$8,
7005
6997
  [Blur]: handleBlur$6,
7006
6998
  [Cut]: handleCut,
7007
- [Paste]: handlePaste
6999
+ [Paste]: handlePaste,
7000
+ returnValue: true
7008
7001
  });
7009
7002
  $EditorInput.name = 'editor';
7010
7003
  const $LayerCursor = document.createElement('div');
@@ -7013,9 +7006,10 @@ const create$n = () => {
7013
7006
  $LayerText.className = 'EditorRows';
7014
7007
  const $LayerGutter = document.createElement('div');
7015
7008
  $LayerGutter.className = 'Gutter';
7016
- attachEvents$c($LayerText, {
7009
+ attachEventsFunctional($LayerText, {
7017
7010
  [MouseDown]: handleMouseDown$1,
7018
- [PointerDown]: handleEditorPointerDown
7011
+ [PointerDown]: handleEditorPointerDown,
7012
+ returnValue: true
7019
7013
  });
7020
7014
  const $ScrollBarThumbVertical = document.createElement('div');
7021
7015
  $ScrollBarThumbVertical.className = 'ScrollBarThumb ScrollBarThumbVertical';
@@ -7025,9 +7019,10 @@ const create$n = () => {
7025
7019
  $ScrollBarDiagnostics.className = 'EditorScrollBarDiagnostics';
7026
7020
  const $ScrollBarVertical = document.createElement('div');
7027
7021
  $ScrollBarVertical.className = 'ScrollBar ScrollBarVertical';
7028
- attachEvents$c($ScrollBarVertical, {
7022
+ attachEventsFunctional($ScrollBarVertical, {
7029
7023
  [PointerDown]: handleScrollBarVerticalPointerDown,
7030
- [ContextMenu]: handleScrollBarContextMenu
7024
+ [ContextMenu]: handleScrollBarContextMenu,
7025
+ returnValue: true
7031
7026
  });
7032
7027
  $ScrollBarVertical.append($ScrollBarThumbVertical);
7033
7028
  const $ScrollBarThumbHorizontal = document.createElement('div');
@@ -7035,8 +7030,9 @@ const create$n = () => {
7035
7030
  const $ScrollBarHorizontal = document.createElement('div');
7036
7031
  $ScrollBarHorizontal.className = 'ScrollBar ScrollBarHorizontal';
7037
7032
  $ScrollBarHorizontal.append($ScrollBarThumbHorizontal);
7038
- attachEvents$c($ScrollBarHorizontal, {
7039
- [PointerDown]: handleScrollBarHorizontalPointerDown
7033
+ attachEventsFunctional($ScrollBarHorizontal, {
7034
+ [PointerDown]: handleScrollBarHorizontalPointerDown,
7035
+ returnValue: true
7040
7036
  });
7041
7037
 
7042
7038
  // $EditorRows.addEventListener('mousemove', handleMouseMove, { passive: true })
@@ -7066,11 +7062,11 @@ const create$n = () => {
7066
7062
  $Editor.className = 'Viewlet Editor';
7067
7063
  $Editor.role = Code;
7068
7064
  $Editor.append($LayerGutter, $EditorContent);
7069
- attachEvents$c($Editor, {
7070
- [ContextMenu]: handleContextMenu$5
7065
+ attachEventsFunctional($Editor, {
7066
+ [ContextMenu]: handleContextMenu$6,
7067
+ [Wheel]: handleWheel$1,
7068
+ returnValue: true
7071
7069
  });
7072
- $Editor.addEventListener(Wheel, handleWheel$1, Passive);
7073
- // $Editor.addEventListener(DomEventType.MouseMove, EditorEvents.handlePointerMove, DomEventOptions.Passive)
7074
7070
  return {
7075
7071
  $LayerCursor,
7076
7072
  $LayerSelections,
@@ -7266,6 +7262,17 @@ const ViewletError = {
7266
7262
  setMessage: setMessage$1
7267
7263
  };
7268
7264
 
7265
+ const handleContextMenu$5 = event => {
7266
+ preventDefault(event);
7267
+ const {
7268
+ button,
7269
+ clientX,
7270
+ clientY
7271
+ } = event;
7272
+ const uid = fromEvent(event);
7273
+ handleContextMenu$8(uid, button, clientX, clientY);
7274
+ };
7275
+
7269
7276
  const CopyMove = 'copyMove';
7270
7277
 
7271
7278
  const Text = 'text';
@@ -8749,7 +8756,7 @@ const handleContextMenu$4 = event => {
8749
8756
  clientY
8750
8757
  } = event;
8751
8758
  const uid = fromEvent(event);
8752
- handleContextMenu$7(uid, clientX, clientY);
8759
+ handleContextMenu$8(uid, clientX, clientY);
8753
8760
  };
8754
8761
 
8755
8762
  // TODO Main should not be bound to Editor -> Lazy load Editor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "main": "dist/diffWorkerMain.js",
6
6
  "type": "module",
@@ -41,6 +41,7 @@
41
41
  "**/renderer-process/**",
42
42
  "**/extension-host-worker/**"
43
43
  ],
44
+ "ext": "ts,js",
44
45
  "exec": "node scripts/build.js"
45
46
  }
46
47
  }