zova-suite-a-devui 5.0.13 → 5.0.15
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-devui",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.15",
|
|
4
4
|
"title": "a-devui",
|
|
5
5
|
"zovaModule": {
|
|
6
6
|
"capabilities": {
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"scripts": {},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "5fd1484d04f43c3f32e49c989fc55373087a1957"
|
|
35
35
|
}
|
|
@@ -13,16 +13,12 @@ export class LocalSSR extends BeanBase<ScopeModule> {
|
|
|
13
13
|
// ssr theme
|
|
14
14
|
if (process.env.SERVER) {
|
|
15
15
|
this.ctx.meta.ssr.context.onRendered(() => {
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const themeName = __names.join('-');
|
|
23
|
-
document.body.setAttribute('data-theme', themeName);
|
|
24
|
-
document.querySelector('#__prefersColorSchemeDarkJS').remove();
|
|
25
|
-
</script>`.replaceAll('\n', '');
|
|
16
|
+
if (!this.app.config.ssr.cookieThemeDark) {
|
|
17
|
+
this.ctx.meta.ssr.context._meta.bodyTags += `<script id="__prefersColorSchemeDarkJS">
|
|
18
|
+
document.body.setAttribute('data-theme', window.ssr_local_themedark_data);
|
|
19
|
+
document.querySelector('#__prefersColorSchemeDarkJS').remove();
|
|
20
|
+
</script>`.replaceAll('\n', '');
|
|
21
|
+
}
|
|
26
22
|
});
|
|
27
23
|
}
|
|
28
24
|
}
|
|
@@ -15,13 +15,18 @@ export class ToolThemeHandler extends BeanBase<ScopeModule> implements ThemeHand
|
|
|
15
15
|
const themeName = _names.join('-');
|
|
16
16
|
// data-theme
|
|
17
17
|
if (process.env.CLIENT) {
|
|
18
|
+
// client
|
|
18
19
|
const body = window?.document?.body;
|
|
19
20
|
if (body) {
|
|
20
21
|
body.setAttribute('data-theme', themeName);
|
|
21
22
|
}
|
|
22
23
|
} else {
|
|
23
|
-
//
|
|
24
|
-
this
|
|
24
|
+
// server
|
|
25
|
+
if (!this.app.config.ssr.cookieThemeDark) {
|
|
26
|
+
this.$useMeta({ bodyAttr: { [`data-ssr-theme-dark-${dark}`]: themeName } });
|
|
27
|
+
} else {
|
|
28
|
+
this.$useMeta({ bodyAttr: { 'data-theme': themeName } });
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
32
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-devui",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.15",
|
|
4
4
|
"title": "a-devui",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "devui",
|
|
7
7
|
"author": "zhennann",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"zova-module-a-devui": "^5.0.
|
|
9
|
+
"zova-module-a-devui": "^5.0.15"
|
|
10
10
|
},
|
|
11
|
-
"gitHead": "
|
|
11
|
+
"gitHead": "5fd1484d04f43c3f32e49c989fc55373087a1957"
|
|
12
12
|
}
|