@godscene/visualizer 1.7.18 → 1.7.20
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/universal-playground/providers/storage-provider.mjs +9 -0
- package/dist/es/component/universal-playground/universal-playground-electron.mjs +8 -8
- package/dist/es/hooks/usePlaygroundState.mjs +5 -0
- package/dist/lib/component/universal-playground/providers/storage-provider.js +9 -0
- package/dist/lib/component/universal-playground/universal-playground-electron.js +8 -8
- package/dist/lib/hooks/usePlaygroundState.js +5 -0
- package/package.json +5 -5
|
@@ -274,6 +274,15 @@ function createStorageProvider(type = "indexeddb", namespace = 'playground') {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
function detectBestStorageType() {
|
|
277
|
+
if ("u" > typeof indexedDB) try {
|
|
278
|
+
indexedDB.open('test', 1).onerror = ()=>{};
|
|
279
|
+
return "indexeddb";
|
|
280
|
+
} catch (unused) {}
|
|
281
|
+
if ("u" > typeof localStorage) try {
|
|
282
|
+
localStorage.setItem('test', 'test');
|
|
283
|
+
localStorage.removeItem('test');
|
|
284
|
+
return "localStorage";
|
|
285
|
+
} catch (unused) {}
|
|
277
286
|
return "memory";
|
|
278
287
|
}
|
|
279
288
|
export { MemoryStorageProvider as IndexedDBMemoryStorageProvider, NoOpStorageProvider as IndexedDBNoOpStorageProvider, IndexedDBStorageProvider, LocalStorageProvider, storage_provider_MemoryStorageProvider as MemoryStorageProvider, storage_provider_NoOpStorageProvider as NoOpStorageProvider, storage_provider_StorageType as StorageType, createStorageProvider, detectBestStorageType };
|
|
@@ -231,7 +231,7 @@ function UniversalPlaygroundElectron({ storage, contextProvider, config: compone
|
|
|
231
231
|
useEffect(()=>{
|
|
232
232
|
var _window_electron, _window_electron1, _window_electron2, _window_electron3;
|
|
233
233
|
clearInfoList();
|
|
234
|
-
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.on(
|
|
234
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.on("test-center-generate-script:execute-start", (e, value, thisRunningId)=>{
|
|
235
235
|
const sub = value.prompt || value.params ? value.prompt || JSON.stringify(value.params) : '';
|
|
236
236
|
const displayContent = sub;
|
|
237
237
|
const userItem = {
|
|
@@ -258,7 +258,7 @@ function UniversalPlaygroundElectron({ storage, contextProvider, config: compone
|
|
|
258
258
|
systemItem
|
|
259
259
|
]);
|
|
260
260
|
});
|
|
261
|
-
null == (_window_electron1 = window.electron) || _window_electron1.ipcRenderer.on(
|
|
261
|
+
null == (_window_electron1 = window.electron) || _window_electron1.ipcRenderer.on("test-center-generate-script:execute-result", (e, value, thisRunningId)=>{
|
|
262
262
|
console.log('rpascene-execute-result', value, thisRunningId);
|
|
263
263
|
const result = _object_spread({}, BLANK_RESULT);
|
|
264
264
|
try {
|
|
@@ -317,7 +317,7 @@ function UniversalPlaygroundElectron({ storage, contextProvider, config: compone
|
|
|
317
317
|
resultItem
|
|
318
318
|
]);
|
|
319
319
|
});
|
|
320
|
-
null == (_window_electron2 = window.electron) || _window_electron2.ipcRenderer.on(
|
|
320
|
+
null == (_window_electron2 = window.electron) || _window_electron2.ipcRenderer.on("test-center-generate-script:execute-prepare", (e, tip, thisRunningId)=>{
|
|
321
321
|
setLoading(true);
|
|
322
322
|
setInfoList((prev)=>{
|
|
323
323
|
const lastItem = prev[prev.length - 1];
|
|
@@ -335,7 +335,7 @@ function UniversalPlaygroundElectron({ storage, contextProvider, config: compone
|
|
|
335
335
|
];
|
|
336
336
|
});
|
|
337
337
|
});
|
|
338
|
-
null == (_window_electron3 = window.electron) || _window_electron3.ipcRenderer.on(
|
|
338
|
+
null == (_window_electron3 = window.electron) || _window_electron3.ipcRenderer.on("test-center-generate-script:execute-progress", (e, thisRunningId, executionDump)=>{
|
|
339
339
|
var _executionDump_tasks;
|
|
340
340
|
if (interruptedFlagRef.current[thisRunningId] || !(null == executionDump ? void 0 : null == (_executionDump_tasks = executionDump.tasks) ? void 0 : _executionDump_tasks.length)) return;
|
|
341
341
|
const progressItems = executionDump.tasks.map((task, index)=>{
|
|
@@ -365,10 +365,10 @@ function UniversalPlaygroundElectron({ storage, contextProvider, config: compone
|
|
|
365
365
|
});
|
|
366
366
|
return ()=>{
|
|
367
367
|
var _window_electron, _window_electron1, _window_electron2, _window_electron3;
|
|
368
|
-
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.removeAllListeners(
|
|
369
|
-
null == (_window_electron1 = window.electron) || _window_electron1.ipcRenderer.removeAllListeners(
|
|
370
|
-
null == (_window_electron2 = window.electron) || _window_electron2.ipcRenderer.removeAllListeners(
|
|
371
|
-
null == (_window_electron3 = window.electron) || _window_electron3.ipcRenderer.removeAllListeners(
|
|
368
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.removeAllListeners("test-center-generate-script:execute-prepare");
|
|
369
|
+
null == (_window_electron1 = window.electron) || _window_electron1.ipcRenderer.removeAllListeners("test-center-generate-script:execute-start");
|
|
370
|
+
null == (_window_electron2 = window.electron) || _window_electron2.ipcRenderer.removeAllListeners("test-center-generate-script:execute-result");
|
|
371
|
+
null == (_window_electron3 = window.electron) || _window_electron3.ipcRenderer.removeAllListeners("test-center-generate-script:execute-progress");
|
|
372
372
|
};
|
|
373
373
|
}, []);
|
|
374
374
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -310,6 +310,15 @@ function createStorageProvider(type = "indexeddb", namespace = 'playground') {
|
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
function detectBestStorageType() {
|
|
313
|
+
if ("u" > typeof indexedDB) try {
|
|
314
|
+
indexedDB.open('test', 1).onerror = ()=>{};
|
|
315
|
+
return "indexeddb";
|
|
316
|
+
} catch (unused) {}
|
|
317
|
+
if ("u" > typeof localStorage) try {
|
|
318
|
+
localStorage.setItem('test', 'test');
|
|
319
|
+
localStorage.removeItem('test');
|
|
320
|
+
return "localStorage";
|
|
321
|
+
} catch (unused) {}
|
|
313
322
|
return "memory";
|
|
314
323
|
}
|
|
315
324
|
exports.IndexedDBMemoryStorageProvider = __webpack_exports__.IndexedDBMemoryStorageProvider;
|
|
@@ -272,7 +272,7 @@ function UniversalPlaygroundElectron({ storage, contextProvider, config: compone
|
|
|
272
272
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
273
273
|
var _window_electron, _window_electron1, _window_electron2, _window_electron3;
|
|
274
274
|
clearInfoList();
|
|
275
|
-
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.on(
|
|
275
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.on("test-center-generate-script:execute-start", (e, value, thisRunningId)=>{
|
|
276
276
|
const sub = value.prompt || value.params ? value.prompt || JSON.stringify(value.params) : '';
|
|
277
277
|
const displayContent = sub;
|
|
278
278
|
const userItem = {
|
|
@@ -299,7 +299,7 @@ function UniversalPlaygroundElectron({ storage, contextProvider, config: compone
|
|
|
299
299
|
systemItem
|
|
300
300
|
]);
|
|
301
301
|
});
|
|
302
|
-
null == (_window_electron1 = window.electron) || _window_electron1.ipcRenderer.on(
|
|
302
|
+
null == (_window_electron1 = window.electron) || _window_electron1.ipcRenderer.on("test-center-generate-script:execute-result", (e, value, thisRunningId)=>{
|
|
303
303
|
console.log('rpascene-execute-result', value, thisRunningId);
|
|
304
304
|
const result = _object_spread({}, constants_js_namespaceObject.BLANK_RESULT);
|
|
305
305
|
try {
|
|
@@ -358,7 +358,7 @@ function UniversalPlaygroundElectron({ storage, contextProvider, config: compone
|
|
|
358
358
|
resultItem
|
|
359
359
|
]);
|
|
360
360
|
});
|
|
361
|
-
null == (_window_electron2 = window.electron) || _window_electron2.ipcRenderer.on(
|
|
361
|
+
null == (_window_electron2 = window.electron) || _window_electron2.ipcRenderer.on("test-center-generate-script:execute-prepare", (e, tip, thisRunningId)=>{
|
|
362
362
|
setLoading(true);
|
|
363
363
|
setInfoList((prev)=>{
|
|
364
364
|
const lastItem = prev[prev.length - 1];
|
|
@@ -376,7 +376,7 @@ function UniversalPlaygroundElectron({ storage, contextProvider, config: compone
|
|
|
376
376
|
];
|
|
377
377
|
});
|
|
378
378
|
});
|
|
379
|
-
null == (_window_electron3 = window.electron) || _window_electron3.ipcRenderer.on(
|
|
379
|
+
null == (_window_electron3 = window.electron) || _window_electron3.ipcRenderer.on("test-center-generate-script:execute-progress", (e, thisRunningId, executionDump)=>{
|
|
380
380
|
var _executionDump_tasks;
|
|
381
381
|
if (interruptedFlagRef.current[thisRunningId] || !(null == executionDump ? void 0 : null == (_executionDump_tasks = executionDump.tasks) ? void 0 : _executionDump_tasks.length)) return;
|
|
382
382
|
const progressItems = executionDump.tasks.map((task, index)=>{
|
|
@@ -406,10 +406,10 @@ function UniversalPlaygroundElectron({ storage, contextProvider, config: compone
|
|
|
406
406
|
});
|
|
407
407
|
return ()=>{
|
|
408
408
|
var _window_electron, _window_electron1, _window_electron2, _window_electron3;
|
|
409
|
-
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.removeAllListeners(
|
|
410
|
-
null == (_window_electron1 = window.electron) || _window_electron1.ipcRenderer.removeAllListeners(
|
|
411
|
-
null == (_window_electron2 = window.electron) || _window_electron2.ipcRenderer.removeAllListeners(
|
|
412
|
-
null == (_window_electron3 = window.electron) || _window_electron3.ipcRenderer.removeAllListeners(
|
|
409
|
+
null == (_window_electron = window.electron) || _window_electron.ipcRenderer.removeAllListeners("test-center-generate-script:execute-prepare");
|
|
410
|
+
null == (_window_electron1 = window.electron) || _window_electron1.ipcRenderer.removeAllListeners("test-center-generate-script:execute-start");
|
|
411
|
+
null == (_window_electron2 = window.electron) || _window_electron2.ipcRenderer.removeAllListeners("test-center-generate-script:execute-result");
|
|
412
|
+
null == (_window_electron3 = window.electron) || _window_electron3.ipcRenderer.removeAllListeners("test-center-generate-script:execute-progress");
|
|
413
413
|
};
|
|
414
414
|
}, []);
|
|
415
415
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
@@ -281,6 +281,11 @@ function usePlaygroundState(playgroundSDK, storage, contextProvider, targetName)
|
|
|
281
281
|
})(), [
|
|
282
282
|
contextProvider
|
|
283
283
|
]);
|
|
284
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
285
|
+
clearInfoList();
|
|
286
|
+
}, [
|
|
287
|
+
clearInfoList
|
|
288
|
+
]);
|
|
284
289
|
return {
|
|
285
290
|
loading,
|
|
286
291
|
setLoading,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@godscene/visualizer",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.20",
|
|
4
4
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
5
5
|
"homepage": "https://midscenejs.com/",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"antd": "^5.21.6",
|
|
67
67
|
"buffer": "6.0.3",
|
|
68
68
|
"dayjs": "^1.11.11",
|
|
69
|
-
"@godscene/
|
|
70
|
-
"@godscene/
|
|
71
|
-
"@godscene/
|
|
72
|
-
"@godscene/
|
|
69
|
+
"@godscene/playground": "1.7.20",
|
|
70
|
+
"@godscene/shared": "1.7.20",
|
|
71
|
+
"@godscene/core": "1.7.20",
|
|
72
|
+
"@godscene/web": "1.7.20"
|
|
73
73
|
},
|
|
74
74
|
"license": "MIT",
|
|
75
75
|
"scripts": {
|