@midscene/visualizer 0.30.10 → 1.0.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/blackboard/index.css +8 -0
- package/dist/es/component/blackboard/index.mjs +137 -68
- package/dist/es/component/config-selector/index.mjs +102 -4
- package/dist/es/component/context-preview/index.mjs +1 -2
- package/dist/es/component/env-config/index.mjs +1 -2
- package/dist/es/component/env-config-reminder/index.css +8 -0
- package/dist/es/component/env-config-reminder/index.mjs +1 -2
- package/dist/es/component/form-field/index.mjs +5 -10
- package/dist/es/component/history-selector/index.css +38 -1
- package/dist/es/component/history-selector/index.mjs +1 -2
- package/dist/es/component/logo/index.mjs +7 -3
- package/dist/es/component/misc/index.mjs +1 -4
- package/dist/es/component/nav-actions/index.mjs +1 -2
- package/dist/es/component/nav-actions/style.css +1 -1
- package/dist/es/component/player/index.css +26 -0
- package/dist/es/component/player/index.mjs +376 -364
- package/dist/es/component/playground/index.css +291 -31
- package/dist/es/component/playground-result/index.css +10 -0
- package/dist/es/component/playground-result/index.mjs +129 -10
- package/dist/es/component/prompt-input/index.css +281 -31
- package/dist/es/component/prompt-input/index.mjs +83 -25
- package/dist/es/component/screenshot-viewer/index.css +214 -0
- package/dist/es/component/screenshot-viewer/index.mjs +282 -0
- package/dist/es/component/service-mode-control/index.mjs +1 -2
- package/dist/es/component/shiny-text/index.css +35 -3
- package/dist/es/component/shiny-text/index.mjs +3 -3
- package/dist/es/component/universal-playground/index.css +61 -1
- package/dist/es/component/universal-playground/index.mjs +106 -83
- package/dist/es/component/universal-playground/providers/context-provider.mjs +56 -18
- package/dist/es/component/universal-playground/providers/indexeddb-storage-provider.mjs +213 -139
- package/dist/es/component/universal-playground/providers/storage-provider.mjs +199 -121
- package/dist/es/hooks/usePlaygroundExecution.mjs +297 -146
- package/dist/es/hooks/usePlaygroundState.mjs +141 -75
- package/dist/es/hooks/useSafeOverrideAIConfig.mjs +2 -6
- package/dist/es/hooks/useServerValid.mjs +37 -12
- package/dist/es/hooks/useTheme.mjs +25 -0
- package/dist/es/icons/avatar.mjs +46 -4
- package/dist/es/icons/close.mjs +46 -4
- package/dist/es/icons/global-perspective.mjs +47 -5
- package/dist/es/icons/history.mjs +48 -6
- package/dist/es/icons/magnifying-glass.mjs +47 -5
- package/dist/es/icons/player-setting.mjs +48 -6
- package/dist/es/icons/setting.mjs +47 -5
- package/dist/es/icons/show-marker.mjs +47 -5
- package/dist/es/index.mjs +4 -4
- package/dist/es/store/history.mjs +46 -7
- package/dist/es/store/store.mjs +68 -2
- package/dist/es/types.mjs +1 -1
- package/dist/es/utils/constants.mjs +7 -3
- package/dist/es/utils/index.mjs +4 -1
- package/dist/es/utils/pixi-loader.mjs +37 -11
- package/dist/es/utils/replay-scripts.mjs +160 -111
- package/dist/lib/component/blackboard/index.css +8 -0
- package/dist/lib/component/blackboard/index.js +139 -70
- package/dist/lib/component/config-selector/index.js +103 -5
- package/dist/lib/component/context-preview/index.js +3 -4
- package/dist/lib/component/env-config/index.js +3 -4
- package/dist/lib/component/env-config-reminder/index.css +8 -0
- package/dist/lib/component/env-config-reminder/index.js +3 -4
- package/dist/lib/component/form-field/index.js +10 -15
- package/dist/lib/component/history-selector/index.css +38 -1
- package/dist/lib/component/history-selector/index.js +3 -4
- package/dist/lib/component/index.js +6 -8
- package/dist/lib/component/logo/index.js +9 -5
- package/dist/lib/component/misc/index.js +6 -9
- package/dist/lib/component/nav-actions/index.js +3 -4
- package/dist/lib/component/nav-actions/style.css +1 -1
- package/dist/lib/component/player/index.css +26 -0
- package/dist/lib/component/player/index.js +376 -365
- package/dist/lib/component/playground/index.css +291 -31
- package/dist/lib/component/playground/index.js +31 -33
- package/dist/lib/component/playground-result/index.css +10 -0
- package/dist/lib/component/playground-result/index.js +131 -12
- package/dist/lib/component/prompt-input/index.css +281 -31
- package/dist/lib/component/prompt-input/index.js +84 -26
- package/dist/lib/component/screenshot-viewer/index.css +214 -0
- package/dist/lib/component/screenshot-viewer/index.js +316 -0
- package/dist/lib/component/service-mode-control/index.js +3 -4
- package/dist/lib/component/shiny-text/index.css +35 -3
- package/dist/lib/component/shiny-text/index.js +5 -5
- package/dist/lib/component/universal-playground/index.css +61 -1
- package/dist/lib/component/universal-playground/index.js +108 -84
- package/dist/lib/component/universal-playground/providers/context-provider.js +58 -20
- package/dist/lib/component/universal-playground/providers/indexeddb-storage-provider.js +217 -143
- package/dist/lib/component/universal-playground/providers/storage-provider.js +207 -129
- package/dist/lib/hooks/usePlaygroundExecution.js +299 -148
- package/dist/lib/hooks/usePlaygroundState.js +143 -77
- package/dist/lib/hooks/useSafeOverrideAIConfig.js +4 -8
- package/dist/lib/hooks/useServerValid.js +39 -14
- package/dist/lib/hooks/useTheme.js +59 -0
- package/dist/lib/icons/avatar.js +48 -6
- package/dist/lib/icons/close.js +48 -6
- package/dist/lib/icons/global-perspective.js +49 -7
- package/dist/lib/icons/history.js +50 -8
- package/dist/lib/icons/magnifying-glass.js +49 -7
- package/dist/lib/icons/player-setting.js +50 -8
- package/dist/lib/icons/setting.js +49 -7
- package/dist/lib/icons/show-marker.js +49 -7
- package/dist/lib/index.js +44 -34
- package/dist/lib/store/history.js +48 -9
- package/dist/lib/store/store.js +74 -8
- package/dist/lib/types.js +3 -3
- package/dist/lib/utils/color.js +2 -2
- package/dist/lib/utils/constants.js +20 -4
- package/dist/lib/utils/index.js +10 -4
- package/dist/lib/utils/pixi-loader.js +41 -15
- package/dist/lib/utils/playground-utils.js +4 -4
- package/dist/lib/utils/replay-scripts.js +164 -115
- package/dist/types/component/config-selector/index.d.ts +2 -0
- package/dist/types/component/player/index.d.ts +0 -1
- package/dist/types/component/playground-result/index.d.ts +1 -0
- package/dist/types/component/prompt-input/index.d.ts +2 -1
- package/dist/types/component/screenshot-viewer/index.d.ts +15 -0
- package/dist/types/hooks/usePlaygroundExecution.d.ts +1 -1
- package/dist/types/hooks/usePlaygroundState.d.ts +3 -3
- package/dist/types/hooks/useTheme.d.ts +7 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/store/store.d.ts +18 -1
- package/dist/types/types.d.ts +14 -4
- package/dist/types/utils/constants.d.ts +5 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/replay-scripts.d.ts +1 -1
- package/package.json +12 -22
|
@@ -24,11 +24,37 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
|
|
27
|
+
MemoryStorageProvider: ()=>MemoryStorageProvider,
|
|
28
28
|
NoOpStorageProvider: ()=>NoOpStorageProvider,
|
|
29
|
-
|
|
29
|
+
IndexedDBStorageProvider: ()=>IndexedDBStorageProvider
|
|
30
30
|
});
|
|
31
31
|
const baseDB_namespaceObject = require("@midscene/shared/baseDB");
|
|
32
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
33
|
+
try {
|
|
34
|
+
var info = gen[key](arg);
|
|
35
|
+
var value = info.value;
|
|
36
|
+
} catch (error) {
|
|
37
|
+
reject(error);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (info.done) resolve(value);
|
|
41
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
42
|
+
}
|
|
43
|
+
function _async_to_generator(fn) {
|
|
44
|
+
return function() {
|
|
45
|
+
var self = this, args = arguments;
|
|
46
|
+
return new Promise(function(resolve, reject) {
|
|
47
|
+
var gen = fn.apply(self, args);
|
|
48
|
+
function _next(value) {
|
|
49
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
50
|
+
}
|
|
51
|
+
function _throw(err) {
|
|
52
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
53
|
+
}
|
|
54
|
+
_next(void 0);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
}
|
|
32
58
|
function _define_property(obj, key, value) {
|
|
33
59
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
34
60
|
value: value,
|
|
@@ -39,6 +65,38 @@ function _define_property(obj, key, value) {
|
|
|
39
65
|
else obj[key] = value;
|
|
40
66
|
return obj;
|
|
41
67
|
}
|
|
68
|
+
function _object_spread(target) {
|
|
69
|
+
for(var i = 1; i < arguments.length; i++){
|
|
70
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
71
|
+
var ownKeys = Object.keys(source);
|
|
72
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
73
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
74
|
+
}));
|
|
75
|
+
ownKeys.forEach(function(key) {
|
|
76
|
+
_define_property(target, key, source[key]);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return target;
|
|
80
|
+
}
|
|
81
|
+
function indexeddb_storage_provider_ownKeys(object, enumerableOnly) {
|
|
82
|
+
var keys = Object.keys(object);
|
|
83
|
+
if (Object.getOwnPropertySymbols) {
|
|
84
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
85
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
86
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
87
|
+
});
|
|
88
|
+
keys.push.apply(keys, symbols);
|
|
89
|
+
}
|
|
90
|
+
return keys;
|
|
91
|
+
}
|
|
92
|
+
function _object_spread_props(target, source) {
|
|
93
|
+
source = null != source ? source : {};
|
|
94
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
95
|
+
else indexeddb_storage_provider_ownKeys(Object(source)).forEach(function(key) {
|
|
96
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
97
|
+
});
|
|
98
|
+
return target;
|
|
99
|
+
}
|
|
42
100
|
const DB_NAME = 'midscene_playground';
|
|
43
101
|
const DB_VERSION = 1;
|
|
44
102
|
const MESSAGES_STORE = 'playground_messages';
|
|
@@ -46,109 +104,105 @@ const RESULTS_STORE = 'playground_results';
|
|
|
46
104
|
const MAX_STORED_MESSAGES = 100;
|
|
47
105
|
const MAX_STORED_RESULTS = 50;
|
|
48
106
|
class IndexedDBStorageProvider {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
await (0, baseDB_namespaceObject.withErrorHandling)(async ()=>{
|
|
93
|
-
await Promise.all([
|
|
94
|
-
this.dbManager.clear(MESSAGES_STORE),
|
|
95
|
-
this.dbManager.clear(RESULTS_STORE)
|
|
96
|
-
]);
|
|
97
|
-
}, 'Failed to clear messages from IndexedDB');
|
|
98
|
-
}
|
|
99
|
-
async saveResult(id, result) {
|
|
100
|
-
await (0, baseDB_namespaceObject.withErrorHandling)(async ()=>{
|
|
101
|
-
const compressedResult = this.compressResultForStorage(result);
|
|
102
|
-
const data = {
|
|
103
|
-
id,
|
|
104
|
-
data: compressedResult,
|
|
105
|
-
timestamp: Date.now(),
|
|
106
|
-
size: JSON.stringify(compressedResult).length
|
|
107
|
-
};
|
|
108
|
-
await this.dbManager.put(RESULTS_STORE, data);
|
|
109
|
-
}, 'Failed to save result to IndexedDB', void 0, this.resultsCleanup);
|
|
107
|
+
saveMessages(messages) {
|
|
108
|
+
return _async_to_generator(function*() {
|
|
109
|
+
yield (0, baseDB_namespaceObject.withErrorHandling)(()=>_async_to_generator(function*() {
|
|
110
|
+
yield this.dbManager.clear(MESSAGES_STORE);
|
|
111
|
+
const messagesToSave = messages.slice(-MAX_STORED_MESSAGES);
|
|
112
|
+
yield Promise.all(messagesToSave.map((msg, index)=>{
|
|
113
|
+
const lightMessage = _object_spread_props(_object_spread({}, msg), {
|
|
114
|
+
result: 'result' === msg.type ? void 0 : msg.result
|
|
115
|
+
});
|
|
116
|
+
const data = {
|
|
117
|
+
id: msg.id || `msg-${index}`,
|
|
118
|
+
data: lightMessage,
|
|
119
|
+
timestamp: msg.timestamp ? msg.timestamp.getTime() : Date.now() + index
|
|
120
|
+
};
|
|
121
|
+
return this.dbManager.put(MESSAGES_STORE, data);
|
|
122
|
+
}));
|
|
123
|
+
}).call(this), 'Failed to save messages to IndexedDB', void 0, this.messagesCleanup);
|
|
124
|
+
}).call(this);
|
|
125
|
+
}
|
|
126
|
+
loadMessages() {
|
|
127
|
+
return _async_to_generator(function*() {
|
|
128
|
+
const result = yield (0, baseDB_namespaceObject.withErrorHandling)(()=>_async_to_generator(function*() {
|
|
129
|
+
const messages = yield this.dbManager.getAll(MESSAGES_STORE, true);
|
|
130
|
+
if (0 === messages.length) return [];
|
|
131
|
+
return Promise.all(messages.map((msg)=>_async_to_generator(function*() {
|
|
132
|
+
const item = msg.data;
|
|
133
|
+
const restoredItem = _object_spread_props(_object_spread({}, item), {
|
|
134
|
+
timestamp: new Date(item.timestamp)
|
|
135
|
+
});
|
|
136
|
+
if ('result' === item.type && item.id) {
|
|
137
|
+
const fullResult = yield this.loadResult(item.id);
|
|
138
|
+
if (fullResult) {
|
|
139
|
+
restoredItem.result = fullResult.result;
|
|
140
|
+
restoredItem.replayScriptsInfo = fullResult.replayScriptsInfo;
|
|
141
|
+
restoredItem.replayCounter = fullResult.replayCounter;
|
|
142
|
+
restoredItem.verticalMode = fullResult.verticalMode;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return restoredItem;
|
|
146
|
+
}).call(this)));
|
|
147
|
+
}).call(this), 'Failed to load messages from IndexedDB', [], this.messagesCleanup);
|
|
148
|
+
return result || [];
|
|
149
|
+
}).call(this);
|
|
110
150
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
151
|
+
clearMessages() {
|
|
152
|
+
return _async_to_generator(function*() {
|
|
153
|
+
yield (0, baseDB_namespaceObject.withErrorHandling)(()=>_async_to_generator(function*() {
|
|
154
|
+
yield Promise.all([
|
|
155
|
+
this.dbManager.clear(MESSAGES_STORE),
|
|
156
|
+
this.dbManager.clear(RESULTS_STORE)
|
|
157
|
+
]);
|
|
158
|
+
}).call(this), 'Failed to clear messages from IndexedDB');
|
|
159
|
+
}).call(this);
|
|
160
|
+
}
|
|
161
|
+
saveResult(id, result) {
|
|
162
|
+
return _async_to_generator(function*() {
|
|
163
|
+
yield (0, baseDB_namespaceObject.withErrorHandling)(()=>_async_to_generator(function*() {
|
|
164
|
+
const compressedResult = this.compressResultForStorage(result);
|
|
165
|
+
const data = {
|
|
166
|
+
id,
|
|
167
|
+
data: compressedResult,
|
|
168
|
+
timestamp: Date.now(),
|
|
169
|
+
size: JSON.stringify(compressedResult).length
|
|
170
|
+
};
|
|
171
|
+
yield this.dbManager.put(RESULTS_STORE, data);
|
|
172
|
+
}).call(this), 'Failed to save result to IndexedDB', void 0, this.resultsCleanup);
|
|
173
|
+
}).call(this);
|
|
174
|
+
}
|
|
175
|
+
loadResult(id) {
|
|
176
|
+
return _async_to_generator(function*() {
|
|
177
|
+
const result = yield (0, baseDB_namespaceObject.withErrorHandling)(()=>_async_to_generator(function*() {
|
|
178
|
+
const data = yield this.dbManager.get(RESULTS_STORE, id);
|
|
179
|
+
return (null == data ? void 0 : data.data) || null;
|
|
180
|
+
}).call(this), 'Failed to load result from IndexedDB', null);
|
|
181
|
+
return result || null;
|
|
182
|
+
}).call(this);
|
|
117
183
|
}
|
|
118
184
|
compressResultForStorage(result) {
|
|
119
185
|
var _result_result_dump, _result_result;
|
|
120
|
-
if (!(null == (_result_result = result.result) ? void 0 : null == (_result_result_dump = _result_result.dump) ? void 0 : _result_result_dump.
|
|
121
|
-
const
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
})) || []
|
|
140
|
-
};
|
|
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
|
+
}))
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
return _object_spread_props(_object_spread({}, result), {
|
|
200
|
+
result: _object_spread_props(_object_spread({}, result.result), {
|
|
201
|
+
dump: _object_spread_props(_object_spread({}, result.result.dump), {
|
|
202
|
+
tasks: compressedTasks
|
|
203
|
+
})
|
|
204
|
+
})
|
|
141
205
|
});
|
|
142
|
-
return {
|
|
143
|
-
...result,
|
|
144
|
-
result: {
|
|
145
|
-
...result.result,
|
|
146
|
-
dump: {
|
|
147
|
-
...result.result.dump,
|
|
148
|
-
executions: compressedExecutions
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
206
|
}
|
|
153
207
|
compressScreenshotIfNeeded(screenshot) {
|
|
154
208
|
if (!screenshot) return screenshot;
|
|
@@ -158,30 +212,34 @@ class IndexedDBStorageProvider {
|
|
|
158
212
|
}
|
|
159
213
|
return screenshot;
|
|
160
214
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
215
|
+
getStorageStats() {
|
|
216
|
+
return _async_to_generator(function*() {
|
|
217
|
+
const result = yield (0, baseDB_namespaceObject.withErrorHandling)(()=>_async_to_generator(function*() {
|
|
218
|
+
const [messageCount, resultCount] = yield Promise.all([
|
|
219
|
+
this.dbManager.count(MESSAGES_STORE),
|
|
220
|
+
this.dbManager.count(RESULTS_STORE)
|
|
221
|
+
]);
|
|
222
|
+
return {
|
|
223
|
+
messageCount,
|
|
224
|
+
resultCount
|
|
225
|
+
};
|
|
226
|
+
}).call(this), 'Failed to get storage statistics', {
|
|
227
|
+
messageCount: 0,
|
|
228
|
+
resultCount: 0
|
|
229
|
+
});
|
|
230
|
+
return result || {
|
|
231
|
+
messageCount: 0,
|
|
232
|
+
resultCount: 0
|
|
170
233
|
};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
async cleanup() {
|
|
181
|
-
await Promise.all([
|
|
182
|
-
this.messagesCleanup(),
|
|
183
|
-
this.resultsCleanup()
|
|
184
|
-
]);
|
|
234
|
+
}).call(this);
|
|
235
|
+
}
|
|
236
|
+
cleanup() {
|
|
237
|
+
return _async_to_generator(function*() {
|
|
238
|
+
yield Promise.all([
|
|
239
|
+
this.messagesCleanup(),
|
|
240
|
+
this.resultsCleanup()
|
|
241
|
+
]);
|
|
242
|
+
}).call(this);
|
|
185
243
|
}
|
|
186
244
|
constructor(namespace = 'playground'){
|
|
187
245
|
_define_property(this, "dbManager", void 0);
|
|
@@ -204,22 +262,30 @@ class IndexedDBStorageProvider {
|
|
|
204
262
|
}
|
|
205
263
|
}
|
|
206
264
|
class MemoryStorageProvider {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
265
|
+
saveMessages(messages) {
|
|
266
|
+
return _async_to_generator(function*() {
|
|
267
|
+
this.messages = [
|
|
268
|
+
...messages
|
|
269
|
+
];
|
|
270
|
+
}).call(this);
|
|
211
271
|
}
|
|
212
|
-
|
|
213
|
-
return
|
|
214
|
-
|
|
215
|
-
|
|
272
|
+
loadMessages() {
|
|
273
|
+
return _async_to_generator(function*() {
|
|
274
|
+
return [
|
|
275
|
+
...this.messages
|
|
276
|
+
];
|
|
277
|
+
}).call(this);
|
|
216
278
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
279
|
+
clearMessages() {
|
|
280
|
+
return _async_to_generator(function*() {
|
|
281
|
+
this.messages = [];
|
|
282
|
+
this.results.clear();
|
|
283
|
+
}).call(this);
|
|
220
284
|
}
|
|
221
|
-
|
|
222
|
-
|
|
285
|
+
saveResult(id, result) {
|
|
286
|
+
return _async_to_generator(function*() {
|
|
287
|
+
this.results.set(id, result);
|
|
288
|
+
}).call(this);
|
|
223
289
|
}
|
|
224
290
|
constructor(){
|
|
225
291
|
_define_property(this, "messages", []);
|
|
@@ -227,21 +293,29 @@ class MemoryStorageProvider {
|
|
|
227
293
|
}
|
|
228
294
|
}
|
|
229
295
|
class NoOpStorageProvider {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
296
|
+
saveMessages(_messages) {
|
|
297
|
+
return _async_to_generator(function*() {})();
|
|
298
|
+
}
|
|
299
|
+
loadMessages() {
|
|
300
|
+
return _async_to_generator(function*() {
|
|
301
|
+
return [];
|
|
302
|
+
})();
|
|
303
|
+
}
|
|
304
|
+
clearMessages() {
|
|
305
|
+
return _async_to_generator(function*() {})();
|
|
306
|
+
}
|
|
307
|
+
saveResult(_id, _result) {
|
|
308
|
+
return _async_to_generator(function*() {})();
|
|
233
309
|
}
|
|
234
|
-
async clearMessages() {}
|
|
235
|
-
async saveResult(_id, _result) {}
|
|
236
310
|
}
|
|
237
311
|
exports.IndexedDBStorageProvider = __webpack_exports__.IndexedDBStorageProvider;
|
|
238
312
|
exports.MemoryStorageProvider = __webpack_exports__.MemoryStorageProvider;
|
|
239
313
|
exports.NoOpStorageProvider = __webpack_exports__.NoOpStorageProvider;
|
|
240
|
-
for(var
|
|
314
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
241
315
|
"IndexedDBStorageProvider",
|
|
242
316
|
"MemoryStorageProvider",
|
|
243
317
|
"NoOpStorageProvider"
|
|
244
|
-
].indexOf(
|
|
318
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
245
319
|
Object.defineProperty(exports, '__esModule', {
|
|
246
320
|
value: true
|
|
247
321
|
});
|