@midscene/visualizer 0.28.3 → 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
|
@@ -4,11 +4,11 @@ import "pixi.js/unsafe-eval";
|
|
|
4
4
|
import { Checkbox } from "antd";
|
|
5
5
|
import { Application, Container, Graphics, Rectangle, Sprite, Text, Texture } from "pixi.js";
|
|
6
6
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
7
|
-
import { colorForName, highlightColorForType } from "
|
|
8
|
-
import "./
|
|
7
|
+
import { colorForName, highlightColorForType } from "../../utils/color.mjs";
|
|
8
|
+
import "./index.css";
|
|
9
9
|
import { treeToList } from "@midscene/shared/extractor";
|
|
10
10
|
import { DropShadowFilter } from "pixi-filters";
|
|
11
|
-
import { useBlackboardPreference } from "
|
|
11
|
+
import { useBlackboardPreference } from "../../store/store.mjs";
|
|
12
12
|
const itemFillAlpha = 0.4;
|
|
13
13
|
const highlightAlpha = 0.4;
|
|
14
14
|
const pointRadius = 10;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Checkbox, Dropdown, Radio } from "antd";
|
|
3
3
|
import setting from "../../icons/setting.mjs";
|
|
4
|
-
import { useEnvConfig } from "
|
|
5
|
-
import { deepThinkTip, domIncludedTip, screenshotIncludedTip, trackingTip } from "
|
|
6
|
-
import "./index.css";
|
|
4
|
+
import { useEnvConfig } from "../../store/store.mjs";
|
|
5
|
+
import { deepThinkTip, domIncludedTip, screenshotIncludedTip, trackingTip } from "../../utils/constants.mjs";
|
|
7
6
|
const ConfigSelector = (param)=>{
|
|
8
7
|
let { showDeepThinkOption = false, enableTracking = false, showDataExtractionOptions = false, hideDomAndScreenshotOptions = false } = param;
|
|
9
8
|
const forceSameTabNavigation = useEnvConfig((state)=>state.forceSameTabNavigation);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from "antd";
|
|
3
|
-
import blackboard from "../blackboard.mjs";
|
|
4
|
-
import { iconForStatus } from "../misc.mjs";
|
|
5
|
-
import playground_demo_ui_context from "../playground-demo-ui-context.json";
|
|
6
|
-
import "./index.css";
|
|
3
|
+
import blackboard from "../blackboard/index.mjs";
|
|
4
|
+
import { iconForStatus } from "../misc/index.mjs";
|
|
5
|
+
import playground_demo_ui_context from "../playground/playground-demo-ui-context.json";
|
|
7
6
|
const ContextPreview = (param)=>{
|
|
8
7
|
let { uiContextPreview, setUiContextPreview, showContextPreview } = param;
|
|
9
8
|
if (!showContextPreview) return null;
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { SettingOutlined } from "@ant-design/icons";
|
|
3
3
|
import { Input, Modal, Tooltip } from "antd";
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
|
5
|
-
import { useEnvConfig } from "
|
|
5
|
+
import { useEnvConfig } from "../../store/store.mjs";
|
|
6
6
|
function EnvConfig(param) {
|
|
7
7
|
let { showTooltipWhenEmpty = true, showModelName = true, tooltipPlacement = 'bottom', mode = 'icon' } = param;
|
|
8
8
|
const { config, configString, loadConfig, syncFromStorage } = useEnvConfig();
|
|
@@ -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
|
+
|
|
@@ -4,7 +4,7 @@ import { useMemo, useState } from "react";
|
|
|
4
4
|
import icons_close from "../../icons/close.mjs";
|
|
5
5
|
import icons_history from "../../icons/history.mjs";
|
|
6
6
|
import magnifying_glass from "../../icons/magnifying-glass.mjs";
|
|
7
|
-
import { useHistoryStore } from "
|
|
7
|
+
import { useHistoryStore } from "../../store/history.mjs";
|
|
8
8
|
import "./index.css";
|
|
9
9
|
const { Text } = Typography;
|
|
10
10
|
const HistorySelector = (param)=>{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../types.mjs";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ArrowRightOutlined, CheckOutlined, ClockCircleOutlined, CloseOutlined, LogoutOutlined, MinusOutlined, WarningOutlined } from "@ant-design/icons";
|
|
3
|
+
import { Alert } from "antd";
|
|
4
|
+
import shiny_text from "../shiny-text/index.mjs";
|
|
3
5
|
function timeCostStrElement(timeCost) {
|
|
4
6
|
let str;
|
|
5
7
|
str = 'number' != typeof timeCost ? '-' : `${(timeCost / 1000).toFixed(2)}s`;
|
|
@@ -51,4 +53,42 @@ const iconForStatus = (status)=>{
|
|
|
51
53
|
return /*#__PURE__*/ jsx(MinusOutlined, {});
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
|
-
|
|
56
|
+
const errorMessageServerNotReady = /*#__PURE__*/ jsxs("span", {
|
|
57
|
+
children: [
|
|
58
|
+
"Don't worry, just one more step to launch the playground server.",
|
|
59
|
+
/*#__PURE__*/ jsx("br", {}),
|
|
60
|
+
"Please run one of the commands under the midscene project directory:",
|
|
61
|
+
/*#__PURE__*/ jsx("br", {}),
|
|
62
|
+
"a. ",
|
|
63
|
+
/*#__PURE__*/ jsx("strong", {
|
|
64
|
+
children: "npx midscene-playground"
|
|
65
|
+
}),
|
|
66
|
+
/*#__PURE__*/ jsx("br", {}),
|
|
67
|
+
"b. ",
|
|
68
|
+
/*#__PURE__*/ jsx("strong", {
|
|
69
|
+
children: "npx --yes @midscene/web"
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
const serverLaunchTip = function() {
|
|
74
|
+
let notReadyMessage = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : errorMessageServerNotReady;
|
|
75
|
+
return /*#__PURE__*/ jsx("div", {
|
|
76
|
+
className: "server-tip",
|
|
77
|
+
children: /*#__PURE__*/ jsx(Alert, {
|
|
78
|
+
message: "Playground Server Not Ready",
|
|
79
|
+
description: notReadyMessage,
|
|
80
|
+
type: "warning"
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
const emptyResultTip = /*#__PURE__*/ jsx("div", {
|
|
85
|
+
className: "result-empty-tip",
|
|
86
|
+
style: {
|
|
87
|
+
textAlign: 'center'
|
|
88
|
+
},
|
|
89
|
+
children: /*#__PURE__*/ jsx(shiny_text, {
|
|
90
|
+
disabled: true,
|
|
91
|
+
text: "The result will be shown here"
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
export { emptyResultTip, errorMessageServerNotReady, iconForStatus, serverLaunchTip, timeCostStrElement };
|
|
@@ -3,17 +3,17 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import "pixi.js/unsafe-eval";
|
|
4
4
|
import { Application, Container, Sprite } from "pixi.js";
|
|
5
5
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
6
|
-
import "./
|
|
7
|
-
import { mouseLoading, mousePointer } from "
|
|
6
|
+
import "./index.css";
|
|
7
|
+
import { mouseLoading, mousePointer } from "../../utils/index.mjs";
|
|
8
8
|
import { CaretRightOutlined, DownloadOutlined, ExportOutlined, LoadingOutlined } from "@ant-design/icons";
|
|
9
9
|
import { treeToList } from "@midscene/shared/extractor";
|
|
10
10
|
import { Dropdown, Spin, Switch, Tooltip } from "antd";
|
|
11
|
-
import global_perspective from "
|
|
12
|
-
import player_setting from "
|
|
13
|
-
import show_marker from "
|
|
14
|
-
import {
|
|
15
|
-
import { getTextureFromCache, loadTexture } from "
|
|
16
|
-
import {
|
|
11
|
+
import global_perspective from "../../icons/global-perspective.mjs";
|
|
12
|
+
import player_setting from "../../icons/player-setting.mjs";
|
|
13
|
+
import show_marker from "../../icons/show-marker.mjs";
|
|
14
|
+
import { useBlackboardPreference } from "../../store/store.mjs";
|
|
15
|
+
import { getTextureFromCache, loadTexture } from "../../utils/pixi-loader.mjs";
|
|
16
|
+
import { rectMarkForItem } from "../blackboard/index.mjs";
|
|
17
17
|
function _define_property(obj, key, value) {
|
|
18
18
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
19
19
|
value: value,
|
|
@@ -1,7 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
.result-wrapper {
|
|
2
|
+
justify-content: center;
|
|
3
|
+
align-items: center;
|
|
4
|
+
height: 100%;
|
|
5
|
+
margin: 4px 0;
|
|
6
|
+
display: flex;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.result-wrapper .loading-container {
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.result-wrapper .loading-container .loading-progress-text {
|
|
19
|
+
color: #888;
|
|
20
|
+
margin-top: 8px;
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.result-wrapper pre {
|
|
25
|
+
white-space: pre-wrap;
|
|
26
|
+
text-wrap: unset;
|
|
27
|
+
word-wrap: break-word;
|
|
28
|
+
overflow-wrap: break-word;
|
|
29
|
+
background: #f2f4f7;
|
|
30
|
+
border-radius: 8px;
|
|
2
31
|
margin: 0;
|
|
3
|
-
|
|
4
|
-
|
|
32
|
+
padding: 14px;
|
|
33
|
+
overflow: scroll;
|
|
5
34
|
}
|
|
6
35
|
|
|
7
36
|
.prompt-input-wrapper {
|
|
@@ -334,164 +363,9 @@ body {
|
|
|
334
363
|
color: #2b83ff;
|
|
335
364
|
}
|
|
336
365
|
|
|
337
|
-
|
|
338
|
-
border-radius: 12px 12px 0 0;
|
|
339
|
-
flex-direction: column;
|
|
340
|
-
height: 70vh;
|
|
341
|
-
display: flex;
|
|
342
|
-
overflow: hidden;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
.history-modal-container .history-modal-header {
|
|
346
|
-
justify-content: space-between;
|
|
347
|
-
align-items: center;
|
|
348
|
-
height: 48px;
|
|
349
|
-
padding: 0 25px;
|
|
350
|
-
line-height: 48px;
|
|
351
|
-
display: flex;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.history-modal-container .history-modal-header .close-button {
|
|
355
|
-
justify-content: center;
|
|
356
|
-
align-items: center;
|
|
357
|
-
margin-right: -4px;
|
|
358
|
-
padding: 4px;
|
|
359
|
-
display: flex;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.history-modal-container .history-modal-header .close-button .anticon {
|
|
363
|
-
color: #999;
|
|
364
|
-
font-size: 18px;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
.history-modal-container .history-modal-header .close-button:hover .anticon {
|
|
368
|
-
color: #666;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
.history-modal-container .history-search-section {
|
|
372
|
-
background: #fff;
|
|
373
|
-
padding: 16px 20px;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.history-modal-container .history-search-section .search-input-wrapper {
|
|
377
|
-
color: rgba(0, 0, 0, .25);
|
|
378
|
-
align-items: center;
|
|
379
|
-
gap: 12px;
|
|
380
|
-
display: flex;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
.history-modal-container .history-search-section .search-input-wrapper .search-input {
|
|
384
|
-
background: #f1f2f3;
|
|
385
|
-
border: none;
|
|
386
|
-
border-radius: 16px;
|
|
387
|
-
flex: 1;
|
|
388
|
-
height: 36px;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
.history-modal-container .history-search-section .search-input-wrapper .search-input .ant-input {
|
|
392
|
-
box-shadow: none;
|
|
393
|
-
background: none;
|
|
394
|
-
border: none;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
.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 {
|
|
398
|
-
background: #fff;
|
|
399
|
-
border-color: #d9d9d9;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
.history-modal-container .history-search-section .search-input-wrapper .clear-button {
|
|
403
|
-
color: #1890ff;
|
|
404
|
-
height: auto;
|
|
405
|
-
padding: 0;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
.history-modal-container .history-search-section .search-input-wrapper .clear-button:hover {
|
|
409
|
-
color: #40a9ff;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
.history-modal-container .history-content {
|
|
413
|
-
flex: 1;
|
|
414
|
-
padding: 0 25px 25px;
|
|
415
|
-
overflow-y: auto;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
.history-modal-container .history-content .history-group {
|
|
419
|
-
margin-bottom: 10px;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
.history-modal-container .history-content .history-group .history-group-title {
|
|
423
|
-
color: rgba(0, 0, 0, .45);
|
|
424
|
-
height: 40px;
|
|
425
|
-
font-size: 12px;
|
|
426
|
-
font-weight: 400;
|
|
427
|
-
line-height: 40px;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
.history-modal-container .history-content .history-group .history-item {
|
|
431
|
-
cursor: pointer;
|
|
432
|
-
color: rgba(0, 0, 0, .85);
|
|
433
|
-
white-space: nowrap;
|
|
434
|
-
text-overflow: ellipsis;
|
|
435
|
-
height: 40px;
|
|
436
|
-
font-size: 14px;
|
|
437
|
-
line-height: 40px;
|
|
438
|
-
overflow: hidden;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.history-modal-container .history-content .history-group .history-item:hover {
|
|
442
|
-
background: #f2f4f7;
|
|
443
|
-
margin: 0 -8px;
|
|
444
|
-
padding: 0 8px;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
.history-modal-container .history-content .no-results {
|
|
448
|
-
text-align: center;
|
|
449
|
-
color: #999;
|
|
450
|
-
padding: 40px 20px;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
.ant-modal-wrap .ant-modal-content {
|
|
454
|
-
animation: .3s cubic-bezier(.4, 0, .2, 1) forwards slideUpFromBottom !important;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
@keyframes slideUpFromBottom {
|
|
458
|
-
0% {
|
|
459
|
-
opacity: 0;
|
|
460
|
-
transform: translateY(100%);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
100% {
|
|
464
|
-
opacity: 1;
|
|
465
|
-
transform: translateY(0);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
.result-wrapper {
|
|
470
|
-
justify-content: center;
|
|
471
|
-
height: 100%;
|
|
472
|
-
margin: 4px 0;
|
|
473
|
-
display: flex;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.result-wrapper .loading-container {
|
|
477
|
-
text-align: center;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
.result-wrapper .loading-container .loading-progress-text {
|
|
481
|
-
color: #888;
|
|
482
|
-
margin-top: 8px;
|
|
483
|
-
font-size: 12px;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
.result-wrapper pre {
|
|
487
|
-
white-space: pre-wrap;
|
|
488
|
-
text-wrap: unset;
|
|
489
|
-
word-wrap: break-word;
|
|
490
|
-
overflow-wrap: break-word;
|
|
491
|
-
background: #f2f4f7;
|
|
492
|
-
border-radius: 8px;
|
|
366
|
+
body {
|
|
493
367
|
margin: 0;
|
|
494
|
-
|
|
495
|
-
|
|
368
|
+
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
|
|
369
|
+
font-size: 14px;
|
|
496
370
|
}
|
|
497
371
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ContextPreview } from "../context-preview/index.mjs";
|
|
2
|
+
import { PlaygroundResultView } from "../playground-result/index.mjs";
|
|
3
|
+
import { PromptInput } from "../prompt-input/index.mjs";
|
|
4
|
+
import { useServerValid } from "../../hooks/useServerValid.mjs";
|
|
5
|
+
import { ServiceModeControl } from "../service-mode-control/index.mjs";
|
|
6
|
+
import { useEnvConfig } from "../../store/store.mjs";
|
|
7
|
+
export * from "../../types.mjs";
|
|
8
|
+
export { ContextPreview, PlaygroundResultView, PromptInput, ServiceModeControl, useEnvConfig, useServerValid };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.result-wrapper {
|
|
2
|
+
justify-content: center;
|
|
3
|
+
align-items: center;
|
|
4
|
+
height: 100%;
|
|
5
|
+
margin: 4px 0;
|
|
6
|
+
display: flex;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.result-wrapper .loading-container {
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.result-wrapper .loading-container .loading-progress-text {
|
|
19
|
+
color: #888;
|
|
20
|
+
margin-top: 8px;
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.result-wrapper pre {
|
|
25
|
+
white-space: pre-wrap;
|
|
26
|
+
text-wrap: unset;
|
|
27
|
+
word-wrap: break-word;
|
|
28
|
+
overflow-wrap: break-word;
|
|
29
|
+
background: #f2f4f7;
|
|
30
|
+
border-radius: 8px;
|
|
31
|
+
margin: 0;
|
|
32
|
+
padding: 14px;
|
|
33
|
+
overflow: scroll;
|
|
34
|
+
}
|
|
35
|
+
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { LoadingOutlined } from "@ant-design/icons";
|
|
3
3
|
import { Spin } from "antd";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import "./index.css";
|
|
4
|
+
import { emptyResultTip, serverLaunchTip } from "../misc/index.mjs";
|
|
5
|
+
import { Player } from "../player/index.mjs";
|
|
6
|
+
import shiny_text from "../shiny-text/index.mjs";
|
|
8
7
|
const PlaygroundResultView = (param)=>{
|
|
9
8
|
let { result, loading, serverValid, serviceMode, replayScriptsInfo, replayCounter, loadingProgressText, verticalMode = false, notReadyMessage, fitMode, autoZoom } = param;
|
|
10
9
|
let resultWrapperClassName = 'result-wrapper';
|
|
@@ -53,7 +52,10 @@ const PlaygroundResultView = (param)=>{
|
|
|
53
52
|
height: '100%',
|
|
54
53
|
display: 'flex',
|
|
55
54
|
flexDirection: 'column',
|
|
56
|
-
flex: '1 1 auto'
|
|
55
|
+
flex: '1 1 auto',
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
textAlign: 'center'
|
|
57
59
|
},
|
|
58
60
|
children: resultDataToShow
|
|
59
61
|
});
|