@lvce-editor/problems-view 1.25.0 → 1.25.2

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.
@@ -1284,6 +1284,10 @@ const {
1284
1284
  invoke: invoke$1,
1285
1285
  set: set$3
1286
1286
  } = create$1(EditorWorker$1);
1287
+ const getUri$1 = async editorUid => {
1288
+ // @ts-ignore
1289
+ return invoke$1('Editor.getUri', editorUid);
1290
+ };
1287
1291
  const getProblems$2 = async () => {
1288
1292
  // @ts-ignore
1289
1293
  return invoke$1('Editor.getProblems');
@@ -1292,6 +1296,7 @@ const getProblems$2 = async () => {
1292
1296
  const EditorWorker = {
1293
1297
  __proto__: null,
1294
1298
  getProblems: getProblems$2,
1299
+ getUri: getUri$1,
1295
1300
  invoke: invoke$1,
1296
1301
  set: set$3
1297
1302
  };
@@ -1315,9 +1320,13 @@ const sendMessagePortToEditorWorker$1 = async (port, rpcId) => {
1315
1320
  const writeClipBoardText$1 = async text => {
1316
1321
  await invoke('ClipBoard.writeText', /* text */text);
1317
1322
  };
1323
+ const getActiveEditorId$1 = () => {
1324
+ return invoke('GetActiveEditor.getActiveEditorId');
1325
+ };
1318
1326
 
1319
1327
  const RendererWorker = {
1320
1328
  __proto__: null,
1329
+ getActiveEditorId: getActiveEditorId$1,
1321
1330
  invoke,
1322
1331
  invokeAndTransfer,
1323
1332
  sendMessagePortToEditorWorker: sendMessagePortToEditorWorker$1,
@@ -1327,6 +1336,7 @@ const RendererWorker = {
1327
1336
  };
1328
1337
 
1329
1338
  const {
1339
+ getActiveEditorId,
1330
1340
  sendMessagePortToEditorWorker,
1331
1341
  set: set$1,
1332
1342
  writeClipBoardText
@@ -1364,6 +1374,7 @@ const List = 2;
1364
1374
 
1365
1375
  const create = (id, uri, x, y, width, height, workspaceUri) => {
1366
1376
  const state = {
1377
+ activeUri: '',
1367
1378
  collapsedUris: [],
1368
1379
  filteredProblems: [],
1369
1380
  filterValue: '',
@@ -1395,7 +1406,7 @@ const isEqual$1 = (oldState, newState) => {
1395
1406
  };
1396
1407
 
1397
1408
  const isEqual = (oldState, newState) => {
1398
- return oldState.problems === newState.problems && oldState.filterValue === newState.filterValue && oldState.message === newState.message && oldState.viewMode === newState.viewMode;
1409
+ return oldState.activeUri === newState.activeUri && oldState.problems === newState.problems && oldState.filterValue === newState.filterValue && oldState.message === newState.message && oldState.viewMode === newState.viewMode;
1399
1410
  };
1400
1411
 
1401
1412
  const RenderItems = 1;
@@ -1584,22 +1595,29 @@ const showInfos = () => {
1584
1595
  return i18nString(ShowInfos);
1585
1596
  };
1586
1597
 
1587
- const getMenuEntriesFilter = state => [{
1588
- command: '-1',
1589
- flags: state.showErrors ? Checked : Unchecked,
1590
- id: 'show-errors',
1591
- label: showErrors()
1592
- }, {
1593
- command: '-1',
1594
- flags: state.showWarnings ? Checked : Unchecked,
1595
- id: 'show-warnings',
1596
- label: showWarnings()
1597
- }, {
1598
- command: '-1',
1599
- flags: state.showInfos ? Checked : Unchecked,
1600
- id: 'show-infos',
1601
- label: showInfos()
1602
- }];
1598
+ const getMenuEntriesFilter = state => {
1599
+ const {
1600
+ showErrors: showErrors$1,
1601
+ showInfos: showInfos$1,
1602
+ showWarnings: showWarnings$1
1603
+ } = state;
1604
+ return [{
1605
+ command: '-1',
1606
+ flags: showErrors$1 ? Checked : Unchecked,
1607
+ id: 'show-errors',
1608
+ label: showErrors()
1609
+ }, {
1610
+ command: '-1',
1611
+ flags: showWarnings$1 ? Checked : Unchecked,
1612
+ id: 'show-warnings',
1613
+ label: showWarnings()
1614
+ }, {
1615
+ command: '-1',
1616
+ flags: showInfos$1 ? Checked : Unchecked,
1617
+ id: 'show-infos',
1618
+ label: showInfos()
1619
+ }];
1620
+ };
1603
1621
 
1604
1622
  const getMenuEntries2 = (state, props) => {
1605
1623
  const {
@@ -1617,10 +1635,152 @@ const getMenuIds = () => {
1617
1635
  return [ProblemsFilter$1];
1618
1636
  };
1619
1637
 
1638
+ const {
1639
+ getProblems: getProblems$1,
1640
+ getUri} = EditorWorker;
1641
+
1620
1642
  const Item = 0;
1621
1643
  const Expanded = 1;
1622
1644
  const Collapsed = 2;
1623
1645
 
1646
+ const toProblem = (diagnostic, index) => {
1647
+ const {
1648
+ code,
1649
+ columnIndex,
1650
+ message,
1651
+ rowIndex,
1652
+ source,
1653
+ type,
1654
+ uri
1655
+ } = diagnostic;
1656
+ return {
1657
+ code: code || '',
1658
+ columnIndex: columnIndex || 0,
1659
+ count: 0,
1660
+ fileName: '',
1661
+ level: 2,
1662
+ listItemType: Item,
1663
+ message: message || '',
1664
+ posInSet: index,
1665
+ relativePath: '',
1666
+ rowIndex: rowIndex || 0,
1667
+ setSize: 1,
1668
+ source: source || '',
1669
+ type: type || 'error',
1670
+ uri
1671
+ };
1672
+ };
1673
+ const getRelativeParentUri = (uri, workspaceUri) => {
1674
+ const slashIndex = uri.lastIndexOf('/');
1675
+ return uri.slice(0, slashIndex).slice(workspaceUri.length);
1676
+ };
1677
+ const getFileName = uri => {
1678
+ const slashIndex = uri.lastIndexOf('/');
1679
+ return uri.slice(slashIndex + 1);
1680
+ };
1681
+ const toProblems = (diagnostics, workspaceUri = '') => {
1682
+ const problems = [];
1683
+ let problem = {
1684
+ code: '',
1685
+ columnIndex: 0,
1686
+ count: 0,
1687
+ fileName: '',
1688
+ level: 0,
1689
+ listItemType: 0,
1690
+ message: '',
1691
+ posInSet: 0,
1692
+ relativePath: '',
1693
+ rowIndex: 0,
1694
+ setSize: 0,
1695
+ source: '',
1696
+ type: '',
1697
+ uri: ''
1698
+ };
1699
+ let relativeIndex = 0;
1700
+ for (const diagnostic of diagnostics) {
1701
+ if (diagnostic.uri === problem.uri) {
1702
+ relativeIndex++;
1703
+ problem.count++;
1704
+ } else {
1705
+ relativeIndex = 1;
1706
+ problem = {
1707
+ code: '',
1708
+ columnIndex: 0,
1709
+ count: 1,
1710
+ fileName: '',
1711
+ level: 1,
1712
+ listItemType: Expanded,
1713
+ message: '',
1714
+ posInSet: relativeIndex,
1715
+ relativePath: '',
1716
+ rowIndex: 0,
1717
+ setSize: 123,
1718
+ source: '',
1719
+ type: '',
1720
+ uri: diagnostic.uri
1721
+ };
1722
+ problems.push(problem);
1723
+ }
1724
+ problems.push(toProblem(diagnostic, relativeIndex));
1725
+ }
1726
+ for (const problem of problems) {
1727
+ // TODO maybe rename property, this should be the relative path of the parent folder of the file
1728
+ // @ts-ignore
1729
+ problem.relativePath = getRelativeParentUri(problem.uri, workspaceUri);
1730
+ // @ts-ignore
1731
+ problem.fileName = getFileName(problem.uri);
1732
+ // problem.uri = problem.uri // TODO
1733
+ }
1734
+ return problems;
1735
+ };
1736
+
1737
+ const getProblems = async (workspaceUri, activeUri) => {
1738
+ if (!activeUri) {
1739
+ return {
1740
+ error: '',
1741
+ problems: []
1742
+ };
1743
+ }
1744
+ try {
1745
+ const diagnostics = await getProblems$1();
1746
+ const activeDiagnostics = diagnostics.filter(diagnostic => diagnostic.uri === activeUri);
1747
+ // @ts-ignore
1748
+ const problems = toProblems(activeDiagnostics, workspaceUri);
1749
+ return {
1750
+ error: '',
1751
+ problems
1752
+ };
1753
+ } catch (error) {
1754
+ return {
1755
+ error: `${error}`,
1756
+ problems: []
1757
+ };
1758
+ }
1759
+ };
1760
+
1761
+ const handleActiveEditorChange = async (state, activeUri) => {
1762
+ const {
1763
+ activeUri: oldActiveUri,
1764
+ workspaceUri
1765
+ } = state;
1766
+ if (activeUri === oldActiveUri) {
1767
+ return state;
1768
+ }
1769
+ const {
1770
+ error,
1771
+ problems
1772
+ } = await getProblems(workspaceUri, activeUri);
1773
+ return {
1774
+ ...state,
1775
+ activeUri,
1776
+ filteredProblems: problems,
1777
+ inputSource: Script,
1778
+ listItems: [],
1779
+ message: error || getMessage(problems.length),
1780
+ problems
1781
+ };
1782
+ };
1783
+
1624
1784
  const getArrowLeftNewFocusedIndex = (problems, collapsedUris, focusedIndex) => {
1625
1785
  for (let i = focusedIndex; i >= 0; i--) {
1626
1786
  const problem = problems[i];
@@ -1759,9 +1919,12 @@ const handleFilterInput = (state, value, inputSource = Script) => {
1759
1919
  };
1760
1920
 
1761
1921
  const handleIconThemeChange = state => {
1922
+ const {
1923
+ problems
1924
+ } = state;
1762
1925
  return {
1763
1926
  ...state,
1764
- problems: [...state.problems]
1927
+ problems: [...problems]
1765
1928
  };
1766
1929
  };
1767
1930
 
@@ -1769,117 +1932,12 @@ const initialize = async () => {
1769
1932
  // function is not needed anymore
1770
1933
  };
1771
1934
 
1772
- const {
1773
- getProblems: getProblems$1} = EditorWorker;
1774
-
1775
- const toProblem = (diagnostic, index) => {
1776
- const {
1777
- code,
1778
- columnIndex,
1779
- message,
1780
- rowIndex,
1781
- source,
1782
- type,
1783
- uri
1784
- } = diagnostic;
1785
- return {
1786
- code: code || '',
1787
- columnIndex: columnIndex || 0,
1788
- count: 0,
1789
- fileName: '',
1790
- level: 2,
1791
- listItemType: Item,
1792
- message: message || '',
1793
- posInSet: index,
1794
- relativePath: '',
1795
- rowIndex: rowIndex || 0,
1796
- setSize: 1,
1797
- source: source || '',
1798
- type: type || 'error',
1799
- uri
1800
- };
1801
- };
1802
- const getRelativeParentUri = (uri, workspaceUri) => {
1803
- const slashIndex = uri.lastIndexOf('/');
1804
- return uri.slice(0, slashIndex).slice(workspaceUri.length);
1805
- };
1806
- const getFileName = uri => {
1807
- const slashIndex = uri.lastIndexOf('/');
1808
- return uri.slice(slashIndex + 1);
1809
- };
1810
- const toProblems = (diagnostics, workspaceUri = '') => {
1811
- const problems = [];
1812
- let problem = {
1813
- code: '',
1814
- columnIndex: 0,
1815
- count: 0,
1816
- fileName: '',
1817
- level: 0,
1818
- listItemType: 0,
1819
- message: '',
1820
- posInSet: 0,
1821
- relativePath: '',
1822
- rowIndex: 0,
1823
- setSize: 0,
1824
- source: '',
1825
- type: '',
1826
- uri: ''
1827
- };
1828
- let relativeIndex = 0;
1829
- for (const diagnostic of diagnostics) {
1830
- if (diagnostic.uri === problem.uri) {
1831
- relativeIndex++;
1832
- problem.count++;
1833
- } else {
1834
- relativeIndex = 1;
1835
- problem = {
1836
- code: '',
1837
- columnIndex: 0,
1838
- count: 1,
1839
- fileName: '',
1840
- level: 1,
1841
- listItemType: Expanded,
1842
- message: '',
1843
- posInSet: relativeIndex,
1844
- relativePath: '',
1845
- rowIndex: 0,
1846
- setSize: 123,
1847
- source: '',
1848
- type: '',
1849
- uri: diagnostic.uri
1850
- };
1851
- problems.push(problem);
1852
- }
1853
- problems.push(toProblem(diagnostic, relativeIndex));
1854
- }
1855
- for (const problem of problems) {
1856
- // TODO maybe rename property, this should be the relative path of the parent folder of the file
1857
- // @ts-ignore
1858
- problem.relativePath = getRelativeParentUri(problem.uri, workspaceUri);
1859
- // @ts-ignore
1860
- problem.fileName = getFileName(problem.uri);
1861
- // problem.uri = problem.uri // TODO
1862
- }
1863
- return problems;
1864
- };
1865
-
1866
- // TODO send event listener to editor, asking to send problem updates to this worker
1867
-
1868
- const getProblems = async workspaceUri => {
1869
- try {
1870
- const diagnostics = await getProblems$1();
1871
- // @ts-ignore
1872
- const problems = toProblems(diagnostics, workspaceUri);
1873
- return {
1874
- error: '',
1875
- problems
1876
- };
1877
- } catch (error) {
1878
- return {
1879
- error: `${error}`,
1880
- problems: []
1881
- };
1935
+ const getActiveUri = async () => {
1936
+ const editorId = await getActiveEditorId();
1937
+ if (editorId === -1) {
1938
+ return '';
1882
1939
  }
1940
+ return getUri(editorId);
1883
1941
  };
1884
1942
 
1885
1943
  const getSavedViewMode = savedState => {
@@ -1904,14 +1962,21 @@ const getSavedCollapsedUris = savedState => {
1904
1962
  return [];
1905
1963
  };
1906
1964
  const loadContent = async (state, savedState) => {
1965
+ const {
1966
+ workspaceUri
1967
+ } = state;
1968
+ const activeUri = await getActiveUri();
1907
1969
  const {
1908
1970
  error,
1909
1971
  problems
1910
- } = await getProblems(state.workspaceUri);
1972
+ } = await getProblems(workspaceUri, activeUri);
1911
1973
  if (error) {
1912
1974
  return {
1913
1975
  ...state,
1914
- message: error
1976
+ activeUri,
1977
+ filteredProblems: [],
1978
+ message: error,
1979
+ problems: []
1915
1980
  };
1916
1981
  }
1917
1982
  const message = getMessage(problems.length);
@@ -1920,6 +1985,7 @@ const loadContent = async (state, savedState) => {
1920
1985
  const collapsedUris = getSavedCollapsedUris(savedState);
1921
1986
  return {
1922
1987
  ...state,
1988
+ activeUri,
1923
1989
  collapsedUris,
1924
1990
  filteredProblems: problems,
1925
1991
  filterValue,
@@ -2000,15 +2066,16 @@ const getActionButtonVirtualDom = action => {
2000
2066
  }, getIconVirtualDom(icon)];
2001
2067
  };
2002
2068
 
2069
+ const filterBadgeNode = {
2070
+ childCount: 1,
2071
+ className: FilterBadge,
2072
+ type: Div
2073
+ };
2003
2074
  const getFilterBadgeDom = badgeText => {
2004
2075
  if (!badgeText) {
2005
2076
  return [];
2006
2077
  }
2007
- return [{
2008
- childCount: 1,
2009
- className: FilterBadge,
2010
- type: Div
2011
- }, text(badgeText)];
2078
+ return [filterBadgeNode, text(badgeText)];
2012
2079
  };
2013
2080
 
2014
2081
  const getInputBoxVirtualDom = (name, onInput, placeholder) => {
@@ -2049,20 +2116,23 @@ const getProblemsFilterVirtualDom = action => {
2049
2116
  id: 'more filters'})];
2050
2117
  };
2051
2118
 
2119
+ const messageNode$2 = {
2120
+ childCount: 3,
2121
+ className: Message,
2122
+ type: Div
2123
+ };
2124
+ const spanNode = {
2125
+ childCount: 1,
2126
+ type: Span
2127
+ };
2128
+ const clearFilterNode = {
2129
+ childCount: 1,
2130
+ className: MessageAction,
2131
+ onClick: HandleClearFilterClick,
2132
+ type: A
2133
+ };
2052
2134
  const getNoResultsWithFilterVirtualDom = () => {
2053
- return [{
2054
- childCount: 3,
2055
- className: Message,
2056
- type: Div
2057
- }, {
2058
- childCount: 1,
2059
- type: Span
2060
- }, text(noResultsFoundWithProvidedFilterCriteria()), {
2061
- childCount: 1,
2062
- className: MessageAction,
2063
- onClick: HandleClearFilterClick,
2064
- type: A
2065
- }, text(clearFilter()), text('.')];
2135
+ return [messageNode$2, spanNode, text(noResultsFoundWithProvidedFilterCriteria()), clearFilterNode, text(clearFilter()), text('.')];
2066
2136
  };
2067
2137
 
2068
2138
  const getBadgeVirtualDom = (className, count) => {
@@ -2133,6 +2203,26 @@ const getTreeItemIndent = depth => {
2133
2203
  return `${depth * defaultIndent}rem`;
2134
2204
  };
2135
2205
 
2206
+ const labelNode = {
2207
+ childCount: 1,
2208
+ className: Label,
2209
+ type: Span
2210
+ };
2211
+ const labelDetailNode = {
2212
+ childCount: 1,
2213
+ className: LabelDetail,
2214
+ type: Div
2215
+ };
2216
+ const highlightNode = {
2217
+ childCount: 1,
2218
+ className: Highlight,
2219
+ type: Div
2220
+ };
2221
+ const problemAtNode = {
2222
+ childCount: 2,
2223
+ className: ProblemAt,
2224
+ type: Span
2225
+ };
2136
2226
  const getProblemVirtualDom = problem => {
2137
2227
  const {
2138
2228
  code,
@@ -2155,7 +2245,7 @@ const getProblemVirtualDom = problem => {
2155
2245
  } = problem;
2156
2246
  let className = Problem;
2157
2247
  if (isActive) {
2158
- className += ' ' + ProblemSelected;
2248
+ className = mergeClassNames(className, ProblemSelected);
2159
2249
  }
2160
2250
  if (listItemType === Expanded || listItemType === Collapsed) {
2161
2251
  return [{
@@ -2169,15 +2259,7 @@ const getProblemVirtualDom = problem => {
2169
2259
  paddingLeft: getTreeItemIndent(1),
2170
2260
  role: TreeItem,
2171
2261
  type: Div
2172
- }, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon), {
2173
- childCount: 1,
2174
- className: Label,
2175
- type: Span
2176
- }, text(fileName), {
2177
- childCount: 1,
2178
- className: LabelDetail,
2179
- type: Div
2180
- }, text(relativePath), ...getBadgeVirtualDom(ProblemBadge, problem.count)];
2262
+ }, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon), labelNode, text(fileName), labelDetailNode, text(relativePath), ...getBadgeVirtualDom(ProblemBadge, problem.count)];
2181
2263
  }
2182
2264
  const lineColumn = atLineColumn(rowIndex, columnIndex);
2183
2265
  const label = {
@@ -2204,19 +2286,11 @@ const getProblemVirtualDom = problem => {
2204
2286
  const middle = message.slice(messageMatchIndex, messageMatchIndex + filterValueLength);
2205
2287
  const after = message.slice(messageMatchIndex + filterValueLength);
2206
2288
  label.childCount += 2;
2207
- dom.push(text(before), {
2208
- childCount: 1,
2209
- className: Highlight,
2210
- type: Div
2211
- }, text(middle), text(after));
2289
+ dom.push(text(before), highlightNode, text(middle), text(after));
2212
2290
  } else {
2213
2291
  dom.push(text(message));
2214
2292
  }
2215
- dom.push({
2216
- childCount: 2,
2217
- className: ProblemAt,
2218
- type: Span
2219
- }, text(getProblemSourceDetail(source, code)), text(lineColumn));
2293
+ dom.push(problemAtNode, text(getProblemSourceDetail(source, code)), text(lineColumn));
2220
2294
  return dom;
2221
2295
  };
2222
2296
 
@@ -2232,14 +2306,20 @@ const getProblemsListVirtualDom = problems => {
2232
2306
  return dom;
2233
2307
  };
2234
2308
 
2309
+ const messageNode$1 = {
2310
+ childCount: 1,
2311
+ className: Message,
2312
+ type: Div
2313
+ };
2235
2314
  const getProblemsNoProblemsFoundVirtualDom = () => {
2236
- return [{
2237
- childCount: 1,
2238
- className: Message,
2239
- type: Div
2240
- }, text(noProblemsDetected())];
2315
+ return [messageNode$1, text(noProblemsDetected())];
2241
2316
  };
2242
2317
 
2318
+ const rowItemNode$1 = {
2319
+ childCount: 1,
2320
+ className: ProblemsTableRowItem,
2321
+ type: Div
2322
+ };
2243
2323
  const getClassName = isEven => {
2244
2324
  if (isEven) {
2245
2325
  return ProblemsTableRow;
@@ -2264,27 +2344,7 @@ const getProblemsTableRowVirtualDom = problem => {
2264
2344
  childCount: 5,
2265
2345
  className: getClassName(isEven),
2266
2346
  type: Div
2267
- }, {
2268
- childCount: 1,
2269
- className: ProblemsTableRowItem,
2270
- type: Div
2271
- }, getProblemsIconVirtualDom(type), {
2272
- childCount: 1,
2273
- className: ProblemsTableRowItem,
2274
- type: Div
2275
- }, text(getProblemSourceDetail(source, code)), {
2276
- childCount: 1,
2277
- className: ProblemsTableRowItem,
2278
- type: Div
2279
- }, text(message), {
2280
- childCount: 1,
2281
- className: ProblemsTableRowItem,
2282
- type: Div
2283
- }, text(uri), {
2284
- childCount: 1,
2285
- className: ProblemsTableRowItem,
2286
- type: Div
2287
- }, text(source)];
2347
+ }, rowItemNode$1, getProblemsIconVirtualDom(type), rowItemNode$1, text(getProblemSourceDetail(source, code)), rowItemNode$1, text(message), rowItemNode$1, text(uri), rowItemNode$1, text(source)];
2288
2348
  return dom;
2289
2349
  };
2290
2350
 
@@ -2297,59 +2357,53 @@ const getProblemsTableBodyVirtualDom = problems => {
2297
2357
  return dom;
2298
2358
  };
2299
2359
 
2360
+ const tableHeaderNode = {
2361
+ childCount: 1,
2362
+ className: ProblemsTableHeader,
2363
+ type: Div
2364
+ };
2365
+ const tableRowNode = {
2366
+ childCount: 5,
2367
+ className: ProblemsTableRow,
2368
+ type: Div
2369
+ };
2370
+ const emptyRowItemNode = {
2371
+ childCount: 0,
2372
+ className: ProblemsTableRowItem,
2373
+ type: Div
2374
+ };
2375
+ const rowItemNode = {
2376
+ childCount: 1,
2377
+ className: ProblemsTableRowItem,
2378
+ type: Div
2379
+ };
2300
2380
  const getProblemsTableHeaderVirtualDom = () => {
2301
2381
  const textCode = code();
2302
2382
  const textSource = source();
2303
2383
  const textMessage = message();
2304
2384
  const textFile = file();
2305
- const dom = [{
2306
- childCount: 1,
2307
- className: ProblemsTableHeader,
2308
- type: Div
2309
- }, {
2310
- childCount: 5,
2311
- className: ProblemsTableRow,
2312
- type: Div
2313
- }, {
2314
- childCount: 0,
2315
- className: ProblemsTableRowItem,
2316
- type: Div
2317
- }, {
2318
- childCount: 1,
2319
- className: ProblemsTableRowItem,
2320
- type: Div
2321
- }, text(textCode), {
2322
- childCount: 1,
2323
- className: ProblemsTableRowItem,
2324
- type: Div
2325
- }, text(textMessage), {
2326
- childCount: 1,
2327
- className: ProblemsTableRowItem,
2328
- type: Div
2329
- }, text(textFile), {
2330
- childCount: 1,
2331
- className: ProblemsTableRowItem,
2332
- type: Div
2333
- }, text(textSource)];
2385
+ const dom = [tableHeaderNode, tableRowNode, emptyRowItemNode, rowItemNode, text(textCode), rowItemNode, text(textMessage), rowItemNode, text(textFile), rowItemNode, text(textSource)];
2334
2386
  return dom;
2335
2387
  };
2336
2388
 
2389
+ const tableNode = {
2390
+ childCount: 2,
2391
+ className: ProblemsTable,
2392
+ type: Div
2393
+ };
2337
2394
  const getProblemsTableVirtualDom = problems => {
2338
- const dom = [{
2339
- childCount: 2,
2340
- className: ProblemsTable,
2341
- type: Div
2342
- }, ...getProblemsTableHeaderVirtualDom(), ...getProblemsTableBodyVirtualDom(problems)];
2395
+ const dom = [tableNode, ...getProblemsTableHeaderVirtualDom(), ...getProblemsTableBodyVirtualDom(problems)];
2343
2396
  return dom;
2344
2397
  };
2345
2398
 
2399
+ const messageNode = {
2400
+ childCount: 1,
2401
+ className: Message,
2402
+ type: Div
2403
+ };
2346
2404
  const getProblemsVirtualDom$1 = (viewMode, problems, filterValue, message) => {
2347
2405
  if (problems.length === 0 && message) {
2348
- return [{
2349
- childCount: 1,
2350
- className: Message,
2351
- type: Div
2352
- }, text(message)];
2406
+ return [messageNode, text(message)];
2353
2407
  }
2354
2408
  if (problems.length === 0 && filterValue) {
2355
2409
  return getNoResultsWithFilterVirtualDom();
@@ -2363,14 +2417,17 @@ const getProblemsVirtualDom$1 = (viewMode, problems, filterValue, message) => {
2363
2417
  return getProblemsListVirtualDom(problems);
2364
2418
  };
2365
2419
 
2366
- const getProblemsVirtualDom = (viewMode, problems, filterValue, isSmall, message) => {
2420
+ const Focusable = 0;
2421
+
2422
+ const getProblemsVirtualDom = (activeUri, viewMode, problems, filterValue, isSmall, message) => {
2367
2423
  const baseDom = {
2368
2424
  childCount: isSmall ? 2 : 1,
2369
2425
  className: mergeClassNames(Viewlet, Problems),
2426
+ 'data-activeUri': activeUri,
2370
2427
  onBlur: HandleBlur,
2371
2428
  onContextMenu: HandleContextMenu,
2372
2429
  onPointerDown: HandlePointerDown,
2373
- tabIndex: 0,
2430
+ tabIndex: Focusable,
2374
2431
  type: Div
2375
2432
  };
2376
2433
  const filterDom = isSmall ? getProblemsFilterVirtualDom({
@@ -2457,6 +2514,7 @@ const getVisibleProblems = (problems, collapsedUris, focusedIndex, filterValue)
2457
2514
 
2458
2515
  const renderItems = (oldState, newState) => {
2459
2516
  const {
2517
+ activeUri,
2460
2518
  collapsedUris,
2461
2519
  filterValue,
2462
2520
  focusedIndex,
@@ -2468,7 +2526,7 @@ const renderItems = (oldState, newState) => {
2468
2526
  } = newState;
2469
2527
  const visible = getVisibleProblems(problems, collapsedUris, focusedIndex, filterValue);
2470
2528
  const isSmall = width <= smallWidthBreakPoint;
2471
- const dom = getProblemsVirtualDom(viewMode, visible, filterValue, isSmall, message);
2529
+ const dom = getProblemsVirtualDom(activeUri, viewMode, visible, filterValue, isSmall, message);
2472
2530
  return ['Viewlet.setDom2', dom];
2473
2531
  };
2474
2532
 
@@ -2646,6 +2704,7 @@ const commandMap = {
2646
2704
  'Problems.getKeyBindings': getKeyBindings,
2647
2705
  'Problems.getMenuEntries2': wrapGetter(getMenuEntries2),
2648
2706
  'Problems.getMenuIds': getMenuIds,
2707
+ 'Problems.handleActiveEditorChange': wrapCommand(handleActiveEditorChange),
2649
2708
  'Problems.handleArrowLeft': wrapCommand(handleArrowLeft),
2650
2709
  'Problems.handleArrowRight': wrapCommand(handleArrowRight),
2651
2710
  'Problems.handleBlur': wrapCommand(handleBlur),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/problems-view",
3
- "version": "1.25.0",
3
+ "version": "1.25.2",
4
4
  "description": "Problems View Worker",
5
5
  "repository": {
6
6
  "type": "git",