@lvce-editor/activity-bar-worker 1.9.0 → 1.11.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/activityBarWorkerMain.js +156 -502
- package/package.json +1 -1
|
@@ -378,7 +378,7 @@ const create$4 = (method, params) => {
|
|
|
378
378
|
};
|
|
379
379
|
};
|
|
380
380
|
const callbacks = Object.create(null);
|
|
381
|
-
const set$
|
|
381
|
+
const set$3 = (id, fn) => {
|
|
382
382
|
callbacks[id] = fn;
|
|
383
383
|
};
|
|
384
384
|
const get$2 = id => {
|
|
@@ -397,7 +397,7 @@ const registerPromise = () => {
|
|
|
397
397
|
resolve,
|
|
398
398
|
promise
|
|
399
399
|
} = Promise.withResolvers();
|
|
400
|
-
set$
|
|
400
|
+
set$3(id, resolve);
|
|
401
401
|
return {
|
|
402
402
|
id,
|
|
403
403
|
promise
|
|
@@ -742,10 +742,10 @@ const send = (transport, method, ...params) => {
|
|
|
742
742
|
const message = create$4(method, params);
|
|
743
743
|
transport.send(message);
|
|
744
744
|
};
|
|
745
|
-
const invoke$
|
|
745
|
+
const invoke$1 = (ipc, method, ...params) => {
|
|
746
746
|
return invokeHelper(ipc, method, params, false);
|
|
747
747
|
};
|
|
748
|
-
const invokeAndTransfer
|
|
748
|
+
const invokeAndTransfer = (ipc, method, ...params) => {
|
|
749
749
|
return invokeHelper(ipc, method, params, true);
|
|
750
750
|
};
|
|
751
751
|
|
|
@@ -781,10 +781,10 @@ const createRpc = ipc => {
|
|
|
781
781
|
send(ipc, method, ...params);
|
|
782
782
|
},
|
|
783
783
|
invoke(method, ...params) {
|
|
784
|
-
return invoke$
|
|
784
|
+
return invoke$1(ipc, method, ...params);
|
|
785
785
|
},
|
|
786
786
|
invokeAndTransfer(method, ...params) {
|
|
787
|
-
return invokeAndTransfer
|
|
787
|
+
return invokeAndTransfer(ipc, method, ...params);
|
|
788
788
|
},
|
|
789
789
|
async dispose() {
|
|
790
790
|
await ipc?.dispose();
|
|
@@ -836,31 +836,84 @@ const WebWorkerRpcClient = {
|
|
|
836
836
|
__proto__: null,
|
|
837
837
|
create: create$3
|
|
838
838
|
};
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
839
|
+
|
|
840
|
+
const Button$2 = 'button';
|
|
841
|
+
const None = 'none';
|
|
842
|
+
const Tab$1 = 'tab';
|
|
843
|
+
const ToolBar = 'toolbar';
|
|
844
|
+
|
|
845
|
+
const Button$1 = 'event.button';
|
|
846
|
+
const ClientX = 'event.clientX';
|
|
847
|
+
const ClientY = 'event.clientY';
|
|
848
|
+
|
|
849
|
+
const Enter = 3;
|
|
850
|
+
const Space = 9;
|
|
851
|
+
const PageUp = 10;
|
|
852
|
+
const PageDown = 11;
|
|
853
|
+
const End = 255;
|
|
854
|
+
const Home = 12;
|
|
855
|
+
const UpArrow = 14;
|
|
856
|
+
const DownArrow = 16;
|
|
857
|
+
|
|
858
|
+
const ActivityBar$3 = 1;
|
|
859
|
+
const Settings$1 = 12;
|
|
860
|
+
const ActivityBarAdditionalViews = 17;
|
|
861
|
+
|
|
862
|
+
const LeftClick = 0;
|
|
863
|
+
|
|
864
|
+
const RendererWorker = 1;
|
|
865
|
+
|
|
866
|
+
const SetCss = 'Viewlet.setCss';
|
|
867
|
+
const SetDom2 = 'Viewlet.setDom2';
|
|
868
|
+
const SetFocusContext = 'Viewlet.setFocusContext';
|
|
869
|
+
|
|
870
|
+
const FocusActivityBar = 5;
|
|
871
|
+
const FocusExplorer = 13;
|
|
872
|
+
|
|
873
|
+
const rpcs = Object.create(null);
|
|
874
|
+
const set$2 = (id, rpc) => {
|
|
875
|
+
rpcs[id] = rpc;
|
|
876
|
+
};
|
|
877
|
+
const get$1 = id => {
|
|
878
|
+
return rpcs[id];
|
|
879
|
+
};
|
|
880
|
+
|
|
881
|
+
const create$2 = rpcId => {
|
|
882
|
+
return {
|
|
883
|
+
// @ts-ignore
|
|
884
|
+
invoke(method, ...params) {
|
|
885
|
+
const rpc = get$1(rpcId);
|
|
886
|
+
// @ts-ignore
|
|
887
|
+
return rpc.invoke(method, ...params);
|
|
888
|
+
},
|
|
889
|
+
// @ts-ignore
|
|
890
|
+
invokeAndTransfer(method, ...params) {
|
|
891
|
+
const rpc = get$1(rpcId);
|
|
892
|
+
// @ts-ignore
|
|
893
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
894
|
+
},
|
|
895
|
+
set(rpc) {
|
|
896
|
+
set$2(rpcId, rpc);
|
|
897
|
+
},
|
|
898
|
+
async dispose() {
|
|
899
|
+
const rpc = get$1(rpcId);
|
|
900
|
+
await rpc.dispose();
|
|
848
901
|
}
|
|
849
|
-
return command(...params);
|
|
850
902
|
};
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
};
|
|
856
|
-
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
const {
|
|
906
|
+
invoke,
|
|
907
|
+
set: set$1} = create$2(RendererWorker);
|
|
908
|
+
const showContextMenu = async (x, y, id, ...args) => {
|
|
909
|
+
return invoke('ContextMenu.show', x, y, id, ...args);
|
|
857
910
|
};
|
|
858
911
|
|
|
859
912
|
const toCommandId = key => {
|
|
860
913
|
const dotIndex = key.indexOf('.');
|
|
861
914
|
return key.slice(dotIndex + 1);
|
|
862
915
|
};
|
|
863
|
-
const create$
|
|
916
|
+
const create$1 = () => {
|
|
864
917
|
const states = Object.create(null);
|
|
865
918
|
const commandMapRef = {};
|
|
866
919
|
return {
|
|
@@ -941,16 +994,17 @@ const terminate = () => {
|
|
|
941
994
|
};
|
|
942
995
|
|
|
943
996
|
const {
|
|
944
|
-
get
|
|
945
|
-
set
|
|
997
|
+
get,
|
|
998
|
+
set,
|
|
946
999
|
registerCommands,
|
|
947
1000
|
getCommandIds,
|
|
948
1001
|
wrapGetter,
|
|
949
|
-
wrapCommand
|
|
950
|
-
|
|
1002
|
+
wrapCommand,
|
|
1003
|
+
diff
|
|
1004
|
+
} = create$1();
|
|
951
1005
|
|
|
952
1006
|
// TODO parentUid might ot be needed
|
|
953
|
-
const create
|
|
1007
|
+
const create = (id, uri, x, y, width, height, args, parentUid, platform = 0) => {
|
|
954
1008
|
const state = {
|
|
955
1009
|
currentViewletId: '',
|
|
956
1010
|
uid: id,
|
|
@@ -959,14 +1013,14 @@ const create$1 = (id, uri, x, y, width, height, args, parentUid, platform = 0) =
|
|
|
959
1013
|
focusedIndex: -1,
|
|
960
1014
|
scrollBarHeight: 0,
|
|
961
1015
|
width: 0,
|
|
962
|
-
x
|
|
963
|
-
y
|
|
1016
|
+
x,
|
|
1017
|
+
y,
|
|
964
1018
|
sideBarVisible: false,
|
|
965
1019
|
activityBarItems: [],
|
|
966
1020
|
selectedIndex: -1,
|
|
967
1021
|
itemHeight: 48
|
|
968
1022
|
};
|
|
969
|
-
set
|
|
1023
|
+
set(id, state, state);
|
|
970
1024
|
return state;
|
|
971
1025
|
};
|
|
972
1026
|
|
|
@@ -993,30 +1047,17 @@ const RenderCss = 11;
|
|
|
993
1047
|
const modules = [isEqual, isEqual$1, isEqual$1, isEqual$2];
|
|
994
1048
|
const numbers = [RenderItems, RenderFocus, RenderFocusContext, RenderCss];
|
|
995
1049
|
|
|
996
|
-
const diff = (oldState, newState) => {
|
|
997
|
-
const diffResult = [];
|
|
998
|
-
for (let i = 0; i < modules.length; i++) {
|
|
999
|
-
const fn = modules[i];
|
|
1000
|
-
if (!fn(oldState, newState)) {
|
|
1001
|
-
diffResult.push(numbers[i]);
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
return diffResult;
|
|
1005
|
-
};
|
|
1006
|
-
|
|
1007
1050
|
const diff2 = uid => {
|
|
1008
|
-
|
|
1009
|
-
oldState,
|
|
1010
|
-
newState
|
|
1011
|
-
} = get$1(uid);
|
|
1012
|
-
const result = diff(oldState, newState);
|
|
1013
|
-
return result;
|
|
1051
|
+
return diff(uid, modules, numbers);
|
|
1014
1052
|
};
|
|
1015
1053
|
|
|
1016
1054
|
const List = 1;
|
|
1017
1055
|
|
|
1018
1056
|
const focus = state => {
|
|
1019
|
-
|
|
1057
|
+
const {
|
|
1058
|
+
focus
|
|
1059
|
+
} = state;
|
|
1060
|
+
if (focus) {
|
|
1020
1061
|
return state;
|
|
1021
1062
|
}
|
|
1022
1063
|
return {
|
|
@@ -1055,40 +1096,7 @@ const focusNone = state => {
|
|
|
1055
1096
|
return focusIndex(state, -1);
|
|
1056
1097
|
};
|
|
1057
1098
|
|
|
1058
|
-
const
|
|
1059
|
-
const None = 'none';
|
|
1060
|
-
const Tab$1 = 'tab';
|
|
1061
|
-
const ToolBar = 'toolbar';
|
|
1062
|
-
|
|
1063
|
-
const Button$1 = 'event.button';
|
|
1064
|
-
const ClientX = 'event.clientX';
|
|
1065
|
-
const ClientY = 'event.clientY';
|
|
1066
|
-
|
|
1067
|
-
const Enter = 3;
|
|
1068
|
-
const Space = 9;
|
|
1069
|
-
const PageUp = 10;
|
|
1070
|
-
const PageDown = 11;
|
|
1071
|
-
const End = 255;
|
|
1072
|
-
const Home = 12;
|
|
1073
|
-
const UpArrow = 14;
|
|
1074
|
-
const DownArrow = 16;
|
|
1075
|
-
|
|
1076
|
-
const ActivityBar$3 = 1;
|
|
1077
|
-
const Settings$1 = 12;
|
|
1078
|
-
const ActivityBarAdditionalViews = 17;
|
|
1079
|
-
|
|
1080
|
-
const LeftClick = 0;
|
|
1081
|
-
|
|
1082
|
-
const DebugWorker = 55;
|
|
1083
|
-
const RendererWorker$1 = 1;
|
|
1084
|
-
|
|
1085
|
-
const SetDom2 = 'Viewlet.setDom2';
|
|
1086
|
-
const SetFocusContext = 'Viewlet.setFocusContext';
|
|
1087
|
-
|
|
1088
|
-
const FocusActivityBar = 5;
|
|
1089
|
-
const FocusExplorer = 13;
|
|
1090
|
-
|
|
1091
|
-
const getKeyBindings$1 = () => {
|
|
1099
|
+
const getKeyBindings = () => {
|
|
1092
1100
|
return [{
|
|
1093
1101
|
key: DownArrow,
|
|
1094
1102
|
command: 'ActivityBar.focusNext',
|
|
@@ -1140,430 +1148,46 @@ const getIndexFromPosition = (y, eventX, eventY, itemHeight, itemCount) => {
|
|
|
1140
1148
|
return index;
|
|
1141
1149
|
};
|
|
1142
1150
|
|
|
1143
|
-
const
|
|
1144
|
-
const set$2 = (id, rpc) => {
|
|
1145
|
-
rpcs[id] = rpc;
|
|
1146
|
-
};
|
|
1147
|
-
const get = id => {
|
|
1148
|
-
return rpcs[id];
|
|
1149
|
-
};
|
|
1150
|
-
|
|
1151
|
-
const create = rpcId => {
|
|
1152
|
-
return {
|
|
1153
|
-
// @ts-ignore
|
|
1154
|
-
invoke(method, ...params) {
|
|
1155
|
-
const rpc = get(rpcId);
|
|
1156
|
-
// @ts-ignore
|
|
1157
|
-
return rpc.invoke(method, ...params);
|
|
1158
|
-
},
|
|
1159
|
-
// @ts-ignore
|
|
1160
|
-
invokeAndTransfer(method, ...params) {
|
|
1161
|
-
const rpc = get(rpcId);
|
|
1162
|
-
// @ts-ignore
|
|
1163
|
-
return rpc.invokeAndTransfer(method, ...params);
|
|
1164
|
-
},
|
|
1165
|
-
set(rpc) {
|
|
1166
|
-
set$2(rpcId, rpc);
|
|
1167
|
-
},
|
|
1168
|
-
async dispose() {
|
|
1169
|
-
const rpc = get(rpcId);
|
|
1170
|
-
await rpc.dispose();
|
|
1171
|
-
}
|
|
1172
|
-
};
|
|
1173
|
-
};
|
|
1174
|
-
|
|
1175
|
-
const {
|
|
1176
|
-
invoke: invoke$1,
|
|
1177
|
-
invokeAndTransfer,
|
|
1178
|
-
set: set$1,
|
|
1179
|
-
dispose
|
|
1180
|
-
} = create(RendererWorker$1);
|
|
1181
|
-
const searchFileHtml = async uri => {
|
|
1182
|
-
return invoke$1('ExtensionHost.searchFileWithHtml', uri);
|
|
1183
|
-
};
|
|
1184
|
-
const getFilePathElectron = async file => {
|
|
1185
|
-
return invoke$1('FileSystemHandle.getFilePathElectron', file);
|
|
1186
|
-
};
|
|
1187
|
-
const showContextMenu = async (x, y, id, ...args) => {
|
|
1188
|
-
return invoke$1('ContextMenu.show', x, y, id, ...args);
|
|
1189
|
-
};
|
|
1190
|
-
const getElectronVersion = async () => {
|
|
1191
|
-
return invoke$1('Process.getElectronVersion');
|
|
1192
|
-
};
|
|
1193
|
-
const applyBulkReplacement = async bulkEdits => {
|
|
1194
|
-
await invoke$1('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1195
|
-
};
|
|
1196
|
-
const setColorTheme = async id => {
|
|
1197
|
-
// @ts-ignore
|
|
1198
|
-
return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1199
|
-
};
|
|
1200
|
-
const getNodeVersion = async () => {
|
|
1201
|
-
return invoke$1('Process.getNodeVersion');
|
|
1202
|
-
};
|
|
1203
|
-
const getChromeVersion = async () => {
|
|
1204
|
-
return invoke$1('Process.getChromeVersion');
|
|
1205
|
-
};
|
|
1206
|
-
const getV8Version = async () => {
|
|
1207
|
-
return invoke$1('Process.getV8Version');
|
|
1208
|
-
};
|
|
1209
|
-
const getFileHandles = async fileIds => {
|
|
1210
|
-
const files = await invoke$1('FileSystemHandle.getFileHandles', fileIds);
|
|
1211
|
-
return files;
|
|
1212
|
-
};
|
|
1213
|
-
const setWorkspacePath = async path => {
|
|
1214
|
-
await invoke$1('Workspace.setPath', path);
|
|
1215
|
-
};
|
|
1216
|
-
const registerWebViewInterceptor = async (id, port) => {
|
|
1217
|
-
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
1218
|
-
};
|
|
1219
|
-
const unregisterWebViewInterceptor = async id => {
|
|
1220
|
-
await invoke$1('WebView.unregisterInterceptor', id);
|
|
1221
|
-
};
|
|
1222
|
-
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1223
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1224
|
-
// @ts-ignore
|
|
1225
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1226
|
-
};
|
|
1227
|
-
const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
1228
|
-
const command = 'Errors.handleMessagePort';
|
|
1229
|
-
// @ts-ignore
|
|
1230
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1231
|
-
};
|
|
1232
|
-
const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
1233
|
-
const command = 'Markdown.handleMessagePort';
|
|
1234
|
-
// @ts-ignore
|
|
1235
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1236
|
-
};
|
|
1237
|
-
const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
1238
|
-
const command = 'IconTheme.handleMessagePort';
|
|
1239
|
-
// @ts-ignore
|
|
1240
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
1241
|
-
};
|
|
1242
|
-
const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
1243
|
-
const command = 'FileSystem.handleMessagePort';
|
|
1244
|
-
// @ts-ignore
|
|
1245
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1246
|
-
};
|
|
1247
|
-
const readFile = async uri => {
|
|
1248
|
-
return invoke$1('FileSystem.readFile', uri);
|
|
1249
|
-
};
|
|
1250
|
-
const getWebViewSecret = async key => {
|
|
1251
|
-
// @ts-ignore
|
|
1252
|
-
return invoke$1('WebView.getSecret', key);
|
|
1253
|
-
};
|
|
1254
|
-
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1255
|
-
return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
|
|
1256
|
-
};
|
|
1257
|
-
const setFocus = key => {
|
|
1258
|
-
return invoke$1('Focus.setFocus', key);
|
|
1259
|
-
};
|
|
1260
|
-
const getFileIcon = async options => {
|
|
1261
|
-
return invoke$1('IconTheme.getFileIcon', options);
|
|
1262
|
-
};
|
|
1263
|
-
const getColorThemeNames = async () => {
|
|
1264
|
-
return invoke$1('ColorTheme.getColorThemeNames');
|
|
1265
|
-
};
|
|
1266
|
-
const disableExtension = async id => {
|
|
1267
|
-
// @ts-ignore
|
|
1268
|
-
return invoke$1('ExtensionManagement.disable', id);
|
|
1269
|
-
};
|
|
1270
|
-
const enableExtension = async id => {
|
|
1271
|
-
// @ts-ignore
|
|
1272
|
-
return invoke$1('ExtensionManagement.enable', id);
|
|
1273
|
-
};
|
|
1274
|
-
const handleDebugChange = async params => {
|
|
1275
|
-
// @ts-ignore
|
|
1276
|
-
return invoke$1('Run And Debug.handleChange', params);
|
|
1277
|
-
};
|
|
1278
|
-
const getFolderIcon = async options => {
|
|
1279
|
-
return invoke$1('IconTheme.getFolderIcon', options);
|
|
1280
|
-
};
|
|
1281
|
-
const closeWidget = async widgetId => {
|
|
1282
|
-
return invoke$1('Viewlet.closeWidget', widgetId);
|
|
1283
|
-
};
|
|
1284
|
-
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
1285
|
-
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1286
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1287
|
-
};
|
|
1288
|
-
const sendMessagePortToSearchProcess = async port => {
|
|
1289
|
-
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1290
|
-
};
|
|
1291
|
-
const confirm = async (message, options) => {
|
|
1292
|
-
// @ts-ignore
|
|
1293
|
-
const result = await invoke$1('ConfirmPrompt.prompt', message, options);
|
|
1294
|
-
return result;
|
|
1295
|
-
};
|
|
1296
|
-
const getRecentlyOpened = async () => {
|
|
1297
|
-
return invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1298
|
-
};
|
|
1299
|
-
const getKeyBindings = async () => {
|
|
1300
|
-
return invoke$1('KeyBindingsInitial.getKeyBindings');
|
|
1301
|
-
};
|
|
1302
|
-
const writeClipBoardText = async text => {
|
|
1303
|
-
await invoke$1('ClipBoard.writeText', /* text */text);
|
|
1304
|
-
};
|
|
1305
|
-
const writeClipBoardImage = async blob => {
|
|
1306
|
-
// @ts-ignore
|
|
1307
|
-
await invoke$1('ClipBoard.writeImage', /* text */blob);
|
|
1308
|
-
};
|
|
1309
|
-
const searchFileMemory = async uri => {
|
|
1310
|
-
// @ts-ignore
|
|
1311
|
-
return invoke$1('ExtensionHost.searchFileWithMemory', uri);
|
|
1312
|
-
};
|
|
1313
|
-
const searchFileFetch = async uri => {
|
|
1314
|
-
return invoke$1('ExtensionHost.searchFileWithFetch', uri);
|
|
1315
|
-
};
|
|
1316
|
-
const showMessageBox = async options => {
|
|
1317
|
-
return invoke$1('ElectronDialog.showMessageBox', options);
|
|
1318
|
-
};
|
|
1319
|
-
const handleDebugResumed = async params => {
|
|
1320
|
-
await invoke$1('Run And Debug.handleResumed', params);
|
|
1321
|
-
};
|
|
1322
|
-
const openWidget = async name => {
|
|
1323
|
-
await invoke$1('Viewlet.openWidget', name);
|
|
1324
|
-
};
|
|
1325
|
-
const getIcons = async requests => {
|
|
1326
|
-
const icons = await invoke$1('IconTheme.getIcons', requests);
|
|
1327
|
-
return icons;
|
|
1328
|
-
};
|
|
1329
|
-
const activateByEvent = event => {
|
|
1330
|
-
return invoke$1('ExtensionHostManagement.activateByEvent', event);
|
|
1331
|
-
};
|
|
1332
|
-
const setAdditionalFocus = focusKey => {
|
|
1333
|
-
// @ts-ignore
|
|
1334
|
-
return invoke$1('Focus.setAdditionalFocus', focusKey);
|
|
1335
|
-
};
|
|
1336
|
-
const getActiveEditorId = () => {
|
|
1337
|
-
// @ts-ignore
|
|
1338
|
-
return invoke$1('GetActiveEditor.getActiveEditorId');
|
|
1339
|
-
};
|
|
1340
|
-
const getWorkspacePath = () => {
|
|
1341
|
-
return invoke$1('Workspace.getPath');
|
|
1342
|
-
};
|
|
1343
|
-
const sendMessagePortToRendererProcess = async port => {
|
|
1344
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1345
|
-
// @ts-ignore
|
|
1346
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1347
|
-
};
|
|
1348
|
-
const getPreference = async key => {
|
|
1349
|
-
return await invoke$1('Preferences.get', key);
|
|
1350
|
-
};
|
|
1351
|
-
const getAllExtensions = async () => {
|
|
1352
|
-
return invoke$1('ExtensionManagement.getAllExtensions');
|
|
1353
|
-
};
|
|
1354
|
-
const rerenderEditor = async key => {
|
|
1355
|
-
// @ts-ignore
|
|
1356
|
-
return invoke$1('Editor.rerender', key);
|
|
1357
|
-
};
|
|
1358
|
-
const handleDebugPaused = async params => {
|
|
1359
|
-
await invoke$1('Run And Debug.handlePaused', params);
|
|
1360
|
-
};
|
|
1361
|
-
const openUri = async (uri, focus, options) => {
|
|
1362
|
-
await invoke$1('Main.openUri', uri, focus, options);
|
|
1363
|
-
};
|
|
1364
|
-
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
1365
|
-
await invokeAndTransfer(
|
|
1366
|
-
// @ts-ignore
|
|
1367
|
-
'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
1368
|
-
};
|
|
1369
|
-
const handleDebugScriptParsed = async script => {
|
|
1370
|
-
await invoke$1('Run And Debug.handleScriptParsed', script);
|
|
1371
|
-
};
|
|
1372
|
-
const getWindowId = async () => {
|
|
1373
|
-
return invoke$1('GetWindowId.getWindowId');
|
|
1374
|
-
};
|
|
1375
|
-
const getBlob = async uri => {
|
|
1376
|
-
// @ts-ignore
|
|
1377
|
-
return invoke$1('FileSystem.getBlob', uri);
|
|
1378
|
-
};
|
|
1379
|
-
const getExtensionCommands = async () => {
|
|
1380
|
-
return invoke$1('ExtensionHost.getCommands');
|
|
1381
|
-
};
|
|
1382
|
-
const showErrorDialog = async errorInfo => {
|
|
1383
|
-
// @ts-ignore
|
|
1384
|
-
await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
|
|
1385
|
-
};
|
|
1386
|
-
const getFolderSize = async uri => {
|
|
1387
|
-
// @ts-ignore
|
|
1388
|
-
return await invoke$1('FileSystem.getFolderSize', uri);
|
|
1389
|
-
};
|
|
1390
|
-
const getExtension = async id => {
|
|
1391
|
-
// @ts-ignore
|
|
1392
|
-
return invoke$1('ExtensionManagement.getExtension', id);
|
|
1393
|
-
};
|
|
1394
|
-
const getMarkdownDom = async html => {
|
|
1395
|
-
// @ts-ignore
|
|
1396
|
-
return invoke$1('Markdown.getVirtualDom', html);
|
|
1397
|
-
};
|
|
1398
|
-
const renderMarkdown = async (markdown, options) => {
|
|
1399
|
-
// @ts-ignore
|
|
1400
|
-
return invoke$1('Markdown.renderMarkdown', markdown, options);
|
|
1401
|
-
};
|
|
1402
|
-
const openNativeFolder = async uri => {
|
|
1403
|
-
// @ts-ignore
|
|
1404
|
-
await invoke$1('OpenNativeFolder.openNativeFolder', uri);
|
|
1405
|
-
};
|
|
1406
|
-
const uninstallExtension = async id => {
|
|
1407
|
-
return invoke$1('ExtensionManagement.uninstall', id);
|
|
1408
|
-
};
|
|
1409
|
-
const installExtension = async id => {
|
|
1410
|
-
// @ts-ignore
|
|
1411
|
-
return invoke$1('ExtensionManagement.install', id);
|
|
1412
|
-
};
|
|
1413
|
-
const openExtensionSearch = async () => {
|
|
1414
|
-
// @ts-ignore
|
|
1415
|
-
return invoke$1('SideBar.openViewlet', 'Extensions');
|
|
1416
|
-
};
|
|
1417
|
-
const setExtensionsSearchValue = async searchValue => {
|
|
1418
|
-
// @ts-ignore
|
|
1419
|
-
return invoke$1('Extensions.handleInput', searchValue);
|
|
1420
|
-
};
|
|
1421
|
-
const openExternal = async uri => {
|
|
1422
|
-
// @ts-ignore
|
|
1423
|
-
await invoke$1('Open.openExternal', uri);
|
|
1424
|
-
};
|
|
1425
|
-
const openUrl = async uri => {
|
|
1426
|
-
// @ts-ignore
|
|
1427
|
-
await invoke$1('Open.openUrl', uri);
|
|
1428
|
-
};
|
|
1429
|
-
const getAllPreferences = async () => {
|
|
1430
|
-
// @ts-ignore
|
|
1431
|
-
return invoke$1('Preferences.getAll');
|
|
1432
|
-
};
|
|
1433
|
-
const showSaveFilePicker = async () => {
|
|
1434
|
-
// @ts-ignore
|
|
1435
|
-
return invoke$1('FilePicker.showSaveFilePicker');
|
|
1436
|
-
};
|
|
1437
|
-
const getLogsDir = async () => {
|
|
1438
|
-
// @ts-ignore
|
|
1439
|
-
return invoke$1('PlatformPaths.getLogsDir');
|
|
1440
|
-
};
|
|
1441
|
-
const registerMockRpc = commandMap => {
|
|
1442
|
-
const mockRpc = createMockRpc({
|
|
1443
|
-
commandMap
|
|
1444
|
-
});
|
|
1445
|
-
set$1(mockRpc);
|
|
1446
|
-
return mockRpc;
|
|
1447
|
-
};
|
|
1448
|
-
|
|
1449
|
-
const RendererWorker = {
|
|
1450
|
-
__proto__: null,
|
|
1451
|
-
activateByEvent,
|
|
1452
|
-
applyBulkReplacement,
|
|
1453
|
-
closeWidget,
|
|
1454
|
-
confirm,
|
|
1455
|
-
disableExtension,
|
|
1456
|
-
dispose,
|
|
1457
|
-
enableExtension,
|
|
1458
|
-
getActiveEditorId,
|
|
1459
|
-
getAllExtensions,
|
|
1460
|
-
getAllPreferences,
|
|
1461
|
-
getBlob,
|
|
1462
|
-
getChromeVersion,
|
|
1463
|
-
getColorThemeNames,
|
|
1464
|
-
getElectronVersion,
|
|
1465
|
-
getExtension,
|
|
1466
|
-
getExtensionCommands,
|
|
1467
|
-
getFileHandles,
|
|
1468
|
-
getFileIcon,
|
|
1469
|
-
getFilePathElectron,
|
|
1470
|
-
getFolderIcon,
|
|
1471
|
-
getFolderSize,
|
|
1472
|
-
getIcons,
|
|
1473
|
-
getKeyBindings,
|
|
1474
|
-
getLogsDir,
|
|
1475
|
-
getMarkdownDom,
|
|
1476
|
-
getNodeVersion,
|
|
1477
|
-
getPreference,
|
|
1478
|
-
getRecentlyOpened,
|
|
1479
|
-
getV8Version,
|
|
1480
|
-
getWebViewSecret,
|
|
1481
|
-
getWindowId,
|
|
1482
|
-
getWorkspacePath,
|
|
1483
|
-
handleDebugChange,
|
|
1484
|
-
handleDebugPaused,
|
|
1485
|
-
handleDebugResumed,
|
|
1486
|
-
handleDebugScriptParsed,
|
|
1487
|
-
installExtension,
|
|
1488
|
-
invoke: invoke$1,
|
|
1489
|
-
invokeAndTransfer,
|
|
1490
|
-
openExtensionSearch,
|
|
1491
|
-
openExternal,
|
|
1492
|
-
openNativeFolder,
|
|
1493
|
-
openUri,
|
|
1494
|
-
openUrl,
|
|
1495
|
-
openWidget,
|
|
1496
|
-
readFile,
|
|
1497
|
-
registerMockRpc,
|
|
1498
|
-
registerWebViewInterceptor,
|
|
1499
|
-
renderMarkdown,
|
|
1500
|
-
rerenderEditor,
|
|
1501
|
-
searchFileFetch,
|
|
1502
|
-
searchFileHtml,
|
|
1503
|
-
searchFileMemory,
|
|
1504
|
-
sendMessagePortToEditorWorker,
|
|
1505
|
-
sendMessagePortToErrorWorker,
|
|
1506
|
-
sendMessagePortToExtensionHostWorker,
|
|
1507
|
-
sendMessagePortToFileSystemWorker,
|
|
1508
|
-
sendMessagePortToIconThemeWorker,
|
|
1509
|
-
sendMessagePortToMarkdownWorker,
|
|
1510
|
-
sendMessagePortToRendererProcess,
|
|
1511
|
-
sendMessagePortToSearchProcess,
|
|
1512
|
-
sendMessagePortToSyntaxHighlightingWorker,
|
|
1513
|
-
set: set$1,
|
|
1514
|
-
setAdditionalFocus,
|
|
1515
|
-
setColorTheme,
|
|
1516
|
-
setExtensionsSearchValue,
|
|
1517
|
-
setFocus,
|
|
1518
|
-
setWebViewPort,
|
|
1519
|
-
setWorkspacePath,
|
|
1520
|
-
showContextMenu,
|
|
1521
|
-
showErrorDialog,
|
|
1522
|
-
showMessageBox,
|
|
1523
|
-
showSaveFilePicker,
|
|
1524
|
-
uninstallExtension,
|
|
1525
|
-
unregisterWebViewInterceptor,
|
|
1526
|
-
writeClipBoardImage,
|
|
1527
|
-
writeClipBoardText
|
|
1528
|
-
};
|
|
1529
|
-
|
|
1530
|
-
const show = async (x, y, id, ...args) => {
|
|
1151
|
+
const show$1 = async (x, y, id, ...args) => {
|
|
1531
1152
|
await showContextMenu(x, y, id, args);
|
|
1532
1153
|
};
|
|
1533
1154
|
|
|
1534
1155
|
const handleClickAdditionalViews = async (state, x, y, viewletId) => {
|
|
1535
|
-
await show(x, y, ActivityBarAdditionalViews);
|
|
1156
|
+
await show$1(x, y, ActivityBarAdditionalViews);
|
|
1536
1157
|
return state;
|
|
1537
1158
|
};
|
|
1538
1159
|
|
|
1539
|
-
const {
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
}
|
|
1160
|
+
const show = async (sideBarVisible, id) => {
|
|
1161
|
+
if (sideBarVisible) {
|
|
1162
|
+
await invoke('SideBar.show', id);
|
|
1163
|
+
} else {
|
|
1164
|
+
// @ts-ignore
|
|
1165
|
+
await invoke('Layout.showSideBar', /* id */id);
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
const hide = async () => {
|
|
1169
|
+
await invoke('Layout.hideSideBar');
|
|
1170
|
+
};
|
|
1543
1171
|
|
|
1544
1172
|
const handleClickOther = async (state, x, y, viewletId) => {
|
|
1545
|
-
// TODO ask renderer worker asynchronously if sidebar is visible
|
|
1546
|
-
|
|
1547
1173
|
const {
|
|
1548
1174
|
sideBarVisible,
|
|
1549
1175
|
currentViewletId
|
|
1550
1176
|
} = state;
|
|
1551
1177
|
if (sideBarVisible) {
|
|
1552
1178
|
if (currentViewletId === viewletId) {
|
|
1553
|
-
await
|
|
1179
|
+
await hide();
|
|
1554
1180
|
} else {
|
|
1555
|
-
await
|
|
1181
|
+
await show(sideBarVisible, viewletId);
|
|
1556
1182
|
}
|
|
1557
1183
|
} else {
|
|
1558
|
-
|
|
1559
|
-
// @ts-ignore
|
|
1560
|
-
await invoke('Layout.showSideBar');
|
|
1184
|
+
await show(sideBarVisible, currentViewletId);
|
|
1561
1185
|
}
|
|
1562
1186
|
return state;
|
|
1563
1187
|
};
|
|
1564
1188
|
|
|
1565
1189
|
const handleClickSettings = async (state, x, y, viewletId) => {
|
|
1566
|
-
await show(x, y, Settings$1);
|
|
1190
|
+
await show$1(x, y, Settings$1);
|
|
1567
1191
|
return state;
|
|
1568
1192
|
};
|
|
1569
1193
|
|
|
@@ -1600,7 +1224,7 @@ const handleClick = async (state, button, eventX, eventY) => {
|
|
|
1600
1224
|
};
|
|
1601
1225
|
|
|
1602
1226
|
const handleContextMenu = async (state, button, x, y) => {
|
|
1603
|
-
await show(x, y, ActivityBar$3);
|
|
1227
|
+
await show$1(x, y, ActivityBar$3);
|
|
1604
1228
|
return state;
|
|
1605
1229
|
};
|
|
1606
1230
|
|
|
@@ -1608,6 +1232,14 @@ const handleResize = state => {
|
|
|
1608
1232
|
return state;
|
|
1609
1233
|
};
|
|
1610
1234
|
|
|
1235
|
+
const handleSideBarHidden = state => {
|
|
1236
|
+
return {
|
|
1237
|
+
...state,
|
|
1238
|
+
focusedIndex: -1,
|
|
1239
|
+
selectedIndex: -1
|
|
1240
|
+
};
|
|
1241
|
+
};
|
|
1242
|
+
|
|
1611
1243
|
const findIndex = (activityBarItems, id) => {
|
|
1612
1244
|
for (let i = 0; i < activityBarItems.length; i++) {
|
|
1613
1245
|
if (activityBarItems[i].id === id) {
|
|
@@ -1624,7 +1256,8 @@ const handleSideBarViewletChange = (state, id, ...args) => {
|
|
|
1624
1256
|
const index = findIndex(activityBarItems, id);
|
|
1625
1257
|
return {
|
|
1626
1258
|
...state,
|
|
1627
|
-
selectedIndex: index
|
|
1259
|
+
selectedIndex: index,
|
|
1260
|
+
currentViewletId: id
|
|
1628
1261
|
};
|
|
1629
1262
|
};
|
|
1630
1263
|
|
|
@@ -1740,12 +1373,25 @@ const loadContent = async (state, savedState) => {
|
|
|
1740
1373
|
return {
|
|
1741
1374
|
...state,
|
|
1742
1375
|
activityBarItems: items,
|
|
1743
|
-
sideBarVisible: true
|
|
1376
|
+
sideBarVisible: true,
|
|
1377
|
+
currentViewletId: Explorer
|
|
1744
1378
|
};
|
|
1745
1379
|
};
|
|
1746
1380
|
|
|
1381
|
+
const getCss = itemHeight => {
|
|
1382
|
+
return `:root {
|
|
1383
|
+
--ActivityBarItemHeight: var(--${itemHeight}px);
|
|
1384
|
+
}
|
|
1385
|
+
`;
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1747
1388
|
const renderCss = (oldState, newState) => {
|
|
1748
|
-
|
|
1389
|
+
const {
|
|
1390
|
+
uid,
|
|
1391
|
+
itemHeight
|
|
1392
|
+
} = newState;
|
|
1393
|
+
const css = getCss(itemHeight);
|
|
1394
|
+
return [SetCss, uid, css];
|
|
1749
1395
|
};
|
|
1750
1396
|
|
|
1751
1397
|
const renderFocusContext = (oldState, newState) => {
|
|
@@ -1779,6 +1425,20 @@ const HandleMouseDown = 'handleMouseDown';
|
|
|
1779
1425
|
|
|
1780
1426
|
const ActivityBar = 'ActivityBar';
|
|
1781
1427
|
|
|
1428
|
+
const getClassName = (isFocused, marginTop, isSelected) => {
|
|
1429
|
+
const classNames = [ActivityBarItem];
|
|
1430
|
+
if (isFocused) {
|
|
1431
|
+
classNames.push(FocusOutline);
|
|
1432
|
+
}
|
|
1433
|
+
if (marginTop) {
|
|
1434
|
+
classNames.push(MarginTopAuto);
|
|
1435
|
+
}
|
|
1436
|
+
if (isSelected) {
|
|
1437
|
+
classNames.push(ActivityBarItemSelected);
|
|
1438
|
+
}
|
|
1439
|
+
return mergeClassNames(...classNames);
|
|
1440
|
+
};
|
|
1441
|
+
|
|
1782
1442
|
const Div = 4;
|
|
1783
1443
|
|
|
1784
1444
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
@@ -1809,15 +1469,8 @@ const createActivityBarItem = item => {
|
|
|
1809
1469
|
const role = isTab ? Tab$1 : Button$2;
|
|
1810
1470
|
const ariaSelected = getAriaSelected(isTab, isSelected);
|
|
1811
1471
|
const marginTop = flags & MarginTop;
|
|
1812
|
-
let className =
|
|
1813
|
-
if (isFocused) {
|
|
1814
|
-
className += ' ' + FocusOutline;
|
|
1815
|
-
}
|
|
1816
|
-
if (marginTop) {
|
|
1817
|
-
className += ' ' + MarginTopAuto;
|
|
1818
|
-
}
|
|
1472
|
+
let className = getClassName(isFocused, marginTop, isSelected);
|
|
1819
1473
|
if (isSelected) {
|
|
1820
|
-
className += ' ' + ActivityBarItemSelected;
|
|
1821
1474
|
return [{
|
|
1822
1475
|
type: Div,
|
|
1823
1476
|
className,
|
|
@@ -1862,7 +1515,7 @@ const createActivityBarItem = item => {
|
|
|
1862
1515
|
}
|
|
1863
1516
|
return [{
|
|
1864
1517
|
type: Div,
|
|
1865
|
-
className:
|
|
1518
|
+
className: mergeClassNames(className, `Icon${icon}`),
|
|
1866
1519
|
ariaLabel: '',
|
|
1867
1520
|
title,
|
|
1868
1521
|
role,
|
|
@@ -1933,8 +1586,8 @@ const render2 = (uid, diffResult) => {
|
|
|
1933
1586
|
const {
|
|
1934
1587
|
oldState,
|
|
1935
1588
|
newState
|
|
1936
|
-
} = get
|
|
1937
|
-
set
|
|
1589
|
+
} = get(uid);
|
|
1590
|
+
set(uid, newState, newState);
|
|
1938
1591
|
const commands = applyRender(oldState, newState, diffResult);
|
|
1939
1592
|
return commands;
|
|
1940
1593
|
};
|
|
@@ -1968,7 +1621,7 @@ const saveState = state => {
|
|
|
1968
1621
|
};
|
|
1969
1622
|
|
|
1970
1623
|
const commandMap = {
|
|
1971
|
-
'ActivityBar.create': create
|
|
1624
|
+
'ActivityBar.create': create,
|
|
1972
1625
|
'ActivityBar.diff2': diff2,
|
|
1973
1626
|
'ActivityBar.focus': wrapCommand(focus),
|
|
1974
1627
|
'ActivityBar.focusFirst': wrapCommand(focusFirst),
|
|
@@ -1977,11 +1630,12 @@ const commandMap = {
|
|
|
1977
1630
|
'ActivityBar.focusNext': wrapCommand(focusNext),
|
|
1978
1631
|
'ActivityBar.focusNone': wrapCommand(focusNone),
|
|
1979
1632
|
'ActivityBar.getCommandIds': getCommandIds,
|
|
1980
|
-
'ActivityBar.getKeyBindings': getKeyBindings
|
|
1633
|
+
'ActivityBar.getKeyBindings': getKeyBindings,
|
|
1981
1634
|
'ActivityBar.handleBlur': wrapCommand(handleBlur),
|
|
1982
1635
|
'ActivityBar.handleResize': wrapCommand(handleResize),
|
|
1983
1636
|
'ActivityBar.handleClick': wrapCommand(handleClick),
|
|
1984
1637
|
'ActivityBar.handleContextMenu': wrapCommand(handleContextMenu),
|
|
1638
|
+
'ActivityBar.handleSideBarHidden': wrapCommand(handleSideBarHidden),
|
|
1985
1639
|
'ActivityBar.handleClickIndex': wrapCommand(handleClickIndex),
|
|
1986
1640
|
'ActivityBar.handleSideBarViewletChange': wrapCommand(handleSideBarViewletChange),
|
|
1987
1641
|
'ActivityBar.loadContent': wrapCommand(loadContent),
|
|
@@ -1996,7 +1650,7 @@ const listen = async () => {
|
|
|
1996
1650
|
const rpc = await WebWorkerRpcClient.create({
|
|
1997
1651
|
commandMap: commandMap
|
|
1998
1652
|
});
|
|
1999
|
-
set(rpc);
|
|
1653
|
+
set$1(rpc);
|
|
2000
1654
|
};
|
|
2001
1655
|
|
|
2002
1656
|
const main = async () => {
|