@vxrn/color-scheme 1.14.4 → 1.15.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.
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var index_exports = {};
22
24
  __export(index_exports, {
@@ -30,11 +32,11 @@ __export(index_exports, {
30
32
  useUserScheme: () => import_userScheme2.useUserScheme
31
33
  });
32
34
  module.exports = __toCommonJS(index_exports);
33
- var import_use_isomorphic_layout_effect = require("@vxrn/use-isomorphic-layout-effect"),
34
- import_userScheme = require("./userScheme.cjs"),
35
- import_systemScheme = require("./systemScheme.cjs"),
36
- import_userScheme2 = require("./userScheme.cjs"),
37
- import_jsx_runtime = require("react/jsx-runtime");
35
+ var import_use_isomorphic_layout_effect = require("@vxrn/use-isomorphic-layout-effect");
36
+ var import_userScheme = require("./userScheme.cjs");
37
+ var import_systemScheme = require("./systemScheme.cjs");
38
+ var import_userScheme2 = require("./userScheme.cjs");
39
+ var import_jsx_runtime = require("react/jsx-runtime");
38
40
  const storageKey = "vxrn-scheme";
39
41
  function SchemeProvider({
40
42
  children,
@@ -44,26 +46,38 @@ function SchemeProvider({
44
46
  }) {
45
47
  (0, import_userScheme.setForceScheme)(forceScheme ?? null);
46
48
  const {
47
- value
48
- } = (0, import_userScheme.useUserScheme)(),
49
- resolvedValue = forceScheme ?? value;
50
- (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(() => {
51
- !forceScheme && defaultScheme && typeof localStorage < "u" && (localStorage.getItem(storageKey) || (0, import_userScheme.setUserScheme)(defaultScheme));
52
- }, [defaultScheme, forceScheme]), (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(() => {
53
- const toAdd = getClassName(resolvedValue),
54
- toRemove = getClassName(resolvedValue === "light" ? "dark" : "light"),
55
- {
49
+ value
50
+ } = (0, import_userScheme.useUserScheme)();
51
+ const resolvedValue = forceScheme ?? value;
52
+ if (true) {
53
+ (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(() => {
54
+ if (!forceScheme && defaultScheme && typeof localStorage !== "undefined") {
55
+ if (!localStorage.getItem(storageKey)) {
56
+ (0, import_userScheme.setUserScheme)(defaultScheme);
57
+ }
58
+ }
59
+ }, [defaultScheme, forceScheme]);
60
+ (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(() => {
61
+ const toAdd = getClassName(resolvedValue);
62
+ const toRemove = getClassName(resolvedValue === "light" ? "dark" : "light");
63
+ const {
56
64
  classList
57
65
  } = document.documentElement;
58
- classList.remove(toRemove), classList.contains(toAdd) || classList.add(toAdd);
59
- }, [getClassName, resolvedValue]);
66
+ classList.remove(toRemove);
67
+ if (!classList.contains(toAdd)) {
68
+ classList.add(toAdd);
69
+ }
70
+ }, [getClassName, resolvedValue]);
71
+ }
60
72
  let scriptContent;
61
- if (forceScheme) scriptContent = `let d = document.documentElement.classList
73
+ if (forceScheme) {
74
+ scriptContent = `let d = document.documentElement.classList
62
75
  d.remove('${getClassName("light")}')
63
76
  d.remove('${getClassName("dark")}')
64
- d.add('${getClassName(forceScheme)}')`;else {
65
- const fallback = defaultScheme ? `'${defaultScheme}' === 'dark'` : "window.matchMedia('(prefers-color-scheme: dark)').matches",
66
- seedStorage = defaultScheme ? `if(!e){localStorage.setItem('${storageKey}','${defaultScheme}')}` : "";
77
+ d.add('${getClassName(forceScheme)}')`;
78
+ } else {
79
+ const fallback = defaultScheme ? `'${defaultScheme}' === 'dark'` : `window.matchMedia('(prefers-color-scheme: dark)').matches`;
80
+ const seedStorage = defaultScheme ? `if(!e){localStorage.setItem('${storageKey}','${defaultScheme}')}` : "";
67
81
  scriptContent = `let d = document.documentElement.classList
68
82
  d.remove('${getClassName("light")}')
69
83
  d.remove('${getClassName("dark")}')
@@ -75,8 +89,8 @@ let t = 'system' === e || !e
75
89
  t ? d.add('${getClassName("dark")}') : d.add('${getClassName("light")}')`;
76
90
  }
77
91
  return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
78
- children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("script", {
79
- suppressHydrationWarning: !0,
92
+ children: [false ? null : /* @__PURE__ */(0, import_jsx_runtime.jsx)("script", {
93
+ suppressHydrationWarning: true,
80
94
  dangerouslySetInnerHTML: {
81
95
  __html: scriptContent
82
96
  }
@@ -89,21 +103,21 @@ function MetaTheme({
89
103
  lightColor
90
104
  }) {
91
105
  const {
92
- value
93
- } = (0, import_userScheme.useUserScheme)(),
94
- forced = (0, import_userScheme.getForceScheme)(),
95
- scriptContent = forced ? `document.getElementById('vxrn-theme-color').setAttribute('content','${forced === "dark" ? darkColor : lightColor}')` : `let dc = document.getElementById('vxrn-theme-color')
106
+ value
107
+ } = (0, import_userScheme.useUserScheme)();
108
+ const forced = (0, import_userScheme.getForceScheme)();
109
+ const scriptContent = forced ? `document.getElementById('vxrn-theme-color').setAttribute('content','${forced === "dark" ? darkColor : lightColor}')` : `let dc = document.getElementById('vxrn-theme-color')
96
110
  let e1 = localStorage.getItem('${storageKey}')
97
111
  let isD = 'system' === e1 || !e1 ? window.matchMedia('(prefers-color-scheme: dark)').matches : e1 === 'dark'
98
112
  dc.setAttribute('content', isD ? '${darkColor}' : '${lightColor}')`;
99
113
  return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
100
114
  children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("meta", {
101
- suppressHydrationWarning: !0,
115
+ suppressHydrationWarning: true,
102
116
  id: "vxrn-theme-color",
103
117
  name: "theme-color",
104
118
  content: color ?? (value === "dark" ? darkColor : lightColor)
105
119
  }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("script", {
106
- suppressHydrationWarning: !0,
120
+ suppressHydrationWarning: true,
107
121
  id: "meta-theme-hydrate",
108
122
  dangerouslySetInnerHTML: {
109
123
  __html: scriptContent
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: !0
23
+ value: true
22
24
  }), mod);
23
25
  var index_exports = {};
24
26
  __export(index_exports, {
@@ -32,12 +34,12 @@ __export(index_exports, {
32
34
  useUserScheme: () => import_userScheme2.useUserScheme
33
35
  });
34
36
  module.exports = __toCommonJS(index_exports);
35
- var import_jsx_runtime = require("react/jsx-runtime"),
36
- import_use_isomorphic_layout_effect = require("@vxrn/use-isomorphic-layout-effect"),
37
- import_userScheme = require("./userScheme.native.js"),
38
- import_systemScheme = require("./systemScheme.native.js"),
39
- import_userScheme2 = require("./userScheme.native.js"),
40
- storageKey = "vxrn-scheme";
37
+ var import_jsx_runtime = require("react/jsx-runtime");
38
+ var import_use_isomorphic_layout_effect = require("@vxrn/use-isomorphic-layout-effect");
39
+ var import_userScheme = require("./userScheme.native.js");
40
+ var import_systemScheme = require("./systemScheme.native.js");
41
+ var import_userScheme2 = require("./userScheme.native.js");
42
+ var storageKey = "vxrn-scheme";
41
43
  function SchemeProvider(param) {
42
44
  var {
43
45
  children,
@@ -47,18 +49,40 @@ function SchemeProvider(param) {
47
49
  defaultScheme,
48
50
  forceScheme
49
51
  } = param;
50
- (0, import_userScheme.setForceScheme)(forceScheme ?? null);
52
+ (0, import_userScheme.setForceScheme)(forceScheme !== null && forceScheme !== void 0 ? forceScheme : null);
51
53
  var {
52
- value
53
- } = (0, import_userScheme.useUserScheme)(),
54
- resolvedValue = forceScheme ?? value,
55
- scriptContent;
56
- if (forceScheme) scriptContent = `let d = document.documentElement.classList
54
+ value
55
+ } = (0, import_userScheme.useUserScheme)();
56
+ var resolvedValue = forceScheme !== null && forceScheme !== void 0 ? forceScheme : value;
57
+ if (false) {
58
+ (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(function () {
59
+ if (!forceScheme && defaultScheme && typeof localStorage !== "undefined") {
60
+ if (!localStorage.getItem(storageKey)) {
61
+ (0, import_userScheme.setUserScheme)(defaultScheme);
62
+ }
63
+ }
64
+ }, [defaultScheme, forceScheme]);
65
+ (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(function () {
66
+ var toAdd = getClassName(resolvedValue);
67
+ var toRemove = getClassName(resolvedValue === "light" ? "dark" : "light");
68
+ var {
69
+ classList
70
+ } = document.documentElement;
71
+ classList.remove(toRemove);
72
+ if (!classList.contains(toAdd)) {
73
+ classList.add(toAdd);
74
+ }
75
+ }, [getClassName, resolvedValue]);
76
+ }
77
+ var scriptContent;
78
+ if (forceScheme) {
79
+ scriptContent = `let d = document.documentElement.classList
57
80
  d.remove('${getClassName("light")}')
58
81
  d.remove('${getClassName("dark")}')
59
- d.add('${getClassName(forceScheme)}')`;else {
60
- var fallback = defaultScheme ? `'${defaultScheme}' === 'dark'` : "window.matchMedia('(prefers-color-scheme: dark)').matches",
61
- seedStorage = defaultScheme ? `if(!e){localStorage.setItem('${storageKey}','${defaultScheme}')}` : "";
82
+ d.add('${getClassName(forceScheme)}')`;
83
+ } else {
84
+ var fallback = defaultScheme ? `'${defaultScheme}' === 'dark'` : `window.matchMedia('(prefers-color-scheme: dark)').matches`;
85
+ var seedStorage = defaultScheme ? `if(!e){localStorage.setItem('${storageKey}','${defaultScheme}')}` : "";
62
86
  scriptContent = `let d = document.documentElement.classList
63
87
  d.remove('${getClassName("light")}')
64
88
  d.remove('${getClassName("dark")}')
@@ -70,31 +94,36 @@ let t = 'system' === e || !e
70
94
  t ? d.add('${getClassName("dark")}') : d.add('${getClassName("light")}')`;
71
95
  }
72
96
  return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
73
- children: [null, children]
97
+ children: [true ? null : /* @__PURE__ */(0, import_jsx_runtime.jsx)("script", {
98
+ suppressHydrationWarning: true,
99
+ dangerouslySetInnerHTML: {
100
+ __html: scriptContent
101
+ }
102
+ }), children]
74
103
  });
75
104
  }
76
105
  function MetaTheme(param) {
77
106
  var {
78
- color,
79
- darkColor,
80
- lightColor
81
- } = param,
82
- {
83
- value
84
- } = (0, import_userScheme.useUserScheme)(),
85
- forced = (0, import_userScheme.getForceScheme)(),
86
- scriptContent = forced ? `document.getElementById('vxrn-theme-color').setAttribute('content','${forced === "dark" ? darkColor : lightColor}')` : `let dc = document.getElementById('vxrn-theme-color')
107
+ color,
108
+ darkColor,
109
+ lightColor
110
+ } = param;
111
+ var {
112
+ value
113
+ } = (0, import_userScheme.useUserScheme)();
114
+ var forced = (0, import_userScheme.getForceScheme)();
115
+ var scriptContent = forced ? `document.getElementById('vxrn-theme-color').setAttribute('content','${forced === "dark" ? darkColor : lightColor}')` : `let dc = document.getElementById('vxrn-theme-color')
87
116
  let e1 = localStorage.getItem('${storageKey}')
88
117
  let isD = 'system' === e1 || !e1 ? window.matchMedia('(prefers-color-scheme: dark)').matches : e1 === 'dark'
89
118
  dc.setAttribute('content', isD ? '${darkColor}' : '${lightColor}')`;
90
119
  return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
91
120
  children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)("meta", {
92
- suppressHydrationWarning: !0,
121
+ suppressHydrationWarning: true,
93
122
  id: "vxrn-theme-color",
94
123
  name: "theme-color",
95
- content: color ?? (value === "dark" ? darkColor : lightColor)
124
+ content: color !== null && color !== void 0 ? color : value === "dark" ? darkColor : lightColor
96
125
  }), /* @__PURE__ */(0, import_jsx_runtime.jsx)("script", {
97
- suppressHydrationWarning: !0,
126
+ suppressHydrationWarning: true,
98
127
  id: "meta-theme-hydrate",
99
128
  dangerouslySetInnerHTML: {
100
129
  __html: scriptContent
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","MetaTheme","SchemeProvider","getSystemScheme","import_systemScheme","getUserScheme","import_userScheme2","onUserSchemeChange","setUserScheme","useSystemScheme","useUserScheme","module","exports","import_jsx_runtime","require","import_use_isomorphic_layout_effect","import_userScheme","storageKey","param","children","getClassName","name","defaultScheme","forceScheme","setForceScheme","resolvedValue","scriptContent","fallback","seedStorage","jsxs","Fragment","color","darkColor","lightColor","forced","getForceScheme","jsx","suppressHydrationWarning","id","content","dangerouslySetInnerHTML","__html"],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAC,mBAAA,CAAAD,eAAA;EAAAE,aAAA,EAAAA,CAAA,KAAAC,kBAAA,CAAAD,aAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAD,kBAAA,CAAAC,kBAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAF,kBAAA,CAAAE,aAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAL,mBAAA,CAAAK,eAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAJ,kBAAA,CAAAI;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAlB,YAAA,CAAAK,aAA0C;AAsB1C,IAAAc,kBAAmB,GAAAC,OAAA;EAAAC,mCAAA,GAAAD,OAAA;EAAAE,iBAAA,GAAAF,OAAA;EAAAV,mBAAA,GAAAU,OAAA;EAAAR,kBAAA,GAAAQ,OAAA;EAAAG,UAAA;AAEZ,SAASf,eAAegB,KAAA;EAC7B;IAAAC,QAAA;IAAAC,YAAA,YAAAA,CAAAC,IAAA;MACA,YAAAA,IAAgB;IAChB;IAAAC,aAAA;IAAAC;EAAA,IAAAL,KAAA;EACA,IAAAF,iBAAA,CAAAQ,cAAA,EAAAD,WAAA;EACF,IAOG;MAAAzB;IAAA,QAAAkB,iBAAA,CAAAN,aAAA;IAAAe,aAAA,GAAAF,WA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IAKF;EACqC;AAIzC","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","index_exports","MetaTheme","SchemeProvider","getSystemScheme","import_systemScheme","getUserScheme","import_userScheme2","onUserSchemeChange","setUserScheme","useSystemScheme","useUserScheme","module","exports","import_jsx_runtime","require","import_use_isomorphic_layout_effect","import_userScheme","storageKey","param","children","getClassName","defaultScheme","forceScheme","setForceScheme","resolvedValue","useIsomorphicLayoutEffect","localStorage","getItem","toAdd","toRemove","classList","document","documentElement","remove","contains","add","scriptContent","fallback","seedStorage","jsxs","Fragment","jsx","suppressHydrationWarning","dangerouslySetInnerHTML","__html","color","darkColor","lightColor","forced","getForceScheme","id","content"],"sources":["index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n MetaTheme: () => MetaTheme,\n SchemeProvider: () => SchemeProvider,\n getSystemScheme: () => import_systemScheme.getSystemScheme,\n getUserScheme: () => import_userScheme2.getUserScheme,\n onUserSchemeChange: () => import_userScheme2.onUserSchemeChange,\n setUserScheme: () => import_userScheme2.setUserScheme,\n useSystemScheme: () => import_systemScheme.useSystemScheme,\n useUserScheme: () => import_userScheme2.useUserScheme\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_use_isomorphic_layout_effect = require(\"@vxrn/use-isomorphic-layout-effect\");\nvar import_userScheme = require(\"./userScheme\");\nvar import_systemScheme = require(\"./systemScheme\");\nvar import_userScheme2 = require(\"./userScheme\");\nvar storageKey = \"vxrn-scheme\";\nfunction SchemeProvider(param) {\n var { children, getClassName = function(name) {\n return `t_${name}`;\n }, defaultScheme, forceScheme } = param;\n (0, import_userScheme.setForceScheme)(forceScheme !== null && forceScheme !== void 0 ? forceScheme : null);\n var { value } = (0, import_userScheme.useUserScheme)();\n var resolvedValue = forceScheme !== null && forceScheme !== void 0 ? forceScheme : value;\n if (false) {\n (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(function() {\n if (!forceScheme && defaultScheme && typeof localStorage !== \"undefined\") {\n if (!localStorage.getItem(storageKey)) {\n (0, import_userScheme.setUserScheme)(defaultScheme);\n }\n }\n }, [\n defaultScheme,\n forceScheme\n ]);\n (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(function() {\n var toAdd = getClassName(resolvedValue);\n var toRemove = getClassName(resolvedValue === \"light\" ? \"dark\" : \"light\");\n var { classList } = document.documentElement;\n classList.remove(toRemove);\n if (!classList.contains(toAdd)) {\n classList.add(toAdd);\n }\n }, [\n getClassName,\n resolvedValue\n ]);\n }\n var scriptContent;\n if (forceScheme) {\n scriptContent = `let d = document.documentElement.classList\nd.remove('${getClassName(\"light\")}')\nd.remove('${getClassName(\"dark\")}')\nd.add('${getClassName(forceScheme)}')`;\n } else {\n var fallback = defaultScheme ? `'${defaultScheme}' === 'dark'` : `window.matchMedia('(prefers-color-scheme: dark)').matches`;\n var seedStorage = defaultScheme ? `if(!e){localStorage.setItem('${storageKey}','${defaultScheme}')}` : \"\";\n scriptContent = `let d = document.documentElement.classList\nd.remove('${getClassName(\"light\")}')\nd.remove('${getClassName(\"dark\")}')\nlet e = localStorage.getItem('${storageKey}')\n${seedStorage}\nlet t = 'system' === e || !e\n ? ${fallback}\n : e === 'dark'\nt ? d.add('${getClassName(\"dark\")}') : d.add('${getClassName(\"light\")}')`;\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {\n children: [\n true ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"script\", {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: {\n __html: scriptContent\n }\n }),\n children\n ]\n });\n}\nfunction MetaTheme(param) {\n var { color, darkColor, lightColor } = param;\n var { value } = (0, import_userScheme.useUserScheme)();\n var forced = (0, import_userScheme.getForceScheme)();\n var scriptContent = forced ? `document.getElementById('vxrn-theme-color').setAttribute('content','${forced === \"dark\" ? darkColor : lightColor}')` : `let dc = document.getElementById('vxrn-theme-color')\nlet e1 = localStorage.getItem('${storageKey}')\nlet isD = 'system' === e1 || !e1 ? window.matchMedia('(prefers-color-scheme: dark)').matches : e1 === 'dark'\ndc.setAttribute('content', isD ? '${darkColor}' : '${lightColor}')`;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {\n children: [\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"meta\", {\n suppressHydrationWarning: true,\n id: \"vxrn-theme-color\",\n name: \"theme-color\",\n content: color !== null && color !== void 0 ? color : value === \"dark\" ? darkColor : lightColor\n }),\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"script\", {\n suppressHydrationWarning: true,\n id: \"meta-theme-hydrate\",\n dangerouslySetInnerHTML: {\n __html: scriptContent\n }\n })\n ]\n });\n}\n//# sourceMappingURL=index.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,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AI;MAC9BQ,EAAE,EAAE,kBAAkB;MACtB/D,IAAI,EAAE,aAAa;MACnBgE,OAAO,EAAEN,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,CAAC,GAAGA,KAAK,GAAG9C,KAAK,KAAK,MAAM,GAAG+C,SAAS,GAAGC;IACvF,CAAC,CAAC,EACF,eAAgB,CAAC,CAAC,EAAElC,kBAAkB,CAAC4B,GAAG,EAAE,QAAQ,EAAE;MACpDC,wBAAwB,EAAE,IAAI;MAC9BQ,EAAE,EAAE,oBAAoB;MACxBP,uBAAuB,EAAE;QACvBC,MAAM,EAAER;MACV;IACF,CAAC,CAAC;EAEN,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var systemScheme_exports = {};
22
24
  __export(systemScheme_exports, {
@@ -24,17 +26,19 @@ __export(systemScheme_exports, {
24
26
  useSystemScheme: () => useSystemScheme
25
27
  });
26
28
  module.exports = __toCommonJS(systemScheme_exports);
27
- var import_use_isomorphic_layout_effect = require("@vxrn/use-isomorphic-layout-effect"),
28
- import_react = require("react");
29
- const media = typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
29
+ var import_use_isomorphic_layout_effect = require("@vxrn/use-isomorphic-layout-effect");
30
+ var import_react = require("react");
31
+ const media = typeof window !== "undefined" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
30
32
  function getSystemScheme() {
31
33
  return media?.matches ? "dark" : "light";
32
34
  }
33
35
  function useSystemScheme() {
34
36
  const [scheme, setScheme] = (0, import_react.useState)("light");
35
- return (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(() => {
37
+ (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(() => {
36
38
  setScheme(getSystemScheme());
37
39
  const onChange = () => setScheme(getSystemScheme());
38
- return media?.addEventListener("change", onChange), () => media?.removeEventListener("change", onChange);
39
- }, []), scheme;
40
+ media?.addEventListener("change", onChange);
41
+ return () => media?.removeEventListener("change", onChange);
42
+ }, []);
43
+ return scheme;
40
44
  }
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: !0
23
+ value: true
22
24
  }), mod);
23
25
  var systemScheme_native_exports = {};
24
26
  __export(systemScheme_native_exports, {
@@ -26,8 +28,8 @@ __export(systemScheme_native_exports, {
26
28
  useSystemScheme: () => useSystemScheme
27
29
  });
28
30
  module.exports = __toCommonJS(systemScheme_native_exports);
29
- var import_react = require("react"),
30
- import_react_native = require("react-native");
31
+ var import_react = require("react");
32
+ var import_react_native = require("react-native");
31
33
  function toScheme(colorScheme) {
32
34
  return colorScheme === "dark" ? "dark" : "light";
33
35
  }
@@ -36,25 +38,27 @@ function getSystemScheme() {
36
38
  }
37
39
  function useSystemScheme() {
38
40
  var [scheme, setScheme] = (0, import_react.useState)(getSystemScheme);
39
- return (0, import_react.useEffect)(function () {
41
+ (0, import_react.useEffect)(function () {
40
42
  var appearanceSubscription = import_react_native.Appearance.addChangeListener(function (param) {
41
- var {
42
- colorScheme
43
- } = param;
44
- setScheme(toScheme(colorScheme));
45
- }),
46
- handleAppStateChange = function (nextAppState) {
47
- if (nextAppState === "active") {
48
- var currentScheme = getSystemScheme();
49
- setScheme(function (prev) {
50
- return prev !== currentScheme ? currentScheme : prev;
51
- });
52
- }
53
- },
54
- appStateSubscription = import_react_native.AppState.addEventListener("change", handleAppStateChange);
43
+ var {
44
+ colorScheme
45
+ } = param;
46
+ setScheme(toScheme(colorScheme));
47
+ });
48
+ var handleAppStateChange = function (nextAppState) {
49
+ if (nextAppState === "active") {
50
+ var currentScheme = getSystemScheme();
51
+ setScheme(function (prev) {
52
+ return prev !== currentScheme ? currentScheme : prev;
53
+ });
54
+ }
55
+ };
56
+ var appStateSubscription = import_react_native.AppState.addEventListener("change", handleAppStateChange);
55
57
  return function () {
56
- appearanceSubscription.remove(), appStateSubscription.remove();
58
+ appearanceSubscription.remove();
59
+ appStateSubscription.remove();
57
60
  };
58
- }, []), scheme;
61
+ }, []);
62
+ return scheme;
59
63
  }
60
64
  //# sourceMappingURL=systemScheme.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["systemScheme_native_exports","__export","getSystemScheme","useSystemScheme","module","exports","__toCommonJS","import_react","require","import_react_native","toScheme","colorScheme","Appearance","getColorScheme","scheme","setScheme","useState","useEffect","appearanceSubscription","addChangeListener","param","handleAppStateChange","nextAppState","currentScheme","prev","appStateSubscription","AppState","addEventListener","remove"],"sources":["../../src/systemScheme.native.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,2BAAA;AAAAC,QAAA,CAAAD,2BAAA;EAAAE,eAAA,EAAAA,CAAA,KAAAA,eAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAN,2BAAA;AAAA,IAAAO,YAAA,GAAoCC,OAAA;EACpCC,mBAAA,GAAqCD,OAAA;AACrC,SAASE,SAASC,WAAA,EAAa;EAC3B,OAAOA,WAAA,KAAgB,SAAS,SAAS;AAC7C;AACO,SAAST,gBAAA,EAAkB;EAC9B,OAAOQ,QAAA,CAASD,mBAAA,CAAAG,UAAA,CAAWC,cAAA,CAAe,CAAC;AAC/C;AACO,SAASV,gBAAA,EAAkB;EAC9B,IAAI,CAACW,MAAA,EAAQC,SAAS,QAAIR,YAAA,CAAAS,QAAA,EAASd,eAAe;EAClD,WAAAK,YAAA,CAAAU,SAAA,EAAU,YAAW;IAEjB,IAAIC,sBAAA,GAAyBT,mBAAA,CAAAG,UAAA,CAAWO,iBAAA,CAAkB,UAASC,KAAA,EAAO;QACtE,IAAI;UAAET;QAAY,IAAIS,KAAA;QACtBL,SAAA,CAAUL,QAAA,CAASC,WAAW,CAAC;MACnC,CAAC;MAGGU,oBAAA,GAAuB,SAAAA,CAASC,YAAA,EAAc;QAC9C,IAAIA,YAAA,KAAiB,UAAU;UAC3B,IAAIC,aAAA,GAAgBrB,eAAA,CAAgB;UACpCa,SAAA,CAAU,UAASS,IAAA,EAAM;YACrB,OAAOA,IAAA,KAASD,aAAA,GAAgBA,aAAA,GAAgBC,IAAA;UACpD,CAAC;QACL;MACJ;MACIC,oBAAA,GAAuBhB,mBAAA,CAAAiB,QAAA,CAASC,gBAAA,CAAiB,UAAUN,oBAAoB;IACnF,OAAO,YAAW;MACdH,sBAAA,CAAuBU,MAAA,CAAO,GAC9BH,oBAAA,CAAqBG,MAAA,CAAO;IAChC;EACJ,GAAG,EAAE,GACEd,MAAA;AACX","ignoreList":[]}
1
+ {"version":3,"names":["systemScheme_native_exports","__export","getSystemScheme","useSystemScheme","module","exports","__toCommonJS","import_react","require","import_react_native","toScheme","colorScheme","Appearance","getColorScheme","scheme","setScheme","useState","useEffect","appearanceSubscription","addChangeListener","param","handleAppStateChange","nextAppState","currentScheme","prev","appStateSubscription","AppState","addEventListener","remove"],"sources":["../../src/systemScheme.native.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,2BAAA;AAAAC,QAAA,CAAAD,2BAAA;EAAAE,eAAA,EAAAA,CAAA,KAAAA,eAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAN,2BAAA;AAAA,IAAAO,YAAA,GAAoCC,OAAA;AACpC,IAAAC,mBAAA,GAAqCD,OAAA;AACrC,SAASE,SAASC,WAAA,EAAa;EAC3B,OAAOA,WAAA,KAAgB,SAAS,SAAS;AAC7C;AACO,SAAST,gBAAA,EAAkB;EAC9B,OAAOQ,QAAA,CAASD,mBAAA,CAAAG,UAAA,CAAWC,cAAA,CAAe,CAAC;AAC/C;AACO,SAASV,gBAAA,EAAkB;EAC9B,IAAI,CAACW,MAAA,E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