@godscene/visualizer 1.7.13 → 1.7.15
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.
- package/dist/es/component/config-selector/index.mjs +1 -1
- package/dist/es/component/env-config/index.css +4 -0
- package/dist/es/component/env-config/index.mjs +1 -3
- package/dist/es/component/history-selector/index.mjs +2 -4
- package/dist/lib/component/config-selector/index.js +1 -1
- package/dist/lib/component/env-config/index.css +4 -0
- package/dist/lib/component/env-config/index.js +1 -3
- package/dist/lib/component/history-selector/index.js +2 -4
- package/package.json +5 -5
|
@@ -30,7 +30,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
30
30
|
return /*#__PURE__*/ jsx("div", {
|
|
31
31
|
className: "selector-trigger",
|
|
32
32
|
children: /*#__PURE__*/ jsx(Dropdown, {
|
|
33
|
-
getPopupContainer: (triggerNode)=>triggerNode.ownerDocument.body,
|
|
33
|
+
getPopupContainer: (triggerNode)=>document.querySelector('.model-root-container') || triggerNode.ownerDocument.body,
|
|
34
34
|
menu: {
|
|
35
35
|
items: configItems
|
|
36
36
|
},
|
|
@@ -8,7 +8,6 @@ import magnifying_glass from "../../icons/magnifying-glass.mjs";
|
|
|
8
8
|
import { useHistoryStore } from "../../store/history.mjs";
|
|
9
9
|
import "./index.css";
|
|
10
10
|
const { Text } = Typography;
|
|
11
|
-
const HISTORY_MODAL_WIDTH = 320;
|
|
12
11
|
const HISTORY_MODAL_HEIGHT = 400;
|
|
13
12
|
const HISTORY_MODAL_GUTTER = 16;
|
|
14
13
|
const HISTORY_MODAL_OFFSET = 8;
|
|
@@ -48,13 +47,12 @@ const HistorySelector = ({ onSelect, history, currentType, trigger, popupPlaceme
|
|
|
48
47
|
const updateOverlayPosition = ()=>{
|
|
49
48
|
if (!triggerRef.current) return;
|
|
50
49
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
51
|
-
|
|
50
|
+
window.innerWidth;
|
|
52
51
|
const maxTop = Math.max(HISTORY_MODAL_GUTTER, window.innerHeight - HISTORY_MODAL_HEIGHT - HISTORY_MODAL_GUTTER);
|
|
53
|
-
const left = Math.min(Math.max(HISTORY_MODAL_GUTTER, triggerRect.right - HISTORY_MODAL_WIDTH), maxLeft);
|
|
54
52
|
const preferredTop = 'top' === popupPlacement ? triggerRect.top - HISTORY_MODAL_HEIGHT - HISTORY_MODAL_OFFSET : triggerRect.bottom + HISTORY_MODAL_OFFSET;
|
|
55
53
|
const top = Math.min(Math.max(HISTORY_MODAL_GUTTER, preferredTop), maxTop);
|
|
56
54
|
setOverlayPosition({
|
|
57
|
-
left,
|
|
55
|
+
left: '10%',
|
|
58
56
|
top
|
|
59
57
|
});
|
|
60
58
|
};
|
|
@@ -68,7 +68,7 @@ const ConfigSelector = ({ showDeepLocateOption = false, showDeepThinkOption = fa
|
|
|
68
68
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
69
69
|
className: "selector-trigger",
|
|
70
70
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Dropdown, {
|
|
71
|
-
getPopupContainer: (triggerNode)=>triggerNode.ownerDocument.body,
|
|
71
|
+
getPopupContainer: (triggerNode)=>document.querySelector('.model-root-container') || triggerNode.ownerDocument.body,
|
|
72
72
|
menu: {
|
|
73
73
|
items: configItems
|
|
74
74
|
},
|
|
@@ -48,7 +48,6 @@ var magnifying_glass_js_default = /*#__PURE__*/ __webpack_require__.n(magnifying
|
|
|
48
48
|
const external_store_history_js_namespaceObject = require("../../store/history.js");
|
|
49
49
|
require("./index.css");
|
|
50
50
|
const { Text } = external_antd_namespaceObject.Typography;
|
|
51
|
-
const HISTORY_MODAL_WIDTH = 320;
|
|
52
51
|
const HISTORY_MODAL_HEIGHT = 400;
|
|
53
52
|
const HISTORY_MODAL_GUTTER = 16;
|
|
54
53
|
const HISTORY_MODAL_OFFSET = 8;
|
|
@@ -88,13 +87,12 @@ const HistorySelector = ({ onSelect, history, currentType, trigger, popupPlaceme
|
|
|
88
87
|
const updateOverlayPosition = ()=>{
|
|
89
88
|
if (!triggerRef.current) return;
|
|
90
89
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
91
|
-
|
|
90
|
+
window.innerWidth;
|
|
92
91
|
const maxTop = Math.max(HISTORY_MODAL_GUTTER, window.innerHeight - HISTORY_MODAL_HEIGHT - HISTORY_MODAL_GUTTER);
|
|
93
|
-
const left = Math.min(Math.max(HISTORY_MODAL_GUTTER, triggerRect.right - HISTORY_MODAL_WIDTH), maxLeft);
|
|
94
92
|
const preferredTop = 'top' === popupPlacement ? triggerRect.top - HISTORY_MODAL_HEIGHT - HISTORY_MODAL_OFFSET : triggerRect.bottom + HISTORY_MODAL_OFFSET;
|
|
95
93
|
const top = Math.min(Math.max(HISTORY_MODAL_GUTTER, preferredTop), maxTop);
|
|
96
94
|
setOverlayPosition({
|
|
97
|
-
left,
|
|
95
|
+
left: '10%',
|
|
98
96
|
top
|
|
99
97
|
});
|
|
100
98
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@godscene/visualizer",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.15",
|
|
4
4
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
5
5
|
"homepage": "https://midscenejs.com/",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"antd": "^5.21.6",
|
|
67
67
|
"buffer": "6.0.3",
|
|
68
68
|
"dayjs": "^1.11.11",
|
|
69
|
-
"@godscene/core": "1.7.
|
|
70
|
-
"@godscene/
|
|
71
|
-
"@godscene/
|
|
72
|
-
"@godscene/
|
|
69
|
+
"@godscene/core": "1.7.15",
|
|
70
|
+
"@godscene/web": "1.7.15",
|
|
71
|
+
"@godscene/playground": "1.7.15",
|
|
72
|
+
"@godscene/shared": "1.7.15"
|
|
73
73
|
},
|
|
74
74
|
"license": "MIT",
|
|
75
75
|
"scripts": {
|