@lvce-editor/text-search-worker 3.45.0 → 3.47.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.
@@ -936,12 +936,12 @@ const invokeAndTransfer$1 = (ipc, method, ...params) => {
936
936
  return invokeHelper(ipc, method, params, true);
937
937
  };
938
938
 
939
- const commands$1 = Object.create(null);
939
+ const commands = Object.create(null);
940
940
  const register = commandMap => {
941
- Object.assign(commands$1, commandMap);
941
+ Object.assign(commands, commandMap);
942
942
  };
943
943
  const getCommand = key => {
944
- return commands$1[key];
944
+ return commands[key];
945
945
  };
946
946
  const execute = (command, ...args) => {
947
947
  const fn = getCommand(command);
@@ -1779,9 +1779,10 @@ const getActionsVirtualDom = actions => {
1779
1779
  }, ...actions.flatMap(getActionVirtualDom)];
1780
1780
  };
1781
1781
 
1782
- const commands = ['clearSearchResults', 'copy', 'dismissItem', 'focusFirst', 'focusIndex', 'focusLast', 'focusMatchCase', 'focusMatchCasePrevious', 'focusMatchWholeWord', 'focusNext', 'focusNextInput', 'focusNextPage', 'focusPreserveCasePrevious', 'focusPrevious', 'focusPreviousInput', 'focusPreviousPage', 'focusRegex', 'focusRegexNext', 'focusReplaceAll', 'focusReplaceValue', 'focusReplaceValueNext', 'focusReplaceValuePrevious', 'focusSearchValue', 'focusSearchValueNext', 'handleClick', 'handleClickAt', 'handleContextMenu', 'handleContextMenuKeyboard', 'handleContextMenuMouseAt', 'handleExcludeInput', 'handleFocusIn', 'handleHeaderClick', 'handleIconThemeChange', 'handleIconThemeChange', 'handleIncludeInput', 'handleInput', 'handleListBlur', 'handleListFocus', 'handleReplaceInput', 'handleScrollBarCaptureLost', 'handleScrollBarClick', 'handleScrollBarMove', 'handleScrollBarThumbPointerMove', 'handleTouchEnd', 'handleTouchMove', 'handleTouchStart', 'handleUpdate', 'handleWheel', 'refresh', 'replaceAll', 'scrollDown', 'selectIndex', 'submit', 'toggleMatchCase', 'toggleMatchWholeWord', 'togglePreserveCase', 'toggleReplace', 'toggleSearchDetails', 'toggleUseRegularExpression'];
1782
+ const commandIds = ['clearSearchResults', 'copy', 'dismissItem', 'focusFirst', 'focusIndex', 'focusLast', 'focusMatchCase', 'focusMatchCasePrevious', 'focusMatchWholeWord', 'focusNext', 'focusNextInput', 'focusNextPage', 'focusPreserveCasePrevious', 'focusPrevious', 'focusPreviousInput', 'focusPreviousPage', 'focusRegex', 'focusRegexNext', 'focusReplaceAll', 'focusReplaceValue', 'focusReplaceValueNext', 'focusReplaceValuePrevious', 'focusSearchValue', 'focusSearchValueNext', 'handleClick', 'handleClickAt', 'handleContextMenu', 'handleContextMenuKeyboard', 'handleContextMenuMouseAt', 'handleExcludeInput', 'handleFocusIn', 'handleHeaderClick', 'handleIconThemeChange', 'handleIconThemeChange', 'handleIncludeInput', 'handleInput', 'handleListBlur', 'handleListFocus', 'handleReplaceInput', 'handleScrollBarCaptureLost', 'handleScrollBarClick', 'handleScrollBarMove', 'handleScrollBarThumbPointerMove', 'handleTouchEnd', 'handleTouchMove', 'handleTouchStart', 'handleUpdate', 'handleWheel', 'refresh', 'replaceAll', 'scrollDown', 'selectIndex', 'submit', 'toggleMatchCase', 'toggleMatchWholeWord', 'togglePreserveCase', 'toggleReplace', 'toggleSearchDetails', 'toggleUseRegularExpression'];
1783
+
1783
1784
  const getCommandIds = () => {
1784
- return commands;
1785
+ return commandIds;
1785
1786
  };
1786
1787
 
1787
1788
  const getFlags = uid => {
@@ -2870,7 +2871,7 @@ const textSearch = async (root, query, options, assetDir, platform) => {
2870
2871
  // Based on https://github.com/microsoft/vscode/blob/ad375c92764b72a1f28f3e1626563e9e41e5c740/src/vs/workbench/contrib/search/browser/searchWidget.ts#L393 by Microsoft (License MIT)
2871
2872
 
2872
2873
  const validateSearchInput = (value, flags) => {
2873
- if (value.length === 0) {
2874
+ if (!value) {
2874
2875
  return '';
2875
2876
  }
2876
2877
  if (!(flags & UseRegularExpression$1)) {
@@ -3706,6 +3707,10 @@ const RenderReplaceValue = 4;
3706
3707
  const RenderIncludeValue = 5;
3707
3708
  const RenderExcludeValue = 6;
3708
3709
 
3710
+ const renderFocus = (oldState, newState) => {
3711
+ return oldState.focus === newState.focus || newState.focusSource === User;
3712
+ };
3713
+
3709
3714
  const createViewModel = state => {
3710
3715
  const {
3711
3716
  listItems,
@@ -3755,9 +3760,6 @@ const renderItems = (oldState, newState) => {
3755
3760
  return ['Viewlet.setDom2', newState.uid, dom];
3756
3761
  };
3757
3762
 
3758
- const renderFocus = (oldState, newState) => {
3759
- return oldState.focus === newState.focus || newState.focusSource === User;
3760
- };
3761
3763
  const renderValue = (oldState, newState) => {
3762
3764
  return ['Viewlet.send', newState.uid, 'setValue', newState.value, `[name="${SearchValue}"]`];
3763
3765
  };
@@ -3770,6 +3772,7 @@ const renderIncludeValue = (oldState, newState) => {
3770
3772
  const renderExcludeValue = (oldState, newState) => {
3771
3773
  return ['Viewlet.send', newState.uid, 'setValue', newState.excludeValue, `[name=${FilesToExclude}]`];
3772
3774
  };
3775
+
3773
3776
  const getRenderer = diffType => {
3774
3777
  switch (diffType) {
3775
3778
  case RenderValue:
@@ -3885,6 +3888,19 @@ const doRender = uid => {
3885
3888
  return applyRender(oldState, newState, diffResult);
3886
3889
  };
3887
3890
 
3891
+ const renderActions = uid => {
3892
+ const {
3893
+ oldState,
3894
+ newState
3895
+ } = get(uid);
3896
+ if (oldState === newState) {
3897
+ return [];
3898
+ }
3899
+ const actions = [];
3900
+ const dom = getActionsVirtualDom(actions);
3901
+ return dom;
3902
+ };
3903
+
3888
3904
  const renderEventListeners = () => {
3889
3905
  return [{
3890
3906
  name: HandleExcludeInput,
@@ -4529,6 +4545,7 @@ const commandMap = {
4529
4545
  'TextSearch.focusReplaceValue': wrapCommand(focusReplaceValue$1),
4530
4546
  'TextSearch.focusReplaceValueNext': wrapCommand(focusReplaceValueNext),
4531
4547
  'TextSearch.focusReplaceValuePrevious': wrapCommand(focusReplaceValuePrevious),
4548
+ 'TextSearch.renderActions': wrapCommand(renderActions),
4532
4549
  'TextSearch.focusSearchValue': wrapCommand(focusSearchValue$1),
4533
4550
  'TextSearch.focusSearchValueNext': wrapCommand(focusSearchValueNext),
4534
4551
  'TextSearch.getActions': wrapCommand(getActions),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "3.45.0",
3
+ "version": "3.47.0",
4
4
  "description": "Text Search Worker",
5
5
  "keywords": [
6
6
  "text-search"