@lvce-editor/output-view 2.11.0 → 2.12.1

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.
@@ -1356,7 +1356,6 @@ const parseStructuredLogLine = line => {
1356
1356
  if (!parsed.source) {
1357
1357
  return parts;
1358
1358
  }
1359
- const href = parsed.line > 0 ? `${parsed.source}:${parsed.line}` : parsed.source;
1360
1359
  return [...parts, {
1361
1360
  type: Text,
1362
1361
  value: ' '
@@ -1364,7 +1363,7 @@ const parseStructuredLogLine = line => {
1364
1363
  className: OutputSourceLink,
1365
1364
  label: getSourceLabel(parsed.source, parsed.line),
1366
1365
  type: Link,
1367
- value: href
1366
+ value: parsed.source
1368
1367
  }];
1369
1368
  };
1370
1369
 
@@ -1789,6 +1788,14 @@ const handleSelect = async (state, id) => {
1789
1788
  return selectChannel(state, id);
1790
1789
  };
1791
1790
 
1791
+ const handleSourceLinkClick = async (state, uri) => {
1792
+ if (!uri) {
1793
+ return state;
1794
+ }
1795
+ await invoke$1('Main.openUri', uri);
1796
+ return state;
1797
+ };
1798
+
1792
1799
  const sendMessagePortToExtensionHostWorker2 = async port => {
1793
1800
  await sendMessagePortToExtensionHostWorker(port);
1794
1801
  };
@@ -2078,6 +2085,15 @@ const renderFilterValue = (oldState, newState) => {
2078
2085
  return ['Viewlet.setValueByName', Filter$1, newState.filterValue];
2079
2086
  };
2080
2087
 
2088
+ const HandleBlur = 'handleBlur';
2089
+ const HandleClearFilterClick = 'handleClearFilterClick';
2090
+ const HandleContextMenu = 'handleContextMenu';
2091
+ const HandleFilterInput = 'handleFilterInput';
2092
+ const HandlePointerDown = 'handlePointerDown';
2093
+ const HandleSelect = 'handleSelect';
2094
+ const HandleButtonClick = 'handleButtonClick';
2095
+ const HandleSourceLinkClick = 'handleSourceLinkClick';
2096
+
2081
2097
  const noNodes = [];
2082
2098
  const repeatCountNode = {
2083
2099
  childCount: 1,
@@ -2092,6 +2108,7 @@ const getLinePartDom = part => {
2092
2108
  switch (part.type) {
2093
2109
  case Link:
2094
2110
  {
2111
+ const isSourceLink = part.className === OutputSourceLink;
2095
2112
  const linkNode = {
2096
2113
  childCount: 1,
2097
2114
  href: part.value,
@@ -2100,6 +2117,9 @@ const getLinePartDom = part => {
2100
2117
  type: A,
2101
2118
  ...(part.className && {
2102
2119
  className: part.className
2120
+ }),
2121
+ ...(isSourceLink && {
2122
+ onClick: HandleSourceLinkClick
2103
2123
  })
2104
2124
  };
2105
2125
  return {
@@ -2185,12 +2205,13 @@ const getErrorDom = (errorCode, error) => {
2185
2205
  return [errorNode, text(error)];
2186
2206
  };
2187
2207
 
2208
+ const outputNode = {
2209
+ childCount: 1,
2210
+ className: mergeClassNames(Viewlet, Output$1),
2211
+ type: Div
2212
+ };
2188
2213
  const getOutputVirtualDom = (lines, errorCode, error) => {
2189
- return [{
2190
- childCount: 1,
2191
- className: mergeClassNames(Viewlet, Output$1),
2192
- type: Div
2193
- }, ...getContentDom(lines, error), ...getErrorDom(errorCode, error)];
2214
+ return [outputNode, ...getContentDom(lines, error), ...getErrorDom(errorCode, error)];
2194
2215
  };
2195
2216
 
2196
2217
  const renderItems = (oldState, newState) => {
@@ -2236,14 +2257,6 @@ const render2 = (uid, diffResult) => {
2236
2257
  return commands;
2237
2258
  };
2238
2259
 
2239
- const HandleBlur = 'handleBlur';
2240
- const HandleClearFilterClick = 'handleClearFilterClick';
2241
- const HandleContextMenu = 'handleContextMenu';
2242
- const HandleFilterInput = 'handleFilterInput';
2243
- const HandlePointerDown = 'handlePointerDown';
2244
- const HandleSelect = 'handleSelect';
2245
- const HandleButtonClick = 'handleButtonClick';
2246
-
2247
2260
  const getActionButtonVirtualDom = button => {
2248
2261
  const {
2249
2262
  icon,
@@ -2352,6 +2365,10 @@ const renderEventListeners = () => {
2352
2365
  }, {
2353
2366
  name: HandleClearFilterClick,
2354
2367
  params: ['clearFilter']
2368
+ }, {
2369
+ name: HandleSourceLinkClick,
2370
+ params: ['handleSourceLinkClick', 'event.target.href'],
2371
+ preventDefault: true
2355
2372
  }, {
2356
2373
  name: HandlePointerDown,
2357
2374
  params: ['handleClickAt', 'event.clientX', 'event.clientY']
@@ -2439,6 +2456,7 @@ const commandMap = {
2439
2456
  'Output.handleError': wrapCommand(handleError),
2440
2457
  'Output.handleFilterInput': wrapCommand(handleFilterInput),
2441
2458
  'Output.handleSelect': wrapCommand(handleSelect),
2459
+ 'Output.handleSourceLinkClick': wrapCommand(handleSourceLinkClick),
2442
2460
  'Output.initialize': initialize,
2443
2461
  'Output.loadContent2': wrapCommand(loadContent),
2444
2462
  'Output.openFindWidget': wrapCommand(openFindWidget),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/output-view",
3
- "version": "2.11.0",
3
+ "version": "2.12.1",
4
4
  "description": "Output View Worker",
5
5
  "repository": {
6
6
  "type": "git",