@midscene/visualizer 0.30.9 → 0.30.11-beta-20251218071621.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
|
@@ -1,6 +1,74 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
2
|
import { createStorageProvider, detectBestStorageType } from "../component/universal-playground/providers/storage-provider.mjs";
|
|
3
3
|
import { WELCOME_MESSAGE_TEMPLATE } from "../utils/constants.mjs";
|
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
5
|
+
try {
|
|
6
|
+
var info = gen[key](arg);
|
|
7
|
+
var value = info.value;
|
|
8
|
+
} catch (error) {
|
|
9
|
+
reject(error);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (info.done) resolve(value);
|
|
13
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
14
|
+
}
|
|
15
|
+
function _async_to_generator(fn) {
|
|
16
|
+
return function() {
|
|
17
|
+
var self = this, args = arguments;
|
|
18
|
+
return new Promise(function(resolve, reject) {
|
|
19
|
+
var gen = fn.apply(self, args);
|
|
20
|
+
function _next(value) {
|
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
+
}
|
|
23
|
+
function _throw(err) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
+
}
|
|
26
|
+
_next(void 0);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function _define_property(obj, key, value) {
|
|
31
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
32
|
+
value: value,
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true
|
|
36
|
+
});
|
|
37
|
+
else obj[key] = value;
|
|
38
|
+
return obj;
|
|
39
|
+
}
|
|
40
|
+
function _object_spread(target) {
|
|
41
|
+
for(var i = 1; i < arguments.length; i++){
|
|
42
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
43
|
+
var ownKeys = Object.keys(source);
|
|
44
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
45
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
46
|
+
}));
|
|
47
|
+
ownKeys.forEach(function(key) {
|
|
48
|
+
_define_property(target, key, source[key]);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
function usePlaygroundState_ownKeys(object, enumerableOnly) {
|
|
54
|
+
var keys = Object.keys(object);
|
|
55
|
+
if (Object.getOwnPropertySymbols) {
|
|
56
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
57
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
58
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
59
|
+
});
|
|
60
|
+
keys.push.apply(keys, symbols);
|
|
61
|
+
}
|
|
62
|
+
return keys;
|
|
63
|
+
}
|
|
64
|
+
function _object_spread_props(target, source) {
|
|
65
|
+
source = null != source ? source : {};
|
|
66
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
67
|
+
else usePlaygroundState_ownKeys(Object(source)).forEach(function(key) {
|
|
68
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
69
|
+
});
|
|
70
|
+
return target;
|
|
71
|
+
}
|
|
4
72
|
function usePlaygroundState(playgroundSDK, storage, contextProvider) {
|
|
5
73
|
const [loading, setLoading] = useState(false);
|
|
6
74
|
const [infoList, setInfoList] = useState([]);
|
|
@@ -15,47 +83,46 @@ function usePlaygroundState(playgroundSDK, storage, contextProvider) {
|
|
|
15
83
|
const interruptedFlagRef = useRef({});
|
|
16
84
|
const initializedRef = useRef(false);
|
|
17
85
|
useEffect(()=>{
|
|
18
|
-
const migrateFromOldNamespace =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
86
|
+
const migrateFromOldNamespace = ()=>_async_to_generator(function*() {
|
|
87
|
+
const oldStorage = createStorageProvider(detectBestStorageType(), 'playground-default');
|
|
88
|
+
try {
|
|
89
|
+
if (null == oldStorage ? void 0 : oldStorage.loadMessages) {
|
|
90
|
+
const oldMessages = yield oldStorage.loadMessages();
|
|
91
|
+
if (oldMessages.length > 1) {
|
|
92
|
+
console.log('Found data in old namespace, migrating...');
|
|
93
|
+
if (null == storage ? void 0 : storage.saveMessages) yield storage.saveMessages(oldMessages);
|
|
94
|
+
if (oldStorage.clearMessages) yield oldStorage.clearMessages();
|
|
95
|
+
return oldMessages;
|
|
96
|
+
}
|
|
28
97
|
}
|
|
98
|
+
} catch (error) {
|
|
99
|
+
console.debug('No data found in old namespace:', error);
|
|
29
100
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
setInfoList([
|
|
101
|
+
return [];
|
|
102
|
+
})();
|
|
103
|
+
const initializeMessages = ()=>_async_to_generator(function*() {
|
|
104
|
+
const welcomeMessage = _object_spread_props(_object_spread({}, WELCOME_MESSAGE_TEMPLATE), {
|
|
105
|
+
id: 'welcome',
|
|
106
|
+
timestamp: new Date()
|
|
107
|
+
});
|
|
108
|
+
if (null == storage ? void 0 : storage.loadMessages) try {
|
|
109
|
+
let storedMessages = yield storage.loadMessages();
|
|
110
|
+
if (0 === storedMessages.length) storedMessages = yield migrateFromOldNamespace();
|
|
111
|
+
const hasWelcomeMessage = storedMessages.some((msg)=>'welcome' === msg.id);
|
|
112
|
+
hasWelcomeMessage ? setInfoList(storedMessages) : setInfoList([
|
|
113
|
+
welcomeMessage,
|
|
114
|
+
...storedMessages
|
|
115
|
+
]);
|
|
116
|
+
} catch (error) {
|
|
117
|
+
console.error('Failed to load messages:', error);
|
|
118
|
+
setInfoList([
|
|
119
|
+
welcomeMessage
|
|
120
|
+
]);
|
|
121
|
+
}
|
|
122
|
+
else setInfoList([
|
|
52
123
|
welcomeMessage
|
|
53
124
|
]);
|
|
54
|
-
}
|
|
55
|
-
else setInfoList([
|
|
56
|
-
welcomeMessage
|
|
57
|
-
]);
|
|
58
|
-
};
|
|
125
|
+
})();
|
|
59
126
|
if (storage && !initializedRef.current) {
|
|
60
127
|
initializedRef.current = true;
|
|
61
128
|
initializeMessages();
|
|
@@ -82,21 +149,21 @@ function usePlaygroundState(playgroundSDK, storage, contextProvider) {
|
|
|
82
149
|
uiContextPreview
|
|
83
150
|
]);
|
|
84
151
|
useEffect(()=>{
|
|
85
|
-
const loadActionSpace =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
152
|
+
const loadActionSpace = ()=>_async_to_generator(function*() {
|
|
153
|
+
setActionSpaceLoading(true);
|
|
154
|
+
try {
|
|
155
|
+
var _contextProvider_getUIContext;
|
|
156
|
+
if (!playgroundSDK) return void setActionSpace([]);
|
|
157
|
+
const context = uiContextPreview || (yield null == contextProvider ? void 0 : null == (_contextProvider_getUIContext = contextProvider.getUIContext) ? void 0 : _contextProvider_getUIContext.call(contextProvider));
|
|
158
|
+
const space = yield playgroundSDK.getActionSpace(context);
|
|
159
|
+
setActionSpace(space || []);
|
|
160
|
+
} catch (error) {
|
|
161
|
+
console.error('Failed to load action space:', error);
|
|
162
|
+
setActionSpace([]);
|
|
163
|
+
} finally{
|
|
164
|
+
setActionSpaceLoading(false);
|
|
165
|
+
}
|
|
166
|
+
})();
|
|
100
167
|
loadActionSpace();
|
|
101
168
|
}, [
|
|
102
169
|
playgroundSDK,
|
|
@@ -151,31 +218,30 @@ function usePlaygroundState(playgroundSDK, storage, contextProvider) {
|
|
|
151
218
|
}, [
|
|
152
219
|
checkIfScrolledToBottom
|
|
153
220
|
]);
|
|
154
|
-
const clearInfoList = useCallback(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
}, [
|
|
221
|
+
const clearInfoList = useCallback(()=>_async_to_generator(function*() {
|
|
222
|
+
const welcomeMessage = _object_spread_props(_object_spread({}, WELCOME_MESSAGE_TEMPLATE), {
|
|
223
|
+
id: 'welcome',
|
|
224
|
+
timestamp: new Date()
|
|
225
|
+
});
|
|
226
|
+
setInfoList([
|
|
227
|
+
welcomeMessage
|
|
228
|
+
]);
|
|
229
|
+
if (null == storage ? void 0 : storage.clearMessages) try {
|
|
230
|
+
yield storage.clearMessages();
|
|
231
|
+
} catch (error) {
|
|
232
|
+
console.error('Failed to clear stored messages:', error);
|
|
233
|
+
}
|
|
234
|
+
})(), [
|
|
169
235
|
storage
|
|
170
236
|
]);
|
|
171
|
-
const refreshContext = useCallback(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
237
|
+
const refreshContext = useCallback(()=>_async_to_generator(function*() {
|
|
238
|
+
if (null == contextProvider ? void 0 : contextProvider.refreshContext) try {
|
|
239
|
+
const newContext = yield contextProvider.refreshContext();
|
|
240
|
+
setUiContextPreview(newContext);
|
|
241
|
+
} catch (error) {
|
|
242
|
+
console.error('Failed to refresh context:', error);
|
|
243
|
+
}
|
|
244
|
+
})(), [
|
|
179
245
|
contextProvider
|
|
180
246
|
]);
|
|
181
247
|
return {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { overrideAIConfig } from "@midscene/shared/env";
|
|
2
2
|
import { message } from "antd";
|
|
3
|
-
function safeOverrideAIConfig(newConfig) {
|
|
4
|
-
let extendMode = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false, showErrorMessage = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : true;
|
|
3
|
+
function safeOverrideAIConfig(newConfig, extendMode = false, showErrorMessage = true) {
|
|
5
4
|
try {
|
|
6
5
|
overrideAIConfig(newConfig, extendMode);
|
|
7
6
|
return true;
|
|
@@ -13,10 +12,7 @@ function safeOverrideAIConfig(newConfig) {
|
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
14
|
function useSafeOverrideAIConfig() {
|
|
16
|
-
const applyConfig =
|
|
17
|
-
let extendMode = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : false, showErrorMessage = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : true;
|
|
18
|
-
return safeOverrideAIConfig(newConfig, extendMode, showErrorMessage);
|
|
19
|
-
};
|
|
15
|
+
const applyConfig = (newConfig, extendMode = false, showErrorMessage = true)=>safeOverrideAIConfig(newConfig, extendMode, showErrorMessage);
|
|
20
16
|
return {
|
|
21
17
|
applyConfig
|
|
22
18
|
};
|
|
@@ -1,23 +1,48 @@
|
|
|
1
1
|
import { PlaygroundSDK } from "@midscene/playground";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { useEnvConfig } from "../store/store.mjs";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
5
|
+
try {
|
|
6
|
+
var info = gen[key](arg);
|
|
7
|
+
var value = info.value;
|
|
8
|
+
} catch (error) {
|
|
9
|
+
reject(error);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (info.done) resolve(value);
|
|
13
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
14
|
+
}
|
|
15
|
+
function _async_to_generator(fn) {
|
|
16
|
+
return function() {
|
|
17
|
+
var self = this, args = arguments;
|
|
18
|
+
return new Promise(function(resolve, reject) {
|
|
19
|
+
var gen = fn.apply(self, args);
|
|
20
|
+
function _next(value) {
|
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
+
}
|
|
23
|
+
function _throw(err) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
+
}
|
|
26
|
+
_next(void 0);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const useServerValid = (shouldRun = true)=>{
|
|
6
31
|
const [serverValid, setServerValid] = useState(true);
|
|
7
32
|
const { serviceMode } = useEnvConfig();
|
|
8
33
|
useEffect(()=>{
|
|
9
34
|
let interruptFlag = false;
|
|
10
35
|
if (!shouldRun) return;
|
|
11
|
-
Promise.resolve((
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
36
|
+
Promise.resolve((()=>_async_to_generator(function*() {
|
|
37
|
+
while(!interruptFlag){
|
|
38
|
+
const playgroundSDK = new PlaygroundSDK({
|
|
39
|
+
type: 'remote-execution'
|
|
40
|
+
});
|
|
41
|
+
const status = yield playgroundSDK.checkStatus();
|
|
42
|
+
status ? setServerValid(true) : setServerValid(false);
|
|
43
|
+
yield new Promise((resolve)=>setTimeout(resolve, 1000));
|
|
44
|
+
}
|
|
45
|
+
})())());
|
|
21
46
|
return ()=>{
|
|
22
47
|
interruptFlag = true;
|
|
23
48
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
function useTheme() {
|
|
3
|
+
const [isDarkMode, setIsDarkMode] = useState(false);
|
|
4
|
+
useEffect(()=>{
|
|
5
|
+
const checkTheme = ()=>{
|
|
6
|
+
var _document_querySelector;
|
|
7
|
+
const theme = null == (_document_querySelector = document.querySelector('[data-theme]')) ? void 0 : _document_querySelector.getAttribute('data-theme');
|
|
8
|
+
setIsDarkMode('dark' === theme);
|
|
9
|
+
};
|
|
10
|
+
checkTheme();
|
|
11
|
+
const observer = new MutationObserver(checkTheme);
|
|
12
|
+
const target = document.querySelector('[data-theme]') || document.documentElement;
|
|
13
|
+
observer.observe(target, {
|
|
14
|
+
attributes: true,
|
|
15
|
+
attributeFilter: [
|
|
16
|
+
'data-theme'
|
|
17
|
+
]
|
|
18
|
+
});
|
|
19
|
+
return ()=>observer.disconnect();
|
|
20
|
+
}, []);
|
|
21
|
+
return {
|
|
22
|
+
isDarkMode
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export { useTheme };
|
package/dist/es/icons/avatar.mjs
CHANGED
|
@@ -1,13 +1,55 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
|
|
3
|
+
function _define_property(obj, key, value) {
|
|
4
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
else obj[key] = value;
|
|
11
|
+
return obj;
|
|
12
|
+
}
|
|
13
|
+
function _object_spread(target) {
|
|
14
|
+
for(var i = 1; i < arguments.length; i++){
|
|
15
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
16
|
+
var ownKeys = Object.keys(source);
|
|
17
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
18
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
19
|
+
}));
|
|
20
|
+
ownKeys.forEach(function(key) {
|
|
21
|
+
_define_property(target, key, source[key]);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return target;
|
|
25
|
+
}
|
|
26
|
+
function avatar_ownKeys(object, enumerableOnly) {
|
|
27
|
+
var keys = Object.keys(object);
|
|
28
|
+
if (Object.getOwnPropertySymbols) {
|
|
29
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
30
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
31
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
32
|
+
});
|
|
33
|
+
keys.push.apply(keys, symbols);
|
|
34
|
+
}
|
|
35
|
+
return keys;
|
|
36
|
+
}
|
|
37
|
+
function _object_spread_props(target, source) {
|
|
38
|
+
source = null != source ? source : {};
|
|
39
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
40
|
+
else avatar_ownKeys(Object(source)).forEach(function(key) {
|
|
41
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
42
|
+
});
|
|
43
|
+
return target;
|
|
44
|
+
}
|
|
45
|
+
const SvgAvatar = (props)=>/*#__PURE__*/ jsxs("svg", _object_spread_props(_object_spread({
|
|
4
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5
47
|
width: 20,
|
|
6
48
|
height: 20,
|
|
7
49
|
fill: "none",
|
|
8
50
|
"aria-label": "Playground",
|
|
9
|
-
viewBox: "0 0 20 20"
|
|
10
|
-
|
|
51
|
+
viewBox: "0 0 20 20"
|
|
52
|
+
}, props), {
|
|
11
53
|
children: [
|
|
12
54
|
/*#__PURE__*/ jsx("rect", {
|
|
13
55
|
width: 20,
|
|
@@ -23,6 +65,6 @@ const SvgAvatar = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
|
23
65
|
d: "M6.866 5.882a.56.56 0 0 1 .667-.078l3.248 1.875 3.247 1.875a.563.563 0 0 1 0 .974l-3.247 1.875-3.248 1.875a.563.563 0 0 1-.784-.74l1.749-3.497-1.75-3.498a.56.56 0 0 1 .118-.661Z"
|
|
24
66
|
})
|
|
25
67
|
]
|
|
26
|
-
});
|
|
68
|
+
}));
|
|
27
69
|
const avatar = SvgAvatar;
|
|
28
70
|
export { avatar as default };
|
package/dist/es/icons/close.mjs
CHANGED
|
@@ -1,12 +1,54 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
|
|
3
|
+
function _define_property(obj, key, value) {
|
|
4
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
else obj[key] = value;
|
|
11
|
+
return obj;
|
|
12
|
+
}
|
|
13
|
+
function _object_spread(target) {
|
|
14
|
+
for(var i = 1; i < arguments.length; i++){
|
|
15
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
16
|
+
var ownKeys = Object.keys(source);
|
|
17
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
18
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
19
|
+
}));
|
|
20
|
+
ownKeys.forEach(function(key) {
|
|
21
|
+
_define_property(target, key, source[key]);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return target;
|
|
25
|
+
}
|
|
26
|
+
function close_ownKeys(object, enumerableOnly) {
|
|
27
|
+
var keys = Object.keys(object);
|
|
28
|
+
if (Object.getOwnPropertySymbols) {
|
|
29
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
30
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
31
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
32
|
+
});
|
|
33
|
+
keys.push.apply(keys, symbols);
|
|
34
|
+
}
|
|
35
|
+
return keys;
|
|
36
|
+
}
|
|
37
|
+
function _object_spread_props(target, source) {
|
|
38
|
+
source = null != source ? source : {};
|
|
39
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
40
|
+
else close_ownKeys(Object(source)).forEach(function(key) {
|
|
41
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
42
|
+
});
|
|
43
|
+
return target;
|
|
44
|
+
}
|
|
45
|
+
const SvgClose = (props)=>/*#__PURE__*/ jsx("svg", _object_spread_props(_object_spread({
|
|
4
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5
47
|
width: 18,
|
|
6
48
|
height: 16,
|
|
7
49
|
fill: "none",
|
|
8
|
-
viewBox: "0 0 18 16"
|
|
9
|
-
|
|
50
|
+
viewBox: "0 0 18 16"
|
|
51
|
+
}, props), {
|
|
10
52
|
children: /*#__PURE__*/ jsx("path", {
|
|
11
53
|
stroke: "#333",
|
|
12
54
|
strokeLinecap: "round",
|
|
@@ -14,6 +56,6 @@ const SvgClose = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
|
14
56
|
strokeWidth: 1.333,
|
|
15
57
|
d: "m3.124 2.667 11.162 10.666M3.124 13.333 14.286 2.667"
|
|
16
58
|
})
|
|
17
|
-
});
|
|
59
|
+
}));
|
|
18
60
|
const icons_close = SvgClose;
|
|
19
61
|
export { icons_close as default };
|
|
@@ -1,16 +1,58 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
|
|
3
|
+
function _define_property(obj, key, value) {
|
|
4
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
else obj[key] = value;
|
|
11
|
+
return obj;
|
|
12
|
+
}
|
|
13
|
+
function _object_spread(target) {
|
|
14
|
+
for(var i = 1; i < arguments.length; i++){
|
|
15
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
16
|
+
var ownKeys = Object.keys(source);
|
|
17
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
18
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
19
|
+
}));
|
|
20
|
+
ownKeys.forEach(function(key) {
|
|
21
|
+
_define_property(target, key, source[key]);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return target;
|
|
25
|
+
}
|
|
26
|
+
function global_perspective_ownKeys(object, enumerableOnly) {
|
|
27
|
+
var keys = Object.keys(object);
|
|
28
|
+
if (Object.getOwnPropertySymbols) {
|
|
29
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
30
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
31
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
32
|
+
});
|
|
33
|
+
keys.push.apply(keys, symbols);
|
|
34
|
+
}
|
|
35
|
+
return keys;
|
|
36
|
+
}
|
|
37
|
+
function _object_spread_props(target, source) {
|
|
38
|
+
source = null != source ? source : {};
|
|
39
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
40
|
+
else global_perspective_ownKeys(Object(source)).forEach(function(key) {
|
|
41
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
42
|
+
});
|
|
43
|
+
return target;
|
|
44
|
+
}
|
|
45
|
+
const SvgGlobalPerspective = (props)=>/*#__PURE__*/ jsx("svg", _object_spread_props(_object_spread({
|
|
4
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5
47
|
width: 16,
|
|
6
48
|
height: 16,
|
|
7
49
|
fill: "none",
|
|
8
|
-
viewBox: "0 0 16 16"
|
|
9
|
-
|
|
50
|
+
viewBox: "0 0 16 16"
|
|
51
|
+
}, props), {
|
|
10
52
|
children: /*#__PURE__*/ jsx("path", {
|
|
11
|
-
fill: "
|
|
53
|
+
fill: "currentColor",
|
|
12
54
|
d: "M1.333 13v-2.5a.667.667 0 0 1 1.334 0V13c0 .184.149.333.333.333h2.5a.667.667 0 0 1 0 1.334H3c-.92 0-1.667-.746-1.667-1.667m12 0v-2.5a.667.667 0 0 1 1.334 0V13c0 .92-.746 1.667-1.667 1.667h-2.5a.667.667 0 0 1 0-1.334H13a.333.333 0 0 0 .333-.333m-12-7.5V3c0-.92.747-1.667 1.667-1.667h2.5a.667.667 0 0 1 0 1.334H3A.333.333 0 0 0 2.667 3v2.5a.667.667 0 0 1-1.334 0m12 0V3A.333.333 0 0 0 13 2.667h-2.5a.667.667 0 0 1 0-1.334H13c.92 0 1.667.747 1.667 1.667v2.5a.667.667 0 0 1-1.334 0M5.667 10.333h4.666V5.667H5.667zm6 .167c0 .644-.523 1.167-1.167 1.167h-5A1.167 1.167 0 0 1 4.333 10.5v-5c0-.644.523-1.167 1.167-1.167h5c.644 0 1.167.523 1.167 1.167z"
|
|
13
55
|
})
|
|
14
|
-
});
|
|
56
|
+
}));
|
|
15
57
|
const global_perspective = SvgGlobalPerspective;
|
|
16
58
|
export { global_perspective as default };
|
|
@@ -1,15 +1,57 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
|
|
3
|
+
function _define_property(obj, key, value) {
|
|
4
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
else obj[key] = value;
|
|
11
|
+
return obj;
|
|
12
|
+
}
|
|
13
|
+
function _object_spread(target) {
|
|
14
|
+
for(var i = 1; i < arguments.length; i++){
|
|
15
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
16
|
+
var ownKeys = Object.keys(source);
|
|
17
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
18
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
19
|
+
}));
|
|
20
|
+
ownKeys.forEach(function(key) {
|
|
21
|
+
_define_property(target, key, source[key]);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return target;
|
|
25
|
+
}
|
|
26
|
+
function history_ownKeys(object, enumerableOnly) {
|
|
27
|
+
var keys = Object.keys(object);
|
|
28
|
+
if (Object.getOwnPropertySymbols) {
|
|
29
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
30
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
31
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
32
|
+
});
|
|
33
|
+
keys.push.apply(keys, symbols);
|
|
34
|
+
}
|
|
35
|
+
return keys;
|
|
36
|
+
}
|
|
37
|
+
function _object_spread_props(target, source) {
|
|
38
|
+
source = null != source ? source : {};
|
|
39
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
40
|
+
else history_ownKeys(Object(source)).forEach(function(key) {
|
|
41
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
42
|
+
});
|
|
43
|
+
return target;
|
|
44
|
+
}
|
|
45
|
+
const SvgHistory = (props)=>/*#__PURE__*/ jsxs("svg", _object_spread_props(_object_spread({
|
|
4
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5
47
|
width: 25,
|
|
6
48
|
height: 25,
|
|
7
49
|
fill: "none",
|
|
8
|
-
viewBox: "0 0 25 25"
|
|
9
|
-
|
|
50
|
+
viewBox: "0 0 25 25"
|
|
51
|
+
}, props), {
|
|
10
52
|
children: [
|
|
11
53
|
/*#__PURE__*/ jsx("path", {
|
|
12
|
-
stroke: "
|
|
54
|
+
stroke: "currentColor",
|
|
13
55
|
strokeLinecap: "round",
|
|
14
56
|
strokeLinejoin: "round",
|
|
15
57
|
strokeOpacity: 0.85,
|
|
@@ -17,7 +59,7 @@ const SvgHistory = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
|
17
59
|
d: "M6.63 9.021c-2.862 6.126 2.197 10.501 6.063 10.501a7 7 0 1 0-6.063-10.5"
|
|
18
60
|
}),
|
|
19
61
|
/*#__PURE__*/ jsx("path", {
|
|
20
|
-
stroke: "
|
|
62
|
+
stroke: "currentColor",
|
|
21
63
|
strokeLinecap: "round",
|
|
22
64
|
strokeLinejoin: "round",
|
|
23
65
|
strokeOpacity: 0.85,
|
|
@@ -25,6 +67,6 @@ const SvgHistory = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
|
25
67
|
d: "M12.695 8.322v4.203l2.967 2.968"
|
|
26
68
|
})
|
|
27
69
|
]
|
|
28
|
-
});
|
|
70
|
+
}));
|
|
29
71
|
const icons_history = SvgHistory;
|
|
30
72
|
export { icons_history as default };
|