@tamagui/theme 2.0.0-rc.4 → 2.0.0-rc.40

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 (48) hide show
  1. package/dist/cjs/_mutateTheme.cjs +68 -63
  2. package/dist/cjs/_mutateTheme.native.js +73 -94
  3. package/dist/cjs/_mutateTheme.native.js.map +1 -1
  4. package/dist/cjs/addTheme.cjs +13 -11
  5. package/dist/cjs/addTheme.native.js +13 -11
  6. package/dist/cjs/addTheme.native.js.map +1 -1
  7. package/dist/cjs/index.cjs +13 -11
  8. package/dist/cjs/index.native.js +13 -11
  9. package/dist/cjs/index.native.js.map +1 -1
  10. package/dist/cjs/replaceTheme.cjs +15 -12
  11. package/dist/cjs/replaceTheme.native.js +21 -19
  12. package/dist/cjs/replaceTheme.native.js.map +1 -1
  13. package/dist/cjs/updateTheme.cjs +13 -11
  14. package/dist/cjs/updateTheme.native.js +13 -11
  15. package/dist/cjs/updateTheme.native.js.map +1 -1
  16. package/dist/esm/_mutateTheme.mjs +53 -50
  17. package/dist/esm/_mutateTheme.mjs.map +1 -1
  18. package/dist/esm/_mutateTheme.native.js +58 -81
  19. package/dist/esm/_mutateTheme.native.js.map +1 -1
  20. package/dist/esm/addTheme.mjs +1 -1
  21. package/dist/esm/addTheme.native.js +1 -1
  22. package/dist/esm/index.js +5 -7
  23. package/dist/esm/index.js.map +1 -6
  24. package/dist/esm/replaceTheme.mjs +3 -2
  25. package/dist/esm/replaceTheme.mjs.map +1 -1
  26. package/dist/esm/replaceTheme.native.js +9 -9
  27. package/dist/esm/replaceTheme.native.js.map +1 -1
  28. package/dist/esm/updateTheme.mjs +1 -1
  29. package/dist/esm/updateTheme.native.js +1 -1
  30. package/package.json +8 -11
  31. package/dist/cjs/_mutateTheme.js +0 -121
  32. package/dist/cjs/_mutateTheme.js.map +0 -6
  33. package/dist/cjs/addTheme.js +0 -24
  34. package/dist/cjs/addTheme.js.map +0 -6
  35. package/dist/cjs/index.js +0 -24
  36. package/dist/cjs/index.js.map +0 -6
  37. package/dist/cjs/replaceTheme.js +0 -27
  38. package/dist/cjs/replaceTheme.js.map +0 -6
  39. package/dist/cjs/updateTheme.js +0 -27
  40. package/dist/cjs/updateTheme.js.map +0 -6
  41. package/dist/esm/_mutateTheme.js +0 -116
  42. package/dist/esm/_mutateTheme.js.map +0 -6
  43. package/dist/esm/addTheme.js +0 -8
  44. package/dist/esm/addTheme.js.map +0 -6
  45. package/dist/esm/replaceTheme.js +0 -11
  46. package/dist/esm/replaceTheme.js.map +0 -6
  47. package/dist/esm/updateTheme.js +0 -11
  48. package/dist/esm/updateTheme.js.map +0 -6
@@ -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 replaceTheme_exports = {};
22
24
  __export(replaceTheme_exports, {
@@ -28,10 +30,11 @@ function replaceTheme({
28
30
  name,
29
31
  theme
30
32
  }) {
31
- return (0, import_mutateTheme._mutateTheme)({
33
+ const next = (0, import_mutateTheme._mutateTheme)({
32
34
  name,
33
35
  theme,
34
- insertCSS: !0,
36
+ insertCSS: true,
35
37
  mutationType: "replace"
36
38
  });
39
+ return next;
37
40
  }
@@ -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 replaceTheme_exports = {};
24
26
  __export(replaceTheme_exports, {
@@ -28,15 +30,15 @@ module.exports = __toCommonJS(replaceTheme_exports);
28
30
  var import_mutateTheme = require("./_mutateTheme.native.js");
29
31
  function replaceTheme(param) {
30
32
  var {
31
- name,
32
- theme
33
- } = param,
34
- next = (0, import_mutateTheme._mutateTheme)({
35
- name,
36
- theme,
37
- insertCSS: !0,
38
- mutationType: "replace"
39
- });
33
+ name,
34
+ theme
35
+ } = param;
36
+ var next = (0, import_mutateTheme._mutateTheme)({
37
+ name,
38
+ theme,
39
+ insertCSS: true,
40
+ mutationType: "replace"
41
+ });
40
42
  return next;
41
43
  }
42
44
  //# sourceMappingURL=replaceTheme.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","replaceTheme_exports","__export","replaceTheme","module","exports","import_mutateTheme","require","param","name","theme","next","_mutateTheme","insertCSS"],"sources":["../../src/replaceTheme.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAA;AAAA;AAEAC,MAAA,CAAAC,OAAA,GAAAT,YAA6B,CAAAK,oBAAA;AAEtB,IAAAK,kBAAsB,GAAAC,OAAA;AAAA,SAC3BJ,aAAAK,KAAA;EACA;MAAAC,IAAA;MAAAC;IAAA,IAAAF,KAAA;IAAAG,IAAA,OAAAL,kBAAA,CAAAM,YAAA;MAICH,IAAA;MAEDC,KAAA;MACFG,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","replaceTheme_exports","__export","replaceTheme","module","exports","import_mutateTheme","require","param","name","theme","next","_mutateTheme","insertCSS"],"sources":["../../src/replaceTheme.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAA;AAAA;AAEAC,MAAA,CAAAC,OAAA,GAAAT,YAA6B,CAAAK,oBAAA;AAEtB,IAAAK,kBAAsB,GAAAC,OAAA;AAAA,SAC3BJ,aAAAK,KAAA;EACA;IAAAC,IAAA;IAAAC;EAAA,IAAAF,KAAA;EACF,IAGGG,IAAA,OAAAL,kBAAA,CAAAM,YAAA;IACDH,IAAM;IACNC,KAAO;IACTG,SAAA","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 updateTheme_exports = {};
22
24
  __export(updateTheme_exports, {
@@ -31,7 +33,7 @@ function updateTheme({
31
33
  return (0, import_mutateTheme._mutateTheme)({
32
34
  name,
33
35
  theme,
34
- insertCSS: !0,
36
+ insertCSS: true,
35
37
  mutationType: "update"
36
38
  });
37
39
  }
@@ -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 updateTheme_exports = {};
24
26
  __export(updateTheme_exports, {
@@ -34,7 +36,7 @@ function updateTheme(param) {
34
36
  return (0, import_mutateTheme._mutateTheme)({
35
37
  name,
36
38
  theme,
37
- insertCSS: !0,
39
+ insertCSS: true,
38
40
  mutationType: "update"
39
41
  });
40
42
  }
@@ -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,"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":[]}
@@ -4,11 +4,11 @@ import { ensureThemeVariable, forceUpdateThemes, getConfig, getThemeCSSRules, mu
4
4
  function mutateThemes({
5
5
  themes,
6
6
  batch,
7
- insertCSS = !0,
7
+ insertCSS = true,
8
8
  ...props
9
9
  }) {
10
- const allThemesProxied = {},
11
- allThemesRaw = {};
10
+ const allThemesProxied = {};
11
+ const allThemesRaw = {};
12
12
  for (const {
13
13
  name,
14
14
  theme
@@ -17,21 +17,23 @@ function mutateThemes({
17
17
  ...props,
18
18
  name,
19
19
  theme,
20
- // we'll do one update at the end
21
- avoidUpdate: !0,
22
- // always add which also replaces but doesnt fail first time
20
+ avoidUpdate: true,
23
21
  mutationType: "add"
24
22
  });
25
- res && (allThemesProxied[name] = res.theme, allThemesRaw[name] = res.themeRaw);
23
+ if (res) {
24
+ allThemesProxied[name] = res.theme;
25
+ allThemesRaw[name] = res.themeRaw;
26
+ }
26
27
  }
27
28
  const cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
28
- return startTransition(() => {
29
+ startTransition(() => {
29
30
  for (const themeName in allThemesProxied) {
30
31
  const theme = allThemesProxied[themeName];
31
32
  updateThemeConfig(themeName, theme);
32
33
  }
33
34
  updateThemeStates();
34
- }), {
35
+ });
36
+ return {
35
37
  themes: allThemesProxied,
36
38
  themesRaw: allThemesRaw,
37
39
  cssRules
@@ -39,16 +41,16 @@ function mutateThemes({
39
41
  }
40
42
  function _mutateTheme(props) {
41
43
  if (isServer) {
42
- process.env.NODE_ENV === "development" && console.warn("Theme mutation is not supported on server side");
44
+ if (process.env.NODE_ENV === "development") console.warn("Theme mutation is not supported on server side");
43
45
  return;
44
46
  }
45
- const config = getConfig(),
46
- {
47
- name: themeName,
48
- theme: themeIn,
49
- insertCSS,
50
- mutationType
51
- } = props;
47
+ const config = getConfig();
48
+ const {
49
+ name: themeName,
50
+ theme: themeIn,
51
+ insertCSS,
52
+ mutationType
53
+ } = props;
52
54
  if (process.env.NODE_ENV === "development") {
53
55
  if (!config) throw new Error("No config");
54
56
  const theme2 = config.themes[props.name];
@@ -59,54 +61,55 @@ function _mutateTheme(props) {
59
61
  ...themeIn
60
62
  };
61
63
  for (const key in theme) ensureThemeVariable(theme, key);
62
- const themeProxied = proxyThemeToParents(themeName, theme),
63
- response = {
64
- themeRaw: theme,
65
- theme: themeProxied,
66
- cssRules: []
67
- };
68
- return props.avoidUpdate || (insertCSS && (response.cssRules = insertThemeCSS({
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({
69
72
  [themeName]: theme
70
- })), updateThemeConfig(themeName, themeProxied), updateThemeStates()), response;
73
+ });
74
+ updateThemeConfig(themeName, themeProxied);
75
+ updateThemeStates();
76
+ return response;
71
77
  }
72
78
  function updateThemeConfig(themeName, theme) {
73
79
  const config = getConfig();
74
- config.themes[themeName] = theme, updateConfig("themes", config.themes);
80
+ config.themes[themeName] = theme;
81
+ updateConfig("themes", config.themes);
75
82
  }
76
83
  function updateThemeStates() {
77
84
  forceUpdateThemes();
78
85
  }
79
- function insertThemeCSS(themes, batch = !1) {
86
+ function insertThemeCSS(themes, batch = false) {
80
87
  const config = getConfig();
81
88
  let cssRules = [];
82
89
  for (const themeName in themes) {
83
- const theme = themes[themeName],
84
- rules = getThemeCSSRules({
85
- config,
86
- themeName,
87
- names: [themeName],
88
- hasDarkLight: !0,
89
- theme,
90
- // Use mutated variable creator which starts from high index to avoid conflicts
91
- useMutatedVariables: !0
92
- });
93
- cssRules = [...cssRules, ...rules], batch || updateStyle(`t_theme_style_${themeName}`, rules);
94
- }
95
- if (mutatedAutoVariables.length > 0) {
96
- const autoVarCSS = `:root{${mutatedAutoVariables.map(v => `--${v.name}:${v.val}`).join(";")}}`;
97
- updateStyle("t_mutate_vars", [autoVarCSS]);
98
- }
99
- if (batch) {
100
- const id = typeof batch == "string" ? batch : simpleHash(Object.keys(themes).join(""));
101
- updateStyle(`t_theme_style_${id}`, cssRules);
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);
102
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);
103
104
  return cssRules;
104
105
  }
105
106
  function updateStyle(id, rules) {
106
- const existing = document.querySelector(`#${id}`),
107
- style = document.createElement("style");
108
- style.id = id, style.appendChild(document.createTextNode(rules.join(`
109
- `))), document.head.appendChild(style), existing && existing.parentElement?.removeChild(existing);
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);
110
113
  }
111
114
  export { _mutateTheme, mutateThemes };
112
115
  //# 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","autoVarCSS","map","v","val","join","id","Object","keys","existing","document","querySelector","style","createElement","appendChild","createTextNode","head","parentElement","removeChild"],"sources":["../../src/_mutateTheme.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AACzB,SAASC,eAAA,QAAuB;AAEhC,SACEC,mBAAA,EACAC,iBAAA,EACAC,SAAA,EACAC,gBAAA,EACAC,oBAAA,EACAC,mBAAA,EACAC,UAAA,EACAC,YAAA,QACK;AAmBA,SAASC,aAAa;EAC3BC,MAAA;EACAC,KAAA;EACAC,SAAA,GAAY;EACZ,GAAGC;AACL,GAKG;EACD,MAAMC,gBAAA,GAAgD,CAAC;IACjDC,YAAA,GAA4C,CAAC;EACnD,WAAW;IAAEC,IAAA;IAAMC;EAAM,KAAKP,MAAA,EAAQ;IACpC,MAAMQ,GAAA,GAAMC,YAAA,CAAa;MACvB,GAAGN,KAAA;MACHG,IAAA;MACAC,KAAA;MAAA;MAEAG,WAAA,EAAa;MAAA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K,GAE5B9B,KAAA,IACHkC,WAAA,CAAY,iBAAiBpB,SAAS,IAAIgB,KAAK;EAEnD;EAGA,IAAIpC,oBAAA,CAAqByC,MAAA,GAAS,GAAG;IACnC,MAAMC,UAAA,GAAa,SAAS1C,oBAAA,CAAqB2C,GAAA,CAAKC,CAAA,IAAM,KAAKA,CAAA,CAAEjC,IAAI,IAAIiC,CAAA,CAAEC,GAAG,EAAE,EAAEC,IAAA,CAAK,GAAG,CAAC;IAC7FN,WAAA,CAAY,iBAAiB,CAACE,UAAU,CAAC;EAC3C;EAEA,IAAIpC,KAAA,EAAO;IACT,MAAMyC,EAAA,GAAK,OAAOzC,KAAA,IAAS,WAAWA,KAAA,GAAQJ,UAAA,CAAW8C,MAAA,CAAOC,IAAA,CAAK5C,MAAM,EAAEyC,IAAA,CAAK,EAAE,CAAC;IACrFN,WAAA,CAAY,iBAAiBO,EAAE,IAAI7B,QAAQ;EAC7C;EAEA,OAAOA,QAAA;AACT;AAEA,SAASsB,YAAYO,EAAA,EAAYX,KAAA,EAAiB;EAChD,MAAMc,QAAA,GAAWC,QAAA,CAASC,aAAA,CAAc,IAAIL,EAAE,EAAE;IAC1CM,KAAA,GAAQF,QAAA,CAASG,aAAA,CAAc,OAAO;EAC5CD,KAAA,CAAMN,EAAA,GAAKA,EAAA,EACXM,KAAA,CAAME,WAAA,CAAYJ,QAAA,CAASK,cAAA,CAAepB,KAAA,CAAMU,IAAA,CAAK;AAAA,CAAI,CAAC,CAAC,GAC3DK,QAAA,CAASM,IAAA,CAAKF,WAAA,CAAYF,KAAK,GAC3BH,QAAA,IACFA,QAAA,CAASQ,aAAA,EAAeC,WAAA,CAAYT,QAAQ;AAEhD","ignoreList":[]}
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":["../../src/_mutateTheme.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AACzB,SAASC,eAAA,QAAuB;AAEhC,SAAAC,mBAAA,EAAAC,iBAAA,EAAAC,SAAA,EAAAC,gBAAA,EAAAC,oBAAA,EAAAC,mBAAA,EAAAC,UAAA,EAAAC,YAAA;AAAA,SACEC,aAAA;EAAAC,MAAA;EAAAC,KAAA;EAAAC,SAAA;EAAA,GAAAC;AAAA;EAAA,MACAC,gBAAA;EAAA,MACAC,YAAA;EAAA,KACA;IAAAC,IAAA;IAAAC;EAAA,KAAAP,MAAA;IACA,MAAAQ,GAAA,GAAAC,YAAA;MACA,GAAAN,KAAA;MACAG,IAAA;MACAC,KAAA;MAAAG,WACK;MAmBAC,YAAS;IACd;IACA,IAAAH,GAAA;MACAJ,gBAAY,CAAAE,IAAA,IAAAE,GAAA,CAAAD,KAAA;MACZF,YAAG,CAAAC,IAAA,IAAAE,GAAA,CAAAI,QAAA;IACL;EAME;EACA,MAAAC,QAAM,GAAAX,SAA6C,GAAAY,cAAA,CAAAT,YAAA,EAAAJ,KAAA;EACnDX,eAAa,OAAM;IACjB,WAAMyB,SAAM,IAAAX,gBAAa;MAAA,MACpBG,KAAA,GAAAH,gBAAA,CAAAW,SAAA;MAAAC,iBACH,CAAAD,SAAA,EAAAR,KAAA;IAAA;IACAU,iBAAA;EAAA;EAEa;IAAAjB,MAEb,EAAAI,gBAAc;IAAAc,SACf,EAAAb,YAAA;IACDQ;EACE;AACA;AAAyB,SAC3BJ,aAAAN,KAAA;EAAA,IACFd,QAAA;IAEA,IAAA8B,OAAM,CAA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AAnC,YAAA,EAAAV,YAAA","ignoreList":[]}
@@ -3,50 +3,53 @@ import { startTransition } from "@tamagui/start-transition";
3
3
  import { ensureThemeVariable, forceUpdateThemes, getConfig, getThemeCSSRules, mutatedAutoVariables, proxyThemeToParents, simpleHash, updateConfig } from "@tamagui/web";
4
4
  function mutateThemes(param) {
5
5
  var {
6
- themes,
7
- batch,
8
- insertCSS = !0,
9
- ...props
10
- } = param,
11
- allThemesProxied = {},
12
- allThemesRaw = {},
13
- _iteratorNormalCompletion = !0,
14
- _didIteratorError = !1,
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
15
  _iteratorError = void 0;
16
16
  try {
17
- for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
17
+ for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
18
18
  var {
19
- name,
20
- theme
21
- } = _step.value,
22
- res = _mutateTheme({
23
- ...props,
24
- name,
25
- theme,
26
- // we'll do one update at the end
27
- avoidUpdate: !0,
28
- // always add which also replaces but doesnt fail first time
29
- mutationType: "add"
30
- });
31
- res && (allThemesProxied[name] = res.theme, allThemesRaw[name] = res.themeRaw);
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
+ }
32
33
  }
33
34
  } catch (err) {
34
- _didIteratorError = !0, _iteratorError = err;
35
+ _didIteratorError = true;
36
+ _iteratorError = err;
35
37
  } finally {
36
38
  try {
37
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
39
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
38
40
  } finally {
39
41
  if (_didIteratorError) throw _iteratorError;
40
42
  }
41
43
  }
42
44
  var cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
43
- return startTransition(function () {
45
+ startTransition(function () {
44
46
  for (var themeName in allThemesProxied) {
45
47
  var theme2 = allThemesProxied[themeName];
46
48
  updateThemeConfig(themeName, theme2);
47
49
  }
48
50
  updateThemeStates();
49
- }), {
51
+ });
52
+ return {
50
53
  themes: allThemesProxied,
51
54
  themesRaw: allThemesRaw,
52
55
  cssRules
@@ -54,78 +57,52 @@ function mutateThemes(param) {
54
57
  }
55
58
  function _mutateTheme(props) {
56
59
  if (isServer) {
57
- process.env.NODE_ENV === "development" && console.warn("Theme mutation is not supported on server side");
60
+ if (process.env.NODE_ENV === "development") console.warn("Theme mutation is not supported on server side");
58
61
  return;
59
62
  }
60
- var config = getConfig(),
61
- {
62
- name: themeName,
63
- theme: themeIn,
64
- insertCSS,
65
- mutationType
66
- } = props;
63
+ var config = getConfig();
64
+ var {
65
+ name: themeName,
66
+ theme: themeIn,
67
+ insertCSS,
68
+ mutationType
69
+ } = props;
67
70
  if (process.env.NODE_ENV === "development") {
68
71
  if (!config) throw new Error("No config");
69
72
  var theme = config.themes[props.name];
70
73
  if (mutationType !== "add" && !theme) throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
71
74
  }
72
- var _config_themes_themeName,
73
- theme1 = {
74
- ...(mutationType === "update" ? (_config_themes_themeName = config.themes[themeName]) !== null && _config_themes_themeName !== void 0 ? _config_themes_themeName : {} : {}),
75
- ...themeIn
76
- };
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
+ };
77
80
  for (var key in theme1) ensureThemeVariable(theme1, key);
78
- var themeProxied = proxyThemeToParents(themeName, theme1),
79
- response = {
80
- themeRaw: theme1,
81
- theme: themeProxied,
82
- cssRules: []
83
- };
84
- return props.avoidUpdate || (insertCSS && (response.cssRules = insertThemeCSS({
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({
85
89
  [themeName]: theme1
86
- })), updateThemeConfig(themeName, themeProxied), updateThemeStates()), response;
90
+ });
91
+ updateThemeConfig(themeName, themeProxied);
92
+ updateThemeStates();
93
+ return response;
87
94
  }
88
95
  function updateThemeConfig(themeName, theme) {
89
96
  var config = getConfig();
90
- config.themes[themeName] = theme, updateConfig("themes", config.themes);
97
+ config.themes[themeName] = theme;
98
+ updateConfig("themes", config.themes);
91
99
  }
92
100
  function updateThemeStates() {
93
101
  forceUpdateThemes();
94
102
  }
95
103
  function insertThemeCSS(themes) {
96
- var batch = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
104
+ arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
97
105
  return [];
98
- var config, cssRules;
99
- for (var themeName in themes) {
100
- var theme = themes[themeName],
101
- rules = getThemeCSSRules({
102
- config,
103
- themeName,
104
- names: [themeName],
105
- hasDarkLight: !0,
106
- theme,
107
- // Use mutated variable creator which starts from high index to avoid conflicts
108
- useMutatedVariables: !0
109
- });
110
- cssRules = [...cssRules, ...rules], batch || updateStyle(`t_theme_style_${themeName}`, rules);
111
- }
112
- if (mutatedAutoVariables.length > 0) {
113
- var autoVarCSS;
114
- updateStyle("t_mutate_vars", [autoVarCSS]);
115
- }
116
- if (batch) {
117
- var id;
118
- updateStyle(`t_theme_style_${id}`, cssRules);
119
- }
120
- }
121
- function updateStyle(id, rules) {
122
- var existing = document.querySelector(`#${id}`),
123
- style = document.createElement("style");
124
- if (style.id = id, style.appendChild(document.createTextNode(rules.join(`
125
- `))), document.head.appendChild(style), existing) {
126
- var _existing_parentElement;
127
- (_existing_parentElement = existing.parentElement) === null || _existing_parentElement === void 0 || _existing_parentElement.removeChild(existing);
128
- }
129
106
  }
130
107
  export { _mutateTheme, mutateThemes };
131
108
  //# sourceMappingURL=_mutateTheme.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isServer","startTransition","ensureThemeVariable","forceUpdateThemes","getConfig","getThemeCSSRules","mutatedAutoVariables","proxyThemeToParents","simpleHash","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","rules","names","hasDarkLight","useMutatedVariables","updateStyle","autoVarCSS","id","existing","document","querySelector","style","createElement","appendChild","createTextNode","join"],"sources":["../../src/_mutateTheme.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AACzB,SAASC,eAAA,QAAuB;AAEhC,SAAAC,mBAAA,EAAAC,iBAAA,EAAAC,SAAA,EAAAC,gBAAA,EAAAC,oBAAA,EAAAC,mBAAA,EAAAC,UAAA,EAAAC,YAAA;AAAA,SACEC,aAAAC,KAAA;EACA;MAAAC,MAAA;MAAAC,KAAA;MAAAC,SAAA;MAAA,GAAAC;IAAA,IAAAJ,KAAA;IAAAK,gBAAA;IAAAC,YAAA;IAAAC,yBAAA;IAAAC,iBAAA;IAAAC,cAAA;EACA;IACA,SAAAC,SAAA,GAAAT,MAAA,CAAAU,MAAA,CAAAC,QAAA,KAAAC,KAAA,IAAAN,yBAAA,IAAAM,KAAA,GAAAH,SAAA,CAAAI,IAAA,IAAAC,IAAA,GAAAR,yBAA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,SAAqD;MAAAoB,KAAe,GAAAtD,gBAAO;QAKlF4C,MAAM;QACFV,SAAA;QAEJqB,KAAA,EAAW,CACTrB,SAAM,CAGJ;QACAsB,YAAA;QACAjC,KAAA;QACA;QACAkC,mBAAA;MAAA;IAAAzB,QAEA,IACD,GAAAA,QAAA,EAED,GAAAsB,KAAA,CAKF,EAAA9C,KAAA,IAAAkD,WAAA,kBAAAxB,SAAA,IAAAoB,KAAA;EAGA;EACE,IAAArD,oBAAmB,CAAAoD,MAAS;IAC5B,IAAAM,UAAY;IACdD,WAAA,mBAEIC,UAAO,CACT;EACA;EACF,IAAAnD,KAAA;IAEA,IAAAoD,EAAO;IACTF,WAAA,kBAAAE,EAAA,IAAA5B,QAAA;EAEA;AACE;AAEA,SAAM0B,WACNA,CAAAE,EAAM,EAAAN,KAAA;EAAoD,IAC1DO,QAAA,GAASC,QAAK,CAAAC,aAAiB,CAC3B,IAAAH,EAAA;IAAAI,KACF,GAAAF,QAAS,CAAAG,aAAe,QAAY;EAExC,IAAAD,KAAA,CAAAJ,EAAA,GAAAA,EAAA,EAAAI,KAAA,CAAAE,WAAA,CAAAJ,QAAA,CAAAK,cAAA,CAAAb,KAAA,CAAAc,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["isServer","startTransition","ensureThemeVariable","forceUpdateThemes","getConfig","getThemeCSSRules","mutatedAutoVariables","proxyThemeToParents","simpleHash","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":["../../src/_mutateTheme.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AACzB,SAAS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,YAAA;EACvBb,iBAAA;EAA8B,OAChCc,QAAA;AAEA;AAEA,SAAMf,iBAAWA,CAAAF,SAAA,EAAAX,KAAA;EAAA,IACfqB,MAAA,GAAU7C,SAAA;EAAA6C,MACV,CAAArC,MAAO,CAAA2B,SAAA,IAAAX,KAAA;EAAAnB,YACP,CAAU,QAAC,EAAAwC,MAAA,CAAArC,MAAA;AAAA;AAGb,SAAI8B,iBAAmBA,CAAA;EACrBvC,iBAAO;AAAA;AAGT,SAAImC,cAAWA,CAAA1B,MAAA;EACb6C,SAAA,CAAAC,MAAS,QAAWD,SAAA,QAAe,UAAAA,SAAA;EAAA,OAChC;AAAY;AACd,SACH1B,YAAA,EAAArB,YAAA","ignoreList":[]}
@@ -2,7 +2,7 @@ import { _mutateTheme } from "./_mutateTheme.mjs";
2
2
  function addTheme(props) {
3
3
  return _mutateTheme({
4
4
  ...props,
5
- insertCSS: !0,
5
+ insertCSS: true,
6
6
  mutationType: "add"
7
7
  });
8
8
  }
@@ -2,7 +2,7 @@ import { _mutateTheme } from "./_mutateTheme.native.js";
2
2
  function addTheme(props) {
3
3
  return _mutateTheme({
4
4
  ...props,
5
- insertCSS: !0,
5
+ insertCSS: true,
6
6
  mutationType: "add"
7
7
  });
8
8
  }