@lvce-editor/text-search-worker 5.8.0 → 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/textSearchWorkerMain.js +169 -102
- package/package.json +1 -1
|
@@ -1274,8 +1274,30 @@ const clearSearchResults$1 = state => {
|
|
|
1274
1274
|
};
|
|
1275
1275
|
};
|
|
1276
1276
|
|
|
1277
|
+
const File$1 = 1;
|
|
1278
|
+
const Match = 2;
|
|
1279
|
+
|
|
1280
|
+
const getPaths = items => {
|
|
1281
|
+
const paths = [];
|
|
1282
|
+
for (const item of items) {
|
|
1283
|
+
if (item.type === File$1) {
|
|
1284
|
+
paths.push(item.text);
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
return paths;
|
|
1288
|
+
};
|
|
1277
1289
|
const collapseAll$1 = async state => {
|
|
1278
|
-
|
|
1290
|
+
const {
|
|
1291
|
+
items
|
|
1292
|
+
} = state;
|
|
1293
|
+
if (items.length === 0) {
|
|
1294
|
+
return state;
|
|
1295
|
+
}
|
|
1296
|
+
const paths = getPaths(items);
|
|
1297
|
+
return {
|
|
1298
|
+
...state,
|
|
1299
|
+
collapsedPaths: paths
|
|
1300
|
+
};
|
|
1279
1301
|
};
|
|
1280
1302
|
|
|
1281
1303
|
const PreserveCase$2 = 1 << 0; // 1
|
|
@@ -1302,6 +1324,16 @@ const collapseDetails = state => {
|
|
|
1302
1324
|
};
|
|
1303
1325
|
};
|
|
1304
1326
|
|
|
1327
|
+
const Alert = 'alert';
|
|
1328
|
+
const Button$3 = 'button';
|
|
1329
|
+
const CheckBox = 'checkbox';
|
|
1330
|
+
const None$1 = 'none';
|
|
1331
|
+
const ScrollBar$1 = 'scrollbar';
|
|
1332
|
+
const Status = 'status';
|
|
1333
|
+
const ToolBar = 'toolbar';
|
|
1334
|
+
const Tree$1 = 'tree';
|
|
1335
|
+
const TreeItem$1 = 'treeitem';
|
|
1336
|
+
|
|
1305
1337
|
const Actions = 'Actions';
|
|
1306
1338
|
const Badge = 'Badge';
|
|
1307
1339
|
const Chevron = 'Chevron';
|
|
@@ -1328,7 +1360,7 @@ const MaskIconRegex = 'MaskIconRegex';
|
|
|
1328
1360
|
const MaskIconReplaceAll = 'MaskIconReplaceAll';
|
|
1329
1361
|
const MaskIconWholeWord = 'MaskIconWholeWord';
|
|
1330
1362
|
const MultilineInputBox = 'MultilineInputBox';
|
|
1331
|
-
const ScrollBar
|
|
1363
|
+
const ScrollBar = 'ScrollBar';
|
|
1332
1364
|
const ScrollBarThumb = 'ScrollBarThumb';
|
|
1333
1365
|
const ScrollBarVertical = 'ScrollBarVertical';
|
|
1334
1366
|
const Search$2 = 'Search';
|
|
@@ -1352,14 +1384,16 @@ const SearchToggleButton = 'SearchToggleButton';
|
|
|
1352
1384
|
const SearchToggleButtonExpanded = 'SearchToggleButtonExpanded';
|
|
1353
1385
|
const SourceControlBadge = 'SourceControlBadge';
|
|
1354
1386
|
const ToggleDetails = 'ToggleDetails';
|
|
1355
|
-
const Tree
|
|
1356
|
-
const TreeItem
|
|
1387
|
+
const Tree = 'Tree';
|
|
1388
|
+
const TreeItem = 'TreeItem';
|
|
1357
1389
|
const TreeItemActive = 'TreeItemActive';
|
|
1358
1390
|
const TreeItems$1 = 'TreeItems';
|
|
1359
1391
|
const Viewlet = 'Viewlet';
|
|
1360
1392
|
const ViewletSearchMessage = 'ViewletSearchMessage';
|
|
1361
1393
|
const ViewletSearchMessageIndented = 'ViewletSearchMessageIndented';
|
|
1362
1394
|
|
|
1395
|
+
const File = 7;
|
|
1396
|
+
|
|
1363
1397
|
const Button$2 = 1;
|
|
1364
1398
|
const Div = 4;
|
|
1365
1399
|
const Span = 8;
|
|
@@ -1370,6 +1404,19 @@ const Del = 21;
|
|
|
1370
1404
|
const H4 = 24;
|
|
1371
1405
|
const TextArea = 62;
|
|
1372
1406
|
|
|
1407
|
+
const Button$1 = 'event.button';
|
|
1408
|
+
const ClientX = 'event.clientX';
|
|
1409
|
+
const ClientY = 'event.clientY';
|
|
1410
|
+
const DeltaMode = 'event.deltaMode';
|
|
1411
|
+
const DeltaY = 'event.deltaY';
|
|
1412
|
+
const TargetName = 'event.target.name';
|
|
1413
|
+
const TargetValue = 'event.target.value';
|
|
1414
|
+
|
|
1415
|
+
const Search$1 = 18;
|
|
1416
|
+
|
|
1417
|
+
const Electron = 2;
|
|
1418
|
+
const Remote = 3;
|
|
1419
|
+
|
|
1373
1420
|
const DebugWorker = 55;
|
|
1374
1421
|
const RendererWorker$1 = 1;
|
|
1375
1422
|
const SearchProcess = 77;
|
|
@@ -1491,7 +1538,7 @@ const setWebViewPort = async (uid, port, origin, portType) => {
|
|
|
1491
1538
|
const setFocus = key => {
|
|
1492
1539
|
return invoke$2('Focus.setFocus', key);
|
|
1493
1540
|
};
|
|
1494
|
-
const getFileIcon
|
|
1541
|
+
const getFileIcon = async options => {
|
|
1495
1542
|
return invoke$2('IconTheme.getFileIcon', options);
|
|
1496
1543
|
};
|
|
1497
1544
|
const getColorThemeNames = async () => {
|
|
@@ -1556,7 +1603,7 @@ const handleDebugResumed = async params => {
|
|
|
1556
1603
|
const openWidget = async name => {
|
|
1557
1604
|
await invoke$2('Viewlet.openWidget', name);
|
|
1558
1605
|
};
|
|
1559
|
-
const getIcons = async requests => {
|
|
1606
|
+
const getIcons$1 = async requests => {
|
|
1560
1607
|
const icons = await invoke$2('IconTheme.getIcons', requests);
|
|
1561
1608
|
return icons;
|
|
1562
1609
|
};
|
|
@@ -1699,11 +1746,11 @@ const RendererWorker = {
|
|
|
1699
1746
|
getExtension,
|
|
1700
1747
|
getExtensionCommands,
|
|
1701
1748
|
getFileHandles,
|
|
1702
|
-
getFileIcon
|
|
1749
|
+
getFileIcon,
|
|
1703
1750
|
getFilePathElectron,
|
|
1704
1751
|
getFolderIcon,
|
|
1705
1752
|
getFolderSize,
|
|
1706
|
-
getIcons,
|
|
1753
|
+
getIcons: getIcons$1,
|
|
1707
1754
|
getKeyBindings: getKeyBindings$1,
|
|
1708
1755
|
getLogsDir,
|
|
1709
1756
|
getMarkdownDom,
|
|
@@ -1787,24 +1834,37 @@ const createLazyRpc = rpcId => {
|
|
|
1787
1834
|
};
|
|
1788
1835
|
|
|
1789
1836
|
const {
|
|
1790
|
-
getFileIcon: getFileIcon$1,
|
|
1791
1837
|
invoke: invoke$1,
|
|
1792
1838
|
openUri: openUri$1,
|
|
1793
1839
|
sendMessagePortToSearchProcess,
|
|
1794
1840
|
set: set$1,
|
|
1795
1841
|
showContextMenu,
|
|
1796
|
-
writeClipBoardText
|
|
1842
|
+
writeClipBoardText,
|
|
1843
|
+
getIcons
|
|
1797
1844
|
} = RendererWorker;
|
|
1798
1845
|
|
|
1799
1846
|
const copy = async state => {
|
|
1800
1847
|
const {
|
|
1801
1848
|
items,
|
|
1802
|
-
|
|
1849
|
+
focusedIndex
|
|
1803
1850
|
} = state;
|
|
1804
|
-
if (
|
|
1851
|
+
if (focusedIndex === -1) {
|
|
1852
|
+
return state;
|
|
1853
|
+
}
|
|
1854
|
+
const item = items[focusedIndex];
|
|
1855
|
+
await writeClipBoardText(item.text);
|
|
1856
|
+
return state;
|
|
1857
|
+
};
|
|
1858
|
+
|
|
1859
|
+
const copyPath = async state => {
|
|
1860
|
+
const {
|
|
1861
|
+
items,
|
|
1862
|
+
focusedIndex
|
|
1863
|
+
} = state;
|
|
1864
|
+
if (focusedIndex === -1) {
|
|
1805
1865
|
return state;
|
|
1806
1866
|
}
|
|
1807
|
-
const item = items[
|
|
1867
|
+
const item = items[focusedIndex];
|
|
1808
1868
|
await writeClipBoardText(item.text);
|
|
1809
1869
|
return state;
|
|
1810
1870
|
};
|
|
@@ -2010,7 +2070,7 @@ const ReplaceAll$1 = 'Replace All';
|
|
|
2010
2070
|
const ReplacedManyOccurrencesInManyFiles = "Replaced {PH1} occurrences across {PH2} files with '{PH3}'";
|
|
2011
2071
|
const ReplacedOneOccurrenceInOneFile = "Replaced 1 occurrence across 1 file with '{PH1}'";
|
|
2012
2072
|
const ReplaceForHistory = 'Replace (⇅ for history)';
|
|
2013
|
-
const Search
|
|
2073
|
+
const Search = 'Search';
|
|
2014
2074
|
const SearchForHistory = 'Search (⇅ for history)';
|
|
2015
2075
|
const SearchOnlyOpenEditors$1 = 'Search Only Open Editors';
|
|
2016
2076
|
const ToggleReplace$1 = 'Toggle Replace';
|
|
@@ -2151,7 +2211,7 @@ const searchForHistory = () => {
|
|
|
2151
2211
|
return i18nString(SearchForHistory);
|
|
2152
2212
|
};
|
|
2153
2213
|
const search = () => {
|
|
2154
|
-
return i18nString(Search
|
|
2214
|
+
return i18nString(Search);
|
|
2155
2215
|
};
|
|
2156
2216
|
const replaceForHistory = () => {
|
|
2157
2217
|
return i18nString(ReplaceForHistory);
|
|
@@ -2170,13 +2230,10 @@ const getStatusMessage = (resultCount, fileResultCount) => {
|
|
|
2170
2230
|
return manyResultsInManyFiles(resultCount, fileResultCount);
|
|
2171
2231
|
};
|
|
2172
2232
|
|
|
2173
|
-
const File = 1;
|
|
2174
|
-
const Match = 2;
|
|
2175
|
-
|
|
2176
2233
|
const getSetSize = (items, index) => {
|
|
2177
2234
|
let setSize = 0;
|
|
2178
2235
|
for (let i = index + 1; i < items.length; i++) {
|
|
2179
|
-
if (items[i].type === File) {
|
|
2236
|
+
if (items[i].type === File$1) {
|
|
2180
2237
|
break;
|
|
2181
2238
|
}
|
|
2182
2239
|
setSize++;
|
|
@@ -2195,7 +2252,7 @@ const getRemoveIndicesFile = (items, item, index, matchCount, fileCount) => {
|
|
|
2195
2252
|
};
|
|
2196
2253
|
const getRemoveIndicesMatch = (items, index, matchCount, fileCount) => {
|
|
2197
2254
|
for (let i = index; i >= 0; i--) {
|
|
2198
|
-
if (items[i].type === File) {
|
|
2255
|
+
if (items[i].type === File$1) {
|
|
2199
2256
|
const setSize = getSetSize(items, i);
|
|
2200
2257
|
if (setSize === 1) {
|
|
2201
2258
|
return {
|
|
@@ -2220,7 +2277,7 @@ const getRemoveIndicesMatch = (items, index, matchCount, fileCount) => {
|
|
|
2220
2277
|
const getRemoveIndices = (items, index, matchCount, fileCount) => {
|
|
2221
2278
|
const item = items[index];
|
|
2222
2279
|
switch (item.type) {
|
|
2223
|
-
case File:
|
|
2280
|
+
case File$1:
|
|
2224
2281
|
return getRemoveIndicesFile(items, item, index, matchCount, fileCount);
|
|
2225
2282
|
case Match:
|
|
2226
2283
|
return getRemoveIndicesMatch(items, index, matchCount, fileCount);
|
|
@@ -2550,18 +2607,26 @@ const handleUpdateError = async (state, update, error) => {
|
|
|
2550
2607
|
};
|
|
2551
2608
|
};
|
|
2552
2609
|
|
|
2553
|
-
const
|
|
2554
|
-
if (
|
|
2555
|
-
return
|
|
2556
|
-
name: result.text
|
|
2557
|
-
});
|
|
2610
|
+
const getFileName$1 = text => {
|
|
2611
|
+
if (text.startsWith('./')) {
|
|
2612
|
+
return text.slice(2);
|
|
2558
2613
|
}
|
|
2559
|
-
return
|
|
2614
|
+
return text;
|
|
2560
2615
|
};
|
|
2561
2616
|
const getFileIcons = async matches => {
|
|
2617
|
+
const requests = [];
|
|
2618
|
+
for (const item of matches) {
|
|
2619
|
+
if (item.type === File$1) {
|
|
2620
|
+
const fileName = getFileName$1(item.text);
|
|
2621
|
+
requests.push({
|
|
2622
|
+
type: File,
|
|
2623
|
+
name: fileName,
|
|
2624
|
+
path: `/${fileName}`
|
|
2625
|
+
});
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
const icons = await getIcons(requests);
|
|
2562
2629
|
// TODO cache file icons
|
|
2563
|
-
const promises = matches.map(getFileIcon);
|
|
2564
|
-
const icons = await Promise.all(promises);
|
|
2565
2630
|
return icons;
|
|
2566
2631
|
};
|
|
2567
2632
|
|
|
@@ -2586,7 +2651,7 @@ const getTextSearchResultCounts = results => {
|
|
|
2586
2651
|
let fileCount = 0;
|
|
2587
2652
|
for (const result of results) {
|
|
2588
2653
|
switch (result.type) {
|
|
2589
|
-
case File:
|
|
2654
|
+
case File$1:
|
|
2590
2655
|
fileCount++;
|
|
2591
2656
|
break;
|
|
2592
2657
|
case Match:
|
|
@@ -2973,7 +3038,7 @@ const getReplaceElements = (items, workspacePath, replacement) => {
|
|
|
2973
3038
|
end,
|
|
2974
3039
|
start
|
|
2975
3040
|
} = match;
|
|
2976
|
-
if (type === File) {
|
|
3041
|
+
if (type === File$1) {
|
|
2977
3042
|
changes = [];
|
|
2978
3043
|
const fileName = getFileName(text);
|
|
2979
3044
|
const absolutePath = `${workspacePath}/${fileName}`;
|
|
@@ -3003,6 +3068,7 @@ const replaceAll = async state => {
|
|
|
3003
3068
|
matchCount
|
|
3004
3069
|
} = state;
|
|
3005
3070
|
const bulkEdits = getReplaceElements(items, workspacePath, replacement);
|
|
3071
|
+
// TODO this function should return an error message if an error occurred during bulk edit
|
|
3006
3072
|
await applyBulkReplacement(bulkEdits);
|
|
3007
3073
|
const fileCount = bulkEdits.length;
|
|
3008
3074
|
const message = getReplacedMessage(fileCount, matchCount, replacement);
|
|
@@ -3166,7 +3232,10 @@ const handleInput2 = (state, inputName, value, inputSource = Script) => {
|
|
|
3166
3232
|
};
|
|
3167
3233
|
|
|
3168
3234
|
const handleListBlur = state => {
|
|
3169
|
-
return
|
|
3235
|
+
return {
|
|
3236
|
+
...state,
|
|
3237
|
+
listFocused: false
|
|
3238
|
+
};
|
|
3170
3239
|
};
|
|
3171
3240
|
|
|
3172
3241
|
const handleSharedInput = (state, name, value, inputSource = Script) => {
|
|
@@ -3191,9 +3260,6 @@ const launchSearchProcessNode = async () => {
|
|
|
3191
3260
|
return rpc;
|
|
3192
3261
|
};
|
|
3193
3262
|
|
|
3194
|
-
const Electron = 2;
|
|
3195
|
-
const Remote = 3;
|
|
3196
|
-
|
|
3197
3263
|
const initialize = async platform => {
|
|
3198
3264
|
if (platform === Electron) {
|
|
3199
3265
|
setFactory(launchSearchProcessElectron);
|
|
@@ -3528,7 +3594,7 @@ const getFilteredResults = (results, collapsedPaths) => {
|
|
|
3528
3594
|
const filteredResults = [];
|
|
3529
3595
|
let isExcluded = false;
|
|
3530
3596
|
for (const result of results) {
|
|
3531
|
-
if (result.type === File) {
|
|
3597
|
+
if (result.type === File$1) {
|
|
3532
3598
|
filteredResults.push(result);
|
|
3533
3599
|
isExcluded = collapsedPaths.includes(result.text) ? true : false;
|
|
3534
3600
|
}
|
|
@@ -3579,7 +3645,7 @@ const selectIndexFile = async (state, searchResult, index) => {
|
|
|
3579
3645
|
const getFileIndex = (items, index) => {
|
|
3580
3646
|
for (let i = index; i >= 0; i--) {
|
|
3581
3647
|
const item = items[i];
|
|
3582
|
-
if (item.type === File) {
|
|
3648
|
+
if (item.type === File$1) {
|
|
3583
3649
|
return i;
|
|
3584
3650
|
}
|
|
3585
3651
|
}
|
|
@@ -3630,7 +3696,7 @@ const selectIndexPreview = async (state, searchResult, index) => {
|
|
|
3630
3696
|
|
|
3631
3697
|
const getSelectHandler = type => {
|
|
3632
3698
|
switch (type) {
|
|
3633
|
-
case File:
|
|
3699
|
+
case File$1:
|
|
3634
3700
|
return selectIndexFile;
|
|
3635
3701
|
case Match:
|
|
3636
3702
|
return selectIndexPreview;
|
|
@@ -3709,12 +3775,18 @@ const getSavedExcludeValue = savedState => {
|
|
|
3709
3775
|
}
|
|
3710
3776
|
return '';
|
|
3711
3777
|
};
|
|
3778
|
+
const getSavedCollapsedPaths = savedState => {
|
|
3779
|
+
if (savedState && typeof savedState === 'object' && 'collapsedPaths' in savedState && Array.isArray(savedState.collapsedPaths) && savedState.collapsedPaths.every(item => typeof item === 'string')) {
|
|
3780
|
+
return savedState.collapsedPaths;
|
|
3781
|
+
}
|
|
3782
|
+
return [];
|
|
3783
|
+
};
|
|
3712
3784
|
|
|
3713
3785
|
const restoreState = savedState => {
|
|
3714
3786
|
return {
|
|
3715
3787
|
savedValue: getSavedValue(savedState),
|
|
3716
3788
|
replacement: getSavedReplacement(savedState),
|
|
3717
|
-
savedCollapsedPaths:
|
|
3789
|
+
savedCollapsedPaths: getSavedCollapsedPaths(savedState),
|
|
3718
3790
|
threads: 1,
|
|
3719
3791
|
flags: getSavedFlags(savedState),
|
|
3720
3792
|
includeValue: getSavedIncludeValue(savedState),
|
|
@@ -3734,7 +3806,7 @@ const loadContent = async (state, savedState) => {
|
|
|
3734
3806
|
excludeValue
|
|
3735
3807
|
} = restoreState(savedState);
|
|
3736
3808
|
if (savedValue) {
|
|
3737
|
-
|
|
3809
|
+
const result = await handleUpdate(state, {
|
|
3738
3810
|
value: savedValue,
|
|
3739
3811
|
threads,
|
|
3740
3812
|
inputSource: Script,
|
|
@@ -3744,6 +3816,10 @@ const loadContent = async (state, savedState) => {
|
|
|
3744
3816
|
includeValue,
|
|
3745
3817
|
excludeValue
|
|
3746
3818
|
});
|
|
3819
|
+
return {
|
|
3820
|
+
...result,
|
|
3821
|
+
loaded: true
|
|
3822
|
+
};
|
|
3747
3823
|
}
|
|
3748
3824
|
return {
|
|
3749
3825
|
...state,
|
|
@@ -3839,14 +3915,14 @@ const renderFocusContext = (oldState, newState) => {
|
|
|
3839
3915
|
return ['Viewlet.setFocusContext', newState.focus];
|
|
3840
3916
|
};
|
|
3841
3917
|
|
|
3842
|
-
const None
|
|
3918
|
+
const None = 0;
|
|
3843
3919
|
const Collapsed = 1;
|
|
3844
3920
|
const Expanded = 2;
|
|
3845
3921
|
|
|
3846
3922
|
const getMatchCount = (results, startIndex) => {
|
|
3847
3923
|
for (let i = startIndex + 1; i < results.length; i++) {
|
|
3848
3924
|
const result = results[i];
|
|
3849
|
-
if (result.type === File) {
|
|
3925
|
+
if (result.type === File$1) {
|
|
3850
3926
|
return i - startIndex - 1;
|
|
3851
3927
|
}
|
|
3852
3928
|
}
|
|
@@ -3881,7 +3957,7 @@ const getDisplayResultMatch = (setSize, searchTermLength, replacement, text, pos
|
|
|
3881
3957
|
return {
|
|
3882
3958
|
badgeText: '',
|
|
3883
3959
|
depth: 1,
|
|
3884
|
-
expanded: None
|
|
3960
|
+
expanded: None,
|
|
3885
3961
|
focused,
|
|
3886
3962
|
icon: '',
|
|
3887
3963
|
matchLength: searchTermLength,
|
|
@@ -3905,7 +3981,7 @@ const getDisplayResult = (results, fileIcons, i, setSize, searchTermLength, repl
|
|
|
3905
3981
|
const focused = i === focusedIndex;
|
|
3906
3982
|
const relativeIndex = i - minLineY;
|
|
3907
3983
|
switch (type) {
|
|
3908
|
-
case File:
|
|
3984
|
+
case File$1:
|
|
3909
3985
|
return getSearchDisplayResultFile(results, fileIcons, i, setSize, collapsedPaths, text, posInSet, relativeIndex, focused, originalResults);
|
|
3910
3986
|
case Match:
|
|
3911
3987
|
return getDisplayResultMatch(setSize, searchTermLength, replacement, text, posInSet, start, focused);
|
|
@@ -4199,38 +4275,28 @@ const diff = (oldNodes, newNodes) => {
|
|
|
4199
4275
|
return patches;
|
|
4200
4276
|
};
|
|
4201
4277
|
|
|
4202
|
-
const
|
|
4203
|
-
const
|
|
4204
|
-
const
|
|
4205
|
-
const
|
|
4206
|
-
const
|
|
4207
|
-
const
|
|
4208
|
-
const
|
|
4209
|
-
const
|
|
4210
|
-
const
|
|
4211
|
-
|
|
4212
|
-
const
|
|
4213
|
-
const
|
|
4214
|
-
const
|
|
4215
|
-
const
|
|
4216
|
-
const
|
|
4217
|
-
const
|
|
4218
|
-
const HandleHeaderFocusOut = 'handleHeaderFocusOut';
|
|
4219
|
-
const HandleIncludeInput = 'handleIncludeInput';
|
|
4220
|
-
const HandleInput = 'handleInput';
|
|
4221
|
-
const HandleInput2 = 'handleInput2';
|
|
4222
|
-
const HandleListBlur = 'handleListBlur';
|
|
4223
|
-
const HandleListFocus = 'handleListFocus';
|
|
4224
|
-
const HandleReplaceInput = 'handleReplaceInput';
|
|
4225
|
-
const HandleScrollBarPointerDown = 'handleScrollBarPointerDown';
|
|
4226
|
-
const HandleToggleButtonClick = 'handleToggleButtonClick';
|
|
4227
|
-
const HandleWheel = 'handleWheel';
|
|
4278
|
+
const HandleClick = 1;
|
|
4279
|
+
const HandleContextMenu = 2;
|
|
4280
|
+
const HandleHeaderContextMenu = 3;
|
|
4281
|
+
const HandleExcludeInput = 4;
|
|
4282
|
+
const HandleHeaderClick2 = 5;
|
|
4283
|
+
const HandleHeaderFocusIn = 6;
|
|
4284
|
+
const HandleHeaderFocusOut = 7;
|
|
4285
|
+
const HandleIncludeInput = 8;
|
|
4286
|
+
const HandleInput = 9;
|
|
4287
|
+
const HandleInput2 = 10;
|
|
4288
|
+
const HandleListBlur = 11;
|
|
4289
|
+
const HandleListFocus = 12;
|
|
4290
|
+
const HandleReplaceInput = 13;
|
|
4291
|
+
const HandleScrollBarPointerDown = 14;
|
|
4292
|
+
const HandleToggleButtonClick = 15;
|
|
4293
|
+
const HandleWheel = 16;
|
|
4228
4294
|
|
|
4229
4295
|
const getSearchDetailsToggleVirtualDom = () => {
|
|
4230
4296
|
return [{
|
|
4231
4297
|
type: Div,
|
|
4232
4298
|
className: ToggleDetails,
|
|
4233
|
-
role: Button$
|
|
4299
|
+
role: Button$3,
|
|
4234
4300
|
tabIndex: 0,
|
|
4235
4301
|
ariaLabel: toggleSearchDetails(),
|
|
4236
4302
|
title: toggleSearchDetails(),
|
|
@@ -4374,7 +4440,7 @@ const getOutSideButtonsDom = outsideButtons => {
|
|
|
4374
4440
|
preNodes: [{
|
|
4375
4441
|
type: Div,
|
|
4376
4442
|
className: SearchFieldContainer,
|
|
4377
|
-
role: None,
|
|
4443
|
+
role: None$1,
|
|
4378
4444
|
childCount: 1 + outsideButtons.length
|
|
4379
4445
|
}],
|
|
4380
4446
|
postNodes: outsideButtons.flatMap(getSearchFieldButtonVirtualDom)
|
|
@@ -4390,7 +4456,7 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
|
|
|
4390
4456
|
const dom = [...preNodes, {
|
|
4391
4457
|
type: Div,
|
|
4392
4458
|
className: searchFieldClassName,
|
|
4393
|
-
role: None,
|
|
4459
|
+
role: None$1,
|
|
4394
4460
|
childCount: 2
|
|
4395
4461
|
}, {
|
|
4396
4462
|
type: TextArea,
|
|
@@ -4545,12 +4611,12 @@ const getSearchHeaderTopVirtualDom = (flags, searchInputErrorMessage, matchCount
|
|
|
4545
4611
|
const dom = [{
|
|
4546
4612
|
type: Div,
|
|
4547
4613
|
className: SearchHeaderTop,
|
|
4548
|
-
role: None,
|
|
4614
|
+
role: None$1,
|
|
4549
4615
|
childCount: 2
|
|
4550
4616
|
}, ...getSearchToggleVirtualDom(replaceExpanded), {
|
|
4551
4617
|
type: Div,
|
|
4552
4618
|
className: SearchHeaderTopRight,
|
|
4553
|
-
role: None,
|
|
4619
|
+
role: None$1,
|
|
4554
4620
|
childCount: replaceExpanded ? 2 : 1
|
|
4555
4621
|
}, ...getSearchFieldVirtualDom(SearchValue, searchPlaceholder, HandleInput2, inputActions.inside, inputActions.outside, '', Boolean(searchInputErrorMessage))];
|
|
4556
4622
|
if (flags & ReplaceExpanded) {
|
|
@@ -4562,7 +4628,7 @@ const getSearchHeaderTopVirtualDom = (flags, searchInputErrorMessage, matchCount
|
|
|
4562
4628
|
const parentNode = {
|
|
4563
4629
|
type: Div,
|
|
4564
4630
|
className: SearchHeader,
|
|
4565
|
-
role: None,
|
|
4631
|
+
role: None$1,
|
|
4566
4632
|
childCount: 3,
|
|
4567
4633
|
onClick: HandleHeaderClick2,
|
|
4568
4634
|
onFocusIn: HandleHeaderFocusIn,
|
|
@@ -4594,10 +4660,10 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarY, scrollBarValue) =>
|
|
|
4594
4660
|
}
|
|
4595
4661
|
return [{
|
|
4596
4662
|
type: Div,
|
|
4597
|
-
className: mergeClassNames(ScrollBar
|
|
4663
|
+
className: mergeClassNames(ScrollBar, ScrollBarVertical),
|
|
4598
4664
|
childCount: 1,
|
|
4599
4665
|
onPointerDown: HandleScrollBarPointerDown,
|
|
4600
|
-
role: ScrollBar,
|
|
4666
|
+
role: ScrollBar$1,
|
|
4601
4667
|
ariaControls: TreeItems,
|
|
4602
4668
|
ariaValueNow: scrollBarValue
|
|
4603
4669
|
}, {
|
|
@@ -4661,7 +4727,7 @@ const getFileIconVirtualDom = icon => {
|
|
|
4661
4727
|
type: Img,
|
|
4662
4728
|
className: FileIcon,
|
|
4663
4729
|
src: icon,
|
|
4664
|
-
role: None,
|
|
4730
|
+
role: None$1,
|
|
4665
4731
|
childCount: 0
|
|
4666
4732
|
};
|
|
4667
4733
|
};
|
|
@@ -4750,9 +4816,9 @@ const getSearchRemoveVirtualDom = () => {
|
|
|
4750
4816
|
|
|
4751
4817
|
const getSearchResultClassName = focused => {
|
|
4752
4818
|
if (focused) {
|
|
4753
|
-
return TreeItem
|
|
4819
|
+
return TreeItem + ' ' + TreeItemActive;
|
|
4754
4820
|
}
|
|
4755
|
-
return TreeItem
|
|
4821
|
+
return TreeItem;
|
|
4756
4822
|
};
|
|
4757
4823
|
|
|
4758
4824
|
const PaddingRight = '12px';
|
|
@@ -4775,7 +4841,7 @@ const getSearchResultVirtualDom = rowInfo => {
|
|
|
4775
4841
|
const childCount = getChildCount(icon, expanded, badgeText);
|
|
4776
4842
|
const dom = [{
|
|
4777
4843
|
type: Div,
|
|
4778
|
-
role: TreeItem,
|
|
4844
|
+
role: TreeItem$1,
|
|
4779
4845
|
className: getSearchResultClassName(focused),
|
|
4780
4846
|
title,
|
|
4781
4847
|
ariaSetSize: setSize,
|
|
@@ -4810,8 +4876,8 @@ const getSearchResultsVirtualDom = (visibleItems, focusOutline, scrollbarHeight,
|
|
|
4810
4876
|
const childCount = scrollbarHeight === 0 ? 1 : 2;
|
|
4811
4877
|
return [{
|
|
4812
4878
|
type: Div,
|
|
4813
|
-
className: mergeClassNames(Viewlet, List$1, Tree
|
|
4814
|
-
role: Tree,
|
|
4879
|
+
className: mergeClassNames(Viewlet, List$1, Tree, focusOutline ? FocusOutline : Empty),
|
|
4880
|
+
role: Tree$1,
|
|
4815
4881
|
tabIndex: 0,
|
|
4816
4882
|
childCount
|
|
4817
4883
|
}, ...getTreeItemsVirtualDom(visibleItems, deltaY, itemHeight), ...getScrollBarVirtualDom(scrollbarHeight, scrollBarY, scrollBarValue)];
|
|
@@ -4892,7 +4958,7 @@ const getIconVirtualDom = (icon, type = Div) => {
|
|
|
4892
4958
|
return {
|
|
4893
4959
|
type,
|
|
4894
4960
|
className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
|
|
4895
|
-
role: None,
|
|
4961
|
+
role: None$1,
|
|
4896
4962
|
childCount: 0
|
|
4897
4963
|
};
|
|
4898
4964
|
};
|
|
@@ -4974,22 +5040,22 @@ const renderActions = uid => {
|
|
|
4974
5040
|
const renderEventListeners = () => {
|
|
4975
5041
|
return [{
|
|
4976
5042
|
name: HandleInput2,
|
|
4977
|
-
params: ['handleInput2',
|
|
5043
|
+
params: ['handleInput2', TargetName, TargetValue, User]
|
|
4978
5044
|
}, {
|
|
4979
5045
|
name: HandleExcludeInput,
|
|
4980
|
-
params: ['handleExcludeInput',
|
|
5046
|
+
params: ['handleExcludeInput', TargetValue]
|
|
4981
5047
|
}, {
|
|
4982
5048
|
name: HandleIncludeInput,
|
|
4983
|
-
params: ['handleIncludeInput',
|
|
5049
|
+
params: ['handleIncludeInput', TargetValue]
|
|
4984
5050
|
}, {
|
|
4985
5051
|
name: HandleReplaceInput,
|
|
4986
|
-
params: ['handleReplaceInput',
|
|
5052
|
+
params: ['handleReplaceInput', TargetValue]
|
|
4987
5053
|
}, {
|
|
4988
5054
|
name: HandleInput,
|
|
4989
|
-
params: ['handleInput',
|
|
5055
|
+
params: ['handleInput', TargetValue, User]
|
|
4990
5056
|
}, {
|
|
4991
5057
|
name: HandleClick,
|
|
4992
|
-
params: ['handleClickAt',
|
|
5058
|
+
params: ['handleClickAt', ClientX, ClientY]
|
|
4993
5059
|
}, {
|
|
4994
5060
|
name: HandleToggleButtonClick,
|
|
4995
5061
|
params: ['handleToggleButtonClick']
|
|
@@ -5001,7 +5067,7 @@ const renderEventListeners = () => {
|
|
|
5001
5067
|
params: ['handleListBlur']
|
|
5002
5068
|
}, {
|
|
5003
5069
|
name: HandleContextMenu,
|
|
5004
|
-
params: ['handleContextMenu',
|
|
5070
|
+
params: ['handleContextMenu', Button$1, ClientX, ClientY],
|
|
5005
5071
|
preventDefault: true
|
|
5006
5072
|
}, {
|
|
5007
5073
|
name: HandleHeaderContextMenu,
|
|
@@ -5009,11 +5075,11 @@ const renderEventListeners = () => {
|
|
|
5009
5075
|
preventDefault: true
|
|
5010
5076
|
}, {
|
|
5011
5077
|
name: HandleWheel,
|
|
5012
|
-
params: ['handleWheel',
|
|
5078
|
+
params: ['handleWheel', DeltaMode, DeltaY],
|
|
5013
5079
|
passive: true
|
|
5014
5080
|
}, {
|
|
5015
5081
|
name: HandleHeaderClick2,
|
|
5016
|
-
params: ['handleHeaderClick',
|
|
5082
|
+
params: ['handleHeaderClick', TargetName]
|
|
5017
5083
|
}, {
|
|
5018
5084
|
name: HandleHeaderFocusIn,
|
|
5019
5085
|
params: ['handleHeaderFocusIn']
|
|
@@ -5022,7 +5088,7 @@ const renderEventListeners = () => {
|
|
|
5022
5088
|
params: ['handleHeaderFocusOut']
|
|
5023
5089
|
}, {
|
|
5024
5090
|
name: HandleScrollBarPointerDown,
|
|
5025
|
-
params: ['handleScrollBarClick',
|
|
5091
|
+
params: ['handleScrollBarClick', DeltaY]
|
|
5026
5092
|
}];
|
|
5027
5093
|
};
|
|
5028
5094
|
|
|
@@ -5107,7 +5173,8 @@ const saveState = uid => {
|
|
|
5107
5173
|
flags,
|
|
5108
5174
|
includeValue,
|
|
5109
5175
|
excludeValue,
|
|
5110
|
-
history
|
|
5176
|
+
history,
|
|
5177
|
+
collapsedPaths
|
|
5111
5178
|
} = newState;
|
|
5112
5179
|
return {
|
|
5113
5180
|
value,
|
|
@@ -5115,7 +5182,8 @@ const saveState = uid => {
|
|
|
5115
5182
|
flags,
|
|
5116
5183
|
includeValue,
|
|
5117
5184
|
excludeValue,
|
|
5118
|
-
history
|
|
5185
|
+
history,
|
|
5186
|
+
collapsedPaths
|
|
5119
5187
|
};
|
|
5120
5188
|
};
|
|
5121
5189
|
|
|
@@ -5248,8 +5316,6 @@ const show = async (x, y, id, ...args) => {
|
|
|
5248
5316
|
await showContextMenu(x, y, id, ...args);
|
|
5249
5317
|
};
|
|
5250
5318
|
|
|
5251
|
-
const Search = 18;
|
|
5252
|
-
|
|
5253
5319
|
const handleContextMenuKeyboard = async state => {
|
|
5254
5320
|
const {
|
|
5255
5321
|
x
|
|
@@ -5257,12 +5323,12 @@ const handleContextMenuKeyboard = async state => {
|
|
|
5257
5323
|
const {
|
|
5258
5324
|
y
|
|
5259
5325
|
} = state; // TODO
|
|
5260
|
-
await show(x, y, Search);
|
|
5326
|
+
await show(x, y, Search$1);
|
|
5261
5327
|
return state;
|
|
5262
5328
|
};
|
|
5263
5329
|
|
|
5264
5330
|
const handleContextMenuMouseAt = async (state, x, y) => {
|
|
5265
|
-
await show(x, y, Search);
|
|
5331
|
+
await show(x, y, Search$1);
|
|
5266
5332
|
return state;
|
|
5267
5333
|
};
|
|
5268
5334
|
|
|
@@ -5286,6 +5352,7 @@ const commandMap = {
|
|
|
5286
5352
|
'TextSearch.collapseAll': wrapCommand(collapseAll$1),
|
|
5287
5353
|
'TextSearch.collapseDetails': wrapCommand(collapseDetails),
|
|
5288
5354
|
'TextSearch.copy': wrapCommand(copy),
|
|
5355
|
+
'TextSearch.copyPath': wrapCommand(copyPath),
|
|
5289
5356
|
'TextSearch.diff2': diff2,
|
|
5290
5357
|
'TextSearch.dismissItem': wrapCommand(dismissItem),
|
|
5291
5358
|
'TextSearch.expandDetails': wrapCommand(expandDetails),
|
|
@@ -5337,6 +5404,7 @@ const commandMap = {
|
|
|
5337
5404
|
'TextSearch.replaceAll': wrapCommand(replaceAll),
|
|
5338
5405
|
'TextSearch.rerender': rerender,
|
|
5339
5406
|
'TextSearch.selectIndex': wrapCommand(selectIndex),
|
|
5407
|
+
'TextSearch.setLimit': wrapCommand(setLimit),
|
|
5340
5408
|
'TextSearch.submit': wrapCommand(submit),
|
|
5341
5409
|
'TextSearch.toggleMatchCase': wrapCommand(toggleMatchCase),
|
|
5342
5410
|
'TextSearch.toggleMatchWholeWord': wrapCommand(toggleMatchWholeWord),
|
|
@@ -5347,7 +5415,6 @@ const commandMap = {
|
|
|
5347
5415
|
'TextSearch.toggleUseIgnoreFiles': wrapCommand(toggleUseIgnoreFiles),
|
|
5348
5416
|
'TextSearch.toggleUseRegularExpression': wrapCommand(toggleUseRegularExpression),
|
|
5349
5417
|
'TextSearch.viewAsTree': wrapCommand(viewAsTree),
|
|
5350
|
-
'TextSearch.setLimit': wrapCommand(setLimit),
|
|
5351
5418
|
// not wrapped
|
|
5352
5419
|
'TextSearch.initialize': initialize,
|
|
5353
5420
|
'TextSearch.create': create,
|