@lvce-editor/text-search-worker 5.10.0 → 5.11.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.
@@ -1256,6 +1256,7 @@ const FocusSearchRegex = 33;
1256
1256
  const FocusSearchReplaceAll = 35;
1257
1257
  const FocusSearchReplaceInput = 31;
1258
1258
  const FocusSearchResults = 22;
1259
+ const FocusUseExcludeSettings = 90_123;
1259
1260
  const FocusSearchWholeWord = 34;
1260
1261
  const FocusToggleDetails = 1010;
1261
1262
  const FocusToggleReplace = 1020;
@@ -2407,7 +2408,14 @@ const getNextFocus = (focus, flags) => {
2407
2408
  case FocusSearchExcludeInput:
2408
2409
  return FocusIgnoreFiles;
2409
2410
  case FocusToggleDetails:
2410
- return FocusSearchIncludeInput;
2411
+ if (flags & DetailsExpanded) {
2412
+ return FocusSearchIncludeInput;
2413
+ }
2414
+ return FocusSearchResults;
2415
+ case FocusIgnoreFiles:
2416
+ return FocusSearchResults;
2417
+ case FocusUseExcludeSettings:
2418
+ return FocusSearchResults;
2411
2419
  default:
2412
2420
  return focus;
2413
2421
  }
@@ -2415,10 +2423,12 @@ const getNextFocus = (focus, flags) => {
2415
2423
 
2416
2424
  const focusNextInput = state => {
2417
2425
  const nextFocus = getNextFocus(state.focus, state.flags);
2426
+ const isListFocus = nextFocus === FocusSearchResults;
2418
2427
  return {
2419
2428
  ...state,
2420
2429
  focus: nextFocus,
2421
- focusSource: Script
2430
+ focusSource: Script,
2431
+ listFocused: isListFocus
2422
2432
  };
2423
2433
  };
2424
2434
 
@@ -3231,6 +3241,17 @@ const handleInput2 = (state, inputName, value, inputSource = Script) => {
3231
3241
  return fn(state, value, inputSource);
3232
3242
  };
3233
3243
 
3244
+ const handleInputBlur = async (state, name) => {
3245
+ return state;
3246
+ };
3247
+
3248
+ const handleInputFocus = state => {
3249
+ return {
3250
+ ...state,
3251
+ listFocused: false
3252
+ };
3253
+ };
3254
+
3234
3255
  const handleListBlur = state => {
3235
3256
  return {
3236
3257
  ...state,
@@ -3901,6 +3922,8 @@ const getFocusSelector = focusKey => {
3901
3922
  return UseExcludeSettings;
3902
3923
  case FocusToggleReplace:
3903
3924
  return ToggleReplace;
3925
+ case FocusSearchResults:
3926
+ return '.Tree';
3904
3927
  default:
3905
3928
  return '';
3906
3929
  }
@@ -4282,11 +4305,10 @@ const HandleClick = 1;
4282
4305
  const HandleContextMenu = 2;
4283
4306
  const HandleHeaderContextMenu = 3;
4284
4307
  const HandleExcludeInput = 4;
4285
- const HandleHeaderClick2 = 5;
4308
+ const HandleButtonClick = 5;
4286
4309
  const HandleHeaderFocusIn = 6;
4287
4310
  const HandleHeaderFocusOut = 7;
4288
4311
  const HandleIncludeInput = 8;
4289
- const HandleInput = 9;
4290
4312
  const HandleInput2 = 10;
4291
4313
  const HandleListBlur = 11;
4292
4314
  const HandleListFocus = 12;
@@ -4294,16 +4316,19 @@ const HandleReplaceInput = 13;
4294
4316
  const HandleScrollBarPointerDown = 14;
4295
4317
  const HandleToggleButtonClick = 15;
4296
4318
  const HandleWheel = 16;
4319
+ const HandleInputFocus = 17;
4320
+ const HandleInputBlur = 18;
4297
4321
 
4298
4322
  const getSearchDetailsToggleVirtualDom = () => {
4299
4323
  return [{
4300
- type: Div,
4324
+ type: Button$2,
4301
4325
  className: ToggleDetails,
4302
4326
  role: Button$3,
4303
4327
  tabIndex: 0,
4304
4328
  ariaLabel: toggleSearchDetails(),
4305
4329
  title: toggleSearchDetails(),
4306
4330
  name: ToggleSearchDetails,
4331
+ onClick: HandleButtonClick,
4307
4332
  childCount: 1
4308
4333
  }, {
4309
4334
  type: Div,
@@ -4424,7 +4449,8 @@ const getSearchFieldButtonVirtualDom = button => {
4424
4449
  ariaChecked,
4425
4450
  disabled,
4426
4451
  tabIndex: 0,
4427
- childCount: 1
4452
+ childCount: 1,
4453
+ onClick: HandleButtonClick
4428
4454
  }, {
4429
4455
  type: Span,
4430
4456
  className: mergeClassNames(MaskIcon, icon),
@@ -4450,7 +4476,7 @@ const getOutSideButtonsDom = outsideButtons => {
4450
4476
  };
4451
4477
  };
4452
4478
 
4453
- const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, outsideButtons, onFocus = '', hasError = false) => {
4479
+ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, outsideButtons, hasError = false) => {
4454
4480
  const {
4455
4481
  preNodes,
4456
4482
  postNodes
@@ -4470,7 +4496,9 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
4470
4496
  placeholder,
4471
4497
  name,
4472
4498
  onInput,
4473
- onFocus,
4499
+ onFocus: HandleInputFocus,
4500
+ onBlur: HandleInputBlur,
4501
+ onContextMenu: HandleContextMenu,
4474
4502
  childCount: 0
4475
4503
  }, {
4476
4504
  type: Div,
@@ -4594,10 +4622,11 @@ const getSearchToggleVirtualDom = replaceExpanded => {
4594
4622
  className: mergeClassNames(IconButton, SearchToggleButton, replaceExpanded ? SearchToggleButtonExpanded : ''),
4595
4623
  title: toggleReplace$1(),
4596
4624
  ariaLabel: toggleReplace$1(),
4625
+ // TODO compute label only once
4597
4626
  ariaExpanded: Boolean(replaceExpanded),
4598
4627
  childCount: 1,
4599
- 'data-command': 'toggleReplace',
4600
- name: ToggleReplace
4628
+ name: ToggleReplace,
4629
+ onClick: HandleButtonClick
4601
4630
  }, {
4602
4631
  type: Div,
4603
4632
  className: mergeClassNames(MaskIcon, replaceExpanded ? MaskIconChevronDown : MaskIconChevronRight),
@@ -4621,7 +4650,7 @@ const getSearchHeaderTopVirtualDom = (flags, searchInputErrorMessage, matchCount
4621
4650
  className: SearchHeaderTopRight,
4622
4651
  role: None$1,
4623
4652
  childCount: replaceExpanded ? 2 : 1
4624
- }, ...getSearchFieldVirtualDom(SearchValue, searchPlaceholder, HandleInput2, inputActions.inside, inputActions.outside, '', Boolean(searchInputErrorMessage))];
4653
+ }, ...getSearchFieldVirtualDom(SearchValue, searchPlaceholder, HandleInput2, inputActions.inside, inputActions.outside, Boolean(searchInputErrorMessage))];
4625
4654
  if (flags & ReplaceExpanded) {
4626
4655
  dom.push(...getSearchFieldVirtualDom(ReplaceValue, replacePlaceholder, HandleInput2, replaceActions.inside, replaceActions.outside));
4627
4656
  }
@@ -4633,9 +4662,6 @@ const parentNode = {
4633
4662
  className: SearchHeader,
4634
4663
  role: None$1,
4635
4664
  childCount: 3,
4636
- onClick: HandleHeaderClick2,
4637
- onFocusIn: HandleHeaderFocusIn,
4638
- onFocusOut: HandleHeaderFocusOut,
4639
4665
  onContextMenu: HandleHeaderContextMenu
4640
4666
  };
4641
4667
  const getSearchHeaderVirtualDom = (flags, message, searchInputErrorMessage, matchCount, focus, limitHitWarning) => {
@@ -5053,9 +5079,6 @@ const renderEventListeners = () => {
5053
5079
  }, {
5054
5080
  name: HandleReplaceInput,
5055
5081
  params: ['handleReplaceInput', TargetValue]
5056
- }, {
5057
- name: HandleInput,
5058
- params: ['handleInput', TargetValue, User]
5059
5082
  }, {
5060
5083
  name: HandleClick,
5061
5084
  params: ['handleClickAt', ClientX, ClientY]
@@ -5081,7 +5104,7 @@ const renderEventListeners = () => {
5081
5104
  params: ['handleWheel', DeltaMode, DeltaY],
5082
5105
  passive: true
5083
5106
  }, {
5084
- name: HandleHeaderClick2,
5107
+ name: HandleButtonClick,
5085
5108
  params: ['handleHeaderClick', TargetName]
5086
5109
  }, {
5087
5110
  name: HandleHeaderFocusIn,
@@ -5092,6 +5115,12 @@ const renderEventListeners = () => {
5092
5115
  }, {
5093
5116
  name: HandleScrollBarPointerDown,
5094
5117
  params: ['handleScrollBarClick', DeltaY]
5118
+ }, {
5119
+ name: HandleInputFocus,
5120
+ params: ['handleInputFocus', TargetName]
5121
+ }, {
5122
+ name: HandleInputBlur,
5123
+ params: ['handleInputBlur', TargetName]
5095
5124
  }];
5096
5125
  };
5097
5126
 
@@ -5356,6 +5385,7 @@ const commandMap = {
5356
5385
  'TextSearch.collapseDetails': wrapCommand(collapseDetails),
5357
5386
  'TextSearch.copy': wrapCommand(copy),
5358
5387
  'TextSearch.copyPath': wrapCommand(copyPath),
5388
+ 'TextSearch.handleInputBlur': wrapCommand(handleInputBlur),
5359
5389
  'TextSearch.diff2': diff2,
5360
5390
  'TextSearch.dismissItem': wrapCommand(dismissItem),
5361
5391
  'TextSearch.expandDetails': wrapCommand(expandDetails),
@@ -5382,6 +5412,7 @@ const commandMap = {
5382
5412
  'TextSearch.focusSearchValue': wrapCommand(focusSearchValue$1),
5383
5413
  'TextSearch.focusSearchValueNext': wrapCommand(focusSearchValueNext),
5384
5414
  'TextSearch.handleClickAt': wrapCommand(handleClickAt),
5415
+ 'TextSearch.handleInputFocus': wrapCommand(handleInputFocus),
5385
5416
  'TextSearch.handleContextMenu': wrapCommand(handleContextMenu),
5386
5417
  'TextSearch.handleExcludeInput': wrapCommand(handleExcludeInput),
5387
5418
  'TextSearch.handleFocusIn': wrapCommand(handleFocusIn),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "5.10.0",
3
+ "version": "5.11.0",
4
4
  "description": "Text Search Worker",
5
5
  "keywords": [
6
6
  "text-search"