@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
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
.prompt-input-wrapper {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.prompt-input-wrapper .mode-radio-group-wrapper {
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
align-items: center;
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group {
|
|
12
|
+
align-items: center;
|
|
13
|
+
height: 100%;
|
|
14
|
+
display: flex;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .ant-radio-button-wrapper {
|
|
18
|
+
height: 24px;
|
|
19
|
+
box-shadow: none;
|
|
20
|
+
background-color: #f7f7f7;
|
|
21
|
+
border: none;
|
|
22
|
+
border-radius: 11px;
|
|
23
|
+
margin-right: 8px;
|
|
24
|
+
padding: 0 8px;
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
line-height: 24px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .ant-radio-button-wrapper:before {
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .ant-radio-button-wrapper:focus-within {
|
|
34
|
+
outline: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .ant-radio-button-wrapper.ant-radio-button-wrapper-checked {
|
|
38
|
+
color: #fff;
|
|
39
|
+
background-color: #2b83ff;
|
|
40
|
+
border-color: #2b83ff;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .ant-radio-button-wrapper.ant-radio-button-wrapper-checked:hover {
|
|
44
|
+
color: #fff;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .more-apis-button {
|
|
48
|
+
height: 24px;
|
|
49
|
+
box-shadow: none;
|
|
50
|
+
background-color: #f7f7f7;
|
|
51
|
+
border: none;
|
|
52
|
+
border-radius: 11px;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: 2px;
|
|
55
|
+
max-width: 160px;
|
|
56
|
+
padding: 0 8px;
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .more-apis-button .ant-btn-content {
|
|
62
|
+
text-overflow: ellipsis;
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .more-apis-button:hover {
|
|
68
|
+
background-color: #e6e6e6;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .more-apis-button.selected-from-dropdown {
|
|
72
|
+
color: #fff;
|
|
73
|
+
background-color: #2b83ff;
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .mode-radio-group .more-apis-button.selected-from-dropdown:hover {
|
|
78
|
+
background-color: #2b83ff;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.prompt-input-wrapper .mode-radio-group-wrapper .action-icons {
|
|
82
|
+
align-items: center;
|
|
83
|
+
display: flex;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.prompt-input-wrapper .main-side-console-input {
|
|
87
|
+
margin-top: 10px;
|
|
88
|
+
position: relative;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea {
|
|
92
|
+
white-space: pre-wrap;
|
|
93
|
+
scrollbar-width: thin;
|
|
94
|
+
background: #fff;
|
|
95
|
+
border: 1px solid #f2f4f7;
|
|
96
|
+
border-radius: 12px;
|
|
97
|
+
padding: 12px 16px;
|
|
98
|
+
line-height: 21px;
|
|
99
|
+
transition: background-color .2s;
|
|
100
|
+
overflow-y: auto;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@keyframes hue-shift {
|
|
104
|
+
0% {
|
|
105
|
+
filter: hue-rotate();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
100% {
|
|
109
|
+
filter: hue-rotate(360deg);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea:focus-within {
|
|
114
|
+
background: linear-gradient(#fff, #fff) padding-box padding-box, linear-gradient(135deg, #4285f4 0%, #06f 25%, #7b02c5 50%, #ea4335 75%, #ff7043 100%) border-box;
|
|
115
|
+
border: 1px solid rgba(0, 0, 0, 0);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea::-webkit-scrollbar {
|
|
119
|
+
width: 6px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.prompt-input-wrapper .main-side-console-input .main-side-console-input-textarea::-webkit-scrollbar-thumb {
|
|
123
|
+
background-color: rgba(0, 0, 0, .2);
|
|
124
|
+
border-radius: 3px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.prompt-input-wrapper .main-side-console-input.loading .main-side-console-input-textarea {
|
|
128
|
+
background: linear-gradient(#fff, #fff) padding-box padding-box, linear-gradient(135deg, #4285f4 0%, #06f 25%, #7b02c5 50%, #ea4335 75%, #ff7043 100%) border-box;
|
|
129
|
+
border: 1px solid rgba(0, 0, 0, 0);
|
|
130
|
+
animation: 5s linear infinite hue-shift;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.prompt-input-wrapper .main-side-console-input .ant-form-item-control-input-content {
|
|
134
|
+
z-index: 999;
|
|
135
|
+
border: 3px solid rgba(0, 0, 0, 0);
|
|
136
|
+
border-radius: 14px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.prompt-input-wrapper .main-side-console-input:focus-within .ant-form-item-control-input-content {
|
|
140
|
+
border-color: rgba(43, 131, 255, .16);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.prompt-input-wrapper .main-side-console-input.disabled .form-controller-wrapper {
|
|
144
|
+
background-color: rgba(0, 0, 0, 0);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.prompt-input-wrapper .ant-form-item-with-help + .form-controller-wrapper {
|
|
148
|
+
bottom: 22px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.prompt-input-wrapper .ant-input {
|
|
152
|
+
padding-bottom: 40px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.prompt-input-wrapper .form-controller-wrapper {
|
|
156
|
+
box-sizing: border-box;
|
|
157
|
+
background-color: #fff;
|
|
158
|
+
flex-direction: row;
|
|
159
|
+
justify-content: flex-end;
|
|
160
|
+
align-items: flex-end;
|
|
161
|
+
gap: 8px;
|
|
162
|
+
width: calc(100% - 32px);
|
|
163
|
+
padding: 12px 0;
|
|
164
|
+
line-height: 32px;
|
|
165
|
+
transition: background-color .2s;
|
|
166
|
+
display: flex;
|
|
167
|
+
position: absolute;
|
|
168
|
+
bottom: 1px;
|
|
169
|
+
left: 16px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.prompt-input-wrapper .settings-wrapper {
|
|
173
|
+
color: #777;
|
|
174
|
+
flex-flow: wrap;
|
|
175
|
+
gap: 2px;
|
|
176
|
+
display: flex;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.prompt-input-wrapper .settings-wrapper.settings-wrapper-hover {
|
|
180
|
+
color: #3b3b3b;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.prompt-input-wrapper .structured-params-container {
|
|
184
|
+
background: linear-gradient(#fff, #fff) padding-box padding-box, linear-gradient(135deg, #4285f4 0%, #06f 25%, #7b02c5 50%, #ea4335 75%, #ff7043 100%) border-box;
|
|
185
|
+
border: 1px solid rgba(0, 0, 0, 0);
|
|
186
|
+
border-radius: 12px;
|
|
187
|
+
padding: 16px 16px 56px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item {
|
|
191
|
+
flex-direction: column;
|
|
192
|
+
display: flex;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-label {
|
|
196
|
+
text-align: left;
|
|
197
|
+
flex-basis: auto;
|
|
198
|
+
padding-bottom: 4px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-label > label {
|
|
202
|
+
color: rgba(0, 0, 0, .85);
|
|
203
|
+
height: auto;
|
|
204
|
+
font-size: 12px;
|
|
205
|
+
font-weight: 500;
|
|
206
|
+
line-height: 1.5;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-label > label:after {
|
|
210
|
+
color: #ff4d4f;
|
|
211
|
+
font-family: SimSun, sans-serif;
|
|
212
|
+
font-size: 12px;
|
|
213
|
+
line-height: 1;
|
|
214
|
+
display: inline-block;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-label > label:not(:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))):after {
|
|
218
|
+
margin-left: 4px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-label > label:not(:-moz-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))):after {
|
|
222
|
+
margin-left: 4px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-label > label:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))):after {
|
|
226
|
+
margin-left: 4px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-label > label:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)):after {
|
|
230
|
+
margin-right: 4px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-label > label:-moz-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)):after {
|
|
234
|
+
margin-right: 4px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-label > label:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)):after {
|
|
238
|
+
margin-right: 4px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-control {
|
|
242
|
+
flex: 1;
|
|
243
|
+
margin-top: 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-row {
|
|
247
|
+
flex-direction: column;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-form-item .ant-form-item-control-input {
|
|
251
|
+
min-height: auto;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-input, .prompt-input-wrapper .structured-params-container .structured-params .ant-input-number, .prompt-input-wrapper .structured-params-container .structured-params .ant-select {
|
|
255
|
+
border: 1px solid #e1e5e9;
|
|
256
|
+
border-radius: 6px;
|
|
257
|
+
width: 100%;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-input:hover, .prompt-input-wrapper .structured-params-container .structured-params .ant-input-number:hover, .prompt-input-wrapper .structured-params-container .structured-params .ant-select:hover {
|
|
261
|
+
border-color: #40a9ff;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-input:focus, .prompt-input-wrapper .structured-params-container .structured-params .ant-input-number:focus, .prompt-input-wrapper .structured-params-container .structured-params .ant-select:focus, .prompt-input-wrapper .structured-params-container .structured-params .ant-input:focus-within, .prompt-input-wrapper .structured-params-container .structured-params .ant-input-number:focus-within, .prompt-input-wrapper .structured-params-container .structured-params .ant-select:focus-within {
|
|
265
|
+
border-color: #40a9ff;
|
|
266
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, .2);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.prompt-input-wrapper .structured-params-container .structured-params textarea.ant-input {
|
|
270
|
+
padding-bottom: 5px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-input-number .ant-input-number-input {
|
|
274
|
+
box-shadow: none;
|
|
275
|
+
border: none;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-input-number:hover .ant-input-number-input {
|
|
279
|
+
box-shadow: none;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-select {
|
|
283
|
+
min-width: 120px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-select .ant-select-selector {
|
|
287
|
+
box-shadow: none;
|
|
288
|
+
border: none;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-select:hover .ant-select-selector, .prompt-input-wrapper .structured-params-container .structured-params .ant-select.ant-select-focused .ant-select-selector {
|
|
292
|
+
box-shadow: none;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-radio-group {
|
|
296
|
+
width: 100%;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-radio-group .ant-radio-button-wrapper {
|
|
300
|
+
border: 1px solid #e1e5e9;
|
|
301
|
+
border-radius: 6px;
|
|
302
|
+
height: 32px;
|
|
303
|
+
margin-right: 4px;
|
|
304
|
+
font-size: 12px;
|
|
305
|
+
line-height: 30px;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.prompt-input-wrapper .structured-params-container .structured-params .ant-radio-group .ant-radio-button-wrapper.ant-radio-button-wrapper-checked {
|
|
309
|
+
color: #fff;
|
|
310
|
+
background-color: #2b83ff;
|
|
311
|
+
border-color: #2b83ff;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.selector-trigger {
|
|
315
|
+
cursor: pointer;
|
|
316
|
+
width: 24px;
|
|
317
|
+
height: 24px;
|
|
318
|
+
transition: all .2s;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.selector-trigger .action-icon {
|
|
322
|
+
color: rgba(0, 0, 0, .85);
|
|
323
|
+
font-size: 14px;
|
|
324
|
+
transition: all .2s;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.selector-trigger .action-icon:hover {
|
|
328
|
+
color: #2b83ff;
|
|
329
|
+
}
|
|
330
|
+
|
|
@@ -37,23 +37,23 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37
37
|
});
|
|
38
38
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
39
|
const icons_namespaceObject = require("@ant-design/icons");
|
|
40
|
+
require("./index.css");
|
|
40
41
|
const external_antd_namespaceObject = require("antd");
|
|
41
42
|
const external_react_namespaceObject = require("react");
|
|
42
43
|
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
43
|
-
const history_js_namespaceObject = require("
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
require("./index.css");
|
|
44
|
+
const history_js_namespaceObject = require("../../store/history.js");
|
|
45
|
+
const external_types_js_namespaceObject = require("../../types.js");
|
|
46
|
+
const constants_js_namespaceObject = require("../../utils/constants.js");
|
|
47
|
+
const playground_utils_js_namespaceObject = require("../../utils/playground-utils.js");
|
|
48
|
+
const index_js_namespaceObject = require("../config-selector/index.js");
|
|
49
|
+
const external_form_field_index_js_namespaceObject = require("../form-field/index.js");
|
|
50
|
+
const external_history_selector_index_js_namespaceObject = require("../history-selector/index.js");
|
|
51
51
|
const { TextArea } = external_antd_namespaceObject.Input;
|
|
52
52
|
const PromptInput = (param)=>{
|
|
53
53
|
let { runButtonEnabled, form, serviceMode, selectedType, dryMode, stoppable, loading, onRun, onStop, clearPromptAfterRun = true, actionSpace, hideDomAndScreenshotOptions = false } = param;
|
|
54
54
|
const [hoveringSettings, setHoveringSettings] = (0, external_react_namespaceObject.useState)(false);
|
|
55
55
|
const [promptValue, setPromptValue] = (0, external_react_namespaceObject.useState)('');
|
|
56
|
-
const placeholder = (0,
|
|
56
|
+
const placeholder = (0, playground_utils_js_namespaceObject.getPlaceholderForType)(selectedType);
|
|
57
57
|
const textAreaRef = (0, external_react_namespaceObject.useRef)(null);
|
|
58
58
|
const params = external_antd_namespaceObject.Form.useWatch('params', form);
|
|
59
59
|
const lastHistoryRef = (0, external_react_namespaceObject.useRef)(null);
|
|
@@ -149,12 +149,12 @@ const PromptInput = (param)=>{
|
|
|
149
149
|
hideDomAndScreenshotOptions
|
|
150
150
|
]);
|
|
151
151
|
const availableDropdownMethods = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
152
|
-
const metadataMethods = Object.keys(
|
|
152
|
+
const metadataMethods = Object.keys(constants_js_namespaceObject.apiMetadata);
|
|
153
153
|
if (!actionSpace || 0 === actionSpace.length) return metadataMethods;
|
|
154
154
|
const availableMethods = actionSpace.map((action)=>action.interfaceAlias || action.name);
|
|
155
155
|
const finalMethods = new Set();
|
|
156
156
|
metadataMethods.forEach((method)=>{
|
|
157
|
-
const methodInfo =
|
|
157
|
+
const methodInfo = constants_js_namespaceObject.apiMetadata[method];
|
|
158
158
|
if ((null == methodInfo ? void 0 : methodInfo.group) === 'extraction' || (null == methodInfo ? void 0 : methodInfo.group) === 'validation') finalMethods.add(method);
|
|
159
159
|
else if (availableMethods.includes(method)) finalMethods.add(method);
|
|
160
160
|
});
|
|
@@ -259,7 +259,7 @@ const PromptInput = (param)=>{
|
|
|
259
259
|
needsStructuredParams,
|
|
260
260
|
actionSpace
|
|
261
261
|
]);
|
|
262
|
-
const isRunButtonEnabled = (0, external_react_namespaceObject.useMemo)(()=>(0,
|
|
262
|
+
const isRunButtonEnabled = (0, external_react_namespaceObject.useMemo)(()=>(0, playground_utils_js_namespaceObject.isRunButtonEnabled)(runButtonEnabled, !!needsStructuredParams, params, actionSpace, selectedType, promptValue), [
|
|
263
263
|
runButtonEnabled,
|
|
264
264
|
needsStructuredParams,
|
|
265
265
|
selectedType,
|
|
@@ -443,19 +443,19 @@ const PromptInput = (param)=>{
|
|
|
443
443
|
marginBottom,
|
|
444
444
|
placeholder
|
|
445
445
|
};
|
|
446
|
-
if (isLocateFieldFlag) fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
446
|
+
if (isLocateFieldFlag) fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_index_js_namespaceObject.LocateField, {
|
|
447
447
|
...fieldProps
|
|
448
448
|
}, key));
|
|
449
|
-
else if ((null == (_actualField__def = actualField._def) ? void 0 : _actualField__def.typeName) === 'ZodEnum') fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
449
|
+
else if ((null == (_actualField__def = actualField._def) ? void 0 : _actualField__def.typeName) === 'ZodEnum') fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_index_js_namespaceObject.EnumField, {
|
|
450
450
|
...fieldProps
|
|
451
451
|
}, key));
|
|
452
|
-
else if ((null == (_actualField__def1 = actualField._def) ? void 0 : _actualField__def1.typeName) === 'ZodNumber') fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
452
|
+
else if ((null == (_actualField__def1 = actualField._def) ? void 0 : _actualField__def1.typeName) === 'ZodNumber') fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_index_js_namespaceObject.NumberField, {
|
|
453
453
|
...fieldProps
|
|
454
454
|
}, key));
|
|
455
|
-
else if ((null == (_actualField__def2 = actualField._def) ? void 0 : _actualField__def2.typeName) === 'ZodBoolean') fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
455
|
+
else if ((null == (_actualField__def2 = actualField._def) ? void 0 : _actualField__def2.typeName) === 'ZodBoolean') fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_index_js_namespaceObject.BooleanField, {
|
|
456
456
|
...fieldProps
|
|
457
457
|
}, key));
|
|
458
|
-
else fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
458
|
+
else fields.push(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_index_js_namespaceObject.TextField, {
|
|
459
459
|
...fieldProps
|
|
460
460
|
}, key));
|
|
461
461
|
});
|
|
@@ -553,13 +553,13 @@ const PromptInput = (param)=>{
|
|
|
553
553
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio.Group, {
|
|
554
554
|
buttonStyle: "solid",
|
|
555
555
|
disabled: !runButtonEnabled,
|
|
556
|
-
children:
|
|
556
|
+
children: constants_js_namespaceObject.defaultMainButtons.map((apiType)=>{
|
|
557
557
|
var _apiMetadata_apiType;
|
|
558
558
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Tooltip, {
|
|
559
|
-
title: (null == (_apiMetadata_apiType =
|
|
559
|
+
title: (null == (_apiMetadata_apiType = constants_js_namespaceObject.apiMetadata[apiType]) ? void 0 : _apiMetadata_apiType.title) || '',
|
|
560
560
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio.Button, {
|
|
561
561
|
value: apiType,
|
|
562
|
-
children: (0,
|
|
562
|
+
children: (0, playground_utils_js_namespaceObject.actionNameForType)(apiType)
|
|
563
563
|
})
|
|
564
564
|
}, apiType);
|
|
565
565
|
})
|
|
@@ -567,11 +567,11 @@ const PromptInput = (param)=>{
|
|
|
567
567
|
}),
|
|
568
568
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Dropdown, {
|
|
569
569
|
menu: (()=>{
|
|
570
|
-
const hiddenAPIs = availableDropdownMethods.filter((api)=>!
|
|
570
|
+
const hiddenAPIs = availableDropdownMethods.filter((api)=>!constants_js_namespaceObject.defaultMainButtons.includes(api));
|
|
571
571
|
const groupedItems = [];
|
|
572
572
|
const interactionAPIs = hiddenAPIs.filter((api)=>{
|
|
573
573
|
var _apiMetadata_api;
|
|
574
|
-
return (null == (_apiMetadata_api =
|
|
574
|
+
return (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.group) === 'interaction';
|
|
575
575
|
});
|
|
576
576
|
if (interactionAPIs.length > 0) groupedItems.push({
|
|
577
577
|
key: 'interaction-group',
|
|
@@ -581,8 +581,8 @@ const PromptInput = (param)=>{
|
|
|
581
581
|
var _apiMetadata_api;
|
|
582
582
|
return {
|
|
583
583
|
key: api,
|
|
584
|
-
label: (0,
|
|
585
|
-
title: (null == (_apiMetadata_api =
|
|
584
|
+
label: (0, playground_utils_js_namespaceObject.actionNameForType)(api),
|
|
585
|
+
title: (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.title) || '',
|
|
586
586
|
onClick: ()=>{
|
|
587
587
|
form.setFieldValue('type', api);
|
|
588
588
|
}
|
|
@@ -591,7 +591,7 @@ const PromptInput = (param)=>{
|
|
|
591
591
|
});
|
|
592
592
|
const extractionAPIs = hiddenAPIs.filter((api)=>{
|
|
593
593
|
var _apiMetadata_api;
|
|
594
|
-
return (null == (_apiMetadata_api =
|
|
594
|
+
return (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.group) === 'extraction';
|
|
595
595
|
});
|
|
596
596
|
if (extractionAPIs.length > 0) groupedItems.push({
|
|
597
597
|
key: 'extraction-group',
|
|
@@ -601,8 +601,8 @@ const PromptInput = (param)=>{
|
|
|
601
601
|
var _apiMetadata_api;
|
|
602
602
|
return {
|
|
603
603
|
key: api,
|
|
604
|
-
label: (0,
|
|
605
|
-
title: (null == (_apiMetadata_api =
|
|
604
|
+
label: (0, playground_utils_js_namespaceObject.actionNameForType)(api),
|
|
605
|
+
title: (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.title) || '',
|
|
606
606
|
onClick: ()=>{
|
|
607
607
|
form.setFieldValue('type', api);
|
|
608
608
|
}
|
|
@@ -611,7 +611,7 @@ const PromptInput = (param)=>{
|
|
|
611
611
|
});
|
|
612
612
|
const validationAPIs = hiddenAPIs.filter((api)=>{
|
|
613
613
|
var _apiMetadata_api;
|
|
614
|
-
return (null == (_apiMetadata_api =
|
|
614
|
+
return (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.group) === 'validation';
|
|
615
615
|
});
|
|
616
616
|
if (validationAPIs.length > 0) groupedItems.push({
|
|
617
617
|
key: 'validation-group',
|
|
@@ -621,22 +621,22 @@ const PromptInput = (param)=>{
|
|
|
621
621
|
var _apiMetadata_api;
|
|
622
622
|
return {
|
|
623
623
|
key: api,
|
|
624
|
-
label: (0,
|
|
625
|
-
title: (null == (_apiMetadata_api =
|
|
624
|
+
label: (0, playground_utils_js_namespaceObject.actionNameForType)(api),
|
|
625
|
+
title: (null == (_apiMetadata_api = constants_js_namespaceObject.apiMetadata[api]) ? void 0 : _apiMetadata_api.title) || '',
|
|
626
626
|
onClick: ()=>{
|
|
627
627
|
form.setFieldValue('type', api);
|
|
628
628
|
}
|
|
629
629
|
};
|
|
630
630
|
})
|
|
631
631
|
});
|
|
632
|
-
const deviceSpecificAPIs = hiddenAPIs.filter((api)=>!
|
|
632
|
+
const deviceSpecificAPIs = hiddenAPIs.filter((api)=>!constants_js_namespaceObject.apiMetadata[api]);
|
|
633
633
|
if (deviceSpecificAPIs.length > 0) groupedItems.push({
|
|
634
634
|
key: 'device-specific-group',
|
|
635
635
|
type: 'group',
|
|
636
636
|
label: 'Device-Specific APIs',
|
|
637
637
|
children: deviceSpecificAPIs.map((api)=>({
|
|
638
638
|
key: api,
|
|
639
|
-
label: (0,
|
|
639
|
+
label: (0, playground_utils_js_namespaceObject.actionNameForType)(api),
|
|
640
640
|
title: '',
|
|
641
641
|
onClick: ()=>{
|
|
642
642
|
form.setFieldValue('type', api);
|
|
@@ -653,9 +653,9 @@ const PromptInput = (param)=>{
|
|
|
653
653
|
],
|
|
654
654
|
disabled: !runButtonEnabled,
|
|
655
655
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Button, {
|
|
656
|
-
className: `more-apis-button ${!
|
|
656
|
+
className: `more-apis-button ${!constants_js_namespaceObject.defaultMainButtons.includes(selectedType) ? 'selected-from-dropdown' : ''}`,
|
|
657
657
|
children: [
|
|
658
|
-
selectedType && !
|
|
658
|
+
selectedType && !constants_js_namespaceObject.defaultMainButtons.includes(selectedType) ? (0, playground_utils_js_namespaceObject.actionNameForType)(selectedType) : 'more',
|
|
659
659
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.DownOutlined, {
|
|
660
660
|
style: {
|
|
661
661
|
fontSize: '10px',
|
|
@@ -670,7 +670,7 @@ const PromptInput = (param)=>{
|
|
|
670
670
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
671
671
|
className: "action-icons",
|
|
672
672
|
children: [
|
|
673
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
673
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_history_selector_index_js_namespaceObject.HistorySelector, {
|
|
674
674
|
onSelect: handleSelectHistory,
|
|
675
675
|
history: historyForSelectedType,
|
|
676
676
|
currentType: selectedType
|
|
@@ -679,7 +679,7 @@ const PromptInput = (param)=>{
|
|
|
679
679
|
className: hoveringSettings ? 'settings-wrapper settings-wrapper-hover' : 'settings-wrapper',
|
|
680
680
|
onMouseEnter: handleMouseEnter,
|
|
681
681
|
onMouseLeave: handleMouseLeave,
|
|
682
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
682
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.ConfigSelector, {
|
|
683
683
|
enableTracking: 'In-Browser-Extension' === serviceMode,
|
|
684
684
|
showDeepThinkOption: showDeepThinkOption,
|
|
685
685
|
showDataExtractionOptions: showDataExtractionOptions,
|
|
@@ -721,7 +721,7 @@ const PromptInput = (param)=>{
|
|
|
721
721
|
},
|
|
722
722
|
children: [
|
|
723
723
|
'Click "Run" to execute ',
|
|
724
|
-
(0,
|
|
724
|
+
(0, playground_utils_js_namespaceObject.actionNameForType)(selectedType)
|
|
725
725
|
]
|
|
726
726
|
}),
|
|
727
727
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
package/dist/lib/component/{playground/ServiceModeControl.js → service-mode-control/index.js}
RENAMED
|
@@ -31,11 +31,10 @@ const playground_namespaceObject = require("@midscene/playground");
|
|
|
31
31
|
const env_namespaceObject = require("@midscene/shared/env");
|
|
32
32
|
const external_antd_namespaceObject = require("antd");
|
|
33
33
|
const external_react_namespaceObject = require("react");
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
require("./index.css");
|
|
34
|
+
const useServerValid_js_namespaceObject = require("../../hooks/useServerValid.js");
|
|
35
|
+
const store_js_namespaceObject = require("../../store/store.js");
|
|
36
|
+
const index_js_namespaceObject = require("../env-config/index.js");
|
|
37
|
+
const external_misc_index_js_namespaceObject = require("../misc/index.js");
|
|
39
38
|
const TITLE_TEXT = {
|
|
40
39
|
Server: 'Server Status',
|
|
41
40
|
'In-Browser': 'In-Browser'
|
|
@@ -47,20 +46,20 @@ const SWITCH_BUTTON_TEXT = {
|
|
|
47
46
|
const ServiceModeControl = (param)=>{
|
|
48
47
|
let { serviceMode } = param;
|
|
49
48
|
const { setServiceMode, config } = (0, store_js_namespaceObject.useEnvConfig)();
|
|
50
|
-
const serverValid = (0,
|
|
49
|
+
const serverValid = (0, useServerValid_js_namespaceObject.useServerValid)('Server' === serviceMode);
|
|
51
50
|
const renderServerTip = ()=>{
|
|
52
51
|
if (serverValid) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Tooltip, {
|
|
53
52
|
title: "Connected",
|
|
54
53
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
55
54
|
className: "server-tip",
|
|
56
|
-
children: (0,
|
|
55
|
+
children: (0, external_misc_index_js_namespaceObject.iconForStatus)('connected')
|
|
57
56
|
})
|
|
58
57
|
});
|
|
59
58
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Tooltip, {
|
|
60
59
|
title: "Connection failed",
|
|
61
60
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
62
61
|
className: "server-tip",
|
|
63
|
-
children: (0,
|
|
62
|
+
children: (0, external_misc_index_js_namespaceObject.iconForStatus)('failed')
|
|
64
63
|
})
|
|
65
64
|
});
|
|
66
65
|
};
|
|
@@ -119,7 +118,7 @@ const ServiceModeControl = (param)=>{
|
|
|
119
118
|
children: title
|
|
120
119
|
}),
|
|
121
120
|
statusContent,
|
|
122
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
121
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.EnvConfig, {
|
|
123
122
|
showTooltipWhenEmpty: 'Server' !== serviceMode
|
|
124
123
|
})
|
|
125
124
|
]
|
|
@@ -27,7 +27,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
default: ()=>shiny_text
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
require("./
|
|
30
|
+
require("./index.css");
|
|
31
31
|
const ShinyText = (param)=>{
|
|
32
32
|
let { text, disabled = false, speed = 5, className = '' } = param;
|
|
33
33
|
const style = {
|