@lvce-editor/text-search-worker 5.14.0 → 5.16.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 +23 -14
- package/package.json +1 -1
|
@@ -2092,7 +2092,7 @@ const copy = async state => {
|
|
|
2092
2092
|
return state;
|
|
2093
2093
|
};
|
|
2094
2094
|
|
|
2095
|
-
const copyPath = async state => {
|
|
2095
|
+
const copyPath$1 = async state => {
|
|
2096
2096
|
const {
|
|
2097
2097
|
items,
|
|
2098
2098
|
focusedIndex
|
|
@@ -2289,6 +2289,8 @@ const ConfirmReplaceManyOccurrencesInOneFile = "Replace {PH1} occurrences across
|
|
|
2289
2289
|
const ConfirmReplaceManyOccurrencesInOneFileNoValue = 'Replace {PH1} occurrences across 1 file';
|
|
2290
2290
|
const ConfirmReplaceOneOccurrenceInOneFile = "Replace 1 occurrence across 1 file with '{PH1}'";
|
|
2291
2291
|
const ConfirmReplaceOneOccurrenceInOneFileNoValue = 'Replace 1 occurrence across 1 file';
|
|
2292
|
+
const CopyPath = 'Copy Path';
|
|
2293
|
+
const Dismiss = 'Dismiss';
|
|
2292
2294
|
const Exclude = 'Exclude';
|
|
2293
2295
|
const FilesToExclude$1 = 'Files to Exclude';
|
|
2294
2296
|
const FilesToInclude$1 = 'Files to Include';
|
|
@@ -2408,9 +2410,15 @@ const replaceAll$1 = () => {
|
|
|
2408
2410
|
const replace = () => {
|
|
2409
2411
|
return i18nString(Replace);
|
|
2410
2412
|
};
|
|
2413
|
+
const dismiss = () => {
|
|
2414
|
+
return i18nString(Dismiss);
|
|
2415
|
+
};
|
|
2411
2416
|
const theResultSetOnlyContainsASubSetOfMatches = () => {
|
|
2412
2417
|
return i18nString(TheResultSetOnlyContainsASubSetOfMatches);
|
|
2413
2418
|
};
|
|
2419
|
+
const copyPath = () => {
|
|
2420
|
+
return i18nString(CopyPath);
|
|
2421
|
+
};
|
|
2414
2422
|
const refresh$1 = () => {
|
|
2415
2423
|
return i18nString(Refresh$1);
|
|
2416
2424
|
};
|
|
@@ -2821,12 +2829,12 @@ const getMenuEntryIds = () => {
|
|
|
2821
2829
|
const getMenuEntries = () => {
|
|
2822
2830
|
return [{
|
|
2823
2831
|
id: 'dismiss',
|
|
2824
|
-
label:
|
|
2832
|
+
label: dismiss(),
|
|
2825
2833
|
flags: None$1,
|
|
2826
2834
|
command: /* TODO */''
|
|
2827
2835
|
}, {
|
|
2828
2836
|
id: 'copyPath',
|
|
2829
|
-
label:
|
|
2837
|
+
label: copyPath(),
|
|
2830
2838
|
flags: None$1,
|
|
2831
2839
|
command: /* TODO */''
|
|
2832
2840
|
}];
|
|
@@ -3050,8 +3058,7 @@ const getRipGrepArgs = ({
|
|
|
3050
3058
|
searchString,
|
|
3051
3059
|
useRegularExpression
|
|
3052
3060
|
}) => {
|
|
3053
|
-
const ripGrepArgs = ['--hidden', '--no-require-git', '--smart-case', '--stats', '--json'];
|
|
3054
|
-
ripGrepArgs.push('--threads', `${threads}`);
|
|
3061
|
+
const ripGrepArgs = ['--hidden', '--no-require-git', '--smart-case', '--stats', '--json', '--threads', `${threads}`];
|
|
3055
3062
|
if (isCaseSensitive) {
|
|
3056
3063
|
ripGrepArgs.push('--case-sensitive');
|
|
3057
3064
|
} else {
|
|
@@ -3585,13 +3592,17 @@ const launchSearchProcessNode = async () => {
|
|
|
3585
3592
|
return rpc;
|
|
3586
3593
|
};
|
|
3587
3594
|
|
|
3588
|
-
const
|
|
3595
|
+
const setSearchProcessFactory = platform => {
|
|
3589
3596
|
if (platform === Electron) {
|
|
3590
3597
|
setFactory(launchSearchProcessElectron);
|
|
3591
3598
|
} else if (platform === Remote) {
|
|
3592
3599
|
setFactory(launchSearchProcessNode);
|
|
3593
3600
|
}
|
|
3594
|
-
|
|
3601
|
+
};
|
|
3602
|
+
const initialize = async platform => {
|
|
3603
|
+
setSearchProcessFactory(platform);
|
|
3604
|
+
|
|
3605
|
+
// TODO connect to icon theme worker
|
|
3595
3606
|
};
|
|
3596
3607
|
|
|
3597
3608
|
// TODO optimize this function to return the minimum number
|
|
@@ -4289,7 +4300,7 @@ const getSearchDisplayResultFile = (results, fileIcons, i, setSize, collapsedPat
|
|
|
4289
4300
|
const absolutePath = getRelativePath(path);
|
|
4290
4301
|
const baseName = pathBaseName(path);
|
|
4291
4302
|
const index = originalResults.indexOf(results[i]);
|
|
4292
|
-
const matchCount = getMatchCount(
|
|
4303
|
+
const matchCount = getMatchCount(originalResults, index);
|
|
4293
4304
|
const expanded = collapsedPaths.includes(path) ? Collapsed : Expanded;
|
|
4294
4305
|
const badgeText = `${matchCount}`;
|
|
4295
4306
|
return {
|
|
@@ -4346,7 +4357,6 @@ const getDisplayResult = (results, fileIcons, i, setSize, searchTermLength, repl
|
|
|
4346
4357
|
};
|
|
4347
4358
|
|
|
4348
4359
|
const getDisplayResults = (results, itemHeight, resultCount, searchTerm, minLineY, maxLineY, replacement, fileIcons, focusedIndex, collapsedPaths, originalResults) => {
|
|
4349
|
-
// Filter out child items when parent files are collapsed
|
|
4350
4360
|
const filteredResults = getFilteredResults(results, collapsedPaths);
|
|
4351
4361
|
const displayResults = [];
|
|
4352
4362
|
const setSize = resultCount;
|
|
@@ -5020,12 +5030,13 @@ const getSearchResultsVirtualDom = (visibleItems, focusOutline, scrollbarHeight,
|
|
|
5020
5030
|
}, ...getTreeItemsVirtualDom(visibleItems, deltaY, itemHeight), ...getScrollBarVirtualDom(scrollbarHeight, scrollBarY, scrollBarValue)];
|
|
5021
5031
|
};
|
|
5022
5032
|
|
|
5033
|
+
const className = mergeClassNames(Viewlet, Search$2);
|
|
5023
5034
|
const getSearchVirtualDom = (visibleItems, flags, message, focusOutline, searchInputErrorMessage, scrollBarHeight, scrollBarY, scrollBarValue, deltaY, itemHeight, matchCount, limitHitWarning, focus = 0) => {
|
|
5024
5035
|
const errorDom = getSearchInputErrorVirtualDom(searchInputErrorMessage);
|
|
5025
5036
|
const childCount = 2 + (errorDom.length > 0 ? 1 : 0);
|
|
5026
5037
|
return [{
|
|
5027
5038
|
type: Div,
|
|
5028
|
-
className
|
|
5039
|
+
className,
|
|
5029
5040
|
childCount
|
|
5030
5041
|
}, ...getSearchHeaderVirtualDom(flags, message, searchInputErrorMessage, matchCount, focus, limitHitWarning), ...errorDom, ...getSearchResultsVirtualDom(visibleItems, focusOutline, scrollBarHeight, scrollBarY, scrollBarValue, deltaY, itemHeight)];
|
|
5031
5042
|
};
|
|
@@ -5429,9 +5440,7 @@ const show = async (x, y, id, ...args) => {
|
|
|
5429
5440
|
|
|
5430
5441
|
const handleContextMenuKeyboard = async state => {
|
|
5431
5442
|
const {
|
|
5432
|
-
x
|
|
5433
|
-
} = state; // TODO
|
|
5434
|
-
const {
|
|
5443
|
+
x,
|
|
5435
5444
|
y
|
|
5436
5445
|
} = state; // TODO
|
|
5437
5446
|
await show(x, y, Search$1);
|
|
@@ -5463,7 +5472,7 @@ const commandMap = {
|
|
|
5463
5472
|
'TextSearch.collapseAll': wrapCommand(collapseAll$1),
|
|
5464
5473
|
'TextSearch.collapseDetails': wrapCommand(collapseDetails),
|
|
5465
5474
|
'TextSearch.copy': wrapCommand(copy),
|
|
5466
|
-
'TextSearch.copyPath': wrapCommand(copyPath),
|
|
5475
|
+
'TextSearch.copyPath': wrapCommand(copyPath$1),
|
|
5467
5476
|
'TextSearch.diff2': diff2,
|
|
5468
5477
|
'TextSearch.dismissItem': wrapCommand(dismissItem),
|
|
5469
5478
|
'TextSearch.expandDetails': wrapCommand(expandDetails),
|