@lvce-editor/file-search-worker 5.16.0 → 5.17.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.
- package/dist/fileSearchWorkerMain.js +64 -52
- package/package.json +1 -1
|
@@ -60,49 +60,57 @@ class AssertionError extends Error {
|
|
|
60
60
|
this.name = 'AssertionError';
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
const Object$1 = 1;
|
|
64
|
+
const Number$1 = 2;
|
|
65
|
+
const Array$1 = 3;
|
|
66
|
+
const String = 4;
|
|
67
|
+
const Boolean$1 = 5;
|
|
68
|
+
const Function = 6;
|
|
69
|
+
const Null = 7;
|
|
70
|
+
const Unknown = 8;
|
|
63
71
|
const getType = value => {
|
|
64
72
|
switch (typeof value) {
|
|
65
73
|
case 'number':
|
|
66
|
-
return
|
|
74
|
+
return Number$1;
|
|
67
75
|
case 'function':
|
|
68
|
-
return
|
|
76
|
+
return Function;
|
|
69
77
|
case 'string':
|
|
70
|
-
return
|
|
78
|
+
return String;
|
|
71
79
|
case 'object':
|
|
72
80
|
if (value === null) {
|
|
73
|
-
return
|
|
81
|
+
return Null;
|
|
74
82
|
}
|
|
75
83
|
if (Array.isArray(value)) {
|
|
76
|
-
return
|
|
84
|
+
return Array$1;
|
|
77
85
|
}
|
|
78
|
-
return
|
|
86
|
+
return Object$1;
|
|
79
87
|
case 'boolean':
|
|
80
|
-
return
|
|
88
|
+
return Boolean$1;
|
|
81
89
|
default:
|
|
82
|
-
return
|
|
90
|
+
return Unknown;
|
|
83
91
|
}
|
|
84
92
|
};
|
|
85
93
|
const object = value => {
|
|
86
94
|
const type = getType(value);
|
|
87
|
-
if (type !==
|
|
95
|
+
if (type !== Object$1) {
|
|
88
96
|
throw new AssertionError('expected value to be of type object');
|
|
89
97
|
}
|
|
90
98
|
};
|
|
91
99
|
const number = value => {
|
|
92
100
|
const type = getType(value);
|
|
93
|
-
if (type !==
|
|
101
|
+
if (type !== Number$1) {
|
|
94
102
|
throw new AssertionError('expected value to be of type number');
|
|
95
103
|
}
|
|
96
104
|
};
|
|
97
105
|
const array = value => {
|
|
98
106
|
const type = getType(value);
|
|
99
|
-
if (type !==
|
|
107
|
+
if (type !== Array$1) {
|
|
100
108
|
throw new AssertionError('expected value to be of type array');
|
|
101
109
|
}
|
|
102
110
|
};
|
|
103
111
|
const string = value => {
|
|
104
112
|
const type = getType(value);
|
|
105
|
-
if (type !==
|
|
113
|
+
if (type !== String) {
|
|
106
114
|
throw new AssertionError('expected value to be of type string');
|
|
107
115
|
}
|
|
108
116
|
};
|
|
@@ -923,8 +931,7 @@ const {
|
|
|
923
931
|
const RendererWorker = {
|
|
924
932
|
__proto__: null,
|
|
925
933
|
invoke: invoke$4,
|
|
926
|
-
set: set$3
|
|
927
|
-
};
|
|
934
|
+
set: set$3};
|
|
928
935
|
|
|
929
936
|
const {
|
|
930
937
|
invoke: invoke$1,
|
|
@@ -2775,6 +2782,34 @@ const renderHeight = newState => {
|
|
|
2775
2782
|
return ['Viewlet.send', newState.uid, /* method */SetItemsHeight, /* height */newState.height];
|
|
2776
2783
|
};
|
|
2777
2784
|
|
|
2785
|
+
const mergeClassNames = (...classNames) => {
|
|
2786
|
+
return classNames.filter(Boolean).join(' ');
|
|
2787
|
+
};
|
|
2788
|
+
const px = value => {
|
|
2789
|
+
return `${value}px`;
|
|
2790
|
+
};
|
|
2791
|
+
const position = (x, y) => {
|
|
2792
|
+
return `${x}px ${y}px`;
|
|
2793
|
+
};
|
|
2794
|
+
const Div = 4;
|
|
2795
|
+
const Input = 6;
|
|
2796
|
+
const Span = 8;
|
|
2797
|
+
const Text = 12;
|
|
2798
|
+
const Img = 17;
|
|
2799
|
+
const VirtualDomElements = {
|
|
2800
|
+
__proto__: null,
|
|
2801
|
+
Div,
|
|
2802
|
+
Img,
|
|
2803
|
+
Input,
|
|
2804
|
+
Span};
|
|
2805
|
+
const text = data => {
|
|
2806
|
+
return {
|
|
2807
|
+
type: Text,
|
|
2808
|
+
text: data,
|
|
2809
|
+
childCount: 0
|
|
2810
|
+
};
|
|
2811
|
+
};
|
|
2812
|
+
|
|
2778
2813
|
const ComboBox = 'combobox';
|
|
2779
2814
|
const ListBox = 'listbox';
|
|
2780
2815
|
const None = 'none';
|
|
@@ -2812,15 +2847,10 @@ const QuickPick = 'QuickPick';
|
|
|
2812
2847
|
const QuickPickItems = 'QuickPickItems';
|
|
2813
2848
|
const QuickPickItemActive = 'QuickPickItemActive';
|
|
2814
2849
|
|
|
2815
|
-
const Div = 4;
|
|
2816
|
-
const Input = 6;
|
|
2817
|
-
const Span = 8;
|
|
2818
|
-
const Img = 17;
|
|
2819
|
-
|
|
2820
2850
|
const getQuickPickInputVirtualDom = () => {
|
|
2821
2851
|
const ariaLabel = typeNameofCommandToRun();
|
|
2822
2852
|
return {
|
|
2823
|
-
type: Input,
|
|
2853
|
+
type: VirtualDomElements.Input,
|
|
2824
2854
|
className: InputBox,
|
|
2825
2855
|
spellcheck: false,
|
|
2826
2856
|
autocapitalize: 'off',
|
|
@@ -2841,7 +2871,7 @@ const getQuickPickInputVirtualDom = () => {
|
|
|
2841
2871
|
|
|
2842
2872
|
const getQuickPickHeaderVirtualDom = () => {
|
|
2843
2873
|
return [{
|
|
2844
|
-
type: Div,
|
|
2874
|
+
type: VirtualDomElements.Div,
|
|
2845
2875
|
className: QuickPickHeader,
|
|
2846
2876
|
childCount: 1
|
|
2847
2877
|
}, getQuickPickInputVirtualDom()];
|
|
@@ -2849,7 +2879,7 @@ const getQuickPickHeaderVirtualDom = () => {
|
|
|
2849
2879
|
|
|
2850
2880
|
const getFileIconVirtualDom = icon => {
|
|
2851
2881
|
return {
|
|
2852
|
-
type: Img,
|
|
2882
|
+
type: VirtualDomElements.Img,
|
|
2853
2883
|
className: FileIcon,
|
|
2854
2884
|
src: icon,
|
|
2855
2885
|
role: None,
|
|
@@ -2857,32 +2887,14 @@ const getFileIconVirtualDom = icon => {
|
|
|
2857
2887
|
};
|
|
2858
2888
|
};
|
|
2859
2889
|
|
|
2860
|
-
const mergeClassNames = (...classNames) => {
|
|
2861
|
-
return classNames.filter(Boolean).join(' ');
|
|
2862
|
-
};
|
|
2863
|
-
const px = value => {
|
|
2864
|
-
return `${value}px`;
|
|
2865
|
-
};
|
|
2866
|
-
const position = (x, y) => {
|
|
2867
|
-
return `${x}px ${y}px`;
|
|
2868
|
-
};
|
|
2869
|
-
const Text = 12;
|
|
2870
|
-
const text = data => {
|
|
2871
|
-
return {
|
|
2872
|
-
type: Text,
|
|
2873
|
-
text: data,
|
|
2874
|
-
childCount: 0
|
|
2875
|
-
};
|
|
2876
|
-
};
|
|
2877
|
-
|
|
2878
2890
|
const quickPickHighlight = {
|
|
2879
|
-
type: Span,
|
|
2891
|
+
type: VirtualDomElements.Span,
|
|
2880
2892
|
className: QuickPickHighlight,
|
|
2881
2893
|
childCount: 1
|
|
2882
2894
|
};
|
|
2883
2895
|
const getHighlights = (sections, label) => {
|
|
2884
2896
|
const labelDom = {
|
|
2885
|
-
type: Div,
|
|
2897
|
+
type: VirtualDomElements.Div,
|
|
2886
2898
|
className: QuickPickItemLabel,
|
|
2887
2899
|
childCount: 0
|
|
2888
2900
|
};
|
|
@@ -2917,7 +2929,7 @@ const getQuickPickItemVirtualDom = visibleItem => {
|
|
|
2917
2929
|
} = visibleItem;
|
|
2918
2930
|
const dom = [];
|
|
2919
2931
|
dom.push({
|
|
2920
|
-
type: Div,
|
|
2932
|
+
type: VirtualDomElements.Div,
|
|
2921
2933
|
className: QuickPickItem,
|
|
2922
2934
|
role: Option,
|
|
2923
2935
|
ariaPosInSet: posInSet,
|
|
@@ -2936,7 +2948,7 @@ const getQuickPickItemVirtualDom = visibleItem => {
|
|
|
2936
2948
|
} else if (icon) {
|
|
2937
2949
|
parent.childCount++;
|
|
2938
2950
|
dom.push({
|
|
2939
|
-
type: Div,
|
|
2951
|
+
type: VirtualDomElements.Div,
|
|
2940
2952
|
className: mergeClassNames(QuickPickMaskIcon, MaskIcon, `MaskIcon${icon}`),
|
|
2941
2953
|
childCount: 0
|
|
2942
2954
|
});
|
|
@@ -2946,7 +2958,7 @@ const getQuickPickItemVirtualDom = visibleItem => {
|
|
|
2946
2958
|
if (description) {
|
|
2947
2959
|
parent.childCount++;
|
|
2948
2960
|
dom.push({
|
|
2949
|
-
type: Div,
|
|
2961
|
+
type: VirtualDomElements.Div,
|
|
2950
2962
|
className: QuickPickItemDescription,
|
|
2951
2963
|
childCount: 1
|
|
2952
2964
|
}, text(description));
|
|
@@ -2957,11 +2969,11 @@ const getQuickPickItemVirtualDom = visibleItem => {
|
|
|
2957
2969
|
const getQuickPickNoResultsVirtualDom = () => {
|
|
2958
2970
|
const noResults$1 = noResults();
|
|
2959
2971
|
return [{
|
|
2960
|
-
type: Div,
|
|
2972
|
+
type: VirtualDomElements.Div,
|
|
2961
2973
|
className: mergeClassNames(QuickPickItem, QuickPickItemActive$1, QuickPickStatus),
|
|
2962
2974
|
childCount: 1
|
|
2963
2975
|
}, {
|
|
2964
|
-
type: Div,
|
|
2976
|
+
type: VirtualDomElements.Div,
|
|
2965
2977
|
className: Label,
|
|
2966
2978
|
childCount: 1
|
|
2967
2979
|
}, text(noResults$1)];
|
|
@@ -2983,11 +2995,11 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarTop) => {
|
|
|
2983
2995
|
const heightString = px(scrollBarHeight);
|
|
2984
2996
|
const translateString = position(0, scrollBarTop);
|
|
2985
2997
|
return [{
|
|
2986
|
-
type: Div,
|
|
2998
|
+
type: VirtualDomElements.Div,
|
|
2987
2999
|
className: mergeClassNames(ScrollBar, ScrollBarSmall),
|
|
2988
3000
|
childCount: 1
|
|
2989
3001
|
}, {
|
|
2990
|
-
type: Div,
|
|
3002
|
+
type: VirtualDomElements.Div,
|
|
2991
3003
|
className: ScrollBarThumb,
|
|
2992
3004
|
childCount: 0,
|
|
2993
3005
|
height: heightString,
|
|
@@ -2999,13 +3011,13 @@ const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop) =>
|
|
|
2999
3011
|
const quickOpen$1 = quickOpen();
|
|
3000
3012
|
const shouldShowScrollbar = scrollBarHeight > 0;
|
|
3001
3013
|
return [{
|
|
3002
|
-
type: Div,
|
|
3014
|
+
type: VirtualDomElements.Div,
|
|
3003
3015
|
className: mergeClassNames(Viewlet, QuickPick$1),
|
|
3004
3016
|
childCount: 2,
|
|
3005
3017
|
id: QuickPick,
|
|
3006
3018
|
ariaLabel: quickOpen$1
|
|
3007
3019
|
}, ...getQuickPickHeaderVirtualDom(), {
|
|
3008
|
-
type: Div,
|
|
3020
|
+
type: VirtualDomElements.Div,
|
|
3009
3021
|
className: mergeClassNames(List, ContainContent),
|
|
3010
3022
|
id: QuickPickItems,
|
|
3011
3023
|
role: ListBox,
|
|
@@ -3014,7 +3026,7 @@ const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop) =>
|
|
|
3014
3026
|
onPointerDown: HandlePointerDown,
|
|
3015
3027
|
childCount: shouldShowScrollbar ? 2 : 1
|
|
3016
3028
|
}, {
|
|
3017
|
-
type: Div,
|
|
3029
|
+
type: VirtualDomElements.Div,
|
|
3018
3030
|
className: mergeClassNames(ListItems, ContainContent),
|
|
3019
3031
|
childCount: visibleItems.length
|
|
3020
3032
|
}, ...getQuickPickItemsVirtualDom(visibleItems), ...getScrollBarVirtualDom(scrollBarHeight, scrollBarTop)];
|