@lvce-editor/extension-search-view 4.3.0 → 4.4.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 +723 -611
- package/package.json +1 -1
|
@@ -436,9 +436,9 @@ const get$2 = id => {
|
|
|
436
436
|
const remove = id => {
|
|
437
437
|
delete callbacks[id];
|
|
438
438
|
};
|
|
439
|
-
let id = 0;
|
|
439
|
+
let id$1 = 0;
|
|
440
440
|
const create$3$1 = () => {
|
|
441
|
-
return ++id;
|
|
441
|
+
return ++id$1;
|
|
442
442
|
};
|
|
443
443
|
const registerPromise = () => {
|
|
444
444
|
const id = create$3$1();
|
|
@@ -1018,10 +1018,34 @@ const ViewsAndMoreActions = 'Views and more Actions...';
|
|
|
1018
1018
|
const Extensions$2 = 'Extensions';
|
|
1019
1019
|
const Copy = 'Copy';
|
|
1020
1020
|
const CopyExtensionId = 'CopyExtensionId';
|
|
1021
|
+
const Name = 'Name';
|
|
1022
|
+
const Id$1 = 'Id';
|
|
1023
|
+
const Description = 'Description';
|
|
1024
|
+
const Version = 'Version';
|
|
1025
|
+
const Publisher = 'Publisher';
|
|
1026
|
+
const MarketplaceLink = 'Marketplace Link';
|
|
1021
1027
|
|
|
1022
1028
|
const noExtensionsFound = () => {
|
|
1023
1029
|
return i18nString(NoExtensionsFound);
|
|
1024
1030
|
};
|
|
1031
|
+
const name = () => {
|
|
1032
|
+
return i18nString(Name);
|
|
1033
|
+
};
|
|
1034
|
+
const id = () => {
|
|
1035
|
+
return i18nString(Id$1);
|
|
1036
|
+
};
|
|
1037
|
+
const version = () => {
|
|
1038
|
+
return i18nString(Version);
|
|
1039
|
+
};
|
|
1040
|
+
const description = () => {
|
|
1041
|
+
return i18nString(Description);
|
|
1042
|
+
};
|
|
1043
|
+
const publisher = () => {
|
|
1044
|
+
return i18nString(Publisher);
|
|
1045
|
+
};
|
|
1046
|
+
const marketplaceLink = () => {
|
|
1047
|
+
return i18nString(MarketplaceLink);
|
|
1048
|
+
};
|
|
1025
1049
|
const filter = () => {
|
|
1026
1050
|
return i18nString(Filter$1);
|
|
1027
1051
|
};
|
|
@@ -1046,7 +1070,7 @@ const installAnotherVersion = () => {
|
|
|
1046
1070
|
const copy = () => {
|
|
1047
1071
|
return i18nString(Copy);
|
|
1048
1072
|
};
|
|
1049
|
-
const copyExtensionId = () => {
|
|
1073
|
+
const copyExtensionId$1 = () => {
|
|
1050
1074
|
return i18nString(CopyExtensionId);
|
|
1051
1075
|
};
|
|
1052
1076
|
const searchExtensionsInMarketPlace = () => {
|
|
@@ -1134,12 +1158,12 @@ const parseValue = value => {
|
|
|
1134
1158
|
builtin = true;
|
|
1135
1159
|
}
|
|
1136
1160
|
if (match.startsWith(Sort)) {
|
|
1137
|
-
// TODO
|
|
1161
|
+
// TODO correcly parse sort order
|
|
1138
1162
|
sort = 'installs';
|
|
1139
1163
|
}
|
|
1140
1164
|
if (match.startsWith(Id)) {
|
|
1141
|
-
// TODO
|
|
1142
|
-
id = '
|
|
1165
|
+
// TODO improve parsing
|
|
1166
|
+
id = value.replace('@id:', '');
|
|
1143
1167
|
}
|
|
1144
1168
|
if (match.startsWith(Outdated)) {
|
|
1145
1169
|
outdated = true;
|
|
@@ -1169,6 +1193,9 @@ const matchesId = (extension, query) => {
|
|
|
1169
1193
|
return extensionIdLower.includes(query);
|
|
1170
1194
|
};
|
|
1171
1195
|
const matchesParsedValue = (extension, parsedValue) => {
|
|
1196
|
+
if (parsedValue.id && extension.id) {
|
|
1197
|
+
return parsedValue.id === extension.id;
|
|
1198
|
+
}
|
|
1172
1199
|
if (extension.name) {
|
|
1173
1200
|
return matchesName(extension, parsedValue.query);
|
|
1174
1201
|
}
|
|
@@ -1288,488 +1315,109 @@ const closeSuggest = state => {
|
|
|
1288
1315
|
return state;
|
|
1289
1316
|
};
|
|
1290
1317
|
|
|
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
|
-
};
|
|
1318
|
+
const None$2 = 'none';
|
|
1334
1319
|
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
};
|
|
1320
|
+
const Button$2 = 1;
|
|
1321
|
+
const Div = 4;
|
|
1322
|
+
const Input = 6;
|
|
1323
|
+
const Text = 12;
|
|
1324
|
+
const Img = 17;
|
|
1341
1325
|
|
|
1342
|
-
const
|
|
1343
|
-
|
|
1344
|
-
|
|
1326
|
+
const Button$1 = 'event.button';
|
|
1327
|
+
const ClientX = 'event.clientX';
|
|
1328
|
+
const ClientY = 'event.clientY';
|
|
1329
|
+
const DeltaMode = 'event.deltaMode';
|
|
1330
|
+
const DeltaY = 'event.deltaY';
|
|
1331
|
+
const TargetValue = 'event.target.value';
|
|
1345
1332
|
|
|
1346
|
-
const
|
|
1347
|
-
return newState.inputSource === User || oldState.searchValue === newState.searchValue;
|
|
1348
|
-
};
|
|
1333
|
+
const LeftClick = 0;
|
|
1349
1334
|
|
|
1350
|
-
const
|
|
1351
|
-
const
|
|
1352
|
-
const RenderItems = 4;
|
|
1353
|
-
const RenderScrollBar = 5;
|
|
1354
|
-
const RenderMessage = 6;
|
|
1355
|
-
const RenderSearchValue = 7;
|
|
1356
|
-
const RenderFocusContext = 8;
|
|
1335
|
+
const DebugWorker = 55;
|
|
1336
|
+
const RendererWorker$1 = 1;
|
|
1357
1337
|
|
|
1358
|
-
const
|
|
1359
|
-
const
|
|
1338
|
+
const rpcs = Object.create(null);
|
|
1339
|
+
const set$3 = (id, rpc) => {
|
|
1340
|
+
rpcs[id] = rpc;
|
|
1341
|
+
};
|
|
1342
|
+
const get$1 = id => {
|
|
1343
|
+
return rpcs[id];
|
|
1344
|
+
};
|
|
1360
1345
|
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1346
|
+
const create$1 = rpcId => {
|
|
1347
|
+
return {
|
|
1348
|
+
// @ts-ignore
|
|
1349
|
+
invoke(method, ...params) {
|
|
1350
|
+
const rpc = get$1(rpcId);
|
|
1351
|
+
// @ts-ignore
|
|
1352
|
+
return rpc.invoke(method, ...params);
|
|
1353
|
+
},
|
|
1354
|
+
// @ts-ignore
|
|
1355
|
+
invokeAndTransfer(method, ...params) {
|
|
1356
|
+
const rpc = get$1(rpcId);
|
|
1357
|
+
// @ts-ignore
|
|
1358
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1359
|
+
},
|
|
1360
|
+
set(rpc) {
|
|
1361
|
+
set$3(rpcId, rpc);
|
|
1362
|
+
},
|
|
1363
|
+
async dispose() {
|
|
1364
|
+
const rpc = get$1(rpcId);
|
|
1365
|
+
await rpc.dispose();
|
|
1371
1366
|
}
|
|
1372
|
-
}
|
|
1373
|
-
return diffResult;
|
|
1367
|
+
};
|
|
1374
1368
|
};
|
|
1375
1369
|
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1370
|
+
const {
|
|
1371
|
+
invoke: invoke$1,
|
|
1372
|
+
invokeAndTransfer,
|
|
1373
|
+
set: set$2,
|
|
1374
|
+
dispose: dispose$2
|
|
1375
|
+
} = create$1(RendererWorker$1);
|
|
1376
|
+
const searchFileHtml = async uri => {
|
|
1377
|
+
return invoke$1('ExtensionHost.searchFileWithHtml', uri);
|
|
1378
1378
|
};
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
// of visible items needed, e.g. when not scrolled 5 items with
|
|
1382
|
-
// 20px fill 100px but when scrolled 6 items are needed
|
|
1383
|
-
const getNumberOfVisibleItems = (listHeight, itemHeight) => {
|
|
1384
|
-
return Math.ceil(listHeight / itemHeight) + 1;
|
|
1379
|
+
const getFilePathElectron = async file => {
|
|
1380
|
+
return invoke$1('FileSystemHandle.getFilePathElectron', file);
|
|
1385
1381
|
};
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1388
|
-
return scrollBarOffset;
|
|
1382
|
+
const showContextMenu$1 = async (x, y, id, ...args) => {
|
|
1383
|
+
return invoke$1('ContextMenu.show', x, y, id, ...args);
|
|
1389
1384
|
};
|
|
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
|
-
};
|
|
1385
|
+
const getElectronVersion = async () => {
|
|
1386
|
+
return invoke$1('Process.getElectronVersion');
|
|
1412
1387
|
};
|
|
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
|
-
};
|
|
1388
|
+
const applyBulkReplacement = async bulkEdits => {
|
|
1389
|
+
await invoke$1('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1434
1390
|
};
|
|
1435
|
-
const
|
|
1436
|
-
|
|
1437
|
-
|
|
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
|
-
};
|
|
1391
|
+
const setColorTheme = async id => {
|
|
1392
|
+
// @ts-ignore
|
|
1393
|
+
return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1468
1394
|
};
|
|
1469
|
-
const
|
|
1470
|
-
return
|
|
1395
|
+
const getNodeVersion = async () => {
|
|
1396
|
+
return invoke$1('Process.getNodeVersion');
|
|
1471
1397
|
};
|
|
1472
|
-
const
|
|
1473
|
-
return
|
|
1398
|
+
const getChromeVersion = async () => {
|
|
1399
|
+
return invoke$1('Process.getChromeVersion');
|
|
1474
1400
|
};
|
|
1475
|
-
const
|
|
1476
|
-
return (
|
|
1401
|
+
const getV8Version = async () => {
|
|
1402
|
+
return invoke$1('Process.getV8Version');
|
|
1477
1403
|
};
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1404
|
+
const getFileHandles = async fileIds => {
|
|
1405
|
+
const files = await invoke$1('FileSystemHandle.getFileHandles', fileIds);
|
|
1406
|
+
return files;
|
|
1480
1407
|
};
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1483
|
-
return focusIndex(state, firstIndex);
|
|
1408
|
+
const setWorkspacePath = async path => {
|
|
1409
|
+
await invoke$1('Workspace.setPath', path);
|
|
1484
1410
|
};
|
|
1485
|
-
const
|
|
1486
|
-
|
|
1487
|
-
items
|
|
1488
|
-
} = state;
|
|
1489
|
-
const lastIndex = last(items);
|
|
1490
|
-
return focusIndex(state, lastIndex);
|
|
1411
|
+
const registerWebViewInterceptor = async (id, port) => {
|
|
1412
|
+
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
1491
1413
|
};
|
|
1492
|
-
const
|
|
1493
|
-
|
|
1494
|
-
focusedIndex,
|
|
1495
|
-
items
|
|
1496
|
-
} = state;
|
|
1497
|
-
const nextIndex = next(items, focusedIndex);
|
|
1498
|
-
return focusIndex(state, nextIndex);
|
|
1414
|
+
const unregisterWebViewInterceptor = async id => {
|
|
1415
|
+
await invoke$1('WebView.unregisterInterceptor', id);
|
|
1499
1416
|
};
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
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);
|
|
1736
|
-
};
|
|
1737
|
-
const getElectronVersion = async () => {
|
|
1738
|
-
return invoke$1('Process.getElectronVersion');
|
|
1739
|
-
};
|
|
1740
|
-
const applyBulkReplacement = async bulkEdits => {
|
|
1741
|
-
await invoke$1('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1742
|
-
};
|
|
1743
|
-
const setColorTheme = async id => {
|
|
1744
|
-
// @ts-ignore
|
|
1745
|
-
return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1746
|
-
};
|
|
1747
|
-
const getNodeVersion = async () => {
|
|
1748
|
-
return invoke$1('Process.getNodeVersion');
|
|
1749
|
-
};
|
|
1750
|
-
const getChromeVersion = async () => {
|
|
1751
|
-
return invoke$1('Process.getChromeVersion');
|
|
1752
|
-
};
|
|
1753
|
-
const getV8Version = async () => {
|
|
1754
|
-
return invoke$1('Process.getV8Version');
|
|
1755
|
-
};
|
|
1756
|
-
const getFileHandles = async fileIds => {
|
|
1757
|
-
const files = await invoke$1('FileSystemHandle.getFileHandles', fileIds);
|
|
1758
|
-
return files;
|
|
1759
|
-
};
|
|
1760
|
-
const setWorkspacePath = async path => {
|
|
1761
|
-
await invoke$1('Workspace.setPath', path);
|
|
1762
|
-
};
|
|
1763
|
-
const registerWebViewInterceptor = async (id, port) => {
|
|
1764
|
-
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
1765
|
-
};
|
|
1766
|
-
const unregisterWebViewInterceptor = async id => {
|
|
1767
|
-
await invoke$1('WebView.unregisterInterceptor', id);
|
|
1768
|
-
};
|
|
1769
|
-
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1770
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1771
|
-
// @ts-ignore
|
|
1772
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1417
|
+
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1418
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1419
|
+
// @ts-ignore
|
|
1420
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1773
1421
|
};
|
|
1774
1422
|
const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
1775
1423
|
const command = 'Errors.handleMessagePort';
|
|
@@ -1843,7 +1491,7 @@ const confirm = async (message, options) => {
|
|
|
1843
1491
|
const getRecentlyOpened = async () => {
|
|
1844
1492
|
return invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1845
1493
|
};
|
|
1846
|
-
const getKeyBindings = async () => {
|
|
1494
|
+
const getKeyBindings$1 = async () => {
|
|
1847
1495
|
return invoke$1('KeyBindingsInitial.getKeyBindings');
|
|
1848
1496
|
};
|
|
1849
1497
|
const writeClipBoardText = async text => {
|
|
@@ -1965,113 +1613,571 @@ const setExtensionsSearchValue = async searchValue => {
|
|
|
1965
1613
|
// @ts-ignore
|
|
1966
1614
|
return invoke$1('Extensions.handleInput', searchValue);
|
|
1967
1615
|
};
|
|
1968
|
-
const openExternal = async uri => {
|
|
1969
|
-
// @ts-ignore
|
|
1970
|
-
await invoke$1('Open.openExternal', uri);
|
|
1616
|
+
const openExternal = async uri => {
|
|
1617
|
+
// @ts-ignore
|
|
1618
|
+
await invoke$1('Open.openExternal', uri);
|
|
1619
|
+
};
|
|
1620
|
+
const openUrl = async uri => {
|
|
1621
|
+
// @ts-ignore
|
|
1622
|
+
await invoke$1('Open.openUrl', uri);
|
|
1623
|
+
};
|
|
1624
|
+
const getAllPreferences = async () => {
|
|
1625
|
+
// @ts-ignore
|
|
1626
|
+
return invoke$1('Preferences.getAll');
|
|
1627
|
+
};
|
|
1628
|
+
const showSaveFilePicker = async () => {
|
|
1629
|
+
// @ts-ignore
|
|
1630
|
+
return invoke$1('FilePicker.showSaveFilePicker');
|
|
1631
|
+
};
|
|
1632
|
+
const getLogsDir = async () => {
|
|
1633
|
+
// @ts-ignore
|
|
1634
|
+
return invoke$1('PlatformPaths.getLogsDir');
|
|
1635
|
+
};
|
|
1636
|
+
const registerMockRpc = commandMap => {
|
|
1637
|
+
const mockRpc = createMockRpc({
|
|
1638
|
+
commandMap
|
|
1639
|
+
});
|
|
1640
|
+
set$2(mockRpc);
|
|
1641
|
+
return mockRpc;
|
|
1642
|
+
};
|
|
1643
|
+
|
|
1644
|
+
const RendererWorker = {
|
|
1645
|
+
__proto__: null,
|
|
1646
|
+
activateByEvent,
|
|
1647
|
+
applyBulkReplacement,
|
|
1648
|
+
closeWidget,
|
|
1649
|
+
confirm,
|
|
1650
|
+
disableExtension,
|
|
1651
|
+
dispose: dispose$2,
|
|
1652
|
+
enableExtension,
|
|
1653
|
+
getActiveEditorId,
|
|
1654
|
+
getAllExtensions: getAllExtensions$2,
|
|
1655
|
+
getAllPreferences,
|
|
1656
|
+
getBlob,
|
|
1657
|
+
getChromeVersion,
|
|
1658
|
+
getColorThemeNames,
|
|
1659
|
+
getElectronVersion,
|
|
1660
|
+
getExtension,
|
|
1661
|
+
getExtensionCommands,
|
|
1662
|
+
getFileHandles,
|
|
1663
|
+
getFileIcon,
|
|
1664
|
+
getFilePathElectron,
|
|
1665
|
+
getFolderIcon,
|
|
1666
|
+
getFolderSize,
|
|
1667
|
+
getIcons,
|
|
1668
|
+
getKeyBindings: getKeyBindings$1,
|
|
1669
|
+
getLogsDir,
|
|
1670
|
+
getMarkdownDom,
|
|
1671
|
+
getNodeVersion,
|
|
1672
|
+
getPreference,
|
|
1673
|
+
getRecentlyOpened,
|
|
1674
|
+
getV8Version,
|
|
1675
|
+
getWebViewSecret,
|
|
1676
|
+
getWindowId,
|
|
1677
|
+
getWorkspacePath,
|
|
1678
|
+
handleDebugChange,
|
|
1679
|
+
handleDebugPaused,
|
|
1680
|
+
handleDebugResumed,
|
|
1681
|
+
handleDebugScriptParsed,
|
|
1682
|
+
installExtension,
|
|
1683
|
+
invoke: invoke$1,
|
|
1684
|
+
invokeAndTransfer,
|
|
1685
|
+
openExtensionSearch,
|
|
1686
|
+
openExternal,
|
|
1687
|
+
openNativeFolder,
|
|
1688
|
+
openUri: openUri$2,
|
|
1689
|
+
openUrl,
|
|
1690
|
+
openWidget,
|
|
1691
|
+
readFile,
|
|
1692
|
+
registerMockRpc,
|
|
1693
|
+
registerWebViewInterceptor,
|
|
1694
|
+
renderMarkdown,
|
|
1695
|
+
rerenderEditor,
|
|
1696
|
+
searchFileFetch,
|
|
1697
|
+
searchFileHtml,
|
|
1698
|
+
searchFileMemory,
|
|
1699
|
+
sendMessagePortToEditorWorker,
|
|
1700
|
+
sendMessagePortToErrorWorker,
|
|
1701
|
+
sendMessagePortToExtensionHostWorker,
|
|
1702
|
+
sendMessagePortToFileSystemWorker,
|
|
1703
|
+
sendMessagePortToIconThemeWorker,
|
|
1704
|
+
sendMessagePortToMarkdownWorker,
|
|
1705
|
+
sendMessagePortToRendererProcess,
|
|
1706
|
+
sendMessagePortToSearchProcess,
|
|
1707
|
+
sendMessagePortToSyntaxHighlightingWorker,
|
|
1708
|
+
set: set$2,
|
|
1709
|
+
setAdditionalFocus,
|
|
1710
|
+
setColorTheme,
|
|
1711
|
+
setExtensionsSearchValue,
|
|
1712
|
+
setFocus,
|
|
1713
|
+
setWebViewPort,
|
|
1714
|
+
setWorkspacePath,
|
|
1715
|
+
showContextMenu: showContextMenu$1,
|
|
1716
|
+
showErrorDialog,
|
|
1717
|
+
showMessageBox,
|
|
1718
|
+
showSaveFilePicker,
|
|
1719
|
+
uninstallExtension,
|
|
1720
|
+
unregisterWebViewInterceptor,
|
|
1721
|
+
writeClipBoardImage,
|
|
1722
|
+
writeClipBoardText
|
|
1723
|
+
};
|
|
1724
|
+
|
|
1725
|
+
const copyExtensionId = async state => {
|
|
1726
|
+
const {
|
|
1727
|
+
items,
|
|
1728
|
+
focusedIndex
|
|
1729
|
+
} = state;
|
|
1730
|
+
if (focusedIndex === -1) {
|
|
1731
|
+
return state;
|
|
1732
|
+
}
|
|
1733
|
+
const item = items[focusedIndex];
|
|
1734
|
+
const {
|
|
1735
|
+
id
|
|
1736
|
+
} = item;
|
|
1737
|
+
await writeClipBoardText(id);
|
|
1738
|
+
return state;
|
|
1739
|
+
};
|
|
1740
|
+
|
|
1741
|
+
const stringifyRow = row => {
|
|
1742
|
+
const {
|
|
1743
|
+
key,
|
|
1744
|
+
value
|
|
1745
|
+
} = row;
|
|
1746
|
+
return `${key}: ${value}`.trim();
|
|
1747
|
+
};
|
|
1748
|
+
const getExtensionInfoText = extension => {
|
|
1749
|
+
const {
|
|
1750
|
+
name: name$1,
|
|
1751
|
+
id: id$1,
|
|
1752
|
+
publisher: publisher$1,
|
|
1753
|
+
description: description$1
|
|
1754
|
+
} = extension;
|
|
1755
|
+
const version$1 = ''; // TODO
|
|
1756
|
+
const marketplaceLink$1 = ''; // TODO
|
|
1757
|
+
const rows = [{
|
|
1758
|
+
key: name(),
|
|
1759
|
+
value: name$1
|
|
1760
|
+
}, {
|
|
1761
|
+
key: id(),
|
|
1762
|
+
value: id$1
|
|
1763
|
+
}, {
|
|
1764
|
+
key: description(),
|
|
1765
|
+
value: description$1
|
|
1766
|
+
}, {
|
|
1767
|
+
key: version(),
|
|
1768
|
+
value: version$1
|
|
1769
|
+
}, {
|
|
1770
|
+
key: publisher(),
|
|
1771
|
+
value: publisher$1
|
|
1772
|
+
}, {
|
|
1773
|
+
key: marketplaceLink(),
|
|
1774
|
+
value: marketplaceLink$1
|
|
1775
|
+
}];
|
|
1776
|
+
const infoRows = rows.map(stringifyRow);
|
|
1777
|
+
const infoText = infoRows.join('\n');
|
|
1778
|
+
return infoText;
|
|
1779
|
+
};
|
|
1780
|
+
|
|
1781
|
+
const copyExtensionInfo = async state => {
|
|
1782
|
+
const {
|
|
1783
|
+
items,
|
|
1784
|
+
focusedIndex
|
|
1785
|
+
} = state;
|
|
1786
|
+
if (focusedIndex === -1) {
|
|
1787
|
+
return state;
|
|
1788
|
+
}
|
|
1789
|
+
const item = items[focusedIndex];
|
|
1790
|
+
const text = getExtensionInfoText(item);
|
|
1791
|
+
await writeClipBoardText(text);
|
|
1792
|
+
return state;
|
|
1793
|
+
};
|
|
1794
|
+
|
|
1795
|
+
const {
|
|
1796
|
+
get,
|
|
1797
|
+
set: set$1,
|
|
1798
|
+
dispose: dispose$1,
|
|
1799
|
+
wrapCommand,
|
|
1800
|
+
wrapGetter
|
|
1801
|
+
} = create$2();
|
|
1802
|
+
|
|
1803
|
+
const create = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
1804
|
+
const state = {
|
|
1805
|
+
allExtensions: [],
|
|
1806
|
+
assetDir,
|
|
1807
|
+
deltaY: 0,
|
|
1808
|
+
finalDeltaY: 0,
|
|
1809
|
+
focus: 0,
|
|
1810
|
+
focused: false,
|
|
1811
|
+
focusedIndex: 0,
|
|
1812
|
+
handleOffset: 0,
|
|
1813
|
+
headerHeight: 41,
|
|
1814
|
+
height,
|
|
1815
|
+
inputActions: [],
|
|
1816
|
+
inputSource: 0,
|
|
1817
|
+
itemHeight: 72,
|
|
1818
|
+
items: [],
|
|
1819
|
+
maxLineY: 0,
|
|
1820
|
+
message: '',
|
|
1821
|
+
minimumSliderSize: 0,
|
|
1822
|
+
minLineY: 0,
|
|
1823
|
+
negativeMargin: 0,
|
|
1824
|
+
placeholder: '',
|
|
1825
|
+
platform,
|
|
1826
|
+
scrollBarActive: false,
|
|
1827
|
+
scrollBarHeight: 0,
|
|
1828
|
+
scrollBarY: 0,
|
|
1829
|
+
searchValue: '',
|
|
1830
|
+
size: 0,
|
|
1831
|
+
uid: id,
|
|
1832
|
+
width,
|
|
1833
|
+
x,
|
|
1834
|
+
y
|
|
1835
|
+
};
|
|
1836
|
+
set$1(id, state, state);
|
|
1837
|
+
};
|
|
1838
|
+
|
|
1839
|
+
const isEqual$2 = (oldState, newState) => {
|
|
1840
|
+
if (!newState.focus) {
|
|
1841
|
+
return true;
|
|
1842
|
+
}
|
|
1843
|
+
return oldState.focus === newState.focus;
|
|
1844
|
+
};
|
|
1845
|
+
|
|
1846
|
+
const isEqual$1 = (oldState, newState) => {
|
|
1847
|
+
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;
|
|
1848
|
+
};
|
|
1849
|
+
|
|
1850
|
+
const isEqual = (oldState, newState) => {
|
|
1851
|
+
return newState.inputSource === User || oldState.searchValue === newState.searchValue;
|
|
1852
|
+
};
|
|
1853
|
+
|
|
1854
|
+
const RenderHeader = 1;
|
|
1855
|
+
const RenderFocus = 2;
|
|
1856
|
+
const RenderItems = 4;
|
|
1857
|
+
const RenderScrollBar = 5;
|
|
1858
|
+
const RenderMessage = 6;
|
|
1859
|
+
const RenderSearchValue = 7;
|
|
1860
|
+
const RenderFocusContext = 8;
|
|
1861
|
+
|
|
1862
|
+
const modules = [isEqual$1, isEqual$2, isEqual, isEqual$2];
|
|
1863
|
+
const numbers = [RenderItems, RenderFocus, RenderSearchValue, RenderFocusContext];
|
|
1864
|
+
|
|
1865
|
+
const diff2 = uid => {
|
|
1866
|
+
const {
|
|
1867
|
+
oldState,
|
|
1868
|
+
newState
|
|
1869
|
+
} = get(uid);
|
|
1870
|
+
const diffResult = [];
|
|
1871
|
+
for (let i = 0; i < modules.length; i++) {
|
|
1872
|
+
const fn = modules[i];
|
|
1873
|
+
if (!fn(oldState, newState)) {
|
|
1874
|
+
diffResult.push(numbers[i]);
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
return diffResult;
|
|
1878
|
+
};
|
|
1879
|
+
|
|
1880
|
+
const dispose = uid => {
|
|
1881
|
+
dispose$1(uid);
|
|
1882
|
+
};
|
|
1883
|
+
|
|
1884
|
+
// TODO optimize this function to return the minimum number
|
|
1885
|
+
// of visible items needed, e.g. when not scrolled 5 items with
|
|
1886
|
+
// 20px fill 100px but when scrolled 6 items are needed
|
|
1887
|
+
const getNumberOfVisibleItems = (listHeight, itemHeight) => {
|
|
1888
|
+
return Math.ceil(listHeight / itemHeight) + 1;
|
|
1889
|
+
};
|
|
1890
|
+
const getScrollBarOffset = (delta, finalDelta, size, scrollBarSize) => {
|
|
1891
|
+
const scrollBarOffset = delta / finalDelta * (size - scrollBarSize);
|
|
1892
|
+
return scrollBarOffset;
|
|
1893
|
+
};
|
|
1894
|
+
const getScrollBarY = getScrollBarOffset;
|
|
1895
|
+
const focusIndexScrollDown = (state, index, listHeight, itemHeight, itemsLength) => {
|
|
1896
|
+
const {
|
|
1897
|
+
finalDeltaY,
|
|
1898
|
+
height,
|
|
1899
|
+
headerHeight,
|
|
1900
|
+
scrollBarHeight
|
|
1901
|
+
} = state;
|
|
1902
|
+
const newMaxLineY = Math.min(index + 1, itemsLength);
|
|
1903
|
+
const fittingItems = getNumberOfVisibleItems(listHeight, itemHeight);
|
|
1904
|
+
const newMinLineY = Math.max(newMaxLineY - fittingItems, 0);
|
|
1905
|
+
const newDeltaY = itemsLength < fittingItems ? 0 : newMinLineY * itemHeight - listHeight % itemHeight + itemHeight;
|
|
1906
|
+
const scrollBarY = getScrollBarY(newDeltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
|
|
1907
|
+
return {
|
|
1908
|
+
...state,
|
|
1909
|
+
focusedIndex: index,
|
|
1910
|
+
minLineY: newMinLineY,
|
|
1911
|
+
maxLineY: newMaxLineY,
|
|
1912
|
+
focused: true,
|
|
1913
|
+
deltaY: newDeltaY,
|
|
1914
|
+
scrollBarY
|
|
1915
|
+
};
|
|
1916
|
+
};
|
|
1917
|
+
const focusIndexScrollUp = (state, index, listHeight, itemHeight, itemsLength) => {
|
|
1918
|
+
const {
|
|
1919
|
+
finalDeltaY,
|
|
1920
|
+
height,
|
|
1921
|
+
headerHeight,
|
|
1922
|
+
scrollBarHeight
|
|
1923
|
+
} = state;
|
|
1924
|
+
const newMinLineY = index;
|
|
1925
|
+
const fittingItems = getNumberOfVisibleItems(listHeight, itemHeight);
|
|
1926
|
+
const newMaxLineY = Math.min(newMinLineY + fittingItems, itemsLength);
|
|
1927
|
+
const newDeltaY = newMinLineY * itemHeight;
|
|
1928
|
+
const scrollBarY = getScrollBarY(newDeltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
|
|
1929
|
+
return {
|
|
1930
|
+
...state,
|
|
1931
|
+
focusedIndex: index,
|
|
1932
|
+
minLineY: newMinLineY,
|
|
1933
|
+
maxLineY: newMaxLineY,
|
|
1934
|
+
focused: true,
|
|
1935
|
+
deltaY: newDeltaY,
|
|
1936
|
+
scrollBarY
|
|
1937
|
+
};
|
|
1938
|
+
};
|
|
1939
|
+
const focusIndex = (state, index) => {
|
|
1940
|
+
const {
|
|
1941
|
+
itemHeight,
|
|
1942
|
+
minLineY,
|
|
1943
|
+
maxLineY,
|
|
1944
|
+
headerHeight,
|
|
1945
|
+
height,
|
|
1946
|
+
items
|
|
1947
|
+
} = state;
|
|
1948
|
+
const itemsLength = items.length;
|
|
1949
|
+
if (itemsLength === 0) {
|
|
1950
|
+
return state;
|
|
1951
|
+
}
|
|
1952
|
+
number(itemHeight);
|
|
1953
|
+
if (index === -1) {
|
|
1954
|
+
return {
|
|
1955
|
+
...state,
|
|
1956
|
+
focusedIndex: -1,
|
|
1957
|
+
focused: true
|
|
1958
|
+
};
|
|
1959
|
+
}
|
|
1960
|
+
const listHeight = height - headerHeight;
|
|
1961
|
+
if (index < minLineY + 1) {
|
|
1962
|
+
return focusIndexScrollUp(state, index, listHeight, itemHeight, itemsLength);
|
|
1963
|
+
}
|
|
1964
|
+
if (index >= maxLineY - 1) {
|
|
1965
|
+
return focusIndexScrollDown(state, index, listHeight, itemHeight, itemsLength);
|
|
1966
|
+
}
|
|
1967
|
+
return {
|
|
1968
|
+
...state,
|
|
1969
|
+
focusedIndex: index,
|
|
1970
|
+
focused: true
|
|
1971
|
+
};
|
|
1972
|
+
};
|
|
1973
|
+
const first = () => {
|
|
1974
|
+
return 0;
|
|
1975
|
+
};
|
|
1976
|
+
const last = items => {
|
|
1977
|
+
return items.length - 1;
|
|
1978
|
+
};
|
|
1979
|
+
const next = (items, index) => {
|
|
1980
|
+
return (index + 1) % items.length;
|
|
1981
|
+
};
|
|
1982
|
+
const previous = (items, index) => {
|
|
1983
|
+
return index === 0 ? items.length - 1 : index - 1;
|
|
1984
|
+
};
|
|
1985
|
+
const focusFirst = state => {
|
|
1986
|
+
const firstIndex = first();
|
|
1987
|
+
return focusIndex(state, firstIndex);
|
|
1988
|
+
};
|
|
1989
|
+
const focusLast = state => {
|
|
1990
|
+
const {
|
|
1991
|
+
items
|
|
1992
|
+
} = state;
|
|
1993
|
+
const lastIndex = last(items);
|
|
1994
|
+
return focusIndex(state, lastIndex);
|
|
1995
|
+
};
|
|
1996
|
+
const focusNext = state => {
|
|
1997
|
+
const {
|
|
1998
|
+
focusedIndex,
|
|
1999
|
+
items
|
|
2000
|
+
} = state;
|
|
2001
|
+
const nextIndex = next(items, focusedIndex);
|
|
2002
|
+
return focusIndex(state, nextIndex);
|
|
2003
|
+
};
|
|
2004
|
+
|
|
2005
|
+
// based on https://github.com/microsoft/vscode/blob/c0769274fa136b45799edeccc0d0a2f645b75caf/src/vs/base/common/arrays.ts#L625 (License MIT)
|
|
2006
|
+
|
|
2007
|
+
const isLastIndex = (array, index) => {
|
|
2008
|
+
return index === array.length - 1;
|
|
2009
|
+
};
|
|
2010
|
+
const lastIndex = array => {
|
|
2011
|
+
return array.length - 1;
|
|
2012
|
+
};
|
|
2013
|
+
const focusNextPage = state => {
|
|
2014
|
+
const {
|
|
2015
|
+
focusedIndex,
|
|
2016
|
+
items,
|
|
2017
|
+
maxLineY,
|
|
2018
|
+
minLineY
|
|
2019
|
+
} = state;
|
|
2020
|
+
if (isLastIndex(items, focusedIndex)) {
|
|
2021
|
+
return state;
|
|
2022
|
+
}
|
|
2023
|
+
const indexNextPage = Math.min(maxLineY + (maxLineY - minLineY) - 2, lastIndex(items));
|
|
2024
|
+
return focusIndex(state, indexNextPage);
|
|
2025
|
+
};
|
|
2026
|
+
const focusPrevious = state => {
|
|
2027
|
+
const {
|
|
2028
|
+
focusedIndex,
|
|
2029
|
+
items
|
|
2030
|
+
} = state;
|
|
2031
|
+
if (focusedIndex === 0 || focusedIndex === -1) {
|
|
2032
|
+
return state;
|
|
2033
|
+
}
|
|
2034
|
+
const previousIndex = previous(items, focusedIndex);
|
|
2035
|
+
return focusIndex(state, previousIndex);
|
|
2036
|
+
};
|
|
2037
|
+
const focusPreviousPage = state => {
|
|
2038
|
+
const {
|
|
2039
|
+
focusedIndex,
|
|
2040
|
+
minLineY,
|
|
2041
|
+
maxLineY
|
|
2042
|
+
} = state;
|
|
2043
|
+
if (focusedIndex === 0 || focusedIndex === -1) {
|
|
2044
|
+
return state;
|
|
2045
|
+
}
|
|
2046
|
+
const indexPreviousPage = Math.max(minLineY - (maxLineY - minLineY) + 1, 0);
|
|
2047
|
+
return focusIndex(state, indexPreviousPage);
|
|
1971
2048
|
};
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
2049
|
+
|
|
2050
|
+
const Button = 1;
|
|
2051
|
+
|
|
2052
|
+
const ClearAll = 'ClearAll';
|
|
2053
|
+
const Filter = 'Filter';
|
|
2054
|
+
const Refresh = 'Refresh';
|
|
2055
|
+
const Ellipsis = 'Ellipsis';
|
|
2056
|
+
|
|
2057
|
+
const getActions = () => {
|
|
2058
|
+
return [{
|
|
2059
|
+
type: Button,
|
|
2060
|
+
id: refresh(),
|
|
2061
|
+
icon: Refresh,
|
|
2062
|
+
command: ''
|
|
2063
|
+
}, {
|
|
2064
|
+
type: Button,
|
|
2065
|
+
id: viewsAndMoreActions(),
|
|
2066
|
+
icon: Ellipsis,
|
|
2067
|
+
command: ''
|
|
2068
|
+
}];
|
|
1975
2069
|
};
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
2070
|
+
|
|
2071
|
+
const commandMapRef = {};
|
|
2072
|
+
|
|
2073
|
+
const toCommandId = key => {
|
|
2074
|
+
const dotIndex = key.indexOf('.');
|
|
2075
|
+
return key.slice(dotIndex + 1);
|
|
1979
2076
|
};
|
|
1980
|
-
const
|
|
1981
|
-
|
|
1982
|
-
|
|
2077
|
+
const getCommandIds = () => {
|
|
2078
|
+
const keys = Object.keys(commandMapRef);
|
|
2079
|
+
const ids = keys.map(toCommandId);
|
|
2080
|
+
return ids;
|
|
1983
2081
|
};
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
2082
|
+
|
|
2083
|
+
const Enter = 3;
|
|
2084
|
+
const Space = 9;
|
|
2085
|
+
const PageUp = 10;
|
|
2086
|
+
const PageDown = 11;
|
|
2087
|
+
const End = 255;
|
|
2088
|
+
const Home = 12;
|
|
2089
|
+
const UpArrow = 14;
|
|
2090
|
+
const DownArrow = 16;
|
|
2091
|
+
|
|
2092
|
+
const CtrlCmd = 1 << 11 >>> 0;
|
|
2093
|
+
|
|
2094
|
+
const FocusExtensions = 15;
|
|
2095
|
+
const FocusExtensionsInput = 7000;
|
|
2096
|
+
|
|
2097
|
+
const getKeyBindings = () => {
|
|
2098
|
+
return [{
|
|
2099
|
+
key: Home,
|
|
2100
|
+
command: 'Extensions.focusFirst',
|
|
2101
|
+
when: FocusExtensions
|
|
2102
|
+
}, {
|
|
2103
|
+
key: End,
|
|
2104
|
+
command: 'Extensions.focusLast',
|
|
2105
|
+
when: FocusExtensions
|
|
2106
|
+
}, {
|
|
2107
|
+
key: PageUp,
|
|
2108
|
+
command: 'Extensions.focusPreviousPage',
|
|
2109
|
+
when: FocusExtensions
|
|
2110
|
+
}, {
|
|
2111
|
+
key: PageDown,
|
|
2112
|
+
command: 'Extensions.focusNextPage',
|
|
2113
|
+
when: FocusExtensions
|
|
2114
|
+
}, {
|
|
2115
|
+
key: UpArrow,
|
|
2116
|
+
command: 'Extensions.focusPrevious',
|
|
2117
|
+
when: FocusExtensions
|
|
2118
|
+
}, {
|
|
2119
|
+
key: DownArrow,
|
|
2120
|
+
command: 'Extensions.focusNext',
|
|
2121
|
+
when: FocusExtensions
|
|
2122
|
+
}, {
|
|
2123
|
+
key: Space,
|
|
2124
|
+
command: 'Extensions.handleClickCurrentButKeepFocus',
|
|
2125
|
+
when: FocusExtensions
|
|
2126
|
+
}, {
|
|
2127
|
+
key: Enter,
|
|
2128
|
+
command: 'Extensions.handleClickCurrent',
|
|
2129
|
+
when: FocusExtensions
|
|
2130
|
+
}, {
|
|
2131
|
+
key: CtrlCmd | Space,
|
|
2132
|
+
command: 'Extensions.toggleSuggest',
|
|
2133
|
+
when: FocusExtensions
|
|
2134
|
+
}, {
|
|
2135
|
+
key: CtrlCmd | DownArrow,
|
|
2136
|
+
command: 'Extensions.scrollDown',
|
|
2137
|
+
when: FocusExtensions
|
|
2138
|
+
}];
|
|
1987
2139
|
};
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
2140
|
+
|
|
2141
|
+
const None$1 = 0;
|
|
2142
|
+
|
|
2143
|
+
const getMenuEntries = () => {
|
|
2144
|
+
return [{
|
|
2145
|
+
id: 'enable',
|
|
2146
|
+
label: enable(),
|
|
2147
|
+
flags: None$1,
|
|
2148
|
+
command: 'SearchExtensions.enable'
|
|
2149
|
+
}, {
|
|
2150
|
+
id: 'disable',
|
|
2151
|
+
label: disable(),
|
|
2152
|
+
flags: None$1,
|
|
2153
|
+
command: 'SearchExtensions.disable'
|
|
2154
|
+
}, {
|
|
2155
|
+
id: 'installAnotherVersion',
|
|
2156
|
+
label: installAnotherVersion(),
|
|
2157
|
+
flags: None$1,
|
|
2158
|
+
command: 'SearchExtensions.installAnotherVersion'
|
|
2159
|
+
}, {
|
|
2160
|
+
id: 'copy',
|
|
2161
|
+
label: copy(),
|
|
2162
|
+
flags: None$1,
|
|
2163
|
+
command: 'SearchExtensions.copy'
|
|
2164
|
+
}, {
|
|
2165
|
+
id: 'copyExtensionId',
|
|
2166
|
+
label: copyExtensionId$1(),
|
|
2167
|
+
flags: None$1,
|
|
2168
|
+
command: 'SearchExtensions.copyExtensionId'
|
|
2169
|
+
}];
|
|
1994
2170
|
};
|
|
1995
2171
|
|
|
1996
|
-
const
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
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
|
|
2172
|
+
const handleBlur = state => {
|
|
2173
|
+
return {
|
|
2174
|
+
...state,
|
|
2175
|
+
focus: None$3
|
|
2176
|
+
};
|
|
2177
|
+
};
|
|
2178
|
+
|
|
2179
|
+
const getExtensionDetailUri = extensionId => {
|
|
2180
|
+
return `extension-detail://${extensionId}`;
|
|
2075
2181
|
};
|
|
2076
2182
|
|
|
2077
2183
|
const {
|
|
@@ -2102,6 +2208,18 @@ const handleClick = async (state, index) => {
|
|
|
2102
2208
|
return newState;
|
|
2103
2209
|
};
|
|
2104
2210
|
|
|
2211
|
+
const mergeClassNames = (...classNames) => {
|
|
2212
|
+
return classNames.filter(Boolean).join(' ');
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
const text = data => {
|
|
2216
|
+
return {
|
|
2217
|
+
type: Text,
|
|
2218
|
+
text: data,
|
|
2219
|
+
childCount: 0
|
|
2220
|
+
};
|
|
2221
|
+
};
|
|
2222
|
+
|
|
2105
2223
|
const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight, headerHeight) => {
|
|
2106
2224
|
const relativeDeltaY = deltaY % itemHeight;
|
|
2107
2225
|
const relativeY = eventY - y - headerHeight + relativeDeltaY;
|
|
@@ -2109,7 +2227,10 @@ const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight, headerHeight) =>
|
|
|
2109
2227
|
return index;
|
|
2110
2228
|
};
|
|
2111
2229
|
|
|
2112
|
-
const handleClickAt = async (state, eventX, eventY) => {
|
|
2230
|
+
const handleClickAt = async (state, button, eventX, eventY) => {
|
|
2231
|
+
if (button !== LeftClick) {
|
|
2232
|
+
return state;
|
|
2233
|
+
}
|
|
2113
2234
|
const {
|
|
2114
2235
|
x,
|
|
2115
2236
|
y,
|
|
@@ -2326,19 +2447,19 @@ const getAllExtensions = platform => {
|
|
|
2326
2447
|
return getAllExtensions$1(platform);
|
|
2327
2448
|
};
|
|
2328
2449
|
|
|
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 =
|
|
2450
|
+
const HandleClearSearchResults = 1;
|
|
2451
|
+
const HandleClickFilter = 2;
|
|
2452
|
+
const HandleContextMenu = 3;
|
|
2453
|
+
const HandleExtensionsInput = 4;
|
|
2454
|
+
const HandleFocus = 5;
|
|
2455
|
+
const HandlePointerDown = 7;
|
|
2456
|
+
const HandleScrollBarMove = 9;
|
|
2457
|
+
const HandleScrollBarPointerCaptureLost = 10;
|
|
2458
|
+
const HandleScrollBarPointerDown = 11;
|
|
2459
|
+
const HandleTouchEnd = 12;
|
|
2460
|
+
const HandleTouchMove = 13;
|
|
2461
|
+
const HandleTouchStart = 14;
|
|
2462
|
+
const HandleWheel = 15;
|
|
2342
2463
|
|
|
2343
2464
|
const getInputActions = newState => {
|
|
2344
2465
|
const clearEnabled = newState.searchValue.length > 0;
|
|
@@ -2346,12 +2467,12 @@ const getInputActions = newState => {
|
|
|
2346
2467
|
onClick: HandleClearSearchResults,
|
|
2347
2468
|
icon: `MaskIcon${ClearAll}`,
|
|
2348
2469
|
title: clearExtensionSearchResults(),
|
|
2349
|
-
type: Button
|
|
2470
|
+
type: Button,
|
|
2350
2471
|
enabled: clearEnabled
|
|
2351
2472
|
}, {
|
|
2352
2473
|
icon: `MaskIcon${Filter}`,
|
|
2353
2474
|
title: filter(),
|
|
2354
|
-
type: Button
|
|
2475
|
+
type: Button,
|
|
2355
2476
|
onClick: HandleClickFilter,
|
|
2356
2477
|
enabled: true
|
|
2357
2478
|
}];
|
|
@@ -2558,18 +2679,6 @@ const renderFocusContext = newState => {
|
|
|
2558
2679
|
return [];
|
|
2559
2680
|
};
|
|
2560
2681
|
|
|
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
2682
|
const Actions = 'Actions';
|
|
2574
2683
|
const ExtensionActions = 'ExtensionActions';
|
|
2575
2684
|
const ExtensionActive = 'ExtensionActive';
|
|
@@ -2618,7 +2727,7 @@ const getSearchFieldButtonVirtualDom = button => {
|
|
|
2618
2727
|
onClick
|
|
2619
2728
|
} = button;
|
|
2620
2729
|
return [{
|
|
2621
|
-
type: Button,
|
|
2730
|
+
type: Button$2,
|
|
2622
2731
|
className: getClassName$1(enabled),
|
|
2623
2732
|
title,
|
|
2624
2733
|
tabIndex: 0,
|
|
@@ -2645,6 +2754,7 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
|
|
|
2645
2754
|
spellcheck: false,
|
|
2646
2755
|
autocapitalize: 'off',
|
|
2647
2756
|
autocorrect: 'off',
|
|
2757
|
+
autocomplete: 'off',
|
|
2648
2758
|
placeholder,
|
|
2649
2759
|
name,
|
|
2650
2760
|
onInput,
|
|
@@ -2881,7 +2991,7 @@ const getExtensionsViewVirtualDom = state => {
|
|
|
2881
2991
|
childCount: 2,
|
|
2882
2992
|
ariaLive: 'polite',
|
|
2883
2993
|
ariaBusy: false,
|
|
2884
|
-
role: None$
|
|
2994
|
+
role: None$2
|
|
2885
2995
|
}, ...getExtensionHeaderVirtualDom(placeholder, inputActions), ...getContentVirtualDom(visibleExtensions, message, scrollBarHeight, scrollBarY)];
|
|
2886
2996
|
};
|
|
2887
2997
|
|
|
@@ -2951,8 +3061,8 @@ const render3 = (uid, diffResult) => {
|
|
|
2951
3061
|
const {
|
|
2952
3062
|
oldState,
|
|
2953
3063
|
newState
|
|
2954
|
-
} = get
|
|
2955
|
-
set$
|
|
3064
|
+
} = get(uid);
|
|
3065
|
+
set$1(uid, newState, newState);
|
|
2956
3066
|
const commands = applyRender(oldState, newState, diffResult);
|
|
2957
3067
|
return commands;
|
|
2958
3068
|
};
|
|
@@ -2972,7 +3082,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2972
3082
|
icon
|
|
2973
3083
|
} = action;
|
|
2974
3084
|
return [{
|
|
2975
|
-
type: Button,
|
|
3085
|
+
type: Button$2,
|
|
2976
3086
|
className: IconButton,
|
|
2977
3087
|
title: id,
|
|
2978
3088
|
childCount: 1
|
|
@@ -2981,7 +3091,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2981
3091
|
|
|
2982
3092
|
const getActionVirtualDom = action => {
|
|
2983
3093
|
switch (action.type) {
|
|
2984
|
-
case Button
|
|
3094
|
+
case Button:
|
|
2985
3095
|
return getActionButtonVirtualDom(action);
|
|
2986
3096
|
default:
|
|
2987
3097
|
return [];
|
|
@@ -3001,7 +3111,7 @@ const renderActions = uid => {
|
|
|
3001
3111
|
const {
|
|
3002
3112
|
oldState,
|
|
3003
3113
|
newState
|
|
3004
|
-
} = get
|
|
3114
|
+
} = get(uid);
|
|
3005
3115
|
if (oldState === newState) {
|
|
3006
3116
|
return [];
|
|
3007
3117
|
}
|
|
@@ -3013,30 +3123,30 @@ const renderActions = uid => {
|
|
|
3013
3123
|
const renderEventListeners = () => {
|
|
3014
3124
|
return [{
|
|
3015
3125
|
name: HandleContextMenu,
|
|
3016
|
-
params: ['handleContextMenu',
|
|
3126
|
+
params: ['handleContextMenu', Button$1, ClientX, ClientY],
|
|
3017
3127
|
preventDefault: true
|
|
3018
3128
|
}, {
|
|
3019
3129
|
name: HandlePointerDown,
|
|
3020
|
-
params: ['handleClickAt',
|
|
3130
|
+
params: ['handleClickAt', Button$1, ClientX, ClientY],
|
|
3021
3131
|
preventDefault: true
|
|
3022
3132
|
}, {
|
|
3023
3133
|
name: HandleScrollBarPointerDown,
|
|
3024
|
-
params: ['handleScrollBarClick',
|
|
3134
|
+
params: ['handleScrollBarClick', ClientY],
|
|
3025
3135
|
preventDefault: true,
|
|
3026
3136
|
trackPointerEvents: [HandleScrollBarMove, HandleScrollBarPointerCaptureLost]
|
|
3027
3137
|
}, {
|
|
3028
3138
|
name: HandleScrollBarMove,
|
|
3029
|
-
params: ['handleScrollBarMove',
|
|
3139
|
+
params: ['handleScrollBarMove', ClientY]
|
|
3030
3140
|
}, {
|
|
3031
3141
|
name: HandleScrollBarPointerCaptureLost,
|
|
3032
3142
|
params: ['handleScrollBarCaptureLost']
|
|
3033
3143
|
}, {
|
|
3034
3144
|
name: HandleWheel,
|
|
3035
|
-
params: ['handleWheel',
|
|
3145
|
+
params: ['handleWheel', DeltaMode, DeltaY],
|
|
3036
3146
|
passive: true
|
|
3037
3147
|
}, {
|
|
3038
3148
|
name: HandleExtensionsInput,
|
|
3039
|
-
params: ['handleInput',
|
|
3149
|
+
params: ['handleInput', TargetValue, User]
|
|
3040
3150
|
}, {
|
|
3041
3151
|
name: HandleClearSearchResults,
|
|
3042
3152
|
params: ['clearSearchResults']
|
|
@@ -3083,9 +3193,9 @@ const toggleSuggest = state => {
|
|
|
3083
3193
|
const commandMap = {
|
|
3084
3194
|
'SearchExtensions.clearSearchResults': wrapCommand(clearSearchResults),
|
|
3085
3195
|
'SearchExtensions.closeSuggest': wrapCommand(closeSuggest),
|
|
3086
|
-
'SearchExtensions.create': create
|
|
3196
|
+
'SearchExtensions.create': create,
|
|
3087
3197
|
'SearchExtensions.diff2': diff2,
|
|
3088
|
-
'SearchExtensions.dispose': dispose
|
|
3198
|
+
'SearchExtensions.dispose': dispose,
|
|
3089
3199
|
'SearchExtensions.focusFirst': wrapCommand(focusFirst),
|
|
3090
3200
|
'SearchExtensions.focusIndex': wrapCommand(focusIndex),
|
|
3091
3201
|
'SearchExtensions.focusLast': wrapCommand(focusLast),
|
|
@@ -3095,9 +3205,10 @@ const commandMap = {
|
|
|
3095
3205
|
'SearchExtensions.focusPrevious': wrapCommand(focusPrevious),
|
|
3096
3206
|
'SearchExtensions.getActions': getActions,
|
|
3097
3207
|
'SearchExtensions.getCommandIds': getCommandIds,
|
|
3098
|
-
'SearchExtensions.getKeyBindings': getKeyBindings
|
|
3208
|
+
'SearchExtensions.getKeyBindings': getKeyBindings,
|
|
3099
3209
|
'SearchExtensions.getMenuEntries': getMenuEntries,
|
|
3100
3210
|
'SearchExtensions.handleBlur': wrapCommand(handleBlur),
|
|
3211
|
+
'SearchExtensions.copyExtensionInfo': wrapCommand(copyExtensionInfo),
|
|
3101
3212
|
'SearchExtensions.handleClick': wrapCommand(handleClick),
|
|
3102
3213
|
'SearchExtensions.handleClickAt': wrapCommand(handleClickAt),
|
|
3103
3214
|
'SearchExtensions.handleClickCurrent': wrapCommand(handleClickCurrent),
|
|
@@ -3116,6 +3227,7 @@ const commandMap = {
|
|
|
3116
3227
|
'SearchExtensions.handleWheel': wrapCommand(handleWheel),
|
|
3117
3228
|
'SearchExtensions.loadContent': wrapCommand(loadContent),
|
|
3118
3229
|
'SearchExtensions.openSuggest': wrapCommand(openSuggest),
|
|
3230
|
+
'SearchExtensions.copyExtensionId': wrapCommand(copyExtensionId),
|
|
3119
3231
|
'SearchExtensions.render3': render3,
|
|
3120
3232
|
'SearchExtensions.renderActions': renderActions,
|
|
3121
3233
|
'SearchExtensions.renderEventListeners': renderEventListeners,
|