@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.
@@ -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
  },
@@ -3,3 +3,7 @@
3
3
  position: absolute !important;
4
4
  }
5
5
 
6
+ .insert-modal-wrap .ant-modal {
7
+ width: 90% !important;
8
+ }
9
+
@@ -176,9 +176,7 @@ function EnvConfig({ showTooltipWhenEmpty = true, showModelName = true, tooltipP
176
176
  ]
177
177
  }),
178
178
  style: {
179
- width: '800px',
180
- height: '100%',
181
- marginTop: '10%'
179
+ width: '80%'
182
180
  },
183
181
  destroyOnClose: true,
184
182
  maskClosable: true,
@@ -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
- const maxLeft = Math.max(HISTORY_MODAL_GUTTER, window.innerWidth - HISTORY_MODAL_WIDTH - HISTORY_MODAL_GUTTER);
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
  },
@@ -3,3 +3,7 @@
3
3
  position: absolute !important;
4
4
  }
5
5
 
6
+ .insert-modal-wrap .ant-modal {
7
+ width: 90% !important;
8
+ }
9
+
@@ -204,9 +204,7 @@ function EnvConfig({ showTooltipWhenEmpty = true, showModelName = true, tooltipP
204
204
  ]
205
205
  }),
206
206
  style: {
207
- width: '800px',
208
- height: '100%',
209
- marginTop: '10%'
207
+ width: '80%'
210
208
  },
211
209
  destroyOnClose: true,
212
210
  maskClosable: true,
@@ -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
- const maxLeft = Math.max(HISTORY_MODAL_GUTTER, window.innerWidth - HISTORY_MODAL_WIDTH - HISTORY_MODAL_GUTTER);
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.13",
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.13",
70
- "@godscene/playground": "1.7.13",
71
- "@godscene/shared": "1.7.13",
72
- "@godscene/web": "1.7.13"
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": {