@lvce-editor/extension-search-view 7.17.0 → 7.18.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.
|
@@ -3827,9 +3827,19 @@ const set = rpc => {
|
|
|
3827
3827
|
state.connected = true;
|
|
3828
3828
|
};
|
|
3829
3829
|
|
|
3830
|
-
const handleMessagePort = async port => {
|
|
3830
|
+
const handleMessagePort = async (port, viewletCommandMap) => {
|
|
3831
|
+
const executeViewletCommand = async (uid, command, ...args) => {
|
|
3832
|
+
const fn = viewletCommandMap[`SearchExtensions.${command}`];
|
|
3833
|
+
if (typeof fn !== 'function') {
|
|
3834
|
+
throw new TypeError(`Viewlet command not found: ${command}`);
|
|
3835
|
+
}
|
|
3836
|
+
await fn(uid, ...args);
|
|
3837
|
+
await invoke$1('Viewlet.requestRender', uid);
|
|
3838
|
+
};
|
|
3831
3839
|
const rpc = await create$7({
|
|
3832
|
-
commandMap: {
|
|
3840
|
+
commandMap: {
|
|
3841
|
+
'Viewlet.executeViewletCommand': executeViewletCommand
|
|
3842
|
+
},
|
|
3833
3843
|
messagePort: port
|
|
3834
3844
|
});
|
|
3835
3845
|
set(rpc);
|
|
@@ -5206,6 +5216,7 @@ const toggleSuggest = state => {
|
|
|
5206
5216
|
return state.suggestOpen ? closeSuggest(state) : openSuggest(state);
|
|
5207
5217
|
};
|
|
5208
5218
|
|
|
5219
|
+
const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
|
|
5209
5220
|
const commandMap = {
|
|
5210
5221
|
'Extensions.copyExtensionId': wrapCommand(copyExtensionId),
|
|
5211
5222
|
'Extensions.copyExtensionInfo': wrapCommand(copyExtensionInfo),
|
|
@@ -5263,7 +5274,7 @@ const commandMap = {
|
|
|
5263
5274
|
'SearchExtensions.handleInput': wrapAsyncCommand(handleInputWithContext),
|
|
5264
5275
|
'SearchExtensions.handleInputFocus': wrapCommand(handleInputFocus),
|
|
5265
5276
|
'SearchExtensions.handleInstall': wrapCommand(handleInstall),
|
|
5266
|
-
'SearchExtensions.handleMessagePort':
|
|
5277
|
+
'SearchExtensions.handleMessagePort': handleDirectMessagePort,
|
|
5267
5278
|
'SearchExtensions.handleScrollBarCaptureLost': wrapCommand(handleScrollBarCaptureLost),
|
|
5268
5279
|
'SearchExtensions.handleScrollBarClick': wrapCommand(handleScrollBarClick),
|
|
5269
5280
|
'SearchExtensions.handleScrollBarMove': wrapCommand(handleScrollBarMove),
|