@lvce-editor/renderer-process 6.9.0 → 6.11.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.
@@ -2471,7 +2471,7 @@ const handleButtonClick = forwardViewletCommand('handleButtonClick');
2471
2471
  const handleClick$9 = forwardViewletCommand('handleClick');
2472
2472
  const handleClickAction$2 = forwardViewletCommand('handleClickAction');
2473
2473
  forwardViewletCommand('handleClickAdd');
2474
- const handleClickAt$2 = forwardViewletCommand('handleClickAt');
2474
+ const handleClickAt$3 = forwardViewletCommand('handleClickAt');
2475
2475
  const handleClickOpenFolder$1 = forwardViewletCommand('handleClickOpenFolder');
2476
2476
  forwardViewletCommand('handleClickClose');
2477
2477
  forwardViewletCommand('handleClickCopy');
@@ -2481,7 +2481,7 @@ forwardViewletCommand('handleClickOpenFile');
2481
2481
  forwardViewletCommand('handleClickRestore');
2482
2482
  const handleClickTab$2 = forwardViewletCommand('handleClickTab');
2483
2483
  forwardViewletCommand('handleClickToggleMaximize');
2484
- const handleContextMenu$c = forwardViewletCommand('handleContextMenu');
2484
+ const handleContextMenu$d = forwardViewletCommand('handleContextMenu');
2485
2485
  const handleDoubleClick = forwardViewletCommand('handleDoubleClick');
2486
2486
  const handleDragEnd$1 = forwardViewletCommand('handleDragEnd');
2487
2487
  const handleDragLeave$1 = forwardViewletCommand('handleDragLeave');
@@ -2564,7 +2564,7 @@ const handleMousedown = event => {
2564
2564
  clientY
2565
2565
  } = event;
2566
2566
  const uid = fromEvent(event);
2567
- handleClickAt$2(uid, clientX, clientY);
2567
+ handleClickAt$3(uid, clientX, clientY);
2568
2568
  };
2569
2569
  const handleScrollBarThumbPointerMove$2 = event => {
2570
2570
  const {
@@ -2799,6 +2799,7 @@ const About = 'About';
2799
2799
  const EditorSourceActions = 'EditorSourceActions';
2800
2800
  const E2eTests = 'E2eTests';
2801
2801
  const E2eTest = 'E2eTest';
2802
+ const WebView = 'WebView';
2802
2803
 
2803
2804
  const state$6 = {
2804
2805
  instances: Object.create(null),
@@ -3753,7 +3754,7 @@ const create$Menu$1 = () => {
3753
3754
  // })
3754
3755
  $Menu.onkeydown = handleKeyDown$4;
3755
3756
  $Menu.addEventListener(FocusOut, handleFocusOut$1);
3756
- $Menu.oncontextmenu = handleContextMenu$b;
3757
+ $Menu.oncontextmenu = handleContextMenu$c;
3757
3758
  // $ContextMenu.onfocus = handleFocus
3758
3759
  // $ContextMenu.onblur = handleBlur
3759
3760
  return $Menu;
@@ -3782,14 +3783,14 @@ const handleBackDropMouseDown = event => {
3782
3783
  stopPropagation(event);
3783
3784
  send( /* Menu.hide */'Menu.hide');
3784
3785
  };
3785
- const handleContextMenu$b = event => {
3786
+ const handleContextMenu$c = event => {
3786
3787
  preventDefault(event);
3787
3788
  };
3788
3789
  const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mouseBlocking = false) => {
3789
3790
  if (mouseBlocking) {
3790
3791
  const $BackDrop = create$BackDrop();
3791
3792
  $BackDrop.onmousedown = handleBackDropMouseDown;
3792
- $BackDrop.oncontextmenu = handleContextMenu$b;
3793
+ $BackDrop.oncontextmenu = handleContextMenu$c;
3793
3794
  // @ts-expect-error
3794
3795
  state$1.$BackDrop = $BackDrop;
3795
3796
  append$1($BackDrop);
@@ -4714,6 +4715,8 @@ const load = moduleId => {
4714
4715
  return Promise.resolve().then(function () { return ViewletE2eTests; });
4715
4716
  case E2eTest:
4716
4717
  return Promise.resolve().then(function () { return ViewletE2eTest; });
4718
+ case WebView:
4719
+ return Promise.resolve().then(function () { return ViewletWebView; });
4717
4720
  default:
4718
4721
  throw new Error(`${moduleId} module not found in renderer process`);
4719
4722
  }
@@ -6113,7 +6116,7 @@ const handleFocus$b = () => {
6113
6116
 
6114
6117
  // TODO use context menu events function again
6115
6118
 
6116
- const handleContextMenu$a = event => {
6119
+ const handleContextMenu$b = event => {
6117
6120
  preventDefault(event);
6118
6121
  const {
6119
6122
  button,
@@ -6122,15 +6125,15 @@ const handleContextMenu$a = event => {
6122
6125
  } = event;
6123
6126
  return ['handleContextMenu', button, clientX, clientY];
6124
6127
  };
6125
- const returnValue$8 = true;
6128
+ const returnValue$9 = true;
6126
6129
 
6127
6130
  const ViewletActivityBarEvents = {
6128
6131
  __proto__: null,
6129
6132
  handleBlur: handleBlur$8,
6130
- handleContextMenu: handleContextMenu$a,
6133
+ handleContextMenu: handleContextMenu$b,
6131
6134
  handleFocus: handleFocus$b,
6132
6135
  handleMouseDown: handleMouseDown$2,
6133
- returnValue: returnValue$8
6136
+ returnValue: returnValue$9
6134
6137
  };
6135
6138
 
6136
6139
  const Events$a = ViewletActivityBarEvents;
@@ -6279,12 +6282,12 @@ const handlePointerDown$6 = event => {
6279
6282
  }
6280
6283
  return [];
6281
6284
  };
6282
- const returnValue$7 = true;
6285
+ const returnValue$8 = true;
6283
6286
 
6284
6287
  const ViewletColorPickerEvents = {
6285
6288
  __proto__: null,
6286
6289
  handlePointerDown: handlePointerDown$6,
6287
- returnValue: returnValue$7
6290
+ returnValue: returnValue$8
6288
6291
  };
6289
6292
 
6290
6293
  const setColor = (state, color) => {
@@ -6583,7 +6586,7 @@ const ViewletEditorError = {
6583
6586
  setDom: setDom$6
6584
6587
  };
6585
6588
 
6586
- const returnValue$6 = true;
6589
+ const returnValue$7 = true;
6587
6590
  const handleSashPointerDown$2 = create$u(event => {
6588
6591
  const {
6589
6592
  clientX,
@@ -6607,7 +6610,7 @@ const handleSashPointerDown$2 = create$u(event => {
6607
6610
  const ViewletEditorHoverEvents = {
6608
6611
  __proto__: null,
6609
6612
  handleSashPointerDown: handleSashPointerDown$2,
6610
- returnValue: returnValue$6
6613
+ returnValue: returnValue$7
6611
6614
  };
6612
6615
 
6613
6616
  const setBounds$2 = (state, x, y, width, height) => {
@@ -6704,7 +6707,7 @@ const handleWheel$2 = event => {
6704
6707
  *
6705
6708
  * @param {MouseEvent} event
6706
6709
  */
6707
- const handleContextMenu$9 = event => {
6710
+ const handleContextMenu$a = event => {
6708
6711
  preventDefault(event);
6709
6712
  const {
6710
6713
  button,
@@ -6712,7 +6715,7 @@ const handleContextMenu$9 = event => {
6712
6715
  clientY
6713
6716
  } = event;
6714
6717
  const uid = fromEvent(event);
6715
- handleContextMenu$c(uid, button, clientX, clientY);
6718
+ handleContextMenu$d(uid, button, clientX, clientY);
6716
6719
  };
6717
6720
  const handleError$5 = event => {
6718
6721
  const uid = fromEvent(event);
@@ -6737,7 +6740,7 @@ const attachEvents$9 = state => {
6737
6740
  attachEvents$c($Viewlet, {
6738
6741
  [PointerDown]: handlePointerDown$5,
6739
6742
  [PointerUp]: handlePointerUp,
6740
- [ContextMenu]: handleContextMenu$9,
6743
+ [ContextMenu]: handleContextMenu$a,
6741
6744
  [FocusIn]: handleFocus$9
6742
6745
  });
6743
6746
  $Viewlet.addEventListener(Error$3, handleError$5, Capture);
@@ -7103,7 +7106,7 @@ const handleScrollBarContextMenu = event => {
7103
7106
  preventDefault(event);
7104
7107
  stopPropagation(event);
7105
7108
  };
7106
- const handleContextMenu$8 = event => {
7109
+ const handleContextMenu$9 = event => {
7107
7110
  preventDefault(event);
7108
7111
  const {
7109
7112
  button,
@@ -7259,7 +7262,7 @@ const create$n = () => {
7259
7262
  $Editor.role = Code;
7260
7263
  $Editor.append($LayerGutter, $EditorContent);
7261
7264
  attachEventsFunctional($Editor, {
7262
- [ContextMenu]: handleContextMenu$8,
7265
+ [ContextMenu]: handleContextMenu$9,
7263
7266
  [Wheel]: handleWheel$1,
7264
7267
  returnValue: true
7265
7268
  });
@@ -7317,10 +7320,16 @@ const setSelections$1 = (state, cursorInfos, selectionInfos) => {
7317
7320
  setCursors(state, cursorInfos);
7318
7321
  setSelections$2(state, selectionInfos);
7319
7322
  };
7320
- const setFocused$3 = (state, isFocused) => {
7323
+ const setFocused$3 = async (state, isFocused) => {
7321
7324
  const {
7322
7325
  $EditorInput
7323
7326
  } = state;
7327
+ let tries = 0;
7328
+ while (!$EditorInput.isConnected && tries++ < 1000) {
7329
+ await new Promise(resolve => {
7330
+ requestAnimationFrame(resolve);
7331
+ });
7332
+ }
7324
7333
  if (!$EditorInput.isConnected) {
7325
7334
  warn('unmounted editor cannot be focused');
7326
7335
  }
@@ -7458,7 +7467,7 @@ const ViewletError = {
7458
7467
  setMessage: setMessage$1
7459
7468
  };
7460
7469
 
7461
- const handleContextMenu$7 = event => {
7470
+ const handleContextMenu$8 = event => {
7462
7471
  preventDefault(event);
7463
7472
  const {
7464
7473
  button,
@@ -7466,7 +7475,7 @@ const handleContextMenu$7 = event => {
7466
7475
  clientY
7467
7476
  } = event;
7468
7477
  const uid = fromEvent(event);
7469
- handleContextMenu$c(uid, button, clientX, clientY);
7478
+ handleContextMenu$d(uid, button, clientX, clientY);
7470
7479
  };
7471
7480
 
7472
7481
  const CopyMove = 'copyMove';
@@ -7606,7 +7615,7 @@ const handleClick$6 = event => {
7606
7615
  clientY
7607
7616
  } = event;
7608
7617
  const uid = fromEvent(event);
7609
- handleClickAt$2(uid, button, clientX, clientY);
7618
+ handleClickAt$3(uid, button, clientX, clientY);
7610
7619
  };
7611
7620
  const handleClickOpenFolder = event => {
7612
7621
  preventDefault(event);
@@ -7660,7 +7669,7 @@ const ViewletExplorerEvents = {
7660
7669
  handleBlur: handleBlur$5,
7661
7670
  handleClick: handleClick$6,
7662
7671
  handleClickOpenFolder,
7663
- handleContextMenu: handleContextMenu$7,
7672
+ handleContextMenu: handleContextMenu$8,
7664
7673
  handleDragEnd,
7665
7674
  handleDragLeave,
7666
7675
  handleDragOver,
@@ -7925,7 +7934,7 @@ const attachEvents$8 = state => {
7925
7934
  // @ts-expect-error
7926
7935
  $ExtensionHeader.addEventListener(Click, undefined);
7927
7936
  attachEvents$c($ListItems, {
7928
- [ContextMenu]: handleContextMenu$7,
7937
+ [ContextMenu]: handleContextMenu$8,
7929
7938
  [PointerDown]: handlePointerDown$3,
7930
7939
  [Focus]: handleFocus$6,
7931
7940
  [Scroll]: handleScroll
@@ -8285,7 +8294,7 @@ const handlePointerDown$2 = event => {
8285
8294
 
8286
8295
  const ViewletkeyBindingsEvents = {
8287
8296
  __proto__: null,
8288
- handleContextMenu: handleContextMenu$7,
8297
+ handleContextMenu: handleContextMenu$8,
8289
8298
  handleInput: handleInput$4,
8290
8299
  handlePointerDown: handlePointerDown$2,
8291
8300
  handleResizerPointerDown,
@@ -8875,7 +8884,7 @@ const ViewletLayout = {
8875
8884
  setSashes
8876
8885
  };
8877
8886
 
8878
- const handleContextMenu$6 = event => {
8887
+ const handleContextMenu$7 = event => {
8879
8888
  if (event.defaultPrevented) {
8880
8889
  return;
8881
8890
  }
@@ -8885,7 +8894,7 @@ const handleContextMenu$6 = event => {
8885
8894
  clientY
8886
8895
  } = event;
8887
8896
  const uid = fromEvent(event);
8888
- handleContextMenu$c(uid, clientX, clientY);
8897
+ handleContextMenu$d(uid, clientX, clientY);
8889
8898
  };
8890
8899
 
8891
8900
  // TODO Main should not be bound to Editor -> Lazy load Editor
@@ -8919,7 +8928,7 @@ const attachEvents$6 = state => {
8919
8928
  [DragOver]: handleDragOver,
8920
8929
  [DragEnd]: handleDragEnd,
8921
8930
  [DragLeave]: handleDragLeave,
8922
- [ContextMenu]: handleContextMenu$6
8931
+ [ContextMenu]: handleContextMenu$7
8923
8932
  });
8924
8933
  };
8925
8934
  const dispose$7 = state => {};
@@ -9314,7 +9323,7 @@ const handlePointerDown$1 = event => {
9314
9323
  } = event;
9315
9324
  return ['handleClickAt', clientX, clientY];
9316
9325
  };
9317
- const handleContextMenu$5 = event => {
9326
+ const handleContextMenu$6 = event => {
9318
9327
  preventDefault(event);
9319
9328
  const {
9320
9329
  clientX,
@@ -9334,15 +9343,15 @@ const handleFilterInput = event => {
9334
9343
  const handleClearFilterClick = event => {
9335
9344
  return ['clearFilter'];
9336
9345
  };
9337
- const returnValue$5 = true;
9346
+ const returnValue$6 = true;
9338
9347
 
9339
9348
  const ViewletProblemsEvents = {
9340
9349
  __proto__: null,
9341
9350
  handleClearFilterClick,
9342
- handleContextMenu: handleContextMenu$5,
9351
+ handleContextMenu: handleContextMenu$6,
9343
9352
  handleFilterInput,
9344
9353
  handlePointerDown: handlePointerDown$1,
9345
- returnValue: returnValue$5
9354
+ returnValue: returnValue$6
9346
9355
  };
9347
9356
 
9348
9357
  const setFocusedIndex$2 = (state, focusedIndex) => {
@@ -9418,7 +9427,7 @@ const handlePointerDown = event => {
9418
9427
  clientY
9419
9428
  } = event;
9420
9429
  const uid = fromEvent(event);
9421
- handleClickAt$2(uid, clientX, clientY);
9430
+ handleClickAt$3(uid, clientX, clientY);
9422
9431
  };
9423
9432
  const handleBlur$2 = event => {
9424
9433
  const uid = fromEvent(event);
@@ -9919,7 +9928,7 @@ const handleHeaderFocusIn = event => {
9919
9928
  }
9920
9929
  return ['handleFocusIn', key];
9921
9930
  };
9922
- const handleContextMenu$4 = event => {
9931
+ const handleContextMenu$5 = event => {
9923
9932
  preventDefault(event);
9924
9933
  const {
9925
9934
  button,
@@ -9935,12 +9944,12 @@ const handleWheel = event => {
9935
9944
  } = event;
9936
9945
  return ['handleWheel', deltaMode, deltaY];
9937
9946
  };
9938
- const returnValue$4 = true;
9947
+ const returnValue$5 = true;
9939
9948
 
9940
9949
  const ViewletSearchEvents = {
9941
9950
  __proto__: null,
9942
9951
  handleClick: handleClick$4,
9943
- handleContextMenu: handleContextMenu$4,
9952
+ handleContextMenu: handleContextMenu$5,
9944
9953
  handleFocus: handleFocus$2,
9945
9954
  handleHeaderClick: handleHeaderClick$1,
9946
9955
  handleHeaderFocusIn,
@@ -9953,7 +9962,7 @@ const ViewletSearchEvents = {
9953
9962
  handleScrollBarThumbPointerMove,
9954
9963
  handleToggleButtonClick,
9955
9964
  handleWheel,
9956
- returnValue: returnValue$4
9965
+ returnValue: returnValue$5
9957
9966
  };
9958
9967
 
9959
9968
  const focus$5 = state => {
@@ -10235,7 +10244,7 @@ const handleInput = event => {
10235
10244
  const ViewletSourceControlEvents = {
10236
10245
  __proto__: null,
10237
10246
  handleClick: handleClick$3,
10238
- handleContextMenu: handleContextMenu$7,
10247
+ handleContextMenu: handleContextMenu$8,
10239
10248
  handleFocus,
10240
10249
  handleInput,
10241
10250
  handleMouseOut,
@@ -10576,7 +10585,7 @@ const ViewletTerminals = {
10576
10585
  setTabsDom
10577
10586
  };
10578
10587
 
10579
- const handleContextMenu$3 = event => {
10588
+ const handleContextMenu$4 = event => {
10580
10589
  preventDefault(event);
10581
10590
  const {
10582
10591
  button,
@@ -10604,7 +10613,7 @@ const attachEvents = state => {
10604
10613
  $Viewlet
10605
10614
  } = state;
10606
10615
  attachEvents$c($Viewlet, {
10607
- [ContextMenu]: handleContextMenu$3
10616
+ [ContextMenu]: handleContextMenu$4
10608
10617
  });
10609
10618
  };
10610
10619
  const activeClassName = 'TitleBarActive';
@@ -10636,12 +10645,12 @@ const handleTitleBarButtonsClick = event => {
10636
10645
  } = event;
10637
10646
  return ['handleClick', target.className];
10638
10647
  };
10639
- const returnValue$3 = true;
10648
+ const returnValue$4 = true;
10640
10649
 
10641
10650
  const ViewletTitleBarButtonEvents = {
10642
10651
  __proto__: null,
10643
10652
  handleTitleBarButtonsClick,
10644
- returnValue: returnValue$3
10653
+ returnValue: returnValue$4
10645
10654
  };
10646
10655
 
10647
10656
  const Events$3 = ViewletTitleBarButtonEvents;
@@ -11062,20 +11071,20 @@ const handleClickCopy = event => {
11062
11071
  const handleFocusIn$1 = event => {
11063
11072
  return ['handleFocusIn'];
11064
11073
  };
11065
- const handleContextMenu$2 = event => {
11074
+ const handleContextMenu$3 = event => {
11066
11075
  preventDefault(event);
11067
11076
  return [];
11068
11077
  };
11069
- const returnValue$2 = true;
11078
+ const returnValue$3 = true;
11070
11079
 
11071
11080
  const ViewletAboutEvents = {
11072
11081
  __proto__: null,
11073
11082
  handleClickClose,
11074
11083
  handleClickCopy,
11075
11084
  handleClickOk,
11076
- handleContextMenu: handleContextMenu$2,
11085
+ handleContextMenu: handleContextMenu$3,
11077
11086
  handleFocusIn: handleFocusIn$1,
11078
- returnValue: returnValue$2
11087
+ returnValue: returnValue$3
11079
11088
  };
11080
11089
 
11081
11090
  const setFocused = (state, selector) => {
@@ -11151,17 +11160,17 @@ const ViewletInlineDiffEditor = {
11151
11160
  setScrollBar: setScrollBar$2
11152
11161
  };
11153
11162
 
11154
- const handleClickAt$1 = event => {
11163
+ const handleClickAt$2 = event => {
11155
11164
  const {
11156
11165
  clientX,
11157
11166
  clientY
11158
11167
  } = event;
11159
11168
  return ['handleClickAt', clientX, clientY];
11160
11169
  };
11161
- const handleLoad$2 = event => {
11170
+ const handleLoad$3 = event => {
11162
11171
  return ['handleLoad'];
11163
11172
  };
11164
- const handleContextMenu$1 = event => {
11173
+ const handleContextMenu$2 = event => {
11165
11174
  preventDefault(event);
11166
11175
  const {
11167
11176
  button,
@@ -11170,14 +11179,14 @@ const handleContextMenu$1 = event => {
11170
11179
  } = event;
11171
11180
  return ['handleContextMenu', button, clientX, clientY];
11172
11181
  };
11173
- const returnValue$1 = true;
11182
+ const returnValue$2 = true;
11174
11183
 
11175
11184
  const ViewletE2eTestsEvents = {
11176
11185
  __proto__: null,
11177
- handleClickAt: handleClickAt$1,
11178
- handleContextMenu: handleContextMenu$1,
11179
- handleLoad: handleLoad$2,
11180
- returnValue: returnValue$1
11186
+ handleClickAt: handleClickAt$2,
11187
+ handleContextMenu: handleContextMenu$2,
11188
+ handleLoad: handleLoad$3,
11189
+ returnValue: returnValue$2
11181
11190
  };
11182
11191
 
11183
11192
  const sendToIframe = (contentWindow, message, origin, transfer) => {
@@ -11189,11 +11198,11 @@ const sendToIframe = (contentWindow, message, origin, transfer) => {
11189
11198
  }
11190
11199
  };
11191
11200
 
11192
- const handleLoad$1 = event => {
11201
+ const handleLoad$2 = event => {
11193
11202
  console.log(event.target.src);
11194
11203
  send('E2eTests.handleLoad');
11195
11204
  };
11196
- const setIframe$1 = (state, src, sandbox = []) => {
11205
+ const setIframe$2 = (state, src, sandbox = []) => {
11197
11206
  if (!src) {
11198
11207
  return;
11199
11208
  }
@@ -11210,7 +11219,7 @@ const setIframe$1 = (state, src, sandbox = []) => {
11210
11219
  console.log({
11211
11220
  src
11212
11221
  });
11213
- $Iframe.addEventListener('load', handleLoad$1, {
11222
+ $Iframe.addEventListener('load', handleLoad$2, {
11214
11223
  once: true
11215
11224
  });
11216
11225
  document.body.append($Iframe);
@@ -11237,21 +11246,21 @@ const setPort = (state, portId, origin) => {
11237
11246
  const ViewletE2eTests = {
11238
11247
  __proto__: null,
11239
11248
  Events: ViewletE2eTestsEvents,
11240
- setIframe: setIframe$1,
11249
+ setIframe: setIframe$2,
11241
11250
  setPort
11242
11251
  };
11243
11252
 
11244
- const handleClickAt = event => {
11253
+ const handleClickAt$1 = event => {
11245
11254
  const {
11246
11255
  clientX,
11247
11256
  clientY
11248
11257
  } = event;
11249
11258
  return ['handleClickAt', clientX, clientY];
11250
11259
  };
11251
- const handleLoad = event => {
11260
+ const handleLoad$1 = event => {
11252
11261
  return ['handleLoad'];
11253
11262
  };
11254
- const handleContextMenu = event => {
11263
+ const handleContextMenu$1 = event => {
11255
11264
  preventDefault(event);
11256
11265
  const {
11257
11266
  button,
@@ -11279,19 +11288,19 @@ const handleSashCornerPointerDown = create$u(event => {
11279
11288
  } = event;
11280
11289
  return ['handleSashCornerPointerUp', clientX, clientY];
11281
11290
  });
11282
- const returnValue = true;
11291
+ const returnValue$1 = true;
11283
11292
 
11284
11293
  const ViewletE2eTestEvents = {
11285
11294
  __proto__: null,
11286
- handleClickAt,
11287
- handleContextMenu,
11288
- handleLoad,
11295
+ handleClickAt: handleClickAt$1,
11296
+ handleContextMenu: handleContextMenu$1,
11297
+ handleLoad: handleLoad$1,
11289
11298
  handleSashCornerPointerDown,
11290
- returnValue
11299
+ returnValue: returnValue$1
11291
11300
  };
11292
11301
 
11293
11302
  // TODO could use browser view when running in electron
11294
- const setIframe = (state, src, sandbox = []) => {
11303
+ const setIframe$1 = (state, src, sandbox = []) => {
11295
11304
  if (!src) {
11296
11305
  return;
11297
11306
  }
@@ -11334,10 +11343,63 @@ const setPreviewTransform = (state, transform) => {
11334
11343
  const ViewletE2eTest = {
11335
11344
  __proto__: null,
11336
11345
  Events: ViewletE2eTestEvents,
11337
- setIframe,
11346
+ setIframe: setIframe$1,
11338
11347
  setPreviewTransform
11339
11348
  };
11340
11349
 
11350
+ const handleClickAt = event => {
11351
+ const {
11352
+ clientX,
11353
+ clientY
11354
+ } = event;
11355
+ return ['handleClickAt', clientX, clientY];
11356
+ };
11357
+ const handleLoad = event => {
11358
+ return ['handleLoad'];
11359
+ };
11360
+ const handleContextMenu = event => {
11361
+ preventDefault(event);
11362
+ const {
11363
+ button,
11364
+ clientX,
11365
+ clientY
11366
+ } = event;
11367
+ return ['handleContextMenu', button, clientX, clientY];
11368
+ };
11369
+ const returnValue = true;
11370
+
11371
+ const ViewletWebViewEvents = {
11372
+ __proto__: null,
11373
+ handleClickAt,
11374
+ handleContextMenu,
11375
+ handleLoad,
11376
+ returnValue
11377
+ };
11378
+
11379
+ // TODO could use browser view when running in electron
11380
+ const setIframe = (state, src, sandbox = []) => {
11381
+ if (!src) {
11382
+ return;
11383
+ }
11384
+ const {
11385
+ $Viewlet
11386
+ } = state;
11387
+ const $Parent = $Viewlet.querySelector('.WebViewWrapper');
11388
+ const $Iframe = document.createElement('iframe');
11389
+ for (const element of sandbox) {
11390
+ $Iframe.sandbox.add(element);
11391
+ }
11392
+ $Iframe.className = 'E2eTestIframe';
11393
+ $Iframe.src = src;
11394
+ $Parent.append($Iframe);
11395
+ };
11396
+
11397
+ const ViewletWebView = {
11398
+ __proto__: null,
11399
+ Events: ViewletWebViewEvents,
11400
+ setIframe
11401
+ };
11402
+
11341
11403
  const getWorkerDisplayName = name => {
11342
11404
  if (!name) {
11343
11405
  return '<unknown> worker';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "6.9.0",
3
+ "version": "6.11.0",
4
4
  "description": "",
5
5
  "main": "dist/diffWorkerMain.js",
6
6
  "type": "module",