@lvce-editor/text-search-worker 5.29.0 → 5.30.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.
@@ -3642,6 +3642,11 @@ const handleInputFocus = (state, name) => {
3642
3642
  };
3643
3643
  };
3644
3644
 
3645
+ const handleInputSelectAll = async (state, name) => {
3646
+ // TODO
3647
+ return state;
3648
+ };
3649
+
3645
3650
  const handleInputSelectionChange = async (state, name, selectionStart, selectionEnd) => {
3646
3651
  const {
3647
3652
  selections
@@ -4386,14 +4391,15 @@ const refresh = state => {
4386
4391
  };
4387
4392
 
4388
4393
  const removeCurrent = async state => {
4389
- // TODO
4390
- // 1. get focused index
4391
- // 2. if it is -1, do nothing
4392
- // 3. get search result at focused index
4393
- // 4. call removeIndex with state, searchResult, index
4394
- return {
4395
- ...state
4396
- };
4394
+ const {
4395
+ focusedIndex,
4396
+ listFocusedIndex
4397
+ } = state;
4398
+ const actualIndex = focusedIndex === -1 ? listFocusedIndex : focusedIndex;
4399
+ if (actualIndex === -1) {
4400
+ return state;
4401
+ }
4402
+ return removeIndex(state, actualIndex);
4397
4403
  };
4398
4404
 
4399
4405
  const getFocusSelector = focusKey => {
@@ -5493,6 +5499,13 @@ const replaceAllAndPrompt = async (workspacePath, items, replacement, matchCount
5493
5499
  return true;
5494
5500
  };
5495
5501
 
5502
+ const replaceAllInFile = async state => {
5503
+ // TODO replace occurrance for focused file
5504
+ return {
5505
+ ...state
5506
+ };
5507
+ };
5508
+
5496
5509
  const rerender = state => {
5497
5510
  return {
5498
5511
  ...state
@@ -5682,6 +5695,7 @@ const commandMap = {
5682
5695
  'TextSearch.focusPreviousPage': wrapCommand(focusPreviousPage),
5683
5696
  'TextSearch.focusRegex': wrapCommand(focusRegex),
5684
5697
  'TextSearch.focusRegexNext': wrapCommand(focusRegexNext),
5698
+ 'TextSearch.replaceAllInFile': wrapCommand(replaceAllInFile),
5685
5699
  'TextSearch.focusReplaceAll': wrapCommand(focusReplaceAll),
5686
5700
  'TextSearch.focusReplaceValue': wrapCommand(focusReplaceValue$1),
5687
5701
  'TextSearch.focusReplaceValueNext': wrapCommand(focusReplaceValueNext),
@@ -5707,6 +5721,7 @@ const commandMap = {
5707
5721
  'TextSearch.handleInputCut': wrapCommand(handleInputCut),
5708
5722
  'TextSearch.handleInputFocus': wrapCommand(handleInputFocus),
5709
5723
  'TextSearch.handleInputPaste': wrapCommand(handleInputPaste),
5724
+ 'TextSearch.handleInputSelectAll': wrapCommand(handleInputSelectAll),
5710
5725
  'TextSearch.handleInputSelectionChange': wrapCommand(handleInputSelectionChange),
5711
5726
  'TextSearch.handleListBlur': wrapCommand(handleListBlur),
5712
5727
  'TextSearch.handleListFocus': wrapCommand(handleListFocus),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "5.29.0",
3
+ "version": "5.30.0",
4
4
  "description": "Text Search Worker",
5
5
  "keywords": [
6
6
  "text-search"