@lvce-editor/status-bar-worker 3.16.5 → 3.17.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,9 +1872,19 @@ const handleExtensionManagementMessagePort = async port => {
1872
1872
  set$4(rpc);
1873
1873
  };
1874
1874
 
1875
- const handleMessagePort = async port => {
1875
+ const handleMessagePort = async (port, viewletCommandMap) => {
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
1890
  set$1(rpc);
@@ -2030,6 +2040,7 @@ const saveState = state => {
2030
2040
  };
2031
2041
  };
2032
2042
 
2043
+ const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
2033
2044
  const commandMap = {
2034
2045
  'StatusBar.create': create$7,
2035
2046
  'StatusBar.diff2': diff2,
@@ -2040,7 +2051,7 @@ const commandMap = {
2040
2051
  'StatusBar.handleExtensionManagementMessagePort': handleExtensionManagementMessagePort,
2041
2052
  'StatusBar.handleExtensionsChanged': wrapCommand(handleExtensionsChanged),
2042
2053
  'StatusBar.handleItemsChanged': wrapCommand(handleItemsChanged),
2043
- 'StatusBar.handleMessagePort': handleMessagePort,
2054
+ 'StatusBar.handleMessagePort': handleDirectMessagePort,
2044
2055
  'StatusBar.handleNotificationCountChanged': wrapCommand(handleNotificationCountChanged),
2045
2056
  'StatusBar.handleProblemsSummaryChange': wrapCommand(handleProblemsSummaryChange),
2046
2057
  '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.17.0",
4
4
  "description": "Status Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",