@lvce-editor/hover-worker 2.4.0 → 2.6.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/hoverWorkerMain.js +17 -10
- package/package.json +1 -1
package/dist/hoverWorkerMain.js
CHANGED
|
@@ -64,7 +64,7 @@ const Object$1 = 1;
|
|
|
64
64
|
const Number$1 = 2;
|
|
65
65
|
const Array$1 = 3;
|
|
66
66
|
const String = 4;
|
|
67
|
-
const Boolean = 5;
|
|
67
|
+
const Boolean$1 = 5;
|
|
68
68
|
const Function = 6;
|
|
69
69
|
const Null = 7;
|
|
70
70
|
const Unknown = 8;
|
|
@@ -85,7 +85,7 @@ const getType = value => {
|
|
|
85
85
|
}
|
|
86
86
|
return Object$1;
|
|
87
87
|
case 'boolean':
|
|
88
|
-
return Boolean;
|
|
88
|
+
return Boolean$1;
|
|
89
89
|
default:
|
|
90
90
|
return Unknown;
|
|
91
91
|
}
|
|
@@ -1785,16 +1785,22 @@ const renderFocusContext = (oldState, newState) => {
|
|
|
1785
1785
|
return [SetFocusContext, FocusEditorRename];
|
|
1786
1786
|
};
|
|
1787
1787
|
|
|
1788
|
+
const EditorHover = 'EditorHover';
|
|
1788
1789
|
const HoverDisplayString = 'HoverDisplayString';
|
|
1789
1790
|
const HoverDocumentation = 'HoverDocumentation';
|
|
1790
1791
|
const HoverEditorRow = 'HoverEditorRow';
|
|
1791
1792
|
const HoverProblem = 'HoverProblem';
|
|
1792
1793
|
const HoverProblemDetail = 'HoverProblemDetail';
|
|
1793
1794
|
const HoverProblemMessage = 'HoverProblemMessage';
|
|
1795
|
+
const Viewlet = 'Viewlet';
|
|
1794
1796
|
|
|
1795
1797
|
const Div = 4;
|
|
1796
1798
|
const Span = 8;
|
|
1797
1799
|
|
|
1800
|
+
const mergeClassNames = (...classNames) => {
|
|
1801
|
+
return classNames.filter(Boolean).join(' ');
|
|
1802
|
+
};
|
|
1803
|
+
|
|
1798
1804
|
const text = data => {
|
|
1799
1805
|
return {
|
|
1800
1806
|
childCount: 0,
|
|
@@ -1837,6 +1843,11 @@ const hoverProblemDetail = {
|
|
|
1837
1843
|
className: HoverProblemDetail,
|
|
1838
1844
|
type: Span
|
|
1839
1845
|
};
|
|
1846
|
+
const hoverDocumentation = {
|
|
1847
|
+
childCount: 1,
|
|
1848
|
+
className: HoverDocumentation,
|
|
1849
|
+
type: Div
|
|
1850
|
+
};
|
|
1840
1851
|
const getChildCount = (lineInfos, documentation, diagnostics) => {
|
|
1841
1852
|
const diagnosticsCount = diagnostics && diagnostics.length > 0 ? 1 : 0;
|
|
1842
1853
|
return lineInfos.length + documentation ? 1 : 0 + diagnosticsCount;
|
|
@@ -1845,13 +1856,13 @@ const getHoverVirtualDom = (lineInfos, documentation, diagnostics) => {
|
|
|
1845
1856
|
const dom = [];
|
|
1846
1857
|
dom.push({
|
|
1847
1858
|
childCount: getChildCount(lineInfos, documentation, diagnostics) + 1,
|
|
1848
|
-
className:
|
|
1859
|
+
className: mergeClassNames(Viewlet, EditorHover),
|
|
1849
1860
|
type: Div
|
|
1850
1861
|
});
|
|
1851
1862
|
if (diagnostics && diagnostics.length > 0) {
|
|
1852
1863
|
dom.push({
|
|
1853
1864
|
childCount: diagnostics.length * 2,
|
|
1854
|
-
className:
|
|
1865
|
+
className: mergeClassNames(HoverDisplayString, HoverProblem),
|
|
1855
1866
|
type: Div
|
|
1856
1867
|
});
|
|
1857
1868
|
for (const diagnostic of diagnostics) {
|
|
@@ -1867,15 +1878,11 @@ const getHoverVirtualDom = (lineInfos, documentation, diagnostics) => {
|
|
|
1867
1878
|
}, ...lineInfosDom);
|
|
1868
1879
|
}
|
|
1869
1880
|
if (documentation) {
|
|
1870
|
-
dom.push(
|
|
1871
|
-
childCount: 1,
|
|
1872
|
-
className: HoverDocumentation,
|
|
1873
|
-
type: Div
|
|
1874
|
-
}, text(documentation));
|
|
1881
|
+
dom.push(hoverDocumentation, text(documentation));
|
|
1875
1882
|
}
|
|
1876
1883
|
dom.push({
|
|
1877
1884
|
childCount: 0,
|
|
1878
|
-
className: 'Sash SashVertical SashResize',
|
|
1885
|
+
className: mergeClassNames('Sash', 'SashVertical', 'SashResize'),
|
|
1879
1886
|
onPointerDown: HandleSashPointerDown,
|
|
1880
1887
|
type: Div
|
|
1881
1888
|
});
|