@lvce-editor/text-search-worker 3.31.0 → 3.32.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.
@@ -2081,7 +2081,7 @@ const getSearchFieldButtonVirtualDom = button => {
2081
2081
  name
2082
2082
  } = button;
2083
2083
  return [{
2084
- type: Div,
2084
+ type: Button,
2085
2085
  className: mergeClassNames(SearchFieldButton, checked ? SearchFieldButtonChecked : ''),
2086
2086
  name,
2087
2087
  title,
@@ -2090,7 +2090,7 @@ const getSearchFieldButtonVirtualDom = button => {
2090
2090
  tabIndex: 0,
2091
2091
  childCount: 1
2092
2092
  }, {
2093
- type: Div,
2093
+ type: Span,
2094
2094
  className: mergeClassNames(MaskIcon, icon),
2095
2095
  childCount: 0
2096
2096
  }];
@@ -3056,31 +3056,22 @@ const toggleUseRegularExpression = state => {
3056
3056
  const getClickHandler = name => {
3057
3057
  switch (name) {
3058
3058
  case MatchCase:
3059
- // @ts-ignore
3060
3059
  return toggleMatchCase;
3061
3060
  case ToggleReplace:
3062
- // @ts-ignore
3063
3061
  return toggleReplace;
3064
3062
  case UseRegularExpression:
3065
- // @ts-ignore
3066
3063
  return toggleUseRegularExpression;
3067
3064
  case ReplaceAll:
3068
- // @ts-ignore
3069
3065
  return replaceAll;
3070
3066
  case MatchWholeWord:
3071
- // @ts-ignore
3072
3067
  return toggleMatchWholeWord;
3073
3068
  case PreserveCase:
3074
- // @ts-ignore
3075
3069
  return togglePreserveCase;
3076
3070
  case ToggleSearchDetails:
3077
- // @ts-ignore
3078
3071
  return toggleDetailsExpanded;
3079
3072
  case SearchOnlyOpenEditors:
3080
- // @ts-ignore
3081
3073
  return toggleOpenEditors;
3082
3074
  case UseExcludeSettings:
3083
- // @ts-ignore
3084
3075
  return toggleUseIgnoreFiles;
3085
3076
  case SearchValue:
3086
3077
  case ReplaceValue:
@@ -3427,9 +3418,9 @@ const selectIndex = async (state, index) => {
3427
3418
  };
3428
3419
  }
3429
3420
  const {
3430
- items
3421
+ listItems
3431
3422
  } = state;
3432
- const searchResult = items[index];
3423
+ const searchResult = listItems[index];
3433
3424
  const fn = getSelectHandler(searchResult.type);
3434
3425
  return fn(state, searchResult, index);
3435
3426
  };
@@ -3677,7 +3668,7 @@ const renderFocus = {
3677
3668
  },
3678
3669
  apply(oldState, newState) {
3679
3670
  const name = newState.focusSource === User ? '' : getFocusSelector(newState.focus);
3680
- return ['Viewlet.focusElementByName', name];
3671
+ return ['Viewlet.focusElementByName', newState.uid, name];
3681
3672
  }
3682
3673
  };
3683
3674
  const renderValue = {
@@ -3787,10 +3778,6 @@ const saveState = uid => {
3787
3778
  };
3788
3779
  };
3789
3780
 
3790
- const setFocus = async focusKey => {
3791
- await invoke$2('Focus.setFocus', focusKey);
3792
- };
3793
-
3794
3781
  const focusElement = (state, focusKey) => {
3795
3782
  return {
3796
3783
  ...state,
@@ -3799,6 +3786,10 @@ const focusElement = (state, focusKey) => {
3799
3786
  };
3800
3787
  };
3801
3788
 
3789
+ const setFocus = async focusKey => {
3790
+ await invoke$2('Focus.setFocus', focusKey);
3791
+ };
3792
+
3802
3793
  const getSearchFocusKey = key => {
3803
3794
  switch (key) {
3804
3795
  case SearchValue:
@@ -3825,11 +3816,26 @@ const getSearchFocusKey = key => {
3825
3816
  return FocusSearchOpenEditors;
3826
3817
  case UseExcludeSettings:
3827
3818
  return FocusIgnoreFiles;
3819
+ case ToggleReplace:
3820
+ return FocusToggleReplace;
3828
3821
  default:
3829
3822
  return Empty$1;
3830
3823
  }
3831
3824
  };
3832
3825
 
3826
+ const handleFocusIn = (state, key) => {
3827
+ const focusKey = getSearchFocusKey(key);
3828
+ if (state.focus === focusKey) {
3829
+ return state;
3830
+ }
3831
+ void setFocus(FocusSearch);
3832
+ return {
3833
+ ...state,
3834
+ focus: focusKey,
3835
+ focusSource: User
3836
+ };
3837
+ };
3838
+
3833
3839
  const focusSearchValue = state => {
3834
3840
  return focusElement(state, FocusSearchInput);
3835
3841
  };
@@ -3869,18 +3875,6 @@ const focusRegex = state => {
3869
3875
  const focusReplaceAll = state => {
3870
3876
  return focusElement(state, FocusSearchReplaceAll);
3871
3877
  };
3872
- const handleFocusIn = (state, key) => {
3873
- const focusKey = getSearchFocusKey(key);
3874
- if (state.focus === focusKey) {
3875
- return state;
3876
- }
3877
- void setFocus(FocusSearch);
3878
- return {
3879
- ...state,
3880
- focus: focusKey,
3881
- focusSource: User
3882
- };
3883
- };
3884
3878
 
3885
3879
  const submit = state => {
3886
3880
  return handleUpdate(state, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "3.31.0",
3
+ "version": "3.32.0",
4
4
  "description": "Text Search Worker",
5
5
  "main": "dist/textSearchWorkerMain.js",
6
6
  "type": "module",