@lvce-editor/text-search-worker 5.17.0 → 5.18.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.
@@ -1641,6 +1641,9 @@ const MatchCase$2 = 1 << 4; // 16
1641
1641
  const DetailsExpanded = 1 << 5; // 32
1642
1642
  const OpenEditors = 1 << 6; // 64
1643
1643
  const UseIgnoreFiles = 1 << 7; // 128
1644
+ const hasReplaceExpanded = flags => {
1645
+ return (flags & ReplaceExpanded) === ReplaceExpanded;
1646
+ };
1644
1647
  const hasDetailsExpanded = flags => {
1645
1648
  return (flags & DetailsExpanded) === DetailsExpanded;
1646
1649
  };
@@ -3383,8 +3386,31 @@ const togglePreserveCase = state => {
3383
3386
  return toggleSearchFlag(state, PreserveCase$2);
3384
3387
  };
3385
3388
 
3386
- const toggleReplace = state => {
3387
- return toggleSearchFlag(state, ReplaceExpanded);
3389
+ const collapseReplace = state => {
3390
+ const {
3391
+ flags
3392
+ } = state;
3393
+ return {
3394
+ ...state,
3395
+ flags: flags & -5
3396
+ };
3397
+ };
3398
+
3399
+ const expandReplace = state => {
3400
+ const {
3401
+ flags
3402
+ } = state;
3403
+ return {
3404
+ ...state,
3405
+ flags: flags | ReplaceExpanded
3406
+ };
3407
+ };
3408
+
3409
+ const toggleReplace = async state => {
3410
+ if (hasReplaceExpanded(state.flags)) {
3411
+ return collapseReplace(state);
3412
+ }
3413
+ return expandReplace(state);
3388
3414
  };
3389
3415
 
3390
3416
  const toggleUseIgnoreFiles = state => {
@@ -4417,7 +4443,7 @@ const createViewModel = state => {
4417
4443
  };
4418
4444
 
4419
4445
  const HandleClick = 1;
4420
- const HandleContextMenu = 2;
4446
+ const HandleListContextMenu = 2;
4421
4447
  const HandleHeaderContextMenu = 3;
4422
4448
  const HandleExcludeInput = 4;
4423
4449
  const HandleButtonClick = 5;
@@ -4613,7 +4639,7 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
4613
4639
  onInput,
4614
4640
  onFocus: HandleInputFocus,
4615
4641
  onBlur: HandleInputBlur,
4616
- onContextMenu: HandleContextMenu,
4642
+ onContextMenu: HandleListContextMenu,
4617
4643
  childCount: 0
4618
4644
  }, {
4619
4645
  type: Div,
@@ -5010,7 +5036,7 @@ const getTreeItemsVirtualDom = (visibleItems, deltaY, itemHeight) => {
5010
5036
  onClick: HandleClick,
5011
5037
  onBlur: HandleListBlur,
5012
5038
  onWheel: HandleWheel,
5013
- onContextMenu: HandleContextMenu,
5039
+ onContextMenu: HandleListContextMenu,
5014
5040
  id: TreeItems,
5015
5041
  top: `${-pixelOffset}px` // TODO use dynamic css instead
5016
5042
  }, ...visibleItems.flatMap(getSearchResultVirtualDom)];
@@ -5024,9 +5050,10 @@ const getSearchResultsVirtualDom = (visibleItems, focusOutline, scrollbarHeight,
5024
5050
  role: Tree$1,
5025
5051
  tabIndex: 0,
5026
5052
  childCount,
5027
- onBlur: HandleListBlur,
5028
- onPointerDown: HandleListPointerDown,
5029
- onFocus: HandleListFocus
5053
+ onBlur: HandleListBlur
5054
+ // TODO renable this when dom diffing is supported
5055
+ // onPointerDown: HandleListPointerDown,
5056
+ // onFocus: HandleListFocus,
5030
5057
  }, ...getTreeItemsVirtualDom(visibleItems, deltaY, itemHeight), ...getScrollBarVirtualDom(scrollbarHeight, scrollBarY, scrollBarValue)];
5031
5058
  };
5032
5059
 
@@ -5214,7 +5241,7 @@ const renderEventListeners = () => {
5214
5241
  name: HandleListBlur,
5215
5242
  params: ['handleListBlur']
5216
5243
  }, {
5217
- name: HandleContextMenu,
5244
+ name: HandleListContextMenu,
5218
5245
  params: ['handleContextMenu', Button$1, ClientX, ClientY],
5219
5246
  preventDefault: true
5220
5247
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "5.17.0",
3
+ "version": "5.18.0",
4
4
  "description": "Text Search Worker",
5
5
  "keywords": [
6
6
  "text-search"