@midscene/visualizer 1.8.4-beta-20260521065716.0 → 1.8.4
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.
|
@@ -29,7 +29,7 @@ function _async_to_generator(fn) {
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUserOperating = false, mjpegUrl, mode = 'default' }) {
|
|
32
|
+
function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUserOperating = false, mjpegUrl, mode = 'default', contentRef }) {
|
|
33
33
|
const [screenshot, setScreenshot] = useState(null);
|
|
34
34
|
const [loading, setLoading] = useState(false);
|
|
35
35
|
const [error, setError] = useState(null);
|
|
@@ -218,6 +218,7 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
218
218
|
};
|
|
219
219
|
const screenshotContent = /*#__PURE__*/ jsx("div", {
|
|
220
220
|
className: "screenshot-content",
|
|
221
|
+
ref: contentRef,
|
|
221
222
|
children: isMjpeg ? /*#__PURE__*/ jsx("img", {
|
|
222
223
|
ref: mjpegImageRef,
|
|
223
224
|
src: mjpegRetryToken ? `${mjpegUrl}${(null == mjpegUrl ? void 0 : mjpegUrl.includes('?')) ? '&' : '?'}_mjpegRetry=${encodeURIComponent(mjpegRetryToken)}` : mjpegUrl,
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
3
12
|
(()=>{
|
|
4
13
|
__webpack_require__.d = (exports1, definition)=>{
|
|
5
14
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -30,6 +39,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
39
|
const icons_namespaceObject = require("@ant-design/icons");
|
|
31
40
|
const external_antd_namespaceObject = require("antd");
|
|
32
41
|
const external_react_namespaceObject = require("react");
|
|
42
|
+
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
33
43
|
require("./index.css");
|
|
34
44
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
35
45
|
try {
|
|
@@ -57,7 +67,8 @@ function _async_to_generator(fn) {
|
|
|
57
67
|
});
|
|
58
68
|
};
|
|
59
69
|
}
|
|
60
|
-
|
|
70
|
+
external_react_default();
|
|
71
|
+
function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUserOperating = false, mjpegUrl, mode = 'default', contentRef }) {
|
|
61
72
|
const [screenshot, setScreenshot] = (0, external_react_namespaceObject.useState)(null);
|
|
62
73
|
const [loading, setLoading] = (0, external_react_namespaceObject.useState)(false);
|
|
63
74
|
const [error, setError] = (0, external_react_namespaceObject.useState)(null);
|
|
@@ -246,6 +257,7 @@ function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUse
|
|
|
246
257
|
};
|
|
247
258
|
const screenshotContent = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
248
259
|
className: "screenshot-content",
|
|
260
|
+
ref: contentRef,
|
|
249
261
|
children: isMjpeg ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
250
262
|
ref: mjpegImageRef,
|
|
251
263
|
src: mjpegRetryToken ? `${mjpegUrl}${(null == mjpegUrl ? void 0 : mjpegUrl.includes('?')) ? '&' : '?'}_mjpegRetry=${encodeURIComponent(mjpegRetryToken)}` : mjpegUrl,
|
|
@@ -18,6 +18,7 @@ interface ScreenshotViewerProps {
|
|
|
18
18
|
isUserOperating?: boolean;
|
|
19
19
|
mjpegUrl?: string;
|
|
20
20
|
mode?: ScreenshotViewerMode;
|
|
21
|
+
contentRef?: React.Ref<HTMLDivElement>;
|
|
21
22
|
}
|
|
22
|
-
export default function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUserOperating, mjpegUrl, mode, }: ScreenshotViewerProps): React.JSX.Element;
|
|
23
|
+
export default function ScreenshotViewer({ getScreenshot, getInterfaceInfo, serverOnline, isUserOperating, mjpegUrl, mode, contentRef, }: ScreenshotViewerProps): React.JSX.Element;
|
|
23
24
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/visualizer",
|
|
3
|
-
"version": "1.8.4
|
|
3
|
+
"version": "1.8.4",
|
|
4
4
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
5
5
|
"homepage": "https://midscenejs.com/",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"antd": "^5.21.6",
|
|
66
66
|
"buffer": "6.0.3",
|
|
67
67
|
"dayjs": "^1.11.11",
|
|
68
|
-
"@midscene/
|
|
69
|
-
"@midscene/
|
|
70
|
-
"@midscene/
|
|
71
|
-
"@midscene/
|
|
68
|
+
"@midscene/core": "1.8.4",
|
|
69
|
+
"@midscene/playground": "1.8.4",
|
|
70
|
+
"@midscene/shared": "1.8.4",
|
|
71
|
+
"@midscene/web": "1.8.4"
|
|
72
72
|
},
|
|
73
73
|
"license": "MIT",
|
|
74
74
|
"scripts": {
|