@midscene/visualizer 0.26.2-beta-20250812091127.0 → 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,64 +1,75 @@
|
|
|
1
1
|
.shiny-text {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
color: rgba(0, 0, 0, 0);
|
|
3
|
+
letter-spacing: .5px;
|
|
4
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, .05);
|
|
5
|
+
background-image: linear-gradient(45deg, #2b83ff, #6a11cb, #2575fc, #4481eb);
|
|
6
|
+
background-size: 300%;
|
|
5
7
|
-webkit-background-clip: text;
|
|
6
8
|
background-clip: text;
|
|
7
|
-
color: transparent;
|
|
8
9
|
font-weight: 600;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
animation: 8s infinite textGradient;
|
|
11
|
+
display: inline-block;
|
|
12
|
+
position: relative;
|
|
11
13
|
overflow: hidden;
|
|
12
|
-
animation: textGradient 8s ease infinite;
|
|
13
|
-
background-image: linear-gradient(45deg, #2b83ff, #6a11cb, #2575fc, #4481eb);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
.shiny-text:after {
|
|
16
17
|
content: "";
|
|
17
|
-
position: absolute;
|
|
18
|
-
top: -10%;
|
|
19
|
-
left: -150%;
|
|
20
18
|
width: 120%;
|
|
21
19
|
height: 120%;
|
|
22
|
-
|
|
23
|
-
transform: skewX(-20deg) translateY(0);
|
|
24
|
-
animation: shine var(--animation-duration, 5s) cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
|
|
20
|
+
animation: shine var(--animation-duration, 5s) cubic-bezier(.25, .1, .25, 1) infinite;
|
|
25
21
|
z-index: 1;
|
|
26
22
|
pointer-events: none;
|
|
23
|
+
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .1) 10%, rgba(255, 255, 255, .6) 50%, rgba(255, 255, 255, .1) 90%, rgba(255, 255, 255, 0) 100%);
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: -10%;
|
|
26
|
+
left: -150%;
|
|
27
|
+
transform: skewX(-20deg)translateY(0);
|
|
27
28
|
}
|
|
29
|
+
|
|
28
30
|
.shiny-text.disabled {
|
|
29
|
-
animation: none;
|
|
30
31
|
background: #2b83ff;
|
|
31
32
|
-webkit-background-clip: text;
|
|
32
33
|
background-clip: text;
|
|
34
|
+
animation: none;
|
|
33
35
|
}
|
|
34
|
-
|
|
36
|
+
|
|
37
|
+
.shiny-text.disabled:after {
|
|
35
38
|
animation: none;
|
|
36
39
|
display: none;
|
|
37
40
|
}
|
|
41
|
+
|
|
38
42
|
@keyframes shine {
|
|
39
43
|
0% {
|
|
44
|
+
opacity: .7;
|
|
40
45
|
left: -150%;
|
|
41
|
-
opacity: 0.7;
|
|
42
46
|
}
|
|
47
|
+
|
|
43
48
|
20% {
|
|
44
49
|
opacity: 1;
|
|
45
50
|
}
|
|
51
|
+
|
|
46
52
|
80% {
|
|
47
53
|
opacity: 1;
|
|
48
54
|
}
|
|
55
|
+
|
|
49
56
|
100% {
|
|
57
|
+
opacity: .7;
|
|
50
58
|
left: 250%;
|
|
51
|
-
opacity: 0.7;
|
|
52
59
|
}
|
|
53
60
|
}
|
|
61
|
+
|
|
54
62
|
@keyframes textGradient {
|
|
55
63
|
0% {
|
|
56
|
-
background-position: 0
|
|
64
|
+
background-position: 0%;
|
|
57
65
|
}
|
|
66
|
+
|
|
58
67
|
50% {
|
|
59
|
-
background-position: 100
|
|
68
|
+
background-position: 100%;
|
|
60
69
|
}
|
|
70
|
+
|
|
61
71
|
100% {
|
|
62
|
-
background-position: 0
|
|
72
|
+
background-position: 0%;
|
|
63
73
|
}
|
|
64
74
|
}
|
|
75
|
+
|
|
@@ -1,60 +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
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var shiny_text_exports = {};
|
|
30
|
-
__export(shiny_text_exports, {
|
|
31
|
-
default: () => shiny_text_default
|
|
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
|
+
default: ()=>shiny_text
|
|
32
28
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
require("./shiny-text.css");
|
|
31
|
+
const ShinyText = (param)=>{
|
|
32
|
+
let { text, disabled = false, speed = 5, className = '' } = param;
|
|
33
|
+
const style = {
|
|
34
|
+
'--animation-duration': `${speed}s`
|
|
35
|
+
};
|
|
36
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
37
|
+
className: `shiny-text ${disabled ? 'disabled' : ''} ${className}`,
|
|
38
|
+
style: style,
|
|
39
|
+
children: text
|
|
40
|
+
});
|
|
39
41
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
const style = {
|
|
49
|
-
"--animation-duration": `${speed}s`
|
|
50
|
-
};
|
|
51
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
-
"div",
|
|
53
|
-
{
|
|
54
|
-
className: `shiny-text ${disabled ? "disabled" : ""} ${className}`,
|
|
55
|
-
style,
|
|
56
|
-
children: text
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
var shiny_text_default = ShinyText;
|
|
42
|
+
const shiny_text = ShinyText;
|
|
43
|
+
exports["default"] = __webpack_exports__["default"];
|
|
44
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
45
|
+
"default"
|
|
46
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
47
|
+
Object.defineProperty(exports, '__esModule', {
|
|
48
|
+
value: true
|
|
49
|
+
});
|
|
@@ -1,68 +1,62 @@
|
|
|
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
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var history_exports = {};
|
|
30
|
-
__export(history_exports, {
|
|
31
|
-
useHistoryStore: () => useHistoryStore
|
|
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
|
+
useHistoryStore: ()=>useHistoryStore
|
|
32
28
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
var Z = __toESM(require("zustand"));
|
|
41
|
-
const { create } = Z;
|
|
42
|
-
const HISTORY_KEY = "midscene-prompt-history";
|
|
43
|
-
const getHistoryFromLocalStorage = () => {
|
|
44
|
-
const historyString = localStorage.getItem(HISTORY_KEY);
|
|
45
|
-
return historyString ? JSON.parse(historyString) : [];
|
|
29
|
+
const external_zustand_namespaceObject = require("zustand");
|
|
30
|
+
const { create } = external_zustand_namespaceObject;
|
|
31
|
+
const HISTORY_KEY = 'midscene-prompt-history';
|
|
32
|
+
const getHistoryFromLocalStorage = ()=>{
|
|
33
|
+
const historyString = localStorage.getItem(HISTORY_KEY);
|
|
34
|
+
return historyString ? JSON.parse(historyString) : [];
|
|
46
35
|
};
|
|
47
|
-
const useHistoryStore = create((set, get)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
36
|
+
const useHistoryStore = create((set, get)=>({
|
|
37
|
+
history: getHistoryFromLocalStorage(),
|
|
38
|
+
clearHistory: ()=>{
|
|
39
|
+
set({
|
|
40
|
+
history: []
|
|
41
|
+
});
|
|
42
|
+
localStorage.removeItem(HISTORY_KEY);
|
|
43
|
+
},
|
|
44
|
+
addHistory: (historyItem)=>{
|
|
45
|
+
const newHistory = [
|
|
46
|
+
historyItem,
|
|
47
|
+
...get().history.filter((h)=>h.prompt !== historyItem.prompt)
|
|
48
|
+
];
|
|
49
|
+
while(newHistory.length > 10)newHistory.pop();
|
|
50
|
+
set({
|
|
51
|
+
history: newHistory
|
|
52
|
+
});
|
|
53
|
+
localStorage.setItem(HISTORY_KEY, JSON.stringify(newHistory));
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
exports.useHistoryStore = __webpack_exports__.useHistoryStore;
|
|
57
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
58
|
+
"useHistoryStore"
|
|
59
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
60
|
+
Object.defineProperty(exports, '__esModule', {
|
|
61
|
+
value: true
|
|
68
62
|
});
|
|
@@ -1,134 +1,138 @@
|
|
|
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 store_exports = {};
|
|
30
|
-
__export(store_exports, {
|
|
31
|
-
useBlackboardPreference: () => useBlackboardPreference,
|
|
32
|
-
useEnvConfig: () => useEnvConfig
|
|
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
|
+
useBlackboardPreference: ()=>useBlackboardPreference,
|
|
28
|
+
useEnvConfig: ()=>useEnvConfig
|
|
33
29
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
const getConfigStringFromLocalStorage = () => {
|
|
58
|
-
const configString = localStorage.getItem(CONFIG_KEY);
|
|
59
|
-
return configString || "";
|
|
30
|
+
const external_zustand_namespaceObject = require("zustand");
|
|
31
|
+
const { create } = external_zustand_namespaceObject;
|
|
32
|
+
const useBlackboardPreference = create((set)=>({
|
|
33
|
+
markerVisible: true,
|
|
34
|
+
elementsVisible: true,
|
|
35
|
+
setMarkerVisible: (visible)=>{
|
|
36
|
+
set({
|
|
37
|
+
markerVisible: visible
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
setTextsVisible: (visible)=>{
|
|
41
|
+
set({
|
|
42
|
+
elementsVisible: visible
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
const CONFIG_KEY = 'midscene-env-config';
|
|
47
|
+
const SERVICE_MODE_KEY = 'midscene-service-mode';
|
|
48
|
+
const TRACKING_ACTIVE_TAB_KEY = 'midscene-tracking-active-tab';
|
|
49
|
+
const DEEP_THINK_KEY = 'midscene-deep-think';
|
|
50
|
+
const getConfigStringFromLocalStorage = ()=>{
|
|
51
|
+
const configString = localStorage.getItem(CONFIG_KEY);
|
|
52
|
+
return configString || '';
|
|
60
53
|
};
|
|
61
|
-
const parseConfig = (configString)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
return config;
|
|
54
|
+
const parseConfig = (configString)=>{
|
|
55
|
+
const lines = configString.split('\n');
|
|
56
|
+
const config = {};
|
|
57
|
+
lines.forEach((line)=>{
|
|
58
|
+
const trimmed = line.trim();
|
|
59
|
+
if (trimmed.startsWith('#')) return;
|
|
60
|
+
const cleanLine = trimmed.replace(/^export\s+/i, '').replace(/;$/, '').trim();
|
|
61
|
+
const match = cleanLine.match(/^(\w+)=(.*)$/);
|
|
62
|
+
if (match) {
|
|
63
|
+
const [, key, value] = match;
|
|
64
|
+
let parsedValue = value.trim();
|
|
65
|
+
if (parsedValue.startsWith("'") && parsedValue.endsWith("'") || parsedValue.startsWith('"') && parsedValue.endsWith('"')) parsedValue = parsedValue.slice(1, -1);
|
|
66
|
+
config[key] = parsedValue;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return config;
|
|
80
70
|
};
|
|
81
|
-
const useEnvConfig = create((set, get)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
71
|
+
const useEnvConfig = create((set, get)=>{
|
|
72
|
+
const configString = getConfigStringFromLocalStorage();
|
|
73
|
+
const config = parseConfig(configString);
|
|
74
|
+
const ifInExtension = window.location.href.startsWith('chrome-extension');
|
|
75
|
+
const savedServiceMode = localStorage.getItem(SERVICE_MODE_KEY);
|
|
76
|
+
const savedForceSameTabNavigation = 'false' !== localStorage.getItem(TRACKING_ACTIVE_TAB_KEY);
|
|
77
|
+
const savedDeepThink = 'true' === localStorage.getItem(DEEP_THINK_KEY);
|
|
78
|
+
return {
|
|
79
|
+
serviceMode: ifInExtension ? 'In-Browser-Extension' : savedServiceMode || 'Server',
|
|
80
|
+
setServiceMode: (serviceMode)=>{
|
|
81
|
+
if (ifInExtension) throw new Error('serviceMode cannot be set in extension');
|
|
82
|
+
set({
|
|
83
|
+
serviceMode
|
|
84
|
+
});
|
|
85
|
+
localStorage.setItem(SERVICE_MODE_KEY, serviceMode);
|
|
86
|
+
},
|
|
87
|
+
config,
|
|
88
|
+
configString,
|
|
89
|
+
setConfig: (config)=>set({
|
|
90
|
+
config
|
|
91
|
+
}),
|
|
92
|
+
loadConfig: (configString)=>{
|
|
93
|
+
const config = parseConfig(configString);
|
|
94
|
+
set({
|
|
95
|
+
config,
|
|
96
|
+
configString
|
|
97
|
+
});
|
|
98
|
+
localStorage.setItem(CONFIG_KEY, configString);
|
|
99
|
+
},
|
|
100
|
+
syncFromStorage: ()=>{
|
|
101
|
+
const latestConfigString = getConfigStringFromLocalStorage();
|
|
102
|
+
const latestConfig = parseConfig(latestConfigString);
|
|
103
|
+
set({
|
|
104
|
+
config: latestConfig,
|
|
105
|
+
configString: latestConfigString
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
forceSameTabNavigation: savedForceSameTabNavigation,
|
|
109
|
+
setForceSameTabNavigation: (forceSameTabNavigation)=>{
|
|
110
|
+
set({
|
|
111
|
+
forceSameTabNavigation
|
|
112
|
+
});
|
|
113
|
+
localStorage.setItem(TRACKING_ACTIVE_TAB_KEY, forceSameTabNavigation.toString());
|
|
114
|
+
},
|
|
115
|
+
deepThink: savedDeepThink,
|
|
116
|
+
setDeepThink: (deepThink)=>{
|
|
117
|
+
set({
|
|
118
|
+
deepThink
|
|
119
|
+
});
|
|
120
|
+
localStorage.setItem(DEEP_THINK_KEY, deepThink.toString());
|
|
121
|
+
},
|
|
122
|
+
popupTab: 'playground',
|
|
123
|
+
setPopupTab: (tab)=>{
|
|
124
|
+
set({
|
|
125
|
+
popupTab: tab
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
129
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
exports.useBlackboardPreference = __webpack_exports__.useBlackboardPreference;
|
|
131
|
+
exports.useEnvConfig = __webpack_exports__.useEnvConfig;
|
|
132
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
133
|
+
"useBlackboardPreference",
|
|
134
|
+
"useEnvConfig"
|
|
135
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
136
|
+
Object.defineProperty(exports, '__esModule', {
|
|
137
|
+
value: true
|
|
134
138
|
});
|