@midscene/visualizer 1.0.1-beta-20251209024153.0 → 1.0.1-beta-20251211095502.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/dist/es/component/player/index.mjs +2 -2
- package/dist/es/component/playground/index.css +0 -9
- package/dist/es/component/playground-result/index.css +0 -9
- package/dist/es/component/playground-result/index.mjs +12 -5
- package/dist/es/component/shiny-text/index.css +20 -3
- package/dist/es/component/shiny-text/index.mjs +3 -2
- package/dist/es/component/universal-playground/index.css +0 -1
- package/dist/es/component/universal-playground/index.mjs +46 -59
- package/dist/es/component/universal-playground/providers/indexeddb-storage-provider.mjs +13 -18
- package/dist/es/component/universal-playground/providers/storage-provider.mjs +2 -2
- package/dist/es/hooks/usePlaygroundExecution.mjs +108 -34
- package/dist/es/index.mjs +2 -2
- package/dist/es/store/store.mjs +23 -2
- package/dist/lib/component/player/index.js +1 -1
- package/dist/lib/component/playground/index.css +0 -9
- package/dist/lib/component/playground-result/index.css +0 -9
- package/dist/lib/component/playground-result/index.js +12 -5
- package/dist/lib/component/shiny-text/index.css +20 -3
- package/dist/lib/component/shiny-text/index.js +3 -2
- package/dist/lib/component/universal-playground/index.css +0 -1
- package/dist/lib/component/universal-playground/index.js +46 -58
- package/dist/lib/component/universal-playground/providers/indexeddb-storage-provider.js +13 -18
- package/dist/lib/component/universal-playground/providers/storage-provider.js +2 -2
- package/dist/lib/hooks/usePlaygroundExecution.js +108 -34
- package/dist/lib/index.js +3 -0
- package/dist/lib/store/store.js +26 -5
- package/dist/types/hooks/usePlaygroundExecution.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/store/store.d.ts +5 -1
- package/dist/types/types.d.ts +8 -2
- package/package.json +5 -5
package/dist/es/store/store.mjs
CHANGED
|
@@ -30,6 +30,8 @@ const { create: store_create } = external_zustand_namespaceObject;
|
|
|
30
30
|
const AUTO_ZOOM_KEY = 'midscene-auto-zoom';
|
|
31
31
|
const BACKGROUND_VISIBLE_KEY = 'midscene-background-visible';
|
|
32
32
|
const ELEMENTS_VISIBLE_KEY = 'midscene-elements-visible';
|
|
33
|
+
const MODEL_CALL_DETAILS_KEY = 'midscene-model-call-details';
|
|
34
|
+
const DARK_MODE_KEY = 'midscene-dark-mode';
|
|
33
35
|
const parseBooleanParam = (value)=>{
|
|
34
36
|
if (null === value) return;
|
|
35
37
|
const normalized = value.trim().toLowerCase();
|
|
@@ -51,16 +53,23 @@ const getQueryPreference = (paramName)=>{
|
|
|
51
53
|
const searchParams = new URLSearchParams(window.location.search);
|
|
52
54
|
return parseBooleanParam(searchParams.get(paramName));
|
|
53
55
|
};
|
|
54
|
-
const
|
|
56
|
+
const useGlobalPreference = store_create((set)=>{
|
|
55
57
|
const savedAutoZoom = 'false' !== localStorage.getItem(AUTO_ZOOM_KEY);
|
|
56
58
|
const savedBackgroundVisible = 'false' !== localStorage.getItem(BACKGROUND_VISIBLE_KEY);
|
|
57
59
|
const savedElementsVisible = 'false' !== localStorage.getItem(ELEMENTS_VISIBLE_KEY);
|
|
60
|
+
const savedModelCallDetails = 'true' === localStorage.getItem(MODEL_CALL_DETAILS_KEY);
|
|
61
|
+
const savedDarkMode = 'true' === localStorage.getItem(DARK_MODE_KEY);
|
|
58
62
|
const autoZoomFromQuery = getQueryPreference('focusOnCursor');
|
|
59
63
|
const elementsVisibleFromQuery = getQueryPreference('showElementMarkers');
|
|
64
|
+
const darkModeFromQuery = getQueryPreference('darkMode');
|
|
65
|
+
const initialDarkMode = void 0 === darkModeFromQuery ? savedDarkMode : darkModeFromQuery;
|
|
66
|
+
if (void 0 !== darkModeFromQuery) localStorage.setItem(DARK_MODE_KEY, initialDarkMode.toString());
|
|
60
67
|
return {
|
|
61
68
|
backgroundVisible: savedBackgroundVisible,
|
|
62
69
|
elementsVisible: void 0 === elementsVisibleFromQuery ? savedElementsVisible : elementsVisibleFromQuery,
|
|
63
70
|
autoZoom: void 0 === autoZoomFromQuery ? savedAutoZoom : autoZoomFromQuery,
|
|
71
|
+
modelCallDetailsEnabled: savedModelCallDetails,
|
|
72
|
+
darkModeEnabled: initialDarkMode,
|
|
64
73
|
setBackgroundVisible: (visible)=>{
|
|
65
74
|
set({
|
|
66
75
|
backgroundVisible: visible
|
|
@@ -78,6 +87,18 @@ const useBlackboardPreference = store_create((set)=>{
|
|
|
78
87
|
autoZoom: enabled
|
|
79
88
|
});
|
|
80
89
|
localStorage.setItem(AUTO_ZOOM_KEY, enabled.toString());
|
|
90
|
+
},
|
|
91
|
+
setModelCallDetailsEnabled: (enabled)=>{
|
|
92
|
+
set({
|
|
93
|
+
modelCallDetailsEnabled: enabled
|
|
94
|
+
});
|
|
95
|
+
localStorage.setItem(MODEL_CALL_DETAILS_KEY, enabled.toString());
|
|
96
|
+
},
|
|
97
|
+
setDarkModeEnabled: (enabled)=>{
|
|
98
|
+
set({
|
|
99
|
+
darkModeEnabled: enabled
|
|
100
|
+
});
|
|
101
|
+
localStorage.setItem(DARK_MODE_KEY, enabled.toString());
|
|
81
102
|
}
|
|
82
103
|
};
|
|
83
104
|
});
|
|
@@ -219,4 +240,4 @@ const useEnvConfig = store_create((set, get)=>{
|
|
|
219
240
|
}
|
|
220
241
|
};
|
|
221
242
|
});
|
|
222
|
-
export {
|
|
243
|
+
export { useEnvConfig, useGlobalPreference };
|
|
@@ -229,7 +229,7 @@ function Player(props) {
|
|
|
229
229
|
var _scripts_;
|
|
230
230
|
const [titleText, setTitleText] = (0, external_react_namespaceObject.useState)('');
|
|
231
231
|
const [subTitleText, setSubTitleText] = (0, external_react_namespaceObject.useState)('');
|
|
232
|
-
const { autoZoom, setAutoZoom } = (0, store_js_namespaceObject.
|
|
232
|
+
const { autoZoom, setAutoZoom } = (0, store_js_namespaceObject.useGlobalPreference)();
|
|
233
233
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
234
234
|
if ((null == props ? void 0 : props.autoZoom) !== void 0) setAutoZoom(props.autoZoom);
|
|
235
235
|
}, [
|
|
@@ -32,15 +32,6 @@
|
|
|
32
32
|
overflow: scroll;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
[data-theme="dark"] .result-wrapper .loading-container .loading-progress-text {
|
|
36
|
-
color: #f8fafd;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
[data-theme="dark"] .result-wrapper pre {
|
|
40
|
-
color: #f8fafd;
|
|
41
|
-
background: #141414;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
35
|
.prompt-input-wrapper {
|
|
45
36
|
width: 100%;
|
|
46
37
|
}
|
|
@@ -67,11 +67,18 @@ const PlaygroundResultView = ({ result, loading, serverValid, serviceMode, repla
|
|
|
67
67
|
})
|
|
68
68
|
]
|
|
69
69
|
});
|
|
70
|
-
else if (replayScriptsInfo)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
else if (replayScriptsInfo) {
|
|
71
|
+
const reportContent = ('In-Browser-Extension' === serviceMode || 'Server' === serviceMode) && (null == result ? void 0 : result.reportHTML) ? null == result ? void 0 : result.reportHTML : null;
|
|
72
|
+
resultDataToShow = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_player_index_js_namespaceObject.Player, {
|
|
73
|
+
replayScripts: replayScriptsInfo.scripts,
|
|
74
|
+
imageWidth: replayScriptsInfo.width,
|
|
75
|
+
imageHeight: replayScriptsInfo.height,
|
|
76
|
+
reportFileContent: reportContent,
|
|
77
|
+
fitMode: fitMode,
|
|
78
|
+
autoZoom: autoZoom
|
|
79
|
+
}, replayCounter);
|
|
80
|
+
} else if ((null == result ? void 0 : result.reportHTML) && ('In-Browser-Extension' === serviceMode || 'Server' === serviceMode)) resultDataToShow = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_player_index_js_namespaceObject.Player, {
|
|
81
|
+
reportFileContent: result.reportHTML,
|
|
75
82
|
fitMode: fitMode,
|
|
76
83
|
autoZoom: autoZoom
|
|
77
84
|
}, replayCounter);
|
|
@@ -13,6 +13,23 @@
|
|
|
13
13
|
overflow: hidden;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.shiny-text.theme-blue {
|
|
17
|
+
background-image: linear-gradient(45deg, #2b83ff, #6a11cb, #2575fc, #4481eb);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.shiny-text.theme-purple {
|
|
21
|
+
background-image: linear-gradient(45deg, #667eea, #764ba2, #b06ab3, #9d50bb);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.shiny-text.theme-green {
|
|
25
|
+
background-image: linear-gradient(45deg, #11998e, #38ef7d, #2dd4bf, #10b981);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.shiny-text.theme-rainbow {
|
|
29
|
+
background-image: linear-gradient(45deg, #ff0080, #ff8c00, #40e0d0, #9d50bb, #ff0080);
|
|
30
|
+
background-size: 400%;
|
|
31
|
+
}
|
|
32
|
+
|
|
16
33
|
.shiny-text:after {
|
|
17
34
|
content: "";
|
|
18
35
|
width: 120%;
|
|
@@ -28,9 +45,9 @@
|
|
|
28
45
|
}
|
|
29
46
|
|
|
30
47
|
.shiny-text.disabled {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
color: #000;
|
|
49
|
+
background: none;
|
|
50
|
+
font-weight: normal;
|
|
34
51
|
animation: none;
|
|
35
52
|
}
|
|
36
53
|
|
|
@@ -28,12 +28,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
require("./index.css");
|
|
31
|
-
const ShinyText = ({ text, disabled = false, speed = 5, className = '' })=>{
|
|
31
|
+
const ShinyText = ({ text, disabled = false, speed = 5, className = '', colorTheme = 'blue' })=>{
|
|
32
32
|
const style = {
|
|
33
33
|
'--animation-duration': `${speed}s`
|
|
34
34
|
};
|
|
35
|
+
const themeClass = `theme-${colorTheme}`;
|
|
35
36
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
36
|
-
className: `shiny-text ${disabled ? 'disabled' : ''} ${className}`,
|
|
37
|
+
className: `shiny-text ${themeClass} ${disabled ? 'disabled' : ''} ${className}`,
|
|
37
38
|
style: style,
|
|
38
39
|
children: text
|
|
39
40
|
});
|
|
@@ -52,6 +52,8 @@ const avatar_js_namespaceObject = require("../../icons/avatar.js");
|
|
|
52
52
|
var avatar_js_default = /*#__PURE__*/ __webpack_require__.n(avatar_js_namespaceObject);
|
|
53
53
|
const constants_js_namespaceObject = require("../../utils/constants.js");
|
|
54
54
|
const external_prompt_input_index_js_namespaceObject = require("../prompt-input/index.js");
|
|
55
|
+
const external_shiny_text_index_js_namespaceObject = require("../shiny-text/index.js");
|
|
56
|
+
var external_shiny_text_index_js_default = /*#__PURE__*/ __webpack_require__.n(external_shiny_text_index_js_namespaceObject);
|
|
55
57
|
const storage_provider_js_namespaceObject = require("./providers/storage-provider.js");
|
|
56
58
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
57
59
|
try {
|
|
@@ -86,21 +88,16 @@ function getSDKId(sdk) {
|
|
|
86
88
|
}
|
|
87
89
|
function ErrorMessage({ error }) {
|
|
88
90
|
if (!error) return null;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
const cleanError = error.replace(/^(Error:\s*)+/, 'Error: ');
|
|
92
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Alert, {
|
|
93
|
+
message: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
91
94
|
style: {
|
|
92
|
-
|
|
93
|
-
wordBreak: 'break-all'
|
|
95
|
+
color: '#ff4d4f'
|
|
94
96
|
},
|
|
95
|
-
children:
|
|
97
|
+
children: cleanError
|
|
96
98
|
}),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
children: [
|
|
101
|
-
"Error: ",
|
|
102
|
-
error.split('\n')[0]
|
|
103
|
-
]
|
|
99
|
+
type: "error",
|
|
100
|
+
showIcon: true
|
|
104
101
|
});
|
|
105
102
|
}
|
|
106
103
|
function UniversalPlayground({ playgroundSDK, storage, contextProvider, config: componentConfig = {}, branding = {}, className = '', dryMode = false, showContextPreview = true }) {
|
|
@@ -143,7 +140,7 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
143
140
|
playgroundSDK
|
|
144
141
|
]);
|
|
145
142
|
const { loading, setLoading, infoList, setInfoList, actionSpace, actionSpaceLoading, uiContextPreview, setUiContextPreview, showScrollToBottomButton, verticalMode, replayCounter, setReplayCounter, infoListRef, currentRunningIdRef, interruptedFlagRef, clearInfoList, handleScrollToBottom } = (0, usePlaygroundState_js_namespaceObject.usePlaygroundState)(playgroundSDK, effectiveStorage, contextProvider);
|
|
146
|
-
const { handleRun: executeAction, handleStop, canStop } = (0, usePlaygroundExecution_js_namespaceObject.usePlaygroundExecution)(playgroundSDK, effectiveStorage, actionSpace, loading, setLoading,
|
|
143
|
+
const { handleRun: executeAction, handleStop, canStop } = (0, usePlaygroundExecution_js_namespaceObject.usePlaygroundExecution)(playgroundSDK, effectiveStorage, actionSpace, loading, setLoading, setInfoList, replayCounter, setReplayCounter, verticalMode, currentRunningIdRef, interruptedFlagRef);
|
|
147
144
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
148
145
|
if ((null == playgroundSDK ? void 0 : playgroundSDK.overrideConfig) && config) playgroundSDK.overrideConfig(config).catch((error)=>{
|
|
149
146
|
console.error('Failed to override SDK config:', error);
|
|
@@ -166,6 +163,12 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
166
163
|
const configAlreadySet = Object.keys(config || {}).length >= 1;
|
|
167
164
|
const runButtonEnabled = componentConfig.serverMode || !dryMode && !actionSpaceLoading && configAlreadySet;
|
|
168
165
|
const selectedType = external_antd_namespaceObject.Form.useWatch('type', form);
|
|
166
|
+
const serviceMode = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
167
|
+
if (!playgroundSDK || 'function' != typeof playgroundSDK.getServiceMode) return 'Server';
|
|
168
|
+
return playgroundSDK.getServiceMode();
|
|
169
|
+
}, [
|
|
170
|
+
playgroundSDK
|
|
171
|
+
]);
|
|
169
172
|
const finalShowContextPreview = showContextPreview && false !== componentConfig.showContextPreview;
|
|
170
173
|
const layout = componentConfig.layout || 'vertical';
|
|
171
174
|
const showVersionInfo = false !== componentConfig.showVersionInfo;
|
|
@@ -204,9 +207,7 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
204
207
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.List, {
|
|
205
208
|
itemLayout: "vertical",
|
|
206
209
|
dataSource: infoList,
|
|
207
|
-
renderItem: (item)
|
|
208
|
-
var _item_result;
|
|
209
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.List.Item, {
|
|
210
|
+
renderItem: (item)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.List.Item, {
|
|
210
211
|
className: "list-item",
|
|
211
212
|
children: 'user' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
212
213
|
className: "user-message-container",
|
|
@@ -239,9 +240,10 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
239
240
|
]
|
|
240
241
|
}),
|
|
241
242
|
description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
242
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
243
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_shiny_text_index_js_default(), {
|
|
244
|
+
text: description,
|
|
243
245
|
className: "progress-description",
|
|
244
|
-
|
|
246
|
+
disabled: !shouldShowLoading
|
|
245
247
|
})
|
|
246
248
|
}),
|
|
247
249
|
(null == (_item_result2 = item.result) ? void 0 : _item_result2.error) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ErrorMessage, {
|
|
@@ -283,50 +285,36 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
283
285
|
})
|
|
284
286
|
]
|
|
285
287
|
}),
|
|
286
|
-
(item.content || item.result) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.
|
|
288
|
+
(item.content || item.result) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
287
289
|
className: "system-message-content",
|
|
288
|
-
children:
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
verticalMode: item.verticalMode || false,
|
|
309
|
-
fitMode: "width"
|
|
310
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
311
|
-
children: [
|
|
312
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
313
|
-
className: "system-message-text",
|
|
314
|
-
children: item.content
|
|
315
|
-
}),
|
|
316
|
-
item.loading && item.loadingProgressText && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
317
|
-
className: "loading-progress-text",
|
|
318
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
319
|
-
children: item.loadingProgressText
|
|
320
|
-
})
|
|
290
|
+
children: 'result' === item.type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_playground_result_index_js_namespaceObject.PlaygroundResultView, {
|
|
291
|
+
result: item.result || null,
|
|
292
|
+
loading: item.loading || false,
|
|
293
|
+
serverValid: true,
|
|
294
|
+
serviceMode: serviceMode,
|
|
295
|
+
replayScriptsInfo: item.replayScriptsInfo || null,
|
|
296
|
+
replayCounter: item.replayCounter || 0,
|
|
297
|
+
loadingProgressText: item.loadingProgressText || '',
|
|
298
|
+
verticalMode: item.verticalMode || false,
|
|
299
|
+
fitMode: "width"
|
|
300
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
301
|
+
children: [
|
|
302
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
303
|
+
className: "system-message-text",
|
|
304
|
+
children: item.content
|
|
305
|
+
}),
|
|
306
|
+
item.loading && item.loadingProgressText && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
307
|
+
className: "loading-progress-text",
|
|
308
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
309
|
+
children: item.loadingProgressText
|
|
321
310
|
})
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
311
|
+
})
|
|
312
|
+
]
|
|
313
|
+
})
|
|
325
314
|
})
|
|
326
315
|
]
|
|
327
316
|
})
|
|
328
|
-
}, item.id)
|
|
329
|
-
}
|
|
317
|
+
}, item.id)
|
|
330
318
|
})
|
|
331
319
|
}),
|
|
332
320
|
showScrollToBottomButton && false !== componentConfig.enableScrollToBottom && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
|
|
@@ -346,7 +334,7 @@ function UniversalPlayground({ playgroundSDK, storage, contextProvider, config:
|
|
|
346
334
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_prompt_input_index_js_namespaceObject.PromptInput, {
|
|
347
335
|
runButtonEnabled: runButtonEnabled,
|
|
348
336
|
form: form,
|
|
349
|
-
serviceMode:
|
|
337
|
+
serviceMode: serviceMode,
|
|
350
338
|
selectedType: selectedType,
|
|
351
339
|
dryMode: dryMode,
|
|
352
340
|
stoppable: canStop,
|
|
@@ -111,7 +111,7 @@ class IndexedDBStorageProvider {
|
|
|
111
111
|
const messagesToSave = messages.slice(-MAX_STORED_MESSAGES);
|
|
112
112
|
yield Promise.all(messagesToSave.map((msg, index)=>{
|
|
113
113
|
const lightMessage = _object_spread_props(_object_spread({}, msg), {
|
|
114
|
-
result: void 0
|
|
114
|
+
result: 'result' === msg.type ? void 0 : msg.result
|
|
115
115
|
});
|
|
116
116
|
const data = {
|
|
117
117
|
id: msg.id || `msg-${index}`,
|
|
@@ -183,28 +183,23 @@ class IndexedDBStorageProvider {
|
|
|
183
183
|
}
|
|
184
184
|
compressResultForStorage(result) {
|
|
185
185
|
var _result_result_dump, _result_result;
|
|
186
|
-
if (!(null == (_result_result = result.result) ? void 0 : null == (_result_result_dump = _result_result.dump) ? void 0 : _result_result_dump.
|
|
187
|
-
const
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
recorder: null == (_task_recorder = task.recorder) ? void 0 : _task_recorder.map((record)=>_object_spread_props(_object_spread({}, record), {
|
|
198
|
-
screenshot: this.compressScreenshotIfNeeded(record.screenshot)
|
|
199
|
-
}))
|
|
200
|
-
});
|
|
201
|
-
})) || []
|
|
186
|
+
if (!(null == (_result_result = result.result) ? void 0 : null == (_result_result_dump = _result_result.dump) ? void 0 : _result_result_dump.tasks)) return result;
|
|
187
|
+
const compressedTasks = result.result.dump.tasks.map((task)=>{
|
|
188
|
+
var _task_recorder;
|
|
189
|
+
var _this_compressScreenshotIfNeeded;
|
|
190
|
+
return _object_spread_props(_object_spread({}, task), {
|
|
191
|
+
uiContext: task.uiContext ? _object_spread_props(_object_spread({}, task.uiContext), {
|
|
192
|
+
screenshotBase64: null != (_this_compressScreenshotIfNeeded = this.compressScreenshotIfNeeded(task.uiContext.screenshotBase64)) ? _this_compressScreenshotIfNeeded : task.uiContext.screenshotBase64
|
|
193
|
+
}) : task.uiContext,
|
|
194
|
+
recorder: null == (_task_recorder = task.recorder) ? void 0 : _task_recorder.map((record)=>_object_spread_props(_object_spread({}, record), {
|
|
195
|
+
screenshot: this.compressScreenshotIfNeeded(record.screenshot)
|
|
196
|
+
}))
|
|
202
197
|
});
|
|
203
198
|
});
|
|
204
199
|
return _object_spread_props(_object_spread({}, result), {
|
|
205
200
|
result: _object_spread_props(_object_spread({}, result.result), {
|
|
206
201
|
dump: _object_spread_props(_object_spread({}, result.result.dump), {
|
|
207
|
-
|
|
202
|
+
tasks: compressedTasks
|
|
208
203
|
})
|
|
209
204
|
})
|
|
210
205
|
});
|
|
@@ -124,7 +124,7 @@ class LocalStorageProvider {
|
|
|
124
124
|
}
|
|
125
125
|
const messagesToSave = messages.slice(-this.maxStorageItems);
|
|
126
126
|
const lightMessages = messagesToSave.map((msg)=>_object_spread_props(_object_spread({}, msg), {
|
|
127
|
-
result: void 0
|
|
127
|
+
result: 'result' === msg.type ? void 0 : msg.result
|
|
128
128
|
}));
|
|
129
129
|
const messageData = JSON.stringify(lightMessages);
|
|
130
130
|
localStorage.setItem(this.messagesKey, messageData);
|
|
@@ -135,7 +135,7 @@ class LocalStorageProvider {
|
|
|
135
135
|
try {
|
|
136
136
|
const recentMessages = messages.slice(-10);
|
|
137
137
|
const lightRecentMessages = recentMessages.map((msg)=>_object_spread_props(_object_spread({}, msg), {
|
|
138
|
-
result: void 0
|
|
138
|
+
result: 'result' === msg.type ? void 0 : msg.result
|
|
139
139
|
}));
|
|
140
140
|
const messageData = JSON.stringify(lightRecentMessages);
|
|
141
141
|
localStorage.setItem(this.messagesKey, messageData);
|