@lvce-editor/problems-view 1.25.1 → 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.
@@ -2066,15 +2066,16 @@ const getActionButtonVirtualDom = action => {
2066
2066
  }, getIconVirtualDom(icon)];
2067
2067
  };
2068
2068
 
2069
+ const filterBadgeNode = {
2070
+ childCount: 1,
2071
+ className: FilterBadge,
2072
+ type: Div
2073
+ };
2069
2074
  const getFilterBadgeDom = badgeText => {
2070
2075
  if (!badgeText) {
2071
2076
  return [];
2072
2077
  }
2073
- return [{
2074
- childCount: 1,
2075
- className: FilterBadge,
2076
- type: Div
2077
- }, text(badgeText)];
2078
+ return [filterBadgeNode, text(badgeText)];
2078
2079
  };
2079
2080
 
2080
2081
  const getInputBoxVirtualDom = (name, onInput, placeholder) => {
@@ -2115,20 +2116,23 @@ const getProblemsFilterVirtualDom = action => {
2115
2116
  id: 'more filters'})];
2116
2117
  };
2117
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
+ };
2118
2134
  const getNoResultsWithFilterVirtualDom = () => {
2119
- return [{
2120
- childCount: 3,
2121
- className: Message,
2122
- type: Div
2123
- }, {
2124
- childCount: 1,
2125
- type: Span
2126
- }, text(noResultsFoundWithProvidedFilterCriteria()), {
2127
- childCount: 1,
2128
- className: MessageAction,
2129
- onClick: HandleClearFilterClick,
2130
- type: A
2131
- }, text(clearFilter()), text('.')];
2135
+ return [messageNode$2, spanNode, text(noResultsFoundWithProvidedFilterCriteria()), clearFilterNode, text(clearFilter()), text('.')];
2132
2136
  };
2133
2137
 
2134
2138
  const getBadgeVirtualDom = (className, count) => {
@@ -2199,6 +2203,26 @@ const getTreeItemIndent = depth => {
2199
2203
  return `${depth * defaultIndent}rem`;
2200
2204
  };
2201
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
+ };
2202
2226
  const getProblemVirtualDom = problem => {
2203
2227
  const {
2204
2228
  code,
@@ -2221,7 +2245,7 @@ const getProblemVirtualDom = problem => {
2221
2245
  } = problem;
2222
2246
  let className = Problem;
2223
2247
  if (isActive) {
2224
- className += ' ' + ProblemSelected;
2248
+ className = mergeClassNames(className, ProblemSelected);
2225
2249
  }
2226
2250
  if (listItemType === Expanded || listItemType === Collapsed) {
2227
2251
  return [{
@@ -2235,15 +2259,7 @@ const getProblemVirtualDom = problem => {
2235
2259
  paddingLeft: getTreeItemIndent(1),
2236
2260
  role: TreeItem,
2237
2261
  type: Div
2238
- }, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon), {
2239
- childCount: 1,
2240
- className: Label,
2241
- type: Span
2242
- }, text(fileName), {
2243
- childCount: 1,
2244
- className: LabelDetail,
2245
- type: Div
2246
- }, text(relativePath), ...getBadgeVirtualDom(ProblemBadge, problem.count)];
2262
+ }, listItemType === Collapsed ? getChevronRightVirtualDom() : getChevronDownVirtualDom(), getFileIconVirtualDom(icon), labelNode, text(fileName), labelDetailNode, text(relativePath), ...getBadgeVirtualDom(ProblemBadge, problem.count)];
2247
2263
  }
2248
2264
  const lineColumn = atLineColumn(rowIndex, columnIndex);
2249
2265
  const label = {
@@ -2270,19 +2286,11 @@ const getProblemVirtualDom = problem => {
2270
2286
  const middle = message.slice(messageMatchIndex, messageMatchIndex + filterValueLength);
2271
2287
  const after = message.slice(messageMatchIndex + filterValueLength);
2272
2288
  label.childCount += 2;
2273
- dom.push(text(before), {
2274
- childCount: 1,
2275
- className: Highlight,
2276
- type: Div
2277
- }, text(middle), text(after));
2289
+ dom.push(text(before), highlightNode, text(middle), text(after));
2278
2290
  } else {
2279
2291
  dom.push(text(message));
2280
2292
  }
2281
- dom.push({
2282
- childCount: 2,
2283
- className: ProblemAt,
2284
- type: Span
2285
- }, text(getProblemSourceDetail(source, code)), text(lineColumn));
2293
+ dom.push(problemAtNode, text(getProblemSourceDetail(source, code)), text(lineColumn));
2286
2294
  return dom;
2287
2295
  };
2288
2296
 
@@ -2298,14 +2306,20 @@ const getProblemsListVirtualDom = problems => {
2298
2306
  return dom;
2299
2307
  };
2300
2308
 
2309
+ const messageNode$1 = {
2310
+ childCount: 1,
2311
+ className: Message,
2312
+ type: Div
2313
+ };
2301
2314
  const getProblemsNoProblemsFoundVirtualDom = () => {
2302
- return [{
2303
- childCount: 1,
2304
- className: Message,
2305
- type: Div
2306
- }, text(noProblemsDetected())];
2315
+ return [messageNode$1, text(noProblemsDetected())];
2307
2316
  };
2308
2317
 
2318
+ const rowItemNode$1 = {
2319
+ childCount: 1,
2320
+ className: ProblemsTableRowItem,
2321
+ type: Div
2322
+ };
2309
2323
  const getClassName = isEven => {
2310
2324
  if (isEven) {
2311
2325
  return ProblemsTableRow;
@@ -2330,27 +2344,7 @@ const getProblemsTableRowVirtualDom = problem => {
2330
2344
  childCount: 5,
2331
2345
  className: getClassName(isEven),
2332
2346
  type: Div
2333
- }, {
2334
- childCount: 1,
2335
- className: ProblemsTableRowItem,
2336
- type: Div
2337
- }, getProblemsIconVirtualDom(type), {
2338
- childCount: 1,
2339
- className: ProblemsTableRowItem,
2340
- type: Div
2341
- }, text(getProblemSourceDetail(source, code)), {
2342
- childCount: 1,
2343
- className: ProblemsTableRowItem,
2344
- type: Div
2345
- }, text(message), {
2346
- childCount: 1,
2347
- className: ProblemsTableRowItem,
2348
- type: Div
2349
- }, text(uri), {
2350
- childCount: 1,
2351
- className: ProblemsTableRowItem,
2352
- type: Div
2353
- }, 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)];
2354
2348
  return dom;
2355
2349
  };
2356
2350
 
@@ -2363,59 +2357,53 @@ const getProblemsTableBodyVirtualDom = problems => {
2363
2357
  return dom;
2364
2358
  };
2365
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
+ };
2366
2380
  const getProblemsTableHeaderVirtualDom = () => {
2367
2381
  const textCode = code();
2368
2382
  const textSource = source();
2369
2383
  const textMessage = message();
2370
2384
  const textFile = file();
2371
- const dom = [{
2372
- childCount: 1,
2373
- className: ProblemsTableHeader,
2374
- type: Div
2375
- }, {
2376
- childCount: 5,
2377
- className: ProblemsTableRow,
2378
- type: Div
2379
- }, {
2380
- childCount: 0,
2381
- className: ProblemsTableRowItem,
2382
- type: Div
2383
- }, {
2384
- childCount: 1,
2385
- className: ProblemsTableRowItem,
2386
- type: Div
2387
- }, text(textCode), {
2388
- childCount: 1,
2389
- className: ProblemsTableRowItem,
2390
- type: Div
2391
- }, text(textMessage), {
2392
- childCount: 1,
2393
- className: ProblemsTableRowItem,
2394
- type: Div
2395
- }, text(textFile), {
2396
- childCount: 1,
2397
- className: ProblemsTableRowItem,
2398
- type: Div
2399
- }, text(textSource)];
2385
+ const dom = [tableHeaderNode, tableRowNode, emptyRowItemNode, rowItemNode, text(textCode), rowItemNode, text(textMessage), rowItemNode, text(textFile), rowItemNode, text(textSource)];
2400
2386
  return dom;
2401
2387
  };
2402
2388
 
2389
+ const tableNode = {
2390
+ childCount: 2,
2391
+ className: ProblemsTable,
2392
+ type: Div
2393
+ };
2403
2394
  const getProblemsTableVirtualDom = problems => {
2404
- const dom = [{
2405
- childCount: 2,
2406
- className: ProblemsTable,
2407
- type: Div
2408
- }, ...getProblemsTableHeaderVirtualDom(), ...getProblemsTableBodyVirtualDom(problems)];
2395
+ const dom = [tableNode, ...getProblemsTableHeaderVirtualDom(), ...getProblemsTableBodyVirtualDom(problems)];
2409
2396
  return dom;
2410
2397
  };
2411
2398
 
2399
+ const messageNode = {
2400
+ childCount: 1,
2401
+ className: Message,
2402
+ type: Div
2403
+ };
2412
2404
  const getProblemsVirtualDom$1 = (viewMode, problems, filterValue, message) => {
2413
2405
  if (problems.length === 0 && message) {
2414
- return [{
2415
- childCount: 1,
2416
- className: Message,
2417
- type: Div
2418
- }, text(message)];
2406
+ return [messageNode, text(message)];
2419
2407
  }
2420
2408
  if (problems.length === 0 && filterValue) {
2421
2409
  return getNoResultsWithFilterVirtualDom();
@@ -2435,7 +2423,7 @@ const getProblemsVirtualDom = (activeUri, viewMode, problems, filterValue, isSma
2435
2423
  const baseDom = {
2436
2424
  childCount: isSmall ? 2 : 1,
2437
2425
  className: mergeClassNames(Viewlet, Problems),
2438
- dataActiveUri: activeUri,
2426
+ 'data-activeUri': activeUri,
2439
2427
  onBlur: HandleBlur,
2440
2428
  onContextMenu: HandleContextMenu,
2441
2429
  onPointerDown: HandlePointerDown,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/problems-view",
3
- "version": "1.25.1",
3
+ "version": "1.25.2",
4
4
  "description": "Problems View Worker",
5
5
  "repository": {
6
6
  "type": "git",