@tamagui/theme 1.89.25 → 1.89.27-1708112217600

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.
@@ -1,38 +1,123 @@
1
1
  import { isServer } from "@tamagui/constants";
2
- import {
3
- activeThemeManagers,
4
- ensureThemeVariable,
5
- getConfig,
6
- getThemeCSSRules,
7
- proxyThemeToParents,
8
- simpleHash,
9
- updateConfig
10
- } from "@tamagui/web";
2
+ import { activeThemeManagers, ensureThemeVariable, getConfig, getThemeCSSRules, proxyThemeToParents, simpleHash, updateConfig } from "@tamagui/web";
11
3
  import { startTransition } from "react";
12
- function mutateThemes({
13
- themes,
14
- batch,
15
- insertCSS = !0,
16
- ...props
17
- }) {
18
- const allThemesProxied = {}, allThemesRaw = {};
19
- for (const { name, theme } of themes) {
20
- const res = _mutateTheme({
21
- ...props,
22
- name,
23
- theme,
24
- // we'll do one update at the end
25
- avoidUpdate: !0,
26
- // always add which also replaces but doesnt fail first time
27
- mutationType: "add"
4
+ function _array_like_to_array(arr, len) {
5
+ (len == null || len > arr.length) && (len = arr.length);
6
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
7
+ arr2[i] = arr[i];
8
+ return arr2;
9
+ }
10
+ function _array_without_holes(arr) {
11
+ if (Array.isArray(arr))
12
+ return _array_like_to_array(arr);
13
+ }
14
+ function _define_property(obj, key, value) {
15
+ return key in obj ? Object.defineProperty(obj, key, {
16
+ value,
17
+ enumerable: !0,
18
+ configurable: !0,
19
+ writable: !0
20
+ }) : obj[key] = value, obj;
21
+ }
22
+ function _iterable_to_array(iter) {
23
+ if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
24
+ return Array.from(iter);
25
+ }
26
+ function _non_iterable_spread() {
27
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
28
+ }
29
+ function _object_spread(target) {
30
+ for (var i = 1; i < arguments.length; i++) {
31
+ var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
32
+ typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
33
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
34
+ }))), ownKeys2.forEach(function(key) {
35
+ _define_property(target, key, source[key]);
28
36
  });
29
- res && (allThemesProxied[name] = res.theme, allThemesRaw[name] = res.themeRaw);
30
37
  }
31
- const cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
32
- return startTransition(() => {
33
- for (const themeName in allThemesProxied) {
34
- const theme = allThemesProxied[themeName];
35
- updateThemeConfig(themeName, theme), notifyThemeManagersOfUpdate(themeName, theme);
38
+ return target;
39
+ }
40
+ function ownKeys(object, enumerableOnly) {
41
+ var keys = Object.keys(object);
42
+ if (Object.getOwnPropertySymbols) {
43
+ var symbols = Object.getOwnPropertySymbols(object);
44
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
45
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
46
+ })), keys.push.apply(keys, symbols);
47
+ }
48
+ return keys;
49
+ }
50
+ function _object_spread_props(target, source) {
51
+ return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
52
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
53
+ }), target;
54
+ }
55
+ function _object_without_properties(source, excluded) {
56
+ if (source == null)
57
+ return {};
58
+ var target = _object_without_properties_loose(source, excluded), key, i;
59
+ if (Object.getOwnPropertySymbols) {
60
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
61
+ for (i = 0; i < sourceSymbolKeys.length; i++)
62
+ key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
63
+ }
64
+ return target;
65
+ }
66
+ function _object_without_properties_loose(source, excluded) {
67
+ if (source == null)
68
+ return {};
69
+ var target = {}, sourceKeys = Object.keys(source), key, i;
70
+ for (i = 0; i < sourceKeys.length; i++)
71
+ key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
72
+ return target;
73
+ }
74
+ function _to_consumable_array(arr) {
75
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
76
+ }
77
+ function _unsupported_iterable_to_array(o, minLen) {
78
+ if (o) {
79
+ if (typeof o == "string")
80
+ return _array_like_to_array(o, minLen);
81
+ var n = Object.prototype.toString.call(o).slice(8, -1);
82
+ if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
83
+ return Array.from(n);
84
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
85
+ return _array_like_to_array(o, minLen);
86
+ }
87
+ }
88
+ function mutateThemes(_param) {
89
+ var themes = _param.themes, batch = _param.batch, _param_insertCSS = _param.insertCSS, insertCSS = _param_insertCSS === void 0 ? !0 : _param_insertCSS, props = _object_without_properties(_param, [
90
+ "themes",
91
+ "batch",
92
+ "insertCSS"
93
+ ]), allThemesProxied = {}, allThemesRaw = {}, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
94
+ try {
95
+ for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
96
+ var _step_value = _step.value, name = _step_value.name, theme = _step_value.theme, res = _mutateTheme(_object_spread_props(_object_spread({}, props), {
97
+ name,
98
+ theme,
99
+ // we'll do one update at the end
100
+ avoidUpdate: !0,
101
+ // always add which also replaces but doesnt fail first time
102
+ mutationType: "add"
103
+ }));
104
+ res && (allThemesProxied[name] = res.theme, allThemesRaw[name] = res.themeRaw);
105
+ }
106
+ } catch (err) {
107
+ _didIteratorError = !0, _iteratorError = err;
108
+ } finally {
109
+ try {
110
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
111
+ } finally {
112
+ if (_didIteratorError)
113
+ throw _iteratorError;
114
+ }
115
+ }
116
+ var cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
117
+ return startTransition(function() {
118
+ for (var themeName in allThemesProxied) {
119
+ var theme2 = allThemesProxied[themeName];
120
+ updateThemeConfig(themeName, theme2), notifyThemeManagersOfUpdate(themeName, theme2);
36
121
  }
37
122
  }), {
38
123
  themes: allThemesProxied,
@@ -45,54 +130,64 @@ function _mutateTheme(props) {
45
130
  process.env.NODE_ENV === "development" && console.warn("Theme mutation is not supported on server side");
46
131
  return;
47
132
  }
48
- const config = getConfig(), { name: themeName, theme: themeIn, insertCSS, mutationType } = props;
133
+ var config = getConfig(), themeName = props.name, themeIn = props.theme, insertCSS = props.insertCSS, mutationType = props.mutationType;
49
134
  if (process.env.NODE_ENV === "development") {
50
135
  if (!config)
51
136
  throw new Error("No config");
52
- const theme2 = config.themes[props.name];
53
- if (mutationType !== "add" && !theme2)
54
- throw new Error(
55
- `${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`
56
- );
137
+ var theme = config.themes[props.name];
138
+ if (mutationType !== "add" && !theme)
139
+ throw new Error("".concat(mutationType === "replace" ? "Replace" : "Update", " theme failed! Theme ").concat(props.name, " does not exist"));
57
140
  }
58
- const theme = {
59
- ...mutationType === "update" ? config.themes[themeName] ?? {} : {},
60
- ...themeIn
61
- };
62
- for (const key in theme)
63
- ensureThemeVariable(theme, key);
64
- const themeProxied = proxyThemeToParents(themeName, theme), response = {
65
- themeRaw: theme,
141
+ var _config_themes_themeName, theme1 = _object_spread({}, mutationType === "update" ? (_config_themes_themeName = config.themes[themeName]) !== null && _config_themes_themeName !== void 0 ? _config_themes_themeName : {} : {}, themeIn);
142
+ for (var key in theme1)
143
+ ensureThemeVariable(theme1, key);
144
+ var themeProxied = proxyThemeToParents(themeName, theme1), response = {
145
+ themeRaw: theme1,
66
146
  theme: themeProxied,
67
147
  cssRules: []
68
148
  };
69
- return props.avoidUpdate || (insertCSS && (response.cssRules = insertThemeCSS({
70
- [themeName]: theme
71
- })), updateThemeConfig(themeName, themeProxied), notifyThemeManagersOfUpdate(themeName, themeProxied)), response;
149
+ return props.avoidUpdate || (insertCSS && (response.cssRules = insertThemeCSS(_define_property({}, themeName, theme1))), updateThemeConfig(themeName, themeProxied), notifyThemeManagersOfUpdate(themeName, themeProxied)), response;
72
150
  }
73
151
  function updateThemeConfig(themeName, theme) {
74
- const config = getConfig();
152
+ var config = getConfig();
75
153
  config.themes[themeName] = theme, updateConfig("themes", config.themes);
76
154
  }
77
155
  function notifyThemeManagersOfUpdate(themeName, theme) {
78
- activeThemeManagers.forEach((manager) => {
79
- manager.state.name === themeName && manager.updateStateFromProps(
80
- {
81
- name: themeName,
82
- forceTheme: theme
83
- },
84
- !0
85
- );
156
+ activeThemeManagers.forEach(function(manager) {
157
+ manager.state.name === themeName && manager.updateStateFromProps({
158
+ name: themeName,
159
+ forceTheme: theme
160
+ }, !0);
86
161
  });
87
162
  }
88
- function insertThemeCSS(themes, batch = !1) {
163
+ function insertThemeCSS(themes) {
164
+ var batch = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
89
165
  return [];
166
+ var config, cssRules;
167
+ for (var themeName in themes) {
168
+ var theme = themes[themeName], rules = getThemeCSSRules({
169
+ config,
170
+ themeName,
171
+ names: [
172
+ themeName
173
+ ],
174
+ hasDarkLight: !0,
175
+ theme
176
+ });
177
+ cssRules = _to_consumable_array(cssRules).concat(_to_consumable_array(rules)), batch || updateStyle("t_theme_style_".concat(themeName), rules);
178
+ }
179
+ if (batch) {
180
+ var id;
181
+ updateStyle("t_theme_style_".concat(id), cssRules);
182
+ }
90
183
  }
91
184
  function updateStyle(id, rules) {
92
- var _a;
93
- const existing = document.querySelector(`#${id}`), style = document.createElement("style");
94
- style.id = id, style.appendChild(document.createTextNode(rules.join(`
95
- `))), document.head.appendChild(style), existing && ((_a = existing.parentElement) == null || _a.removeChild(existing));
185
+ var existing = document.querySelector("#".concat(id)), style = document.createElement("style");
186
+ if (style.id = id, style.appendChild(document.createTextNode(rules.join(`
187
+ `))), document.head.appendChild(style), existing) {
188
+ var _existing_parentElement;
189
+ (_existing_parentElement = existing.parentElement) === null || _existing_parentElement === void 0 || _existing_parentElement.removeChild(existing);
190
+ }
96
191
  }
97
192
  export {
98
193
  _mutateTheme,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/_mutateTheme.ts"],
4
- "mappings": "AAAA,SAAS,gBAAgB;AAEzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAmBzB,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,GAMG;AACD,QAAM,mBAAgD,CAAC,GACjD,eAA4C,CAAC;AAEnD,aAAW,EAAE,MAAM,MAAM,KAAK,QAAQ;AACpC,UAAM,MAAM,aAAa;AAAA,MACvB,GAAG;AAAA,MACH;AAAA,MACA;AAAA;AAAA,MAEA,aAAa;AAAA;AAAA,MAEb,cAAc;AAAA,IAChB,CAAC;AACD,IAAI,QACF,iBAAiB,IAAI,IAAI,IAAI,OAC7B,aAAa,IAAI,IAAI,IAAI;AAAA,EAE7B;AAEA,QAAM,WAAW,YAAY,eAAe,cAAc,KAAK,IAAI,CAAC;AAEpE,yBAAgB,MAAM;AACpB,eAAW,aAAa,kBAAkB;AACxC,YAAM,QAAQ,iBAAiB,SAAS;AACxC,wBAAkB,WAAW,KAAK,GAClC,4BAA4B,WAAW,KAAK;AAAA,IAC9C;AAAA,EACF,CAAC,GAEM;AAAA,IACL,QAAQ;AAAA,IACR,WAAW;AAAA,IACX;AAAA,EACF;AACF;AAEO,SAAS,aAAa,OAAiD;AAC5E,MAAI,UAAU;AACZ,IAAI,QAAQ,IAAI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IrC,MAHAD,MAAMJ,KAAKA,IACXI,MAAME,YAAYJ,SAASK,eAAeX,MAAMY,KAAK;CAAA,CAAA,CAAA,GACrDN,SAASO,KAAKH,YAAYF,KAAAA,GACtBH,UAAU;QACZA;KAAAA,0BAAAA,SAASS,mBAAa,QAAtBT,4BAAAA,UAAAA,wBAAwBU,YAAYV,QAAAA;EACtC;AACF;",
5
+ "names": ["isServer", "activeThemeManagers", "ensureThemeVariable", "getConfig", "getThemeCSSRules", "proxyThemeToParents", "simpleHash", "updateConfig", "startTransition", "mutateThemes", "themes", "batch", "insertCSS", "props", "allThemesProxied", "allThemesRaw", "name", "theme", "res", "_mutateTheme", "avoidUpdate", "mutationType", "themeRaw", "cssRules", "insertThemeCSS", "themeName", "updateThemeConfig", "notifyThemeManagersOfUpdate", "themesRaw", "process", "env", "NODE_ENV", "console", "warn", "config", "themeIn", "Error", "key", "themeProxied", "response", "forEach", "manager", "state", "updateStateFromProps", "forceTheme", "rules", "names", "hasDarkLight", "updateStyle", "id", "existing", "document", "querySelector", "style", "createElement", "appendChild", "createTextNode", "join", "head", "parentElement", "removeChild"]
6
6
  }
@@ -1,6 +1,43 @@
1
1
  import { _mutateTheme } from "./_mutateTheme";
2
+ function _define_property(obj, key, value) {
3
+ return key in obj ? Object.defineProperty(obj, key, {
4
+ value,
5
+ enumerable: !0,
6
+ configurable: !0,
7
+ writable: !0
8
+ }) : obj[key] = value, obj;
9
+ }
10
+ function _object_spread(target) {
11
+ for (var i = 1; i < arguments.length; i++) {
12
+ var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
13
+ typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
14
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
15
+ }))), ownKeys2.forEach(function(key) {
16
+ _define_property(target, key, source[key]);
17
+ });
18
+ }
19
+ return target;
20
+ }
21
+ function ownKeys(object, enumerableOnly) {
22
+ var keys = Object.keys(object);
23
+ if (Object.getOwnPropertySymbols) {
24
+ var symbols = Object.getOwnPropertySymbols(object);
25
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
26
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
27
+ })), keys.push.apply(keys, symbols);
28
+ }
29
+ return keys;
30
+ }
31
+ function _object_spread_props(target, source) {
32
+ return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
33
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
34
+ }), target;
35
+ }
2
36
  function addTheme(props) {
3
- return _mutateTheme({ ...props, insertCSS: !0, mutationType: "add" });
37
+ return _mutateTheme(_object_spread_props(_object_spread({}, props), {
38
+ insertCSS: !0,
39
+ mutationType: "add"
40
+ }));
4
41
  }
5
42
  export {
6
43
  addTheme
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/addTheme.ts"],
4
- "mappings": "AAEA,SAAS,oBAAoB;AAEtB,SAAS,SAAS,OAItB;AACD,SAAO,aAAa,EAAE,GAAG,OAAO,WAAW,IAAM,cAAc,MAAM,CAAC;AACxE;",
5
- "names": []
3
+ "sources": ["../../src/Users/n8/tamagui/packages/theme/src/addTheme.ts"],
4
+ "mappings": "AAEA,SAASA,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtB,SAASC,SAASC,OAIxB;AACC,SAAOF,aAAa,qBAAA,eAAA,CAAA,GAAKE,KAAAA,GAAAA;IAAOC,WAAW;IAAMC,cAAc;;AACjE;",
5
+ "names": ["_mutateTheme", "addTheme", "props", "insertCSS", "mutationType"]
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,oBAAoB;",
5
- "names": []
3
+ "sources": ["../../src/Users/n8/tamagui/packages/theme/src/index.ts"],
4
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAASA,oBAAoB;",
5
+ "names": ["mutateThemes"]
6
6
  }
@@ -1,9 +1,12 @@
1
1
  import { _mutateTheme } from "./_mutateTheme";
2
- function replaceTheme({
3
- name,
4
- theme
5
- }) {
6
- return _mutateTheme({ name, theme, insertCSS: !0, mutationType: "replace" });
2
+ function replaceTheme(param) {
3
+ var name = param.name, theme = param.theme, next = _mutateTheme({
4
+ name,
5
+ theme,
6
+ insertCSS: !0,
7
+ mutationType: "replace"
8
+ });
9
+ return next;
7
10
  }
8
11
  export {
9
12
  replaceTheme
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/replaceTheme.ts"],
4
- "mappings": "AAEA,SAAS,oBAAoB;AAEtB,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AACF,GAGG;AAED,SADa,aAAa,EAAE,MAAM,OAAO,WAAW,IAAM,cAAc,UAAU,CAAC;AAErF;",
5
- "names": []
3
+ "sources": ["../../src/Users/n8/tamagui/packages/theme/src/replaceTheme.ts"],
4
+ "mappings": "AAEA,SAASA,oBAAoB;AAEtB,SAASC,aAAa,OAM5B;MALCC,OAD2B,MAC3BA,MACAC,QAF2B,MAE3BA,OAKMC,OAAOJ,aAAa;IAAEE;IAAMC;IAAOE,WAAW;IAAMC,cAAc;EAAU,CAAA;AAClF,SAAOF;AACT;",
5
+ "names": ["_mutateTheme", "replaceTheme", "name", "theme", "next", "insertCSS", "mutationType"]
6
6
  }
@@ -1,9 +1,12 @@
1
1
  import { _mutateTheme } from "./_mutateTheme";
2
- function updateTheme({
3
- name,
4
- theme
5
- }) {
6
- return _mutateTheme({ name, theme, insertCSS: !0, mutationType: "update" });
2
+ function updateTheme(param) {
3
+ var name = param.name, theme = param.theme;
4
+ return _mutateTheme({
5
+ name,
6
+ theme,
7
+ insertCSS: !0,
8
+ mutationType: "update"
9
+ });
7
10
  }
8
11
  export {
9
12
  updateTheme
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/updateTheme.ts"],
4
- "mappings": "AAEA,SAAS,oBAAoB;AAEtB,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AACF,GAGG;AACD,SAAO,aAAa,EAAE,MAAM,OAAO,WAAW,IAAM,cAAc,SAAS,CAAC;AAC9E;",
5
- "names": []
3
+ "sources": ["../../src/Users/n8/tamagui/packages/theme/src/updateTheme.ts"],
4
+ "mappings": "AAEA,SAASA,oBAAoB;AAEtB,SAASC,YAAY,OAM3B;MALCC,OAD0B,MAC1BA,MACAC,QAF0B,MAE1BA;AAKA,SAAOH,aAAa;IAAEE;IAAMC;IAAOC,WAAW;IAAMC,cAAc;EAAS,CAAA;AAC7E;",
5
+ "names": ["_mutateTheme", "updateTheme", "name", "theme", "insertCSS", "mutationType"]
6
6
  }