ssovee-os-web-ui 0.1.86 → 0.1.89
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/README.md +0 -2
- package/dist/index.cjs +12 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +12 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -181,8 +181,6 @@ export function PluginPreview() {
|
|
|
181
181
|
return (
|
|
182
182
|
<PluginPlayground
|
|
183
183
|
metadata={pluginMetadata}
|
|
184
|
-
onClose={() => console.log("Playground closed")}
|
|
185
|
-
onMinimize={(isMinimized) => console.log("Minimized:", isMinimized)}
|
|
186
184
|
>
|
|
187
185
|
<div>
|
|
188
186
|
<Typography variant="h6">Plugin Content</Typography>
|
package/dist/index.cjs
CHANGED
|
@@ -2305,9 +2305,7 @@ function getDefaultSize(metadata) {
|
|
|
2305
2305
|
function PluginPlayground({
|
|
2306
2306
|
children,
|
|
2307
2307
|
metadata,
|
|
2308
|
-
backgroundImage
|
|
2309
|
-
onClose,
|
|
2310
|
-
onMinimize
|
|
2308
|
+
backgroundImage
|
|
2311
2309
|
}) {
|
|
2312
2310
|
const [mockUser] = React23.useState(DEFAULT_MOCK_USER);
|
|
2313
2311
|
const [mockToken] = React23.useState(DEFAULT_TOKEN);
|
|
@@ -2318,7 +2316,9 @@ function PluginPlayground({
|
|
|
2318
2316
|
React23.useEffect(() => {
|
|
2319
2317
|
if (typeof window === "undefined") return;
|
|
2320
2318
|
const storedTheme = window.localStorage.getItem("plugin-playground-theme");
|
|
2321
|
-
const prefersDark = window.matchMedia(
|
|
2319
|
+
const prefersDark = window.matchMedia(
|
|
2320
|
+
"(prefers-color-scheme: dark)"
|
|
2321
|
+
).matches;
|
|
2322
2322
|
const shouldUseDark = storedTheme ? storedTheme === "dark" : prefersDark;
|
|
2323
2323
|
setIsNightMode(shouldUseDark);
|
|
2324
2324
|
}, []);
|
|
@@ -2339,22 +2339,19 @@ function PluginPlayground({
|
|
|
2339
2339
|
setIsActive(false);
|
|
2340
2340
|
setIsMinimized(true);
|
|
2341
2341
|
setIsClosed(false);
|
|
2342
|
-
|
|
2343
|
-
}, [onMinimize]);
|
|
2342
|
+
}, []);
|
|
2344
2343
|
const closeWindow = React23.useCallback(() => {
|
|
2345
2344
|
setIsActive(false);
|
|
2346
2345
|
setIsClosed(true);
|
|
2347
2346
|
setIsMinimized(false);
|
|
2348
|
-
|
|
2349
|
-
}, [onClose]);
|
|
2347
|
+
}, []);
|
|
2350
2348
|
const restoreWindow = React23.useCallback(() => {
|
|
2351
2349
|
setIsActive(true);
|
|
2352
2350
|
setIsClosed(false);
|
|
2353
2351
|
setIsMinimized(false);
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
() => ({
|
|
2352
|
+
}, []);
|
|
2353
|
+
const mockApi = React23.useMemo(() => {
|
|
2354
|
+
return {
|
|
2358
2355
|
showToast: (message, type) => {
|
|
2359
2356
|
console.info(`[playground:${type}] ${message}`);
|
|
2360
2357
|
},
|
|
@@ -2367,10 +2364,9 @@ function PluginPlayground({
|
|
|
2367
2364
|
getToken: async () => {
|
|
2368
2365
|
return mockToken;
|
|
2369
2366
|
},
|
|
2370
|
-
isDarkTheme:
|
|
2371
|
-
}
|
|
2372
|
-
|
|
2373
|
-
);
|
|
2367
|
+
isDarkTheme: isNightMode
|
|
2368
|
+
};
|
|
2369
|
+
}, [mockToken, mockUser, isNightMode]);
|
|
2374
2370
|
const appProps = React23.useMemo(
|
|
2375
2371
|
() => ({
|
|
2376
2372
|
name: title,
|