@lvce-editor/text-search-worker 5.8.0 → 5.10.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 +174 -104
- 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);
|
|
@@ -3915,11 +3991,14 @@ const getDisplayResult = (results, fileIcons, i, setSize, searchTermLength, repl
|
|
|
3915
3991
|
};
|
|
3916
3992
|
|
|
3917
3993
|
const getDisplayResults = (results, itemHeight, resultCount, searchTerm, minLineY, maxLineY, replacement, fileIcons, focusedIndex, collapsedPaths, originalResults) => {
|
|
3994
|
+
// Filter out child items when parent files are collapsed
|
|
3995
|
+
const filteredResults = getFilteredResults(results, collapsedPaths);
|
|
3918
3996
|
const displayResults = [];
|
|
3919
3997
|
const setSize = resultCount;
|
|
3920
3998
|
const searchTermLength = searchTerm.length;
|
|
3921
|
-
|
|
3922
|
-
|
|
3999
|
+
const max = Math.min(filteredResults.length, maxLineY);
|
|
4000
|
+
for (let i = minLineY; i < max; i++) {
|
|
4001
|
+
const displayResult = getDisplayResult(filteredResults, fileIcons, i, setSize, searchTermLength, replacement, focusedIndex, collapsedPaths, minLineY, originalResults);
|
|
3923
4002
|
displayResults.push(displayResult);
|
|
3924
4003
|
}
|
|
3925
4004
|
return displayResults;
|
|
@@ -4199,38 +4278,28 @@ const diff = (oldNodes, newNodes) => {
|
|
|
4199
4278
|
return patches;
|
|
4200
4279
|
};
|
|
4201
4280
|
|
|
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';
|
|
4281
|
+
const HandleClick = 1;
|
|
4282
|
+
const HandleContextMenu = 2;
|
|
4283
|
+
const HandleHeaderContextMenu = 3;
|
|
4284
|
+
const HandleExcludeInput = 4;
|
|
4285
|
+
const HandleHeaderClick2 = 5;
|
|
4286
|
+
const HandleHeaderFocusIn = 6;
|
|
4287
|
+
const HandleHeaderFocusOut = 7;
|
|
4288
|
+
const HandleIncludeInput = 8;
|
|
4289
|
+
const HandleInput = 9;
|
|
4290
|
+
const HandleInput2 = 10;
|
|
4291
|
+
const HandleListBlur = 11;
|
|
4292
|
+
const HandleListFocus = 12;
|
|
4293
|
+
const HandleReplaceInput = 13;
|
|
4294
|
+
const HandleScrollBarPointerDown = 14;
|
|
4295
|
+
const HandleToggleButtonClick = 15;
|
|
4296
|
+
const HandleWheel = 16;
|
|
4228
4297
|
|
|
4229
4298
|
const getSearchDetailsToggleVirtualDom = () => {
|
|
4230
4299
|
return [{
|
|
4231
4300
|
type: Div,
|
|
4232
4301
|
className: ToggleDetails,
|
|
4233
|
-
role: Button$
|
|
4302
|
+
role: Button$3,
|
|
4234
4303
|
tabIndex: 0,
|
|
4235
4304
|
ariaLabel: toggleSearchDetails(),
|
|
4236
4305
|
title: toggleSearchDetails(),
|
|
@@ -4374,7 +4443,7 @@ const getOutSideButtonsDom = outsideButtons => {
|
|
|
4374
4443
|
preNodes: [{
|
|
4375
4444
|
type: Div,
|
|
4376
4445
|
className: SearchFieldContainer,
|
|
4377
|
-
role: None,
|
|
4446
|
+
role: None$1,
|
|
4378
4447
|
childCount: 1 + outsideButtons.length
|
|
4379
4448
|
}],
|
|
4380
4449
|
postNodes: outsideButtons.flatMap(getSearchFieldButtonVirtualDom)
|
|
@@ -4390,7 +4459,7 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
|
|
|
4390
4459
|
const dom = [...preNodes, {
|
|
4391
4460
|
type: Div,
|
|
4392
4461
|
className: searchFieldClassName,
|
|
4393
|
-
role: None,
|
|
4462
|
+
role: None$1,
|
|
4394
4463
|
childCount: 2
|
|
4395
4464
|
}, {
|
|
4396
4465
|
type: TextArea,
|
|
@@ -4545,12 +4614,12 @@ const getSearchHeaderTopVirtualDom = (flags, searchInputErrorMessage, matchCount
|
|
|
4545
4614
|
const dom = [{
|
|
4546
4615
|
type: Div,
|
|
4547
4616
|
className: SearchHeaderTop,
|
|
4548
|
-
role: None,
|
|
4617
|
+
role: None$1,
|
|
4549
4618
|
childCount: 2
|
|
4550
4619
|
}, ...getSearchToggleVirtualDom(replaceExpanded), {
|
|
4551
4620
|
type: Div,
|
|
4552
4621
|
className: SearchHeaderTopRight,
|
|
4553
|
-
role: None,
|
|
4622
|
+
role: None$1,
|
|
4554
4623
|
childCount: replaceExpanded ? 2 : 1
|
|
4555
4624
|
}, ...getSearchFieldVirtualDom(SearchValue, searchPlaceholder, HandleInput2, inputActions.inside, inputActions.outside, '', Boolean(searchInputErrorMessage))];
|
|
4556
4625
|
if (flags & ReplaceExpanded) {
|
|
@@ -4562,7 +4631,7 @@ const getSearchHeaderTopVirtualDom = (flags, searchInputErrorMessage, matchCount
|
|
|
4562
4631
|
const parentNode = {
|
|
4563
4632
|
type: Div,
|
|
4564
4633
|
className: SearchHeader,
|
|
4565
|
-
role: None,
|
|
4634
|
+
role: None$1,
|
|
4566
4635
|
childCount: 3,
|
|
4567
4636
|
onClick: HandleHeaderClick2,
|
|
4568
4637
|
onFocusIn: HandleHeaderFocusIn,
|
|
@@ -4594,10 +4663,10 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarY, scrollBarValue) =>
|
|
|
4594
4663
|
}
|
|
4595
4664
|
return [{
|
|
4596
4665
|
type: Div,
|
|
4597
|
-
className: mergeClassNames(ScrollBar
|
|
4666
|
+
className: mergeClassNames(ScrollBar, ScrollBarVertical),
|
|
4598
4667
|
childCount: 1,
|
|
4599
4668
|
onPointerDown: HandleScrollBarPointerDown,
|
|
4600
|
-
role: ScrollBar,
|
|
4669
|
+
role: ScrollBar$1,
|
|
4601
4670
|
ariaControls: TreeItems,
|
|
4602
4671
|
ariaValueNow: scrollBarValue
|
|
4603
4672
|
}, {
|
|
@@ -4661,7 +4730,7 @@ const getFileIconVirtualDom = icon => {
|
|
|
4661
4730
|
type: Img,
|
|
4662
4731
|
className: FileIcon,
|
|
4663
4732
|
src: icon,
|
|
4664
|
-
role: None,
|
|
4733
|
+
role: None$1,
|
|
4665
4734
|
childCount: 0
|
|
4666
4735
|
};
|
|
4667
4736
|
};
|
|
@@ -4750,9 +4819,9 @@ const getSearchRemoveVirtualDom = () => {
|
|
|
4750
4819
|
|
|
4751
4820
|
const getSearchResultClassName = focused => {
|
|
4752
4821
|
if (focused) {
|
|
4753
|
-
return TreeItem
|
|
4822
|
+
return TreeItem + ' ' + TreeItemActive;
|
|
4754
4823
|
}
|
|
4755
|
-
return TreeItem
|
|
4824
|
+
return TreeItem;
|
|
4756
4825
|
};
|
|
4757
4826
|
|
|
4758
4827
|
const PaddingRight = '12px';
|
|
@@ -4775,7 +4844,7 @@ const getSearchResultVirtualDom = rowInfo => {
|
|
|
4775
4844
|
const childCount = getChildCount(icon, expanded, badgeText);
|
|
4776
4845
|
const dom = [{
|
|
4777
4846
|
type: Div,
|
|
4778
|
-
role: TreeItem,
|
|
4847
|
+
role: TreeItem$1,
|
|
4779
4848
|
className: getSearchResultClassName(focused),
|
|
4780
4849
|
title,
|
|
4781
4850
|
ariaSetSize: setSize,
|
|
@@ -4810,8 +4879,8 @@ const getSearchResultsVirtualDom = (visibleItems, focusOutline, scrollbarHeight,
|
|
|
4810
4879
|
const childCount = scrollbarHeight === 0 ? 1 : 2;
|
|
4811
4880
|
return [{
|
|
4812
4881
|
type: Div,
|
|
4813
|
-
className: mergeClassNames(Viewlet, List$1, Tree
|
|
4814
|
-
role: Tree,
|
|
4882
|
+
className: mergeClassNames(Viewlet, List$1, Tree, focusOutline ? FocusOutline : Empty),
|
|
4883
|
+
role: Tree$1,
|
|
4815
4884
|
tabIndex: 0,
|
|
4816
4885
|
childCount
|
|
4817
4886
|
}, ...getTreeItemsVirtualDom(visibleItems, deltaY, itemHeight), ...getScrollBarVirtualDom(scrollbarHeight, scrollBarY, scrollBarValue)];
|
|
@@ -4892,7 +4961,7 @@ const getIconVirtualDom = (icon, type = Div) => {
|
|
|
4892
4961
|
return {
|
|
4893
4962
|
type,
|
|
4894
4963
|
className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
|
|
4895
|
-
role: None,
|
|
4964
|
+
role: None$1,
|
|
4896
4965
|
childCount: 0
|
|
4897
4966
|
};
|
|
4898
4967
|
};
|
|
@@ -4974,22 +5043,22 @@ const renderActions = uid => {
|
|
|
4974
5043
|
const renderEventListeners = () => {
|
|
4975
5044
|
return [{
|
|
4976
5045
|
name: HandleInput2,
|
|
4977
|
-
params: ['handleInput2',
|
|
5046
|
+
params: ['handleInput2', TargetName, TargetValue, User]
|
|
4978
5047
|
}, {
|
|
4979
5048
|
name: HandleExcludeInput,
|
|
4980
|
-
params: ['handleExcludeInput',
|
|
5049
|
+
params: ['handleExcludeInput', TargetValue]
|
|
4981
5050
|
}, {
|
|
4982
5051
|
name: HandleIncludeInput,
|
|
4983
|
-
params: ['handleIncludeInput',
|
|
5052
|
+
params: ['handleIncludeInput', TargetValue]
|
|
4984
5053
|
}, {
|
|
4985
5054
|
name: HandleReplaceInput,
|
|
4986
|
-
params: ['handleReplaceInput',
|
|
5055
|
+
params: ['handleReplaceInput', TargetValue]
|
|
4987
5056
|
}, {
|
|
4988
5057
|
name: HandleInput,
|
|
4989
|
-
params: ['handleInput',
|
|
5058
|
+
params: ['handleInput', TargetValue, User]
|
|
4990
5059
|
}, {
|
|
4991
5060
|
name: HandleClick,
|
|
4992
|
-
params: ['handleClickAt',
|
|
5061
|
+
params: ['handleClickAt', ClientX, ClientY]
|
|
4993
5062
|
}, {
|
|
4994
5063
|
name: HandleToggleButtonClick,
|
|
4995
5064
|
params: ['handleToggleButtonClick']
|
|
@@ -5001,7 +5070,7 @@ const renderEventListeners = () => {
|
|
|
5001
5070
|
params: ['handleListBlur']
|
|
5002
5071
|
}, {
|
|
5003
5072
|
name: HandleContextMenu,
|
|
5004
|
-
params: ['handleContextMenu',
|
|
5073
|
+
params: ['handleContextMenu', Button$1, ClientX, ClientY],
|
|
5005
5074
|
preventDefault: true
|
|
5006
5075
|
}, {
|
|
5007
5076
|
name: HandleHeaderContextMenu,
|
|
@@ -5009,11 +5078,11 @@ const renderEventListeners = () => {
|
|
|
5009
5078
|
preventDefault: true
|
|
5010
5079
|
}, {
|
|
5011
5080
|
name: HandleWheel,
|
|
5012
|
-
params: ['handleWheel',
|
|
5081
|
+
params: ['handleWheel', DeltaMode, DeltaY],
|
|
5013
5082
|
passive: true
|
|
5014
5083
|
}, {
|
|
5015
5084
|
name: HandleHeaderClick2,
|
|
5016
|
-
params: ['handleHeaderClick',
|
|
5085
|
+
params: ['handleHeaderClick', TargetName]
|
|
5017
5086
|
}, {
|
|
5018
5087
|
name: HandleHeaderFocusIn,
|
|
5019
5088
|
params: ['handleHeaderFocusIn']
|
|
@@ -5022,7 +5091,7 @@ const renderEventListeners = () => {
|
|
|
5022
5091
|
params: ['handleHeaderFocusOut']
|
|
5023
5092
|
}, {
|
|
5024
5093
|
name: HandleScrollBarPointerDown,
|
|
5025
|
-
params: ['handleScrollBarClick',
|
|
5094
|
+
params: ['handleScrollBarClick', DeltaY]
|
|
5026
5095
|
}];
|
|
5027
5096
|
};
|
|
5028
5097
|
|
|
@@ -5107,7 +5176,8 @@ const saveState = uid => {
|
|
|
5107
5176
|
flags,
|
|
5108
5177
|
includeValue,
|
|
5109
5178
|
excludeValue,
|
|
5110
|
-
history
|
|
5179
|
+
history,
|
|
5180
|
+
collapsedPaths
|
|
5111
5181
|
} = newState;
|
|
5112
5182
|
return {
|
|
5113
5183
|
value,
|
|
@@ -5115,7 +5185,8 @@ const saveState = uid => {
|
|
|
5115
5185
|
flags,
|
|
5116
5186
|
includeValue,
|
|
5117
5187
|
excludeValue,
|
|
5118
|
-
history
|
|
5188
|
+
history,
|
|
5189
|
+
collapsedPaths
|
|
5119
5190
|
};
|
|
5120
5191
|
};
|
|
5121
5192
|
|
|
@@ -5248,8 +5319,6 @@ const show = async (x, y, id, ...args) => {
|
|
|
5248
5319
|
await showContextMenu(x, y, id, ...args);
|
|
5249
5320
|
};
|
|
5250
5321
|
|
|
5251
|
-
const Search = 18;
|
|
5252
|
-
|
|
5253
5322
|
const handleContextMenuKeyboard = async state => {
|
|
5254
5323
|
const {
|
|
5255
5324
|
x
|
|
@@ -5257,12 +5326,12 @@ const handleContextMenuKeyboard = async state => {
|
|
|
5257
5326
|
const {
|
|
5258
5327
|
y
|
|
5259
5328
|
} = state; // TODO
|
|
5260
|
-
await show(x, y, Search);
|
|
5329
|
+
await show(x, y, Search$1);
|
|
5261
5330
|
return state;
|
|
5262
5331
|
};
|
|
5263
5332
|
|
|
5264
5333
|
const handleContextMenuMouseAt = async (state, x, y) => {
|
|
5265
|
-
await show(x, y, Search);
|
|
5334
|
+
await show(x, y, Search$1);
|
|
5266
5335
|
return state;
|
|
5267
5336
|
};
|
|
5268
5337
|
|
|
@@ -5286,6 +5355,7 @@ const commandMap = {
|
|
|
5286
5355
|
'TextSearch.collapseAll': wrapCommand(collapseAll$1),
|
|
5287
5356
|
'TextSearch.collapseDetails': wrapCommand(collapseDetails),
|
|
5288
5357
|
'TextSearch.copy': wrapCommand(copy),
|
|
5358
|
+
'TextSearch.copyPath': wrapCommand(copyPath),
|
|
5289
5359
|
'TextSearch.diff2': diff2,
|
|
5290
5360
|
'TextSearch.dismissItem': wrapCommand(dismissItem),
|
|
5291
5361
|
'TextSearch.expandDetails': wrapCommand(expandDetails),
|
|
@@ -5337,6 +5407,7 @@ const commandMap = {
|
|
|
5337
5407
|
'TextSearch.replaceAll': wrapCommand(replaceAll),
|
|
5338
5408
|
'TextSearch.rerender': rerender,
|
|
5339
5409
|
'TextSearch.selectIndex': wrapCommand(selectIndex),
|
|
5410
|
+
'TextSearch.setLimit': wrapCommand(setLimit),
|
|
5340
5411
|
'TextSearch.submit': wrapCommand(submit),
|
|
5341
5412
|
'TextSearch.toggleMatchCase': wrapCommand(toggleMatchCase),
|
|
5342
5413
|
'TextSearch.toggleMatchWholeWord': wrapCommand(toggleMatchWholeWord),
|
|
@@ -5347,7 +5418,6 @@ const commandMap = {
|
|
|
5347
5418
|
'TextSearch.toggleUseIgnoreFiles': wrapCommand(toggleUseIgnoreFiles),
|
|
5348
5419
|
'TextSearch.toggleUseRegularExpression': wrapCommand(toggleUseRegularExpression),
|
|
5349
5420
|
'TextSearch.viewAsTree': wrapCommand(viewAsTree),
|
|
5350
|
-
'TextSearch.setLimit': wrapCommand(setLimit),
|
|
5351
5421
|
// not wrapped
|
|
5352
5422
|
'TextSearch.initialize': initialize,
|
|
5353
5423
|
'TextSearch.create': create,
|