@lvce-editor/quick-pick-worker 4.14.2 → 4.16.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 +17 -4
- package/package.json +1 -1
|
@@ -3832,12 +3832,24 @@ const set = rpc => {
|
|
|
3832
3832
|
state.connected = true;
|
|
3833
3833
|
};
|
|
3834
3834
|
|
|
3835
|
-
const handleRendererProcessMessagePort = async port => {
|
|
3835
|
+
const handleRendererProcessMessagePort = async (port, viewletCommandMap, setAsRendererProcess = true) => {
|
|
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
|
+
if (setAsRendererProcess) {
|
|
3851
|
+
set(rpc);
|
|
3852
|
+
}
|
|
3841
3853
|
};
|
|
3842
3854
|
|
|
3843
3855
|
const initialize = async () => {
|
|
@@ -4768,6 +4780,7 @@ const showQuickPick = async ({
|
|
|
4768
4780
|
}
|
|
4769
4781
|
};
|
|
4770
4782
|
|
|
4783
|
+
const handleDirectMessagePort = (port, setAsRendererProcess = true) => handleRendererProcessMessagePort(port, commandMap, setAsRendererProcess);
|
|
4771
4784
|
const commandMap = {
|
|
4772
4785
|
'QuickPick.addMenuEntries': add$1,
|
|
4773
4786
|
'QuickPick.close': wrapCommand(close),
|
|
@@ -4788,7 +4801,7 @@ const commandMap = {
|
|
|
4788
4801
|
'QuickPick.handleFocus': wrapCommand(handleFocus),
|
|
4789
4802
|
'QuickPick.handleInput': wrapAsyncCommand(handleInputWithContext),
|
|
4790
4803
|
'QuickPick.handleMessagePort': handleMessagePort,
|
|
4791
|
-
'QuickPick.handleRendererProcessMessagePort':
|
|
4804
|
+
'QuickPick.handleRendererProcessMessagePort': handleDirectMessagePort,
|
|
4792
4805
|
'QuickPick.handleScrollBarPointerDown': wrapCommand(handleScrollBarPointerDown),
|
|
4793
4806
|
'QuickPick.handleScrollBarPointerMove': wrapCommand(handleScrollBarPointerMove),
|
|
4794
4807
|
'QuickPick.handleScrollBarPointerUp': wrapCommand(handleScrollBarPointerUp),
|