@lvce-editor/extension-search-view 4.3.0 → 4.5.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/README.md +7 -2
- package/dist/extensionSearchViewWorkerMain.js +960 -655
- package/package.json +1 -1
|
@@ -417,9 +417,103 @@ const IpcChildWithModuleWorkerAndMessagePort$1 = {
|
|
|
417
417
|
listen: listen$6,
|
|
418
418
|
wrap: wrap$e
|
|
419
419
|
};
|
|
420
|
+
const addListener = (emitter, type, callback) => {
|
|
421
|
+
if ('addEventListener' in emitter) {
|
|
422
|
+
emitter.addEventListener(type, callback);
|
|
423
|
+
} else {
|
|
424
|
+
emitter.on(type, callback);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
const removeListener = (emitter, type, callback) => {
|
|
428
|
+
if ('removeEventListener' in emitter) {
|
|
429
|
+
emitter.removeEventListener(type, callback);
|
|
430
|
+
} else {
|
|
431
|
+
emitter.off(type, callback);
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
435
|
+
const {
|
|
436
|
+
resolve,
|
|
437
|
+
promise
|
|
438
|
+
} = Promise.withResolvers();
|
|
439
|
+
const listenerMap = Object.create(null);
|
|
440
|
+
const cleanup = value => {
|
|
441
|
+
for (const event of Object.keys(eventMap)) {
|
|
442
|
+
removeListener(eventEmitter, event, listenerMap[event]);
|
|
443
|
+
}
|
|
444
|
+
resolve(value);
|
|
445
|
+
};
|
|
446
|
+
for (const [event, type] of Object.entries(eventMap)) {
|
|
447
|
+
const listener = event => {
|
|
448
|
+
cleanup({
|
|
449
|
+
type,
|
|
450
|
+
event
|
|
451
|
+
});
|
|
452
|
+
};
|
|
453
|
+
addListener(eventEmitter, event, listener);
|
|
454
|
+
listenerMap[event] = listener;
|
|
455
|
+
}
|
|
456
|
+
return promise;
|
|
457
|
+
};
|
|
458
|
+
const Message$1 = 3;
|
|
459
|
+
const create$5$1 = async ({
|
|
460
|
+
messagePort,
|
|
461
|
+
isMessagePortOpen
|
|
462
|
+
}) => {
|
|
463
|
+
if (!isMessagePort(messagePort)) {
|
|
464
|
+
throw new IpcError('port must be of type MessagePort');
|
|
465
|
+
}
|
|
466
|
+
if (isMessagePortOpen) {
|
|
467
|
+
return messagePort;
|
|
468
|
+
}
|
|
469
|
+
const eventPromise = getFirstEvent(messagePort, {
|
|
470
|
+
message: Message$1
|
|
471
|
+
});
|
|
472
|
+
messagePort.start();
|
|
473
|
+
const {
|
|
474
|
+
type,
|
|
475
|
+
event
|
|
476
|
+
} = await eventPromise;
|
|
477
|
+
if (type !== Message$1) {
|
|
478
|
+
throw new IpcError('Failed to wait for ipc message');
|
|
479
|
+
}
|
|
480
|
+
if (event.data !== readyMessage) {
|
|
481
|
+
throw new IpcError('unexpected first message');
|
|
482
|
+
}
|
|
483
|
+
return messagePort;
|
|
484
|
+
};
|
|
485
|
+
const signal$1 = messagePort => {
|
|
486
|
+
messagePort.start();
|
|
487
|
+
};
|
|
488
|
+
class IpcParentWithMessagePort extends Ipc {
|
|
489
|
+
getData = getData$2;
|
|
490
|
+
send(message) {
|
|
491
|
+
this._rawIpc.postMessage(message);
|
|
492
|
+
}
|
|
493
|
+
sendAndTransfer(message) {
|
|
494
|
+
const transfer = getTransferrables(message);
|
|
495
|
+
this._rawIpc.postMessage(message, transfer);
|
|
496
|
+
}
|
|
497
|
+
dispose() {
|
|
498
|
+
this._rawIpc.close();
|
|
499
|
+
}
|
|
500
|
+
onMessage(callback) {
|
|
501
|
+
this._rawIpc.addEventListener('message', callback);
|
|
502
|
+
}
|
|
503
|
+
onClose(callback) {}
|
|
504
|
+
}
|
|
505
|
+
const wrap$5 = messagePort => {
|
|
506
|
+
return new IpcParentWithMessagePort(messagePort);
|
|
507
|
+
};
|
|
508
|
+
const IpcParentWithMessagePort$1 = {
|
|
509
|
+
__proto__: null,
|
|
510
|
+
create: create$5$1,
|
|
511
|
+
signal: signal$1,
|
|
512
|
+
wrap: wrap$5
|
|
513
|
+
};
|
|
420
514
|
|
|
421
515
|
const Two = '2.0';
|
|
422
|
-
const create$4 = (method, params) => {
|
|
516
|
+
const create$4$1 = (method, params) => {
|
|
423
517
|
return {
|
|
424
518
|
jsonrpc: Two,
|
|
425
519
|
method,
|
|
@@ -427,7 +521,7 @@ const create$4 = (method, params) => {
|
|
|
427
521
|
};
|
|
428
522
|
};
|
|
429
523
|
const callbacks = Object.create(null);
|
|
430
|
-
const set$
|
|
524
|
+
const set$6 = (id, fn) => {
|
|
431
525
|
callbacks[id] = fn;
|
|
432
526
|
};
|
|
433
527
|
const get$2 = id => {
|
|
@@ -436,9 +530,9 @@ const get$2 = id => {
|
|
|
436
530
|
const remove = id => {
|
|
437
531
|
delete callbacks[id];
|
|
438
532
|
};
|
|
439
|
-
let id = 0;
|
|
533
|
+
let id$1 = 0;
|
|
440
534
|
const create$3$1 = () => {
|
|
441
|
-
return ++id;
|
|
535
|
+
return ++id$1;
|
|
442
536
|
};
|
|
443
537
|
const registerPromise = () => {
|
|
444
538
|
const id = create$3$1();
|
|
@@ -446,7 +540,7 @@ const registerPromise = () => {
|
|
|
446
540
|
resolve,
|
|
447
541
|
promise
|
|
448
542
|
} = Promise.withResolvers();
|
|
449
|
-
set$
|
|
543
|
+
set$6(id, resolve);
|
|
450
544
|
return {
|
|
451
545
|
id,
|
|
452
546
|
promise
|
|
@@ -674,7 +768,7 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
674
768
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
675
769
|
return create$1$1(id, errorProperty);
|
|
676
770
|
};
|
|
677
|
-
const create$
|
|
771
|
+
const create$6 = (message, result) => {
|
|
678
772
|
return {
|
|
679
773
|
jsonrpc: Two,
|
|
680
774
|
id: message.id,
|
|
@@ -683,7 +777,7 @@ const create$5 = (message, result) => {
|
|
|
683
777
|
};
|
|
684
778
|
const getSuccessResponse = (message, result) => {
|
|
685
779
|
const resultProperty = result ?? null;
|
|
686
|
-
return create$
|
|
780
|
+
return create$6(message, resultProperty);
|
|
687
781
|
};
|
|
688
782
|
const getErrorResponseSimple = (id, error) => {
|
|
689
783
|
return {
|
|
@@ -788,13 +882,13 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
788
882
|
return unwrapJsonRpcResult(responseMessage);
|
|
789
883
|
};
|
|
790
884
|
const send = (transport, method, ...params) => {
|
|
791
|
-
const message = create$4(method, params);
|
|
885
|
+
const message = create$4$1(method, params);
|
|
792
886
|
transport.send(message);
|
|
793
887
|
};
|
|
794
|
-
const invoke$
|
|
888
|
+
const invoke$4 = (ipc, method, ...params) => {
|
|
795
889
|
return invokeHelper(ipc, method, params, false);
|
|
796
890
|
};
|
|
797
|
-
const invokeAndTransfer$
|
|
891
|
+
const invokeAndTransfer$2 = (ipc, method, ...params) => {
|
|
798
892
|
return invokeHelper(ipc, method, params, true);
|
|
799
893
|
};
|
|
800
894
|
|
|
@@ -830,10 +924,10 @@ const createRpc = ipc => {
|
|
|
830
924
|
send(ipc, method, ...params);
|
|
831
925
|
},
|
|
832
926
|
invoke(method, ...params) {
|
|
833
|
-
return invoke$
|
|
927
|
+
return invoke$4(ipc, method, ...params);
|
|
834
928
|
},
|
|
835
929
|
invokeAndTransfer(method, ...params) {
|
|
836
|
-
return invokeAndTransfer$
|
|
930
|
+
return invokeAndTransfer$2(ipc, method, ...params);
|
|
837
931
|
},
|
|
838
932
|
async dispose() {
|
|
839
933
|
await ipc?.dispose();
|
|
@@ -871,7 +965,41 @@ const listen$1 = async (module, options) => {
|
|
|
871
965
|
const ipc = module.wrap(rawIpc);
|
|
872
966
|
return ipc;
|
|
873
967
|
};
|
|
968
|
+
const create$5 = async ({
|
|
969
|
+
commandMap,
|
|
970
|
+
messagePort
|
|
971
|
+
}) => {
|
|
972
|
+
// TODO create a commandMap per rpc instance
|
|
973
|
+
register(commandMap);
|
|
974
|
+
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
975
|
+
messagePort,
|
|
976
|
+
isMessagePortOpen: true
|
|
977
|
+
});
|
|
978
|
+
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
979
|
+
handleIpc(ipc);
|
|
980
|
+
const rpc = createRpc(ipc);
|
|
981
|
+
messagePort.start();
|
|
982
|
+
return rpc;
|
|
983
|
+
};
|
|
874
984
|
const create$3 = async ({
|
|
985
|
+
commandMap,
|
|
986
|
+
send
|
|
987
|
+
}) => {
|
|
988
|
+
const {
|
|
989
|
+
port1,
|
|
990
|
+
port2
|
|
991
|
+
} = new MessageChannel();
|
|
992
|
+
await send(port1);
|
|
993
|
+
return create$5({
|
|
994
|
+
commandMap,
|
|
995
|
+
messagePort: port2
|
|
996
|
+
});
|
|
997
|
+
};
|
|
998
|
+
const TransferMessagePortRpcParent = {
|
|
999
|
+
__proto__: null,
|
|
1000
|
+
create: create$3
|
|
1001
|
+
};
|
|
1002
|
+
const create$4 = async ({
|
|
875
1003
|
commandMap
|
|
876
1004
|
}) => {
|
|
877
1005
|
// TODO create a commandMap per rpc instance
|
|
@@ -883,7 +1011,7 @@ const create$3 = async ({
|
|
|
883
1011
|
};
|
|
884
1012
|
const WebWorkerRpcClient = {
|
|
885
1013
|
__proto__: null,
|
|
886
|
-
create: create$
|
|
1014
|
+
create: create$4
|
|
887
1015
|
};
|
|
888
1016
|
const createMockRpc = ({
|
|
889
1017
|
commandMap
|
|
@@ -905,7 +1033,7 @@ const createMockRpc = ({
|
|
|
905
1033
|
return mockRpc;
|
|
906
1034
|
};
|
|
907
1035
|
|
|
908
|
-
const toCommandId
|
|
1036
|
+
const toCommandId = key => {
|
|
909
1037
|
const dotIndex = key.indexOf('.');
|
|
910
1038
|
return key.slice(dotIndex + 1);
|
|
911
1039
|
};
|
|
@@ -977,7 +1105,7 @@ const create$2 = () => {
|
|
|
977
1105
|
},
|
|
978
1106
|
getCommandIds() {
|
|
979
1107
|
const keys = Object.keys(commandMapRef);
|
|
980
|
-
const ids = keys.map(toCommandId
|
|
1108
|
+
const ids = keys.map(toCommandId);
|
|
981
1109
|
return ids;
|
|
982
1110
|
},
|
|
983
1111
|
registerCommands(commandMap) {
|
|
@@ -1017,11 +1145,35 @@ const SearchExtensionsInMarketplace = 'Search Extensions in Marketplace';
|
|
|
1017
1145
|
const ViewsAndMoreActions = 'Views and more Actions...';
|
|
1018
1146
|
const Extensions$2 = 'Extensions';
|
|
1019
1147
|
const Copy = 'Copy';
|
|
1020
|
-
const CopyExtensionId = '
|
|
1148
|
+
const CopyExtensionId = 'Copy Extension Id';
|
|
1149
|
+
const Name = 'Name';
|
|
1150
|
+
const Id$1 = 'Id';
|
|
1151
|
+
const Description = 'Description';
|
|
1152
|
+
const Version = 'Version';
|
|
1153
|
+
const Publisher = 'Publisher';
|
|
1154
|
+
const MarketplaceLink = 'Marketplace Link';
|
|
1021
1155
|
|
|
1022
1156
|
const noExtensionsFound = () => {
|
|
1023
1157
|
return i18nString(NoExtensionsFound);
|
|
1024
1158
|
};
|
|
1159
|
+
const name = () => {
|
|
1160
|
+
return i18nString(Name);
|
|
1161
|
+
};
|
|
1162
|
+
const id = () => {
|
|
1163
|
+
return i18nString(Id$1);
|
|
1164
|
+
};
|
|
1165
|
+
const version = () => {
|
|
1166
|
+
return i18nString(Version);
|
|
1167
|
+
};
|
|
1168
|
+
const description = () => {
|
|
1169
|
+
return i18nString(Description);
|
|
1170
|
+
};
|
|
1171
|
+
const publisher = () => {
|
|
1172
|
+
return i18nString(Publisher);
|
|
1173
|
+
};
|
|
1174
|
+
const marketplaceLink = () => {
|
|
1175
|
+
return i18nString(MarketplaceLink);
|
|
1176
|
+
};
|
|
1025
1177
|
const filter = () => {
|
|
1026
1178
|
return i18nString(Filter$1);
|
|
1027
1179
|
};
|
|
@@ -1046,7 +1198,7 @@ const installAnotherVersion = () => {
|
|
|
1046
1198
|
const copy = () => {
|
|
1047
1199
|
return i18nString(Copy);
|
|
1048
1200
|
};
|
|
1049
|
-
const copyExtensionId = () => {
|
|
1201
|
+
const copyExtensionId$1 = () => {
|
|
1050
1202
|
return i18nString(CopyExtensionId);
|
|
1051
1203
|
};
|
|
1052
1204
|
const searchExtensionsInMarketPlace = () => {
|
|
@@ -1134,12 +1286,12 @@ const parseValue = value => {
|
|
|
1134
1286
|
builtin = true;
|
|
1135
1287
|
}
|
|
1136
1288
|
if (match.startsWith(Sort)) {
|
|
1137
|
-
// TODO
|
|
1289
|
+
// TODO correcly parse sort order
|
|
1138
1290
|
sort = 'installs';
|
|
1139
1291
|
}
|
|
1140
1292
|
if (match.startsWith(Id)) {
|
|
1141
|
-
// TODO
|
|
1142
|
-
id = '
|
|
1293
|
+
// TODO improve parsing
|
|
1294
|
+
id = value.replace('@id:', '');
|
|
1143
1295
|
}
|
|
1144
1296
|
if (match.startsWith(Outdated)) {
|
|
1145
1297
|
outdated = true;
|
|
@@ -1169,6 +1321,9 @@ const matchesId = (extension, query) => {
|
|
|
1169
1321
|
return extensionIdLower.includes(query);
|
|
1170
1322
|
};
|
|
1171
1323
|
const matchesParsedValue = (extension, parsedValue) => {
|
|
1324
|
+
if (parsedValue.id && extension.id) {
|
|
1325
|
+
return parsedValue.id === extension.id;
|
|
1326
|
+
}
|
|
1172
1327
|
if (extension.name) {
|
|
1173
1328
|
return matchesName(extension, parsedValue.query);
|
|
1174
1329
|
}
|
|
@@ -1288,483 +1443,143 @@ const closeSuggest = state => {
|
|
|
1288
1443
|
return state;
|
|
1289
1444
|
};
|
|
1290
1445
|
|
|
1291
|
-
const
|
|
1292
|
-
get: get$1,
|
|
1293
|
-
set: set$3,
|
|
1294
|
-
dispose: dispose$2,
|
|
1295
|
-
wrapCommand,
|
|
1296
|
-
wrapGetter
|
|
1297
|
-
} = create$2();
|
|
1298
|
-
|
|
1299
|
-
const create$1 = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
1300
|
-
const state = {
|
|
1301
|
-
allExtensions: [],
|
|
1302
|
-
assetDir,
|
|
1303
|
-
deltaY: 0,
|
|
1304
|
-
finalDeltaY: 0,
|
|
1305
|
-
focus: 0,
|
|
1306
|
-
focused: false,
|
|
1307
|
-
focusedIndex: 0,
|
|
1308
|
-
handleOffset: 0,
|
|
1309
|
-
headerHeight: 41,
|
|
1310
|
-
height,
|
|
1311
|
-
inputActions: [],
|
|
1312
|
-
inputSource: 0,
|
|
1313
|
-
itemHeight: 72,
|
|
1314
|
-
items: [],
|
|
1315
|
-
maxLineY: 0,
|
|
1316
|
-
message: '',
|
|
1317
|
-
minimumSliderSize: 0,
|
|
1318
|
-
minLineY: 0,
|
|
1319
|
-
negativeMargin: 0,
|
|
1320
|
-
placeholder: '',
|
|
1321
|
-
platform,
|
|
1322
|
-
scrollBarActive: false,
|
|
1323
|
-
scrollBarHeight: 0,
|
|
1324
|
-
scrollBarY: 0,
|
|
1325
|
-
searchValue: '',
|
|
1326
|
-
size: 0,
|
|
1327
|
-
uid: id,
|
|
1328
|
-
width,
|
|
1329
|
-
x,
|
|
1330
|
-
y
|
|
1331
|
-
};
|
|
1332
|
-
set$3(id, state, state);
|
|
1333
|
-
};
|
|
1446
|
+
const None$2 = 'none';
|
|
1334
1447
|
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
};
|
|
1448
|
+
const Button$2 = 1;
|
|
1449
|
+
const Div = 4;
|
|
1450
|
+
const Input = 6;
|
|
1451
|
+
const Text = 12;
|
|
1452
|
+
const Img = 17;
|
|
1341
1453
|
|
|
1342
|
-
const
|
|
1343
|
-
|
|
1344
|
-
|
|
1454
|
+
const Button$1 = 'event.button';
|
|
1455
|
+
const ClientX = 'event.clientX';
|
|
1456
|
+
const ClientY = 'event.clientY';
|
|
1457
|
+
const DeltaMode = 'event.deltaMode';
|
|
1458
|
+
const DeltaY = 'event.deltaY';
|
|
1459
|
+
const TargetValue = 'event.target.value';
|
|
1345
1460
|
|
|
1346
|
-
const
|
|
1347
|
-
return newState.inputSource === User || oldState.searchValue === newState.searchValue;
|
|
1348
|
-
};
|
|
1461
|
+
const LeftClick = 0;
|
|
1349
1462
|
|
|
1350
|
-
const
|
|
1351
|
-
const
|
|
1352
|
-
const
|
|
1353
|
-
const RenderScrollBar = 5;
|
|
1354
|
-
const RenderMessage = 6;
|
|
1355
|
-
const RenderSearchValue = 7;
|
|
1356
|
-
const RenderFocusContext = 8;
|
|
1463
|
+
const DebugWorker = 55;
|
|
1464
|
+
const ExtensionHostWorker = 44;
|
|
1465
|
+
const RendererWorker$1 = 1;
|
|
1357
1466
|
|
|
1358
|
-
const
|
|
1359
|
-
const
|
|
1467
|
+
const rpcs = Object.create(null);
|
|
1468
|
+
const set$5 = (id, rpc) => {
|
|
1469
|
+
rpcs[id] = rpc;
|
|
1470
|
+
};
|
|
1471
|
+
const get$1 = id => {
|
|
1472
|
+
return rpcs[id];
|
|
1473
|
+
};
|
|
1360
1474
|
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1475
|
+
const create$1 = rpcId => {
|
|
1476
|
+
return {
|
|
1477
|
+
// @ts-ignore
|
|
1478
|
+
invoke(method, ...params) {
|
|
1479
|
+
const rpc = get$1(rpcId);
|
|
1480
|
+
// @ts-ignore
|
|
1481
|
+
return rpc.invoke(method, ...params);
|
|
1482
|
+
},
|
|
1483
|
+
// @ts-ignore
|
|
1484
|
+
invokeAndTransfer(method, ...params) {
|
|
1485
|
+
const rpc = get$1(rpcId);
|
|
1486
|
+
// @ts-ignore
|
|
1487
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1488
|
+
},
|
|
1489
|
+
set(rpc) {
|
|
1490
|
+
set$5(rpcId, rpc);
|
|
1491
|
+
},
|
|
1492
|
+
async dispose() {
|
|
1493
|
+
const rpc = get$1(rpcId);
|
|
1494
|
+
await rpc.dispose();
|
|
1371
1495
|
}
|
|
1372
|
-
}
|
|
1373
|
-
return diffResult;
|
|
1496
|
+
};
|
|
1374
1497
|
};
|
|
1375
1498
|
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1499
|
+
const {
|
|
1500
|
+
invoke: invoke$3,
|
|
1501
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1502
|
+
set: set$4,
|
|
1503
|
+
dispose: dispose$3
|
|
1504
|
+
} = create$1(ExtensionHostWorker);
|
|
1505
|
+
const executeReferenceProvider = async (id, offset) => {
|
|
1506
|
+
// @ts-ignore
|
|
1507
|
+
return invoke$3('ExtensionHostReference.executeReferenceProvider', id, offset);
|
|
1508
|
+
};
|
|
1509
|
+
const executeFileReferenceProvider = async id => {
|
|
1510
|
+
// @ts-ignore
|
|
1511
|
+
return invoke$3('ExtensionHostReference.executeFileReferenceProvider', id);
|
|
1512
|
+
};
|
|
1513
|
+
const getRuntimeStatus = async extensionId => {
|
|
1514
|
+
// @ts-ignore
|
|
1515
|
+
return invoke$3('ExtensionHost.getRuntimeStatus', extensionId);
|
|
1516
|
+
};
|
|
1517
|
+
const registerMockRpc$1 = commandMap => {
|
|
1518
|
+
const mockRpc = createMockRpc({
|
|
1519
|
+
commandMap
|
|
1520
|
+
});
|
|
1521
|
+
set$4(mockRpc);
|
|
1522
|
+
return mockRpc;
|
|
1378
1523
|
};
|
|
1379
1524
|
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1525
|
+
const ExtensionHost = {
|
|
1526
|
+
__proto__: null,
|
|
1527
|
+
dispose: dispose$3,
|
|
1528
|
+
executeFileReferenceProvider,
|
|
1529
|
+
executeReferenceProvider,
|
|
1530
|
+
getRuntimeStatus,
|
|
1531
|
+
invoke: invoke$3,
|
|
1532
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1533
|
+
registerMockRpc: registerMockRpc$1,
|
|
1534
|
+
set: set$4
|
|
1385
1535
|
};
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1536
|
+
|
|
1537
|
+
const {
|
|
1538
|
+
invoke: invoke$2,
|
|
1539
|
+
invokeAndTransfer,
|
|
1540
|
+
set: set$3,
|
|
1541
|
+
dispose: dispose$2
|
|
1542
|
+
} = create$1(RendererWorker$1);
|
|
1543
|
+
const searchFileHtml = async uri => {
|
|
1544
|
+
return invoke$2('ExtensionHost.searchFileWithHtml', uri);
|
|
1389
1545
|
};
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1392
|
-
const {
|
|
1393
|
-
finalDeltaY,
|
|
1394
|
-
height,
|
|
1395
|
-
headerHeight,
|
|
1396
|
-
scrollBarHeight
|
|
1397
|
-
} = state;
|
|
1398
|
-
const newMaxLineY = Math.min(index + 1, itemsLength);
|
|
1399
|
-
const fittingItems = getNumberOfVisibleItems(listHeight, itemHeight);
|
|
1400
|
-
const newMinLineY = Math.max(newMaxLineY - fittingItems, 0);
|
|
1401
|
-
const newDeltaY = itemsLength < fittingItems ? 0 : newMinLineY * itemHeight - listHeight % itemHeight + itemHeight;
|
|
1402
|
-
const scrollBarY = getScrollBarY(newDeltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
|
|
1403
|
-
return {
|
|
1404
|
-
...state,
|
|
1405
|
-
focusedIndex: index,
|
|
1406
|
-
minLineY: newMinLineY,
|
|
1407
|
-
maxLineY: newMaxLineY,
|
|
1408
|
-
focused: true,
|
|
1409
|
-
deltaY: newDeltaY,
|
|
1410
|
-
scrollBarY
|
|
1411
|
-
};
|
|
1546
|
+
const getFilePathElectron = async file => {
|
|
1547
|
+
return invoke$2('FileSystemHandle.getFilePathElectron', file);
|
|
1412
1548
|
};
|
|
1413
|
-
const
|
|
1414
|
-
|
|
1415
|
-
finalDeltaY,
|
|
1416
|
-
height,
|
|
1417
|
-
headerHeight,
|
|
1418
|
-
scrollBarHeight
|
|
1419
|
-
} = state;
|
|
1420
|
-
const newMinLineY = index;
|
|
1421
|
-
const fittingItems = getNumberOfVisibleItems(listHeight, itemHeight);
|
|
1422
|
-
const newMaxLineY = Math.min(newMinLineY + fittingItems, itemsLength);
|
|
1423
|
-
const newDeltaY = newMinLineY * itemHeight;
|
|
1424
|
-
const scrollBarY = getScrollBarY(newDeltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
|
|
1425
|
-
return {
|
|
1426
|
-
...state,
|
|
1427
|
-
focusedIndex: index,
|
|
1428
|
-
minLineY: newMinLineY,
|
|
1429
|
-
maxLineY: newMaxLineY,
|
|
1430
|
-
focused: true,
|
|
1431
|
-
deltaY: newDeltaY,
|
|
1432
|
-
scrollBarY
|
|
1433
|
-
};
|
|
1434
|
-
};
|
|
1435
|
-
const focusIndex = (state, index) => {
|
|
1436
|
-
const {
|
|
1437
|
-
itemHeight,
|
|
1438
|
-
minLineY,
|
|
1439
|
-
maxLineY,
|
|
1440
|
-
headerHeight,
|
|
1441
|
-
height,
|
|
1442
|
-
items
|
|
1443
|
-
} = state;
|
|
1444
|
-
const itemsLength = items.length;
|
|
1445
|
-
if (itemsLength === 0) {
|
|
1446
|
-
return state;
|
|
1447
|
-
}
|
|
1448
|
-
number(itemHeight);
|
|
1449
|
-
if (index === -1) {
|
|
1450
|
-
return {
|
|
1451
|
-
...state,
|
|
1452
|
-
focusedIndex: -1,
|
|
1453
|
-
focused: true
|
|
1454
|
-
};
|
|
1455
|
-
}
|
|
1456
|
-
const listHeight = height - headerHeight;
|
|
1457
|
-
if (index < minLineY + 1) {
|
|
1458
|
-
return focusIndexScrollUp(state, index, listHeight, itemHeight, itemsLength);
|
|
1459
|
-
}
|
|
1460
|
-
if (index >= maxLineY - 1) {
|
|
1461
|
-
return focusIndexScrollDown(state, index, listHeight, itemHeight, itemsLength);
|
|
1462
|
-
}
|
|
1463
|
-
return {
|
|
1464
|
-
...state,
|
|
1465
|
-
focusedIndex: index,
|
|
1466
|
-
focused: true
|
|
1467
|
-
};
|
|
1468
|
-
};
|
|
1469
|
-
const first = () => {
|
|
1470
|
-
return 0;
|
|
1471
|
-
};
|
|
1472
|
-
const last = items => {
|
|
1473
|
-
return items.length - 1;
|
|
1474
|
-
};
|
|
1475
|
-
const next = (items, index) => {
|
|
1476
|
-
return (index + 1) % items.length;
|
|
1477
|
-
};
|
|
1478
|
-
const previous = (items, index) => {
|
|
1479
|
-
return index === 0 ? items.length - 1 : index - 1;
|
|
1480
|
-
};
|
|
1481
|
-
const focusFirst = state => {
|
|
1482
|
-
const firstIndex = first();
|
|
1483
|
-
return focusIndex(state, firstIndex);
|
|
1484
|
-
};
|
|
1485
|
-
const focusLast = state => {
|
|
1486
|
-
const {
|
|
1487
|
-
items
|
|
1488
|
-
} = state;
|
|
1489
|
-
const lastIndex = last(items);
|
|
1490
|
-
return focusIndex(state, lastIndex);
|
|
1491
|
-
};
|
|
1492
|
-
const focusNext = state => {
|
|
1493
|
-
const {
|
|
1494
|
-
focusedIndex,
|
|
1495
|
-
items
|
|
1496
|
-
} = state;
|
|
1497
|
-
const nextIndex = next(items, focusedIndex);
|
|
1498
|
-
return focusIndex(state, nextIndex);
|
|
1499
|
-
};
|
|
1500
|
-
|
|
1501
|
-
// based on https://github.com/microsoft/vscode/blob/c0769274fa136b45799edeccc0d0a2f645b75caf/src/vs/base/common/arrays.ts#L625 (License MIT)
|
|
1502
|
-
|
|
1503
|
-
const isLastIndex = (array, index) => {
|
|
1504
|
-
return index === array.length - 1;
|
|
1505
|
-
};
|
|
1506
|
-
const lastIndex = array => {
|
|
1507
|
-
return array.length - 1;
|
|
1508
|
-
};
|
|
1509
|
-
const focusNextPage = state => {
|
|
1510
|
-
const {
|
|
1511
|
-
focusedIndex,
|
|
1512
|
-
items,
|
|
1513
|
-
maxLineY,
|
|
1514
|
-
minLineY
|
|
1515
|
-
} = state;
|
|
1516
|
-
if (isLastIndex(items, focusedIndex)) {
|
|
1517
|
-
return state;
|
|
1518
|
-
}
|
|
1519
|
-
const indexNextPage = Math.min(maxLineY + (maxLineY - minLineY) - 2, lastIndex(items));
|
|
1520
|
-
return focusIndex(state, indexNextPage);
|
|
1521
|
-
};
|
|
1522
|
-
const focusPrevious = state => {
|
|
1523
|
-
const {
|
|
1524
|
-
focusedIndex,
|
|
1525
|
-
items
|
|
1526
|
-
} = state;
|
|
1527
|
-
if (focusedIndex === 0 || focusedIndex === -1) {
|
|
1528
|
-
return state;
|
|
1529
|
-
}
|
|
1530
|
-
const previousIndex = previous(items, focusedIndex);
|
|
1531
|
-
return focusIndex(state, previousIndex);
|
|
1532
|
-
};
|
|
1533
|
-
const focusPreviousPage = state => {
|
|
1534
|
-
const {
|
|
1535
|
-
focusedIndex,
|
|
1536
|
-
minLineY,
|
|
1537
|
-
maxLineY
|
|
1538
|
-
} = state;
|
|
1539
|
-
if (focusedIndex === 0 || focusedIndex === -1) {
|
|
1540
|
-
return state;
|
|
1541
|
-
}
|
|
1542
|
-
const indexPreviousPage = Math.max(minLineY - (maxLineY - minLineY) + 1, 0);
|
|
1543
|
-
return focusIndex(state, indexPreviousPage);
|
|
1544
|
-
};
|
|
1545
|
-
|
|
1546
|
-
const Button$1 = 1;
|
|
1547
|
-
|
|
1548
|
-
const ClearAll = 'ClearAll';
|
|
1549
|
-
const Filter = 'Filter';
|
|
1550
|
-
const Refresh = 'Refresh';
|
|
1551
|
-
const Ellipsis = 'Ellipsis';
|
|
1552
|
-
|
|
1553
|
-
const getActions = () => {
|
|
1554
|
-
return [{
|
|
1555
|
-
type: Button$1,
|
|
1556
|
-
id: refresh(),
|
|
1557
|
-
icon: Refresh,
|
|
1558
|
-
command: ''
|
|
1559
|
-
}, {
|
|
1560
|
-
type: Button$1,
|
|
1561
|
-
id: viewsAndMoreActions(),
|
|
1562
|
-
icon: Ellipsis,
|
|
1563
|
-
command: ''
|
|
1564
|
-
}];
|
|
1565
|
-
};
|
|
1566
|
-
|
|
1567
|
-
const commandMapRef = {};
|
|
1568
|
-
|
|
1569
|
-
const toCommandId = key => {
|
|
1570
|
-
const dotIndex = key.indexOf('.');
|
|
1571
|
-
return key.slice(dotIndex + 1);
|
|
1572
|
-
};
|
|
1573
|
-
const getCommandIds = () => {
|
|
1574
|
-
const keys = Object.keys(commandMapRef);
|
|
1575
|
-
const ids = keys.map(toCommandId);
|
|
1576
|
-
return ids;
|
|
1577
|
-
};
|
|
1578
|
-
|
|
1579
|
-
const Enter = 3;
|
|
1580
|
-
const Space = 9;
|
|
1581
|
-
const PageUp = 10;
|
|
1582
|
-
const PageDown = 11;
|
|
1583
|
-
const End = 255;
|
|
1584
|
-
const Home = 12;
|
|
1585
|
-
const UpArrow = 14;
|
|
1586
|
-
const DownArrow = 16;
|
|
1587
|
-
|
|
1588
|
-
const CtrlCmd = 1 << 11 >>> 0;
|
|
1589
|
-
|
|
1590
|
-
const FocusExtensions = 15;
|
|
1591
|
-
const FocusExtensionsInput = 7000;
|
|
1592
|
-
|
|
1593
|
-
const getKeyBindings$1 = () => {
|
|
1594
|
-
return [{
|
|
1595
|
-
key: Home,
|
|
1596
|
-
command: 'Extensions.focusFirst',
|
|
1597
|
-
when: FocusExtensions
|
|
1598
|
-
}, {
|
|
1599
|
-
key: End,
|
|
1600
|
-
command: 'Extensions.focusLast',
|
|
1601
|
-
when: FocusExtensions
|
|
1602
|
-
}, {
|
|
1603
|
-
key: PageUp,
|
|
1604
|
-
command: 'Extensions.focusPreviousPage',
|
|
1605
|
-
when: FocusExtensions
|
|
1606
|
-
}, {
|
|
1607
|
-
key: PageDown,
|
|
1608
|
-
command: 'Extensions.focusNextPage',
|
|
1609
|
-
when: FocusExtensions
|
|
1610
|
-
}, {
|
|
1611
|
-
key: UpArrow,
|
|
1612
|
-
command: 'Extensions.focusPrevious',
|
|
1613
|
-
when: FocusExtensions
|
|
1614
|
-
}, {
|
|
1615
|
-
key: DownArrow,
|
|
1616
|
-
command: 'Extensions.focusNext',
|
|
1617
|
-
when: FocusExtensions
|
|
1618
|
-
}, {
|
|
1619
|
-
key: Space,
|
|
1620
|
-
command: 'Extensions.handleClickCurrentButKeepFocus',
|
|
1621
|
-
when: FocusExtensions
|
|
1622
|
-
}, {
|
|
1623
|
-
key: Enter,
|
|
1624
|
-
command: 'Extensions.handleClickCurrent',
|
|
1625
|
-
when: FocusExtensions
|
|
1626
|
-
}, {
|
|
1627
|
-
key: CtrlCmd | Space,
|
|
1628
|
-
command: 'Extensions.toggleSuggest',
|
|
1629
|
-
when: FocusExtensions
|
|
1630
|
-
}, {
|
|
1631
|
-
key: CtrlCmd | DownArrow,
|
|
1632
|
-
command: 'Extensions.scrollDown',
|
|
1633
|
-
when: FocusExtensions
|
|
1634
|
-
}];
|
|
1635
|
-
};
|
|
1636
|
-
|
|
1637
|
-
const None$2 = 0;
|
|
1638
|
-
|
|
1639
|
-
const getMenuEntries = () => {
|
|
1640
|
-
return [{
|
|
1641
|
-
id: 'enable',
|
|
1642
|
-
label: enable(),
|
|
1643
|
-
flags: None$2,
|
|
1644
|
-
command: 'SearchExtensions.enable'
|
|
1645
|
-
}, {
|
|
1646
|
-
id: 'disable',
|
|
1647
|
-
label: disable(),
|
|
1648
|
-
flags: None$2,
|
|
1649
|
-
command: 'SearchExtensions.disable'
|
|
1650
|
-
}, {
|
|
1651
|
-
id: 'installAnotherVersion',
|
|
1652
|
-
label: installAnotherVersion(),
|
|
1653
|
-
flags: None$2,
|
|
1654
|
-
command: 'SearchExtensions.installAnotherVersion'
|
|
1655
|
-
}, {
|
|
1656
|
-
id: 'copy',
|
|
1657
|
-
label: copy(),
|
|
1658
|
-
flags: None$2,
|
|
1659
|
-
command: 'SearchExtensions.copy'
|
|
1660
|
-
}, {
|
|
1661
|
-
id: 'copyExtensionId',
|
|
1662
|
-
label: copyExtensionId(),
|
|
1663
|
-
flags: None$2,
|
|
1664
|
-
command: 'SearchExtensions.copyExtensionId'
|
|
1665
|
-
}];
|
|
1666
|
-
};
|
|
1667
|
-
|
|
1668
|
-
const handleBlur = state => {
|
|
1669
|
-
return {
|
|
1670
|
-
...state,
|
|
1671
|
-
focus: None$3
|
|
1672
|
-
};
|
|
1673
|
-
};
|
|
1674
|
-
|
|
1675
|
-
const getExtensionDetailUri = extensionId => {
|
|
1676
|
-
return `extension-detail://${extensionId}`;
|
|
1677
|
-
};
|
|
1678
|
-
|
|
1679
|
-
const None$1 = 'none';
|
|
1680
|
-
|
|
1681
|
-
const Button = 1;
|
|
1682
|
-
const Div = 4;
|
|
1683
|
-
const Input = 6;
|
|
1684
|
-
const Text = 12;
|
|
1685
|
-
const Img = 17;
|
|
1686
|
-
|
|
1687
|
-
const DebugWorker = 55;
|
|
1688
|
-
const RendererWorker$1 = 1;
|
|
1689
|
-
|
|
1690
|
-
const rpcs = Object.create(null);
|
|
1691
|
-
const set$2 = (id, rpc) => {
|
|
1692
|
-
rpcs[id] = rpc;
|
|
1693
|
-
};
|
|
1694
|
-
const get = id => {
|
|
1695
|
-
return rpcs[id];
|
|
1696
|
-
};
|
|
1697
|
-
|
|
1698
|
-
const create = rpcId => {
|
|
1699
|
-
return {
|
|
1700
|
-
// @ts-ignore
|
|
1701
|
-
invoke(method, ...params) {
|
|
1702
|
-
const rpc = get(rpcId);
|
|
1703
|
-
// @ts-ignore
|
|
1704
|
-
return rpc.invoke(method, ...params);
|
|
1705
|
-
},
|
|
1706
|
-
// @ts-ignore
|
|
1707
|
-
invokeAndTransfer(method, ...params) {
|
|
1708
|
-
const rpc = get(rpcId);
|
|
1709
|
-
// @ts-ignore
|
|
1710
|
-
return rpc.invokeAndTransfer(method, ...params);
|
|
1711
|
-
},
|
|
1712
|
-
set(rpc) {
|
|
1713
|
-
set$2(rpcId, rpc);
|
|
1714
|
-
},
|
|
1715
|
-
async dispose() {
|
|
1716
|
-
const rpc = get(rpcId);
|
|
1717
|
-
await rpc.dispose();
|
|
1718
|
-
}
|
|
1719
|
-
};
|
|
1720
|
-
};
|
|
1721
|
-
|
|
1722
|
-
const {
|
|
1723
|
-
invoke: invoke$1,
|
|
1724
|
-
invokeAndTransfer,
|
|
1725
|
-
set: set$1,
|
|
1726
|
-
dispose
|
|
1727
|
-
} = create(RendererWorker$1);
|
|
1728
|
-
const searchFileHtml = async uri => {
|
|
1729
|
-
return invoke$1('ExtensionHost.searchFileWithHtml', uri);
|
|
1730
|
-
};
|
|
1731
|
-
const getFilePathElectron = async file => {
|
|
1732
|
-
return invoke$1('FileSystemHandle.getFilePathElectron', file);
|
|
1733
|
-
};
|
|
1734
|
-
const showContextMenu$1 = async (x, y, id, ...args) => {
|
|
1735
|
-
return invoke$1('ContextMenu.show', x, y, id, ...args);
|
|
1549
|
+
const showContextMenu$1 = async (x, y, id, ...args) => {
|
|
1550
|
+
return invoke$2('ContextMenu.show', x, y, id, ...args);
|
|
1736
1551
|
};
|
|
1737
1552
|
const getElectronVersion = async () => {
|
|
1738
|
-
return invoke$
|
|
1553
|
+
return invoke$2('Process.getElectronVersion');
|
|
1739
1554
|
};
|
|
1740
1555
|
const applyBulkReplacement = async bulkEdits => {
|
|
1741
|
-
await invoke$
|
|
1556
|
+
await invoke$2('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1742
1557
|
};
|
|
1743
1558
|
const setColorTheme = async id => {
|
|
1744
1559
|
// @ts-ignore
|
|
1745
|
-
return invoke$
|
|
1560
|
+
return invoke$2(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1746
1561
|
};
|
|
1747
1562
|
const getNodeVersion = async () => {
|
|
1748
|
-
return invoke$
|
|
1563
|
+
return invoke$2('Process.getNodeVersion');
|
|
1749
1564
|
};
|
|
1750
1565
|
const getChromeVersion = async () => {
|
|
1751
|
-
return invoke$
|
|
1566
|
+
return invoke$2('Process.getChromeVersion');
|
|
1752
1567
|
};
|
|
1753
1568
|
const getV8Version = async () => {
|
|
1754
|
-
return invoke$
|
|
1569
|
+
return invoke$2('Process.getV8Version');
|
|
1755
1570
|
};
|
|
1756
1571
|
const getFileHandles = async fileIds => {
|
|
1757
|
-
const files = await invoke$
|
|
1572
|
+
const files = await invoke$2('FileSystemHandle.getFileHandles', fileIds);
|
|
1758
1573
|
return files;
|
|
1759
1574
|
};
|
|
1760
1575
|
const setWorkspacePath = async path => {
|
|
1761
|
-
await invoke$
|
|
1576
|
+
await invoke$2('Workspace.setPath', path);
|
|
1762
1577
|
};
|
|
1763
1578
|
const registerWebViewInterceptor = async (id, port) => {
|
|
1764
1579
|
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
1765
1580
|
};
|
|
1766
1581
|
const unregisterWebViewInterceptor = async id => {
|
|
1767
|
-
await invoke$
|
|
1582
|
+
await invoke$2('WebView.unregisterInterceptor', id);
|
|
1768
1583
|
};
|
|
1769
1584
|
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1770
1585
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
@@ -1792,43 +1607,43 @@ const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
|
1792
1607
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1793
1608
|
};
|
|
1794
1609
|
const readFile = async uri => {
|
|
1795
|
-
return invoke$
|
|
1610
|
+
return invoke$2('FileSystem.readFile', uri);
|
|
1796
1611
|
};
|
|
1797
1612
|
const getWebViewSecret = async key => {
|
|
1798
1613
|
// @ts-ignore
|
|
1799
|
-
return invoke$
|
|
1614
|
+
return invoke$2('WebView.getSecret', key);
|
|
1800
1615
|
};
|
|
1801
1616
|
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1802
1617
|
return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
|
|
1803
1618
|
};
|
|
1804
1619
|
const setFocus = key => {
|
|
1805
|
-
return invoke$
|
|
1620
|
+
return invoke$2('Focus.setFocus', key);
|
|
1806
1621
|
};
|
|
1807
1622
|
const getFileIcon = async options => {
|
|
1808
|
-
return invoke$
|
|
1623
|
+
return invoke$2('IconTheme.getFileIcon', options);
|
|
1809
1624
|
};
|
|
1810
1625
|
const getColorThemeNames = async () => {
|
|
1811
|
-
return invoke$
|
|
1626
|
+
return invoke$2('ColorTheme.getColorThemeNames');
|
|
1812
1627
|
};
|
|
1813
1628
|
const disableExtension = async id => {
|
|
1814
1629
|
// @ts-ignore
|
|
1815
|
-
return invoke$
|
|
1630
|
+
return invoke$2('ExtensionManagement.disable', id);
|
|
1816
1631
|
};
|
|
1817
1632
|
const enableExtension = async id => {
|
|
1818
1633
|
// @ts-ignore
|
|
1819
|
-
return invoke$
|
|
1634
|
+
return invoke$2('ExtensionManagement.enable', id);
|
|
1820
1635
|
};
|
|
1821
1636
|
const handleDebugChange = async params => {
|
|
1822
1637
|
// @ts-ignore
|
|
1823
|
-
return invoke$
|
|
1638
|
+
return invoke$2('Run And Debug.handleChange', params);
|
|
1824
1639
|
};
|
|
1825
1640
|
const getFolderIcon = async options => {
|
|
1826
|
-
return invoke$
|
|
1641
|
+
return invoke$2('IconTheme.getFolderIcon', options);
|
|
1827
1642
|
};
|
|
1828
1643
|
const closeWidget = async widgetId => {
|
|
1829
|
-
return invoke$
|
|
1644
|
+
return invoke$2('Viewlet.closeWidget', widgetId);
|
|
1830
1645
|
};
|
|
1831
|
-
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
1646
|
+
const sendMessagePortToExtensionHostWorker$2 = async (port, rpcId = 0) => {
|
|
1832
1647
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1833
1648
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1834
1649
|
};
|
|
@@ -1837,55 +1652,55 @@ const sendMessagePortToSearchProcess = async port => {
|
|
|
1837
1652
|
};
|
|
1838
1653
|
const confirm = async (message, options) => {
|
|
1839
1654
|
// @ts-ignore
|
|
1840
|
-
const result = await invoke$
|
|
1655
|
+
const result = await invoke$2('ConfirmPrompt.prompt', message, options);
|
|
1841
1656
|
return result;
|
|
1842
1657
|
};
|
|
1843
1658
|
const getRecentlyOpened = async () => {
|
|
1844
|
-
return invoke$
|
|
1659
|
+
return invoke$2(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1845
1660
|
};
|
|
1846
|
-
const getKeyBindings = async () => {
|
|
1847
|
-
return invoke$
|
|
1661
|
+
const getKeyBindings$1 = async () => {
|
|
1662
|
+
return invoke$2('KeyBindingsInitial.getKeyBindings');
|
|
1848
1663
|
};
|
|
1849
1664
|
const writeClipBoardText = async text => {
|
|
1850
|
-
await invoke$
|
|
1665
|
+
await invoke$2('ClipBoard.writeText', /* text */text);
|
|
1851
1666
|
};
|
|
1852
1667
|
const writeClipBoardImage = async blob => {
|
|
1853
1668
|
// @ts-ignore
|
|
1854
|
-
await invoke$
|
|
1669
|
+
await invoke$2('ClipBoard.writeImage', /* text */blob);
|
|
1855
1670
|
};
|
|
1856
1671
|
const searchFileMemory = async uri => {
|
|
1857
1672
|
// @ts-ignore
|
|
1858
|
-
return invoke$
|
|
1673
|
+
return invoke$2('ExtensionHost.searchFileWithMemory', uri);
|
|
1859
1674
|
};
|
|
1860
1675
|
const searchFileFetch = async uri => {
|
|
1861
|
-
return invoke$
|
|
1676
|
+
return invoke$2('ExtensionHost.searchFileWithFetch', uri);
|
|
1862
1677
|
};
|
|
1863
1678
|
const showMessageBox = async options => {
|
|
1864
|
-
return invoke$
|
|
1679
|
+
return invoke$2('ElectronDialog.showMessageBox', options);
|
|
1865
1680
|
};
|
|
1866
1681
|
const handleDebugResumed = async params => {
|
|
1867
|
-
await invoke$
|
|
1682
|
+
await invoke$2('Run And Debug.handleResumed', params);
|
|
1868
1683
|
};
|
|
1869
1684
|
const openWidget = async name => {
|
|
1870
|
-
await invoke$
|
|
1685
|
+
await invoke$2('Viewlet.openWidget', name);
|
|
1871
1686
|
};
|
|
1872
1687
|
const getIcons = async requests => {
|
|
1873
|
-
const icons = await invoke$
|
|
1688
|
+
const icons = await invoke$2('IconTheme.getIcons', requests);
|
|
1874
1689
|
return icons;
|
|
1875
1690
|
};
|
|
1876
1691
|
const activateByEvent = event => {
|
|
1877
|
-
return invoke$
|
|
1692
|
+
return invoke$2('ExtensionHostManagement.activateByEvent', event);
|
|
1878
1693
|
};
|
|
1879
1694
|
const setAdditionalFocus = focusKey => {
|
|
1880
1695
|
// @ts-ignore
|
|
1881
|
-
return invoke$
|
|
1696
|
+
return invoke$2('Focus.setAdditionalFocus', focusKey);
|
|
1882
1697
|
};
|
|
1883
1698
|
const getActiveEditorId = () => {
|
|
1884
1699
|
// @ts-ignore
|
|
1885
|
-
return invoke$
|
|
1700
|
+
return invoke$2('GetActiveEditor.getActiveEditorId');
|
|
1886
1701
|
};
|
|
1887
1702
|
const getWorkspacePath = () => {
|
|
1888
|
-
return invoke$
|
|
1703
|
+
return invoke$2('Workspace.getPath');
|
|
1889
1704
|
};
|
|
1890
1705
|
const sendMessagePortToRendererProcess = async port => {
|
|
1891
1706
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
@@ -1893,20 +1708,20 @@ const sendMessagePortToRendererProcess = async port => {
|
|
|
1893
1708
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1894
1709
|
};
|
|
1895
1710
|
const getPreference = async key => {
|
|
1896
|
-
return await invoke$
|
|
1711
|
+
return await invoke$2('Preferences.get', key);
|
|
1897
1712
|
};
|
|
1898
1713
|
const getAllExtensions$2 = async () => {
|
|
1899
|
-
return invoke$
|
|
1714
|
+
return invoke$2('ExtensionManagement.getAllExtensions');
|
|
1900
1715
|
};
|
|
1901
1716
|
const rerenderEditor = async key => {
|
|
1902
1717
|
// @ts-ignore
|
|
1903
|
-
return invoke$
|
|
1718
|
+
return invoke$2('Editor.rerender', key);
|
|
1904
1719
|
};
|
|
1905
1720
|
const handleDebugPaused = async params => {
|
|
1906
|
-
await invoke$
|
|
1721
|
+
await invoke$2('Run And Debug.handlePaused', params);
|
|
1907
1722
|
};
|
|
1908
1723
|
const openUri$2 = async (uri, focus, options) => {
|
|
1909
|
-
await invoke$
|
|
1724
|
+
await invoke$2('Main.openUri', uri, focus, options);
|
|
1910
1725
|
};
|
|
1911
1726
|
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
1912
1727
|
await invokeAndTransfer(
|
|
@@ -1914,171 +1729,620 @@ const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
|
1914
1729
|
'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
1915
1730
|
};
|
|
1916
1731
|
const handleDebugScriptParsed = async script => {
|
|
1917
|
-
await invoke$
|
|
1732
|
+
await invoke$2('Run And Debug.handleScriptParsed', script);
|
|
1918
1733
|
};
|
|
1919
1734
|
const getWindowId = async () => {
|
|
1920
|
-
return invoke$
|
|
1735
|
+
return invoke$2('GetWindowId.getWindowId');
|
|
1921
1736
|
};
|
|
1922
1737
|
const getBlob = async uri => {
|
|
1923
1738
|
// @ts-ignore
|
|
1924
|
-
return invoke$
|
|
1739
|
+
return invoke$2('FileSystem.getBlob', uri);
|
|
1925
1740
|
};
|
|
1926
1741
|
const getExtensionCommands = async () => {
|
|
1927
|
-
return invoke$
|
|
1742
|
+
return invoke$2('ExtensionHost.getCommands');
|
|
1928
1743
|
};
|
|
1929
1744
|
const showErrorDialog = async errorInfo => {
|
|
1930
1745
|
// @ts-ignore
|
|
1931
|
-
await invoke$
|
|
1746
|
+
await invoke$2('ErrorHandling.showErrorDialog', errorInfo);
|
|
1932
1747
|
};
|
|
1933
1748
|
const getFolderSize = async uri => {
|
|
1934
1749
|
// @ts-ignore
|
|
1935
|
-
return await invoke$
|
|
1750
|
+
return await invoke$2('FileSystem.getFolderSize', uri);
|
|
1936
1751
|
};
|
|
1937
1752
|
const getExtension = async id => {
|
|
1938
1753
|
// @ts-ignore
|
|
1939
|
-
return invoke$
|
|
1754
|
+
return invoke$2('ExtensionManagement.getExtension', id);
|
|
1940
1755
|
};
|
|
1941
1756
|
const getMarkdownDom = async html => {
|
|
1942
1757
|
// @ts-ignore
|
|
1943
|
-
return invoke$
|
|
1758
|
+
return invoke$2('Markdown.getVirtualDom', html);
|
|
1944
1759
|
};
|
|
1945
1760
|
const renderMarkdown = async (markdown, options) => {
|
|
1946
1761
|
// @ts-ignore
|
|
1947
|
-
return invoke$
|
|
1762
|
+
return invoke$2('Markdown.renderMarkdown', markdown, options);
|
|
1948
1763
|
};
|
|
1949
1764
|
const openNativeFolder = async uri => {
|
|
1950
1765
|
// @ts-ignore
|
|
1951
|
-
await invoke$
|
|
1766
|
+
await invoke$2('OpenNativeFolder.openNativeFolder', uri);
|
|
1952
1767
|
};
|
|
1953
1768
|
const uninstallExtension = async id => {
|
|
1954
|
-
return invoke$
|
|
1769
|
+
return invoke$2('ExtensionManagement.uninstall', id);
|
|
1955
1770
|
};
|
|
1956
1771
|
const installExtension = async id => {
|
|
1957
1772
|
// @ts-ignore
|
|
1958
|
-
return invoke$
|
|
1773
|
+
return invoke$2('ExtensionManagement.install', id);
|
|
1959
1774
|
};
|
|
1960
1775
|
const openExtensionSearch = async () => {
|
|
1961
1776
|
// @ts-ignore
|
|
1962
|
-
return invoke$
|
|
1777
|
+
return invoke$2('SideBar.openViewlet', 'Extensions');
|
|
1963
1778
|
};
|
|
1964
1779
|
const setExtensionsSearchValue = async searchValue => {
|
|
1965
1780
|
// @ts-ignore
|
|
1966
|
-
return invoke$
|
|
1781
|
+
return invoke$2('Extensions.handleInput', searchValue);
|
|
1967
1782
|
};
|
|
1968
1783
|
const openExternal = async uri => {
|
|
1969
1784
|
// @ts-ignore
|
|
1970
|
-
await invoke$
|
|
1785
|
+
await invoke$2('Open.openExternal', uri);
|
|
1971
1786
|
};
|
|
1972
1787
|
const openUrl = async uri => {
|
|
1973
1788
|
// @ts-ignore
|
|
1974
|
-
await invoke$
|
|
1789
|
+
await invoke$2('Open.openUrl', uri);
|
|
1790
|
+
};
|
|
1791
|
+
const getAllPreferences = async () => {
|
|
1792
|
+
// @ts-ignore
|
|
1793
|
+
return invoke$2('Preferences.getAll');
|
|
1794
|
+
};
|
|
1795
|
+
const showSaveFilePicker = async () => {
|
|
1796
|
+
// @ts-ignore
|
|
1797
|
+
return invoke$2('FilePicker.showSaveFilePicker');
|
|
1798
|
+
};
|
|
1799
|
+
const getLogsDir = async () => {
|
|
1800
|
+
// @ts-ignore
|
|
1801
|
+
return invoke$2('PlatformPaths.getLogsDir');
|
|
1802
|
+
};
|
|
1803
|
+
const registerMockRpc = commandMap => {
|
|
1804
|
+
const mockRpc = createMockRpc({
|
|
1805
|
+
commandMap
|
|
1806
|
+
});
|
|
1807
|
+
set$3(mockRpc);
|
|
1808
|
+
return mockRpc;
|
|
1809
|
+
};
|
|
1810
|
+
|
|
1811
|
+
const RendererWorker = {
|
|
1812
|
+
__proto__: null,
|
|
1813
|
+
activateByEvent,
|
|
1814
|
+
applyBulkReplacement,
|
|
1815
|
+
closeWidget,
|
|
1816
|
+
confirm,
|
|
1817
|
+
disableExtension,
|
|
1818
|
+
dispose: dispose$2,
|
|
1819
|
+
enableExtension,
|
|
1820
|
+
getActiveEditorId,
|
|
1821
|
+
getAllExtensions: getAllExtensions$2,
|
|
1822
|
+
getAllPreferences,
|
|
1823
|
+
getBlob,
|
|
1824
|
+
getChromeVersion,
|
|
1825
|
+
getColorThemeNames,
|
|
1826
|
+
getElectronVersion,
|
|
1827
|
+
getExtension,
|
|
1828
|
+
getExtensionCommands,
|
|
1829
|
+
getFileHandles,
|
|
1830
|
+
getFileIcon,
|
|
1831
|
+
getFilePathElectron,
|
|
1832
|
+
getFolderIcon,
|
|
1833
|
+
getFolderSize,
|
|
1834
|
+
getIcons,
|
|
1835
|
+
getKeyBindings: getKeyBindings$1,
|
|
1836
|
+
getLogsDir,
|
|
1837
|
+
getMarkdownDom,
|
|
1838
|
+
getNodeVersion,
|
|
1839
|
+
getPreference,
|
|
1840
|
+
getRecentlyOpened,
|
|
1841
|
+
getV8Version,
|
|
1842
|
+
getWebViewSecret,
|
|
1843
|
+
getWindowId,
|
|
1844
|
+
getWorkspacePath,
|
|
1845
|
+
handleDebugChange,
|
|
1846
|
+
handleDebugPaused,
|
|
1847
|
+
handleDebugResumed,
|
|
1848
|
+
handleDebugScriptParsed,
|
|
1849
|
+
installExtension,
|
|
1850
|
+
invoke: invoke$2,
|
|
1851
|
+
invokeAndTransfer,
|
|
1852
|
+
openExtensionSearch,
|
|
1853
|
+
openExternal,
|
|
1854
|
+
openNativeFolder,
|
|
1855
|
+
openUri: openUri$2,
|
|
1856
|
+
openUrl,
|
|
1857
|
+
openWidget,
|
|
1858
|
+
readFile,
|
|
1859
|
+
registerMockRpc,
|
|
1860
|
+
registerWebViewInterceptor,
|
|
1861
|
+
renderMarkdown,
|
|
1862
|
+
rerenderEditor,
|
|
1863
|
+
searchFileFetch,
|
|
1864
|
+
searchFileHtml,
|
|
1865
|
+
searchFileMemory,
|
|
1866
|
+
sendMessagePortToEditorWorker,
|
|
1867
|
+
sendMessagePortToErrorWorker,
|
|
1868
|
+
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$2,
|
|
1869
|
+
sendMessagePortToFileSystemWorker,
|
|
1870
|
+
sendMessagePortToIconThemeWorker,
|
|
1871
|
+
sendMessagePortToMarkdownWorker,
|
|
1872
|
+
sendMessagePortToRendererProcess,
|
|
1873
|
+
sendMessagePortToSearchProcess,
|
|
1874
|
+
sendMessagePortToSyntaxHighlightingWorker,
|
|
1875
|
+
set: set$3,
|
|
1876
|
+
setAdditionalFocus,
|
|
1877
|
+
setColorTheme,
|
|
1878
|
+
setExtensionsSearchValue,
|
|
1879
|
+
setFocus,
|
|
1880
|
+
setWebViewPort,
|
|
1881
|
+
setWorkspacePath,
|
|
1882
|
+
showContextMenu: showContextMenu$1,
|
|
1883
|
+
showErrorDialog,
|
|
1884
|
+
showMessageBox,
|
|
1885
|
+
showSaveFilePicker,
|
|
1886
|
+
uninstallExtension,
|
|
1887
|
+
unregisterWebViewInterceptor,
|
|
1888
|
+
writeClipBoardImage,
|
|
1889
|
+
writeClipBoardText
|
|
1890
|
+
};
|
|
1891
|
+
|
|
1892
|
+
const copyExtensionId = async state => {
|
|
1893
|
+
const {
|
|
1894
|
+
items,
|
|
1895
|
+
focusedIndex
|
|
1896
|
+
} = state;
|
|
1897
|
+
if (focusedIndex === -1) {
|
|
1898
|
+
return state;
|
|
1899
|
+
}
|
|
1900
|
+
const item = items[focusedIndex];
|
|
1901
|
+
const {
|
|
1902
|
+
id
|
|
1903
|
+
} = item;
|
|
1904
|
+
await writeClipBoardText(id);
|
|
1905
|
+
return state;
|
|
1906
|
+
};
|
|
1907
|
+
|
|
1908
|
+
const stringifyRow = row => {
|
|
1909
|
+
const {
|
|
1910
|
+
key,
|
|
1911
|
+
value
|
|
1912
|
+
} = row;
|
|
1913
|
+
return `${key}: ${value}`.trim();
|
|
1914
|
+
};
|
|
1915
|
+
const getExtensionInfoText = extension => {
|
|
1916
|
+
const {
|
|
1917
|
+
name: name$1,
|
|
1918
|
+
id: id$1,
|
|
1919
|
+
publisher: publisher$1,
|
|
1920
|
+
description: description$1
|
|
1921
|
+
} = extension;
|
|
1922
|
+
const version$1 = ''; // TODO
|
|
1923
|
+
const marketplaceLink$1 = ''; // TODO
|
|
1924
|
+
const rows = [{
|
|
1925
|
+
key: name(),
|
|
1926
|
+
value: name$1
|
|
1927
|
+
}, {
|
|
1928
|
+
key: id(),
|
|
1929
|
+
value: id$1
|
|
1930
|
+
}, {
|
|
1931
|
+
key: description(),
|
|
1932
|
+
value: description$1
|
|
1933
|
+
}, {
|
|
1934
|
+
key: version(),
|
|
1935
|
+
value: version$1
|
|
1936
|
+
}, {
|
|
1937
|
+
key: publisher(),
|
|
1938
|
+
value: publisher$1
|
|
1939
|
+
}, {
|
|
1940
|
+
key: marketplaceLink(),
|
|
1941
|
+
value: marketplaceLink$1
|
|
1942
|
+
}];
|
|
1943
|
+
const infoRows = rows.map(stringifyRow);
|
|
1944
|
+
const infoText = infoRows.join('\n');
|
|
1945
|
+
return infoText;
|
|
1946
|
+
};
|
|
1947
|
+
|
|
1948
|
+
const copyExtensionInfo = async state => {
|
|
1949
|
+
const {
|
|
1950
|
+
items,
|
|
1951
|
+
focusedIndex
|
|
1952
|
+
} = state;
|
|
1953
|
+
if (focusedIndex === -1) {
|
|
1954
|
+
return state;
|
|
1955
|
+
}
|
|
1956
|
+
const item = items[focusedIndex];
|
|
1957
|
+
const text = getExtensionInfoText(item);
|
|
1958
|
+
await writeClipBoardText(text);
|
|
1959
|
+
return state;
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1962
|
+
const {
|
|
1963
|
+
get,
|
|
1964
|
+
set: set$2,
|
|
1965
|
+
dispose: dispose$1,
|
|
1966
|
+
wrapCommand,
|
|
1967
|
+
getCommandIds,
|
|
1968
|
+
registerCommands,
|
|
1969
|
+
wrapGetter
|
|
1970
|
+
} = create$2();
|
|
1971
|
+
|
|
1972
|
+
const create = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
1973
|
+
const state = {
|
|
1974
|
+
allExtensions: [],
|
|
1975
|
+
assetDir,
|
|
1976
|
+
deltaY: 0,
|
|
1977
|
+
finalDeltaY: 0,
|
|
1978
|
+
focus: 0,
|
|
1979
|
+
focused: false,
|
|
1980
|
+
focusedIndex: 0,
|
|
1981
|
+
handleOffset: 0,
|
|
1982
|
+
headerHeight: 41,
|
|
1983
|
+
height,
|
|
1984
|
+
inputActions: [],
|
|
1985
|
+
inputSource: 0,
|
|
1986
|
+
itemHeight: 72,
|
|
1987
|
+
items: [],
|
|
1988
|
+
maxLineY: 0,
|
|
1989
|
+
message: '',
|
|
1990
|
+
minimumSliderSize: 0,
|
|
1991
|
+
minLineY: 0,
|
|
1992
|
+
negativeMargin: 0,
|
|
1993
|
+
placeholder: '',
|
|
1994
|
+
platform,
|
|
1995
|
+
scrollBarActive: false,
|
|
1996
|
+
scrollBarHeight: 0,
|
|
1997
|
+
scrollBarY: 0,
|
|
1998
|
+
searchValue: '',
|
|
1999
|
+
size: 0,
|
|
2000
|
+
uid: id,
|
|
2001
|
+
width,
|
|
2002
|
+
x,
|
|
2003
|
+
y
|
|
2004
|
+
};
|
|
2005
|
+
set$2(id, state, state);
|
|
2006
|
+
};
|
|
2007
|
+
|
|
2008
|
+
const isEqual$2 = (oldState, newState) => {
|
|
2009
|
+
if (!newState.focus) {
|
|
2010
|
+
return true;
|
|
2011
|
+
}
|
|
2012
|
+
return oldState.focus === newState.focus;
|
|
2013
|
+
};
|
|
2014
|
+
|
|
2015
|
+
const isEqual$1 = (oldState, newState) => {
|
|
2016
|
+
return oldState.items === newState.items && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && oldState.deltaY === newState.deltaY && oldState.focusedIndex === newState.focusedIndex && oldState.message === newState.message && oldState.inputActions === newState.inputActions && oldState.placeholder === newState.placeholder;
|
|
2017
|
+
};
|
|
2018
|
+
|
|
2019
|
+
const isEqual = (oldState, newState) => {
|
|
2020
|
+
return newState.inputSource === User || oldState.searchValue === newState.searchValue;
|
|
2021
|
+
};
|
|
2022
|
+
|
|
2023
|
+
const RenderHeader = 1;
|
|
2024
|
+
const RenderFocus = 2;
|
|
2025
|
+
const RenderItems = 4;
|
|
2026
|
+
const RenderScrollBar = 5;
|
|
2027
|
+
const RenderMessage = 6;
|
|
2028
|
+
const RenderSearchValue = 7;
|
|
2029
|
+
const RenderFocusContext = 8;
|
|
2030
|
+
|
|
2031
|
+
const modules = [isEqual$1, isEqual$2, isEqual, isEqual$2];
|
|
2032
|
+
const numbers = [RenderItems, RenderFocus, RenderSearchValue, RenderFocusContext];
|
|
2033
|
+
|
|
2034
|
+
const diff2 = uid => {
|
|
2035
|
+
const {
|
|
2036
|
+
oldState,
|
|
2037
|
+
newState
|
|
2038
|
+
} = get(uid);
|
|
2039
|
+
const diffResult = [];
|
|
2040
|
+
for (let i = 0; i < modules.length; i++) {
|
|
2041
|
+
const fn = modules[i];
|
|
2042
|
+
if (!fn(oldState, newState)) {
|
|
2043
|
+
diffResult.push(numbers[i]);
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
return diffResult;
|
|
2047
|
+
};
|
|
2048
|
+
|
|
2049
|
+
const dispose = uid => {
|
|
2050
|
+
dispose$1(uid);
|
|
2051
|
+
};
|
|
2052
|
+
|
|
2053
|
+
// TODO optimize this function to return the minimum number
|
|
2054
|
+
// of visible items needed, e.g. when not scrolled 5 items with
|
|
2055
|
+
// 20px fill 100px but when scrolled 6 items are needed
|
|
2056
|
+
const getNumberOfVisibleItems = (listHeight, itemHeight) => {
|
|
2057
|
+
return Math.ceil(listHeight / itemHeight) + 1;
|
|
2058
|
+
};
|
|
2059
|
+
const getScrollBarOffset = (delta, finalDelta, size, scrollBarSize) => {
|
|
2060
|
+
const scrollBarOffset = delta / finalDelta * (size - scrollBarSize);
|
|
2061
|
+
return scrollBarOffset;
|
|
2062
|
+
};
|
|
2063
|
+
const getScrollBarY = getScrollBarOffset;
|
|
2064
|
+
const focusIndexScrollDown = (state, index, listHeight, itemHeight, itemsLength) => {
|
|
2065
|
+
const {
|
|
2066
|
+
finalDeltaY,
|
|
2067
|
+
height,
|
|
2068
|
+
headerHeight,
|
|
2069
|
+
scrollBarHeight
|
|
2070
|
+
} = state;
|
|
2071
|
+
const newMaxLineY = Math.min(index + 1, itemsLength);
|
|
2072
|
+
const fittingItems = getNumberOfVisibleItems(listHeight, itemHeight);
|
|
2073
|
+
const newMinLineY = Math.max(newMaxLineY - fittingItems, 0);
|
|
2074
|
+
const newDeltaY = itemsLength < fittingItems ? 0 : newMinLineY * itemHeight - listHeight % itemHeight + itemHeight;
|
|
2075
|
+
const scrollBarY = getScrollBarY(newDeltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
|
|
2076
|
+
return {
|
|
2077
|
+
...state,
|
|
2078
|
+
focusedIndex: index,
|
|
2079
|
+
minLineY: newMinLineY,
|
|
2080
|
+
maxLineY: newMaxLineY,
|
|
2081
|
+
focused: true,
|
|
2082
|
+
deltaY: newDeltaY,
|
|
2083
|
+
scrollBarY
|
|
2084
|
+
};
|
|
2085
|
+
};
|
|
2086
|
+
const focusIndexScrollUp = (state, index, listHeight, itemHeight, itemsLength) => {
|
|
2087
|
+
const {
|
|
2088
|
+
finalDeltaY,
|
|
2089
|
+
height,
|
|
2090
|
+
headerHeight,
|
|
2091
|
+
scrollBarHeight
|
|
2092
|
+
} = state;
|
|
2093
|
+
const newMinLineY = index;
|
|
2094
|
+
const fittingItems = getNumberOfVisibleItems(listHeight, itemHeight);
|
|
2095
|
+
const newMaxLineY = Math.min(newMinLineY + fittingItems, itemsLength);
|
|
2096
|
+
const newDeltaY = newMinLineY * itemHeight;
|
|
2097
|
+
const scrollBarY = getScrollBarY(newDeltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
|
|
2098
|
+
return {
|
|
2099
|
+
...state,
|
|
2100
|
+
focusedIndex: index,
|
|
2101
|
+
minLineY: newMinLineY,
|
|
2102
|
+
maxLineY: newMaxLineY,
|
|
2103
|
+
focused: true,
|
|
2104
|
+
deltaY: newDeltaY,
|
|
2105
|
+
scrollBarY
|
|
2106
|
+
};
|
|
2107
|
+
};
|
|
2108
|
+
const focusIndex = (state, index) => {
|
|
2109
|
+
const {
|
|
2110
|
+
itemHeight,
|
|
2111
|
+
minLineY,
|
|
2112
|
+
maxLineY,
|
|
2113
|
+
headerHeight,
|
|
2114
|
+
height,
|
|
2115
|
+
items
|
|
2116
|
+
} = state;
|
|
2117
|
+
const itemsLength = items.length;
|
|
2118
|
+
if (itemsLength === 0) {
|
|
2119
|
+
return state;
|
|
2120
|
+
}
|
|
2121
|
+
number(itemHeight);
|
|
2122
|
+
if (index === -1) {
|
|
2123
|
+
return {
|
|
2124
|
+
...state,
|
|
2125
|
+
focusedIndex: -1,
|
|
2126
|
+
focused: true
|
|
2127
|
+
};
|
|
2128
|
+
}
|
|
2129
|
+
const listHeight = height - headerHeight;
|
|
2130
|
+
if (index < minLineY + 1) {
|
|
2131
|
+
return focusIndexScrollUp(state, index, listHeight, itemHeight, itemsLength);
|
|
2132
|
+
}
|
|
2133
|
+
if (index >= maxLineY - 1) {
|
|
2134
|
+
return focusIndexScrollDown(state, index, listHeight, itemHeight, itemsLength);
|
|
2135
|
+
}
|
|
2136
|
+
return {
|
|
2137
|
+
...state,
|
|
2138
|
+
focusedIndex: index,
|
|
2139
|
+
focused: true
|
|
2140
|
+
};
|
|
2141
|
+
};
|
|
2142
|
+
const first = () => {
|
|
2143
|
+
return 0;
|
|
2144
|
+
};
|
|
2145
|
+
const last = items => {
|
|
2146
|
+
return items.length - 1;
|
|
2147
|
+
};
|
|
2148
|
+
const next = (items, index) => {
|
|
2149
|
+
return (index + 1) % items.length;
|
|
2150
|
+
};
|
|
2151
|
+
const previous = (items, index) => {
|
|
2152
|
+
return index === 0 ? items.length - 1 : index - 1;
|
|
2153
|
+
};
|
|
2154
|
+
const focusFirst = state => {
|
|
2155
|
+
const firstIndex = first();
|
|
2156
|
+
return focusIndex(state, firstIndex);
|
|
2157
|
+
};
|
|
2158
|
+
const focusLast = state => {
|
|
2159
|
+
const {
|
|
2160
|
+
items
|
|
2161
|
+
} = state;
|
|
2162
|
+
const lastIndex = last(items);
|
|
2163
|
+
return focusIndex(state, lastIndex);
|
|
2164
|
+
};
|
|
2165
|
+
const focusNext = state => {
|
|
2166
|
+
const {
|
|
2167
|
+
focusedIndex,
|
|
2168
|
+
items
|
|
2169
|
+
} = state;
|
|
2170
|
+
const nextIndex = next(items, focusedIndex);
|
|
2171
|
+
return focusIndex(state, nextIndex);
|
|
2172
|
+
};
|
|
2173
|
+
|
|
2174
|
+
// based on https://github.com/microsoft/vscode/blob/c0769274fa136b45799edeccc0d0a2f645b75caf/src/vs/base/common/arrays.ts#L625 (License MIT)
|
|
2175
|
+
|
|
2176
|
+
const isLastIndex = (array, index) => {
|
|
2177
|
+
return index === array.length - 1;
|
|
2178
|
+
};
|
|
2179
|
+
const lastIndex = array => {
|
|
2180
|
+
return array.length - 1;
|
|
2181
|
+
};
|
|
2182
|
+
const focusNextPage = state => {
|
|
2183
|
+
const {
|
|
2184
|
+
focusedIndex,
|
|
2185
|
+
items,
|
|
2186
|
+
maxLineY,
|
|
2187
|
+
minLineY
|
|
2188
|
+
} = state;
|
|
2189
|
+
if (isLastIndex(items, focusedIndex)) {
|
|
2190
|
+
return state;
|
|
2191
|
+
}
|
|
2192
|
+
const indexNextPage = Math.min(maxLineY + (maxLineY - minLineY) - 2, lastIndex(items));
|
|
2193
|
+
return focusIndex(state, indexNextPage);
|
|
2194
|
+
};
|
|
2195
|
+
const focusPrevious = state => {
|
|
2196
|
+
const {
|
|
2197
|
+
focusedIndex,
|
|
2198
|
+
items
|
|
2199
|
+
} = state;
|
|
2200
|
+
if (focusedIndex === 0 || focusedIndex === -1) {
|
|
2201
|
+
return state;
|
|
2202
|
+
}
|
|
2203
|
+
const previousIndex = previous(items, focusedIndex);
|
|
2204
|
+
return focusIndex(state, previousIndex);
|
|
2205
|
+
};
|
|
2206
|
+
const focusPreviousPage = state => {
|
|
2207
|
+
const {
|
|
2208
|
+
focusedIndex,
|
|
2209
|
+
minLineY,
|
|
2210
|
+
maxLineY
|
|
2211
|
+
} = state;
|
|
2212
|
+
if (focusedIndex === 0 || focusedIndex === -1) {
|
|
2213
|
+
return state;
|
|
2214
|
+
}
|
|
2215
|
+
const indexPreviousPage = Math.max(minLineY - (maxLineY - minLineY) + 1, 0);
|
|
2216
|
+
return focusIndex(state, indexPreviousPage);
|
|
1975
2217
|
};
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
2218
|
+
|
|
2219
|
+
const Button = 1;
|
|
2220
|
+
|
|
2221
|
+
const ClearAll = 'ClearAll';
|
|
2222
|
+
const Filter = 'Filter';
|
|
2223
|
+
const Refresh = 'Refresh';
|
|
2224
|
+
const Ellipsis = 'Ellipsis';
|
|
2225
|
+
|
|
2226
|
+
const getActions = () => {
|
|
2227
|
+
return [{
|
|
2228
|
+
type: Button,
|
|
2229
|
+
id: refresh(),
|
|
2230
|
+
icon: Refresh,
|
|
2231
|
+
command: ''
|
|
2232
|
+
}, {
|
|
2233
|
+
type: Button,
|
|
2234
|
+
id: viewsAndMoreActions(),
|
|
2235
|
+
icon: Ellipsis,
|
|
2236
|
+
command: ''
|
|
2237
|
+
}];
|
|
1979
2238
|
};
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
2239
|
+
|
|
2240
|
+
const Enter = 3;
|
|
2241
|
+
const Space = 9;
|
|
2242
|
+
const PageUp = 10;
|
|
2243
|
+
const PageDown = 11;
|
|
2244
|
+
const End = 255;
|
|
2245
|
+
const Home = 12;
|
|
2246
|
+
const UpArrow = 14;
|
|
2247
|
+
const DownArrow = 16;
|
|
2248
|
+
|
|
2249
|
+
const CtrlCmd = 1 << 11 >>> 0;
|
|
2250
|
+
|
|
2251
|
+
const FocusExtensions = 15;
|
|
2252
|
+
const FocusExtensionsInput = 7000;
|
|
2253
|
+
|
|
2254
|
+
const getKeyBindings = () => {
|
|
2255
|
+
return [{
|
|
2256
|
+
key: Home,
|
|
2257
|
+
command: 'Extensions.focusFirst',
|
|
2258
|
+
when: FocusExtensions
|
|
2259
|
+
}, {
|
|
2260
|
+
key: End,
|
|
2261
|
+
command: 'Extensions.focusLast',
|
|
2262
|
+
when: FocusExtensions
|
|
2263
|
+
}, {
|
|
2264
|
+
key: PageUp,
|
|
2265
|
+
command: 'Extensions.focusPreviousPage',
|
|
2266
|
+
when: FocusExtensions
|
|
2267
|
+
}, {
|
|
2268
|
+
key: PageDown,
|
|
2269
|
+
command: 'Extensions.focusNextPage',
|
|
2270
|
+
when: FocusExtensions
|
|
2271
|
+
}, {
|
|
2272
|
+
key: UpArrow,
|
|
2273
|
+
command: 'Extensions.focusPrevious',
|
|
2274
|
+
when: FocusExtensions
|
|
2275
|
+
}, {
|
|
2276
|
+
key: DownArrow,
|
|
2277
|
+
command: 'Extensions.focusNext',
|
|
2278
|
+
when: FocusExtensions
|
|
2279
|
+
}, {
|
|
2280
|
+
key: Space,
|
|
2281
|
+
command: 'Extensions.handleClickCurrentButKeepFocus',
|
|
2282
|
+
when: FocusExtensions
|
|
2283
|
+
}, {
|
|
2284
|
+
key: Enter,
|
|
2285
|
+
command: 'Extensions.handleClickCurrent',
|
|
2286
|
+
when: FocusExtensions
|
|
2287
|
+
}, {
|
|
2288
|
+
key: CtrlCmd | Space,
|
|
2289
|
+
command: 'Extensions.toggleSuggest',
|
|
2290
|
+
when: FocusExtensions
|
|
2291
|
+
}, {
|
|
2292
|
+
key: CtrlCmd | DownArrow,
|
|
2293
|
+
command: 'Extensions.scrollDown',
|
|
2294
|
+
when: FocusExtensions
|
|
2295
|
+
}];
|
|
1983
2296
|
};
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
2297
|
+
|
|
2298
|
+
const None$1 = 0;
|
|
2299
|
+
|
|
2300
|
+
const getMenuEntries = () => {
|
|
2301
|
+
return [{
|
|
2302
|
+
id: 'enable',
|
|
2303
|
+
label: enable(),
|
|
2304
|
+
flags: None$1,
|
|
2305
|
+
command: 'SearchExtensions.enable'
|
|
2306
|
+
}, {
|
|
2307
|
+
id: 'disable',
|
|
2308
|
+
label: disable(),
|
|
2309
|
+
flags: None$1,
|
|
2310
|
+
command: 'SearchExtensions.disable'
|
|
2311
|
+
}, {
|
|
2312
|
+
id: 'installAnotherVersion',
|
|
2313
|
+
label: installAnotherVersion(),
|
|
2314
|
+
flags: None$1,
|
|
2315
|
+
command: 'SearchExtensions.installAnotherVersion'
|
|
2316
|
+
}, {
|
|
2317
|
+
id: 'copy',
|
|
2318
|
+
label: copy(),
|
|
2319
|
+
flags: None$1,
|
|
2320
|
+
command: 'SearchExtensions.copy'
|
|
2321
|
+
}, {
|
|
2322
|
+
id: 'copyExtensionId',
|
|
2323
|
+
label: copyExtensionId$1(),
|
|
2324
|
+
flags: None$1,
|
|
2325
|
+
command: 'SearchExtensions.copyExtensionId'
|
|
2326
|
+
}];
|
|
1987
2327
|
};
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
2328
|
+
|
|
2329
|
+
const handleBlur = state => {
|
|
2330
|
+
return {
|
|
2331
|
+
...state,
|
|
2332
|
+
focus: None$3
|
|
2333
|
+
};
|
|
1994
2334
|
};
|
|
1995
2335
|
|
|
1996
|
-
const
|
|
1997
|
-
|
|
1998
|
-
activateByEvent,
|
|
1999
|
-
applyBulkReplacement,
|
|
2000
|
-
closeWidget,
|
|
2001
|
-
confirm,
|
|
2002
|
-
disableExtension,
|
|
2003
|
-
dispose,
|
|
2004
|
-
enableExtension,
|
|
2005
|
-
getActiveEditorId,
|
|
2006
|
-
getAllExtensions: getAllExtensions$2,
|
|
2007
|
-
getAllPreferences,
|
|
2008
|
-
getBlob,
|
|
2009
|
-
getChromeVersion,
|
|
2010
|
-
getColorThemeNames,
|
|
2011
|
-
getElectronVersion,
|
|
2012
|
-
getExtension,
|
|
2013
|
-
getExtensionCommands,
|
|
2014
|
-
getFileHandles,
|
|
2015
|
-
getFileIcon,
|
|
2016
|
-
getFilePathElectron,
|
|
2017
|
-
getFolderIcon,
|
|
2018
|
-
getFolderSize,
|
|
2019
|
-
getIcons,
|
|
2020
|
-
getKeyBindings,
|
|
2021
|
-
getLogsDir,
|
|
2022
|
-
getMarkdownDom,
|
|
2023
|
-
getNodeVersion,
|
|
2024
|
-
getPreference,
|
|
2025
|
-
getRecentlyOpened,
|
|
2026
|
-
getV8Version,
|
|
2027
|
-
getWebViewSecret,
|
|
2028
|
-
getWindowId,
|
|
2029
|
-
getWorkspacePath,
|
|
2030
|
-
handleDebugChange,
|
|
2031
|
-
handleDebugPaused,
|
|
2032
|
-
handleDebugResumed,
|
|
2033
|
-
handleDebugScriptParsed,
|
|
2034
|
-
installExtension,
|
|
2035
|
-
invoke: invoke$1,
|
|
2036
|
-
invokeAndTransfer,
|
|
2037
|
-
openExtensionSearch,
|
|
2038
|
-
openExternal,
|
|
2039
|
-
openNativeFolder,
|
|
2040
|
-
openUri: openUri$2,
|
|
2041
|
-
openUrl,
|
|
2042
|
-
openWidget,
|
|
2043
|
-
readFile,
|
|
2044
|
-
registerMockRpc,
|
|
2045
|
-
registerWebViewInterceptor,
|
|
2046
|
-
renderMarkdown,
|
|
2047
|
-
rerenderEditor,
|
|
2048
|
-
searchFileFetch,
|
|
2049
|
-
searchFileHtml,
|
|
2050
|
-
searchFileMemory,
|
|
2051
|
-
sendMessagePortToEditorWorker,
|
|
2052
|
-
sendMessagePortToErrorWorker,
|
|
2053
|
-
sendMessagePortToExtensionHostWorker,
|
|
2054
|
-
sendMessagePortToFileSystemWorker,
|
|
2055
|
-
sendMessagePortToIconThemeWorker,
|
|
2056
|
-
sendMessagePortToMarkdownWorker,
|
|
2057
|
-
sendMessagePortToRendererProcess,
|
|
2058
|
-
sendMessagePortToSearchProcess,
|
|
2059
|
-
sendMessagePortToSyntaxHighlightingWorker,
|
|
2060
|
-
set: set$1,
|
|
2061
|
-
setAdditionalFocus,
|
|
2062
|
-
setColorTheme,
|
|
2063
|
-
setExtensionsSearchValue,
|
|
2064
|
-
setFocus,
|
|
2065
|
-
setWebViewPort,
|
|
2066
|
-
setWorkspacePath,
|
|
2067
|
-
showContextMenu: showContextMenu$1,
|
|
2068
|
-
showErrorDialog,
|
|
2069
|
-
showMessageBox,
|
|
2070
|
-
showSaveFilePicker,
|
|
2071
|
-
uninstallExtension,
|
|
2072
|
-
unregisterWebViewInterceptor,
|
|
2073
|
-
writeClipBoardImage,
|
|
2074
|
-
writeClipBoardText
|
|
2336
|
+
const getExtensionDetailUri = extensionId => {
|
|
2337
|
+
return `extension-detail://${extensionId}`;
|
|
2075
2338
|
};
|
|
2076
2339
|
|
|
2077
2340
|
const {
|
|
2078
|
-
invoke,
|
|
2079
|
-
set,
|
|
2341
|
+
invoke: invoke$1,
|
|
2342
|
+
set: set$1,
|
|
2080
2343
|
showContextMenu,
|
|
2081
|
-
openUri: openUri$1
|
|
2344
|
+
openUri: openUri$1,
|
|
2345
|
+
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1
|
|
2082
2346
|
} = RendererWorker;
|
|
2083
2347
|
|
|
2084
2348
|
const openUri = async uri => {
|
|
@@ -2102,6 +2366,18 @@ const handleClick = async (state, index) => {
|
|
|
2102
2366
|
return newState;
|
|
2103
2367
|
};
|
|
2104
2368
|
|
|
2369
|
+
const mergeClassNames = (...classNames) => {
|
|
2370
|
+
return classNames.filter(Boolean).join(' ');
|
|
2371
|
+
};
|
|
2372
|
+
|
|
2373
|
+
const text = data => {
|
|
2374
|
+
return {
|
|
2375
|
+
type: Text,
|
|
2376
|
+
text: data,
|
|
2377
|
+
childCount: 0
|
|
2378
|
+
};
|
|
2379
|
+
};
|
|
2380
|
+
|
|
2105
2381
|
const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight, headerHeight) => {
|
|
2106
2382
|
const relativeDeltaY = deltaY % itemHeight;
|
|
2107
2383
|
const relativeY = eventY - y - headerHeight + relativeDeltaY;
|
|
@@ -2109,7 +2385,10 @@ const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight, headerHeight) =>
|
|
|
2109
2385
|
return index;
|
|
2110
2386
|
};
|
|
2111
2387
|
|
|
2112
|
-
const handleClickAt = async (state, eventX, eventY) => {
|
|
2388
|
+
const handleClickAt = async (state, button, eventX, eventY) => {
|
|
2389
|
+
if (button !== LeftClick) {
|
|
2390
|
+
return state;
|
|
2391
|
+
}
|
|
2113
2392
|
const {
|
|
2114
2393
|
x,
|
|
2115
2394
|
y,
|
|
@@ -2310,35 +2589,69 @@ const handleWheel = (state, deltaMode, deltaY) => {
|
|
|
2310
2589
|
return setDeltaY(state, state.deltaY + deltaY);
|
|
2311
2590
|
};
|
|
2312
2591
|
|
|
2592
|
+
const sendMessagePortToExtensionHostWorker = async port => {
|
|
2593
|
+
await sendMessagePortToExtensionHostWorker$1(port, 0);
|
|
2594
|
+
};
|
|
2595
|
+
|
|
2596
|
+
const createExtensionHostWorkerRpc = async () => {
|
|
2597
|
+
try {
|
|
2598
|
+
const rpc = await TransferMessagePortRpcParent.create({
|
|
2599
|
+
commandMap: {},
|
|
2600
|
+
send: sendMessagePortToExtensionHostWorker
|
|
2601
|
+
});
|
|
2602
|
+
return rpc;
|
|
2603
|
+
} catch (error) {
|
|
2604
|
+
throw new VError(error, `Failed to create extension host rpc`);
|
|
2605
|
+
}
|
|
2606
|
+
};
|
|
2607
|
+
|
|
2608
|
+
const {
|
|
2609
|
+
set,
|
|
2610
|
+
invoke} = ExtensionHost;
|
|
2611
|
+
|
|
2612
|
+
const initializeExtensionHostWorker = async () => {
|
|
2613
|
+
const rpc = await createExtensionHostWorkerRpc();
|
|
2614
|
+
set(rpc);
|
|
2615
|
+
};
|
|
2616
|
+
|
|
2617
|
+
const initialize = async () => {
|
|
2618
|
+
await initializeExtensionHostWorker();
|
|
2619
|
+
};
|
|
2620
|
+
|
|
2313
2621
|
const Web = 1;
|
|
2314
2622
|
const Electron = 2;
|
|
2315
2623
|
const Remote = 3;
|
|
2316
2624
|
|
|
2317
2625
|
const getAllExtensions$1 = async platform => {
|
|
2318
2626
|
if (platform === Web) {
|
|
2319
|
-
|
|
2627
|
+
try {
|
|
2628
|
+
const extensions = await invoke('Extensions.getExtensions');
|
|
2629
|
+
return extensions;
|
|
2630
|
+
} catch {
|
|
2631
|
+
return [];
|
|
2632
|
+
}
|
|
2320
2633
|
}
|
|
2321
2634
|
// @ts-ignore todo
|
|
2322
|
-
return invoke('ExtensionManagement.getAllExtensions');
|
|
2635
|
+
return invoke$1('ExtensionManagement.getAllExtensions');
|
|
2323
2636
|
};
|
|
2324
2637
|
|
|
2325
2638
|
const getAllExtensions = platform => {
|
|
2326
2639
|
return getAllExtensions$1(platform);
|
|
2327
2640
|
};
|
|
2328
2641
|
|
|
2329
|
-
const HandleClearSearchResults =
|
|
2330
|
-
const HandleClickFilter =
|
|
2331
|
-
const HandleContextMenu =
|
|
2332
|
-
const HandleExtensionsInput =
|
|
2333
|
-
const HandleFocus =
|
|
2334
|
-
const HandlePointerDown =
|
|
2335
|
-
const HandleScrollBarMove =
|
|
2336
|
-
const HandleScrollBarPointerCaptureLost =
|
|
2337
|
-
const HandleScrollBarPointerDown =
|
|
2338
|
-
const HandleTouchEnd =
|
|
2339
|
-
const HandleTouchMove =
|
|
2340
|
-
const HandleTouchStart =
|
|
2341
|
-
const HandleWheel =
|
|
2642
|
+
const HandleClearSearchResults = 1;
|
|
2643
|
+
const HandleClickFilter = 2;
|
|
2644
|
+
const HandleContextMenu = 3;
|
|
2645
|
+
const HandleExtensionsInput = 4;
|
|
2646
|
+
const HandleFocus = 5;
|
|
2647
|
+
const HandlePointerDown = 7;
|
|
2648
|
+
const HandleScrollBarMove = 9;
|
|
2649
|
+
const HandleScrollBarPointerCaptureLost = 10;
|
|
2650
|
+
const HandleScrollBarPointerDown = 11;
|
|
2651
|
+
const HandleTouchEnd = 12;
|
|
2652
|
+
const HandleTouchMove = 13;
|
|
2653
|
+
const HandleTouchStart = 14;
|
|
2654
|
+
const HandleWheel = 15;
|
|
2342
2655
|
|
|
2343
2656
|
const getInputActions = newState => {
|
|
2344
2657
|
const clearEnabled = newState.searchValue.length > 0;
|
|
@@ -2346,12 +2659,12 @@ const getInputActions = newState => {
|
|
|
2346
2659
|
onClick: HandleClearSearchResults,
|
|
2347
2660
|
icon: `MaskIcon${ClearAll}`,
|
|
2348
2661
|
title: clearExtensionSearchResults(),
|
|
2349
|
-
type: Button
|
|
2662
|
+
type: Button,
|
|
2350
2663
|
enabled: clearEnabled
|
|
2351
2664
|
}, {
|
|
2352
2665
|
icon: `MaskIcon${Filter}`,
|
|
2353
2666
|
title: filter(),
|
|
2354
|
-
type: Button
|
|
2667
|
+
type: Button,
|
|
2355
2668
|
onClick: HandleClickFilter,
|
|
2356
2669
|
enabled: true
|
|
2357
2670
|
}];
|
|
@@ -2558,18 +2871,6 @@ const renderFocusContext = newState => {
|
|
|
2558
2871
|
return [];
|
|
2559
2872
|
};
|
|
2560
2873
|
|
|
2561
|
-
const mergeClassNames = (...classNames) => {
|
|
2562
|
-
return classNames.filter(Boolean).join(' ');
|
|
2563
|
-
};
|
|
2564
|
-
|
|
2565
|
-
const text = data => {
|
|
2566
|
-
return {
|
|
2567
|
-
type: Text,
|
|
2568
|
-
text: data,
|
|
2569
|
-
childCount: 0
|
|
2570
|
-
};
|
|
2571
|
-
};
|
|
2572
|
-
|
|
2573
2874
|
const Actions = 'Actions';
|
|
2574
2875
|
const ExtensionActions = 'ExtensionActions';
|
|
2575
2876
|
const ExtensionActive = 'ExtensionActive';
|
|
@@ -2618,7 +2919,7 @@ const getSearchFieldButtonVirtualDom = button => {
|
|
|
2618
2919
|
onClick
|
|
2619
2920
|
} = button;
|
|
2620
2921
|
return [{
|
|
2621
|
-
type: Button,
|
|
2922
|
+
type: Button$2,
|
|
2622
2923
|
className: getClassName$1(enabled),
|
|
2623
2924
|
title,
|
|
2624
2925
|
tabIndex: 0,
|
|
@@ -2645,6 +2946,7 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
|
|
|
2645
2946
|
spellcheck: false,
|
|
2646
2947
|
autocapitalize: 'off',
|
|
2647
2948
|
autocorrect: 'off',
|
|
2949
|
+
autocomplete: 'off',
|
|
2648
2950
|
placeholder,
|
|
2649
2951
|
name,
|
|
2650
2952
|
onInput,
|
|
@@ -2881,7 +3183,7 @@ const getExtensionsViewVirtualDom = state => {
|
|
|
2881
3183
|
childCount: 2,
|
|
2882
3184
|
ariaLive: 'polite',
|
|
2883
3185
|
ariaBusy: false,
|
|
2884
|
-
role: None$
|
|
3186
|
+
role: None$2
|
|
2885
3187
|
}, ...getExtensionHeaderVirtualDom(placeholder, inputActions), ...getContentVirtualDom(visibleExtensions, message, scrollBarHeight, scrollBarY)];
|
|
2886
3188
|
};
|
|
2887
3189
|
|
|
@@ -2951,8 +3253,8 @@ const render3 = (uid, diffResult) => {
|
|
|
2951
3253
|
const {
|
|
2952
3254
|
oldState,
|
|
2953
3255
|
newState
|
|
2954
|
-
} = get
|
|
2955
|
-
set$
|
|
3256
|
+
} = get(uid);
|
|
3257
|
+
set$2(uid, newState, newState);
|
|
2956
3258
|
const commands = applyRender(oldState, newState, diffResult);
|
|
2957
3259
|
return commands;
|
|
2958
3260
|
};
|
|
@@ -2972,7 +3274,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2972
3274
|
icon
|
|
2973
3275
|
} = action;
|
|
2974
3276
|
return [{
|
|
2975
|
-
type: Button,
|
|
3277
|
+
type: Button$2,
|
|
2976
3278
|
className: IconButton,
|
|
2977
3279
|
title: id,
|
|
2978
3280
|
childCount: 1
|
|
@@ -2981,7 +3283,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2981
3283
|
|
|
2982
3284
|
const getActionVirtualDom = action => {
|
|
2983
3285
|
switch (action.type) {
|
|
2984
|
-
case Button
|
|
3286
|
+
case Button:
|
|
2985
3287
|
return getActionButtonVirtualDom(action);
|
|
2986
3288
|
default:
|
|
2987
3289
|
return [];
|
|
@@ -3001,7 +3303,7 @@ const renderActions = uid => {
|
|
|
3001
3303
|
const {
|
|
3002
3304
|
oldState,
|
|
3003
3305
|
newState
|
|
3004
|
-
} = get
|
|
3306
|
+
} = get(uid);
|
|
3005
3307
|
if (oldState === newState) {
|
|
3006
3308
|
return [];
|
|
3007
3309
|
}
|
|
@@ -3013,30 +3315,30 @@ const renderActions = uid => {
|
|
|
3013
3315
|
const renderEventListeners = () => {
|
|
3014
3316
|
return [{
|
|
3015
3317
|
name: HandleContextMenu,
|
|
3016
|
-
params: ['handleContextMenu',
|
|
3318
|
+
params: ['handleContextMenu', Button$1, ClientX, ClientY],
|
|
3017
3319
|
preventDefault: true
|
|
3018
3320
|
}, {
|
|
3019
3321
|
name: HandlePointerDown,
|
|
3020
|
-
params: ['handleClickAt',
|
|
3322
|
+
params: ['handleClickAt', Button$1, ClientX, ClientY],
|
|
3021
3323
|
preventDefault: true
|
|
3022
3324
|
}, {
|
|
3023
3325
|
name: HandleScrollBarPointerDown,
|
|
3024
|
-
params: ['handleScrollBarClick',
|
|
3326
|
+
params: ['handleScrollBarClick', ClientY],
|
|
3025
3327
|
preventDefault: true,
|
|
3026
3328
|
trackPointerEvents: [HandleScrollBarMove, HandleScrollBarPointerCaptureLost]
|
|
3027
3329
|
}, {
|
|
3028
3330
|
name: HandleScrollBarMove,
|
|
3029
|
-
params: ['handleScrollBarMove',
|
|
3331
|
+
params: ['handleScrollBarMove', ClientY]
|
|
3030
3332
|
}, {
|
|
3031
3333
|
name: HandleScrollBarPointerCaptureLost,
|
|
3032
3334
|
params: ['handleScrollBarCaptureLost']
|
|
3033
3335
|
}, {
|
|
3034
3336
|
name: HandleWheel,
|
|
3035
|
-
params: ['handleWheel',
|
|
3337
|
+
params: ['handleWheel', DeltaMode, DeltaY],
|
|
3036
3338
|
passive: true
|
|
3037
3339
|
}, {
|
|
3038
3340
|
name: HandleExtensionsInput,
|
|
3039
|
-
params: ['handleInput',
|
|
3341
|
+
params: ['handleInput', TargetValue, User]
|
|
3040
3342
|
}, {
|
|
3041
3343
|
name: HandleClearSearchResults,
|
|
3042
3344
|
params: ['clearSearchResults']
|
|
@@ -3083,19 +3385,21 @@ const toggleSuggest = state => {
|
|
|
3083
3385
|
const commandMap = {
|
|
3084
3386
|
'SearchExtensions.clearSearchResults': wrapCommand(clearSearchResults),
|
|
3085
3387
|
'SearchExtensions.closeSuggest': wrapCommand(closeSuggest),
|
|
3086
|
-
'SearchExtensions.
|
|
3388
|
+
'SearchExtensions.copyExtensionId': wrapCommand(copyExtensionId),
|
|
3389
|
+
'SearchExtensions.copyExtensionInfo': wrapCommand(copyExtensionInfo),
|
|
3390
|
+
'SearchExtensions.create': create,
|
|
3087
3391
|
'SearchExtensions.diff2': diff2,
|
|
3088
|
-
'SearchExtensions.dispose': dispose
|
|
3392
|
+
'SearchExtensions.dispose': dispose,
|
|
3089
3393
|
'SearchExtensions.focusFirst': wrapCommand(focusFirst),
|
|
3090
3394
|
'SearchExtensions.focusIndex': wrapCommand(focusIndex),
|
|
3091
3395
|
'SearchExtensions.focusLast': wrapCommand(focusLast),
|
|
3092
3396
|
'SearchExtensions.focusNext': wrapCommand(focusNext),
|
|
3093
3397
|
'SearchExtensions.focusNextPage': wrapCommand(focusNextPage),
|
|
3094
|
-
'SearchExtensions.focusPreviousPage': wrapCommand(focusPreviousPage),
|
|
3095
3398
|
'SearchExtensions.focusPrevious': wrapCommand(focusPrevious),
|
|
3399
|
+
'SearchExtensions.focusPreviousPage': wrapCommand(focusPreviousPage),
|
|
3096
3400
|
'SearchExtensions.getActions': getActions,
|
|
3097
3401
|
'SearchExtensions.getCommandIds': getCommandIds,
|
|
3098
|
-
'SearchExtensions.getKeyBindings': getKeyBindings
|
|
3402
|
+
'SearchExtensions.getKeyBindings': getKeyBindings,
|
|
3099
3403
|
'SearchExtensions.getMenuEntries': getMenuEntries,
|
|
3100
3404
|
'SearchExtensions.handleBlur': wrapCommand(handleBlur),
|
|
3101
3405
|
'SearchExtensions.handleClick': wrapCommand(handleClick),
|
|
@@ -3114,6 +3418,7 @@ const commandMap = {
|
|
|
3114
3418
|
'SearchExtensions.handleScrollBarThumbPointerMove': wrapCommand(handleScrollBarMove),
|
|
3115
3419
|
'SearchExtensions.handleUninstall': wrapCommand(handleUninstall),
|
|
3116
3420
|
'SearchExtensions.handleWheel': wrapCommand(handleWheel),
|
|
3421
|
+
'SearchExtensions.initialize': initialize,
|
|
3117
3422
|
'SearchExtensions.loadContent': wrapCommand(loadContent),
|
|
3118
3423
|
'SearchExtensions.openSuggest': wrapCommand(openSuggest),
|
|
3119
3424
|
'SearchExtensions.render3': render3,
|
|
@@ -3130,11 +3435,11 @@ const commandMap = {
|
|
|
3130
3435
|
};
|
|
3131
3436
|
|
|
3132
3437
|
const listen = async () => {
|
|
3133
|
-
|
|
3438
|
+
registerCommands(commandMap);
|
|
3134
3439
|
const rpc = await WebWorkerRpcClient.create({
|
|
3135
|
-
commandMap:
|
|
3440
|
+
commandMap: commandMap
|
|
3136
3441
|
});
|
|
3137
|
-
set(rpc);
|
|
3442
|
+
set$1(rpc);
|
|
3138
3443
|
};
|
|
3139
3444
|
|
|
3140
3445
|
const main = async () => {
|