@sqaitech/visualizer 0.5.0
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/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/es/assets/sqai-logo.mjs +2 -0
- package/dist/es/component/blackboard/index.css +33 -0
- package/dist/es/component/blackboard/index.mjs +278 -0
- package/dist/es/component/config-selector/index.mjs +104 -0
- package/dist/es/component/context-preview/index.mjs +38 -0
- package/dist/es/component/env-config/index.mjs +112 -0
- package/dist/es/component/env-config-reminder/index.css +22 -0
- package/dist/es/component/env-config-reminder/index.mjs +28 -0
- package/dist/es/component/form-field/index.mjs +163 -0
- package/dist/es/component/history-selector/index.css +135 -0
- package/dist/es/component/history-selector/index.mjs +170 -0
- package/dist/es/component/index.mjs +1 -0
- package/dist/es/component/logo/index.css +13 -0
- package/dist/es/component/logo/index.mjs +21 -0
- package/dist/es/component/misc/index.mjs +94 -0
- package/dist/es/component/nav-actions/index.mjs +32 -0
- package/dist/es/component/nav-actions/style.css +35 -0
- package/dist/es/component/player/index.css +185 -0
- package/dist/es/component/player/index.mjs +856 -0
- package/dist/es/component/playground/index.css +431 -0
- package/dist/es/component/playground/index.mjs +8 -0
- package/dist/es/component/playground/playground-demo-ui-context.json +290 -0
- package/dist/es/component/playground-result/index.css +34 -0
- package/dist/es/component/playground-result/index.mjs +62 -0
- package/dist/es/component/prompt-input/index.css +391 -0
- package/dist/es/component/prompt-input/index.mjs +730 -0
- package/dist/es/component/service-mode-control/index.mjs +105 -0
- package/dist/es/component/shiny-text/index.css +75 -0
- package/dist/es/component/shiny-text/index.mjs +15 -0
- package/dist/es/component/universal-playground/index.css +341 -0
- package/dist/es/component/universal-playground/index.mjs +302 -0
- package/dist/es/component/universal-playground/providers/context-provider.mjs +52 -0
- package/dist/es/component/universal-playground/providers/indexeddb-storage-provider.mjs +207 -0
- package/dist/es/component/universal-playground/providers/storage-provider.mjs +210 -0
- package/dist/es/hooks/usePlaygroundExecution.mjs +180 -0
- package/dist/es/hooks/usePlaygroundState.mjs +203 -0
- package/dist/es/hooks/useSafeOverrideAIConfig.mjs +24 -0
- package/dist/es/hooks/useServerValid.mjs +30 -0
- package/dist/es/icons/avatar.mjs +28 -0
- package/dist/es/icons/close.mjs +19 -0
- package/dist/es/icons/global-perspective.mjs +16 -0
- package/dist/es/icons/history.mjs +30 -0
- package/dist/es/icons/magnifying-glass.mjs +39 -0
- package/dist/es/icons/player-setting.mjs +26 -0
- package/dist/es/icons/setting.mjs +20 -0
- package/dist/es/icons/show-marker.mjs +16 -0
- package/dist/es/index.mjs +25 -0
- package/dist/es/static/image/sqai-logo.png +0 -0
- package/dist/es/store/history.mjs +89 -0
- package/dist/es/store/store.mjs +186 -0
- package/dist/es/types.mjs +70 -0
- package/dist/es/utils/color.mjs +35 -0
- package/dist/es/utils/constants.mjs +99 -0
- package/dist/es/utils/index.mjs +10 -0
- package/dist/es/utils/pixi-loader.mjs +16 -0
- package/dist/es/utils/playground-utils.mjs +67 -0
- package/dist/es/utils/replay-scripts.mjs +312 -0
- package/dist/lib/assets/sqai-logo.js +24 -0
- package/dist/lib/component/blackboard/index.css +33 -0
- package/dist/lib/component/blackboard/index.js +321 -0
- package/dist/lib/component/config-selector/index.js +148 -0
- package/dist/lib/component/context-preview/index.js +83 -0
- package/dist/lib/component/env-config/index.js +146 -0
- package/dist/lib/component/env-config-reminder/index.css +22 -0
- package/dist/lib/component/env-config-reminder/index.js +62 -0
- package/dist/lib/component/form-field/index.js +209 -0
- package/dist/lib/component/history-selector/index.css +135 -0
- package/dist/lib/component/history-selector/index.js +216 -0
- package/dist/lib/component/index.js +60 -0
- package/dist/lib/component/logo/index.css +13 -0
- package/dist/lib/component/logo/index.js +68 -0
- package/dist/lib/component/misc/index.js +150 -0
- package/dist/lib/component/nav-actions/index.js +66 -0
- package/dist/lib/component/nav-actions/style.css +35 -0
- package/dist/lib/component/player/index.css +185 -0
- package/dist/lib/component/player/index.js +902 -0
- package/dist/lib/component/playground/index.css +431 -0
- package/dist/lib/component/playground/index.js +113 -0
- package/dist/lib/component/playground/playground-demo-ui-context.json +290 -0
- package/dist/lib/component/playground-result/index.css +34 -0
- package/dist/lib/component/playground-result/index.js +106 -0
- package/dist/lib/component/prompt-input/index.css +391 -0
- package/dist/lib/component/prompt-input/index.js +774 -0
- package/dist/lib/component/service-mode-control/index.js +139 -0
- package/dist/lib/component/shiny-text/index.css +75 -0
- package/dist/lib/component/shiny-text/index.js +49 -0
- package/dist/lib/component/universal-playground/index.css +341 -0
- package/dist/lib/component/universal-playground/index.js +350 -0
- package/dist/lib/component/universal-playground/providers/context-provider.js +95 -0
- package/dist/lib/component/universal-playground/providers/indexeddb-storage-provider.js +247 -0
- package/dist/lib/component/universal-playground/providers/storage-provider.js +268 -0
- package/dist/lib/hooks/usePlaygroundExecution.js +214 -0
- package/dist/lib/hooks/usePlaygroundState.js +237 -0
- package/dist/lib/hooks/useSafeOverrideAIConfig.js +61 -0
- package/dist/lib/hooks/useServerValid.js +64 -0
- package/dist/lib/icons/avatar.js +62 -0
- package/dist/lib/icons/close.js +53 -0
- package/dist/lib/icons/global-perspective.js +50 -0
- package/dist/lib/icons/history.js +64 -0
- package/dist/lib/icons/magnifying-glass.js +73 -0
- package/dist/lib/icons/player-setting.js +60 -0
- package/dist/lib/icons/setting.js +54 -0
- package/dist/lib/icons/show-marker.js +50 -0
- package/dist/lib/index.js +187 -0
- package/dist/lib/static/image/sqai-logo.png +0 -0
- package/dist/lib/store/history.js +96 -0
- package/dist/lib/store/store.js +196 -0
- package/dist/lib/types.js +116 -0
- package/dist/lib/utils/color.js +75 -0
- package/dist/lib/utils/constants.js +154 -0
- package/dist/lib/utils/index.js +63 -0
- package/dist/lib/utils/pixi-loader.js +56 -0
- package/dist/lib/utils/playground-utils.js +110 -0
- package/dist/lib/utils/replay-scripts.js +355 -0
- package/dist/types/component/blackboard/index.d.ts +15 -0
- package/dist/types/component/config-selector/index.d.ts +9 -0
- package/dist/types/component/context-preview/index.d.ts +9 -0
- package/dist/types/component/env-config/index.d.ts +6 -0
- package/dist/types/component/env-config-reminder/index.d.ts +6 -0
- package/dist/types/component/form-field/index.d.ts +17 -0
- package/dist/types/component/history-selector/index.d.ts +10 -0
- package/dist/types/component/index.d.ts +1 -0
- package/dist/types/component/logo/index.d.ts +5 -0
- package/dist/types/component/misc/index.d.ts +6 -0
- package/dist/types/component/nav-actions/index.d.ts +10 -0
- package/dist/types/component/player/index.d.ts +13 -0
- package/dist/types/component/playground/index.d.ts +7 -0
- package/dist/types/component/playground-result/index.d.ts +20 -0
- package/dist/types/component/prompt-input/index.d.ts +22 -0
- package/dist/types/component/service-mode-control/index.d.ts +6 -0
- package/dist/types/component/shiny-text/index.d.ts +12 -0
- 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/indexeddb-storage-provider.d.ts +71 -0
- package/dist/types/component/universal-playground/providers/storage-provider.d.ts +58 -0
- package/dist/types/hooks/usePlaygroundExecution.d.ts +10 -0
- package/dist/types/hooks/usePlaygroundState.d.ts +26 -0
- package/dist/types/hooks/useSafeOverrideAIConfig.d.ts +16 -0
- package/dist/types/hooks/useServerValid.d.ts +1 -0
- package/dist/types/index.d.ts +27 -0
- package/dist/types/store/history.d.ts +16 -0
- package/dist/types/store/store.d.ts +36 -0
- package/dist/types/types.d.ts +161 -0
- package/dist/types/utils/color.d.ts +4 -0
- package/dist/types/utils/constants.d.ts +74 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/pixi-loader.d.ts +5 -0
- package/dist/types/utils/playground-utils.d.ts +6 -0
- package/dist/types/utils/replay-scripts.d.ts +34 -0
- package/package.json +85 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
HistorySelector: ()=>HistorySelector
|
|
37
|
+
});
|
|
38
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
|
+
const external_antd_namespaceObject = require("antd");
|
|
40
|
+
const external_react_namespaceObject = require("react");
|
|
41
|
+
const close_js_namespaceObject = require("../../icons/close.js");
|
|
42
|
+
var close_js_default = /*#__PURE__*/ __webpack_require__.n(close_js_namespaceObject);
|
|
43
|
+
const history_js_namespaceObject = require("../../icons/history.js");
|
|
44
|
+
var history_js_default = /*#__PURE__*/ __webpack_require__.n(history_js_namespaceObject);
|
|
45
|
+
const magnifying_glass_js_namespaceObject = require("../../icons/magnifying-glass.js");
|
|
46
|
+
var magnifying_glass_js_default = /*#__PURE__*/ __webpack_require__.n(magnifying_glass_js_namespaceObject);
|
|
47
|
+
const external_store_history_js_namespaceObject = require("../../store/history.js");
|
|
48
|
+
require("./index.css");
|
|
49
|
+
const { Text } = external_antd_namespaceObject.Typography;
|
|
50
|
+
const HistorySelector = (param)=>{
|
|
51
|
+
let { onSelect, history, currentType } = param;
|
|
52
|
+
const [isModalOpen, setIsModalOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
53
|
+
const [searchText, setSearchText] = (0, external_react_namespaceObject.useState)('');
|
|
54
|
+
const clearHistory = (0, external_store_history_js_namespaceObject.useHistoryStore)((state)=>state.clearHistory);
|
|
55
|
+
const modalRef = (0, external_react_namespaceObject.useRef)(null);
|
|
56
|
+
const groupedHistory = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
57
|
+
const now = Date.now();
|
|
58
|
+
const sevenDaysAgo = now - 604800000;
|
|
59
|
+
const oneYearAgo = now - 31536000000;
|
|
60
|
+
const filteredHistory = history.filter((item)=>item.prompt.toLowerCase().includes(searchText.toLowerCase()));
|
|
61
|
+
const groups = {
|
|
62
|
+
recent7Days: filteredHistory.filter((item)=>item.timestamp >= sevenDaysAgo),
|
|
63
|
+
recent1Year: filteredHistory.filter((item)=>item.timestamp < sevenDaysAgo && item.timestamp >= oneYearAgo),
|
|
64
|
+
older: filteredHistory.filter((item)=>item.timestamp < oneYearAgo)
|
|
65
|
+
};
|
|
66
|
+
return groups;
|
|
67
|
+
}, [
|
|
68
|
+
history,
|
|
69
|
+
searchText
|
|
70
|
+
]);
|
|
71
|
+
const handleHistoryClick = (item)=>{
|
|
72
|
+
onSelect(item);
|
|
73
|
+
setIsModalOpen(false);
|
|
74
|
+
};
|
|
75
|
+
const handleClearHistory = ()=>{
|
|
76
|
+
clearHistory(currentType);
|
|
77
|
+
setSearchText('');
|
|
78
|
+
setIsModalOpen(false);
|
|
79
|
+
};
|
|
80
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
81
|
+
if (!isModalOpen) return;
|
|
82
|
+
const handleClickOutside = (event)=>{
|
|
83
|
+
if (modalRef.current && !modalRef.current.contains(event.target)) setIsModalOpen(false);
|
|
84
|
+
};
|
|
85
|
+
const timer = setTimeout(()=>{
|
|
86
|
+
document.addEventListener('click', handleClickOutside);
|
|
87
|
+
}, 100);
|
|
88
|
+
return ()=>{
|
|
89
|
+
clearTimeout(timer);
|
|
90
|
+
document.removeEventListener('click', handleClickOutside);
|
|
91
|
+
};
|
|
92
|
+
}, [
|
|
93
|
+
isModalOpen
|
|
94
|
+
]);
|
|
95
|
+
const renderHistoryGroup = (title, items)=>{
|
|
96
|
+
if (0 === items.length) return null;
|
|
97
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
98
|
+
className: "history-group",
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
101
|
+
className: "history-group-title",
|
|
102
|
+
children: title
|
|
103
|
+
}),
|
|
104
|
+
items.map((item, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
105
|
+
className: "history-item",
|
|
106
|
+
onClick: ()=>handleHistoryClick(item),
|
|
107
|
+
children: item.prompt
|
|
108
|
+
}, `${item.timestamp}-${index}`))
|
|
109
|
+
]
|
|
110
|
+
}, title);
|
|
111
|
+
};
|
|
112
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
113
|
+
className: "history-selector-wrapper",
|
|
114
|
+
children: [
|
|
115
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
116
|
+
className: "selector-trigger",
|
|
117
|
+
onClick: ()=>setIsModalOpen(true),
|
|
118
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(history_js_default(), {
|
|
119
|
+
width: 24,
|
|
120
|
+
height: 24
|
|
121
|
+
})
|
|
122
|
+
}),
|
|
123
|
+
isModalOpen && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
124
|
+
className: "history-modal-overlay",
|
|
125
|
+
ref: modalRef,
|
|
126
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
127
|
+
className: "history-modal-container",
|
|
128
|
+
children: [
|
|
129
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
130
|
+
className: "history-modal-header",
|
|
131
|
+
children: [
|
|
132
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(Text, {
|
|
133
|
+
strong: true,
|
|
134
|
+
style: {
|
|
135
|
+
fontSize: '16px'
|
|
136
|
+
},
|
|
137
|
+
children: [
|
|
138
|
+
"History (",
|
|
139
|
+
history.length,
|
|
140
|
+
")"
|
|
141
|
+
]
|
|
142
|
+
}),
|
|
143
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
144
|
+
size: "small",
|
|
145
|
+
type: "text",
|
|
146
|
+
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(close_js_default(), {
|
|
147
|
+
width: 16,
|
|
148
|
+
height: 16
|
|
149
|
+
}),
|
|
150
|
+
onClick: ()=>setIsModalOpen(false),
|
|
151
|
+
className: "close-button"
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
156
|
+
className: "history-search-section",
|
|
157
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
158
|
+
className: "search-input-wrapper",
|
|
159
|
+
children: [
|
|
160
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Input, {
|
|
161
|
+
placeholder: "Search",
|
|
162
|
+
value: searchText,
|
|
163
|
+
onChange: (e)=>setSearchText(e.target.value),
|
|
164
|
+
prefix: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(magnifying_glass_js_default(), {
|
|
165
|
+
width: 18,
|
|
166
|
+
height: 18
|
|
167
|
+
}),
|
|
168
|
+
className: "search-input",
|
|
169
|
+
allowClear: true
|
|
170
|
+
}),
|
|
171
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
172
|
+
type: "link",
|
|
173
|
+
onClick: handleClearHistory,
|
|
174
|
+
className: "clear-button",
|
|
175
|
+
disabled: 0 === history.length,
|
|
176
|
+
children: "Clear"
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
})
|
|
180
|
+
}),
|
|
181
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
182
|
+
className: "history-content",
|
|
183
|
+
children: 0 === history.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
184
|
+
className: "no-results",
|
|
185
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Text, {
|
|
186
|
+
type: "secondary",
|
|
187
|
+
children: "No history record"
|
|
188
|
+
})
|
|
189
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
190
|
+
children: [
|
|
191
|
+
renderHistoryGroup('Last 7 days', groupedHistory.recent7Days),
|
|
192
|
+
renderHistoryGroup('Last 1 year', groupedHistory.recent1Year),
|
|
193
|
+
renderHistoryGroup('Earlier', groupedHistory.older),
|
|
194
|
+
searchText && 0 === groupedHistory.recent7Days.length && 0 === groupedHistory.recent1Year.length && 0 === groupedHistory.older.length && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
195
|
+
className: "no-results",
|
|
196
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Text, {
|
|
197
|
+
type: "secondary",
|
|
198
|
+
children: "No matching history record"
|
|
199
|
+
})
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
exports.HistorySelector = __webpack_exports__.HistorySelector;
|
|
211
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
212
|
+
"HistorySelector"
|
|
213
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
214
|
+
Object.defineProperty(exports, '__esModule', {
|
|
215
|
+
value: true
|
|
216
|
+
});
|
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
Logo: ()=>Logo,
|
|
37
|
+
LogoUrl: ()=>LogoUrl
|
|
38
|
+
});
|
|
39
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
40
|
+
require("./index.css");
|
|
41
|
+
const sqai_logo_js_namespaceObject = require("../../assets/sqai-logo.js");
|
|
42
|
+
var sqai_logo_js_default = /*#__PURE__*/ __webpack_require__.n(sqai_logo_js_namespaceObject);
|
|
43
|
+
const LogoUrl = sqai_logo_js_default();
|
|
44
|
+
const Logo = (param)=>{
|
|
45
|
+
let { hideLogo = false } = param;
|
|
46
|
+
if (hideLogo) return null;
|
|
47
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
48
|
+
className: "logo",
|
|
49
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("a", {
|
|
50
|
+
href: "https://sqai.tech",
|
|
51
|
+
target: "_blank",
|
|
52
|
+
rel: "noreferrer",
|
|
53
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
|
|
54
|
+
alt: "SQAI Logo",
|
|
55
|
+
src: sqai_logo_js_default()
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
exports.Logo = __webpack_exports__.Logo;
|
|
61
|
+
exports.LogoUrl = __webpack_exports__.LogoUrl;
|
|
62
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
63
|
+
"Logo",
|
|
64
|
+
"LogoUrl"
|
|
65
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
66
|
+
Object.defineProperty(exports, '__esModule', {
|
|
67
|
+
value: true
|
|
68
|
+
});
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
serverLaunchTip: ()=>serverLaunchTip,
|
|
37
|
+
errorMessageServerNotReady: ()=>errorMessageServerNotReady,
|
|
38
|
+
timeCostStrElement: ()=>timeCostStrElement,
|
|
39
|
+
iconForStatus: ()=>iconForStatus,
|
|
40
|
+
emptyResultTip: ()=>emptyResultTip
|
|
41
|
+
});
|
|
42
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
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);
|
|
47
|
+
function timeCostStrElement(timeCost) {
|
|
48
|
+
let str;
|
|
49
|
+
str = 'number' != typeof timeCost ? '-' : `${(timeCost / 1000).toFixed(2)}s`;
|
|
50
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
51
|
+
style: {
|
|
52
|
+
fontVariantNumeric: 'tabular-nums',
|
|
53
|
+
fontFeatureSettings: 'tnum'
|
|
54
|
+
},
|
|
55
|
+
children: str
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const iconForStatus = (status)=>{
|
|
59
|
+
switch(status){
|
|
60
|
+
case 'finished':
|
|
61
|
+
case 'passed':
|
|
62
|
+
case 'success':
|
|
63
|
+
case 'connected':
|
|
64
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
65
|
+
style: {
|
|
66
|
+
color: '#00AD4B'
|
|
67
|
+
},
|
|
68
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.CheckOutlined, {})
|
|
69
|
+
});
|
|
70
|
+
case 'finishedWithWarning':
|
|
71
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
72
|
+
style: {
|
|
73
|
+
color: '#f7bb05'
|
|
74
|
+
},
|
|
75
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.WarningOutlined, {})
|
|
76
|
+
});
|
|
77
|
+
case 'failed':
|
|
78
|
+
case 'closed':
|
|
79
|
+
case 'timedOut':
|
|
80
|
+
case 'interrupted':
|
|
81
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
82
|
+
style: {
|
|
83
|
+
color: '#FF0A0A'
|
|
84
|
+
},
|
|
85
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.CloseOutlined, {})
|
|
86
|
+
});
|
|
87
|
+
case 'pending':
|
|
88
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ClockCircleOutlined, {});
|
|
89
|
+
case 'cancelled':
|
|
90
|
+
case 'skipped':
|
|
91
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.LogoutOutlined, {});
|
|
92
|
+
case 'running':
|
|
93
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ArrowRightOutlined, {});
|
|
94
|
+
default:
|
|
95
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.MinusOutlined, {});
|
|
96
|
+
}
|
|
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 @sqaitech/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;
|
|
138
|
+
exports.iconForStatus = __webpack_exports__.iconForStatus;
|
|
139
|
+
exports.serverLaunchTip = __webpack_exports__.serverLaunchTip;
|
|
140
|
+
exports.timeCostStrElement = __webpack_exports__.timeCostStrElement;
|
|
141
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
142
|
+
"emptyResultTip",
|
|
143
|
+
"errorMessageServerNotReady",
|
|
144
|
+
"iconForStatus",
|
|
145
|
+
"serverLaunchTip",
|
|
146
|
+
"timeCostStrElement"
|
|
147
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
148
|
+
Object.defineProperty(exports, '__esModule', {
|
|
149
|
+
value: true
|
|
150
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
NavActions: ()=>NavActions
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const icons_namespaceObject = require("@ant-design/icons");
|
|
31
|
+
const external_antd_namespaceObject = require("antd");
|
|
32
|
+
const index_js_namespaceObject = require("../env-config/index.js");
|
|
33
|
+
require("./style.css");
|
|
34
|
+
function NavActions(param) {
|
|
35
|
+
let { showEnvConfig = true, showTooltipWhenEmpty = false, showModelName = false, githubUrl = 'https://github.com/web-infra-dev/midscene', helpUrl = 'https://sqai.tech/quick-experience.html', className = '' } = param;
|
|
36
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
37
|
+
className: `nav-actions ${className}`,
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Typography.Link, {
|
|
40
|
+
href: githubUrl,
|
|
41
|
+
target: "_blank",
|
|
42
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.GithubOutlined, {
|
|
43
|
+
className: "nav-icon"
|
|
44
|
+
})
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Typography.Link, {
|
|
47
|
+
href: helpUrl,
|
|
48
|
+
target: "_blank",
|
|
49
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.QuestionCircleOutlined, {
|
|
50
|
+
className: "nav-icon"
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
showEnvConfig && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.EnvConfig, {
|
|
54
|
+
showTooltipWhenEmpty: showTooltipWhenEmpty,
|
|
55
|
+
showModelName: showModelName
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
exports.NavActions = __webpack_exports__.NavActions;
|
|
61
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
62
|
+
"NavActions"
|
|
63
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
64
|
+
Object.defineProperty(exports, '__esModule', {
|
|
65
|
+
value: true
|
|
66
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.nav-actions {
|
|
2
|
+
align-items: center;
|
|
3
|
+
gap: 8px;
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.nav-actions .nav-icon {
|
|
8
|
+
color: rgba(0, 0, 0, .65);
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
font-size: 16px;
|
|
11
|
+
transition: color .3s;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.nav-actions .nav-icon:hover {
|
|
15
|
+
color: #2b83ff;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.nav-actions a {
|
|
19
|
+
align-items: center;
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
display: flex;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.nav-actions a:hover .nav-icon {
|
|
25
|
+
color: #2b83ff;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[data-theme="dark"] .nav-actions .nav-icon {
|
|
29
|
+
color: rgba(255, 255, 255, .65);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[data-theme="dark"] .nav-actions .nav-icon:hover {
|
|
33
|
+
color: #2b83ff;
|
|
34
|
+
}
|
|
35
|
+
|