@lvce-editor/activity-bar-worker 7.20.0 → 7.21.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.
|
@@ -2748,9 +2748,19 @@ const set = rpc => {
|
|
|
2748
2748
|
state.connected = true;
|
|
2749
2749
|
};
|
|
2750
2750
|
|
|
2751
|
-
const handleMessagePort = async port => {
|
|
2751
|
+
const handleMessagePort = async (port, viewletCommandMap) => {
|
|
2752
|
+
const executeViewletCommand = async (uid, command, ...args) => {
|
|
2753
|
+
const fn = viewletCommandMap[`ActivityBar.${command}`];
|
|
2754
|
+
if (typeof fn !== 'function') {
|
|
2755
|
+
throw new TypeError(`Viewlet command not found: ${command}`);
|
|
2756
|
+
}
|
|
2757
|
+
await fn(uid, ...args);
|
|
2758
|
+
await invoke$1('Viewlet.requestRender', uid);
|
|
2759
|
+
};
|
|
2752
2760
|
const rpc = await create$4({
|
|
2753
|
-
commandMap: {
|
|
2761
|
+
commandMap: {
|
|
2762
|
+
'Viewlet.executeViewletCommand': executeViewletCommand
|
|
2763
|
+
},
|
|
2754
2764
|
messagePort: port
|
|
2755
2765
|
});
|
|
2756
2766
|
set(rpc);
|
|
@@ -3806,6 +3816,7 @@ const wakeUp = sleepState => {
|
|
|
3806
3816
|
set$5(sleepState.uid, sleepState, sleepState);
|
|
3807
3817
|
};
|
|
3808
3818
|
|
|
3819
|
+
const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
|
|
3809
3820
|
const commandMap = {
|
|
3810
3821
|
'ActivityBar.create': create$9,
|
|
3811
3822
|
'ActivityBar.diff2': diff2,
|
|
@@ -3835,7 +3846,7 @@ const commandMap = {
|
|
|
3835
3846
|
'ActivityBar.handleExtensionManagementMessagePort': handleExtensionManagementMessagePort,
|
|
3836
3847
|
'ActivityBar.handleExtensionsChanged': wrapCommand(handleExtensionsChanged),
|
|
3837
3848
|
'ActivityBar.handleFocus': wrapCommand(handleFocus),
|
|
3838
|
-
'ActivityBar.handleMessagePort':
|
|
3849
|
+
'ActivityBar.handleMessagePort': handleDirectMessagePort,
|
|
3839
3850
|
'ActivityBar.handleSettingsChanged': wrapCommand(handleSettingsChanged),
|
|
3840
3851
|
'ActivityBar.handleSideBarStateChange': wrapCommand(handleSideBarStateChange),
|
|
3841
3852
|
'ActivityBar.handleUpdateStateChange': wrapCommand(handleUpdateStateChange),
|