@lvce-editor/status-bar-worker 3.16.5 → 3.18.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.
@@ -1872,12 +1872,24 @@ const handleExtensionManagementMessagePort = async port => {
1872
1872
  set$4(rpc);
1873
1873
  };
1874
1874
 
1875
- const handleMessagePort = async port => {
1875
+ const handleMessagePort = async (port, viewletCommandMap, setAsRendererProcess = true) => {
1876
+ const executeViewletCommand = async (uid, command, ...args) => {
1877
+ const fn = viewletCommandMap[`StatusBar.${command}`];
1878
+ if (typeof fn !== 'function') {
1879
+ throw new TypeError(`Viewlet command not found: ${command}`);
1880
+ }
1881
+ await fn(uid, ...args);
1882
+ await invoke$1('Viewlet.requestRender', uid);
1883
+ };
1876
1884
  const rpc = await create$2({
1877
- commandMap: {},
1885
+ commandMap: {
1886
+ 'Viewlet.executeViewletCommand': executeViewletCommand
1887
+ },
1878
1888
  messagePort: port
1879
1889
  });
1880
- set$1(rpc);
1890
+ if (setAsRendererProcess) {
1891
+ set$1(rpc);
1892
+ }
1881
1893
  };
1882
1894
 
1883
1895
  const handleProblemsSummaryChange = (state, summary) => {
@@ -2030,6 +2042,7 @@ const saveState = state => {
2030
2042
  };
2031
2043
  };
2032
2044
 
2045
+ const handleDirectMessagePort = (port, setAsRendererProcess = true) => handleMessagePort(port, commandMap, setAsRendererProcess);
2033
2046
  const commandMap = {
2034
2047
  'StatusBar.create': create$7,
2035
2048
  'StatusBar.diff2': diff2,
@@ -2040,7 +2053,7 @@ const commandMap = {
2040
2053
  'StatusBar.handleExtensionManagementMessagePort': handleExtensionManagementMessagePort,
2041
2054
  'StatusBar.handleExtensionsChanged': wrapCommand(handleExtensionsChanged),
2042
2055
  'StatusBar.handleItemsChanged': wrapCommand(handleItemsChanged),
2043
- 'StatusBar.handleMessagePort': handleMessagePort,
2056
+ 'StatusBar.handleMessagePort': handleDirectMessagePort,
2044
2057
  'StatusBar.handleNotificationCountChanged': wrapCommand(handleNotificationCountChanged),
2045
2058
  'StatusBar.handleProblemsSummaryChange': wrapCommand(handleProblemsSummaryChange),
2046
2059
  'StatusBar.initialize': initialize,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/status-bar-worker",
3
- "version": "3.16.5",
3
+ "version": "3.18.0",
4
4
  "description": "Status Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",