@tamagui/theme 2.0.0-rc.36 → 2.0.0-rc.36-1775243248161

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 mutateTheme_exports = {};
22
24
  __export(mutateTheme_exports, {
@@ -24,17 +26,17 @@ __export(mutateTheme_exports, {
24
26
  mutateThemes: () => mutateThemes
25
27
  });
26
28
  module.exports = __toCommonJS(mutateTheme_exports);
27
- var import_constants = require("@tamagui/constants"),
28
- import_start_transition = require("@tamagui/start-transition"),
29
- import_web = require("@tamagui/web");
29
+ var import_constants = require("@tamagui/constants");
30
+ var import_start_transition = require("@tamagui/start-transition");
31
+ var import_web = require("@tamagui/web");
30
32
  function mutateThemes({
31
33
  themes,
32
34
  batch,
33
- insertCSS = !0,
35
+ insertCSS = true,
34
36
  ...props
35
37
  }) {
36
- const allThemesProxied = {},
37
- allThemesRaw = {};
38
+ const allThemesProxied = {};
39
+ const allThemesRaw = {};
38
40
  for (const {
39
41
  name,
40
42
  theme
@@ -44,20 +46,24 @@ function mutateThemes({
44
46
  name,
45
47
  theme,
46
48
  // we'll do one update at the end
47
- avoidUpdate: !0,
49
+ avoidUpdate: true,
48
50
  // always add which also replaces but doesnt fail first time
49
51
  mutationType: "add"
50
52
  });
51
- res && (allThemesProxied[name] = res.theme, allThemesRaw[name] = res.themeRaw);
53
+ if (res) {
54
+ allThemesProxied[name] = res.theme;
55
+ allThemesRaw[name] = res.themeRaw;
56
+ }
52
57
  }
53
58
  const cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
54
- return (0, import_start_transition.startTransition)(() => {
59
+ (0, import_start_transition.startTransition)(() => {
55
60
  for (const themeName in allThemesProxied) {
56
61
  const theme = allThemesProxied[themeName];
57
62
  updateThemeConfig(themeName, theme);
58
63
  }
59
64
  updateThemeStates();
60
- }), {
65
+ });
66
+ return {
61
67
  themes: allThemesProxied,
62
68
  themesRaw: allThemesRaw,
63
69
  cssRules
@@ -65,62 +71,85 @@ function mutateThemes({
65
71
  }
66
72
  function _mutateTheme(props) {
67
73
  if (import_constants.isServer) {
68
- process.env.NODE_ENV === "development" && console.warn("Theme mutation is not supported on server side");
74
+ if (process.env.NODE_ENV === "development") {
75
+ console.warn("Theme mutation is not supported on server side");
76
+ }
69
77
  return;
70
78
  }
71
- const config = (0, import_web.getConfig)(),
72
- {
73
- name: themeName,
74
- theme: themeIn,
75
- insertCSS,
76
- mutationType
77
- } = props;
79
+ const config = (0, import_web.getConfig)();
80
+ const {
81
+ name: themeName,
82
+ theme: themeIn,
83
+ insertCSS,
84
+ mutationType
85
+ } = props;
78
86
  if (process.env.NODE_ENV === "development") {
79
- if (!config) throw new Error("No config");
87
+ if (!config) {
88
+ throw new Error("No config");
89
+ }
80
90
  const theme2 = config.themes[props.name];
81
- if (mutationType !== "add" && !theme2) throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
91
+ if (mutationType !== "add" && !theme2) {
92
+ throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
93
+ }
82
94
  }
83
95
  const theme = {
84
96
  ...(mutationType === "update" ? config.themes[themeName] ?? {} : {}),
85
97
  ...themeIn
86
98
  };
87
- for (const key in theme) (0, import_web.ensureThemeVariable)(theme, key);
88
- const themeProxied = (0, import_web.proxyThemeToParents)(themeName, theme),
89
- response = {
90
- themeRaw: theme,
91
- theme: themeProxied,
92
- cssRules: []
93
- };
94
- return props.avoidUpdate || (insertCSS && (response.cssRules = insertThemeCSS({
95
- [themeName]: theme
96
- })), updateThemeConfig(themeName, themeProxied), updateThemeStates()), response;
99
+ for (const key in theme) {
100
+ (0, import_web.ensureThemeVariable)(theme, key);
101
+ }
102
+ const themeProxied = (0, import_web.proxyThemeToParents)(themeName, theme);
103
+ const response = {
104
+ themeRaw: theme,
105
+ theme: themeProxied,
106
+ cssRules: []
107
+ };
108
+ if (props.avoidUpdate) {
109
+ return response;
110
+ }
111
+ if (insertCSS) {
112
+ response.cssRules = insertThemeCSS({
113
+ [themeName]: theme
114
+ });
115
+ }
116
+ updateThemeConfig(themeName, themeProxied);
117
+ updateThemeStates();
118
+ return response;
97
119
  }
98
120
  function updateThemeConfig(themeName, theme) {
99
121
  const config = (0, import_web.getConfig)();
100
- config.themes[themeName] = theme, (0, import_web.updateConfig)("themes", config.themes);
122
+ config.themes[themeName] = theme;
123
+ (0, import_web.updateConfig)("themes", config.themes);
101
124
  }
102
125
  function updateThemeStates() {
103
126
  (0, import_web.forceUpdateThemes)();
104
127
  }
105
- function insertThemeCSS(themes, batch = !1) {
128
+ function insertThemeCSS(themes, batch = false) {
129
+ if (false) {
130
+ return [];
131
+ }
106
132
  const config = (0, import_web.getConfig)();
107
133
  let cssRules = [];
108
134
  for (const themeName in themes) {
109
- const theme = themes[themeName],
110
- rules = (0, import_web.getThemeCSSRules)({
111
- config,
112
- themeName,
113
- names: [themeName],
114
- hasDarkLight: !0,
115
- theme,
116
- // Use mutated variable creator which starts from high index to avoid conflicts
117
- useMutatedVariables: !0
118
- });
119
- cssRules = [...cssRules, ...rules], batch || updateStyle(`t_theme_style_${themeName}`, rules);
135
+ const theme = themes[themeName];
136
+ const rules = (0, import_web.getThemeCSSRules)({
137
+ config,
138
+ themeName,
139
+ names: [themeName],
140
+ hasDarkLight: true,
141
+ theme,
142
+ // Use mutated variable creator which starts from high index to avoid conflicts
143
+ useMutatedVariables: true
144
+ });
145
+ cssRules = [...cssRules, ...rules];
146
+ if (!batch) {
147
+ updateStyle(`t_theme_style_${themeName}`, rules);
148
+ }
120
149
  }
121
150
  if (import_web.mutatedAutoVariables.length > 0) {
122
151
  const autoVarCSS = `:root{${import_web.mutatedAutoVariables.map(v => `--${v.name}:${v.val}`).join(";")}}`;
123
- updateStyle("t_mutate_vars", [autoVarCSS]);
152
+ updateStyle(`t_mutate_vars`, [autoVarCSS]);
124
153
  }
125
154
  if (batch) {
126
155
  const id = typeof batch == "string" ? batch : (0, import_web.simpleHash)(Object.keys(themes).join(""));
@@ -129,8 +158,12 @@ function insertThemeCSS(themes, batch = !1) {
129
158
  return cssRules;
130
159
  }
131
160
  function updateStyle(id, rules) {
132
- const existing = document.querySelector(`#${id}`),
133
- style = document.createElement("style");
134
- style.id = id, style.appendChild(document.createTextNode(rules.join(`
135
- `))), document.head.appendChild(style), existing && existing.parentElement?.removeChild(existing);
161
+ const existing = document.querySelector(`#${id}`);
162
+ const style = document.createElement("style");
163
+ style.id = id;
164
+ style.appendChild(document.createTextNode(rules.join("\n")));
165
+ document.head.appendChild(style);
166
+ if (existing) {
167
+ existing.parentElement?.removeChild(existing);
168
+ }
136
169
  }
@@ -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 mutateTheme_exports = {};
24
26
  __export(mutateTheme_exports, {
@@ -26,55 +28,64 @@ __export(mutateTheme_exports, {
26
28
  mutateThemes: () => mutateThemes
27
29
  });
28
30
  module.exports = __toCommonJS(mutateTheme_exports);
29
- var import_constants = require("@tamagui/constants"),
30
- import_start_transition = require("@tamagui/start-transition"),
31
- import_web = require("@tamagui/web");
31
+ var import_constants = require("@tamagui/constants");
32
+ var import_start_transition = require("@tamagui/start-transition");
33
+ var import_web = require("@tamagui/web");
32
34
  function mutateThemes(param) {
33
35
  var {
34
- themes,
35
- batch,
36
- insertCSS = !0,
37
- ...props
38
- } = param,
39
- allThemesProxied = {},
40
- allThemesRaw = {},
41
- _iteratorNormalCompletion = !0,
42
- _didIteratorError = !1,
36
+ themes,
37
+ batch,
38
+ insertCSS = true,
39
+ ...props
40
+ } = param;
41
+ var allThemesProxied = {};
42
+ var allThemesRaw = {};
43
+ var _iteratorNormalCompletion = true,
44
+ _didIteratorError = false,
43
45
  _iteratorError = void 0;
44
46
  try {
45
- for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
47
+ for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
46
48
  var {
47
- name,
48
- theme
49
- } = _step.value,
50
- res = _mutateTheme({
51
- ...props,
52
- name,
53
- theme,
54
- // we'll do one update at the end
55
- avoidUpdate: !0,
56
- // always add which also replaces but doesnt fail first time
57
- mutationType: "add"
58
- });
59
- res && (allThemesProxied[name] = res.theme, allThemesRaw[name] = res.themeRaw);
49
+ name,
50
+ theme
51
+ } = _step.value;
52
+ var res = _mutateTheme({
53
+ ...props,
54
+ name,
55
+ theme,
56
+ // we'll do one update at the end
57
+ avoidUpdate: true,
58
+ // always add which also replaces but doesnt fail first time
59
+ mutationType: "add"
60
+ });
61
+ if (res) {
62
+ allThemesProxied[name] = res.theme;
63
+ allThemesRaw[name] = res.themeRaw;
64
+ }
60
65
  }
61
66
  } catch (err) {
62
- _didIteratorError = !0, _iteratorError = err;
67
+ _didIteratorError = true;
68
+ _iteratorError = err;
63
69
  } finally {
64
70
  try {
65
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
71
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
72
+ _iterator.return();
73
+ }
66
74
  } finally {
67
- if (_didIteratorError) throw _iteratorError;
75
+ if (_didIteratorError) {
76
+ throw _iteratorError;
77
+ }
68
78
  }
69
79
  }
70
80
  var cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
71
- return (0, import_start_transition.startTransition)(function () {
81
+ (0, import_start_transition.startTransition)(function () {
72
82
  for (var themeName in allThemesProxied) {
73
83
  var theme2 = allThemesProxied[themeName];
74
84
  updateThemeConfig(themeName, theme2);
75
85
  }
76
86
  updateThemeStates();
77
- }), {
87
+ });
88
+ return {
78
89
  themes: allThemesProxied,
79
90
  themesRaw: allThemesRaw,
80
91
  cssRules
@@ -82,77 +93,105 @@ function mutateThemes(param) {
82
93
  }
83
94
  function _mutateTheme(props) {
84
95
  if (import_constants.isServer) {
85
- process.env.NODE_ENV === "development" && console.warn("Theme mutation is not supported on server side");
96
+ if (process.env.NODE_ENV === "development") {
97
+ console.warn("Theme mutation is not supported on server side");
98
+ }
86
99
  return;
87
100
  }
88
- var config = (0, import_web.getConfig)(),
89
- {
90
- name: themeName,
91
- theme: themeIn,
92
- insertCSS,
93
- mutationType
94
- } = props;
101
+ var config = (0, import_web.getConfig)();
102
+ var {
103
+ name: themeName,
104
+ theme: themeIn,
105
+ insertCSS,
106
+ mutationType
107
+ } = props;
95
108
  if (process.env.NODE_ENV === "development") {
96
- if (!config) throw new Error("No config");
109
+ if (!config) {
110
+ throw new Error("No config");
111
+ }
97
112
  var theme = config.themes[props.name];
98
- if (mutationType !== "add" && !theme) throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
113
+ if (mutationType !== "add" && !theme) {
114
+ throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
115
+ }
116
+ }
117
+ var _config_themes_themeName;
118
+ var theme1 = {
119
+ ...(mutationType === "update" ? (_config_themes_themeName = config.themes[themeName]) !== null && _config_themes_themeName !== void 0 ? _config_themes_themeName : {} : {}),
120
+ ...themeIn
121
+ };
122
+ for (var key in theme1) {
123
+ (0, import_web.ensureThemeVariable)(theme1, key);
124
+ }
125
+ var themeProxied = (0, import_web.proxyThemeToParents)(themeName, theme1);
126
+ var response = {
127
+ themeRaw: theme1,
128
+ theme: themeProxied,
129
+ cssRules: []
130
+ };
131
+ if (props.avoidUpdate) {
132
+ return response;
99
133
  }
100
- var _config_themes_themeName,
101
- theme1 = {
102
- ...(mutationType === "update" ? (_config_themes_themeName = config.themes[themeName]) !== null && _config_themes_themeName !== void 0 ? _config_themes_themeName : {} : {}),
103
- ...themeIn
104
- };
105
- for (var key in theme1) (0, import_web.ensureThemeVariable)(theme1, key);
106
- var themeProxied = (0, import_web.proxyThemeToParents)(themeName, theme1),
107
- response = {
108
- themeRaw: theme1,
109
- theme: themeProxied,
110
- cssRules: []
111
- };
112
- return props.avoidUpdate || (insertCSS && (response.cssRules = insertThemeCSS({
113
- [themeName]: theme1
114
- })), updateThemeConfig(themeName, themeProxied), updateThemeStates()), response;
134
+ if (insertCSS) {
135
+ response.cssRules = insertThemeCSS({
136
+ [themeName]: theme1
137
+ });
138
+ }
139
+ updateThemeConfig(themeName, themeProxied);
140
+ updateThemeStates();
141
+ return response;
115
142
  }
116
143
  function updateThemeConfig(themeName, theme) {
117
144
  var config = (0, import_web.getConfig)();
118
- config.themes[themeName] = theme, (0, import_web.updateConfig)("themes", config.themes);
145
+ config.themes[themeName] = theme;
146
+ (0, import_web.updateConfig)("themes", config.themes);
119
147
  }
120
148
  function updateThemeStates() {
121
149
  (0, import_web.forceUpdateThemes)();
122
150
  }
123
151
  function insertThemeCSS(themes) {
124
- var batch = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
125
- return [];
126
- var config, cssRules;
152
+ var batch = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
153
+ if (true) {
154
+ return [];
155
+ }
156
+ var config = (0, import_web.getConfig)();
157
+ var cssRules = [];
127
158
  for (var themeName in themes) {
128
- var theme = themes[themeName],
129
- rules = (0, import_web.getThemeCSSRules)({
130
- config,
131
- themeName,
132
- names: [themeName],
133
- hasDarkLight: !0,
134
- theme,
135
- // Use mutated variable creator which starts from high index to avoid conflicts
136
- useMutatedVariables: !0
137
- });
138
- cssRules = [...cssRules, ...rules], batch || updateStyle(`t_theme_style_${themeName}`, rules);
159
+ var theme = themes[themeName];
160
+ var rules = (0, import_web.getThemeCSSRules)({
161
+ config,
162
+ themeName,
163
+ names: [themeName],
164
+ hasDarkLight: true,
165
+ theme,
166
+ // Use mutated variable creator which starts from high index to avoid conflicts
167
+ useMutatedVariables: true
168
+ });
169
+ cssRules = [...cssRules, ...rules];
170
+ if (!batch) {
171
+ updateStyle(`t_theme_style_${themeName}`, rules);
172
+ }
139
173
  }
140
174
  if (import_web.mutatedAutoVariables.length > 0) {
141
- var autoVarCSS;
142
- updateStyle("t_mutate_vars", [autoVarCSS]);
175
+ var autoVarCSS = `:root{${import_web.mutatedAutoVariables.map(function (v) {
176
+ return `--${v.name}:${v.val}`;
177
+ }).join(";")}}`;
178
+ updateStyle(`t_mutate_vars`, [autoVarCSS]);
143
179
  }
144
180
  if (batch) {
145
- var id;
181
+ var id = typeof batch == "string" ? batch : (0, import_web.simpleHash)(Object.keys(themes).join(""));
146
182
  updateStyle(`t_theme_style_${id}`, cssRules);
147
183
  }
184
+ return cssRules;
148
185
  }
149
186
  function updateStyle(id, rules) {
150
- var existing = document.querySelector(`#${id}`),
151
- style = document.createElement("style");
152
- if (style.id = id, style.appendChild(document.createTextNode(rules.join(`
153
- `))), document.head.appendChild(style), existing) {
187
+ var existing = document.querySelector(`#${id}`);
188
+ var style = document.createElement("style");
189
+ style.id = id;
190
+ style.appendChild(document.createTextNode(rules.join("\n")));
191
+ document.head.appendChild(style);
192
+ if (existing) {
154
193
  var _existing_parentElement;
155
- (_existing_parentElement = existing.parentElement) === null || _existing_parentElement === void 0 || _existing_parentElement.removeChild(existing);
194
+ (_existing_parentElement = existing.parentElement) === null || _existing_parentElement === void 0 ? void 0 : _existing_parentElement.removeChild(existing);
156
195
  }
157
196
  }
158
197
  //# sourceMappingURL=_mutateTheme.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","mutateTheme_exports","__export","_mutateTheme","mutateThemes","module","exports","import_constants","require","import_start_transition","import_web","param","themes","batch","insertCSS","props","allThemesProxied","allThemesRaw","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","name","theme","res","avoidUpdate","mutationType","themeRaw","err","return","cssRules","insertThemeCSS","startTransition","themeName","theme2","updateThemeConfig","updateThemeStates","themesRaw","isServer","process","env","NODE_ENV","console","warn","config","getConfig","themeIn","Error","_config_themes_themeName","theme1","key","ensureThemeVariable","themeProxied","proxyThemeToParents","response","updateConfig","forceUpdateThemes","arguments","length","rules","getThemeCSSRules","names","hasDarkLight","useMutatedVariables","updateStyle","mutatedAutoVariables","autoVarCSS"],"sources":["../../src/_mutateTheme.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,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAV,YAAyB,CAAAK,mBAAA;AA+BlB,IAAAM,gBAAS,GAAaC,OAAA;EAAAC,uBAAA,GAAAD,OAAA;EAAAE,UAAA,GAAAF,OAAA;AAAA,SAC3BJ,aAAAO,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,KAAG,IAAAC,SAAA,GAAAT,MAAA,CAAAU,MAAA,CAAAC,QAAA,KAAAC,KAAA,IAAAN,yBAAA,IAAAM,KAAA,GAAAH,SAAA,CAAAI,IAAA,IAAAC,IAAA,GAAAR,yBAAA;MAMF;UAAAS,IAAA;UAAAC;QAAA,IAAAJ,KAAA,CAAAxB,KAAA;QAAA6B,GAAA,GAAA1B,YAAA;UACK,GAAAY,KAAA;UAENY,IAAA;UACEC,KAAM;UACJ;UACAE,WAAA;UACA;UAAAC,YAAA;QAEA;MAAaF,GAAA,KAAAb,gBAAA,CAAAW,IAAA,IAAAE,GAAA,CAAAD,KAAA,EAAAX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A,GAKF5B,SAAA,CAGI;QACF6B,YAAM;QACNvC,KAAA;QACF;QAEIwC,mBAAO;MACT;IACAjC,QAAA,IACF,GAAAA,QAAA,EAEA,GAAO6B,KAAA,CACT,EAAAnD,KAAA,IAAAwD,WAAA,kBAAA/B,SAAA,IAAA0B,KAAA;EAEA;EACE,IAAAtD,UAAM,CAAA4D,oBAAoB,CAAAP,MAAc,GAAI,CAAE,EAAE;IAEhD,IAAMQ,UACN;IAA2DF,WAClD,gBAAK,EAAY,CAI5BE,UAAA,C","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","mutateTheme_exports","__export","_mutateTheme","mutateThemes","module","exports","import_constants","require","import_start_transition","import_web","param","themes","batch","insertCSS","props","allThemesProxied","allThemesRaw","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","name","theme","res","avoidUpdate","mutationType","themeRaw","err","return","cssRules","insertThemeCSS","startTransition","themeName","theme2","updateThemeConfig","updateThemeStates","themesRaw","isServer","process","env","NODE_ENV","console","warn","config","getConfig","themeIn","Error","_config_themes_themeName","theme1","key","ensureThemeVariable","themeProxied","proxyThemeToParents","response","updateConfig","forceUpdateThemes","arguments","length","rules","getThemeCSSRules","names","hasDarkLight","useMutatedVariables","updateStyle","mutatedAutoVariables"],"sources":["../../src/_mutateTheme.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,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAV,YAAyB,CAAAK,mBAAA;AACzB,IAAAM,gBAAA,GAAAC,OAAgC;AAEhC,IAAAC,uBASO,GAAAD,O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AAAE,SAAA,GAAAgB;IACF;EAEA;EACEd,iBAA0C,CAAAF,SAAA,EAAAmB,YAAA;EACxChB,iBAAQ;EACV,OAAAkB,QAAA;AAEA;AACA,SAAInB,iBAAsBA,CAAAF,SAAA,EAAAV,KAAA;EAE1B,IAAAqB,MAAA,GAAW,IAAAvC,UAAa,CAAAwC,SAAQ;EAC9BD,MAAA,CAAArC,MAAM,CAAA0B,SAAe,IAAAV,KAAS;EAE9B,IAAAlB,UAAM,CAAAkD,YAAQ,YAAAX,MAAA,CAAArC,MAAiB;AAAA;AAC7B,SACA6B,kBAAA;EAAA,IACA/B,UAAQ,CAAAmD,iBAAS;AAAA;AACH,SACdzB,eAAAxB,MAAA;EAAA,IAAAC,KAAA,GAAAiD,SAAA,CAAAC,MAAA,QAAAD,SAAA,iBAAAA,SAAA;EAAA,IAEA;IACF,OAAC;EAED;EAEA,IAAAb,MAAK,IAAO,GAAAvC,UAAA,CAAAwC,SAAA;EACV,IAAAf,QAAA,KAAY;EAAmC,KACjD,IAAAG,SAAA,IAAA1B,MAAA;IACF,IAAAgB,KAAA,GAAAhB,MAAA,CAAA0B,SAAA;IAGA,IAAI0B,KAAA,OAAAtD,UAAA,CAAAuD,gBAA8B;MAChChB,MAAM;MACNX,SAAA;MACF4B,KAAA,GAEI5B,SAAO,CACT;MACA6B,YAAY;MACdvC,KAAA;MAEA;MACFwC,mBAAA;IAEA;IACEjC,QAAM,IACN,GAAMA,QAAQ,EACd,GAAM6B,KAAK,CACX;IACA,KAAAnD,KAAS,EAAK;MACVwD,WAAU,kBAAA/B,SAAA,IAAA0B,KAAA;IACZ;EACF;EACF,IAAAtD,UAAA,CAAA4D,oBAAA,CAAAP,MAAA","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 addTheme_exports = {};
22
24
  __export(addTheme_exports, {
@@ -27,7 +29,7 @@ var import_mutateTheme = require("./_mutateTheme.cjs");
27
29
  function addTheme(props) {
28
30
  return (0, import_mutateTheme._mutateTheme)({
29
31
  ...props,
30
- insertCSS: !0,
32
+ insertCSS: true,
31
33
  mutationType: "add"
32
34
  });
33
35
  }
@@ -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 addTheme_exports = {};
24
26
  __export(addTheme_exports, {
@@ -29,7 +31,7 @@ var import_mutateTheme = require("./_mutateTheme.native.js");
29
31
  function addTheme(props) {
30
32
  return (0, import_mutateTheme._mutateTheme)({
31
33
  ...props,
32
- insertCSS: !0,
34
+ insertCSS: true,
33
35
  mutationType: "add"
34
36
  });
35
37
  }
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","addTheme_exports","__export","addTheme","module","exports","import_mutateTheme","require","props","_mutateTheme"],"sources":["../../src/addTheme.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,gBAAA;AAAAC,QAAA,CAAAD,gBAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA;AAAA;AAEAC,MAAA,CAAAC,OAAA,GAAAT,YAA6B,CAAAK,gBAAA;AAEtB,IAAAK,kBAAkB,GAItBC,OAAA;AACD,SAAAJ,QAAOA,CAAAK,KAAA;EACT,WAAAF,kBAAA,CAAAG,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","addTheme_exports","__export","addTheme","module","exports","import_mutateTheme","require","props","_mutateTheme"],"sources":["../../src/addTheme.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,gBAAA;AAAAC,QAAA,CAAAD,gBAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA;AAAA;AAEAC,MAAA,CAAAC,OAAA,GAAAT,YAA6B,CAAAK,gBAAA;AAEtB,IAAAK,kBAAkB,GAItBC,OAAA;AACD,SAAAJ,QAAOA,CAAAK,KAAA;EACT,WAAAF,kBAAA,CAAAG,YAAA","ignoreList":[]}