@lvce-editor/quick-pick-worker 4.14.2 → 4.15.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.
- package/dist/quickPickWorkerMain.js +14 -3
- package/package.json +1 -1
|
@@ -3832,9 +3832,19 @@ const set = rpc => {
|
|
|
3832
3832
|
state.connected = true;
|
|
3833
3833
|
};
|
|
3834
3834
|
|
|
3835
|
-
const handleRendererProcessMessagePort = async port => {
|
|
3835
|
+
const handleRendererProcessMessagePort = async (port, viewletCommandMap) => {
|
|
3836
|
+
const executeViewletCommand = async (uid, command, ...args) => {
|
|
3837
|
+
const fn = viewletCommandMap[`QuickPick.${command}`];
|
|
3838
|
+
if (typeof fn !== 'function') {
|
|
3839
|
+
throw new TypeError(`Viewlet command not found: ${command}`);
|
|
3840
|
+
}
|
|
3841
|
+
await fn(uid, ...args);
|
|
3842
|
+
await invoke$2('Viewlet.requestRender', uid);
|
|
3843
|
+
};
|
|
3836
3844
|
const rpc = await create$8({
|
|
3837
|
-
commandMap: {
|
|
3845
|
+
commandMap: {
|
|
3846
|
+
'Viewlet.executeViewletCommand': executeViewletCommand
|
|
3847
|
+
},
|
|
3838
3848
|
messagePort: port
|
|
3839
3849
|
});
|
|
3840
3850
|
set(rpc);
|
|
@@ -4768,6 +4778,7 @@ const showQuickPick = async ({
|
|
|
4768
4778
|
}
|
|
4769
4779
|
};
|
|
4770
4780
|
|
|
4781
|
+
const handleDirectMessagePort = port => handleRendererProcessMessagePort(port, commandMap);
|
|
4771
4782
|
const commandMap = {
|
|
4772
4783
|
'QuickPick.addMenuEntries': add$1,
|
|
4773
4784
|
'QuickPick.close': wrapCommand(close),
|
|
@@ -4788,7 +4799,7 @@ const commandMap = {
|
|
|
4788
4799
|
'QuickPick.handleFocus': wrapCommand(handleFocus),
|
|
4789
4800
|
'QuickPick.handleInput': wrapAsyncCommand(handleInputWithContext),
|
|
4790
4801
|
'QuickPick.handleMessagePort': handleMessagePort,
|
|
4791
|
-
'QuickPick.handleRendererProcessMessagePort':
|
|
4802
|
+
'QuickPick.handleRendererProcessMessagePort': handleDirectMessagePort,
|
|
4792
4803
|
'QuickPick.handleScrollBarPointerDown': wrapCommand(handleScrollBarPointerDown),
|
|
4793
4804
|
'QuickPick.handleScrollBarPointerMove': wrapCommand(handleScrollBarPointerMove),
|
|
4794
4805
|
'QuickPick.handleScrollBarPointerUp': wrapCommand(handleScrollBarPointerUp),
|