weifuwu 0.17.21 → 0.17.22

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.
Files changed (2) hide show
  1. package/dist/react.js +2 -1
  2. package/package.json +1 -1
package/dist/react.js CHANGED
@@ -544,13 +544,14 @@ function useLocale() {
544
544
 
545
545
  // client-theme.ts
546
546
  function resolveTheme(theme) {
547
- if (theme === "system") {
547
+ if (theme === "system" && typeof window !== "undefined") {
548
548
  return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
549
549
  }
550
550
  return theme;
551
551
  }
552
552
  var _mqListener = null;
553
553
  function applyTheme(theme) {
554
+ if (typeof document === "undefined") return;
554
555
  const resolved = resolveTheme(theme);
555
556
  document.documentElement.dataset.theme = resolved;
556
557
  if (theme === "system") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weifuwu",
3
- "version": "0.17.21",
3
+ "version": "0.17.22",
4
4
  "description": "Web-standard HTTP framework for Node.js — (req, ctx) => Response",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",