@lvce-editor/text-search-worker 6.7.0 → 6.9.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.
@@ -1795,7 +1795,6 @@ const diffChildren = (oldChildren, newChildren, patches) => {
1795
1795
  patches.push({
1796
1796
  type: NavigateParent
1797
1797
  });
1798
- currentChildIndex = -1;
1799
1798
  }
1800
1799
  // Add remove patches in reverse order (highest index first)
1801
1800
  // This ensures indices remain valid as we remove
@@ -3112,16 +3111,27 @@ const handleUpdateEmpty = (state, update) => {
3112
3111
  ...state,
3113
3112
  ...update
3114
3113
  };
3114
+ const headerHeight = getTopHeight(partialNewState.flags);
3115
3115
  return {
3116
3116
  ...partialNewState,
3117
+ collapsedPaths: [],
3117
3118
  deltaY: 0,
3119
+ fileCount: 0,
3120
+ finalDeltaY: 0,
3121
+ headerHeight,
3122
+ icons: [],
3118
3123
  items: [],
3124
+ limitHit: false,
3125
+ limitHitWarning: '',
3119
3126
  listItems: [],
3120
3127
  loaded: true,
3121
3128
  matchCount: 0,
3122
3129
  maxLineY: 0,
3123
3130
  message: '',
3124
3131
  minLineY: 0,
3132
+ scrollBarHeight: 0,
3133
+ scrollBarY: 0,
3134
+ searchId: '',
3125
3135
  searchInputErrorMessage: ''
3126
3136
  };
3127
3137
  };
@@ -4808,10 +4818,7 @@ const getUsePullBasedSearch = async () => {
4808
4818
  };
4809
4819
 
4810
4820
  const hasProperty = (object, key) => {
4811
- if (!object || typeof object !== 'object' || !(key in object)) {
4812
- return false;
4813
- }
4814
- return true;
4821
+ return !!object && typeof object === 'object' && key in object;
4815
4822
  };
4816
4823
 
4817
4824
  const getSavedFocus = savedState => {
@@ -5122,8 +5129,8 @@ const createViewModel = state => {
5122
5129
  } = state;
5123
5130
  const displayResults = getDisplayResults(listItems, itemHeight, fileCount, value, minLineY, maxLineY, replacement, icons, listFocusedIndex, collapsedPaths, renderFolderPaths || false, items);
5124
5131
  const focusOutline = listFocused && listFocusedIndex === -1;
5125
- const scrollBarValue = deltaY / finalDeltaY * 100;
5126
- const scrollBarY = getScrollBarY$1(deltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
5132
+ const scrollBarValue = finalDeltaY === 0 ? 0 : deltaY / finalDeltaY * 100;
5133
+ const scrollBarY = finalDeltaY === 0 ? 0 : getScrollBarY$1(deltaY, finalDeltaY, height - headerHeight, scrollBarHeight);
5127
5134
  return {
5128
5135
  deltaY,
5129
5136
  displayResults,
@@ -6174,12 +6181,7 @@ const replaceAllAndPrompt = async (workspacePath, items, replacement, matchCount
6174
6181
  confirmMessage: confirmAccept,
6175
6182
  title: confirmTitle
6176
6183
  });
6177
- if (!shouldReplace) {
6178
- return false;
6179
- }
6180
- // TODO
6181
- // await TextSearchReplaceAll.replaceAll(workspacePath, items, replacement)
6182
- return true;
6184
+ return shouldReplace;
6183
6185
  };
6184
6186
 
6185
6187
  const replaceAllInFile = async state => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "6.7.0",
3
+ "version": "6.9.0",
4
4
  "description": "Text Search Worker",
5
5
  "keywords": [
6
6
  "text-search"