@lvce-editor/extension-search-view 4.0.0 → 4.1.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.
@@ -427,7 +427,7 @@ const create$4 = (method, params) => {
427
427
  };
428
428
  };
429
429
  const callbacks = Object.create(null);
430
- const set$2 = (id, fn) => {
430
+ const set$4 = (id, fn) => {
431
431
  callbacks[id] = fn;
432
432
  };
433
433
  const get$2 = id => {
@@ -446,7 +446,7 @@ const registerPromise = () => {
446
446
  resolve,
447
447
  promise
448
448
  } = Promise.withResolvers();
449
- set$2(id, resolve);
449
+ set$4(id, resolve);
450
450
  return {
451
451
  id,
452
452
  promise
@@ -526,7 +526,8 @@ const splitLines = lines => {
526
526
  return lines.split(NewLine);
527
527
  };
528
528
  const getCurrentStack = () => {
529
- const currentStack = joinLines(splitLines(new Error().stack || '').slice(2));
529
+ const stackLinesToSkip = 3;
530
+ const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
530
531
  return currentStack;
531
532
  };
532
533
  const getNewLineIndex = (string, startIndex = undefined) => {
@@ -790,13 +791,19 @@ const send = (transport, method, ...params) => {
790
791
  const message = create$4(method, params);
791
792
  transport.send(message);
792
793
  };
793
- const invoke$1 = (ipc, method, ...params) => {
794
+ const invoke$2 = (ipc, method, ...params) => {
794
795
  return invokeHelper(ipc, method, params, false);
795
796
  };
796
- const invokeAndTransfer = (ipc, method, ...params) => {
797
+ const invokeAndTransfer$1 = (ipc, method, ...params) => {
797
798
  return invokeHelper(ipc, method, params, true);
798
799
  };
799
800
 
801
+ class CommandNotFoundError extends Error {
802
+ constructor(command) {
803
+ super(`Command not found ${command}`);
804
+ this.name = 'CommandNotFoundError';
805
+ }
806
+ }
800
807
  const commands = Object.create(null);
801
808
  const register = commandMap => {
802
809
  Object.assign(commands, commandMap);
@@ -807,7 +814,7 @@ const getCommand = key => {
807
814
  const execute = (command, ...args) => {
808
815
  const fn = getCommand(command);
809
816
  if (!fn) {
810
- throw new Error(`command not found ${command}`);
817
+ throw new CommandNotFoundError(command);
811
818
  }
812
819
  return fn(...args);
813
820
  };
@@ -823,10 +830,10 @@ const createRpc = ipc => {
823
830
  send(ipc, method, ...params);
824
831
  },
825
832
  invoke(method, ...params) {
826
- return invoke$1(ipc, method, ...params);
833
+ return invoke$2(ipc, method, ...params);
827
834
  },
828
835
  invokeAndTransfer(method, ...params) {
829
- return invokeAndTransfer(ipc, method, ...params);
836
+ return invokeAndTransfer$1(ipc, method, ...params);
830
837
  },
831
838
  async dispose() {
832
839
  await ipc?.dispose();
@@ -878,9 +885,30 @@ const WebWorkerRpcClient = {
878
885
  __proto__: null,
879
886
  create: create$3
880
887
  };
888
+ const createMockRpc = ({
889
+ commandMap
890
+ }) => {
891
+ const invocations = [];
892
+ const invoke = (method, ...params) => {
893
+ invocations.push([method, ...params]);
894
+ const command = commandMap[method];
895
+ return command(...params);
896
+ };
897
+ const mockRpc = {
898
+ invoke,
899
+ invokeAndTransfer: invoke,
900
+ invocations
901
+ };
902
+ return mockRpc;
903
+ };
881
904
 
905
+ const toCommandId$1 = key => {
906
+ const dotIndex = key.indexOf('.');
907
+ return key.slice(dotIndex + 1);
908
+ };
882
909
  const create$2 = () => {
883
910
  const states = Object.create(null);
911
+ const commandMapRef = {};
884
912
  return {
885
913
  get(uid) {
886
914
  return states[uid];
@@ -921,6 +949,15 @@ const create$2 = () => {
921
949
  };
922
950
  return wrapped;
923
951
  },
952
+ wrapGetter(fn) {
953
+ const wrapped = (uid, ...args) => {
954
+ const {
955
+ newState
956
+ } = states[uid];
957
+ return fn(newState, ...args);
958
+ };
959
+ return wrapped;
960
+ },
924
961
  diff(uid, modules, numbers) {
925
962
  const {
926
963
  oldState,
@@ -934,6 +971,14 @@ const create$2 = () => {
934
971
  }
935
972
  }
936
973
  return diffResult;
974
+ },
975
+ getCommandIds() {
976
+ const keys = Object.keys(commandMapRef);
977
+ const ids = keys.map(toCommandId$1);
978
+ return ids;
979
+ },
980
+ registerCommands(commandMap) {
981
+ Object.assign(commandMapRef, commandMap);
937
982
  }
938
983
  };
939
984
  };
@@ -1009,7 +1054,7 @@ const viewsAndMoreActions = () => {
1009
1054
  };
1010
1055
 
1011
1056
  const None$3 = 0;
1012
- const Input = 1;
1057
+ const Input$1 = 1;
1013
1058
  const List$2 = 2;
1014
1059
 
1015
1060
  const getFinalDeltaY = (height, itemHeight, itemsLength) => {
@@ -1128,7 +1173,7 @@ const matchesParsedValue = (extension, parsedValue) => {
1128
1173
  };
1129
1174
 
1130
1175
  const toSorted = (array, compare) => {
1131
- return [...array].sort(compare);
1176
+ return array.toSorted(compare);
1132
1177
  };
1133
1178
 
1134
1179
  const compareExtension = (extensionA, extensionB) => {
@@ -1181,7 +1226,7 @@ const handleInput = async (state, value) => {
1181
1226
  allExtensions,
1182
1227
  deltaY: 0,
1183
1228
  finalDeltaY: 0,
1184
- focus: Input,
1229
+ focus: Input$1,
1185
1230
  items,
1186
1231
  maxLineY: 0,
1187
1232
  message: noExtensionsFound(),
@@ -1237,9 +1282,10 @@ const closeSuggest = state => {
1237
1282
 
1238
1283
  const {
1239
1284
  get: get$1,
1240
- set: set$1,
1241
- dispose: dispose$1,
1242
- wrapCommand
1285
+ set: set$3,
1286
+ dispose: dispose$2,
1287
+ wrapCommand,
1288
+ wrapGetter
1243
1289
  } = create$2();
1244
1290
 
1245
1291
  const create$1 = (id, uri, x, y, width, height, platform, assetDir) => {
@@ -1275,7 +1321,7 @@ const create$1 = (id, uri, x, y, width, height, platform, assetDir) => {
1275
1321
  x,
1276
1322
  y
1277
1323
  };
1278
- set$1(id, state, state);
1324
+ set$3(id, state, state);
1279
1325
  };
1280
1326
 
1281
1327
  const isEqual$2 = (oldState, newState) => {
@@ -1322,8 +1368,8 @@ const diff2 = uid => {
1322
1368
  return diffResult;
1323
1369
  };
1324
1370
 
1325
- const dispose = uid => {
1326
- dispose$1(uid);
1371
+ const dispose$1 = uid => {
1372
+ dispose$2(uid);
1327
1373
  };
1328
1374
 
1329
1375
  // TODO optimize this function to return the minimum number
@@ -1539,7 +1585,7 @@ const CtrlCmd = 1 << 11 >>> 0;
1539
1585
  const FocusExtensions = 15;
1540
1586
  const FocusExtensionsInput = 7000;
1541
1587
 
1542
- const getKeyBindings = () => {
1588
+ const getKeyBindings$1 = () => {
1543
1589
  return [{
1544
1590
  key: Home,
1545
1591
  command: 'Extensions.focusFirst',
@@ -1625,16 +1671,25 @@ const getExtensionDetailUri = extensionId => {
1625
1671
  return `extension-detail://${extensionId}`;
1626
1672
  };
1627
1673
 
1674
+ const None$1 = 'none';
1675
+
1676
+ const Button = 1;
1677
+ const Div = 4;
1678
+ const Input = 6;
1679
+ const Text = 12;
1680
+ const Img = 17;
1681
+
1682
+ const DebugWorker = 55;
1683
+ const RendererWorker$1 = 1;
1684
+
1628
1685
  const rpcs = Object.create(null);
1629
- const set$g = (id, rpc) => {
1686
+ const set$2 = (id, rpc) => {
1630
1687
  rpcs[id] = rpc;
1631
1688
  };
1632
1689
  const get = id => {
1633
1690
  return rpcs[id];
1634
1691
  };
1635
1692
 
1636
- /* eslint-disable @typescript-eslint/explicit-function-return-type */
1637
-
1638
1693
  const create = rpcId => {
1639
1694
  return {
1640
1695
  // @ts-ignore
@@ -1650,7 +1705,7 @@ const create = rpcId => {
1650
1705
  return rpc.invokeAndTransfer(method, ...params);
1651
1706
  },
1652
1707
  set(rpc) {
1653
- set$g(rpcId, rpc);
1708
+ set$2(rpcId, rpc);
1654
1709
  },
1655
1710
  async dispose() {
1656
1711
  const rpc = get(rpcId);
@@ -1658,22 +1713,355 @@ const create = rpcId => {
1658
1713
  }
1659
1714
  };
1660
1715
  };
1661
- const RendererWorker$1 = 1;
1716
+
1662
1717
  const {
1663
- invoke: invoke$3,
1664
- set: set$3} = create(RendererWorker$1);
1718
+ invoke: invoke$1,
1719
+ invokeAndTransfer,
1720
+ set: set$1,
1721
+ dispose
1722
+ } = create(RendererWorker$1);
1723
+ const searchFileHtml = async uri => {
1724
+ return invoke$1('ExtensionHost.searchFileWithHtml', uri);
1725
+ };
1726
+ const getFilePathElectron = async file => {
1727
+ return invoke$1('FileSystemHandle.getFilePathElectron', file);
1728
+ };
1665
1729
  const showContextMenu$1 = async (x, y, id, ...args) => {
1666
- return invoke$3('ContextMenu.show', x, y, id, ...args);
1730
+ return invoke$1('ContextMenu.show', x, y, id, ...args);
1731
+ };
1732
+ const getElectronVersion = async () => {
1733
+ return invoke$1('Process.getElectronVersion');
1734
+ };
1735
+ const applyBulkReplacement = async bulkEdits => {
1736
+ await invoke$1('BulkReplacement.applyBulkReplacement', bulkEdits);
1737
+ };
1738
+ const setColorTheme = async id => {
1739
+ // @ts-ignore
1740
+ return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
1741
+ };
1742
+ const getNodeVersion = async () => {
1743
+ return invoke$1('Process.getNodeVersion');
1744
+ };
1745
+ const getChromeVersion = async () => {
1746
+ return invoke$1('Process.getChromeVersion');
1747
+ };
1748
+ const getV8Version = async () => {
1749
+ return invoke$1('Process.getV8Version');
1750
+ };
1751
+ const getFileHandles = async fileIds => {
1752
+ const files = await invoke$1('FileSystemHandle.getFileHandles', fileIds);
1753
+ return files;
1754
+ };
1755
+ const setWorkspacePath = async path => {
1756
+ await invoke$1('Workspace.setPath', path);
1757
+ };
1758
+ const registerWebViewInterceptor = async (id, port) => {
1759
+ await invokeAndTransfer('WebView.registerInterceptor', id, port);
1760
+ };
1761
+ const unregisterWebViewInterceptor = async id => {
1762
+ await invoke$1('WebView.unregisterInterceptor', id);
1763
+ };
1764
+ const sendMessagePortToEditorWorker = async (port, rpcId) => {
1765
+ const command = 'HandleMessagePort.handleMessagePort';
1766
+ // @ts-ignore
1767
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
1768
+ };
1769
+ const sendMessagePortToErrorWorker = async (port, rpcId) => {
1770
+ const command = 'Errors.handleMessagePort';
1771
+ // @ts-ignore
1772
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
1773
+ };
1774
+ const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
1775
+ const command = 'Markdown.handleMessagePort';
1776
+ // @ts-ignore
1777
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
1778
+ };
1779
+ const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
1780
+ const command = 'FileSystem.handleMessagePort';
1781
+ // @ts-ignore
1782
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
1783
+ };
1784
+ const readFile = async uri => {
1785
+ return invoke$1('FileSystem.readFile', uri);
1786
+ };
1787
+ const getWebViewSecret = async key => {
1788
+ // @ts-ignore
1789
+ return invoke$1('WebView.getSecret', key);
1790
+ };
1791
+ const setWebViewPort = async (uid, port, origin, portType) => {
1792
+ return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
1793
+ };
1794
+ const setFocus = key => {
1795
+ return invoke$1('Focus.setFocus', key);
1796
+ };
1797
+ const getFileIcon = async options => {
1798
+ return invoke$1('IconTheme.getFileIcon', options);
1799
+ };
1800
+ const getColorThemeNames = async () => {
1801
+ return invoke$1('ColorTheme.getColorThemeNames');
1802
+ };
1803
+ const disableExtension = async id => {
1804
+ // @ts-ignore
1805
+ return invoke$1('ExtensionManagement.disable', id);
1806
+ };
1807
+ const enableExtension = async id => {
1808
+ // @ts-ignore
1809
+ return invoke$1('ExtensionManagement.enable', id);
1810
+ };
1811
+ const handleDebugChange = async params => {
1812
+ // @ts-ignore
1813
+ return invoke$1('Run And Debug.handleChange', params);
1814
+ };
1815
+ const getFolderIcon = async options => {
1816
+ return invoke$1('IconTheme.getFolderIcon', options);
1817
+ };
1818
+ const closeWidget = async widgetId => {
1819
+ return invoke$1('Viewlet.closeWidget', widgetId);
1820
+ };
1821
+ const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
1822
+ const command = 'HandleMessagePort.handleMessagePort2';
1823
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
1824
+ };
1825
+ const sendMessagePortToSearchProcess = async port => {
1826
+ await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
1827
+ };
1828
+ const confirm = async (message, options) => {
1829
+ // @ts-ignore
1830
+ const result = await invoke$1('ConfirmPrompt.prompt', message, options);
1831
+ return result;
1832
+ };
1833
+ const getRecentlyOpened = async () => {
1834
+ return invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
1835
+ };
1836
+ const getKeyBindings = async () => {
1837
+ return invoke$1('KeyBindingsInitial.getKeyBindings');
1838
+ };
1839
+ const writeClipBoardText = async text => {
1840
+ await invoke$1('ClipBoard.writeText', /* text */text);
1841
+ };
1842
+ const writeClipBoardImage = async blob => {
1843
+ // @ts-ignore
1844
+ await invoke$1('ClipBoard.writeImage', /* text */blob);
1845
+ };
1846
+ const searchFileMemory = async uri => {
1847
+ // @ts-ignore
1848
+ return invoke$1('ExtensionHost.searchFileWithMemory', uri);
1849
+ };
1850
+ const searchFileFetch = async uri => {
1851
+ return invoke$1('ExtensionHost.searchFileWithFetch', uri);
1852
+ };
1853
+ const showMessageBox = async options => {
1854
+ return invoke$1('ElectronDialog.showMessageBox', options);
1855
+ };
1856
+ const handleDebugResumed = async params => {
1857
+ await invoke$1('Run And Debug.handleResumed', params);
1858
+ };
1859
+ const openWidget = async name => {
1860
+ await invoke$1('Viewlet.openWidget', name);
1861
+ };
1862
+ const getIcons = async requests => {
1863
+ const icons = await invoke$1('IconTheme.getIcons', requests);
1864
+ return icons;
1865
+ };
1866
+ const activateByEvent = event => {
1867
+ return invoke$1('ExtensionHostManagement.activateByEvent', event);
1868
+ };
1869
+ const setAdditionalFocus = focusKey => {
1870
+ // @ts-ignore
1871
+ return invoke$1('Focus.setAdditionalFocus', focusKey);
1872
+ };
1873
+ const getActiveEditorId = () => {
1874
+ // @ts-ignore
1875
+ return invoke$1('GetActiveEditor.getActiveEditorId');
1876
+ };
1877
+ const getWorkspacePath = () => {
1878
+ return invoke$1('Workspace.getPath');
1879
+ };
1880
+ const sendMessagePortToRendererProcess = async port => {
1881
+ const command = 'HandleMessagePort.handleMessagePort';
1882
+ // @ts-ignore
1883
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
1884
+ };
1885
+ const getPreference = async key => {
1886
+ return await invoke$1('Preferences.get', key);
1887
+ };
1888
+ const getAllExtensions$2 = async () => {
1889
+ return invoke$1('ExtensionManagement.getAllExtensions');
1890
+ };
1891
+ const rerenderEditor = async key => {
1892
+ // @ts-ignore
1893
+ return invoke$1('Editor.rerender', key);
1894
+ };
1895
+ const handleDebugPaused = async params => {
1896
+ await invoke$1('Run And Debug.handlePaused', params);
1667
1897
  };
1668
1898
  const openUri$2 = async (uri, focus, options) => {
1669
- await invoke$3('Main.openUri', uri, focus, options);
1899
+ await invoke$1('Main.openUri', uri, focus, options);
1900
+ };
1901
+ const sendMessagePortToSyntaxHighlightingWorker = async port => {
1902
+ await invokeAndTransfer(
1903
+ // @ts-ignore
1904
+ 'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
1905
+ };
1906
+ const handleDebugScriptParsed = async script => {
1907
+ await invoke$1('Run And Debug.handleScriptParsed', script);
1908
+ };
1909
+ const getWindowId = async () => {
1910
+ return invoke$1('GetWindowId.getWindowId');
1911
+ };
1912
+ const getBlob = async uri => {
1913
+ // @ts-ignore
1914
+ return invoke$1('FileSystem.getBlob', uri);
1915
+ };
1916
+ const getExtensionCommands = async () => {
1917
+ return invoke$1('ExtensionHost.getCommands');
1918
+ };
1919
+ const showErrorDialog = async errorInfo => {
1920
+ // @ts-ignore
1921
+ await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
1922
+ };
1923
+ const getFolderSize = async uri => {
1924
+ // @ts-ignore
1925
+ return await invoke$1('FileSystem.getFolderSize', uri);
1926
+ };
1927
+ const getExtension = async id => {
1928
+ // @ts-ignore
1929
+ return invoke$1('ExtensionManagement.getExtension', id);
1930
+ };
1931
+ const getMarkdownDom = async html => {
1932
+ // @ts-ignore
1933
+ return invoke$1('Markdown.getVirtualDom', html);
1934
+ };
1935
+ const renderMarkdown = async (markdown, options) => {
1936
+ // @ts-ignore
1937
+ return invoke$1('Markdown.renderMarkdown', markdown, options);
1670
1938
  };
1939
+ const openNativeFolder = async uri => {
1940
+ // @ts-ignore
1941
+ await invoke$1('OpenNativeFolder.openNativeFolder', uri);
1942
+ };
1943
+ const uninstallExtension = async id => {
1944
+ return invoke$1('ExtensionManagement.uninstall', id);
1945
+ };
1946
+ const installExtension = async id => {
1947
+ // @ts-ignore
1948
+ return invoke$1('ExtensionManagement.install', id);
1949
+ };
1950
+ const openExtensionSearch = async () => {
1951
+ // @ts-ignore
1952
+ return invoke$1('SideBar.openViewlet', 'Extensions');
1953
+ };
1954
+ const setExtensionsSearchValue = async searchValue => {
1955
+ // @ts-ignore
1956
+ return invoke$1('Extensions.handleInput', searchValue);
1957
+ };
1958
+ const openExternal = async uri => {
1959
+ // @ts-ignore
1960
+ await invoke$1('Open.openExternal', uri);
1961
+ };
1962
+ const openUrl = async uri => {
1963
+ // @ts-ignore
1964
+ await invoke$1('Open.openUrl', uri);
1965
+ };
1966
+ const getAllPreferences = async () => {
1967
+ // @ts-ignore
1968
+ return invoke$1('Preferences.getAll');
1969
+ };
1970
+ const showSaveFilePicker = async () => {
1971
+ // @ts-ignore
1972
+ return invoke$1('FilePicker.showSaveFilePicker');
1973
+ };
1974
+ const getLogsDir = async () => {
1975
+ // @ts-ignore
1976
+ return invoke$1('PlatformPaths.getLogsDir');
1977
+ };
1978
+ const registerMockRpc = commandMap => {
1979
+ const mockRpc = createMockRpc({
1980
+ commandMap
1981
+ });
1982
+ set$1(mockRpc);
1983
+ return mockRpc;
1984
+ };
1985
+
1671
1986
  const RendererWorker = {
1672
1987
  __proto__: null,
1673
- invoke: invoke$3,
1988
+ activateByEvent,
1989
+ applyBulkReplacement,
1990
+ closeWidget,
1991
+ confirm,
1992
+ disableExtension,
1993
+ dispose,
1994
+ enableExtension,
1995
+ getActiveEditorId,
1996
+ getAllExtensions: getAllExtensions$2,
1997
+ getAllPreferences,
1998
+ getBlob,
1999
+ getChromeVersion,
2000
+ getColorThemeNames,
2001
+ getElectronVersion,
2002
+ getExtension,
2003
+ getExtensionCommands,
2004
+ getFileHandles,
2005
+ getFileIcon,
2006
+ getFilePathElectron,
2007
+ getFolderIcon,
2008
+ getFolderSize,
2009
+ getIcons,
2010
+ getKeyBindings,
2011
+ getLogsDir,
2012
+ getMarkdownDom,
2013
+ getNodeVersion,
2014
+ getPreference,
2015
+ getRecentlyOpened,
2016
+ getV8Version,
2017
+ getWebViewSecret,
2018
+ getWindowId,
2019
+ getWorkspacePath,
2020
+ handleDebugChange,
2021
+ handleDebugPaused,
2022
+ handleDebugResumed,
2023
+ handleDebugScriptParsed,
2024
+ installExtension,
2025
+ invoke: invoke$1,
2026
+ invokeAndTransfer,
2027
+ openExtensionSearch,
2028
+ openExternal,
2029
+ openNativeFolder,
1674
2030
  openUri: openUri$2,
1675
- set: set$3,
1676
- showContextMenu: showContextMenu$1};
2031
+ openUrl,
2032
+ openWidget,
2033
+ readFile,
2034
+ registerMockRpc,
2035
+ registerWebViewInterceptor,
2036
+ renderMarkdown,
2037
+ rerenderEditor,
2038
+ searchFileFetch,
2039
+ searchFileHtml,
2040
+ searchFileMemory,
2041
+ sendMessagePortToEditorWorker,
2042
+ sendMessagePortToErrorWorker,
2043
+ sendMessagePortToExtensionHostWorker,
2044
+ sendMessagePortToFileSystemWorker,
2045
+ sendMessagePortToMarkdownWorker,
2046
+ sendMessagePortToRendererProcess,
2047
+ sendMessagePortToSearchProcess,
2048
+ sendMessagePortToSyntaxHighlightingWorker,
2049
+ set: set$1,
2050
+ setAdditionalFocus,
2051
+ setColorTheme,
2052
+ setExtensionsSearchValue,
2053
+ setFocus,
2054
+ setWebViewPort,
2055
+ setWorkspacePath,
2056
+ showContextMenu: showContextMenu$1,
2057
+ showErrorDialog,
2058
+ showMessageBox,
2059
+ showSaveFilePicker,
2060
+ uninstallExtension,
2061
+ unregisterWebViewInterceptor,
2062
+ writeClipBoardImage,
2063
+ writeClipBoardText
2064
+ };
1677
2065
 
1678
2066
  const {
1679
2067
  invoke,
@@ -2126,7 +2514,7 @@ const Extensions$1 = 'extensions';
2126
2514
 
2127
2515
  const getSelector = focus => {
2128
2516
  switch (focus) {
2129
- case Input:
2517
+ case Input$1:
2130
2518
  return `[name="${Extensions$1}"]`;
2131
2519
  case List$2:
2132
2520
  return '.ListItems';
@@ -2147,15 +2535,30 @@ const renderFocus = newState => {
2147
2535
  };
2148
2536
 
2149
2537
  const renderFocusContext = newState => {
2150
- if (newState.focus === Input) {
2151
- return ['Viewlet.setFocusContext', FocusExtensionsInput];
2538
+ const {
2539
+ uid
2540
+ } = newState;
2541
+ if (newState.focus === Input$1) {
2542
+ return ['Viewlet.setFocusContext', uid, FocusExtensionsInput];
2152
2543
  }
2153
2544
  if (newState.focus === List$2) {
2154
- return ['Viewlet.setFocusContext', FocusExtensions];
2545
+ return ['Viewlet.setFocusContext', uid, FocusExtensions];
2155
2546
  }
2156
2547
  return [];
2157
2548
  };
2158
2549
 
2550
+ const mergeClassNames = (...classNames) => {
2551
+ return classNames.filter(Boolean).join(' ');
2552
+ };
2553
+
2554
+ const text = data => {
2555
+ return {
2556
+ type: Text,
2557
+ text: data,
2558
+ childCount: 0
2559
+ };
2560
+ };
2561
+
2159
2562
  const Actions = 'Actions';
2160
2563
  const ExtensionActions = 'ExtensionActions';
2161
2564
  const ExtensionActive = 'ExtensionActive';
@@ -2186,33 +2589,8 @@ const Viewlet = 'Viewlet';
2186
2589
 
2187
2590
  const List = 'list';
2188
2591
  const ListItem = 'listitem';
2189
- const None$1 = 'none';
2190
- const ToolBar = 'toolbar';
2191
-
2192
2592
  const None = 'none';
2193
- const AriaRoles = {
2194
- __proto__: null,
2195
- None};
2196
- const mergeClassNames = (...classNames) => {
2197
- return classNames.filter(Boolean).join(' ');
2198
- };
2199
- const Div$1 = 4;
2200
- const Text = 12;
2201
- const VirtualDomElements = {
2202
- __proto__: null,
2203
- Div: Div$1};
2204
- const text = data => {
2205
- return {
2206
- type: Text,
2207
- text: data,
2208
- childCount: 0
2209
- };
2210
- };
2211
-
2212
- const Div = 4;
2213
- const Img = 17;
2214
- const TextArea = 62;
2215
- const Button = 1;
2593
+ const ToolBar = 'toolbar';
2216
2594
 
2217
2595
  const getClassName$1 = enabled => {
2218
2596
  if (enabled) {
@@ -2246,10 +2624,10 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
2246
2624
  const dom = [{
2247
2625
  type: Div,
2248
2626
  className: SearchField,
2249
- role: None$1,
2627
+ role: None,
2250
2628
  childCount: 2
2251
2629
  }, {
2252
- type: TextArea,
2630
+ type: Input,
2253
2631
  className: MultilineInputBox,
2254
2632
  spellcheck: false,
2255
2633
  autocapitalize: 'off',
@@ -2268,7 +2646,7 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
2268
2646
  dom.unshift({
2269
2647
  type: Div,
2270
2648
  className: SearchFieldContainer,
2271
- role: None$1,
2649
+ role: None,
2272
2650
  childCount: 1 + outsideButtons.length
2273
2651
  });
2274
2652
  dom.push(...outsideButtons.flatMap(getSearchFieldButtonVirtualDom));
@@ -2355,7 +2733,7 @@ const getExtensionListItemVirtualDom = extension => {
2355
2733
  type: Img,
2356
2734
  src: icon,
2357
2735
  className: ExtensionListItemIcon,
2358
- role: None$1,
2736
+ role: None,
2359
2737
  childCount: 0
2360
2738
  }, listItemDetail, listItemName, text(name), listItemDescription, text(description), listItemFooter, listItemAuthorName, text(publisher), {
2361
2739
  type: Div,
@@ -2465,12 +2843,12 @@ const getVisible = state => {
2465
2843
  const getContentVirtualDom = (visibleExtensions, message, scrollBarHeight, scrollBarY) => {
2466
2844
  if (message) {
2467
2845
  return [{
2468
- type: VirtualDomElements.Div,
2846
+ type: Div,
2469
2847
  childCount: 1
2470
2848
  }, text(message)];
2471
2849
  }
2472
2850
  return [{
2473
- type: VirtualDomElements.Div,
2851
+ type: Div,
2474
2852
  className: mergeClassNames(Viewlet, List$1),
2475
2853
  childCount: 2
2476
2854
  }, ...getExtensionsVirtualDom(visibleExtensions), ...getScrollBarVirtualDom(scrollBarHeight, scrollBarY)];
@@ -2485,12 +2863,12 @@ const getExtensionsViewVirtualDom = state => {
2485
2863
  scrollBarY
2486
2864
  } = state;
2487
2865
  return [{
2488
- type: VirtualDomElements.Div,
2866
+ type: Div,
2489
2867
  className: mergeClassNames(Viewlet, Extensions),
2490
2868
  childCount: 2,
2491
2869
  ariaLive: 'polite',
2492
2870
  ariaBusy: false,
2493
- role: AriaRoles.None
2871
+ role: None$1
2494
2872
  }, ...getExtensionHeaderVirtualDom(placeholder, inputActions), ...getContentVirtualDom(visibleExtensions, message, scrollBarHeight, scrollBarY)];
2495
2873
  };
2496
2874
 
@@ -2561,7 +2939,7 @@ const render3 = (uid, diffResult) => {
2561
2939
  oldState,
2562
2940
  newState
2563
2941
  } = get$1(uid);
2564
- set$1(uid, newState, newState);
2942
+ set$3(uid, newState, newState);
2565
2943
  const commands = applyRender(oldState, newState, diffResult);
2566
2944
  return commands;
2567
2945
  };
@@ -2570,7 +2948,7 @@ const getIconVirtualDom = (icon, type = Div) => {
2570
2948
  return {
2571
2949
  type,
2572
2950
  className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
2573
- role: None$1,
2951
+ role: None,
2574
2952
  childCount: 0
2575
2953
  };
2576
2954
  };
@@ -2660,14 +3038,11 @@ const renderEventListeners = () => {
2660
3038
  }];
2661
3039
  };
2662
3040
 
2663
- const saveState = uid => {
2664
- const {
2665
- newState
2666
- } = get$1(uid);
3041
+ const saveState = state => {
2667
3042
  const {
2668
3043
  searchValue,
2669
3044
  deltaY
2670
- } = newState;
3045
+ } = state;
2671
3046
  return {
2672
3047
  searchValue,
2673
3048
  deltaY
@@ -2699,7 +3074,7 @@ const commandMap = {
2699
3074
  'SearchExtensions.closeSuggest': wrapCommand(closeSuggest),
2700
3075
  'SearchExtensions.create': create$1,
2701
3076
  'SearchExtensions.diff2': diff2,
2702
- 'SearchExtensions.dispose': dispose,
3077
+ 'SearchExtensions.dispose': dispose$1,
2703
3078
  'SearchExtensions.focusFirst': wrapCommand(focusFirst),
2704
3079
  'SearchExtensions.focusIndex': wrapCommand(focusIndex),
2705
3080
  'SearchExtensions.focusLast': wrapCommand(focusLast),
@@ -2709,7 +3084,7 @@ const commandMap = {
2709
3084
  'SearchExtensions.focusPrevious': wrapCommand(focusPrevious),
2710
3085
  'SearchExtensions.getActions': getActions,
2711
3086
  'SearchExtensions.getCommandIds': getCommandIds,
2712
- 'SearchExtensions.getKeyBindings': getKeyBindings,
3087
+ 'SearchExtensions.getKeyBindings': getKeyBindings$1,
2713
3088
  'SearchExtensions.getMenuEntries': getMenuEntries,
2714
3089
  'SearchExtensions.handleBlur': wrapCommand(handleBlur),
2715
3090
  'SearchExtensions.handleClick': wrapCommand(handleClick),
@@ -2734,7 +3109,7 @@ const commandMap = {
2734
3109
  'SearchExtensions.renderActions': renderActions,
2735
3110
  'SearchExtensions.renderEventListeners': renderEventListeners,
2736
3111
  'SearchExtensions.restoreState': restoreState,
2737
- 'SearchExtensions.saveState': saveState,
3112
+ 'SearchExtensions.saveState': wrapGetter(saveState),
2738
3113
  'SearchExtensions.scrollDown': wrapCommand(scrollDown),
2739
3114
  'SearchExtensions.searchExtensions': searchExtensions,
2740
3115
  'SearchExtensions.selectIndex': wrapCommand(selectIndex),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-search-view",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Extension Search View Worker",
5
5
  "license": "MIT",
6
6
  "author": "Lvce Editor",