@lvce-editor/extension-search-view 4.13.0 → 5.0.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.
@@ -1066,10 +1066,11 @@ const create$2 = () => {
1066
1066
  wrapCommand(fn) {
1067
1067
  const wrapped = async (uid, ...args) => {
1068
1068
  const {
1069
+ oldState,
1069
1070
  newState
1070
1071
  } = states[uid];
1071
1072
  const newerState = await fn(newState, ...args);
1072
- if (newState === newerState) {
1073
+ if (oldState === newerState || newState === newerState) {
1073
1074
  return;
1074
1075
  }
1075
1076
  const latest = states[uid];
@@ -1134,11 +1135,13 @@ const TargetValue = 'event.target.value';
1134
1135
 
1135
1136
  const Script$1 = 2;
1136
1137
 
1138
+ const ManageExtension$1 = 8;
1139
+
1137
1140
  const LeftClick = 0;
1138
1141
 
1139
1142
  const DebugWorker = 55;
1140
1143
  const ExtensionHostWorker = 44;
1141
- const RendererWorker$2 = 1;
1144
+ const RendererWorker$1 = 1;
1142
1145
 
1143
1146
  const None$2 = 0;
1144
1147
  const Input = 1;
@@ -1623,19 +1626,23 @@ const {
1623
1626
  invokeAndTransfer,
1624
1627
  set: set$3,
1625
1628
  dispose: dispose$2
1626
- } = create$1(RendererWorker$2);
1629
+ } = create$1(RendererWorker$1);
1627
1630
  const searchFileHtml = async uri => {
1628
1631
  return invoke$2('ExtensionHost.searchFileWithHtml', uri);
1629
1632
  };
1630
1633
  const getFilePathElectron = async file => {
1631
1634
  return invoke$2('FileSystemHandle.getFilePathElectron', file);
1632
1635
  };
1633
- const showContextMenu$1 = async (x, y, id, ...args) => {
1636
+ const showContextMenu = async (x, y, id, ...args) => {
1634
1637
  return invoke$2('ContextMenu.show', x, y, id, ...args);
1635
1638
  };
1636
1639
  const showContextMenu2 = async (uid, menuId, x, y, args) => {
1640
+ number(uid);
1641
+ number(menuId);
1642
+ number(x);
1643
+ number(y);
1637
1644
  // @ts-ignore
1638
- await RendererWorker.invoke('ContextMenu.show2', uid, menuId, x, y, args);
1645
+ await invoke$2('ContextMenu.show2', uid, menuId, x, y, args);
1639
1646
  };
1640
1647
  const getElectronVersion = async () => {
1641
1648
  return invoke$2('Process.getElectronVersion');
@@ -1752,6 +1759,9 @@ const getKeyBindings$1 = async () => {
1752
1759
  const writeClipBoardText = async text => {
1753
1760
  await invoke$2('ClipBoard.writeText', /* text */text);
1754
1761
  };
1762
+ const readClipBoardText = async () => {
1763
+ return invoke$2('ClipBoard.readText');
1764
+ };
1755
1765
  const writeClipBoardImage = async blob => {
1756
1766
  // @ts-ignore
1757
1767
  await invoke$2('ClipBoard.writeImage', /* text */blob);
@@ -1795,6 +1805,16 @@ const sendMessagePortToRendererProcess = async port => {
1795
1805
  // @ts-ignore
1796
1806
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
1797
1807
  };
1808
+ const sendMessagePortToTextMeasurementWorker = async port => {
1809
+ const command = 'TextMeasurement.handleMessagePort';
1810
+ // @ts-ignore
1811
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
1812
+ };
1813
+ const sendMessagePortToSourceControlWorker = async port => {
1814
+ const command = 'SourceControl.handleMessagePort';
1815
+ // @ts-ignore
1816
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
1817
+ };
1798
1818
  const getPreference = async key => {
1799
1819
  return await invoke$2('Preferences.get', key);
1800
1820
  };
@@ -1896,7 +1916,7 @@ const registerMockRpc = commandMap => {
1896
1916
  return mockRpc;
1897
1917
  };
1898
1918
 
1899
- const RendererWorker$1 = {
1919
+ const RendererWorker = {
1900
1920
  __proto__: null,
1901
1921
  activateByEvent,
1902
1922
  applyBulkReplacement,
@@ -1943,6 +1963,7 @@ const RendererWorker$1 = {
1943
1963
  openUri: openUri$2,
1944
1964
  openUrl,
1945
1965
  openWidget,
1966
+ readClipBoardText,
1946
1967
  readFile,
1947
1968
  registerMockRpc,
1948
1969
  registerWebViewInterceptor,
@@ -1959,7 +1980,9 @@ const RendererWorker$1 = {
1959
1980
  sendMessagePortToMarkdownWorker,
1960
1981
  sendMessagePortToRendererProcess,
1961
1982
  sendMessagePortToSearchProcess,
1983
+ sendMessagePortToSourceControlWorker,
1962
1984
  sendMessagePortToSyntaxHighlightingWorker,
1985
+ sendMessagePortToTextMeasurementWorker,
1963
1986
  set: set$3,
1964
1987
  setAdditionalFocus,
1965
1988
  setColorTheme,
@@ -1967,7 +1990,7 @@ const RendererWorker$1 = {
1967
1990
  setFocus,
1968
1991
  setWebViewPort,
1969
1992
  setWorkspacePath,
1970
- showContextMenu: showContextMenu$1,
1993
+ showContextMenu,
1971
1994
  showContextMenu2,
1972
1995
  showErrorDialog,
1973
1996
  showMessageBox,
@@ -2409,6 +2432,14 @@ const getMenuEntries = () => {
2409
2432
  }];
2410
2433
  };
2411
2434
 
2435
+ const getMenuEntries2 = state => {
2436
+ return getMenuEntries();
2437
+ };
2438
+
2439
+ const getMenuIds = () => {
2440
+ return [ManageExtension$1];
2441
+ };
2442
+
2412
2443
  const handleBlur = state => {
2413
2444
  return {
2414
2445
  ...state,
@@ -2423,10 +2454,9 @@ const getExtensionDetailUri = extensionId => {
2423
2454
  const {
2424
2455
  invoke: invoke$1,
2425
2456
  set: set$1,
2426
- showContextMenu,
2427
2457
  openUri: openUri$1,
2428
2458
  sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1
2429
- } = RendererWorker$1;
2459
+ } = RendererWorker;
2430
2460
 
2431
2461
  const openUri = async uri => {
2432
2462
  return openUri$1(uri);
@@ -2497,18 +2527,20 @@ const handleClickCurrentButKeepFocus = state => {
2497
2527
  return handleClick(state, focusedIndex);
2498
2528
  };
2499
2529
 
2500
- const show = async (x, y, id) => {
2501
- number(x);
2502
- number(y);
2503
- number(id);
2504
- await showContextMenu(x, y, id);
2530
+ const show2 = async (uid, menuId, x, y, args) => {
2531
+ await showContextMenu2(uid, menuId, x, y, args);
2505
2532
  };
2506
2533
 
2507
2534
  const ManageExtension = 8;
2508
2535
 
2509
2536
  const handleContextMenu = async (state, button, x, y) => {
2510
2537
  // TODO use focused index when when context menu button is -1 (keyboard)
2511
- await show(x, y, ManageExtension);
2538
+ const {
2539
+ uid
2540
+ } = state;
2541
+ await show2(uid, ManageExtension, x, y, {
2542
+ menuId: ManageExtension
2543
+ });
2512
2544
  return state;
2513
2545
  };
2514
2546
 
@@ -3509,6 +3541,7 @@ const commandMap = {
3509
3541
  'SearchExtensions.focusFirst': wrapCommand(focusFirst),
3510
3542
  'SearchExtensions.focusIndex': wrapCommand(focusIndex),
3511
3543
  'SearchExtensions.focusLast': wrapCommand(focusLast),
3544
+ 'SearchExtensions.getMenuEntries2': wrapGetter(getMenuEntries2),
3512
3545
  'SearchExtensions.focusNext': wrapCommand(focusNext),
3513
3546
  'SearchExtensions.handleHeaderContextMenu': wrapCommand(handleHeaderContextMenu),
3514
3547
  'SearchExtensions.focusNextPage': wrapCommand(focusNextPage),
@@ -3549,7 +3582,8 @@ const commandMap = {
3549
3582
  'SearchExtensions.setDeltaY': wrapCommand(setDeltaY),
3550
3583
  'SearchExtensions.terminate': terminate,
3551
3584
  'SearchExtensions.toggleSuggest': wrapCommand(toggleSuggest),
3552
- 'SearchExtensions.resize': wrapCommand(resize)
3585
+ 'SearchExtensions.resize': wrapCommand(resize),
3586
+ 'SearchExtensions.getMenuIds': getMenuIds
3553
3587
  };
3554
3588
 
3555
3589
  const listen = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-search-view",
3
- "version": "4.13.0",
3
+ "version": "5.0.0",
4
4
  "description": "Extension Search View Worker",
5
5
  "repository": {
6
6
  "type": "git",