@midscene/visualizer 1.5.3-beta-20260309062917.0 → 1.5.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,12 +1,11 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useMemo, useRef } from "react";
3
+ import { useMemo } from "react";
4
4
  import "./index.css";
5
5
  const Blackboard = (props)=>{
6
6
  var _props_uiContext;
7
7
  const highlightElements = props.highlightElements || [];
8
8
  const highlightRect = props.highlightRect;
9
- const highlightPoints = props.highlightPoints;
10
9
  if (!(null == (_props_uiContext = props.uiContext) ? void 0 : _props_uiContext.shotSize)) return /*#__PURE__*/ jsx("div", {
11
10
  className: "blackboard",
12
11
  children: /*#__PURE__*/ jsx("div", {
@@ -29,19 +28,6 @@ const Blackboard = (props)=>{
29
28
  }, [
30
29
  screenshot
31
30
  ]);
32
- const containerRef = useRef(null);
33
- const handleClick = (e)=>{
34
- if (!props.onCanvasClick || !containerRef.current) return;
35
- const rect = containerRef.current.getBoundingClientRect();
36
- const scaleX = screenWidth / rect.width;
37
- const scaleY = screenHeight / rect.height;
38
- const x = Math.round((e.clientX - rect.left) * scaleX);
39
- const y = Math.round((e.clientY - rect.top) * scaleY);
40
- props.onCanvasClick([
41
- x,
42
- y
43
- ]);
44
- };
45
31
  const highlightElementRects = highlightElements.map((e)=>e.rect);
46
32
  let bottomTipA = null;
47
33
  if (1 === highlightElementRects.length) bottomTipA = /*#__PURE__*/ jsx("div", {
@@ -69,12 +55,9 @@ const Blackboard = (props)=>{
69
55
  children: [
70
56
  /*#__PURE__*/ jsxs("div", {
71
57
  className: "blackboard-main-content",
72
- ref: containerRef,
73
- onClick: handleClick,
74
58
  style: {
75
59
  width: '100%',
76
- position: 'relative',
77
- cursor: props.onCanvasClick ? 'crosshair' : void 0
60
+ position: 'relative'
78
61
  },
79
62
  children: [
80
63
  screenshotBase64 && /*#__PURE__*/ jsx("img", {
@@ -115,14 +98,7 @@ const Blackboard = (props)=>{
115
98
  className: "blackboard-rect-label",
116
99
  children: el.content
117
100
  })
118
- }, el.id || idx)),
119
- null == highlightPoints ? void 0 : highlightPoints.map((point, idx)=>/*#__PURE__*/ jsx("div", {
120
- className: "blackboard-point",
121
- style: {
122
- left: `${point[0] / screenWidth * 100}%`,
123
- top: `${point[1] / screenHeight * 100}%`
124
- }
125
- }, idx))
101
+ }, el.id || idx))
126
102
  ]
127
103
  })
128
104
  ]
@@ -112,7 +112,7 @@ function wrapExecutionDumpForReplay(dump, deviceType) {
112
112
  }
113
113
  function usePlaygroundExecution(options) {
114
114
  const { playgroundSDK, storage, actionSpace, loading, setLoading, setInfoList, replayCounter, setReplayCounter, verticalMode, currentRunningIdRef, interruptedFlagRef, deviceType } = options;
115
- const { deepLocate, deepThink, screenshotIncluded, domIncluded } = useEnvConfig();
115
+ const { deepLocate, deepThink, screenshotIncluded, domIncluded, imeStrategy, autoDismissKeyboard, keyboardDismissStrategy, alwaysRefreshScreenInfo } = useEnvConfig();
116
116
  const handleRun = useCallback((value)=>_async_to_generator(function*() {
117
117
  if (!playgroundSDK) return void console.warn('PlaygroundSDK is not available');
118
118
  const thisRunningId = Date.now();
@@ -183,7 +183,13 @@ function usePlaygroundExecution(options) {
183
183
  deepThink
184
184
  } : {}), {
185
185
  screenshotIncluded,
186
- domIncluded
186
+ domIncluded,
187
+ deviceOptions: {
188
+ imeStrategy,
189
+ autoDismissKeyboard,
190
+ keyboardDismissStrategy,
191
+ alwaysRefreshScreenInfo
192
+ }
187
193
  });
188
194
  result.result = yield playgroundSDK.executeAction(actionType, value, executionOptions);
189
195
  if ('object' == typeof result.result && null !== result.result) {
@@ -267,7 +273,11 @@ function usePlaygroundExecution(options) {
267
273
  deepThink,
268
274
  screenshotIncluded,
269
275
  domIncluded,
270
- deviceType
276
+ deviceType,
277
+ imeStrategy,
278
+ autoDismissKeyboard,
279
+ keyboardDismissStrategy,
280
+ alwaysRefreshScreenInfo
271
281
  ]);
272
282
  const handleStop = useCallback(()=>_async_to_generator(function*() {
273
283
  const thisRunningId = currentRunningIdRef.current;
@@ -35,7 +35,6 @@ const Blackboard = (props)=>{
35
35
  var _props_uiContext;
36
36
  const highlightElements = props.highlightElements || [];
37
37
  const highlightRect = props.highlightRect;
38
- const highlightPoints = props.highlightPoints;
39
38
  if (!(null == (_props_uiContext = props.uiContext) ? void 0 : _props_uiContext.shotSize)) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
40
39
  className: "blackboard",
41
40
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
@@ -58,19 +57,6 @@ const Blackboard = (props)=>{
58
57
  }, [
59
58
  screenshot
60
59
  ]);
61
- const containerRef = (0, external_react_namespaceObject.useRef)(null);
62
- const handleClick = (e)=>{
63
- if (!props.onCanvasClick || !containerRef.current) return;
64
- const rect = containerRef.current.getBoundingClientRect();
65
- const scaleX = screenWidth / rect.width;
66
- const scaleY = screenHeight / rect.height;
67
- const x = Math.round((e.clientX - rect.left) * scaleX);
68
- const y = Math.round((e.clientY - rect.top) * scaleY);
69
- props.onCanvasClick([
70
- x,
71
- y
72
- ]);
73
- };
74
60
  const highlightElementRects = highlightElements.map((e)=>e.rect);
75
61
  let bottomTipA = null;
76
62
  if (1 === highlightElementRects.length) bottomTipA = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
@@ -98,12 +84,9 @@ const Blackboard = (props)=>{
98
84
  children: [
99
85
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
100
86
  className: "blackboard-main-content",
101
- ref: containerRef,
102
- onClick: handleClick,
103
87
  style: {
104
88
  width: '100%',
105
- position: 'relative',
106
- cursor: props.onCanvasClick ? 'crosshair' : void 0
89
+ position: 'relative'
107
90
  },
108
91
  children: [
109
92
  screenshotBase64 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
@@ -144,14 +127,7 @@ const Blackboard = (props)=>{
144
127
  className: "blackboard-rect-label",
145
128
  children: el.content
146
129
  })
147
- }, el.id || idx)),
148
- null == highlightPoints ? void 0 : highlightPoints.map((point, idx)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
149
- className: "blackboard-point",
150
- style: {
151
- left: `${point[0] / screenWidth * 100}%`,
152
- top: `${point[1] / screenHeight * 100}%`
153
- }
154
- }, idx))
130
+ }, el.id || idx))
155
131
  ]
156
132
  })
157
133
  ]
@@ -140,7 +140,7 @@ function wrapExecutionDumpForReplay(dump, deviceType) {
140
140
  }
141
141
  function usePlaygroundExecution(options) {
142
142
  const { playgroundSDK, storage, actionSpace, loading, setLoading, setInfoList, replayCounter, setReplayCounter, verticalMode, currentRunningIdRef, interruptedFlagRef, deviceType } = options;
143
- const { deepLocate, deepThink, screenshotIncluded, domIncluded } = (0, store_js_namespaceObject.useEnvConfig)();
143
+ const { deepLocate, deepThink, screenshotIncluded, domIncluded, imeStrategy, autoDismissKeyboard, keyboardDismissStrategy, alwaysRefreshScreenInfo } = (0, store_js_namespaceObject.useEnvConfig)();
144
144
  const handleRun = (0, external_react_namespaceObject.useCallback)((value)=>_async_to_generator(function*() {
145
145
  if (!playgroundSDK) return void console.warn('PlaygroundSDK is not available');
146
146
  const thisRunningId = Date.now();
@@ -211,7 +211,13 @@ function usePlaygroundExecution(options) {
211
211
  deepThink
212
212
  } : {}), {
213
213
  screenshotIncluded,
214
- domIncluded
214
+ domIncluded,
215
+ deviceOptions: {
216
+ imeStrategy,
217
+ autoDismissKeyboard,
218
+ keyboardDismissStrategy,
219
+ alwaysRefreshScreenInfo
220
+ }
215
221
  });
216
222
  result.result = yield playgroundSDK.executeAction(actionType, value, executionOptions);
217
223
  if ('object' == typeof result.result && null !== result.result) {
@@ -295,7 +301,11 @@ function usePlaygroundExecution(options) {
295
301
  deepThink,
296
302
  screenshotIncluded,
297
303
  domIncluded,
298
- deviceType
304
+ deviceType,
305
+ imeStrategy,
306
+ autoDismissKeyboard,
307
+ keyboardDismissStrategy,
308
+ alwaysRefreshScreenInfo
299
309
  ]);
300
310
  const handleStop = (0, external_react_namespaceObject.useCallback)(()=>_async_to_generator(function*() {
301
311
  const thisRunningId = currentRunningIdRef.current;
@@ -4,8 +4,6 @@ export declare const Blackboard: (props: {
4
4
  uiContext: UIContext | undefined | null;
5
5
  highlightElements?: BaseElement[];
6
6
  highlightRect?: Rect;
7
- highlightPoints?: [number, number][];
8
7
  hideController?: boolean;
9
- onCanvasClick?: (position: [number, number]) => void;
10
8
  }) => import("react").JSX.Element;
11
9
  export default Blackboard;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/visualizer",
3
- "version": "1.5.3-beta-20260309062917.0",
3
+ "version": "1.5.3",
4
4
  "repository": "https://github.com/web-infra-dev/midscene",
5
5
  "homepage": "https://midscenejs.com/",
6
6
  "types": "./dist/types/index.d.ts",
@@ -57,10 +57,10 @@
57
57
  "antd": "^5.21.6",
58
58
  "buffer": "6.0.3",
59
59
  "dayjs": "^1.11.11",
60
- "@midscene/core": "1.5.3-beta-20260309062917.0",
61
- "@midscene/web": "1.5.3-beta-20260309062917.0",
62
- "@midscene/playground": "1.5.3-beta-20260309062917.0",
63
- "@midscene/shared": "1.5.3-beta-20260309062917.0"
60
+ "@midscene/core": "1.5.3",
61
+ "@midscene/playground": "1.5.3",
62
+ "@midscene/web": "1.5.3",
63
+ "@midscene/shared": "1.5.3"
64
64
  },
65
65
  "license": "MIT",
66
66
  "scripts": {