@lvce-editor/problems-view 1.31.3 → 1.32.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.
@@ -2599,9 +2599,19 @@ const set = rpc => {
2599
2599
  state.connected = true;
2600
2600
  };
2601
2601
 
2602
- const handleMessagePort = async port => {
2602
+ const handleMessagePort = async (port, viewletCommandMap) => {
2603
+ const executeViewletCommand = async (uid, command, ...args) => {
2604
+ const fn = viewletCommandMap[`Problems.${command}`];
2605
+ if (typeof fn !== 'function') {
2606
+ throw new TypeError(`Viewlet command not found: ${command}`);
2607
+ }
2608
+ await fn(uid, ...args);
2609
+ await invoke$1('Viewlet.requestRender', uid);
2610
+ };
2603
2611
  const rpc = await create$5({
2604
- commandMap: {},
2612
+ commandMap: {
2613
+ 'Viewlet.executeViewletCommand': executeViewletCommand
2614
+ },
2605
2615
  messagePort: port
2606
2616
  });
2607
2617
  set(rpc);
@@ -3776,6 +3786,7 @@ const toggleShowWarnings = state => {
3776
3786
  };
3777
3787
  };
3778
3788
 
3789
+ const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
3779
3790
  const commandMap = {
3780
3791
  'Problems.collapseAll': wrapCommand(collapseAll$1),
3781
3792
  'Problems.copyMessage': wrapCommand(copyMessage),
@@ -3798,7 +3809,7 @@ const commandMap = {
3798
3809
  'Problems.handleDiagnosticsChange': wrapCommand(handleDiagnosticsChange),
3799
3810
  'Problems.handleFilterInput': wrapCommand(handleFilterInput),
3800
3811
  'Problems.handleIconThemeChange': wrapCommand(handleIconThemeChange),
3801
- 'Problems.handleMessagePort': handleMessagePort,
3812
+ 'Problems.handleMessagePort': handleDirectMessagePort,
3802
3813
  'Problems.handleScrollBarCaptureLost': wrapCommand(handleScrollBarCaptureLost),
3803
3814
  'Problems.handleScrollBarClick': wrapCommand(handleScrollBarClick),
3804
3815
  'Problems.handleScrollBarMove': wrapCommand(handleScrollBarMove),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/problems-view",
3
- "version": "1.31.3",
3
+ "version": "1.32.0",
4
4
  "description": "Problems View Worker",
5
5
  "repository": {
6
6
  "type": "git",