@lvce-editor/renderer-process 30.21.1 → 30.22.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.
@@ -1683,7 +1683,7 @@ const setPathName = pathName => {
1683
1683
  }
1684
1684
  history.pushState(null, '', pathName);
1685
1685
  };
1686
- const hydrate$4 = () => {
1686
+ const hydrate$3 = () => {
1687
1687
  // addEventListener('popstate', handlePopState)
1688
1688
  };
1689
1689
 
@@ -3417,7 +3417,7 @@ const scheduleExport = () => {
3417
3417
  const state$8 = {
3418
3418
  rpc: undefined
3419
3419
  };
3420
- const hydrate$3 = async () => {
3420
+ const hydrate$2 = async () => {
3421
3421
  const result = await launchRendererWorker();
3422
3422
  if (isError(result)) {
3423
3423
  state$8.rpc = undefined;
@@ -3460,7 +3460,7 @@ const invokeAndTransfer = (method, ...params) => {
3460
3460
  const RendererWorker = {
3461
3461
  __proto__: null,
3462
3462
  dispose: dispose$j,
3463
- hydrate: hydrate$3,
3463
+ hydrate: hydrate$2,
3464
3464
  invoke: invoke$1,
3465
3465
  invokeAndTransfer,
3466
3466
  send,
@@ -3913,7 +3913,7 @@ const getLevel = $Menu => {
3913
3913
  // @ts-expect-error
3914
3914
  return state$4.$$Menus.indexOf($Menu);
3915
3915
  };
3916
- const handleMouseDown$2 = event => {
3916
+ const handleMouseDown$4 = event => {
3917
3917
  const $Target = event.target;
3918
3918
  const $Menu = $Target.closest('.Menu');
3919
3919
  const index = findIndex($Menu, $Target);
@@ -3990,7 +3990,7 @@ const create$Menu$1 = () => {
3990
3990
  $Menu.tabIndex = -1;
3991
3991
  // $ContextMenu.onmousedown = contextMenuHandleMouseDown
3992
3992
  // TODO mousedown vs click? (click is usually better but mousedown is faster, why wait 100ms?)
3993
- $Menu.addEventListener(MouseDown, handleMouseDown$2);
3993
+ $Menu.addEventListener(MouseDown, handleMouseDown$4);
3994
3994
  $Menu.addEventListener(MouseEnter, handleMouseEnter, {
3995
3995
  capture: true
3996
3996
  });
@@ -5096,7 +5096,7 @@ const getNodeIndex = $Node => {
5096
5096
  const get$ItemFromEvent = event => {
5097
5097
  return event.target.closest?.('.ActivityBarItem');
5098
5098
  };
5099
- const handleMouseDown$1 = event => {
5099
+ const handleMouseDown$3 = event => {
5100
5100
  const {
5101
5101
  button,
5102
5102
  clientX,
@@ -5136,7 +5136,7 @@ const ViewletActivityBarEvents = {
5136
5136
  handleBlur: handleBlur$7,
5137
5137
  handleContextMenu: handleContextMenu$6,
5138
5138
  handleFocus: handleFocus$8,
5139
- handleMouseDown: handleMouseDown$1,
5139
+ handleMouseDown: handleMouseDown$3,
5140
5140
  returnValue: returnValue$8
5141
5141
  };
5142
5142
 
@@ -5219,7 +5219,7 @@ forwardViewletCommand('handleListBlur');
5219
5219
  forwardViewletCommand('handleListFocus');
5220
5220
  const handleMenuClick$1 = forwardViewletCommand('handleMenuClick');
5221
5221
  const handleMenuMouseOver$1 = forwardViewletCommand('handleMenuMouseOver');
5222
- forwardViewletCommand('handleMouseDown');
5222
+ const handleMouseDown$2 = forwardViewletCommand('handleMouseDown');
5223
5223
  forwardViewletCommand('handleMouseMove');
5224
5224
  const handleMouseOut$1 = forwardViewletCommand('handleMouseOut');
5225
5225
  const handleMouseOver$1 = forwardViewletCommand('handleMouseOver');
@@ -7552,7 +7552,7 @@ const handleClickTab$1 = (target, uid) => {
7552
7552
  const index = getNodeIndex(target);
7553
7553
  selectIndex(uid, index);
7554
7554
  };
7555
- const handleClickAction$1 = (target, uid) => {
7555
+ const handleClickAction$1 = target => {
7556
7556
  const index = getNodeIndex(target);
7557
7557
  const {
7558
7558
  command
@@ -7562,7 +7562,8 @@ const handleClickAction$1 = (target, uid) => {
7562
7562
  console.info('[panel] action command not found');
7563
7563
  return;
7564
7564
  }
7565
- handleClickAction$2(uid, index, command);
7565
+ const childUid = get(target);
7566
+ handleClickAction$2(childUid, index, command);
7566
7567
  };
7567
7568
  const handleHeaderClick$1 = event => {
7568
7569
  const {
@@ -7575,7 +7576,7 @@ const handleHeaderClick$1 = event => {
7575
7576
  }
7576
7577
  const action = target.closest?.('.IconButton[data-command]');
7577
7578
  if (action) {
7578
- handleClickAction$1(action, uid);
7579
+ handleClickAction$1(action);
7579
7580
  }
7580
7581
  };
7581
7582
 
@@ -8110,10 +8111,26 @@ const handleClickTab = event => {
8110
8111
  const shouldDelete = Boolean(target.closest?.('.TerminalTabDeleteButton'));
8111
8112
  handleClickTab$2(uid, index, shouldDelete);
8112
8113
  };
8114
+ const handleMouseDown$1 = event => {
8115
+ const uid = fromEvent(event);
8116
+ const {
8117
+ target
8118
+ } = event;
8119
+ const terminal = target.closest?.('.XtermTerminal');
8120
+ if (!terminal) {
8121
+ return;
8122
+ }
8123
+ const terminalUid = get(terminal);
8124
+ if (!terminalUid) {
8125
+ return;
8126
+ }
8127
+ handleMouseDown$2(uid, terminalUid);
8128
+ };
8113
8129
 
8114
8130
  const ViewletTerminalsEvents = {
8115
8131
  __proto__: null,
8116
- handleClickTab
8132
+ handleClickTab,
8133
+ handleMouseDown: handleMouseDown$1
8117
8134
  };
8118
8135
 
8119
8136
  const Events$1 = ViewletTerminalsEvents;
@@ -9549,7 +9566,7 @@ const commandMap = {
9549
9566
  'Layout.getBounds': getBounds,
9550
9567
  'Location.getHref': getHref,
9551
9568
  'Location.getPathName': getPathName,
9552
- 'Location.hydrate': hydrate$4,
9569
+ 'Location.hydrate': hydrate$3,
9553
9570
  'Location.setPathName': setPathName,
9554
9571
  'MeasureTextBlockHeight.measureTextBlockHeight': measureTextBlockHeight,
9555
9572
  'MeasureTextHeight.measureTextHeight': measureTextHeight,
@@ -9912,7 +9929,7 @@ const launchEditorWorker = async port => {
9912
9929
  }
9913
9930
  };
9914
9931
 
9915
- const hydrate$2 = async () => {
9932
+ const hydrate$1 = async () => {
9916
9933
  const {
9917
9934
  port1,
9918
9935
  port2
@@ -9928,44 +9945,6 @@ const hydrate$2 = async () => {
9928
9945
  return success(undefined);
9929
9946
  };
9930
9947
 
9931
- const getConfiguredExtensionHostWorkerUrl = () => {
9932
- return getConfiguredWorkerUrl('extensionHostWorkerUrl');
9933
- };
9934
-
9935
- const extensionHostWorkerUrl = getConfiguredExtensionHostWorkerUrl() || `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/extension-host-worker/dist/extensionHostWorkerMain.js`;
9936
-
9937
- const launchExtensionHostWorker = async port => {
9938
- const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
9939
- try {
9940
- await create$u({
9941
- method: ModuleWorkerWithMessagePort,
9942
- name,
9943
- port,
9944
- url: extensionHostWorkerUrl
9945
- });
9946
- return success(undefined);
9947
- } catch (error$1) {
9948
- return error(error$1);
9949
- }
9950
- };
9951
-
9952
- const hydrate$1 = async () => {
9953
- const {
9954
- port1,
9955
- port2
9956
- } = new MessageChannel();
9957
- // TODO only launch port and send to renderer worker
9958
- const promise = launchExtensionHostWorker(port1);
9959
- const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
9960
- set$7(name, port2);
9961
- const result = await promise;
9962
- if (isError(result)) {
9963
- remove$2(name);
9964
- return result;
9965
- }
9966
- return success(undefined);
9967
- };
9968
-
9969
9948
  const getConfiguredSyntaxHighlightingWorkerUrl = () => {
9970
9949
  return getConfiguredWorkerUrl('syntaxHighlightingWorkerUrl');
9971
9950
  };
@@ -10002,7 +9981,7 @@ const hydrate = async () => {
10002
9981
  return success(undefined);
10003
9982
  };
10004
9983
 
10005
- const workerFns = [hydrate$3, hydrate$2, hydrate, hydrate$1];
9984
+ const workerFns = [hydrate$2, hydrate$1, hydrate];
10006
9985
  const call = fn => {
10007
9986
  return fn();
10008
9987
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "30.21.1",
3
+ "version": "30.22.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"