@lvce-editor/renderer-process 6.5.0 → 6.6.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.
@@ -2256,7 +2256,15 @@ var rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
2256
2256
  return $Viewlet;
2257
2257
  };
2258
2258
 
2259
+ const handleWindowMessage = event => {
2260
+ console.log({
2261
+ event
2262
+ });
2263
+ };
2259
2264
  const main = async () => {
2265
+ if (location.pathname.includes('/test')) {
2266
+ window.addEventListener('message', handleWindowMessage);
2267
+ }
2260
2268
  onerror = handleUnhandledError;
2261
2269
  onunhandledrejection = handleUnhandledRejection;
2262
2270
  if ('SecurityPolicyViolationEvent' in self) {
@@ -3178,7 +3186,6 @@ const CompositionStart = 'compositionstart';
3178
3186
  const CompositionUpdate = 'compositionupdate';
3179
3187
  const ContextMenu = 'contextmenu';
3180
3188
  const Cut = 'cut';
3181
- const Load = 'load';
3182
3189
  const DoubleClick = 'dblclick';
3183
3190
  const DragEnd = 'dragend';
3184
3191
  const DragLeave = 'dragleave';
@@ -3337,7 +3344,7 @@ const create$Menu$1 = () => {
3337
3344
  // })
3338
3345
  $Menu.onkeydown = handleKeyDown$5;
3339
3346
  $Menu.addEventListener(FocusOut, handleFocusOut$1);
3340
- $Menu.oncontextmenu = handleContextMenu$a;
3347
+ $Menu.oncontextmenu = handleContextMenu$c;
3341
3348
  // $ContextMenu.onfocus = handleFocus
3342
3349
  // $ContextMenu.onblur = handleBlur
3343
3350
  return $Menu;
@@ -3366,14 +3373,14 @@ const handleBackDropMouseDown = event => {
3366
3373
  stopPropagation(event);
3367
3374
  send( /* Menu.hide */'Menu.hide');
3368
3375
  };
3369
- const handleContextMenu$a = event => {
3376
+ const handleContextMenu$c = event => {
3370
3377
  preventDefault(event);
3371
3378
  };
3372
3379
  const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mouseBlocking = false) => {
3373
3380
  if (mouseBlocking) {
3374
3381
  const $BackDrop = create$BackDrop();
3375
3382
  $BackDrop.onmousedown = handleBackDropMouseDown;
3376
- $BackDrop.oncontextmenu = handleContextMenu$a;
3383
+ $BackDrop.oncontextmenu = handleContextMenu$c;
3377
3384
  // @ts-expect-error
3378
3385
  state$2.$BackDrop = $BackDrop;
3379
3386
  append$1($BackDrop);
@@ -4244,6 +4251,7 @@ const TitleBarTitle = 'TitleBarTitle';
4244
4251
  const About = 'About';
4245
4252
  const EditorSourceActions = 'EditorSourceActions';
4246
4253
  const E2eTests = 'E2eTests';
4254
+ const E2eTest = 'E2eTest';
4247
4255
 
4248
4256
  const load = moduleId => {
4249
4257
  switch (moduleId) {
@@ -4355,6 +4363,8 @@ const load = moduleId => {
4355
4363
  return Promise.resolve().then(function () { return ViewletInlineDiffEditor; });
4356
4364
  case E2eTests:
4357
4365
  return Promise.resolve().then(function () { return ViewletE2eTests; });
4366
+ case E2eTest:
4367
+ return Promise.resolve().then(function () { return ViewletE2eTest; });
4358
4368
  default:
4359
4369
  throw new Error(`${moduleId} module not found in renderer process`);
4360
4370
  }
@@ -5761,7 +5771,7 @@ const handleFocus$c = () => {
5761
5771
 
5762
5772
  // TODO use context menu events function again
5763
5773
 
5764
- const handleContextMenu$9 = event => {
5774
+ const handleContextMenu$b = event => {
5765
5775
  preventDefault(event);
5766
5776
  const {
5767
5777
  button,
@@ -5770,22 +5780,22 @@ const handleContextMenu$9 = event => {
5770
5780
  } = event;
5771
5781
  return ['handleContextMenu', button, clientX, clientY];
5772
5782
  };
5773
- const returnValue$7 = true;
5783
+ const returnValue$8 = true;
5774
5784
 
5775
5785
  const ViewletActivityBarEvents = {
5776
5786
  __proto__: null,
5777
5787
  handleBlur: handleBlur$9,
5778
- handleContextMenu: handleContextMenu$9,
5788
+ handleContextMenu: handleContextMenu$b,
5779
5789
  handleFocus: handleFocus$c,
5780
5790
  handleMouseDown: handleMouseDown$3,
5781
- returnValue: returnValue$7
5791
+ returnValue: returnValue$8
5782
5792
  };
5783
5793
 
5784
- const Events$b = ViewletActivityBarEvents;
5794
+ const Events$a = ViewletActivityBarEvents;
5785
5795
 
5786
5796
  const ViewletActivityBar = {
5787
5797
  __proto__: null,
5788
- Events: Events$b
5798
+ Events: Events$a
5789
5799
  };
5790
5800
 
5791
5801
  const executeViewletCommand = (uid, command, ...args) => {
@@ -5827,7 +5837,7 @@ const handleButtonClick = forwardViewletCommand('handleButtonClick');
5827
5837
  const handleClick$9 = forwardViewletCommand('handleClick');
5828
5838
  const handleClickAction$2 = forwardViewletCommand('handleClickAction');
5829
5839
  forwardViewletCommand('handleClickAdd');
5830
- const handleClickAt$1 = forwardViewletCommand('handleClickAt');
5840
+ const handleClickAt$2 = forwardViewletCommand('handleClickAt');
5831
5841
  const handleClickOpenFolder$1 = forwardViewletCommand('handleClickOpenFolder');
5832
5842
  forwardViewletCommand('handleClickClose');
5833
5843
  forwardViewletCommand('handleClickCopy');
@@ -5837,7 +5847,7 @@ forwardViewletCommand('handleClickOpenFile');
5837
5847
  forwardViewletCommand('handleClickRestore');
5838
5848
  const handleClickTab$2 = forwardViewletCommand('handleClickTab');
5839
5849
  forwardViewletCommand('handleClickToggleMaximize');
5840
- const handleContextMenu$8 = forwardViewletCommand('handleContextMenu');
5850
+ const handleContextMenu$a = forwardViewletCommand('handleContextMenu');
5841
5851
  const handleDoubleClick = forwardViewletCommand('handleDoubleClick');
5842
5852
  const handleDragEnd$1 = forwardViewletCommand('handleDragEnd');
5843
5853
  const handleDragLeave$1 = forwardViewletCommand('handleDragLeave');
@@ -5924,11 +5934,11 @@ const ViewletAudioEvents = {
5924
5934
  handleAudioError
5925
5935
  };
5926
5936
 
5927
- const Events$a = ViewletAudioEvents;
5937
+ const Events$9 = ViewletAudioEvents;
5928
5938
 
5929
5939
  const ViewletAudio = {
5930
5940
  __proto__: null,
5931
- Events: Events$a
5941
+ Events: Events$9
5932
5942
  };
5933
5943
 
5934
5944
  const create$x = () => {
@@ -6043,12 +6053,12 @@ const handlePointerDown$6 = event => {
6043
6053
  }
6044
6054
  return [];
6045
6055
  };
6046
- const returnValue$6 = true;
6056
+ const returnValue$7 = true;
6047
6057
 
6048
6058
  const ViewletColorPickerEvents = {
6049
6059
  __proto__: null,
6050
6060
  handlePointerDown: handlePointerDown$6,
6051
- returnValue: returnValue$6
6061
+ returnValue: returnValue$7
6052
6062
  };
6053
6063
 
6054
6064
  const setColor = (state, color) => {
@@ -6362,7 +6372,7 @@ const handleMousedown = event => {
6362
6372
  clientY
6363
6373
  } = event;
6364
6374
  const uid = fromEvent(event);
6365
- handleClickAt$1(uid, clientX, clientY);
6375
+ handleClickAt$2(uid, clientX, clientY);
6366
6376
  };
6367
6377
  const handleScrollBarThumbPointerMove$2 = event => {
6368
6378
  const {
@@ -6572,7 +6582,7 @@ const ViewletEditorError = {
6572
6582
  setDom: setDom$6
6573
6583
  };
6574
6584
 
6575
- const returnValue$5 = true;
6585
+ const returnValue$6 = true;
6576
6586
  const handleSashPointerDown$2 = create$v(event => {
6577
6587
  const {
6578
6588
  clientX,
@@ -6596,7 +6606,7 @@ const handleSashPointerDown$2 = create$v(event => {
6596
6606
  const ViewletEditorHoverEvents = {
6597
6607
  __proto__: null,
6598
6608
  handleSashPointerDown: handleSashPointerDown$2,
6599
- returnValue: returnValue$5
6609
+ returnValue: returnValue$6
6600
6610
  };
6601
6611
 
6602
6612
  const setBounds$2 = (state, x, y, width, height) => {
@@ -6693,7 +6703,7 @@ const handleWheel$2 = event => {
6693
6703
  *
6694
6704
  * @param {MouseEvent} event
6695
6705
  */
6696
- const handleContextMenu$7 = event => {
6706
+ const handleContextMenu$9 = event => {
6697
6707
  preventDefault(event);
6698
6708
  const {
6699
6709
  button,
@@ -6701,7 +6711,7 @@ const handleContextMenu$7 = event => {
6701
6711
  clientY
6702
6712
  } = event;
6703
6713
  const uid = fromEvent(event);
6704
- handleContextMenu$8(uid, button, clientX, clientY);
6714
+ handleContextMenu$a(uid, button, clientX, clientY);
6705
6715
  };
6706
6716
  const handleError$5 = event => {
6707
6717
  const uid = fromEvent(event);
@@ -6726,7 +6736,7 @@ const attachEvents$9 = state => {
6726
6736
  attachEvents$b($Viewlet, {
6727
6737
  [PointerDown]: handlePointerDown$5,
6728
6738
  [PointerUp]: handlePointerUp,
6729
- [ContextMenu]: handleContextMenu$7,
6739
+ [ContextMenu]: handleContextMenu$9,
6730
6740
  [FocusIn]: handleFocus$9
6731
6741
  });
6732
6742
  $Viewlet.addEventListener(Error$3, handleError$5, Capture);
@@ -7092,7 +7102,7 @@ const handleScrollBarContextMenu = event => {
7092
7102
  preventDefault(event);
7093
7103
  stopPropagation(event);
7094
7104
  };
7095
- const handleContextMenu$6 = event => {
7105
+ const handleContextMenu$8 = event => {
7096
7106
  preventDefault(event);
7097
7107
  const {
7098
7108
  button,
@@ -7248,7 +7258,7 @@ const create$n = () => {
7248
7258
  $Editor.role = Code;
7249
7259
  $Editor.append($LayerGutter, $EditorContent);
7250
7260
  attachEventsFunctional($Editor, {
7251
- [ContextMenu]: handleContextMenu$6,
7261
+ [ContextMenu]: handleContextMenu$8,
7252
7262
  [Wheel]: handleWheel$1,
7253
7263
  returnValue: true
7254
7264
  });
@@ -7447,7 +7457,7 @@ const ViewletError = {
7447
7457
  setMessage: setMessage$1
7448
7458
  };
7449
7459
 
7450
- const handleContextMenu$5 = event => {
7460
+ const handleContextMenu$7 = event => {
7451
7461
  preventDefault(event);
7452
7462
  const {
7453
7463
  button,
@@ -7455,7 +7465,7 @@ const handleContextMenu$5 = event => {
7455
7465
  clientY
7456
7466
  } = event;
7457
7467
  const uid = fromEvent(event);
7458
- handleContextMenu$8(uid, button, clientX, clientY);
7468
+ handleContextMenu$a(uid, button, clientX, clientY);
7459
7469
  };
7460
7470
 
7461
7471
  const CopyMove = 'copyMove';
@@ -7595,7 +7605,7 @@ const handleClick$6 = event => {
7595
7605
  clientY
7596
7606
  } = event;
7597
7607
  const uid = fromEvent(event);
7598
- handleClickAt$1(uid, button, clientX, clientY);
7608
+ handleClickAt$2(uid, button, clientX, clientY);
7599
7609
  };
7600
7610
  const handleClickOpenFolder = event => {
7601
7611
  preventDefault(event);
@@ -7649,7 +7659,7 @@ const ViewletExplorerEvents = {
7649
7659
  handleBlur: handleBlur$5,
7650
7660
  handleClick: handleClick$6,
7651
7661
  handleClickOpenFolder,
7652
- handleContextMenu: handleContextMenu$5,
7662
+ handleContextMenu: handleContextMenu$7,
7653
7663
  handleDragEnd,
7654
7664
  handleDragLeave,
7655
7665
  handleDragOver,
@@ -7673,7 +7683,7 @@ const create$i = () => {
7673
7683
  $Viewlet
7674
7684
  };
7675
7685
  };
7676
- const Events$9 = ViewletExplorerEvents;
7686
+ const Events$8 = ViewletExplorerEvents;
7677
7687
  const handleError$3 = (state, message) => {
7678
7688
  object(state);
7679
7689
  string(message);
@@ -7720,7 +7730,7 @@ const setDom$4 = (state, dom) => {
7720
7730
 
7721
7731
  const ViewletExplorer = {
7722
7732
  __proto__: null,
7723
- Events: Events$9,
7733
+ Events: Events$8,
7724
7734
  create: create$i,
7725
7735
  dispose: dispose$9,
7726
7736
  focusInput,
@@ -7764,11 +7774,11 @@ const ViewletExtensionDetailEvents = {
7764
7774
  handleReadmeContextMenu
7765
7775
  };
7766
7776
 
7767
- const Events$8 = ViewletExtensionDetailEvents;
7777
+ const Events$7 = ViewletExtensionDetailEvents;
7768
7778
 
7769
7779
  const ViewletExtensionDetail = {
7770
7780
  __proto__: null,
7771
- Events: Events$8,
7781
+ Events: Events$7,
7772
7782
  setSize
7773
7783
  };
7774
7784
 
@@ -7914,7 +7924,7 @@ const attachEvents$8 = state => {
7914
7924
  // @ts-expect-error
7915
7925
  $ExtensionHeader.addEventListener(Click, undefined);
7916
7926
  attachEvents$b($ListItems, {
7917
- [ContextMenu]: handleContextMenu$5,
7927
+ [ContextMenu]: handleContextMenu$7,
7918
7928
  [PointerDown]: handlePointerDown$3,
7919
7929
  [Focus]: handleFocus$6,
7920
7930
  [Scroll]: handleScroll
@@ -8157,7 +8167,7 @@ const ViewletLocationsEvents = {
8157
8167
  handleLocationsMouseDown
8158
8168
  };
8159
8169
 
8160
- const Events$7 = ViewletLocationsEvents;
8170
+ const Events$6 = ViewletLocationsEvents;
8161
8171
  const setFocusedIndex$3 = (state, oldFocusedIndex, newFocusedIndex) => {
8162
8172
  const {
8163
8173
  $Viewlet
@@ -8192,7 +8202,7 @@ const focus$b = state => {
8192
8202
 
8193
8203
  const ViewletImplementations = {
8194
8204
  __proto__: null,
8195
- Events: Events$7,
8205
+ Events: Events$6,
8196
8206
  focus: focus$b,
8197
8207
  handleError: handleError$1,
8198
8208
  setFocusedIndex: setFocusedIndex$3
@@ -8274,7 +8284,7 @@ const handlePointerDown$2 = event => {
8274
8284
 
8275
8285
  const ViewletkeyBindingsEvents = {
8276
8286
  __proto__: null,
8277
- handleContextMenu: handleContextMenu$5,
8287
+ handleContextMenu: handleContextMenu$7,
8278
8288
  handleInput: handleInput$4,
8279
8289
  handlePointerDown: handlePointerDown$2,
8280
8290
  handleResizerPointerDown,
@@ -8303,11 +8313,11 @@ const setColumnWidths = (state, columnWidth1, columnWidth2, columnWidth3) => {
8303
8313
  $Resizer1.style.left = `${paddingLeft + columnWidth1}px`;
8304
8314
  $Resizer2.style.left = `${paddingLeft + columnWidth1 + columnWidth2}px`;
8305
8315
  };
8306
- const Events$6 = ViewletkeyBindingsEvents;
8316
+ const Events$5 = ViewletkeyBindingsEvents;
8307
8317
 
8308
8318
  const ViewletKeyBindings = {
8309
8319
  __proto__: null,
8310
- Events: Events$6,
8320
+ Events: Events$5,
8311
8321
  setColumnWidths,
8312
8322
  setScrollBar: setScrollBar$2,
8313
8323
  setSize,
@@ -8863,7 +8873,7 @@ const ViewletLayout = {
8863
8873
  setSashes
8864
8874
  };
8865
8875
 
8866
- const handleContextMenu$4 = event => {
8876
+ const handleContextMenu$6 = event => {
8867
8877
  if (event.defaultPrevented) {
8868
8878
  return;
8869
8879
  }
@@ -8873,7 +8883,7 @@ const handleContextMenu$4 = event => {
8873
8883
  clientY
8874
8884
  } = event;
8875
8885
  const uid = fromEvent(event);
8876
- handleContextMenu$8(uid, clientX, clientY);
8886
+ handleContextMenu$a(uid, clientX, clientY);
8877
8887
  };
8878
8888
 
8879
8889
  // TODO Main should not be bound to Editor -> Lazy load Editor
@@ -8907,7 +8917,7 @@ const attachEvents$6 = state => {
8907
8917
  [DragOver]: handleDragOver,
8908
8918
  [DragEnd]: handleDragEnd,
8909
8919
  [DragLeave]: handleDragLeave,
8910
- [ContextMenu]: handleContextMenu$4
8920
+ [ContextMenu]: handleContextMenu$6
8911
8921
  });
8912
8922
  };
8913
8923
  const dispose$7 = state => {};
@@ -9302,7 +9312,7 @@ const handlePointerDown$1 = event => {
9302
9312
  } = event;
9303
9313
  return ['handleClickAt', clientX, clientY];
9304
9314
  };
9305
- const handleContextMenu$3 = event => {
9315
+ const handleContextMenu$5 = event => {
9306
9316
  preventDefault(event);
9307
9317
  const {
9308
9318
  clientX,
@@ -9322,15 +9332,15 @@ const handleFilterInput = event => {
9322
9332
  const handleClearFilterClick = event => {
9323
9333
  return ['clearFilter'];
9324
9334
  };
9325
- const returnValue$4 = true;
9335
+ const returnValue$5 = true;
9326
9336
 
9327
9337
  const ViewletProblemsEvents = {
9328
9338
  __proto__: null,
9329
9339
  handleClearFilterClick,
9330
- handleContextMenu: handleContextMenu$3,
9340
+ handleContextMenu: handleContextMenu$5,
9331
9341
  handleFilterInput,
9332
9342
  handlePointerDown: handlePointerDown$1,
9333
- returnValue: returnValue$4
9343
+ returnValue: returnValue$5
9334
9344
  };
9335
9345
 
9336
9346
  const setFocusedIndex$2 = (state, focusedIndex) => {
@@ -9406,7 +9416,7 @@ const handlePointerDown = event => {
9406
9416
  clientY
9407
9417
  } = event;
9408
9418
  const uid = fromEvent(event);
9409
- handleClickAt$1(uid, clientX, clientY);
9419
+ handleClickAt$2(uid, clientX, clientY);
9410
9420
  };
9411
9421
  const handleBlur$2 = event => {
9412
9422
  const uid = fromEvent(event);
@@ -9627,7 +9637,7 @@ const ViewletQuickPick = {
9627
9637
 
9628
9638
  const ViewletReferences = {
9629
9639
  __proto__: null,
9630
- Events: Events$7,
9640
+ Events: Events$6,
9631
9641
  focus: focus$b,
9632
9642
  handleError: handleError$1,
9633
9643
  setFocusedIndex: setFocusedIndex$3
@@ -9907,7 +9917,7 @@ const handleHeaderFocusIn = event => {
9907
9917
  }
9908
9918
  return ['handleFocusIn', key];
9909
9919
  };
9910
- const handleContextMenu$2 = event => {
9920
+ const handleContextMenu$4 = event => {
9911
9921
  preventDefault(event);
9912
9922
  const {
9913
9923
  button,
@@ -9923,12 +9933,12 @@ const handleWheel = event => {
9923
9933
  } = event;
9924
9934
  return ['handleWheel', deltaMode, deltaY];
9925
9935
  };
9926
- const returnValue$3 = true;
9936
+ const returnValue$4 = true;
9927
9937
 
9928
9938
  const ViewletSearchEvents = {
9929
9939
  __proto__: null,
9930
9940
  handleClick: handleClick$4,
9931
- handleContextMenu: handleContextMenu$2,
9941
+ handleContextMenu: handleContextMenu$4,
9932
9942
  handleFocus: handleFocus$2,
9933
9943
  handleHeaderClick: handleHeaderClick$1,
9934
9944
  handleHeaderFocusIn,
@@ -9941,7 +9951,7 @@ const ViewletSearchEvents = {
9941
9951
  handleScrollBarThumbPointerMove,
9942
9952
  handleToggleButtonClick,
9943
9953
  handleWheel,
9944
- returnValue: returnValue$3
9954
+ returnValue: returnValue$4
9945
9955
  };
9946
9956
 
9947
9957
  const focus$5 = state => {
@@ -9967,11 +9977,11 @@ const setFocus = (state, selector) => {
9967
9977
  }
9968
9978
  };
9969
9979
  const dispose$3 = () => {};
9970
- const Events$5 = ViewletSearchEvents;
9980
+ const Events$4 = ViewletSearchEvents;
9971
9981
 
9972
9982
  const ViewletSearch = {
9973
9983
  __proto__: null,
9974
- Events: Events$5,
9984
+ Events: Events$4,
9975
9985
  dispose: dispose$3,
9976
9986
  focus: focus$5,
9977
9987
  setFocus,
@@ -10223,7 +10233,7 @@ const handleInput = event => {
10223
10233
  const ViewletSourceControlEvents = {
10224
10234
  __proto__: null,
10225
10235
  handleClick: handleClick$3,
10226
- handleContextMenu: handleContextMenu$5,
10236
+ handleContextMenu: handleContextMenu$7,
10227
10237
  handleFocus,
10228
10238
  handleInput,
10229
10239
  handleMouseOut,
@@ -10564,7 +10574,7 @@ const ViewletTerminals = {
10564
10574
  setTabsDom
10565
10575
  };
10566
10576
 
10567
- const handleContextMenu$1 = event => {
10577
+ const handleContextMenu$3 = event => {
10568
10578
  preventDefault(event);
10569
10579
  const {
10570
10580
  button,
@@ -10592,7 +10602,7 @@ const attachEvents = state => {
10592
10602
  $Viewlet
10593
10603
  } = state;
10594
10604
  attachEvents$b($Viewlet, {
10595
- [ContextMenu]: handleContextMenu$1
10605
+ [ContextMenu]: handleContextMenu$3
10596
10606
  });
10597
10607
  };
10598
10608
  const activeClassName = 'TitleBarActive';
@@ -10624,26 +10634,26 @@ const handleTitleBarButtonsClick = event => {
10624
10634
  } = event;
10625
10635
  return ['handleClick', target.className];
10626
10636
  };
10627
- const returnValue$2 = true;
10637
+ const returnValue$3 = true;
10628
10638
 
10629
10639
  const ViewletTitleBarButtonEvents = {
10630
10640
  __proto__: null,
10631
10641
  handleTitleBarButtonsClick,
10632
- returnValue: returnValue$2
10642
+ returnValue: returnValue$3
10633
10643
  };
10634
10644
 
10635
- const Events$4 = ViewletTitleBarButtonEvents;
10645
+ const Events$3 = ViewletTitleBarButtonEvents;
10636
10646
 
10637
10647
  const ViewletTitleBarButtons = {
10638
10648
  __proto__: null,
10639
- Events: Events$4
10649
+ Events: Events$3
10640
10650
  };
10641
10651
 
10642
- const Events$3 = {};
10652
+ const Events$2 = {};
10643
10653
 
10644
10654
  const ViewletTitleBarIcon = {
10645
10655
  __proto__: null,
10646
- Events: Events$3
10656
+ Events: Events$2
10647
10657
  };
10648
10658
 
10649
10659
  const isInsideTitleBarMenu = $Element => {
@@ -10975,11 +10985,11 @@ const setMenus = (state, changes, uid) => {
10975
10985
  }
10976
10986
  }
10977
10987
  };
10978
- const Events$2 = ViewletTitleBarMenuBarEvents;
10988
+ const Events$1 = ViewletTitleBarMenuBarEvents;
10979
10989
 
10980
10990
  const ViewletTitleBarMenuBar = {
10981
10991
  __proto__: null,
10982
- Events: Events$2,
10992
+ Events: Events$1,
10983
10993
  closeMenu,
10984
10994
  dispose,
10985
10995
  focus,
@@ -11011,11 +11021,11 @@ const ViewletVideoEvents = {
11011
11021
  handleVideoError
11012
11022
  };
11013
11023
 
11014
- const Events$1 = ViewletVideoEvents;
11024
+ const Events = ViewletVideoEvents;
11015
11025
 
11016
11026
  const ViewletVideo = {
11017
11027
  __proto__: null,
11018
- Events: Events$1
11028
+ Events
11019
11029
  };
11020
11030
 
11021
11031
  const create$1 = () => {
@@ -11050,20 +11060,20 @@ const handleClickCopy = event => {
11050
11060
  const handleFocusIn$1 = event => {
11051
11061
  return ['handleFocusIn'];
11052
11062
  };
11053
- const handleContextMenu = event => {
11063
+ const handleContextMenu$2 = event => {
11054
11064
  preventDefault(event);
11055
11065
  return [];
11056
11066
  };
11057
- const returnValue$1 = true;
11067
+ const returnValue$2 = true;
11058
11068
 
11059
11069
  const ViewletAboutEvents = {
11060
11070
  __proto__: null,
11061
11071
  handleClickClose,
11062
11072
  handleClickCopy,
11063
11073
  handleClickOk,
11064
- handleContextMenu,
11074
+ handleContextMenu: handleContextMenu$2,
11065
11075
  handleFocusIn: handleFocusIn$1,
11066
- returnValue: returnValue$1
11076
+ returnValue: returnValue$2
11067
11077
  };
11068
11078
 
11069
11079
  const setFocused = (state, selector) => {
@@ -11139,47 +11149,151 @@ const ViewletInlineDiffEditor = {
11139
11149
  setScrollBar: setScrollBar$2
11140
11150
  };
11141
11151
 
11142
- const handleClickAt = event => {
11152
+ const handleClickAt$1 = event => {
11143
11153
  const {
11144
11154
  clientX,
11145
11155
  clientY
11146
11156
  } = event;
11147
11157
  return ['handleClickAt', clientX, clientY];
11148
11158
  };
11149
- const handleLoad = event => {
11159
+ const handleLoad$3 = event => {
11150
11160
  return ['handleLoad'];
11151
11161
  };
11152
- const returnValue = true;
11162
+ const handleContextMenu$1 = event => {
11163
+ preventDefault(event);
11164
+ const {
11165
+ button,
11166
+ clientX,
11167
+ clientY
11168
+ } = event;
11169
+ return ['handleContextMenu', button, clientX, clientY];
11170
+ };
11171
+ const returnValue$1 = true;
11153
11172
 
11154
- const Events = {
11173
+ const ViewletE2eTestsEvents = {
11155
11174
  __proto__: null,
11156
- handleClickAt,
11157
- handleLoad,
11158
- returnValue
11175
+ handleClickAt: handleClickAt$1,
11176
+ handleContextMenu: handleContextMenu$1,
11177
+ handleLoad: handleLoad$3,
11178
+ returnValue: returnValue$1
11159
11179
  };
11160
11180
 
11161
11181
  const sendToIframe = (contentWindow, message, origin, transfer) => {
11162
11182
  try {
11183
+ console.log('send to iframe', message);
11163
11184
  contentWindow.postMessage(message, origin, transfer);
11164
11185
  } catch (error) {
11165
11186
  throw new VError$1(error, `Failed to send message to iframe`);
11166
11187
  }
11167
11188
  };
11168
11189
 
11169
- const setIframe = (state, src, sandbox = []) => {
11190
+ const handleLoad$2 = event => {
11191
+ console.log(event.target.src);
11192
+ send('E2eTests.handleLoad');
11193
+ };
11194
+ const setIframe$1 = (state, src, sandbox = []) => {
11195
+ if (!src) {
11196
+ return;
11197
+ }
11170
11198
  const $ExistingIframe = document.querySelector('.E2eTestsIframe');
11171
11199
  if ($ExistingIframe) {
11172
11200
  $ExistingIframe.remove();
11173
11201
  }
11174
11202
  const $Iframe = document.createElement('iframe');
11175
- attachEventsFunctional($Iframe, {
11176
- [Load]: handleLoad
11203
+ for (const element of sandbox) {
11204
+ $Iframe.sandbox.add(element);
11205
+ }
11206
+ $Iframe.className = 'E2eTestsIframe';
11207
+ $Iframe.src = src;
11208
+ console.log({
11209
+ src
11210
+ });
11211
+ $Iframe.addEventListener('load', handleLoad$2, {
11212
+ once: true
11177
11213
  });
11214
+ document.body.append($Iframe);
11215
+ };
11216
+ const setPort$1 = (state, portId, origin) => {
11217
+ const $ExistingIframe = document.querySelector('.E2eTestsIframe');
11218
+ if (!$ExistingIframe) {
11219
+ throw new Error('no iframe found');
11220
+ }
11221
+ const port = acquire(portId);
11222
+ // @ts-ignore
11223
+ const {
11224
+ contentWindow
11225
+ } = $ExistingIframe;
11226
+ const message = {
11227
+ jsonrpc: '2.0',
11228
+ method: 'handleIpc',
11229
+ params: [port]
11230
+ };
11231
+ const transfer = [port];
11232
+ sendToIframe(contentWindow, message, origin, transfer);
11233
+ };
11234
+
11235
+ const ViewletE2eTests = {
11236
+ __proto__: null,
11237
+ Events: ViewletE2eTestsEvents,
11238
+ setIframe: setIframe$1,
11239
+ setPort: setPort$1
11240
+ };
11241
+
11242
+ const handleClickAt = event => {
11243
+ const {
11244
+ clientX,
11245
+ clientY
11246
+ } = event;
11247
+ return ['handleClickAt', clientX, clientY];
11248
+ };
11249
+ const handleLoad$1 = event => {
11250
+ return ['handleLoad'];
11251
+ };
11252
+ const handleContextMenu = event => {
11253
+ preventDefault(event);
11254
+ const {
11255
+ button,
11256
+ clientX,
11257
+ clientY
11258
+ } = event;
11259
+ return ['handleContextMenu', button, clientX, clientY];
11260
+ };
11261
+ const returnValue = true;
11262
+
11263
+ const ViewletE2eTestEvents = {
11264
+ __proto__: null,
11265
+ handleClickAt,
11266
+ handleContextMenu,
11267
+ handleLoad: handleLoad$1,
11268
+ returnValue
11269
+ };
11270
+
11271
+ const handleLoad = event => {
11272
+ console.log(event.target.src);
11273
+ send('E2eTests.handleLoad');
11274
+ };
11275
+
11276
+ // TODO could use browser view when running in electron
11277
+ const setIframe = (state, src, sandbox = []) => {
11278
+ if (!src) {
11279
+ return;
11280
+ }
11281
+ const $ExistingIframe = document.querySelector('.E2eTestsIframe');
11282
+ if ($ExistingIframe) {
11283
+ $ExistingIframe.remove();
11284
+ }
11285
+ const $Iframe = document.createElement('iframe');
11178
11286
  for (const element of sandbox) {
11179
11287
  $Iframe.sandbox.add(element);
11180
11288
  }
11181
11289
  $Iframe.className = 'E2eTestsIframe';
11182
11290
  $Iframe.src = src;
11291
+ console.log({
11292
+ src
11293
+ });
11294
+ $Iframe.addEventListener('load', handleLoad, {
11295
+ once: true
11296
+ });
11183
11297
  document.body.append($Iframe);
11184
11298
  };
11185
11299
  const setPort = (state, portId, origin) => {
@@ -11201,9 +11315,9 @@ const setPort = (state, portId, origin) => {
11201
11315
  sendToIframe(contentWindow, message, origin, transfer);
11202
11316
  };
11203
11317
 
11204
- const ViewletE2eTests = {
11318
+ const ViewletE2eTest = {
11205
11319
  __proto__: null,
11206
- Events,
11320
+ Events: ViewletE2eTestEvents,
11207
11321
  setIframe,
11208
11322
  setPort
11209
11323
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "6.5.0",
3
+ "version": "6.6.0",
4
4
  "description": "",
5
5
  "main": "dist/diffWorkerMain.js",
6
6
  "type": "module",
@@ -18,22 +18,8 @@
18
18
  "url": "https://github.com/lvce-editor/renderer-process.git"
19
19
  },
20
20
  "nodemonConfig": {
21
- "ignore": [
22
- "**/build/**",
23
- "**/misc/**",
24
- "**/playground/**",
25
- "**/static/**",
26
- "**/test/**",
27
- "**/dist/**",
28
- "**/coverage/**",
29
- "**/distmin/**",
30
- "**/scripts/**",
31
- "**/node_modules/**",
32
- "**/coverage/**",
33
- "**/extensions/**",
34
- "**/renderer-worker/**",
35
- "**/renderer-process/**",
36
- "**/extension-host-worker/**"
21
+ "watch": [
22
+ "src"
37
23
  ],
38
24
  "ext": "ts,js",
39
25
  "exec": "node scripts/build.js"