@lvce-editor/file-search-worker 4.3.0 → 4.4.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.
@@ -1778,7 +1778,7 @@ const handleWheel = (state, deltaMode, deltaY) => {
1778
1778
  return setDeltaY(state, state.deltaY + deltaY);
1779
1779
  };
1780
1780
 
1781
- const create = (uid, uri, listItemHeight, x, y, width, height, platform, args, renderAllItems) => {
1781
+ const create = (uid, uri, listItemHeight, x, y, width, height, platform, args) => {
1782
1782
  const state = {
1783
1783
  uid,
1784
1784
  state: Default$1,
@@ -1806,8 +1806,7 @@ const create = (uid, uri, listItemHeight, x, y, width, height, platform, args, r
1806
1806
  args,
1807
1807
  focused: false,
1808
1808
  platform,
1809
- value: '',
1810
- renderAllItems
1809
+ value: ''
1811
1810
  };
1812
1811
  set(uid, state, state);
1813
1812
  };
@@ -2144,6 +2143,11 @@ const InsertLineBreak = 'insertLineBreak';
2144
2143
  const InsertCompositionText = 'insertCompositionText';
2145
2144
  const InsertFromPaste = 'insertFromPaste';
2146
2145
 
2146
+ const RE_ALPHA_NUMERIC = /[a-z\d]/i;
2147
+ const isAlphaNumeric = character => {
2148
+ return RE_ALPHA_NUMERIC.test(character);
2149
+ };
2150
+
2147
2151
  const getNewValueInsertText = (value, selectionStart, selectionEnd, data) => {
2148
2152
  if (selectionStart === value.length) {
2149
2153
  const newValue = value + data;
@@ -2177,10 +2181,6 @@ const getNewValueDeleteContentBackward = (value, selectionStart, selectionEnd, d
2177
2181
  cursorOffset: selectionStart
2178
2182
  };
2179
2183
  };
2180
- const RE_ALPHA_NUMERIC = /[a-z\d]/i;
2181
- const isAlphaNumeric = character => {
2182
- return RE_ALPHA_NUMERIC.test(character);
2183
- };
2184
2184
  const getNewValueDeleteWordBackward = (value, selectionStart, selectionEnd, data) => {
2185
2185
  const after = value.slice(selectionEnd);
2186
2186
  if (selectionStart === selectionEnd) {
@@ -2584,6 +2584,13 @@ const getIconRequests = (items, provider) => {
2584
2584
  return iconRequests;
2585
2585
  };
2586
2586
 
2587
+ const getPickDescription$3 = (provider, pick) => {
2588
+ if (provider.getPickDescription) {
2589
+ return provider.getPickDescription(pick);
2590
+ }
2591
+ return '';
2592
+ };
2593
+
2587
2594
  const requestFileIcons = async requests => {
2588
2595
  const promises = requests.map(request => {
2589
2596
  if (!request.name) {
@@ -2598,12 +2605,6 @@ const requestFileIcons = async requests => {
2598
2605
  return Promise.all(promises);
2599
2606
  };
2600
2607
 
2601
- const getPickDescription$3 = (provider, pick) => {
2602
- if (provider.getPickDescription) {
2603
- return provider.getPickDescription(pick);
2604
- }
2605
- return '';
2606
- };
2607
2608
  const getVisible = async (provider, items, minLineY, maxLineY, focusedIndex) => {
2608
2609
  const visibleItems = [];
2609
2610
  const setSize = items.length;
@@ -2647,8 +2648,7 @@ const createQuickPickViewModel = async (oldState, newState) => {
2647
2648
  height,
2648
2649
  oldFocusedIndex,
2649
2650
  newFocusedIndex,
2650
- uid: newState.uid,
2651
- renderAllItems: newState.renderAllItems
2651
+ uid: newState.uid
2652
2652
  };
2653
2653
  };
2654
2654
 
@@ -2671,11 +2671,7 @@ const renderCursorOffset = newState => {
2671
2671
  const QuickPickInput = 'QuickPickInput';
2672
2672
 
2673
2673
  const renderFocus = newState => {
2674
- if (newState.renderAllItems) {
2675
- return ['Viewlet.focusElementByName', QuickPickInput];
2676
- }
2677
- const selector = newState.focused ? '.InputBox' : '';
2678
- return ['Viewlet.focusSelector', selector];
2674
+ return ['Viewlet.focusElementByName', QuickPickInput];
2679
2675
  };
2680
2676
 
2681
2677
  const renderFocusedIndex = newState => {
@@ -2707,21 +2703,52 @@ const QuickPickItemLabel = 'QuickPickItemLabel';
2707
2703
  const QuickPickItems$1 = 'QuickPickItems';
2708
2704
  const Viewlet = 'Viewlet';
2709
2705
 
2706
+ const HandleBeforeInput = 'handleBeforeInput';
2707
+ const HandleBlur = 'handleBlur';
2708
+ const HandleFocus = 'handleFocus';
2709
+ const HandleInput = 'handleInput';
2710
+ const HandlePointerDown = 'handlePointerDown';
2711
+ const HandleWheel = 'handleWheel';
2712
+
2713
+ const QuickPick = 'QuickPick';
2714
+ const QuickPickItems = 'QuickPickItems';
2715
+ const QuickPickItemActive = 'QuickPickItemActive';
2716
+
2710
2717
  const Div$1 = 4;
2711
2718
  const Input$1 = 6;
2712
2719
  const Span$1 = 8;
2713
2720
  const Img$1 = 17;
2714
2721
 
2715
- const getFileIconVirtualDom = icon => {
2722
+ const getQuickPickInputVirtualDom = () => {
2723
+ const ariaLabel = typeNameofCommandToRun();
2716
2724
  return {
2717
- type: Img$1,
2718
- className: FileIcon,
2719
- src: icon,
2720
- role: None$1,
2721
- childCount: 0
2725
+ type: Input$1,
2726
+ className: InputBox,
2727
+ spellcheck: false,
2728
+ autocapitalize: 'off',
2729
+ inputType: 'text',
2730
+ childCount: 0,
2731
+ role: ComboBox,
2732
+ name: QuickPickInput,
2733
+ onBeforeInput: HandleBeforeInput,
2734
+ onBlur: HandleBlur,
2735
+ onInput: HandleInput,
2736
+ onFocus: HandleFocus,
2737
+ ariaLabel: ariaLabel,
2738
+ ariaAutoComplete: 'list',
2739
+ ariaExpanded: true,
2740
+ autocomplete: 'off'
2722
2741
  };
2723
2742
  };
2724
2743
 
2744
+ const getQuickPickHeaderVirtualDom = () => {
2745
+ return [{
2746
+ type: Div$1,
2747
+ className: QuickPickHeader,
2748
+ childCount: 1
2749
+ }, getQuickPickInputVirtualDom()];
2750
+ };
2751
+
2725
2752
  var __defProp = Object.defineProperty;
2726
2753
  var __export = (target, all) => {
2727
2754
  for (var name in all) __defProp(target, name, {
@@ -2889,6 +2916,17 @@ const addHighlights = (dom, highlights, label) => {
2889
2916
  dom.push(text(afterText));
2890
2917
  }
2891
2918
  };
2919
+
2920
+ const getFileIconVirtualDom = icon => {
2921
+ return {
2922
+ type: Img$1,
2923
+ className: FileIcon,
2924
+ src: icon,
2925
+ role: None$1,
2926
+ childCount: 0
2927
+ };
2928
+ };
2929
+
2892
2930
  const getQuickPickItemVirtualDom = visibleItem => {
2893
2931
  const {
2894
2932
  posInSet,
@@ -2959,47 +2997,6 @@ const getQuickPickItemsVirtualDom = visibleItems => {
2959
2997
  return dom;
2960
2998
  };
2961
2999
 
2962
- const HandleBeforeInput = 'handleBeforeInput';
2963
- const HandleBlur = 'handleBlur';
2964
- const HandleFocus = 'handleFocus';
2965
- const HandleInput = 'handleInput';
2966
- const HandlePointerDown = 'handlePointerDown';
2967
- const HandleWheel = 'handleWheel';
2968
-
2969
- const QuickPick = 'QuickPick';
2970
- const QuickPickItems = 'QuickPickItems';
2971
- const QuickPickItemActive = 'QuickPickItemActive';
2972
-
2973
- const getQuickPickInputVirtualDom = () => {
2974
- const ariaLabel = typeNameofCommandToRun();
2975
- return {
2976
- type: Input$1,
2977
- className: InputBox,
2978
- spellcheck: false,
2979
- autocapitalize: 'off',
2980
- inputType: 'text',
2981
- childCount: 0,
2982
- role: ComboBox,
2983
- name: QuickPickInput,
2984
- onBeforeInput: HandleBeforeInput,
2985
- onBlur: HandleBlur,
2986
- onInput: HandleInput,
2987
- onFocus: HandleFocus,
2988
- ariaLabel: ariaLabel,
2989
- ariaAutoComplete: 'list',
2990
- ariaExpanded: true,
2991
- autocomplete: 'off'
2992
- };
2993
- };
2994
-
2995
- const getQuickPickHeaderVirtualDom = () => {
2996
- return [{
2997
- type: Div$1,
2998
- className: QuickPickHeader,
2999
- childCount: 1
3000
- }, getQuickPickInputVirtualDom()];
3001
- };
3002
-
3003
3000
  const getQuickPickVirtualDom = visibleItems => {
3004
3001
  const quickOpen$1 = quickOpen();
3005
3002
  return [{
@@ -3020,12 +3017,8 @@ const getQuickPickVirtualDom = visibleItems => {
3020
3017
  };
3021
3018
 
3022
3019
  const renderItems = newState => {
3023
- if (newState.renderAllItems) {
3024
- const dom = getQuickPickVirtualDom(newState.visibleItems);
3025
- return ['Viewlet.setDom2', dom];
3026
- }
3027
- const dom = getQuickPickItemsVirtualDom(newState.visibleItems);
3028
- return ['Viewlet.send', newState.uid, /* method */'setItemsDom', dom];
3020
+ const dom = getQuickPickVirtualDom(newState.visibleItems);
3021
+ return ['Viewlet.setDom2', dom];
3029
3022
  };
3030
3023
 
3031
3024
  const renderValue = newState => {
@@ -3055,10 +3048,10 @@ const applyRender = async (oldState, newState, diffResult) => {
3055
3048
  const commands = [];
3056
3049
  const viewModel = await createQuickPickViewModel(oldState, newState);
3057
3050
  for (const item of diffResult) {
3058
- if (viewModel.renderAllItems && item === Height) {
3051
+ if (item === Height) {
3059
3052
  continue;
3060
3053
  }
3061
- if (viewModel.renderAllItems && item === RenderFocusedIndex) {
3054
+ if (item === RenderFocusedIndex) {
3062
3055
  continue;
3063
3056
  }
3064
3057
  const fn = getRenderer(item);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-search-worker",
3
- "version": "4.3.0",
3
+ "version": "4.4.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "text-search"