react-terminal-viewer-cicd 3.0.0-beta.2 → 3.0.0-beta.3
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function LogWorker() {
|
|
2
2
|
var workerPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/worker';
|
|
3
3
|
var worker = null;
|
|
4
|
-
var version = "3.0.0-beta.
|
|
4
|
+
var version = "3.0.0-beta.3" || '0.0.0';
|
|
5
5
|
var path = workerPath.includes('http') ? "".concat(workerPath, "/log.worker.js") : "".concat(window.location.origin).concat(workerPath, "/log.worker.js");
|
|
6
6
|
var blob = new Blob(["importScripts(\"".concat(path, "?v=").concat(version, "\")")], {
|
|
7
7
|
type: 'application/javascript'
|
|
@@ -89,7 +89,7 @@ var ReactVirtuoso = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
89
89
|
}, [logs.length]);
|
|
90
90
|
var itemContent = useCallback(function (index) {
|
|
91
91
|
var _matchOption$decorati, _matchOption$decorati2, _extraOptionsRef$curr2;
|
|
92
|
-
var rowClassName = index === scrollToRow ? 'terminal-viewer-
|
|
92
|
+
var rowClassName = index === scrollToRow ? 'terminal-viewer-virtuoso-list-row terminal-viewer-virtuoso-list-row--active' : 'terminal-viewer-virtuoso-list-row';
|
|
93
93
|
var log = searcherResult.map[index] || logs[index];
|
|
94
94
|
var options = highlightOptionsRef.current || [];
|
|
95
95
|
var matchOption = options.find(function (option) {
|
|
@@ -254,7 +254,7 @@ var ReactVirtuoso = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
254
254
|
height: '100%',
|
|
255
255
|
width: '100%'
|
|
256
256
|
},
|
|
257
|
-
className: "terminal-viewer-
|
|
257
|
+
className: "terminal-viewer-virtuoso-list",
|
|
258
258
|
totalCount: logs.length,
|
|
259
259
|
itemContent: itemContent,
|
|
260
260
|
followOutput: autoScroll && !isScrollTopRef.current && searcherResult.count <= 0 && typeof scrollToRow === 'undefined' ? 'smooth' : false,
|
|
@@ -263,7 +263,9 @@ var ReactVirtuoso = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
263
263
|
increaseViewportBy: 400 // 扩展约 20 行的高度
|
|
264
264
|
// 其他性能优化
|
|
265
265
|
,
|
|
266
|
-
useWindowScroll: false
|
|
266
|
+
useWindowScroll: false,
|
|
267
|
+
isScrolling: extraOptions === null || extraOptions === void 0 ? void 0 : extraOptions.isScrolling,
|
|
268
|
+
atBottomStateChange: extraOptions === null || extraOptions === void 0 ? void 0 : extraOptions.atBottomStateChange
|
|
267
269
|
}), (logs === null || logs === void 0 ? void 0 : logs.length) === 0 && (empty || /*#__PURE__*/React.createElement("div", {
|
|
268
270
|
className: "terminal-viewer-body-empty"
|
|
269
271
|
}, "\u6682\u65E0\u6570\u636E")));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
.terminal-viewer-
|
|
1
|
+
.terminal-viewer-virtuoso-list {
|
|
2
2
|
color: #b5bbc6;
|
|
3
3
|
font-size: 13px;
|
|
4
4
|
font-family: Roboto Mono, Andale Mono, Consolas, Courier New, monospace;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.terminal-viewer-
|
|
7
|
+
.terminal-viewer-virtuoso-list-row {
|
|
8
8
|
display: inline-flex;
|
|
9
9
|
align-items: stretch;
|
|
10
10
|
overflow: visible;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.terminal-viewer-
|
|
13
|
+
.terminal-viewer-virtuoso-list-row--active {
|
|
14
14
|
color: #dddddd;
|
|
15
15
|
background: #3c4655;
|
|
16
16
|
.terminal-viewer-line-number,
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -2,11 +2,21 @@ import { CanvasAddon } from '@xterm/addon-canvas';
|
|
|
2
2
|
import { FitAddon } from '@xterm/addon-fit';
|
|
3
3
|
import { WebLinksAddon } from '@xterm/addon-web-links';
|
|
4
4
|
import { Terminal } from '@xterm/xterm';
|
|
5
|
+
import type { VirtuosoProps } from 'react-virtuoso';
|
|
5
6
|
import { HighlightAddon } from './Addon/HighlightAddon';
|
|
6
7
|
import { SearchAddon } from './Addon/SearchAddon';
|
|
7
8
|
import type { SearcherRef } from './Addon/WorkerLog/types';
|
|
8
9
|
export interface ExtraOptions {
|
|
9
10
|
showLineNumber?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Called when the list starts/stops scrolling.
|
|
13
|
+
*/
|
|
14
|
+
isScrolling?: VirtuosoProps<unknown, unknown>['isScrolling'];
|
|
15
|
+
/**
|
|
16
|
+
* Called with true / false when the list has reached the bottom / gets scrolled up.
|
|
17
|
+
* Can be used to load newer items, like `tail -f`.
|
|
18
|
+
*/
|
|
19
|
+
atBottomStateChange?: VirtuosoProps<unknown, unknown>['atBottomStateChange'];
|
|
10
20
|
}
|
|
11
21
|
export interface VirtualDomTerminal {
|
|
12
22
|
scrollToTop: () => void;
|
|
@@ -2,11 +2,21 @@ import { CanvasAddon } from '@xterm/addon-canvas';
|
|
|
2
2
|
import { FitAddon } from '@xterm/addon-fit';
|
|
3
3
|
import { WebLinksAddon } from '@xterm/addon-web-links';
|
|
4
4
|
import { Terminal } from '@xterm/xterm';
|
|
5
|
+
import type { VirtuosoProps } from 'react-virtuoso';
|
|
5
6
|
import { HighlightAddon } from './Addon/HighlightAddon';
|
|
6
7
|
import { SearchAddon } from './Addon/SearchAddon';
|
|
7
8
|
import type { SearcherRef } from './Addon/WorkerLog/types';
|
|
8
9
|
export interface ExtraOptions {
|
|
9
10
|
showLineNumber?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Called when the list starts/stops scrolling.
|
|
13
|
+
*/
|
|
14
|
+
isScrolling?: VirtuosoProps<unknown, unknown>['isScrolling'];
|
|
15
|
+
/**
|
|
16
|
+
* Called with true / false when the list has reached the bottom / gets scrolled up.
|
|
17
|
+
* Can be used to load newer items, like `tail -f`.
|
|
18
|
+
*/
|
|
19
|
+
atBottomStateChange?: VirtuosoProps<unknown, unknown>['atBottomStateChange'];
|
|
10
20
|
}
|
|
11
21
|
export interface VirtualDomTerminal {
|
|
12
22
|
scrollToTop: () => void;
|