@lvce-editor/renderer-process 8.1.0 → 8.2.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.
@@ -461,6 +461,10 @@ const getPlatform = () => {
461
461
  if (globalThis.isElectron) {
462
462
  return Electron$1;
463
463
  }
464
+ if (typeof location !== 'undefined' && location.search === '?web') {
465
+ console.log('is web');
466
+ return Web;
467
+ }
464
468
  return Remote;
465
469
  };
466
470
  const platform = getPlatform();
@@ -881,8 +885,6 @@ const unhandleIpc = ipc => {
881
885
  }
882
886
  };
883
887
 
884
- const isElectron = platform === Electron$1;
885
-
886
888
  const MessagePort$2 = 1;
887
889
  const ModuleWorker$1 = 2;
888
890
  const ReferencePort = 3;
@@ -1026,8 +1028,18 @@ const assetDir = getAssetDir();
1026
1028
 
1027
1029
  const rendererWorkerUrl = `${assetDir}/packages/renderer-worker/src/rendererWorkerMain.ts`;
1028
1030
 
1031
+ const getName = platform => {
1032
+ switch (platform) {
1033
+ case Electron$1:
1034
+ return 'Renderer Worker (Electron)';
1035
+ case Web:
1036
+ return 'Renderer Worker (Web)';
1037
+ default:
1038
+ return 'Renderer Worker';
1039
+ }
1040
+ };
1029
1041
  const launchRendererWorker = async () => {
1030
- const name = isElectron ? 'Renderer Worker (Electron)' : 'Renderer Worker';
1042
+ const name = getName(platform);
1031
1043
  return launchWorker({
1032
1044
  name,
1033
1045
  url: rendererWorkerUrl
@@ -2809,7 +2821,7 @@ const FocusSimpleBrowserInput = 23;
2809
2821
  const FocusOutput = 28;
2810
2822
 
2811
2823
  const handleBlur$9 = () => {
2812
- send( /* EditorRename.abort */'EditorRename.abort');
2824
+ send(/* EditorRename.abort */'EditorRename.abort');
2813
2825
  };
2814
2826
  const create$G = (x, y) => {
2815
2827
  const $RenameWidgetInputBox = create$H();
@@ -3182,7 +3194,7 @@ const handleNotificationClick = event => {
3182
3194
  switch ($Target.className) {
3183
3195
  case 'NotificationOption':
3184
3196
  const index = findIndex$1($Target);
3185
- send( /* Notification.handleClick */'Notification.handleClick', /* index */index);
3197
+ send(/* Notification.handleClick */'Notification.handleClick', /* index */index);
3186
3198
  break;
3187
3199
  }
3188
3200
  };
@@ -3335,7 +3347,7 @@ const handleMouseDown$3 = event => {
3335
3347
  }
3336
3348
  preventDefault(event);
3337
3349
  const level = getLevel($Menu);
3338
- send( /* Menu.handleClick */'Menu.selectIndex', /* level */level, /* index */index);
3350
+ send(/* Menu.handleClick */'Menu.selectIndex', /* level */level, /* index */index);
3339
3351
  };
3340
3352
 
3341
3353
  // const handleKeyDown = (event) => {
@@ -3380,7 +3392,7 @@ const handleMouseEnter$1 = event => {
3380
3392
  return;
3381
3393
  }
3382
3394
  const level = getLevel($Menu);
3383
- send( /* Menu.handleMouseEnter */'Menu.handleMouseEnter', /* level */level, /* index */index, /* x */clientX, /* y */clientY, /* timeStamp */timeStamp);
3395
+ send(/* Menu.handleMouseEnter */'Menu.handleMouseEnter', /* level */level, /* index */index, /* x */clientX, /* y */clientY, /* timeStamp */timeStamp);
3384
3396
  };
3385
3397
  const handleMouseLeave$1 = event => {
3386
3398
  const $RelatedTarget = event.relatedTarget;
@@ -3442,7 +3454,7 @@ const focusIndex = (level, oldFocusedIndex, newFocusedIndex) => {
3442
3454
  const handleBackDropMouseDown = event => {
3443
3455
  preventDefault(event);
3444
3456
  stopPropagation(event);
3445
- send( /* Menu.hide */'Menu.hide');
3457
+ send(/* Menu.hide */'Menu.hide');
3446
3458
  };
3447
3459
  const handleContextMenu$c = event => {
3448
3460
  preventDefault(event);
@@ -4927,7 +4939,7 @@ const close = () => {
4927
4939
  // window.close()
4928
4940
  };
4929
4941
  const sendVisibilityChangeHint = () => {
4930
- send( /* SaveState.handleVisibilityChange */'SaveState.handleVisibilityChange', /* visibilityState */'hidden');
4942
+ send(/* SaveState.handleVisibilityChange */'SaveState.handleVisibilityChange', /* visibilityState */'hidden');
4931
4943
  };
4932
4944
  const handleBeforeUnload = () => {
4933
4945
  sendVisibilityChangeHint();
@@ -5167,6 +5179,18 @@ const joinLines = lines => {
5167
5179
  const splitLines = lines => {
5168
5180
  return lines.split(NewLine$1);
5169
5181
  };
5182
+ const isModuleNotFoundMessage = line => {
5183
+ return line.includes('[ERR_MODULE_NOT_FOUND]');
5184
+ };
5185
+ const getModuleNotFoundError = stderr => {
5186
+ const lines = splitLines(stderr);
5187
+ const messageIndex = lines.findIndex(isModuleNotFoundMessage);
5188
+ const message = lines[messageIndex];
5189
+ return {
5190
+ message,
5191
+ code: ERR_MODULE_NOT_FOUND
5192
+ };
5193
+ };
5170
5194
  const RE_NATIVE_MODULE_ERROR = /^innerError Error: Cannot find module '.*.node'/;
5171
5195
  const RE_NATIVE_MODULE_ERROR_2 = /was compiled against a different Node.js version/;
5172
5196
  const RE_MESSAGE_CODE_BLOCK_START = /^Error: The module '.*'$/;
@@ -5215,18 +5239,6 @@ const isModuleNotFoundError = stderr => {
5215
5239
  }
5216
5240
  return stderr.includes('ERR_MODULE_NOT_FOUND');
5217
5241
  };
5218
- const isModuleNotFoundMessage = line => {
5219
- return line.includes('ERR_MODULE_NOT_FOUND');
5220
- };
5221
- const getModuleNotFoundError = stderr => {
5222
- const lines = splitLines(stderr);
5223
- const messageIndex = lines.findIndex(isModuleNotFoundMessage);
5224
- const message = lines[messageIndex];
5225
- return {
5226
- message,
5227
- code: ERR_MODULE_NOT_FOUND
5228
- };
5229
- };
5230
5242
  const isNormalStackLine = line => {
5231
5243
  return RE_AT.test(line) && !RE_AT_PROMISE_INDEX.test(line);
5232
5244
  };
@@ -5837,6 +5849,8 @@ const handleIpcOnce = ipc => {
5837
5849
  }
5838
5850
  };
5839
5851
 
5852
+ const isElectron = platform === Electron$1;
5853
+
5840
5854
  // TODO use handleIncomingIpc function
5841
5855
  const create$x = async ({
5842
5856
  port,
@@ -6212,7 +6226,7 @@ const create$Button = (label, icon) => {
6212
6226
  };
6213
6227
 
6214
6228
  const handleClick$8 = index => {
6215
- send( /* Dialog.handleClick */'Dialog.handleClick', /* index */index);
6229
+ send(/* Dialog.handleClick */'Dialog.handleClick', /* index */index);
6216
6230
  };
6217
6231
 
6218
6232
  const handleClick$7 = event => {
@@ -7949,9 +7963,9 @@ const handleLocationsMouseDown = event => {
7949
7963
  const $Target = event.target;
7950
7964
  if ($Target.classList.contains('TreeItem')) {
7951
7965
  const index = getNodeIndex($Target);
7952
- send( /* ViewletLocations.selectIndex */'Locations.selectIndex', /* index */index);
7966
+ send(/* ViewletLocations.selectIndex */'Locations.selectIndex', /* index */index);
7953
7967
  } else if ($Target.classList.contains('LocationList')) {
7954
- send( /* ViewletLocations.focusIndex */'Locations.focusIndex', /* index */-1);
7968
+ send(/* ViewletLocations.focusIndex */'Locations.focusIndex', /* index */-1);
7955
7969
  }
7956
7970
  };
7957
7971
 
@@ -8521,7 +8535,7 @@ const isMatchingKeyBinding = (identifiers, identifier) => {
8521
8535
  };
8522
8536
 
8523
8537
  const handleMatchingKeyBinding = identifier => {
8524
- send( /* KeyBindings.handleKeyBinding */'KeyBindings.handleKeyBinding', /* keyBinding */identifier);
8538
+ send(/* KeyBindings.handleKeyBinding */'KeyBindings.handleKeyBinding', /* keyBinding */identifier);
8525
8539
  };
8526
8540
  const handleKeyDown$2 = event => {
8527
8541
  const identifier = getKeyBindingIdentifier(event);
@@ -10670,7 +10684,7 @@ const closeMenu = (state, unFocusIndex, index) => {
10670
10684
  if (index !== -1) {
10671
10685
  $Viewlet.children[index].focus();
10672
10686
  }
10673
- hide( /* restoreFocus */false);
10687
+ hide(/* restoreFocus */false);
10674
10688
  $Viewlet.removeEventListener('mouseenter', handlePointerOver, {
10675
10689
  capture: true
10676
10690
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "description": "",
5
5
  "main": "dist/diffWorkerMain.js",
6
6
  "type": "module",