@lvce-editor/text-search-worker 5.29.0 → 5.31.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 +78 -13
- package/package.json +1 -1
|
@@ -1205,7 +1205,7 @@ const Viewlet = 'Viewlet';
|
|
|
1205
1205
|
const ViewletSearchMessage = 'ViewletSearchMessage';
|
|
1206
1206
|
const ViewletSearchMessageIndented = 'ViewletSearchMessageIndented';
|
|
1207
1207
|
|
|
1208
|
-
const File$
|
|
1208
|
+
const File$2 = 7;
|
|
1209
1209
|
|
|
1210
1210
|
const Button$2 = 1;
|
|
1211
1211
|
const Div = 4;
|
|
@@ -1244,6 +1244,7 @@ const RendererWorker = 1;
|
|
|
1244
1244
|
const SearchProcess = 77;
|
|
1245
1245
|
const IconThemeWorker = 7009;
|
|
1246
1246
|
|
|
1247
|
+
const File$1 = 1;
|
|
1247
1248
|
const Match$1 = 2;
|
|
1248
1249
|
|
|
1249
1250
|
const FocusElementByName = 'Viewlet.focusElementByName';
|
|
@@ -1994,7 +1995,7 @@ const toIconRequest = item => {
|
|
|
1994
1995
|
const filePath = getFilePath(item.text);
|
|
1995
1996
|
const fileName = getFileName(filePath);
|
|
1996
1997
|
return {
|
|
1997
|
-
type: File$
|
|
1998
|
+
type: File$2,
|
|
1998
1999
|
name: fileName,
|
|
1999
2000
|
path: filePath
|
|
2000
2001
|
};
|
|
@@ -2727,7 +2728,7 @@ const getMenuEntriesInput = options => {
|
|
|
2727
2728
|
}];
|
|
2728
2729
|
};
|
|
2729
2730
|
|
|
2730
|
-
const
|
|
2731
|
+
const getMenuEntriesFile = (state, props) => {
|
|
2731
2732
|
return [{
|
|
2732
2733
|
id: 'replaceAll',
|
|
2733
2734
|
label: replaceAll$1(),
|
|
@@ -2756,9 +2757,48 @@ const getMenuEntriesList = (state, props) => {
|
|
|
2756
2757
|
}];
|
|
2757
2758
|
};
|
|
2758
2759
|
|
|
2760
|
+
const getMenuEntriesMatch = (state, props) => {
|
|
2761
|
+
return [{
|
|
2762
|
+
id: 'dismiss',
|
|
2763
|
+
label: dismiss(),
|
|
2764
|
+
flags: None$1,
|
|
2765
|
+
command: 'Search.removeCurrent'
|
|
2766
|
+
}, {
|
|
2767
|
+
id: 'copy',
|
|
2768
|
+
label: copy(),
|
|
2769
|
+
flags: None$1,
|
|
2770
|
+
command: 'Search.copy'
|
|
2771
|
+
}, {
|
|
2772
|
+
id: 'copyAll',
|
|
2773
|
+
label: copyAll(),
|
|
2774
|
+
flags: None$1,
|
|
2775
|
+
command: 'Search.copyAll'
|
|
2776
|
+
}];
|
|
2777
|
+
};
|
|
2778
|
+
|
|
2779
|
+
const getMenuEntriesList = (state, props) => {
|
|
2780
|
+
const {
|
|
2781
|
+
items
|
|
2782
|
+
} = state;
|
|
2783
|
+
const {
|
|
2784
|
+
index
|
|
2785
|
+
} = props;
|
|
2786
|
+
const item = items[index];
|
|
2787
|
+
if (!item) {
|
|
2788
|
+
return [];
|
|
2789
|
+
}
|
|
2790
|
+
if (item.type === Match$1) {
|
|
2791
|
+
return getMenuEntriesMatch();
|
|
2792
|
+
}
|
|
2793
|
+
if (item.type === File$1) {
|
|
2794
|
+
return getMenuEntriesFile();
|
|
2795
|
+
}
|
|
2796
|
+
return [];
|
|
2797
|
+
};
|
|
2798
|
+
|
|
2759
2799
|
const getMenuEntries = (state, props) => {
|
|
2760
2800
|
if (props.menuId === Search$1) {
|
|
2761
|
-
return getMenuEntriesList();
|
|
2801
|
+
return getMenuEntriesList(state, props);
|
|
2762
2802
|
}
|
|
2763
2803
|
if (props.menuId === InputContextMenu) {
|
|
2764
2804
|
return getMenuEntriesInput(props);
|
|
@@ -3642,6 +3682,11 @@ const handleInputFocus = (state, name) => {
|
|
|
3642
3682
|
};
|
|
3643
3683
|
};
|
|
3644
3684
|
|
|
3685
|
+
const handleInputSelectAll = async (state, name) => {
|
|
3686
|
+
// TODO
|
|
3687
|
+
return state;
|
|
3688
|
+
};
|
|
3689
|
+
|
|
3645
3690
|
const handleInputSelectionChange = async (state, name, selectionStart, selectionEnd) => {
|
|
3646
3691
|
const {
|
|
3647
3692
|
selections
|
|
@@ -4386,14 +4431,15 @@ const refresh = state => {
|
|
|
4386
4431
|
};
|
|
4387
4432
|
|
|
4388
4433
|
const removeCurrent = async state => {
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
}
|
|
4434
|
+
const {
|
|
4435
|
+
focusedIndex,
|
|
4436
|
+
listFocusedIndex
|
|
4437
|
+
} = state;
|
|
4438
|
+
const actualIndex = focusedIndex === -1 ? listFocusedIndex : focusedIndex;
|
|
4439
|
+
if (actualIndex === -1) {
|
|
4440
|
+
return state;
|
|
4441
|
+
}
|
|
4442
|
+
return removeIndex(state, actualIndex);
|
|
4397
4443
|
};
|
|
4398
4444
|
|
|
4399
4445
|
const getFocusSelector = focusKey => {
|
|
@@ -5493,6 +5539,13 @@ const replaceAllAndPrompt = async (workspacePath, items, replacement, matchCount
|
|
|
5493
5539
|
return true;
|
|
5494
5540
|
};
|
|
5495
5541
|
|
|
5542
|
+
const replaceAllInFile = async state => {
|
|
5543
|
+
// TODO replace occurrance for focused file
|
|
5544
|
+
return {
|
|
5545
|
+
...state
|
|
5546
|
+
};
|
|
5547
|
+
};
|
|
5548
|
+
|
|
5496
5549
|
const rerender = state => {
|
|
5497
5550
|
return {
|
|
5498
5551
|
...state
|
|
@@ -5618,7 +5671,8 @@ const handleContextMenuKeyboard = async state => {
|
|
|
5618
5671
|
uid
|
|
5619
5672
|
} = state; // TODO
|
|
5620
5673
|
await show2(uid, Search$1, x, y, {
|
|
5621
|
-
menuId: Search$1
|
|
5674
|
+
menuId: Search$1,
|
|
5675
|
+
index: 0 // TODO pass proper index
|
|
5622
5676
|
});
|
|
5623
5677
|
return state;
|
|
5624
5678
|
};
|
|
@@ -5635,6 +5689,15 @@ const handleContextMenuMouseAt = async (state, eventX, eventY) => {
|
|
|
5635
5689
|
} = state;
|
|
5636
5690
|
const topHeight = getTopHeight(flags);
|
|
5637
5691
|
const index = getListIndex(eventX, eventY, x, y, deltaY, itemHeight, topHeight, listItems.length);
|
|
5692
|
+
const {
|
|
5693
|
+
oldState,
|
|
5694
|
+
newState
|
|
5695
|
+
} = get$1(uid);
|
|
5696
|
+
set(uid, oldState, {
|
|
5697
|
+
...newState,
|
|
5698
|
+
listFocusedIndex: index,
|
|
5699
|
+
focusedIndex: index
|
|
5700
|
+
});
|
|
5638
5701
|
await show2(uid, Search$1, x, y, {
|
|
5639
5702
|
menuId: Search$1,
|
|
5640
5703
|
index
|
|
@@ -5682,6 +5745,7 @@ const commandMap = {
|
|
|
5682
5745
|
'TextSearch.focusPreviousPage': wrapCommand(focusPreviousPage),
|
|
5683
5746
|
'TextSearch.focusRegex': wrapCommand(focusRegex),
|
|
5684
5747
|
'TextSearch.focusRegexNext': wrapCommand(focusRegexNext),
|
|
5748
|
+
'TextSearch.replaceAllInFile': wrapCommand(replaceAllInFile),
|
|
5685
5749
|
'TextSearch.focusReplaceAll': wrapCommand(focusReplaceAll),
|
|
5686
5750
|
'TextSearch.focusReplaceValue': wrapCommand(focusReplaceValue$1),
|
|
5687
5751
|
'TextSearch.focusReplaceValueNext': wrapCommand(focusReplaceValueNext),
|
|
@@ -5707,6 +5771,7 @@ const commandMap = {
|
|
|
5707
5771
|
'TextSearch.handleInputCut': wrapCommand(handleInputCut),
|
|
5708
5772
|
'TextSearch.handleInputFocus': wrapCommand(handleInputFocus),
|
|
5709
5773
|
'TextSearch.handleInputPaste': wrapCommand(handleInputPaste),
|
|
5774
|
+
'TextSearch.handleInputSelectAll': wrapCommand(handleInputSelectAll),
|
|
5710
5775
|
'TextSearch.handleInputSelectionChange': wrapCommand(handleInputSelectionChange),
|
|
5711
5776
|
'TextSearch.handleListBlur': wrapCommand(handleListBlur),
|
|
5712
5777
|
'TextSearch.handleListFocus': wrapCommand(handleListFocus),
|