@midscene/visualizer 0.26.2 → 0.26.3-beta-20250813021342.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/blank_polyfill.mjs +2 -0
- package/dist/es/component/blackboard.css +12 -5
- package/dist/es/component/blackboard.mjs +266 -0
- package/dist/es/component/color.mjs +35 -0
- package/dist/es/component/describer.css +9 -5
- package/dist/es/component/describer.mjs +128 -0
- package/dist/es/component/env-config.mjs +112 -0
- package/dist/es/component/github-star.css +1 -0
- package/dist/es/component/github-star.mjs +20 -0
- package/dist/es/component/logo.css +5 -3
- package/dist/es/component/logo.mjs +20 -0
- package/dist/es/component/misc.mjs +54 -0
- package/dist/es/component/pixi-loader.mjs +16 -0
- package/dist/es/component/player.css +88 -70
- package/dist/es/component/player.mjs +628 -0
- package/dist/es/component/playground/ConfigSelector.mjs +53 -0
- package/dist/es/component/playground/ContextPreview.mjs +39 -0
- package/dist/es/component/playground/HistorySelector.mjs +193 -0
- package/dist/es/component/playground/PlaygroundResult.mjs +60 -0
- package/dist/es/component/playground/PromptInput.mjs +225 -0
- package/dist/es/component/playground/ServiceModeControl.mjs +100 -0
- package/dist/es/component/playground/index.css +140 -98
- package/dist/es/component/playground/playground-constants.mjs +45 -0
- package/dist/es/component/playground/playground-utils.mjs +89 -0
- package/dist/es/component/playground/useServerValid.mjs +27 -0
- package/dist/es/component/playground/useStaticPageAgent.mjs +12 -0
- package/dist/es/component/replay-scripts.mjs +271 -0
- package/dist/es/component/shiny-text.css +33 -22
- package/dist/es/component/shiny-text.mjs +15 -0
- package/dist/es/component/store/history.mjs +55 -0
- package/dist/es/component/store/store.mjs +128 -0
- package/dist/es/icons/close.mjs +19 -0
- package/dist/es/icons/history.mjs +30 -0
- package/dist/es/icons/magnifying-glass.mjs +39 -0
- package/dist/es/icons/setting.mjs +20 -0
- package/dist/es/index.mjs +21 -0
- package/dist/es/init.mjs +10 -0
- package/dist/es/{utils.js → utils.mjs} +51 -75
- package/dist/lib/blank_polyfill.js +34 -38
- package/dist/lib/component/blackboard.css +12 -5
- package/dist/lib/component/blackboard.js +293 -306
- package/dist/lib/component/color.js +64 -74
- package/dist/lib/component/describer.css +9 -5
- package/dist/lib/component/describer.js +158 -198
- package/dist/lib/component/env-config.js +142 -147
- package/dist/lib/component/github-star.css +1 -0
- package/dist/lib/component/github-star.js +51 -62
- package/dist/lib/component/logo.css +5 -3
- package/dist/lib/component/logo.js +53 -56
- package/dist/lib/component/misc.js +85 -84
- package/dist/lib/component/pixi-loader.js +49 -80
- package/dist/lib/component/player.css +88 -70
- package/dist/lib/component/player.js +627 -738
- package/dist/lib/component/playground/ConfigSelector.js +91 -92
- package/dist/lib/component/playground/ContextPreview.js +80 -72
- package/dist/lib/component/playground/HistorySelector.js +234 -197
- package/dist/lib/component/playground/PlaygroundResult.js +100 -103
- package/dist/lib/component/playground/PromptInput.js +250 -237
- package/dist/lib/component/playground/ServiceModeControl.js +124 -124
- package/dist/lib/component/playground/index.css +140 -98
- package/dist/lib/component/playground/playground-constants.js +97 -73
- package/dist/lib/component/playground/playground-types.js +17 -31
- package/dist/lib/component/playground/playground-utils.js +140 -168
- package/dist/lib/component/playground/useServerValid.js +55 -86
- package/dist/lib/component/playground/useStaticPageAgent.js +45 -51
- package/dist/lib/component/replay-scripts.js +291 -373
- package/dist/lib/component/shiny-text.css +33 -22
- package/dist/lib/component/shiny-text.js +46 -57
- package/dist/lib/component/store/history.js +58 -64
- package/dist/lib/component/store/store.js +132 -128
- package/dist/lib/icons/close.js +53 -0
- package/dist/lib/icons/history.js +64 -0
- package/dist/lib/icons/magnifying-glass.js +73 -0
- package/dist/lib/icons/setting.js +54 -0
- package/dist/lib/index.js +158 -124
- package/dist/lib/init.js +39 -46
- package/dist/lib/utils.js +105 -109
- package/dist/types/blank_polyfill.d.ts +2 -2
- package/dist/types/component/playground/ConfigSelector.d.ts +1 -0
- package/dist/types/component/playground/ContextPreview.d.ts +1 -0
- package/dist/types/component/playground/HistorySelector.d.ts +1 -0
- package/dist/types/component/playground/PlaygroundResult.d.ts +1 -0
- package/dist/types/component/playground/PromptInput.d.ts +1 -0
- package/dist/types/component/playground/ServiceModeControl.d.ts +1 -0
- package/package.json +16 -18
- package/dist/es/assets/close.909351c0.svg +0 -4
- package/dist/es/assets/history.164a4eab.svg +0 -4
- package/dist/es/assets/magnifying-glass.9498e70e.svg +0 -12
- package/dist/es/assets/setting.80ab7285.svg +0 -11
- package/dist/es/blank_polyfill.js +0 -10
- package/dist/es/component/blackboard.js +0 -286
- package/dist/es/component/color.js +0 -49
- package/dist/es/component/describer.js +0 -173
- package/dist/es/component/env-config.js +0 -117
- package/dist/es/component/github-star.js +0 -31
- package/dist/es/component/logo.js +0 -25
- package/dist/es/component/misc.js +0 -63
- package/dist/es/component/pixi-loader.js +0 -51
- package/dist/es/component/player.js +0 -746
- package/dist/es/component/playground/ConfigSelector.js +0 -64
- package/dist/es/component/playground/ContextPreview.js +0 -42
- package/dist/es/component/playground/HistorySelector.js +0 -168
- package/dist/es/component/playground/PlaygroundResult.js +0 -73
- package/dist/es/component/playground/PromptInput.js +0 -212
- package/dist/es/component/playground/ServiceModeControl.js +0 -100
- package/dist/es/component/playground/playground-constants.js +0 -39
- package/dist/es/component/playground/playground-types.js +0 -6
- package/dist/es/component/playground/playground-utils.js +0 -141
- package/dist/es/component/playground/useServerValid.js +0 -58
- package/dist/es/component/playground/useStaticPageAgent.js +0 -20
- package/dist/es/component/replay-scripts.js +0 -361
- package/dist/es/component/shiny-text.js +0 -30
- package/dist/es/component/store/history.js +0 -34
- package/dist/es/component/store/store.js +0 -99
- package/dist/es/index.js +0 -79
- package/dist/es/init.js +0 -17
- package/dist/index.css +0 -595
- package/dist/index.js +0 -1
- package/dist/lib/assets/close.909351c0.svg +0 -4
- package/dist/lib/assets/history.164a4eab.svg +0 -4
- package/dist/lib/assets/magnifying-glass.9498e70e.svg +0 -12
- package/dist/lib/assets/setting.80ab7285.svg +0 -11
- package/dist/lib/component/common.css +0 -0
- /package/dist/es/component/{common.css → playground/playground-types.mjs} +0 -0
|
@@ -1,181 +1,153 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var __async = (__this, __arguments, generator) => {
|
|
30
|
-
return new Promise((resolve, reject) => {
|
|
31
|
-
var fulfilled = (value) => {
|
|
32
|
-
try {
|
|
33
|
-
step(generator.next(value));
|
|
34
|
-
} catch (e) {
|
|
35
|
-
reject(e);
|
|
36
|
-
}
|
|
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
|
+
});
|
|
37
9
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
+
});
|
|
44
22
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
serverBase: () => serverBase,
|
|
61
|
-
staticAgentFromContext: () => staticAgentFromContext
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
blankResult: ()=>blankResult,
|
|
28
|
+
formatErrorMessage: ()=>formatErrorMessage,
|
|
29
|
+
serverBase: ()=>serverBase,
|
|
30
|
+
actionNameForType: ()=>actionNameForType,
|
|
31
|
+
getPlaceholderForType: ()=>getPlaceholderForType,
|
|
32
|
+
cancelTask: ()=>cancelTask,
|
|
33
|
+
requestPlaygroundServer: ()=>requestPlaygroundServer,
|
|
34
|
+
staticAgentFromContext: ()=>staticAgentFromContext,
|
|
35
|
+
checkServerStatus: ()=>checkServerStatus,
|
|
36
|
+
overrideServerConfig: ()=>overrideServerConfig,
|
|
37
|
+
getTaskProgress: ()=>getTaskProgress
|
|
62
38
|
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
39
|
+
const constants_namespaceObject = require("@midscene/shared/constants");
|
|
40
|
+
const playground_namespaceObject = require("@midscene/web/playground");
|
|
41
|
+
const serverBase = `http://localhost:${constants_namespaceObject.PLAYGROUND_SERVER_PORT}`;
|
|
42
|
+
const checkServerStatus = async ()=>{
|
|
43
|
+
try {
|
|
44
|
+
const res = await fetch(`${serverBase}/status`);
|
|
45
|
+
return 200 === res.status;
|
|
46
|
+
} catch (e) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
69
49
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (requestId) {
|
|
87
|
-
payload.requestId = requestId;
|
|
88
|
-
}
|
|
89
|
-
if (deepThink) {
|
|
90
|
-
payload.deepThink = deepThink;
|
|
91
|
-
}
|
|
92
|
-
const res = yield fetch(`${serverBase}/execute`, {
|
|
93
|
-
method: "POST",
|
|
94
|
-
headers: {
|
|
95
|
-
"Content-Type": "application/json"
|
|
96
|
-
},
|
|
97
|
-
body: JSON.stringify(payload)
|
|
98
|
-
});
|
|
99
|
-
return res.json();
|
|
100
|
-
});
|
|
101
|
-
const overrideServerConfig = (aiConfig) => __async(void 0, null, function* () {
|
|
102
|
-
return fetch(`${serverBase}/config`, {
|
|
103
|
-
method: "POST",
|
|
104
|
-
headers: {
|
|
105
|
-
"Content-Type": "application/json"
|
|
106
|
-
},
|
|
107
|
-
body: JSON.stringify({ aiConfig })
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
const cancelTask = (requestId) => __async(void 0, null, function* () {
|
|
111
|
-
try {
|
|
112
|
-
const res = yield fetch(`${serverBase}/cancel/${requestId}`);
|
|
50
|
+
const requestPlaygroundServer = async function(context, type, prompt) {
|
|
51
|
+
let { requestId, deepThink } = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
|
|
52
|
+
const payload = {
|
|
53
|
+
context,
|
|
54
|
+
type,
|
|
55
|
+
prompt
|
|
56
|
+
};
|
|
57
|
+
if (requestId) payload.requestId = requestId;
|
|
58
|
+
if (deepThink) payload.deepThink = deepThink;
|
|
59
|
+
const res = await fetch(`${serverBase}/execute`, {
|
|
60
|
+
method: 'POST',
|
|
61
|
+
headers: {
|
|
62
|
+
'Content-Type': 'application/json'
|
|
63
|
+
},
|
|
64
|
+
body: JSON.stringify(payload)
|
|
65
|
+
});
|
|
113
66
|
return res.json();
|
|
114
|
-
} catch (error) {
|
|
115
|
-
import_console_browserify.default.error("Failed to cancel task:", error);
|
|
116
|
-
return { error: "Failed to cancel task" };
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
const getTaskProgress = (requestId) => __async(void 0, null, function* () {
|
|
120
|
-
try {
|
|
121
|
-
const response = yield fetch(`${serverBase}/task-progress/${requestId}`);
|
|
122
|
-
return yield response.json();
|
|
123
|
-
} catch (error) {
|
|
124
|
-
import_console_browserify.default.error("Failed to poll task progress:", error);
|
|
125
|
-
return { tip: null };
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
const actionNameForType = (type) => {
|
|
129
|
-
if (type === "aiAction")
|
|
130
|
-
return "Action";
|
|
131
|
-
if (type === "aiQuery")
|
|
132
|
-
return "Query";
|
|
133
|
-
if (type === "aiAssert")
|
|
134
|
-
return "Assert";
|
|
135
|
-
if (type === "aiTap")
|
|
136
|
-
return "Tap";
|
|
137
|
-
return type;
|
|
138
67
|
};
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
68
|
+
const overrideServerConfig = async (aiConfig)=>fetch(`${serverBase}/config`, {
|
|
69
|
+
method: 'POST',
|
|
70
|
+
headers: {
|
|
71
|
+
'Content-Type': 'application/json'
|
|
72
|
+
},
|
|
73
|
+
body: JSON.stringify({
|
|
74
|
+
aiConfig
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
const cancelTask = async (requestId)=>{
|
|
78
|
+
try {
|
|
79
|
+
const res = await fetch(`${serverBase}/cancel/${requestId}`);
|
|
80
|
+
return res.json();
|
|
81
|
+
} catch (error) {
|
|
82
|
+
console.error('Failed to cancel task:', error);
|
|
83
|
+
return {
|
|
84
|
+
error: 'Failed to cancel task'
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const getTaskProgress = async (requestId)=>{
|
|
89
|
+
try {
|
|
90
|
+
const response = await fetch(`${serverBase}/task-progress/${requestId}`);
|
|
91
|
+
return await response.json();
|
|
92
|
+
} catch (error) {
|
|
93
|
+
console.error('Failed to poll task progress:', error);
|
|
94
|
+
return {
|
|
95
|
+
tip: null
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const actionNameForType = (type)=>{
|
|
100
|
+
if ('aiAction' === type) return 'Action';
|
|
101
|
+
if ('aiQuery' === type) return 'Query';
|
|
102
|
+
if ('aiAssert' === type) return 'Assert';
|
|
103
|
+
if ('aiTap' === type) return 'Tap';
|
|
104
|
+
return type;
|
|
105
|
+
};
|
|
106
|
+
const staticAgentFromContext = (context)=>{
|
|
107
|
+
const page = new playground_namespaceObject.StaticPage(context);
|
|
108
|
+
return new playground_namespaceObject.StaticPageAgent(page);
|
|
142
109
|
};
|
|
143
|
-
const formatErrorMessage = (e)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (!(errorMessage == null ? void 0 : errorMessage.includes(import_playground.ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED))) {
|
|
149
|
-
return errorMessage;
|
|
150
|
-
}
|
|
151
|
-
return "Unknown error";
|
|
110
|
+
const formatErrorMessage = (e)=>{
|
|
111
|
+
const errorMessage = (null == e ? void 0 : e.message) || '';
|
|
112
|
+
if (errorMessage.includes('of different extension')) return 'Conflicting extension detected. Please disable the suspicious plugins and refresh the page. Guide: https://midscenejs.com/quick-experience.html#faq';
|
|
113
|
+
if (!(null == errorMessage ? void 0 : errorMessage.includes(playground_namespaceObject.ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED))) return errorMessage;
|
|
114
|
+
return 'Unknown error';
|
|
152
115
|
};
|
|
153
|
-
const getPlaceholderForType = (type)
|
|
154
|
-
|
|
155
|
-
return
|
|
156
|
-
|
|
157
|
-
if (type === "aiAssert") {
|
|
158
|
-
return "What do you want to assert?";
|
|
159
|
-
}
|
|
160
|
-
return "What do you want to do?";
|
|
116
|
+
const getPlaceholderForType = (type)=>{
|
|
117
|
+
if ('aiQuery' === type) return 'What do you want to query?';
|
|
118
|
+
if ('aiAssert' === type) return 'What do you want to assert?';
|
|
119
|
+
return 'What do you want to do?';
|
|
161
120
|
};
|
|
162
121
|
const blankResult = {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
122
|
+
result: null,
|
|
123
|
+
dump: null,
|
|
124
|
+
reportHTML: null,
|
|
125
|
+
error: null
|
|
167
126
|
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
127
|
+
exports.actionNameForType = __webpack_exports__.actionNameForType;
|
|
128
|
+
exports.blankResult = __webpack_exports__.blankResult;
|
|
129
|
+
exports.cancelTask = __webpack_exports__.cancelTask;
|
|
130
|
+
exports.checkServerStatus = __webpack_exports__.checkServerStatus;
|
|
131
|
+
exports.formatErrorMessage = __webpack_exports__.formatErrorMessage;
|
|
132
|
+
exports.getPlaceholderForType = __webpack_exports__.getPlaceholderForType;
|
|
133
|
+
exports.getTaskProgress = __webpack_exports__.getTaskProgress;
|
|
134
|
+
exports.overrideServerConfig = __webpack_exports__.overrideServerConfig;
|
|
135
|
+
exports.requestPlaygroundServer = __webpack_exports__.requestPlaygroundServer;
|
|
136
|
+
exports.serverBase = __webpack_exports__.serverBase;
|
|
137
|
+
exports.staticAgentFromContext = __webpack_exports__.staticAgentFromContext;
|
|
138
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
139
|
+
"actionNameForType",
|
|
140
|
+
"blankResult",
|
|
141
|
+
"cancelTask",
|
|
142
|
+
"checkServerStatus",
|
|
143
|
+
"formatErrorMessage",
|
|
144
|
+
"getPlaceholderForType",
|
|
145
|
+
"getTaskProgress",
|
|
146
|
+
"overrideServerConfig",
|
|
147
|
+
"requestPlaygroundServer",
|
|
148
|
+
"serverBase",
|
|
149
|
+
"staticAgentFromContext"
|
|
150
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
151
|
+
Object.defineProperty(exports, '__esModule', {
|
|
152
|
+
value: true
|
|
181
153
|
});
|
|
@@ -1,92 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var __async = (__this, __arguments, generator) => {
|
|
30
|
-
return new Promise((resolve, reject) => {
|
|
31
|
-
var fulfilled = (value) => {
|
|
32
|
-
try {
|
|
33
|
-
step(generator.next(value));
|
|
34
|
-
} catch (e) {
|
|
35
|
-
reject(e);
|
|
36
|
-
}
|
|
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
|
+
});
|
|
37
9
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
+
});
|
|
44
22
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
__export(useServerValid_exports, {
|
|
51
|
-
useServerValid: () => useServerValid
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
useServerValid: ()=>useServerValid
|
|
52
28
|
});
|
|
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
|
-
yield new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
80
|
-
}
|
|
81
|
-
}))()
|
|
82
|
-
);
|
|
83
|
-
return () => {
|
|
84
|
-
interruptFlag = true;
|
|
85
|
-
};
|
|
86
|
-
}, [serviceMode, shouldRun]);
|
|
87
|
-
return serverValid;
|
|
29
|
+
const external_react_namespaceObject = require("react");
|
|
30
|
+
const store_js_namespaceObject = require("../store/store.js");
|
|
31
|
+
const external_playground_utils_js_namespaceObject = require("./playground-utils.js");
|
|
32
|
+
const useServerValid = function() {
|
|
33
|
+
let shouldRun = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : true;
|
|
34
|
+
const [serverValid, setServerValid] = (0, external_react_namespaceObject.useState)(true);
|
|
35
|
+
const { serviceMode } = (0, store_js_namespaceObject.useEnvConfig)();
|
|
36
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
37
|
+
let interruptFlag = false;
|
|
38
|
+
if (!shouldRun) return;
|
|
39
|
+
Promise.resolve((async ()=>{
|
|
40
|
+
while(!interruptFlag){
|
|
41
|
+
const status = await (0, external_playground_utils_js_namespaceObject.checkServerStatus)();
|
|
42
|
+
status ? setServerValid(true) : setServerValid(false);
|
|
43
|
+
await new Promise((resolve)=>setTimeout(resolve, 1000));
|
|
44
|
+
}
|
|
45
|
+
})());
|
|
46
|
+
return ()=>{
|
|
47
|
+
interruptFlag = true;
|
|
48
|
+
};
|
|
49
|
+
}, [
|
|
50
|
+
serviceMode,
|
|
51
|
+
shouldRun
|
|
52
|
+
]);
|
|
53
|
+
return serverValid;
|
|
88
54
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
55
|
+
exports.useServerValid = __webpack_exports__.useServerValid;
|
|
56
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
57
|
+
"useServerValid"
|
|
58
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
59
|
+
Object.defineProperty(exports, '__esModule', {
|
|
60
|
+
value: true
|
|
92
61
|
});
|
|
@@ -1,55 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
var useStaticPageAgent_exports = {};
|
|
30
|
-
__export(useStaticPageAgent_exports, {
|
|
31
|
-
staticAgentFromContext: () => import_playground_utils.staticAgentFromContext,
|
|
32
|
-
useStaticPageAgent: () => useStaticPageAgent
|
|
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
|
+
useStaticPageAgent: ()=>useStaticPageAgent,
|
|
28
|
+
staticAgentFromContext: ()=>external_playground_utils_js_namespaceObject.staticAgentFromContext
|
|
33
29
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const agent = (0, import_react.useMemo)(() => {
|
|
45
|
-
if (!context)
|
|
46
|
-
return null;
|
|
47
|
-
return (0, import_playground_utils.staticAgentFromContext)(context);
|
|
48
|
-
}, [context]);
|
|
49
|
-
return agent;
|
|
30
|
+
const external_react_namespaceObject = require("react");
|
|
31
|
+
const external_playground_utils_js_namespaceObject = require("./playground-utils.js");
|
|
32
|
+
const useStaticPageAgent = (context)=>{
|
|
33
|
+
const agent = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
34
|
+
if (!context) return null;
|
|
35
|
+
return (0, external_playground_utils_js_namespaceObject.staticAgentFromContext)(context);
|
|
36
|
+
}, [
|
|
37
|
+
context
|
|
38
|
+
]);
|
|
39
|
+
return agent;
|
|
50
40
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
exports.staticAgentFromContext = __webpack_exports__.staticAgentFromContext;
|
|
42
|
+
exports.useStaticPageAgent = __webpack_exports__.useStaticPageAgent;
|
|
43
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
44
|
+
"staticAgentFromContext",
|
|
45
|
+
"useStaticPageAgent"
|
|
46
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
47
|
+
Object.defineProperty(exports, '__esModule', {
|
|
48
|
+
value: true
|
|
55
49
|
});
|