@lvce-editor/text-search-view 1.8.0 → 1.9.1
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/textSearchViewMain.js +17 -5
- package/package.json +1 -1
|
@@ -4823,9 +4823,19 @@ const set = rpc => {
|
|
|
4823
4823
|
state.connected = true;
|
|
4824
4824
|
};
|
|
4825
4825
|
|
|
4826
|
-
const handleMessagePort = async port => {
|
|
4826
|
+
const handleMessagePort = async (port, viewletCommandMap) => {
|
|
4827
|
+
const executeViewletCommand = async (uid, command, ...args) => {
|
|
4828
|
+
const fn = viewletCommandMap[`TextSearch.${command}`];
|
|
4829
|
+
if (typeof fn !== 'function') {
|
|
4830
|
+
throw new TypeError(`Viewlet command not found: ${command}`);
|
|
4831
|
+
}
|
|
4832
|
+
await fn(uid, ...args);
|
|
4833
|
+
await invoke$2('Viewlet.requestRender', uid);
|
|
4834
|
+
};
|
|
4827
4835
|
const rpc = await create$7({
|
|
4828
|
-
commandMap: {
|
|
4836
|
+
commandMap: {
|
|
4837
|
+
'Viewlet.executeViewletCommand': executeViewletCommand
|
|
4838
|
+
},
|
|
4829
4839
|
messagePort: port
|
|
4830
4840
|
});
|
|
4831
4841
|
set(rpc);
|
|
@@ -4935,7 +4945,7 @@ const handleSharedInput = (state, name, value, inputSource = Script) => {
|
|
|
4935
4945
|
return fn(state, value, inputSource);
|
|
4936
4946
|
};
|
|
4937
4947
|
|
|
4938
|
-
const handleWorkspaceChange = state => {
|
|
4948
|
+
const handleWorkspaceChange = (state, workspacePath) => {
|
|
4939
4949
|
return {
|
|
4940
4950
|
...state,
|
|
4941
4951
|
deltaY: 0,
|
|
@@ -4946,7 +4956,8 @@ const handleWorkspaceChange = state => {
|
|
|
4946
4956
|
message: '',
|
|
4947
4957
|
minLineY: 0,
|
|
4948
4958
|
replacement: '',
|
|
4949
|
-
value: ''
|
|
4959
|
+
value: '',
|
|
4960
|
+
workspacePath
|
|
4950
4961
|
};
|
|
4951
4962
|
};
|
|
4952
4963
|
|
|
@@ -7050,6 +7061,7 @@ const handleContextMenu = async (state, button, x, y) => {
|
|
|
7050
7061
|
return newState;
|
|
7051
7062
|
};
|
|
7052
7063
|
|
|
7064
|
+
const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
|
|
7053
7065
|
const commandMap = {
|
|
7054
7066
|
'TextSearch.clearSearchResults': wrapCommand(clearSearchResults$1),
|
|
7055
7067
|
'TextSearch.collapseAll': wrapCommand(collapseAll$1),
|
|
@@ -7116,7 +7128,7 @@ const commandMap = {
|
|
|
7116
7128
|
'TextSearch.handleListBlur': wrapCommand(handleListBlur),
|
|
7117
7129
|
'TextSearch.handleListFocus': wrapCommand(handleListFocus),
|
|
7118
7130
|
'TextSearch.handleListPointerDown': wrapCommand(handleListPointerDown),
|
|
7119
|
-
'TextSearch.handleMessagePort':
|
|
7131
|
+
'TextSearch.handleMessagePort': handleDirectMessagePort,
|
|
7120
7132
|
'TextSearch.handlePullResultsFound': wrapCommand(handlePullResultsFound),
|
|
7121
7133
|
'TextSearch.handleReplaceInput': wrapCommand(handleReplaceInput),
|
|
7122
7134
|
'TextSearch.handleResize': wrapCommand(handleResize),
|