@midscene/visualizer 0.28.4-beta-20250910153230.0 → 0.28.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.
- package/dist/es/component/{blackboard.mjs → blackboard/index.mjs} +3 -3
- package/dist/es/component/{playground/ConfigSelector.mjs → config-selector/index.mjs} +2 -3
- package/dist/es/component/{playground/ContextPreview.mjs → context-preview/index.mjs} +3 -4
- package/dist/es/component/{env-config.mjs → env-config/index.mjs} +1 -1
- package/dist/es/component/{github-star.mjs → github-star/index.mjs} +1 -1
- package/dist/es/component/history-selector/index.css +132 -0
- package/dist/es/component/{playground/HistorySelector.mjs → history-selector/index.mjs} +1 -1
- package/dist/es/component/index.mjs +1 -0
- package/dist/es/component/{logo.mjs → logo/index.mjs} +1 -1
- package/dist/es/component/{misc.mjs → misc/index.mjs} +42 -2
- package/dist/es/component/{player.mjs → player/index.mjs} +8 -8
- package/dist/es/component/playground/index.css +35 -161
- package/dist/es/component/playground/index.mjs +8 -0
- package/dist/es/component/playground-result/index.css +35 -0
- package/dist/es/component/{playground/PlaygroundResult.mjs → playground-result/index.mjs} +7 -5
- package/dist/es/component/prompt-input/index.css +330 -0
- package/dist/es/component/{playground/PromptInput.mjs → prompt-input/index.mjs} +9 -9
- package/dist/es/component/{playground/ServiceModeControl.mjs → service-mode-control/index.mjs} +4 -5
- package/dist/es/component/{shiny-text.mjs → shiny-text/index.mjs} +1 -1
- package/dist/es/component/universal-playground/index.css +341 -0
- package/dist/es/component/universal-playground/index.mjs +273 -0
- package/dist/es/component/universal-playground/providers/context-provider.mjs +52 -0
- package/dist/es/component/universal-playground/providers/storage-provider.mjs +107 -0
- package/dist/es/hooks/usePlaygroundExecution.mjs +168 -0
- package/dist/es/hooks/usePlaygroundState.mjs +176 -0
- package/dist/es/icons/avatar.mjs +28 -0
- package/dist/es/index.mjs +22 -18
- package/dist/es/{component/playground/playground-constants.mjs → utils/constants.mjs} +23 -43
- package/dist/es/{component/playground → utils}/playground-utils.mjs +1 -1
- package/dist/es/{component → utils}/replay-scripts.mjs +1 -2
- package/dist/lib/component/{blackboard.js → blackboard/index.js} +5 -5
- package/dist/lib/component/{playground/ConfigSelector.js → config-selector/index.js} +6 -7
- package/dist/lib/component/{playground/ContextPreview.js → context-preview/index.js} +8 -9
- package/dist/lib/component/{env-config.js → env-config/index.js} +1 -1
- package/dist/lib/component/{github-star.js → github-star/index.js} +1 -1
- package/dist/lib/component/history-selector/index.css +132 -0
- package/dist/lib/component/{playground/HistorySelector.js → history-selector/index.js} +1 -1
- package/dist/lib/component/index.js +60 -0
- package/dist/lib/component/{logo.js → logo/index.js} +1 -1
- package/dist/lib/component/{misc.js → misc/index.js} +60 -1
- package/dist/lib/component/{player.js → player/index.js} +23 -23
- package/dist/lib/component/playground/index.css +35 -161
- package/dist/lib/component/playground/index.js +113 -0
- package/dist/lib/component/playground-result/index.css +35 -0
- package/dist/lib/component/{playground/PlaygroundResult.js → playground-result/index.js} +12 -10
- package/dist/lib/component/prompt-input/index.css +330 -0
- package/dist/lib/component/{playground/PromptInput.js → prompt-input/index.js} +37 -37
- package/dist/lib/component/{playground/ServiceModeControl.js → service-mode-control/index.js} +8 -9
- package/dist/lib/component/{shiny-text.js → shiny-text/index.js} +1 -1
- package/dist/lib/component/universal-playground/index.css +341 -0
- package/dist/lib/component/universal-playground/index.js +321 -0
- package/dist/lib/component/universal-playground/providers/context-provider.js +95 -0
- package/dist/lib/component/universal-playground/providers/storage-provider.js +147 -0
- package/dist/lib/hooks/usePlaygroundExecution.js +202 -0
- package/dist/lib/hooks/usePlaygroundState.js +210 -0
- package/dist/lib/icons/avatar.js +62 -0
- package/dist/lib/index.js +66 -34
- package/dist/lib/{component/playground/playground-constants.js → utils/constants.js} +31 -64
- package/dist/lib/{component/playground → utils}/playground-utils.js +1 -1
- package/dist/lib/{component → utils}/replay-scripts.js +3 -4
- package/dist/types/component/{blackboard.d.ts → blackboard/index.d.ts} +2 -2
- package/dist/types/component/{playground/ConfigSelector.d.ts → config-selector/index.d.ts} +0 -1
- package/dist/types/component/{playground/ContextPreview.d.ts → context-preview/index.d.ts} +0 -1
- package/dist/types/component/{github-star.d.ts → github-star/index.d.ts} +1 -1
- package/dist/types/component/{playground/HistorySelector.d.ts → history-selector/index.d.ts} +1 -1
- package/dist/types/component/index.d.ts +1 -0
- package/dist/types/component/{logo.d.ts → logo/index.d.ts} +1 -1
- package/dist/types/component/misc/index.d.ts +6 -0
- package/dist/types/component/{player.d.ts → player/index.d.ts} +2 -2
- package/dist/types/component/playground/index.d.ts +7 -0
- package/dist/types/component/{playground/PlaygroundResult.d.ts → playground-result/index.d.ts} +3 -4
- package/dist/types/component/{playground/PromptInput.d.ts → prompt-input/index.d.ts} +3 -2
- package/dist/types/component/{playground/ServiceModeControl.d.ts → service-mode-control/index.d.ts} +0 -1
- package/dist/types/component/{shiny-text.d.ts → shiny-text/index.d.ts} +1 -1
- package/dist/types/component/universal-playground/index.d.ts +4 -0
- package/dist/types/component/universal-playground/providers/context-provider.d.ts +37 -0
- package/dist/types/component/universal-playground/providers/storage-provider.d.ts +33 -0
- package/dist/types/hooks/usePlaygroundExecution.d.ts +10 -0
- package/dist/types/hooks/usePlaygroundState.d.ts +26 -0
- package/dist/types/index.d.ts +15 -10
- package/dist/types/types.d.ts +164 -0
- package/dist/types/{component/playground/playground-constants.d.ts → utils/constants.d.ts} +3 -5
- package/dist/types/{component → utils}/replay-scripts.d.ts +0 -1
- package/package.json +5 -5
- package/dist/es/blank_polyfill.mjs +0 -2
- package/dist/es/component/describer.css +0 -25
- package/dist/es/component/playground/playground-types.mjs +0 -0
- package/dist/es/init.mjs +0 -10
- package/dist/lib/blank_polyfill.js +0 -36
- package/dist/lib/component/describer.css +0 -25
- package/dist/lib/component/playground/playground-types.js +0 -18
- package/dist/lib/init.js +0 -44
- package/dist/types/blank_polyfill.d.ts +0 -2
- package/dist/types/component/misc.d.ts +0 -2
- package/dist/types/component/playground/playground-types.d.ts +0 -19
- package/dist/types/component/playground/types.d.ts +0 -72
- package/dist/types/init.d.ts +0 -1
- /package/dist/es/component/{blackboard.css → blackboard/index.css} +0 -0
- /package/dist/es/component/{playground/FormField.mjs → form-field/index.mjs} +0 -0
- /package/dist/es/component/{github-star.css → github-star/index.css} +0 -0
- /package/dist/es/component/{logo.css → logo/index.css} +0 -0
- /package/dist/es/component/{player.css → player/index.css} +0 -0
- /package/dist/es/component/{playground-demo-ui-context.json → playground/playground-demo-ui-context.json} +0 -0
- /package/dist/es/component/{shiny-text.css → shiny-text/index.css} +0 -0
- /package/dist/es/{component/playground → hooks}/useServerValid.mjs +0 -0
- /package/dist/es/{component/store → store}/history.mjs +0 -0
- /package/dist/es/{component/store → store}/store.mjs +0 -0
- /package/dist/es/{component/playground/types.mjs → types.mjs} +0 -0
- /package/dist/es/{component → utils}/color.mjs +0 -0
- /package/dist/es/{utils.mjs → utils/index.mjs} +0 -0
- /package/dist/es/{component → utils}/pixi-loader.mjs +0 -0
- /package/dist/lib/component/{blackboard.css → blackboard/index.css} +0 -0
- /package/dist/lib/component/{playground/FormField.js → form-field/index.js} +0 -0
- /package/dist/lib/component/{github-star.css → github-star/index.css} +0 -0
- /package/dist/lib/component/{logo.css → logo/index.css} +0 -0
- /package/dist/lib/component/{player.css → player/index.css} +0 -0
- /package/dist/lib/component/{playground-demo-ui-context.json → playground/playground-demo-ui-context.json} +0 -0
- /package/dist/lib/component/{shiny-text.css → shiny-text/index.css} +0 -0
- /package/dist/lib/{component/playground → hooks}/useServerValid.js +0 -0
- /package/dist/lib/{component/store → store}/history.js +0 -0
- /package/dist/lib/{component/store → store}/store.js +0 -0
- /package/dist/lib/{component/playground/types.js → types.js} +0 -0
- /package/dist/lib/{component → utils}/color.js +0 -0
- /package/dist/lib/{utils.js → utils/index.js} +0 -0
- /package/dist/lib/{component → utils}/pixi-loader.js +0 -0
- /package/dist/types/component/{env-config.d.ts → env-config/index.d.ts} +0 -0
- /package/dist/types/component/{playground/FormField.d.ts → form-field/index.d.ts} +0 -0
- /package/dist/types/{component/playground → hooks}/useServerValid.d.ts +0 -0
- /package/dist/types/{component/store → store}/history.d.ts +0 -0
- /package/dist/types/{component/store → store}/store.d.ts +0 -0
- /package/dist/types/{component → utils}/color.d.ts +0 -0
- /package/dist/types/{utils.d.ts → utils/index.d.ts} +0 -0
- /package/dist/types/{component → utils}/pixi-loader.d.ts +0 -0
- /package/dist/types/{component/playground → utils}/playground-utils.d.ts +0 -0
|
@@ -39,9 +39,8 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
39
39
|
const external_antd_namespaceObject = require("antd");
|
|
40
40
|
const setting_js_namespaceObject = require("../../icons/setting.js");
|
|
41
41
|
var setting_js_default = /*#__PURE__*/ __webpack_require__.n(setting_js_namespaceObject);
|
|
42
|
-
const store_js_namespaceObject = require("
|
|
43
|
-
const
|
|
44
|
-
require("./index.css");
|
|
42
|
+
const store_js_namespaceObject = require("../../store/store.js");
|
|
43
|
+
const constants_js_namespaceObject = require("../../utils/constants.js");
|
|
45
44
|
const ConfigSelector = (param)=>{
|
|
46
45
|
let { showDeepThinkOption = false, enableTracking = false, showDataExtractionOptions = false, hideDomAndScreenshotOptions = false } = param;
|
|
47
46
|
const forceSameTabNavigation = (0, store_js_namespaceObject.useEnvConfig)((state)=>state.forceSameTabNavigation);
|
|
@@ -75,7 +74,7 @@ const ConfigSelector = (param)=>{
|
|
|
75
74
|
label: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Checkbox, {
|
|
76
75
|
onChange: (e)=>setForceSameTabNavigation(e.target.checked),
|
|
77
76
|
checked: forceSameTabNavigation,
|
|
78
|
-
children:
|
|
77
|
+
children: constants_js_namespaceObject.trackingTip
|
|
79
78
|
}),
|
|
80
79
|
key: 'track-config'
|
|
81
80
|
});
|
|
@@ -85,7 +84,7 @@ const ConfigSelector = (param)=>{
|
|
|
85
84
|
setDeepThink(e.target.checked);
|
|
86
85
|
},
|
|
87
86
|
checked: deepThink,
|
|
88
|
-
children:
|
|
87
|
+
children: constants_js_namespaceObject.deepThinkTip
|
|
89
88
|
}),
|
|
90
89
|
key: 'deep-think-config'
|
|
91
90
|
});
|
|
@@ -96,7 +95,7 @@ const ConfigSelector = (param)=>{
|
|
|
96
95
|
setScreenshotIncluded(e.target.checked);
|
|
97
96
|
},
|
|
98
97
|
checked: screenshotIncluded,
|
|
99
|
-
children:
|
|
98
|
+
children: constants_js_namespaceObject.screenshotIncludedTip
|
|
100
99
|
}),
|
|
101
100
|
key: 'screenshot-included-config'
|
|
102
101
|
});
|
|
@@ -111,7 +110,7 @@ const ConfigSelector = (param)=>{
|
|
|
111
110
|
marginBottom: '4px',
|
|
112
111
|
fontSize: '14px'
|
|
113
112
|
},
|
|
114
|
-
children:
|
|
113
|
+
children: constants_js_namespaceObject.domIncludedTip
|
|
115
114
|
}),
|
|
116
115
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Radio.Group, {
|
|
117
116
|
size: "small",
|
|
@@ -37,12 +37,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37
37
|
});
|
|
38
38
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
39
|
const external_antd_namespaceObject = require("antd");
|
|
40
|
-
const
|
|
41
|
-
var
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
var
|
|
45
|
-
require("./index.css");
|
|
40
|
+
const index_js_namespaceObject = require("../blackboard/index.js");
|
|
41
|
+
var index_js_default = /*#__PURE__*/ __webpack_require__.n(index_js_namespaceObject);
|
|
42
|
+
const external_misc_index_js_namespaceObject = require("../misc/index.js");
|
|
43
|
+
const playground_demo_ui_context_json_namespaceObject = require("../playground/playground-demo-ui-context.json");
|
|
44
|
+
var playground_demo_ui_context_json_default = /*#__PURE__*/ __webpack_require__.n(playground_demo_ui_context_json_namespaceObject);
|
|
46
45
|
const ContextPreview = (param)=>{
|
|
47
46
|
let { uiContextPreview, setUiContextPreview, showContextPreview } = param;
|
|
48
47
|
if (!showContextPreview) return null;
|
|
@@ -52,18 +51,18 @@ const ContextPreview = (param)=>{
|
|
|
52
51
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("h3", {
|
|
53
52
|
children: "UI Context"
|
|
54
53
|
}),
|
|
55
|
-
uiContextPreview ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
54
|
+
uiContextPreview ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_default(), {
|
|
56
55
|
uiContext: uiContextPreview,
|
|
57
56
|
hideController: true
|
|
58
57
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
59
58
|
children: [
|
|
60
|
-
(0,
|
|
59
|
+
(0, external_misc_index_js_namespaceObject.iconForStatus)('failed'),
|
|
61
60
|
" No UI context",
|
|
62
61
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
63
62
|
type: "link",
|
|
64
63
|
onClick: (e)=>{
|
|
65
64
|
e.preventDefault();
|
|
66
|
-
setUiContextPreview(
|
|
65
|
+
setUiContextPreview(playground_demo_ui_context_json_default());
|
|
67
66
|
},
|
|
68
67
|
children: "Load Demo"
|
|
69
68
|
}),
|
|
@@ -30,7 +30,7 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
const icons_namespaceObject = require("@ant-design/icons");
|
|
31
31
|
const external_antd_namespaceObject = require("antd");
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
|
-
const store_js_namespaceObject = require("
|
|
33
|
+
const store_js_namespaceObject = require("../../store/store.js");
|
|
34
34
|
function EnvConfig(param) {
|
|
35
35
|
let { showTooltipWhenEmpty = true, showModelName = true, tooltipPlacement = 'bottom', mode = 'icon' } = param;
|
|
36
36
|
const { config, configString, loadConfig, syncFromStorage } = (0, store_js_namespaceObject.useEnvConfig)();
|
|
@@ -27,7 +27,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
GithubStar: ()=>GithubStar
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
require("./
|
|
30
|
+
require("./index.css");
|
|
31
31
|
const GithubStar = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("a", {
|
|
32
32
|
href: "https://github.com/web-infra-dev/midscene",
|
|
33
33
|
target: "_blank",
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
.history-modal-container {
|
|
2
|
+
border-radius: 12px 12px 0 0;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
height: 70vh;
|
|
5
|
+
display: flex;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.history-modal-container .history-modal-header {
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
align-items: center;
|
|
12
|
+
height: 48px;
|
|
13
|
+
padding: 0 25px;
|
|
14
|
+
line-height: 48px;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.history-modal-container .history-modal-header .close-button {
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
margin-right: -4px;
|
|
22
|
+
padding: 4px;
|
|
23
|
+
display: flex;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.history-modal-container .history-modal-header .close-button .anticon {
|
|
27
|
+
color: #999;
|
|
28
|
+
font-size: 18px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.history-modal-container .history-modal-header .close-button:hover .anticon {
|
|
32
|
+
color: #666;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.history-modal-container .history-search-section {
|
|
36
|
+
background: #fff;
|
|
37
|
+
padding: 16px 20px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.history-modal-container .history-search-section .search-input-wrapper {
|
|
41
|
+
color: rgba(0, 0, 0, .25);
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 12px;
|
|
44
|
+
display: flex;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.history-modal-container .history-search-section .search-input-wrapper .search-input {
|
|
48
|
+
background: #f1f2f3;
|
|
49
|
+
border: none;
|
|
50
|
+
border-radius: 16px;
|
|
51
|
+
flex: 1;
|
|
52
|
+
height: 36px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input {
|
|
56
|
+
box-shadow: none;
|
|
57
|
+
background: none;
|
|
58
|
+
border: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.history-modal-container .history-search-section .search-input-wrapper .search-input:hover, .history-modal-container .history-search-section .search-input-wrapper .search-input:focus-within {
|
|
62
|
+
background: #fff;
|
|
63
|
+
border-color: #d9d9d9;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.history-modal-container .history-search-section .search-input-wrapper .clear-button {
|
|
67
|
+
color: #1890ff;
|
|
68
|
+
height: auto;
|
|
69
|
+
padding: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.history-modal-container .history-search-section .search-input-wrapper .clear-button:hover {
|
|
73
|
+
color: #40a9ff;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.history-modal-container .history-content {
|
|
77
|
+
flex: 1;
|
|
78
|
+
padding: 0 25px 25px;
|
|
79
|
+
overflow-y: auto;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.history-modal-container .history-content .history-group {
|
|
83
|
+
margin-bottom: 10px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.history-modal-container .history-content .history-group .history-group-title {
|
|
87
|
+
color: rgba(0, 0, 0, .45);
|
|
88
|
+
height: 40px;
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
font-weight: 400;
|
|
91
|
+
line-height: 40px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.history-modal-container .history-content .history-group .history-item {
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
color: rgba(0, 0, 0, .85);
|
|
97
|
+
white-space: nowrap;
|
|
98
|
+
text-overflow: ellipsis;
|
|
99
|
+
height: 40px;
|
|
100
|
+
font-size: 14px;
|
|
101
|
+
line-height: 40px;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.history-modal-container .history-content .history-group .history-item:hover {
|
|
106
|
+
background: #f2f4f7;
|
|
107
|
+
margin: 0 -8px;
|
|
108
|
+
padding: 0 8px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.history-modal-container .history-content .no-results {
|
|
112
|
+
text-align: center;
|
|
113
|
+
color: #999;
|
|
114
|
+
padding: 40px 20px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ant-modal-wrap .ant-modal-content {
|
|
118
|
+
animation: .3s cubic-bezier(.4, 0, .2, 1) forwards slideUpFromBottom !important;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@keyframes slideUpFromBottom {
|
|
122
|
+
0% {
|
|
123
|
+
opacity: 0;
|
|
124
|
+
transform: translateY(100%);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
100% {
|
|
128
|
+
opacity: 1;
|
|
129
|
+
transform: translateY(0);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
@@ -44,7 +44,7 @@ const history_js_namespaceObject = require("../../icons/history.js");
|
|
|
44
44
|
var history_js_default = /*#__PURE__*/ __webpack_require__.n(history_js_namespaceObject);
|
|
45
45
|
const magnifying_glass_js_namespaceObject = require("../../icons/magnifying-glass.js");
|
|
46
46
|
var magnifying_glass_js_default = /*#__PURE__*/ __webpack_require__.n(magnifying_glass_js_namespaceObject);
|
|
47
|
-
const external_store_history_js_namespaceObject = require("
|
|
47
|
+
const external_store_history_js_namespaceObject = require("../../store/history.js");
|
|
48
48
|
require("./index.css");
|
|
49
49
|
const { Text } = external_antd_namespaceObject.Typography;
|
|
50
50
|
const HistorySelector = (param)=>{
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"../types": function(module) {
|
|
4
|
+
module.exports = require("../types.js");
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
var __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
13
|
+
};
|
|
14
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
+
return module.exports;
|
|
16
|
+
}
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.n = (module)=>{
|
|
19
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
20
|
+
__webpack_require__.d(getter, {
|
|
21
|
+
a: getter
|
|
22
|
+
});
|
|
23
|
+
return getter;
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
(()=>{
|
|
27
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
28
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: definition[key]
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
(()=>{
|
|
35
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
36
|
+
})();
|
|
37
|
+
(()=>{
|
|
38
|
+
__webpack_require__.r = (exports1)=>{
|
|
39
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
40
|
+
value: 'Module'
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
43
|
+
value: true
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
var __webpack_exports__ = {};
|
|
48
|
+
(()=>{
|
|
49
|
+
__webpack_require__.r(__webpack_exports__);
|
|
50
|
+
var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../types");
|
|
51
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
52
|
+
for(var __WEBPACK_IMPORT_KEY__ in _types__WEBPACK_IMPORTED_MODULE_0__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
53
|
+
return _types__WEBPACK_IMPORTED_MODULE_0__[key];
|
|
54
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
55
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
56
|
+
})();
|
|
57
|
+
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
58
|
+
Object.defineProperty(exports, '__esModule', {
|
|
59
|
+
value: true
|
|
60
|
+
});
|
|
@@ -28,7 +28,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
LogoUrl: ()=>LogoUrl
|
|
29
29
|
});
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
-
require("./
|
|
31
|
+
require("./index.css");
|
|
32
32
|
const LogoUrl = 'https://lf3-static.bytednsdoc.com/obj/eden-cn/vhaeh7vhabf/Midscene.png';
|
|
33
33
|
const Logo = (param)=>{
|
|
34
34
|
let { hideLogo = false } = param;
|
|
@@ -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, {
|
|
@@ -24,11 +33,17 @@ var __webpack_require__ = {};
|
|
|
24
33
|
var __webpack_exports__ = {};
|
|
25
34
|
__webpack_require__.r(__webpack_exports__);
|
|
26
35
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
serverLaunchTip: ()=>serverLaunchTip,
|
|
37
|
+
errorMessageServerNotReady: ()=>errorMessageServerNotReady,
|
|
38
|
+
timeCostStrElement: ()=>timeCostStrElement,
|
|
27
39
|
iconForStatus: ()=>iconForStatus,
|
|
28
|
-
|
|
40
|
+
emptyResultTip: ()=>emptyResultTip
|
|
29
41
|
});
|
|
30
42
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
43
|
const icons_namespaceObject = require("@ant-design/icons");
|
|
44
|
+
const external_antd_namespaceObject = require("antd");
|
|
45
|
+
const index_js_namespaceObject = require("../shiny-text/index.js");
|
|
46
|
+
var index_js_default = /*#__PURE__*/ __webpack_require__.n(index_js_namespaceObject);
|
|
32
47
|
function timeCostStrElement(timeCost) {
|
|
33
48
|
let str;
|
|
34
49
|
str = 'number' != typeof timeCost ? '-' : `${(timeCost / 1000).toFixed(2)}s`;
|
|
@@ -80,10 +95,54 @@ const iconForStatus = (status)=>{
|
|
|
80
95
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.MinusOutlined, {});
|
|
81
96
|
}
|
|
82
97
|
};
|
|
98
|
+
const errorMessageServerNotReady = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
99
|
+
children: [
|
|
100
|
+
"Don't worry, just one more step to launch the playground server.",
|
|
101
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("br", {}),
|
|
102
|
+
"Please run one of the commands under the midscene project directory:",
|
|
103
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("br", {}),
|
|
104
|
+
"a. ",
|
|
105
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("strong", {
|
|
106
|
+
children: "npx midscene-playground"
|
|
107
|
+
}),
|
|
108
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("br", {}),
|
|
109
|
+
"b. ",
|
|
110
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("strong", {
|
|
111
|
+
children: "npx --yes @midscene/web"
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
});
|
|
115
|
+
const serverLaunchTip = function() {
|
|
116
|
+
let notReadyMessage = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : errorMessageServerNotReady;
|
|
117
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
118
|
+
className: "server-tip",
|
|
119
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Alert, {
|
|
120
|
+
message: "Playground Server Not Ready",
|
|
121
|
+
description: notReadyMessage,
|
|
122
|
+
type: "warning"
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
const emptyResultTip = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
127
|
+
className: "result-empty-tip",
|
|
128
|
+
style: {
|
|
129
|
+
textAlign: 'center'
|
|
130
|
+
},
|
|
131
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_default(), {
|
|
132
|
+
disabled: true,
|
|
133
|
+
text: "The result will be shown here"
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
exports.emptyResultTip = __webpack_exports__.emptyResultTip;
|
|
137
|
+
exports.errorMessageServerNotReady = __webpack_exports__.errorMessageServerNotReady;
|
|
83
138
|
exports.iconForStatus = __webpack_exports__.iconForStatus;
|
|
139
|
+
exports.serverLaunchTip = __webpack_exports__.serverLaunchTip;
|
|
84
140
|
exports.timeCostStrElement = __webpack_exports__.timeCostStrElement;
|
|
85
141
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
142
|
+
"emptyResultTip",
|
|
143
|
+
"errorMessageServerNotReady",
|
|
86
144
|
"iconForStatus",
|
|
145
|
+
"serverLaunchTip",
|
|
87
146
|
"timeCostStrElement"
|
|
88
147
|
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
89
148
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -40,20 +40,20 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
40
40
|
require("pixi.js/unsafe-eval");
|
|
41
41
|
const external_pixi_js_namespaceObject = require("pixi.js");
|
|
42
42
|
const external_react_namespaceObject = require("react");
|
|
43
|
-
require("./
|
|
44
|
-
const
|
|
43
|
+
require("./index.css");
|
|
44
|
+
const index_js_namespaceObject = require("../../utils/index.js");
|
|
45
45
|
const icons_namespaceObject = require("@ant-design/icons");
|
|
46
46
|
const extractor_namespaceObject = require("@midscene/shared/extractor");
|
|
47
47
|
const external_antd_namespaceObject = require("antd");
|
|
48
|
-
const global_perspective_js_namespaceObject = require("
|
|
48
|
+
const global_perspective_js_namespaceObject = require("../../icons/global-perspective.js");
|
|
49
49
|
var global_perspective_js_default = /*#__PURE__*/ __webpack_require__.n(global_perspective_js_namespaceObject);
|
|
50
|
-
const player_setting_js_namespaceObject = require("
|
|
50
|
+
const player_setting_js_namespaceObject = require("../../icons/player-setting.js");
|
|
51
51
|
var player_setting_js_default = /*#__PURE__*/ __webpack_require__.n(player_setting_js_namespaceObject);
|
|
52
|
-
const show_marker_js_namespaceObject = require("
|
|
52
|
+
const show_marker_js_namespaceObject = require("../../icons/show-marker.js");
|
|
53
53
|
var show_marker_js_default = /*#__PURE__*/ __webpack_require__.n(show_marker_js_namespaceObject);
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
54
|
+
const store_js_namespaceObject = require("../../store/store.js");
|
|
55
|
+
const pixi_loader_js_namespaceObject = require("../../utils/pixi-loader.js");
|
|
56
|
+
const external_blackboard_index_js_namespaceObject = require("../blackboard/index.js");
|
|
57
57
|
function _define_property(obj, key, value) {
|
|
58
58
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
59
59
|
value: value,
|
|
@@ -215,11 +215,11 @@ function Player(props) {
|
|
|
215
215
|
const repaintImage = async ()=>{
|
|
216
216
|
const imgToUpdate = currentImg.current;
|
|
217
217
|
if (!imgToUpdate) return void console.warn('no image to update');
|
|
218
|
-
if (!(0,
|
|
218
|
+
if (!(0, pixi_loader_js_namespaceObject.getTextureFromCache)(imgToUpdate)) {
|
|
219
219
|
console.warn('image not loaded', imgToUpdate);
|
|
220
|
-
await (0,
|
|
220
|
+
await (0, pixi_loader_js_namespaceObject.loadTexture)(imgToUpdate);
|
|
221
221
|
}
|
|
222
|
-
const texture = (0,
|
|
222
|
+
const texture = (0, pixi_loader_js_namespaceObject.getTextureFromCache)(imgToUpdate);
|
|
223
223
|
if (!texture) throw new Error('texture not found');
|
|
224
224
|
const sprite = external_pixi_js_namespaceObject.Sprite.from(texture);
|
|
225
225
|
if (!sprite) throw new Error('sprite not found');
|
|
@@ -235,7 +235,7 @@ function Player(props) {
|
|
|
235
235
|
const spinningPointer = (frame)=>{
|
|
236
236
|
var _pointerSprite_current, _pointerSprite_current1;
|
|
237
237
|
if (!spinningPointerSprite.current) {
|
|
238
|
-
spinningPointerSprite.current = external_pixi_js_namespaceObject.Sprite.from(
|
|
238
|
+
spinningPointerSprite.current = external_pixi_js_namespaceObject.Sprite.from(index_js_namespaceObject.mouseLoading);
|
|
239
239
|
spinningPointerSprite.current.zIndex = LAYER_ORDER_SPINNING_POINTER;
|
|
240
240
|
spinningPointerSprite.current.anchor.set(0.5, 0.5);
|
|
241
241
|
spinningPointerSprite.current.scale.set(0.5);
|
|
@@ -264,11 +264,11 @@ function Player(props) {
|
|
|
264
264
|
};
|
|
265
265
|
const updatePointer = async (img, x, y)=>{
|
|
266
266
|
var _pointerSprite_current, _pointerSprite_current1;
|
|
267
|
-
if (!(0,
|
|
267
|
+
if (!(0, pixi_loader_js_namespaceObject.getTextureFromCache)(img)) {
|
|
268
268
|
console.warn('image not loaded', img);
|
|
269
|
-
await (0,
|
|
269
|
+
await (0, pixi_loader_js_namespaceObject.loadTexture)(img);
|
|
270
270
|
}
|
|
271
|
-
const texture = (0,
|
|
271
|
+
const texture = (0, pixi_loader_js_namespaceObject.getTextureFromCache)(img);
|
|
272
272
|
if (!texture) throw new Error('texture not found');
|
|
273
273
|
const sprite = external_pixi_js_namespaceObject.Sprite.from(texture);
|
|
274
274
|
let targetX = null == (_pointerSprite_current = pointerSprite.current) ? void 0 : _pointerSprite_current.x;
|
|
@@ -413,7 +413,7 @@ function Player(props) {
|
|
|
413
413
|
const randomIndex = Math.floor(Math.random() * elementsToAdd.length);
|
|
414
414
|
const element = elementsToAdd.splice(randomIndex, 1)[0];
|
|
415
415
|
if (element) {
|
|
416
|
-
const [insightMarkGraphic] = (0,
|
|
416
|
+
const [insightMarkGraphic] = (0, external_blackboard_index_js_namespaceObject.rectMarkForItem)(element.rect, element.content, 'element');
|
|
417
417
|
insightMarkGraphic.alpha = 0;
|
|
418
418
|
insightMarkContainer.addChild(insightMarkGraphic);
|
|
419
419
|
childrenCount++;
|
|
@@ -425,17 +425,17 @@ function Player(props) {
|
|
|
425
425
|
while(elementsToAdd.length > 0){
|
|
426
426
|
const randomIndex = Math.floor(Math.random() * elementsToAdd.length);
|
|
427
427
|
const element = elementsToAdd.splice(randomIndex, 1)[0];
|
|
428
|
-
const [insightMarkGraphic] = (0,
|
|
428
|
+
const [insightMarkGraphic] = (0, external_blackboard_index_js_namespaceObject.rectMarkForItem)(element.rect, element.content, 'element');
|
|
429
429
|
insightMarkGraphic.alpha = 1;
|
|
430
430
|
insightMarkContainer.addChild(insightMarkGraphic);
|
|
431
431
|
}
|
|
432
432
|
if (searchArea) {
|
|
433
|
-
const [searchAreaGraphic] = (0,
|
|
433
|
+
const [searchAreaGraphic] = (0, external_blackboard_index_js_namespaceObject.rectMarkForItem)(searchArea, 'Search Area', 'searchArea');
|
|
434
434
|
searchAreaGraphic.alpha = 1;
|
|
435
435
|
insightMarkContainer.addChild(searchAreaGraphic);
|
|
436
436
|
}
|
|
437
437
|
highlightElements.map((element)=>{
|
|
438
|
-
const [insightMarkGraphic] = (0,
|
|
438
|
+
const [insightMarkGraphic] = (0, external_blackboard_index_js_namespaceObject.rectMarkForItem)(element.rect, element.content || '', 'highlight');
|
|
439
439
|
insightMarkGraphic.alpha = 1;
|
|
440
440
|
insightMarkContainer.addChild(insightMarkGraphic);
|
|
441
441
|
});
|
|
@@ -482,11 +482,11 @@ function Player(props) {
|
|
|
482
482
|
const allImages = scripts.filter((item)=>!!item.img).map((item)=>item.img);
|
|
483
483
|
await Promise.all([
|
|
484
484
|
...allImages,
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
].map(
|
|
485
|
+
index_js_namespaceObject.mouseLoading,
|
|
486
|
+
index_js_namespaceObject.mousePointer
|
|
487
|
+
].map(pixi_loader_js_namespaceObject.loadTexture));
|
|
488
488
|
insightMarkContainer.removeChildren();
|
|
489
|
-
await updatePointer(
|
|
489
|
+
await updatePointer(index_js_namespaceObject.mousePointer, imageWidth / 2, imageHeight / 2);
|
|
490
490
|
await repaintImage();
|
|
491
491
|
await updateCamera({
|
|
492
492
|
...basicCameraState
|