@tamagui/theme 2.7.7 → 3.0.0-beta.643.1

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 (44) hide show
  1. package/dist/cjs/_mutateTheme.cjs +101 -116
  2. package/dist/cjs/_mutateTheme.native.cjs +118 -0
  3. package/dist/cjs/_mutateTheme.native.js +92 -109
  4. package/dist/cjs/_mutateTheme.native.js.map +1 -1
  5. package/dist/cjs/addTheme.cjs +20 -23
  6. package/dist/cjs/addTheme.native.cjs +34 -0
  7. package/dist/cjs/addTheme.native.js +20 -22
  8. package/dist/cjs/addTheme.native.js.map +1 -1
  9. package/dist/cjs/index.cjs +15 -18
  10. package/dist/cjs/index.native.cjs +31 -0
  11. package/dist/cjs/index.native.js +15 -17
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/cjs/replaceTheme.cjs +23 -29
  14. package/dist/cjs/replaceTheme.native.cjs +37 -0
  15. package/dist/cjs/replaceTheme.native.js +23 -28
  16. package/dist/cjs/replaceTheme.native.js.map +1 -1
  17. package/dist/cjs/updateTheme.cjs +22 -28
  18. package/dist/cjs/updateTheme.native.cjs +36 -0
  19. package/dist/cjs/updateTheme.native.js +22 -27
  20. package/dist/cjs/updateTheme.native.js.map +1 -1
  21. package/dist/esm/_mutateTheme.mjs +88 -100
  22. package/dist/esm/_mutateTheme.mjs.map +1 -1
  23. package/dist/esm/_mutateTheme.native.js +78 -93
  24. package/dist/esm/_mutateTheme.native.js.map +1 -1
  25. package/dist/esm/addTheme.mjs +7 -5
  26. package/dist/esm/addTheme.mjs.map +1 -1
  27. package/dist/esm/addTheme.native.js +7 -5
  28. package/dist/esm/addTheme.native.js.map +1 -1
  29. package/dist/esm/index.js +8 -5
  30. package/dist/esm/index.mjs +8 -5
  31. package/dist/esm/index.native.js +8 -5
  32. package/dist/esm/replaceTheme.mjs +10 -11
  33. package/dist/esm/replaceTheme.mjs.map +1 -1
  34. package/dist/esm/replaceTheme.native.js +10 -11
  35. package/dist/esm/replaceTheme.native.js.map +1 -1
  36. package/dist/esm/updateTheme.mjs +9 -10
  37. package/dist/esm/updateTheme.mjs.map +1 -1
  38. package/dist/esm/updateTheme.native.js +9 -10
  39. package/dist/esm/updateTheme.native.js.map +1 -1
  40. package/package.json +5 -5
  41. package/src/_mutateTheme.ts +5 -4
  42. package/dist/esm/index.js.map +0 -1
  43. package/dist/esm/index.mjs.map +0 -1
  44. package/dist/esm/index.native.js.map +0 -1
@@ -1,43 +1,38 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  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, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
24
  var updateTheme_exports = {};
26
- __export(updateTheme_exports, {
27
- updateTheme: () => updateTheme
28
- });
25
+ __export(updateTheme_exports, { updateTheme: () => updateTheme });
29
26
  module.exports = __toCommonJS(updateTheme_exports);
30
27
  var import_mutateTheme = require("./_mutateTheme.native.js");
31
28
  function updateTheme(param) {
32
- var {
33
- name,
34
- theme
35
- } = param;
36
- return (0, import_mutateTheme._mutateTheme)({
37
- name,
38
- theme,
39
- insertCSS: true,
40
- mutationType: "update"
41
- });
29
+ var { name, theme } = param;
30
+ return (0, import_mutateTheme._mutateTheme)({
31
+ name,
32
+ theme,
33
+ insertCSS: true,
34
+ mutationType: "update"
35
+ });
42
36
  }
37
+
43
38
  //# sourceMappingURL=updateTheme.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","updateTheme_exports","__export","updateTheme","module","exports","import_mutateTheme","require","param","name","theme","_mutateTheme"],"sources":["../../src/updateTheme.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,mBAAA;AAAAC,QAAA,CAAAD,mBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA;AAAA;AAEAC,MAAA,CAAAC,OAAA,GAAAT,YAA6B,CAAAK,mBAAA;AAEtB,IAAAK,kBAAqB,GAAAC,OAAA;AAAA,SAC1BJ,YAAAK,KAAA;EACA;IAAAC,IAAA;IAAAC;EAAA,IAAAF,KAAA;EACF,OAGG,IAAAF,kBAAA,CAAAK,YAAA;IACDF,IAAA;IACFC,KAAA","ignoreList":[]}
1
+ {"version":3,"file":"updateTheme.native.js","names":[],"sources":["cjs/updateTheme.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 updateTheme_exports = {};\n__export(updateTheme_exports, {\n updateTheme: () => updateTheme\n});\nmodule.exports = __toCommonJS(updateTheme_exports);\nvar import_mutateTheme = require(\"./_mutateTheme\");\nfunction updateTheme(param) {\n var { name, theme } = param;\n return (0, import_mutateTheme._mutateTheme)({\n name,\n theme,\n insertCSS: true,\n mutationType: \"update\"\n });\n}\n//# sourceMappingURL=updateTheme.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,sBAAsB,CAAC;AAC3B,SAAS,qBAAqB,EAC5B,mBAAmB,YACrB,CAAC;AACD,OAAO,UAAU,aAAa,mBAAmB;AACjD,IAAI,qBAAqB,QAAQ,0BAAgB;AACjD,SAAS,YAAY,OAAO;CAC1B,IAAI,EAAE,MAAM,UAAU;CACtB,QAAQ,GAAG,mBAAmB,cAAc;EAC1C;EACA;EACA,WAAW;EACX,cAAc;CAChB,CAAC;AACH"}
@@ -1,115 +1,103 @@
1
1
  import { isServer } from "@tamagui/constants";
2
2
  import { startTransition } from "@tamagui/start-transition";
3
- import { ensureThemeVariable, forceUpdateThemes, getConfig, getThemeCSSRules, mutatedAutoVariables, proxyThemeToParents, simpleHash, updateConfig } from "@tamagui/web";
4
- function mutateThemes({
5
- themes,
6
- batch,
7
- insertCSS = true,
8
- ...props
9
- }) {
10
- const allThemesProxied = {};
11
- const allThemesRaw = {};
12
- for (const {
13
- name,
14
- theme
15
- } of themes) {
16
- const res = _mutateTheme({
17
- ...props,
18
- name,
19
- theme,
20
- avoidUpdate: true,
21
- mutationType: "add"
22
- });
23
- if (res) {
24
- allThemesProxied[name] = res.theme;
25
- allThemesRaw[name] = res.themeRaw;
26
- }
27
- }
28
- const cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
29
- startTransition(() => {
30
- for (const themeName in allThemesProxied) {
31
- const theme = allThemesProxied[themeName];
32
- updateThemeConfig(themeName, theme);
33
- }
34
- updateThemeStates();
35
- });
36
- return {
37
- themes: allThemesProxied,
38
- themesRaw: allThemesRaw,
39
- cssRules
40
- };
3
+ import { ensureThemeVariable, forceUpdateThemes, getConfig, getMutatedAutoVariableCSS, getThemeCSSRules, proxyThemeToParents, simpleHash, updateConfig } from "@tamagui/web";
4
+
5
+ function mutateThemes({ themes, batch, insertCSS = true, ...props }) {
6
+ const allThemesProxied = {};
7
+ const allThemesRaw = {};
8
+ for (const { name, theme } of themes) {
9
+ const res = _mutateTheme({
10
+ ...props,
11
+ name,
12
+ theme,
13
+ avoidUpdate: true,
14
+ mutationType: "add"
15
+ });
16
+ if (res) {
17
+ allThemesProxied[name] = res.theme;
18
+ allThemesRaw[name] = res.themeRaw;
19
+ }
20
+ }
21
+ const cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
22
+ startTransition(() => {
23
+ for (const themeName in allThemesProxied) {
24
+ const theme = allThemesProxied[themeName];
25
+ updateThemeConfig(themeName, theme);
26
+ }
27
+ updateThemeStates();
28
+ });
29
+ return {
30
+ themes: allThemesProxied,
31
+ themesRaw: allThemesRaw,
32
+ cssRules
33
+ };
41
34
  }
42
35
  function _mutateTheme(props) {
43
- if (isServer) {
44
- if (process.env.NODE_ENV === "development") console.warn("Theme mutation is not supported on server side");
45
- return;
46
- }
47
- const config = getConfig();
48
- const {
49
- name: themeName,
50
- theme: themeIn,
51
- insertCSS,
52
- mutationType
53
- } = props;
54
- if (process.env.NODE_ENV === "development") {
55
- if (!config) throw new Error("No config");
56
- const theme2 = config.themes[props.name];
57
- if (mutationType !== "add" && !theme2) throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
58
- }
59
- const theme = {
60
- ...(mutationType === "update" ? config.themes[themeName] ?? {} : {}),
61
- ...themeIn
62
- };
63
- for (const key in theme) ensureThemeVariable(theme, key);
64
- const themeProxied = proxyThemeToParents(themeName, theme);
65
- const response = {
66
- themeRaw: theme,
67
- theme: themeProxied,
68
- cssRules: []
69
- };
70
- if (props.avoidUpdate) return response;
71
- if (insertCSS) response.cssRules = insertThemeCSS({
72
- [themeName]: theme
73
- });
74
- updateThemeConfig(themeName, themeProxied);
75
- updateThemeStates();
76
- return response;
36
+ if (isServer) {
37
+ if (process.env.NODE_ENV === "development") console.warn("Theme mutation is not supported on server side");
38
+ return;
39
+ }
40
+ const config = getConfig();
41
+ const { name: themeName, theme: themeIn, insertCSS, mutationType } = props;
42
+ if (process.env.NODE_ENV === "development") {
43
+ if (!config) throw new Error("No config");
44
+ const theme2 = config.themes[props.name];
45
+ if (mutationType !== "add" && !theme2) throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
46
+ }
47
+ const theme = {
48
+ ...mutationType === "update" ? config.themes[themeName] ?? {} : {},
49
+ ...themeIn
50
+ };
51
+ for (const key in theme) ensureThemeVariable(theme, key);
52
+ const themeProxied = proxyThemeToParents(themeName, theme);
53
+ const response = {
54
+ themeRaw: theme,
55
+ theme: themeProxied,
56
+ cssRules: []
57
+ };
58
+ if (props.avoidUpdate) return response;
59
+ if (insertCSS) response.cssRules = insertThemeCSS({ [themeName]: theme });
60
+ updateThemeConfig(themeName, themeProxied);
61
+ updateThemeStates();
62
+ return response;
77
63
  }
78
64
  function updateThemeConfig(themeName, theme) {
79
- const config = getConfig();
80
- config.themes[themeName] = theme;
81
- updateConfig("themes", config.themes);
65
+ const config = getConfig();
66
+ config.themes[themeName] = theme;
67
+ updateConfig("themes", config.themes);
82
68
  }
83
69
  function updateThemeStates() {
84
- forceUpdateThemes();
70
+ forceUpdateThemes();
85
71
  }
86
72
  function insertThemeCSS(themes, batch = false) {
87
- const config = getConfig();
88
- let cssRules = [];
89
- for (const themeName in themes) {
90
- const theme = themes[themeName];
91
- const rules = getThemeCSSRules({
92
- config,
93
- themeName,
94
- names: [themeName],
95
- hasDarkLight: true,
96
- theme,
97
- useMutatedVariables: true
98
- });
99
- cssRules = [...cssRules, ...rules];
100
- if (!batch) updateStyle(`t_theme_style_${themeName}`, rules);
101
- }
102
- if (mutatedAutoVariables.length > 0) updateStyle(`t_mutate_vars`, [`:root{${mutatedAutoVariables.map(v => `--${v.name}:${v.val}`).join(";")}}`]);
103
- if (batch) updateStyle(`t_theme_style_${typeof batch == "string" ? batch : simpleHash(Object.keys(themes).join(""))}`, cssRules);
104
- return cssRules;
73
+ const config = getConfig();
74
+ let cssRules = [];
75
+ for (const themeName in themes) {
76
+ const theme = themes[themeName];
77
+ const rules = getThemeCSSRules({
78
+ config,
79
+ themeName,
80
+ names: [themeName],
81
+ hasDarkLight: true,
82
+ theme,
83
+ useMutatedVariables: true
84
+ });
85
+ cssRules = [...cssRules, ...rules];
86
+ if (!batch) updateStyle(`t_theme_style_${themeName}`, rules);
87
+ }
88
+ const mutatedAutoVariableCSS = getMutatedAutoVariableCSS();
89
+ if (mutatedAutoVariableCSS) updateStyle(`t_mutate_vars`, [`:root{${mutatedAutoVariableCSS}}`]);
90
+ if (batch) updateStyle(`t_theme_style_${typeof batch == "string" ? batch : simpleHash(Object.keys(themes).join(""))}`, cssRules);
91
+ return cssRules;
105
92
  }
106
93
  function updateStyle(id, rules) {
107
- const existing = document.querySelector(`#${id}`);
108
- const style = document.createElement("style");
109
- style.id = id;
110
- style.appendChild(document.createTextNode(rules.join("\n")));
111
- document.head.appendChild(style);
112
- if (existing) existing.parentElement?.removeChild(existing);
94
+ const existing = document.querySelector(`#${id}`);
95
+ const style = document.createElement("style");
96
+ style.id = id;
97
+ style.appendChild(document.createTextNode(rules.join("\n")));
98
+ document.head.appendChild(style);
99
+ if (existing) existing.parentElement?.removeChild(existing);
113
100
  }
101
+
114
102
  export { _mutateTheme, mutateThemes };
115
103
  //# sourceMappingURL=_mutateTheme.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["isServer","startTransition","ensureThemeVariable","forceUpdateThemes","getConfig","getThemeCSSRules","mutatedAutoVariables","proxyThemeToParents","simpleHash","updateConfig","mutateThemes","themes","batch","insertCSS","props","allThemesProxied","allThemesRaw","name","theme","res","_mutateTheme","avoidUpdate","mutationType","themeRaw","cssRules","insertThemeCSS","themeName","updateThemeConfig","updateThemeStates","themesRaw","process","env","NODE_ENV","console","warn","config","themeIn","Error","theme2","key","themeProxied","response","rules","names","hasDarkLight","useMutatedVariables","updateStyle","length","map","v","val","join","Object","keys","id","existing","document","querySelector","style","createElement","appendChild","createTextNode","head","parentElement","removeChild"],"sources":["_mutateTheme.mjs"],"sourcesContent":["import { isServer } from \"@tamagui/constants\";\nimport { startTransition } from \"@tamagui/start-transition\";\nimport { ensureThemeVariable, forceUpdateThemes, getConfig, getThemeCSSRules, mutatedAutoVariables, proxyThemeToParents, simpleHash, updateConfig } from \"@tamagui/web\";\n\nfunction mutateThemes({ themes, batch, insertCSS = true, ...props }) {\n\tconst allThemesProxied = {};\n\tconst allThemesRaw = {};\n\tfor (const { name, theme } of themes) {\n\t\tconst res = _mutateTheme({\n\t\t\t...props,\n\t\t\tname,\n\t\t\ttheme,\n\t\t\tavoidUpdate: true,\n\t\t\tmutationType: \"add\"\n\t\t});\n\t\tif (res) {\n\t\t\tallThemesProxied[name] = res.theme;\n\t\t\tallThemesRaw[name] = res.themeRaw;\n\t\t}\n\t}\n\tconst cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];\n\tstartTransition(() => {\n\t\tfor (const themeName in allThemesProxied) {\n\t\t\tconst theme = allThemesProxied[themeName];\n\t\t\tupdateThemeConfig(themeName, theme);\n\t\t}\n\t\tupdateThemeStates();\n\t});\n\treturn {\n\t\tthemes: allThemesProxied,\n\t\tthemesRaw: allThemesRaw,\n\t\tcssRules\n\t};\n}\nfunction _mutateTheme(props) {\n\tif (isServer) {\n\t\tif (process.env.NODE_ENV === \"development\") console.warn(\"Theme mutation is not supported on server side\");\n\t\treturn;\n\t}\n\tconst config = getConfig();\n\tconst { name: themeName, theme: themeIn, insertCSS, mutationType } = props;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!config) throw new Error(\"No config\");\n\t\tconst theme2 = config.themes[props.name];\n\t\tif (mutationType !== \"add\" && !theme2) throw new Error(`${mutationType === \"replace\" ? \"Replace\" : \"Update\"} theme failed! Theme ${props.name} does not exist`);\n\t}\n\tconst theme = {\n\t\t...mutationType === \"update\" ? config.themes[themeName] ?? {} : {},\n\t\t...themeIn\n\t};\n\tfor (const key in theme) ensureThemeVariable(theme, key);\n\tconst themeProxied = proxyThemeToParents(themeName, theme);\n\tconst response = {\n\t\tthemeRaw: theme,\n\t\ttheme: themeProxied,\n\t\tcssRules: []\n\t};\n\tif (props.avoidUpdate) return response;\n\tif (insertCSS) response.cssRules = insertThemeCSS({ [themeName]: theme });\n\tupdateThemeConfig(themeName, themeProxied);\n\tupdateThemeStates();\n\treturn response;\n}\nfunction updateThemeConfig(themeName, theme) {\n\tconst config = getConfig();\n\tconfig.themes[themeName] = theme;\n\tupdateConfig(\"themes\", config.themes);\n}\nfunction updateThemeStates() {\n\tforceUpdateThemes();\n}\nfunction insertThemeCSS(themes, batch = false) {\n\tconst config = getConfig();\n\tlet cssRules = [];\n\tfor (const themeName in themes) {\n\t\tconst theme = themes[themeName];\n\t\tconst rules = getThemeCSSRules({\n\t\t\tconfig,\n\t\t\tthemeName,\n\t\t\tnames: [themeName],\n\t\t\thasDarkLight: true,\n\t\t\ttheme,\n\t\t\tuseMutatedVariables: true\n\t\t});\n\t\tcssRules = [...cssRules, ...rules];\n\t\tif (!batch) updateStyle(`t_theme_style_${themeName}`, rules);\n\t}\n\tif (mutatedAutoVariables.length > 0) updateStyle(`t_mutate_vars`, [`:root{${mutatedAutoVariables.map((v) => `--${v.name}:${v.val}`).join(\";\")}}`]);\n\tif (batch) updateStyle(`t_theme_style_${typeof batch == \"string\" ? batch : simpleHash(Object.keys(themes).join(\"\"))}`, cssRules);\n\treturn cssRules;\n}\nfunction updateStyle(id, rules) {\n\tconst existing = document.querySelector(`#${id}`);\n\tconst style = document.createElement(\"style\");\n\tstyle.id = id;\n\tstyle.appendChild(document.createTextNode(rules.join(\"\\n\")));\n\tdocument.head.appendChild(style);\n\tif (existing) existing.parentElement?.removeChild(existing);\n}\n\nexport { _mutateTheme, mutateThemes };"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,mBAAmB,EAAEC,iBAAiB,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,oBAAoB,EAAEC,mBAAmB,EAAEC,UAAU,EAAEC,YAAY,QAAQ,cAAc;AAEvK,SAASC,YAAYA,CAAC;EAAEC,MA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;EAChI,OAAOA,QAAQ;AAChB;AACA,SAASsB,WAAWA,CAACQ,EAAE,EAAEZ,KAAK,EAAE;EAC/B,MAAMa,QAAQ,GAAGC,QAAQ,CAACC,aAAa,CAAC,IAAIH,EAAE,EAAE,CAAC;EACjD,MAAMI,KAAK,GAAGF,QAAQ,CAACG,aAAa,CAAC,OAAO,CAAC;EAC7CD,KAAK,CAACJ,EAAE,GAAGA,EAAE;EACbI,KAAK,CAACE,WAAW,CAACJ,QAAQ,CAACK,cAAc,CAACnB,KAAK,CAACS,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;EAC5DK,QAAQ,CAACM,IAAI,CAACF,WAAW,CAACF,KAAK,CAAC;EAChC,IAAIH,QAAQ,EAAEA,QAAQ,CAACQ,aAAa,EAAEC,WAAW,CAACT,QAAQ,CAAC;AAC5D;AAEA,SAASnC,YAAY,EAAEV,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"_mutateTheme.js","names":[],"sources":["esm/_mutateTheme.js"],"sourcesContent":["import { isServer } from \"@tamagui/constants\";\nimport { startTransition } from \"@tamagui/start-transition\";\nimport { ensureThemeVariable, forceUpdateThemes, getConfig, getMutatedAutoVariableCSS, getThemeCSSRules, proxyThemeToParents, simpleHash, updateConfig } from \"@tamagui/web\";\n\nfunction mutateThemes({ themes, batch, insertCSS = true, ...props }) {\n\tconst allThemesProxied = {};\n\tconst allThemesRaw = {};\n\tfor (const { name, theme } of themes) {\n\t\tconst res = _mutateTheme({\n\t\t\t...props,\n\t\t\tname,\n\t\t\ttheme,\n\t\t\tavoidUpdate: true,\n\t\t\tmutationType: \"add\"\n\t\t});\n\t\tif (res) {\n\t\t\tallThemesProxied[name] = res.theme;\n\t\t\tallThemesRaw[name] = res.themeRaw;\n\t\t}\n\t}\n\tconst cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];\n\tstartTransition(() => {\n\t\tfor (const themeName in allThemesProxied) {\n\t\t\tconst theme = allThemesProxied[themeName];\n\t\t\tupdateThemeConfig(themeName, theme);\n\t\t}\n\t\tupdateThemeStates();\n\t});\n\treturn {\n\t\tthemes: allThemesProxied,\n\t\tthemesRaw: allThemesRaw,\n\t\tcssRules\n\t};\n}\nfunction _mutateTheme(props) {\n\tif (isServer) {\n\t\tif (process.env.NODE_ENV === \"development\") console.warn(\"Theme mutation is not supported on server side\");\n\t\treturn;\n\t}\n\tconst config = getConfig();\n\tconst { name: themeName, theme: themeIn, insertCSS, mutationType } = props;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!config) throw new Error(\"No config\");\n\t\tconst theme2 = config.themes[props.name];\n\t\tif (mutationType !== \"add\" && !theme2) throw new Error(`${mutationType === \"replace\" ? \"Replace\" : \"Update\"} theme failed! Theme ${props.name} does not exist`);\n\t}\n\tconst theme = {\n\t\t...mutationType === \"update\" ? config.themes[themeName] ?? {} : {},\n\t\t...themeIn\n\t};\n\tfor (const key in theme) ensureThemeVariable(theme, key);\n\tconst themeProxied = proxyThemeToParents(themeName, theme);\n\tconst response = {\n\t\tthemeRaw: theme,\n\t\ttheme: themeProxied,\n\t\tcssRules: []\n\t};\n\tif (props.avoidUpdate) return response;\n\tif (insertCSS) response.cssRules = insertThemeCSS({ [themeName]: theme });\n\tupdateThemeConfig(themeName, themeProxied);\n\tupdateThemeStates();\n\treturn response;\n}\nfunction updateThemeConfig(themeName, theme) {\n\tconst config = getConfig();\n\tconfig.themes[themeName] = theme;\n\tupdateConfig(\"themes\", config.themes);\n}\nfunction updateThemeStates() {\n\tforceUpdateThemes();\n}\nfunction insertThemeCSS(themes, batch = false) {\n\tconst config = getConfig();\n\tlet cssRules = [];\n\tfor (const themeName in themes) {\n\t\tconst theme = themes[themeName];\n\t\tconst rules = getThemeCSSRules({\n\t\t\tconfig,\n\t\t\tthemeName,\n\t\t\tnames: [themeName],\n\t\t\thasDarkLight: true,\n\t\t\ttheme,\n\t\t\tuseMutatedVariables: true\n\t\t});\n\t\tcssRules = [...cssRules, ...rules];\n\t\tif (!batch) updateStyle(`t_theme_style_${themeName}`, rules);\n\t}\n\tconst mutatedAutoVariableCSS = getMutatedAutoVariableCSS();\n\tif (mutatedAutoVariableCSS) updateStyle(`t_mutate_vars`, [`:root{${mutatedAutoVariableCSS}}`]);\n\tif (batch) updateStyle(`t_theme_style_${typeof batch == \"string\" ? batch : simpleHash(Object.keys(themes).join(\"\"))}`, cssRules);\n\treturn cssRules;\n}\nfunction updateStyle(id, rules) {\n\tconst existing = document.querySelector(`#${id}`);\n\tconst style = document.createElement(\"style\");\n\tstyle.id = id;\n\tstyle.appendChild(document.createTextNode(rules.join(\"\\n\")));\n\tdocument.head.appendChild(style);\n\tif (existing) existing.parentElement?.removeChild(existing);\n}\n\nexport { _mutateTheme, mutateThemes };"],"mappings":";;;;;AAIA,SAAS,aAAa,EAAE,QAAQ,OAAO,YAAY,MAAM,GAAG,SAAS;CACpE,MAAM,mBAAmB,CAAC;CAC1B,MAAM,eAAe,CAAC;CACtB,KAAK,MAAM,EAAE,MAAM,WAAW,QAAQ;EACrC,MAAM,MAAM,aAAa;GACxB,GAAG;GACH;GACA;GACA,aAAa;GACb,cAAc;EACf,CAAC;EACD,IAAI,KAAK;GACR,iBAAiB,QAAQ,IAAI;GAC7B,aAAa,QAAQ,IAAI;EAC1B;CACD;CACA,MAAM,WAAW,YAAY,eAAe,cAAc,KAAK,IAAI,CAAC;CACpE,sBAAsB;EACrB,KAAK,MAAM,aAAa,kBAAkB;GACzC,MAAM,QAAQ,iBAAiB;GAC/B,kBAAkB,WAAW,KAAK;EACnC;EACA,kBAAkB;CACnB,CAAC;CACD,OAAO;EACN,QAAQ;EACR,WAAW;EACX;CACD;AACD;AACA,SAAS,aAAa,OAAO;CAC5B,IAAI,UAAU;EACb,IAAI,QAAQ,IAAI,aAAa,eAAe,QAAQ,KAAK,gDAAgD;EACzG;CACD;CACA,MAAM,SAAS,UAAU;CACzB,MAAM,EAAE,MAAM,WAAW,OAAO,SAAS,WAAW,iBAAiB;CACrE,IAAI,QAAQ,I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7F,IAAI,OAAO,YAAY,iBAAiB,OAAO,SAAS,WAAW,QAAQ,WAAW,OAAO,KAAK,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,QAAQ;CAC/H,OAAO;AACR;AACA,SAAS,YAAY,IAAI,OAAO;CAC/B,MAAM,WAAW,SAAS,cAAc,IAAI,IAAI;CAChD,MAAM,QAAQ,SAAS,cAAc,OAAO;CAC5C,MAAM,KAAK;CACX,MAAM,YAAY,SAAS,eAAe,MAAM,KAAK,IAAI,CAAC,CAAC;CAC3D,SAAS,KAAK,YAAY,KAAK;CAC/B,IAAI,UAAU,SAAS,eAAe,YAAY,QAAQ;AAC3D"}
@@ -1,108 +1,93 @@
1
1
  import { isServer } from "@tamagui/constants";
2
2
  import { startTransition } from "@tamagui/start-transition";
3
3
  import { ensureThemeVariable, forceUpdateThemes, getConfig, proxyThemeToParents, updateConfig } from "@tamagui/web";
4
+
4
5
  function mutateThemes(param) {
5
- var {
6
- themes,
7
- batch,
8
- insertCSS = true,
9
- ...props
10
- } = param;
11
- var allThemesProxied = {};
12
- var allThemesRaw = {};
13
- var _iteratorNormalCompletion = true,
14
- _didIteratorError = false,
15
- _iteratorError = void 0;
16
- try {
17
- for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
18
- var {
19
- name,
20
- theme
21
- } = _step.value;
22
- var res = _mutateTheme({
23
- ...props,
24
- name,
25
- theme,
26
- avoidUpdate: true,
27
- mutationType: "add"
28
- });
29
- if (res) {
30
- allThemesProxied[name] = res.theme;
31
- allThemesRaw[name] = res.themeRaw;
32
- }
33
- }
34
- } catch (err) {
35
- _didIteratorError = true;
36
- _iteratorError = err;
37
- } finally {
38
- try {
39
- if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
40
- } finally {
41
- if (_didIteratorError) throw _iteratorError;
42
- }
43
- }
44
- var cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
45
- startTransition(function () {
46
- for (var themeName in allThemesProxied) {
47
- var theme2 = allThemesProxied[themeName];
48
- updateThemeConfig(themeName, theme2);
49
- }
50
- updateThemeStates();
51
- });
52
- return {
53
- themes: allThemesProxied,
54
- themesRaw: allThemesRaw,
55
- cssRules
56
- };
6
+ var { themes, batch, insertCSS = true, ...props } = param;
7
+ var allThemesProxied = {};
8
+ var allThemesRaw = {};
9
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
10
+ try {
11
+ for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
12
+ var { name, theme } = _step.value;
13
+ var res = _mutateTheme({
14
+ ...props,
15
+ name,
16
+ theme,
17
+ avoidUpdate: true,
18
+ mutationType: "add"
19
+ });
20
+ if (res) {
21
+ allThemesProxied[name] = res.theme;
22
+ allThemesRaw[name] = res.themeRaw;
23
+ }
24
+ }
25
+ } catch (err) {
26
+ _didIteratorError = true;
27
+ _iteratorError = err;
28
+ } finally {
29
+ try {
30
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
31
+ } finally {
32
+ if (_didIteratorError) throw _iteratorError;
33
+ }
34
+ }
35
+ var cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
36
+ startTransition(function() {
37
+ for (var themeName in allThemesProxied) {
38
+ var theme2 = allThemesProxied[themeName];
39
+ updateThemeConfig(themeName, theme2);
40
+ }
41
+ updateThemeStates();
42
+ });
43
+ return {
44
+ themes: allThemesProxied,
45
+ themesRaw: allThemesRaw,
46
+ cssRules
47
+ };
57
48
  }
58
49
  function _mutateTheme(props) {
59
- if (isServer) {
60
- if (process.env.NODE_ENV === "development") console.warn("Theme mutation is not supported on server side");
61
- return;
62
- }
63
- var config = getConfig();
64
- var {
65
- name: themeName,
66
- theme: themeIn,
67
- insertCSS,
68
- mutationType
69
- } = props;
70
- if (process.env.NODE_ENV === "development") {
71
- if (!config) throw new Error("No config");
72
- var theme = config.themes[props.name];
73
- if (mutationType !== "add" && !theme) throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
74
- }
75
- var _config_themes_themeName;
76
- var theme1 = {
77
- ...(mutationType === "update" ? (_config_themes_themeName = config.themes[themeName]) !== null && _config_themes_themeName !== void 0 ? _config_themes_themeName : {} : {}),
78
- ...themeIn
79
- };
80
- for (var key in theme1) ensureThemeVariable(theme1, key);
81
- var themeProxied = proxyThemeToParents(themeName, theme1);
82
- var response = {
83
- themeRaw: theme1,
84
- theme: themeProxied,
85
- cssRules: []
86
- };
87
- if (props.avoidUpdate) return response;
88
- if (insertCSS) response.cssRules = insertThemeCSS({
89
- [themeName]: theme1
90
- });
91
- updateThemeConfig(themeName, themeProxied);
92
- updateThemeStates();
93
- return response;
50
+ if (isServer) {
51
+ if (process.env.NODE_ENV === "development") console.warn("Theme mutation is not supported on server side");
52
+ return;
53
+ }
54
+ var config = getConfig();
55
+ var { name: themeName, theme: themeIn, insertCSS, mutationType } = props;
56
+ if (process.env.NODE_ENV === "development") {
57
+ if (!config) throw new Error("No config");
58
+ var theme = config.themes[props.name];
59
+ if (mutationType !== "add" && !theme) throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
60
+ }
61
+ var _config_themes_themeName;
62
+ var theme1 = {
63
+ ...mutationType === "update" ? (_config_themes_themeName = config.themes[themeName]) !== null && _config_themes_themeName !== void 0 ? _config_themes_themeName : {} : {},
64
+ ...themeIn
65
+ };
66
+ for (var key in theme1) ensureThemeVariable(theme1, key);
67
+ var themeProxied = proxyThemeToParents(themeName, theme1);
68
+ var response = {
69
+ themeRaw: theme1,
70
+ theme: themeProxied,
71
+ cssRules: []
72
+ };
73
+ if (props.avoidUpdate) return response;
74
+ if (insertCSS) response.cssRules = insertThemeCSS({ [themeName]: theme1 });
75
+ updateThemeConfig(themeName, themeProxied);
76
+ updateThemeStates();
77
+ return response;
94
78
  }
95
79
  function updateThemeConfig(themeName, theme) {
96
- var config = getConfig();
97
- config.themes[themeName] = theme;
98
- updateConfig("themes", config.themes);
80
+ var config = getConfig();
81
+ config.themes[themeName] = theme;
82
+ updateConfig("themes", config.themes);
99
83
  }
100
84
  function updateThemeStates() {
101
- forceUpdateThemes();
85
+ forceUpdateThemes();
102
86
  }
103
87
  function insertThemeCSS(themes) {
104
- arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
105
- return [];
88
+ arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
89
+ return [];
106
90
  }
91
+
107
92
  export { _mutateTheme, mutateThemes };
108
93
  //# sourceMappingURL=_mutateTheme.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isServer","startTransition","ensureThemeVariable","forceUpdateThemes","getConfig","proxyThemeToParents","updateConfig","mutateThemes","param","themes","batch","insertCSS","props","allThemesProxied","allThemesRaw","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","name","theme","value","res","_mutateTheme","avoidUpdate","mutationType","themeRaw","err","return","cssRules","insertThemeCSS","themeName","theme2","updateThemeConfig","updateThemeStates","themesRaw","process","env","NODE_ENV","console","warn","config","themeIn","Error","_config_themes_themeName","theme1","key","themeProxied","response","arguments","length"],"sources":["_mutateTheme.native.js"],"sourcesContent":["import { isServer } from \"@tamagui/constants\";\nimport { startTransition } from \"@tamagui/start-transition\";\nimport { ensureThemeVariable, forceUpdateThemes, getConfig, proxyThemeToParents, updateConfig } from \"@tamagui/web\";\n\nfunction mutateThemes(param) {\n\tvar { themes, batch, insertCSS = true, ...props } = param;\n\tvar allThemesProxied = {};\n\tvar allThemesRaw = {};\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar { name, theme } = _step.value;\n\t\t\tvar res = _mutateTheme({\n\t\t\t\t...props,\n\t\t\t\tname,\n\t\t\t\ttheme,\n\t\t\t\tavoidUpdate: true,\n\t\t\t\tmutationType: \"add\"\n\t\t\t});\n\t\t\tif (res) {\n\t\t\t\tallThemesProxied[name] = res.theme;\n\t\t\t\tallThemesRaw[name] = res.themeRaw;\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\tvar cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];\n\tstartTransition(function() {\n\t\tfor (var themeName in allThemesProxied) {\n\t\t\tvar theme2 = allThemesProxied[themeName];\n\t\t\tupdateThemeConfig(themeName, theme2);\n\t\t}\n\t\tupdateThemeStates();\n\t});\n\treturn {\n\t\tthemes: allThemesProxied,\n\t\tthemesRaw: allThemesRaw,\n\t\tcssRules\n\t};\n}\nfunction _mutateTheme(props) {\n\tif (isServer) {\n\t\tif (process.env.NODE_ENV === \"development\") console.warn(\"Theme mutation is not supported on server side\");\n\t\treturn;\n\t}\n\tvar config = getConfig();\n\tvar { name: themeName, theme: themeIn, insertCSS, mutationType } = props;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!config) throw new Error(\"No config\");\n\t\tvar theme = config.themes[props.name];\n\t\tif (mutationType !== \"add\" && !theme) throw new Error(`${mutationType === \"replace\" ? \"Replace\" : \"Update\"} theme failed! Theme ${props.name} does not exist`);\n\t}\n\tvar _config_themes_themeName;\n\tvar theme1 = {\n\t\t...mutationType === \"update\" ? (_config_themes_themeName = config.themes[themeName]) !== null && _config_themes_themeName !== void 0 ? _config_themes_themeName : {} : {},\n\t\t...themeIn\n\t};\n\tfor (var key in theme1) ensureThemeVariable(theme1, key);\n\tvar themeProxied = proxyThemeToParents(themeName, theme1);\n\tvar response = {\n\t\tthemeRaw: theme1,\n\t\ttheme: themeProxied,\n\t\tcssRules: []\n\t};\n\tif (props.avoidUpdate) return response;\n\tif (insertCSS) response.cssRules = insertThemeCSS({ [themeName]: theme1 });\n\tupdateThemeConfig(themeName, themeProxied);\n\tupdateThemeStates();\n\treturn response;\n}\nfunction updateThemeConfig(themeName, theme) {\n\tvar config = getConfig();\n\tconfig.themes[themeName] = theme;\n\tupdateConfig(\"themes\", config.themes);\n}\nfunction updateThemeStates() {\n\tforceUpdateThemes();\n}\nfunction insertThemeCSS(themes) {\n\targuments.length > 1 && arguments[1] !== void 0 && arguments[1];\n\treturn [];\n}\n\nexport { _mutateTheme, mutateThemes };"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,mBAAmB,EAAEC,iBAAiB,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,YAAY,QAAQ,cAAc;AAEnH,SAASC,YAAYA,CAACC,KAAK,EAAE;EAC5B,IAAI;IAAEC,MAAM;IAAEC,KAAK;IAAEC,SAAS,GAAG,IAAI;IAAE,GAAGC;EAAM,CAAC,GAAGJ,KAAK;EACzD,IAAIK,gBAAgB,GAAG,CAAC,CAAC;EACzB,IAAIC,YAAY,GAAG,CAAC,CAAC;EACrB,IAAIC,yBAAyB,GAAG,IAAI;IAAEC,iBAAiB,GAAG,KAAK;IAAEC,cAAc,GAAG,KAAK,CAAC;EACxF,IAAI;IACH,KAAK,IAAIC,SAAS,GAAGT,MAAM,CAACU,MAAM,CAACC,QAAQ,CAAC,CAAC,CAAC,EAAEC,KAAK,EAAE,EAAEN,yBAAyB,GAAG,CAACM,KAAK,GAAGH,SAAS,CAACI,IAAI,CAAC,CAAC,EAAEC,IAAI,CAAC,EAAER,yBAAyB,GAAG,IAAI,EAAE;MACxJ,IAAI;QAAES,IAAI;QAAEC;MAAM,CAAC,GAAGJ,KAAK,CAACK,KAAK;MACjC,IAAIC,GAAG,GAAGC,YAAY,CAAC;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Cb,iBAAiB,CAAC,CAAC;EACnB,OAAOc,QAAQ;AAChB;AACA,SAASf,iBAAiBA,CAACF,SAAS,EAAEX,KAAK,EAAE;EAC5C,IAAIqB,MAAM,GAAG1C,SAAS,CAAC,CAAC;EACxB0C,MAAM,CAACrC,MAAM,CAAC2B,SAAS,CAAC,GAAGX,KAAK;EAChCnB,YAAY,CAAC,QAAQ,EAAEwC,MAAM,CAACrC,MAAM,CAAC;AACtC;AACA,SAAS8B,iBAAiBA,CAAA,EAAG;EAC5BpC,iBAAiB,CAAC,CAAC;AACpB;AACA,SAASgC,cAAcA,CAAC1B,MAAM,EAAE;EAC/B6C,SAAS,CAACC,MAAM,GAAG,CAAC,IAAID,SAAS,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,IAAIA,SAAS,CAAC,CAAC,CAAC;EAC/D,OAAO,EAAE;AACV;AAEA,SAAS1B,YAAY,EAAErB,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"_mutateTheme.native.js","names":[],"sources":["esm/_mutateTheme.native.js"],"sourcesContent":["import { isServer } from \"@tamagui/constants\";\nimport { startTransition } from \"@tamagui/start-transition\";\nimport { ensureThemeVariable, forceUpdateThemes, getConfig, proxyThemeToParents, updateConfig } from \"@tamagui/web\";\n\nfunction mutateThemes(param) {\n\tvar { themes, batch, insertCSS = true, ...props } = param;\n\tvar allThemesProxied = {};\n\tvar allThemesRaw = {};\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar { name, theme } = _step.value;\n\t\t\tvar res = _mutateTheme({\n\t\t\t\t...props,\n\t\t\t\tname,\n\t\t\t\ttheme,\n\t\t\t\tavoidUpdate: true,\n\t\t\t\tmutationType: \"add\"\n\t\t\t});\n\t\t\tif (res) {\n\t\t\t\tallThemesProxied[name] = res.theme;\n\t\t\t\tallThemesRaw[name] = res.themeRaw;\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\tvar cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];\n\tstartTransition(function() {\n\t\tfor (var themeName in allThemesProxied) {\n\t\t\tvar theme2 = allThemesProxied[themeName];\n\t\t\tupdateThemeConfig(themeName, theme2);\n\t\t}\n\t\tupdateThemeStates();\n\t});\n\treturn {\n\t\tthemes: allThemesProxied,\n\t\tthemesRaw: allThemesRaw,\n\t\tcssRules\n\t};\n}\nfunction _mutateTheme(props) {\n\tif (isServer) {\n\t\tif (process.env.NODE_ENV === \"development\") console.warn(\"Theme mutation is not supported on server side\");\n\t\treturn;\n\t}\n\tvar config = getConfig();\n\tvar { name: themeName, theme: themeIn, insertCSS, mutationType } = props;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!config) throw new Error(\"No config\");\n\t\tvar theme = config.themes[props.name];\n\t\tif (mutationType !== \"add\" && !theme) throw new Error(`${mutationType === \"replace\" ? \"Replace\" : \"Update\"} theme failed! Theme ${props.name} does not exist`);\n\t}\n\tvar _config_themes_themeName;\n\tvar theme1 = {\n\t\t...mutationType === \"update\" ? (_config_themes_themeName = config.themes[themeName]) !== null && _config_themes_themeName !== void 0 ? _config_themes_themeName : {} : {},\n\t\t...themeIn\n\t};\n\tfor (var key in theme1) ensureThemeVariable(theme1, key);\n\tvar themeProxied = proxyThemeToParents(themeName, theme1);\n\tvar response = {\n\t\tthemeRaw: theme1,\n\t\ttheme: themeProxied,\n\t\tcssRules: []\n\t};\n\tif (props.avoidUpdate) return response;\n\tif (insertCSS) response.cssRules = insertThemeCSS({ [themeName]: theme1 });\n\tupdateThemeConfig(themeName, themeProxied);\n\tupdateThemeStates();\n\treturn response;\n}\nfunction updateThemeConfig(themeName, theme) {\n\tvar config = getConfig();\n\tconfig.themes[themeName] = theme;\n\tupdateConfig(\"themes\", config.themes);\n}\nfunction updateThemeStates() {\n\tforceUpdateThemes();\n}\nfunction insertThemeCSS(themes) {\n\targuments.length > 1 && arguments[1] !== void 0 && arguments[1];\n\treturn [];\n}\n\nexport { _mutateTheme, mutateThemes };"],"mappings":";;;;;AAIA,SAAS,aAAa,OAAO;CAC5B,IAAI,EAAE,QAAQ,OAAO,YAAY,MAAM,GAAG,UAAU;CACpD,IAAI,mBAAmB,CAAC;CACxB,IAAI,eAAe,CAAC;CACpB,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACH,KAAK,IAAI,YAAY,OAAO,OAAO,UAAU,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,GAAG,OAAO,4BAA4B,MAAM;GACxJ,IAAI,EAAE,MAAM,UAAU,MAAM;GAC5B,IAAI,MAAM,aAAa;IACtB,GAAG;IACH;IACA;IACA,aAAa;IACb,cAAc;GACf,CAAC;GACD,IAAI,KAAK;IACR,iBAAiB,QAAQ,IAAI;IAC7B,aAAa,QAAQ,IAAI;GAC1B;EACD;CACD,SAAS,KAAK;EACb,oBAAoB;EACpB,iBAAiB;CAClB,UAAU;EACT,IAAI;GACH,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM,UAAU,OAAO;EAC9E,UAAU;GACT,IAAI,mBAAmB,MAAM;EAC9B;CACD;CACA,IAAI,WAAW,YAAY,eAAe,cAAc,KAAK,IAAI,CAAC;CAClE,gBAAgB,WAAW;EAC1B,KAAK,IAAI,aAAa,kBAAkB;GACvC,IAAI,SAAS,iBAAiB;GAC9B,kBAAkB,WAAW,MAAM;EACpC;EACA,kBAAkB;CACnB,CAAC;CACD,OAAO;EACN,QAAQ;EACR,WAAW;EACX;CACD;AACD;AACA,SAAS,aAAa,OAAO;CAC5B,IAAI,UAAU;E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S: true,
6
- mutationType: "add"
7
- });
4
+ return _mutateTheme({
5
+ ...props,
6
+ insertCSS: true,
7
+ mutationType: "add"
8
+ });
8
9
  }
10
+
9
11
  export { addTheme };
10
12
  //# sourceMappingURL=addTheme.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["_mutateTheme","addTheme","props","insertCSS","mutationType"],"sources":["../../src/addTheme.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,YAAA,QAAoB;AAEtB,SAASC,SAASC,KAAA,EAItB;EACD,OAAOF,YAAA,CAAa;IAAE,GAAGE,KAAA;IAAOC,SAAA,EAAW;IAAMC,YAAA,EAAc;EAAM,CAAC;AACxE","ignoreList":[]}
1
+ {"version":3,"file":"addTheme.js","names":[],"sources":["esm/addTheme.js"],"sourcesContent":["import { _mutateTheme } from \"./_mutateTheme\";\nfunction addTheme(props) {\n return _mutateTheme({ ...props, insertCSS: true, mutationType: \"add\" });\n}\nexport {\n addTheme\n};\n//# sourceMappingURL=addTheme.js.map\n"],"mappings":";;;AACA,SAAS,SAAS,OAAO;CACvB,OAAO,aAAa;EAAE,GAAG;EAAO,WAAW;EAAM,cAAc;CAAM,CAAC;AACxE"}
@@ -1,10 +1,12 @@
1
1
  import { _mutateTheme } from "./_mutateTheme.native.js";
2
+
2
3
  function addTheme(props) {
3
- return _mutateTheme({
4
- ...props,
5
- insertCSS: true,
6
- mutationType: "add"
7
- });
4
+ return _mutateTheme({
5
+ ...props,
6
+ insertCSS: true,
7
+ mutationType: "add"
8
+ });
8
9
  }
10
+
9
11
  export { addTheme };
10
12
  //# sourceMappingURL=addTheme.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_mutateTheme","addTheme","props"],"sources":["../../src/addTheme.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,YAAA,QAAoB;AAEtB,SAASC,SAASC,KAAA,EAItB;EACD,OAAOF,YAAA,CAAa;IACtB,GAAAE,KAAA","ignoreList":[]}
1
+ {"version":3,"file":"addTheme.native.js","names":[],"sources":["esm/addTheme.native.js"],"sourcesContent":["import { _mutateTheme } from \"./_mutateTheme\";\nfunction addTheme(props) {\n return _mutateTheme({\n ...props,\n insertCSS: true,\n mutationType: \"add\"\n });\n}\nexport {\n addTheme\n};\n//# sourceMappingURL=addTheme.js.map\n"],"mappings":";;;AACA,SAAS,SAAS,OAAO;CACvB,OAAO,aAAa;EAClB,GAAG;EACH,WAAW;EACX,cAAc;CAChB,CAAC;AACH"}