@lvce-editor/settings-view 2.22.0 → 2.23.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.
@@ -3358,9 +3358,19 @@ const set$1 = rpc => {
3358
3358
  state.connected = true;
3359
3359
  };
3360
3360
 
3361
- const handleMessagePort = async port => {
3361
+ const handleMessagePort = async (port, viewletCommandMap) => {
3362
+ const executeViewletCommand = async (uid, command, ...args) => {
3363
+ const fn = viewletCommandMap[`Settings.${command}`];
3364
+ if (typeof fn !== 'function') {
3365
+ throw new TypeError(`Viewlet command not found: ${command}`);
3366
+ }
3367
+ await fn(uid, ...args);
3368
+ await invoke$1('Viewlet.requestRender', uid);
3369
+ };
3362
3370
  const rpc = await PlainMessagePortRpc.create({
3363
- commandMap: {},
3371
+ commandMap: {
3372
+ 'Viewlet.executeViewletCommand': executeViewletCommand
3373
+ },
3364
3374
  messagePort: port
3365
3375
  });
3366
3376
  set$1(rpc);
@@ -5558,6 +5568,7 @@ const usePreviousSearchValue = state => {
5558
5568
  };
5559
5569
  };
5560
5570
 
5571
+ const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
5561
5572
  const commandMap = {
5562
5573
  'Initialize.initialize': initialize,
5563
5574
  'Settings.clear': wrapCommand(clear$1),
@@ -5574,7 +5585,7 @@ const commandMap = {
5574
5585
  'Settings.handleInput': wrapCommand(handleInput),
5575
5586
  'Settings.handleInputBlur': wrapCommand(handleInputBlur),
5576
5587
  'Settings.handleInputFocus': wrapCommand(handleInputFocus),
5577
- 'Settings.handleMessagePort': handleMessagePort,
5588
+ 'Settings.handleMessagePort': handleDirectMessagePort,
5578
5589
  'Settings.handleResizerPointerDown': wrapCommand(handleResizerPointerDown),
5579
5590
  'Settings.handleResizerPointerMove': wrapCommand(handleResizerPointerMove),
5580
5591
  'Settings.handleResizerPointerUp': wrapCommand(handleResizerPointerUp),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/settings-view",
3
- "version": "2.22.0",
3
+ "version": "2.23.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",