@lvce-editor/renderer-process 6.3.0 → 6.5.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.
@@ -3178,6 +3178,7 @@ const CompositionStart = 'compositionstart';
3178
3178
  const CompositionUpdate = 'compositionupdate';
3179
3179
  const ContextMenu = 'contextmenu';
3180
3180
  const Cut = 'cut';
3181
+ const Load = 'load';
3181
3182
  const DoubleClick = 'dblclick';
3182
3183
  const DragEnd = 'dragend';
3183
3184
  const DragLeave = 'dragleave';
@@ -4141,6 +4142,11 @@ const objects = Object.create(null);
4141
4142
  const transfer = (objectId, transferable) => {
4142
4143
  objects[objectId] = transferable;
4143
4144
  };
4145
+ const acquire = objectId => {
4146
+ const value = objects[objectId];
4147
+ delete objects[objectId];
4148
+ return value;
4149
+ };
4144
4150
 
4145
4151
  const name$8 = 'Transferrable';
4146
4152
  const Commands$9 = {
@@ -4237,6 +4243,7 @@ const Video = 'Video';
4237
4243
  const TitleBarTitle = 'TitleBarTitle';
4238
4244
  const About = 'About';
4239
4245
  const EditorSourceActions = 'EditorSourceActions';
4246
+ const E2eTests = 'E2eTests';
4240
4247
 
4241
4248
  const load = moduleId => {
4242
4249
  switch (moduleId) {
@@ -4346,6 +4353,8 @@ const load = moduleId => {
4346
4353
  return Promise.resolve().then(function () { return ViewletEmptyEditor; });
4347
4354
  case InlineDiffEditor:
4348
4355
  return Promise.resolve().then(function () { return ViewletInlineDiffEditor; });
4356
+ case E2eTests:
4357
+ return Promise.resolve().then(function () { return ViewletE2eTests; });
4349
4358
  default:
4350
4359
  throw new Error(`${moduleId} module not found in renderer process`);
4351
4360
  }
@@ -5761,7 +5770,7 @@ const handleContextMenu$9 = event => {
5761
5770
  } = event;
5762
5771
  return ['handleContextMenu', button, clientX, clientY];
5763
5772
  };
5764
- const returnValue$6 = true;
5773
+ const returnValue$7 = true;
5765
5774
 
5766
5775
  const ViewletActivityBarEvents = {
5767
5776
  __proto__: null,
@@ -5769,14 +5778,14 @@ const ViewletActivityBarEvents = {
5769
5778
  handleContextMenu: handleContextMenu$9,
5770
5779
  handleFocus: handleFocus$c,
5771
5780
  handleMouseDown: handleMouseDown$3,
5772
- returnValue: returnValue$6
5781
+ returnValue: returnValue$7
5773
5782
  };
5774
5783
 
5775
- const Events$a = ViewletActivityBarEvents;
5784
+ const Events$b = ViewletActivityBarEvents;
5776
5785
 
5777
5786
  const ViewletActivityBar = {
5778
5787
  __proto__: null,
5779
- Events: Events$a
5788
+ Events: Events$b
5780
5789
  };
5781
5790
 
5782
5791
  const executeViewletCommand = (uid, command, ...args) => {
@@ -5818,7 +5827,7 @@ const handleButtonClick = forwardViewletCommand('handleButtonClick');
5818
5827
  const handleClick$9 = forwardViewletCommand('handleClick');
5819
5828
  const handleClickAction$2 = forwardViewletCommand('handleClickAction');
5820
5829
  forwardViewletCommand('handleClickAdd');
5821
- const handleClickAt = forwardViewletCommand('handleClickAt');
5830
+ const handleClickAt$1 = forwardViewletCommand('handleClickAt');
5822
5831
  const handleClickOpenFolder$1 = forwardViewletCommand('handleClickOpenFolder');
5823
5832
  forwardViewletCommand('handleClickClose');
5824
5833
  forwardViewletCommand('handleClickCopy');
@@ -5915,11 +5924,11 @@ const ViewletAudioEvents = {
5915
5924
  handleAudioError
5916
5925
  };
5917
5926
 
5918
- const Events$9 = ViewletAudioEvents;
5927
+ const Events$a = ViewletAudioEvents;
5919
5928
 
5920
5929
  const ViewletAudio = {
5921
5930
  __proto__: null,
5922
- Events: Events$9
5931
+ Events: Events$a
5923
5932
  };
5924
5933
 
5925
5934
  const create$x = () => {
@@ -6034,12 +6043,12 @@ const handlePointerDown$6 = event => {
6034
6043
  }
6035
6044
  return [];
6036
6045
  };
6037
- const returnValue$5 = true;
6046
+ const returnValue$6 = true;
6038
6047
 
6039
6048
  const ViewletColorPickerEvents = {
6040
6049
  __proto__: null,
6041
6050
  handlePointerDown: handlePointerDown$6,
6042
- returnValue: returnValue$5
6051
+ returnValue: returnValue$6
6043
6052
  };
6044
6053
 
6045
6054
  const setColor = (state, color) => {
@@ -6353,7 +6362,7 @@ const handleMousedown = event => {
6353
6362
  clientY
6354
6363
  } = event;
6355
6364
  const uid = fromEvent(event);
6356
- handleClickAt(uid, clientX, clientY);
6365
+ handleClickAt$1(uid, clientX, clientY);
6357
6366
  };
6358
6367
  const handleScrollBarThumbPointerMove$2 = event => {
6359
6368
  const {
@@ -6563,7 +6572,7 @@ const ViewletEditorError = {
6563
6572
  setDom: setDom$6
6564
6573
  };
6565
6574
 
6566
- const returnValue$4 = true;
6575
+ const returnValue$5 = true;
6567
6576
  const handleSashPointerDown$2 = create$v(event => {
6568
6577
  const {
6569
6578
  clientX,
@@ -6587,7 +6596,7 @@ const handleSashPointerDown$2 = create$v(event => {
6587
6596
  const ViewletEditorHoverEvents = {
6588
6597
  __proto__: null,
6589
6598
  handleSashPointerDown: handleSashPointerDown$2,
6590
- returnValue: returnValue$4
6599
+ returnValue: returnValue$5
6591
6600
  };
6592
6601
 
6593
6602
  const setBounds$2 = (state, x, y, width, height) => {
@@ -7586,7 +7595,7 @@ const handleClick$6 = event => {
7586
7595
  clientY
7587
7596
  } = event;
7588
7597
  const uid = fromEvent(event);
7589
- handleClickAt(uid, button, clientX, clientY);
7598
+ handleClickAt$1(uid, button, clientX, clientY);
7590
7599
  };
7591
7600
  const handleClickOpenFolder = event => {
7592
7601
  preventDefault(event);
@@ -7664,7 +7673,7 @@ const create$i = () => {
7664
7673
  $Viewlet
7665
7674
  };
7666
7675
  };
7667
- const Events$8 = ViewletExplorerEvents;
7676
+ const Events$9 = ViewletExplorerEvents;
7668
7677
  const handleError$3 = (state, message) => {
7669
7678
  object(state);
7670
7679
  string(message);
@@ -7711,7 +7720,7 @@ const setDom$4 = (state, dom) => {
7711
7720
 
7712
7721
  const ViewletExplorer = {
7713
7722
  __proto__: null,
7714
- Events: Events$8,
7723
+ Events: Events$9,
7715
7724
  create: create$i,
7716
7725
  dispose: dispose$9,
7717
7726
  focusInput,
@@ -7755,11 +7764,11 @@ const ViewletExtensionDetailEvents = {
7755
7764
  handleReadmeContextMenu
7756
7765
  };
7757
7766
 
7758
- const Events$7 = ViewletExtensionDetailEvents;
7767
+ const Events$8 = ViewletExtensionDetailEvents;
7759
7768
 
7760
7769
  const ViewletExtensionDetail = {
7761
7770
  __proto__: null,
7762
- Events: Events$7,
7771
+ Events: Events$8,
7763
7772
  setSize
7764
7773
  };
7765
7774
 
@@ -8148,7 +8157,7 @@ const ViewletLocationsEvents = {
8148
8157
  handleLocationsMouseDown
8149
8158
  };
8150
8159
 
8151
- const Events$6 = ViewletLocationsEvents;
8160
+ const Events$7 = ViewletLocationsEvents;
8152
8161
  const setFocusedIndex$3 = (state, oldFocusedIndex, newFocusedIndex) => {
8153
8162
  const {
8154
8163
  $Viewlet
@@ -8183,7 +8192,7 @@ const focus$b = state => {
8183
8192
 
8184
8193
  const ViewletImplementations = {
8185
8194
  __proto__: null,
8186
- Events: Events$6,
8195
+ Events: Events$7,
8187
8196
  focus: focus$b,
8188
8197
  handleError: handleError$1,
8189
8198
  setFocusedIndex: setFocusedIndex$3
@@ -8294,11 +8303,11 @@ const setColumnWidths = (state, columnWidth1, columnWidth2, columnWidth3) => {
8294
8303
  $Resizer1.style.left = `${paddingLeft + columnWidth1}px`;
8295
8304
  $Resizer2.style.left = `${paddingLeft + columnWidth1 + columnWidth2}px`;
8296
8305
  };
8297
- const Events$5 = ViewletkeyBindingsEvents;
8306
+ const Events$6 = ViewletkeyBindingsEvents;
8298
8307
 
8299
8308
  const ViewletKeyBindings = {
8300
8309
  __proto__: null,
8301
- Events: Events$5,
8310
+ Events: Events$6,
8302
8311
  setColumnWidths,
8303
8312
  setScrollBar: setScrollBar$2,
8304
8313
  setSize,
@@ -9313,7 +9322,7 @@ const handleFilterInput = event => {
9313
9322
  const handleClearFilterClick = event => {
9314
9323
  return ['clearFilter'];
9315
9324
  };
9316
- const returnValue$3 = true;
9325
+ const returnValue$4 = true;
9317
9326
 
9318
9327
  const ViewletProblemsEvents = {
9319
9328
  __proto__: null,
@@ -9321,7 +9330,7 @@ const ViewletProblemsEvents = {
9321
9330
  handleContextMenu: handleContextMenu$3,
9322
9331
  handleFilterInput,
9323
9332
  handlePointerDown: handlePointerDown$1,
9324
- returnValue: returnValue$3
9333
+ returnValue: returnValue$4
9325
9334
  };
9326
9335
 
9327
9336
  const setFocusedIndex$2 = (state, focusedIndex) => {
@@ -9397,7 +9406,7 @@ const handlePointerDown = event => {
9397
9406
  clientY
9398
9407
  } = event;
9399
9408
  const uid = fromEvent(event);
9400
- handleClickAt(uid, clientX, clientY);
9409
+ handleClickAt$1(uid, clientX, clientY);
9401
9410
  };
9402
9411
  const handleBlur$2 = event => {
9403
9412
  const uid = fromEvent(event);
@@ -9618,7 +9627,7 @@ const ViewletQuickPick = {
9618
9627
 
9619
9628
  const ViewletReferences = {
9620
9629
  __proto__: null,
9621
- Events: Events$6,
9630
+ Events: Events$7,
9622
9631
  focus: focus$b,
9623
9632
  handleError: handleError$1,
9624
9633
  setFocusedIndex: setFocusedIndex$3
@@ -9914,7 +9923,7 @@ const handleWheel = event => {
9914
9923
  } = event;
9915
9924
  return ['handleWheel', deltaMode, deltaY];
9916
9925
  };
9917
- const returnValue$2 = true;
9926
+ const returnValue$3 = true;
9918
9927
 
9919
9928
  const ViewletSearchEvents = {
9920
9929
  __proto__: null,
@@ -9932,7 +9941,7 @@ const ViewletSearchEvents = {
9932
9941
  handleScrollBarThumbPointerMove,
9933
9942
  handleToggleButtonClick,
9934
9943
  handleWheel,
9935
- returnValue: returnValue$2
9944
+ returnValue: returnValue$3
9936
9945
  };
9937
9946
 
9938
9947
  const focus$5 = state => {
@@ -9958,11 +9967,11 @@ const setFocus = (state, selector) => {
9958
9967
  }
9959
9968
  };
9960
9969
  const dispose$3 = () => {};
9961
- const Events$4 = ViewletSearchEvents;
9970
+ const Events$5 = ViewletSearchEvents;
9962
9971
 
9963
9972
  const ViewletSearch = {
9964
9973
  __proto__: null,
9965
- Events: Events$4,
9974
+ Events: Events$5,
9966
9975
  dispose: dispose$3,
9967
9976
  focus: focus$5,
9968
9977
  setFocus,
@@ -10615,26 +10624,26 @@ const handleTitleBarButtonsClick = event => {
10615
10624
  } = event;
10616
10625
  return ['handleClick', target.className];
10617
10626
  };
10618
- const returnValue$1 = true;
10627
+ const returnValue$2 = true;
10619
10628
 
10620
10629
  const ViewletTitleBarButtonEvents = {
10621
10630
  __proto__: null,
10622
10631
  handleTitleBarButtonsClick,
10623
- returnValue: returnValue$1
10632
+ returnValue: returnValue$2
10624
10633
  };
10625
10634
 
10626
- const Events$3 = ViewletTitleBarButtonEvents;
10635
+ const Events$4 = ViewletTitleBarButtonEvents;
10627
10636
 
10628
10637
  const ViewletTitleBarButtons = {
10629
10638
  __proto__: null,
10630
- Events: Events$3
10639
+ Events: Events$4
10631
10640
  };
10632
10641
 
10633
- const Events$2 = {};
10642
+ const Events$3 = {};
10634
10643
 
10635
10644
  const ViewletTitleBarIcon = {
10636
10645
  __proto__: null,
10637
- Events: Events$2
10646
+ Events: Events$3
10638
10647
  };
10639
10648
 
10640
10649
  const isInsideTitleBarMenu = $Element => {
@@ -10966,11 +10975,11 @@ const setMenus = (state, changes, uid) => {
10966
10975
  }
10967
10976
  }
10968
10977
  };
10969
- const Events$1 = ViewletTitleBarMenuBarEvents;
10978
+ const Events$2 = ViewletTitleBarMenuBarEvents;
10970
10979
 
10971
10980
  const ViewletTitleBarMenuBar = {
10972
10981
  __proto__: null,
10973
- Events: Events$1,
10982
+ Events: Events$2,
10974
10983
  closeMenu,
10975
10984
  dispose,
10976
10985
  focus,
@@ -11002,11 +11011,11 @@ const ViewletVideoEvents = {
11002
11011
  handleVideoError
11003
11012
  };
11004
11013
 
11005
- const Events = ViewletVideoEvents;
11014
+ const Events$1 = ViewletVideoEvents;
11006
11015
 
11007
11016
  const ViewletVideo = {
11008
11017
  __proto__: null,
11009
- Events
11018
+ Events: Events$1
11010
11019
  };
11011
11020
 
11012
11021
  const create$1 = () => {
@@ -11045,7 +11054,7 @@ const handleContextMenu = event => {
11045
11054
  preventDefault(event);
11046
11055
  return [];
11047
11056
  };
11048
- const returnValue = true;
11057
+ const returnValue$1 = true;
11049
11058
 
11050
11059
  const ViewletAboutEvents = {
11051
11060
  __proto__: null,
@@ -11054,7 +11063,7 @@ const ViewletAboutEvents = {
11054
11063
  handleClickOk,
11055
11064
  handleContextMenu,
11056
11065
  handleFocusIn: handleFocusIn$1,
11057
- returnValue
11066
+ returnValue: returnValue$1
11058
11067
  };
11059
11068
 
11060
11069
  const setFocused = (state, selector) => {
@@ -11130,6 +11139,75 @@ const ViewletInlineDiffEditor = {
11130
11139
  setScrollBar: setScrollBar$2
11131
11140
  };
11132
11141
 
11142
+ const handleClickAt = event => {
11143
+ const {
11144
+ clientX,
11145
+ clientY
11146
+ } = event;
11147
+ return ['handleClickAt', clientX, clientY];
11148
+ };
11149
+ const handleLoad = event => {
11150
+ return ['handleLoad'];
11151
+ };
11152
+ const returnValue = true;
11153
+
11154
+ const Events = {
11155
+ __proto__: null,
11156
+ handleClickAt,
11157
+ handleLoad,
11158
+ returnValue
11159
+ };
11160
+
11161
+ const sendToIframe = (contentWindow, message, origin, transfer) => {
11162
+ try {
11163
+ contentWindow.postMessage(message, origin, transfer);
11164
+ } catch (error) {
11165
+ throw new VError$1(error, `Failed to send message to iframe`);
11166
+ }
11167
+ };
11168
+
11169
+ const setIframe = (state, src, sandbox = []) => {
11170
+ const $ExistingIframe = document.querySelector('.E2eTestsIframe');
11171
+ if ($ExistingIframe) {
11172
+ $ExistingIframe.remove();
11173
+ }
11174
+ const $Iframe = document.createElement('iframe');
11175
+ attachEventsFunctional($Iframe, {
11176
+ [Load]: handleLoad
11177
+ });
11178
+ for (const element of sandbox) {
11179
+ $Iframe.sandbox.add(element);
11180
+ }
11181
+ $Iframe.className = 'E2eTestsIframe';
11182
+ $Iframe.src = src;
11183
+ document.body.append($Iframe);
11184
+ };
11185
+ const setPort = (state, portId, origin) => {
11186
+ const $ExistingIframe = document.querySelector('.E2eTestsIframe');
11187
+ if (!$ExistingIframe) {
11188
+ throw new Error('no iframe found');
11189
+ }
11190
+ const port = acquire(portId);
11191
+ // @ts-ignore
11192
+ const {
11193
+ contentWindow
11194
+ } = $ExistingIframe;
11195
+ const message = {
11196
+ jsonrpc: '2.0',
11197
+ method: 'handleIpc',
11198
+ params: [port]
11199
+ };
11200
+ const transfer = [port];
11201
+ sendToIframe(contentWindow, message, origin, transfer);
11202
+ };
11203
+
11204
+ const ViewletE2eTests = {
11205
+ __proto__: null,
11206
+ Events,
11207
+ setIframe,
11208
+ setPort
11209
+ };
11210
+
11133
11211
  const getWorkerDisplayName = name => {
11134
11212
  if (!name) {
11135
11213
  return '<unknown> worker';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "6.3.0",
3
+ "version": "6.5.0",
4
4
  "description": "",
5
5
  "main": "dist/diffWorkerMain.js",
6
6
  "type": "module",