@tamagui/theme 1.89.26 → 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.
- package/dist/cjs/_mutateTheme.native.js +156 -53
- package/dist/cjs/_mutateTheme.native.js.map +3 -3
- package/dist/cjs/addTheme.native.js +38 -1
- package/dist/cjs/addTheme.native.js.map +3 -3
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/cjs/replaceTheme.native.js +8 -5
- package/dist/cjs/replaceTheme.native.js.map +3 -3
- package/dist/cjs/updateTheme.native.js +8 -5
- package/dist/cjs/updateTheme.native.js.map +3 -3
- package/dist/esm/_mutateTheme.native.js +157 -62
- package/dist/esm/_mutateTheme.native.js.map +3 -3
- package/dist/esm/addTheme.native.js +38 -1
- package/dist/esm/addTheme.native.js.map +3 -3
- package/dist/esm/index.native.js.map +3 -3
- package/dist/esm/replaceTheme.native.js +8 -5
- package/dist/esm/replaceTheme.native.js.map +3 -3
- package/dist/esm/updateTheme.native.js +8 -5
- package/dist/esm/updateTheme.native.js.map +3 -3
- package/dist/jsx/_mutateTheme.native.js +157 -62
- package/dist/jsx/_mutateTheme.native.js.map +3 -3
- package/dist/jsx/addTheme.native.js +38 -1
- package/dist/jsx/addTheme.native.js.map +3 -3
- package/dist/jsx/index.native.js.map +3 -3
- package/dist/jsx/replaceTheme.native.js +8 -5
- package/dist/jsx/replaceTheme.native.js.map +3 -3
- package/dist/jsx/updateTheme.native.js +8 -5
- package/dist/jsx/updateTheme.native.js.map +3 -3
- package/package.json +4 -4
|
@@ -20,30 +20,123 @@ __export(mutateTheme_exports, {
|
|
|
20
20
|
});
|
|
21
21
|
module.exports = __toCommonJS(mutateTheme_exports);
|
|
22
22
|
var import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web"), import_react = require("react");
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
function _array_like_to_array(arr, len) {
|
|
24
|
+
(len == null || len > arr.length) && (len = arr.length);
|
|
25
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
26
|
+
arr2[i] = arr[i];
|
|
27
|
+
return arr2;
|
|
28
|
+
}
|
|
29
|
+
function _array_without_holes(arr) {
|
|
30
|
+
if (Array.isArray(arr))
|
|
31
|
+
return _array_like_to_array(arr);
|
|
32
|
+
}
|
|
33
|
+
function _define_property(obj, key, value) {
|
|
34
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
35
|
+
value,
|
|
36
|
+
enumerable: !0,
|
|
37
|
+
configurable: !0,
|
|
38
|
+
writable: !0
|
|
39
|
+
}) : obj[key] = value, obj;
|
|
40
|
+
}
|
|
41
|
+
function _iterable_to_array(iter) {
|
|
42
|
+
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
43
|
+
return Array.from(iter);
|
|
44
|
+
}
|
|
45
|
+
function _non_iterable_spread() {
|
|
46
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
47
|
+
}
|
|
48
|
+
function _object_spread(target) {
|
|
49
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
50
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
51
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
52
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
53
|
+
}))), ownKeys2.forEach(function(key) {
|
|
54
|
+
_define_property(target, key, source[key]);
|
|
39
55
|
});
|
|
40
|
-
res && (allThemesProxied[name] = res.theme, allThemesRaw[name] = res.themeRaw);
|
|
41
56
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
57
|
+
return target;
|
|
58
|
+
}
|
|
59
|
+
function ownKeys(object, enumerableOnly) {
|
|
60
|
+
var keys = Object.keys(object);
|
|
61
|
+
if (Object.getOwnPropertySymbols) {
|
|
62
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
63
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
64
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
65
|
+
})), keys.push.apply(keys, symbols);
|
|
66
|
+
}
|
|
67
|
+
return keys;
|
|
68
|
+
}
|
|
69
|
+
function _object_spread_props(target, source) {
|
|
70
|
+
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
71
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
72
|
+
}), target;
|
|
73
|
+
}
|
|
74
|
+
function _object_without_properties(source, excluded) {
|
|
75
|
+
if (source == null)
|
|
76
|
+
return {};
|
|
77
|
+
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
78
|
+
if (Object.getOwnPropertySymbols) {
|
|
79
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
80
|
+
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
81
|
+
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
82
|
+
}
|
|
83
|
+
return target;
|
|
84
|
+
}
|
|
85
|
+
function _object_without_properties_loose(source, excluded) {
|
|
86
|
+
if (source == null)
|
|
87
|
+
return {};
|
|
88
|
+
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
89
|
+
for (i = 0; i < sourceKeys.length; i++)
|
|
90
|
+
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
91
|
+
return target;
|
|
92
|
+
}
|
|
93
|
+
function _to_consumable_array(arr) {
|
|
94
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
95
|
+
}
|
|
96
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
97
|
+
if (o) {
|
|
98
|
+
if (typeof o == "string")
|
|
99
|
+
return _array_like_to_array(o, minLen);
|
|
100
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
101
|
+
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
|
|
102
|
+
return Array.from(n);
|
|
103
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
104
|
+
return _array_like_to_array(o, minLen);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function mutateThemes(_param) {
|
|
108
|
+
var themes = _param.themes, batch = _param.batch, _param_insertCSS = _param.insertCSS, insertCSS = _param_insertCSS === void 0 ? !0 : _param_insertCSS, props = _object_without_properties(_param, [
|
|
109
|
+
"themes",
|
|
110
|
+
"batch",
|
|
111
|
+
"insertCSS"
|
|
112
|
+
]), allThemesProxied = {}, allThemesRaw = {}, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
113
|
+
try {
|
|
114
|
+
for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
115
|
+
var _step_value = _step.value, name = _step_value.name, theme = _step_value.theme, res = _mutateTheme(_object_spread_props(_object_spread({}, props), {
|
|
116
|
+
name,
|
|
117
|
+
theme,
|
|
118
|
+
// we'll do one update at the end
|
|
119
|
+
avoidUpdate: !0,
|
|
120
|
+
// always add which also replaces but doesnt fail first time
|
|
121
|
+
mutationType: "add"
|
|
122
|
+
}));
|
|
123
|
+
res && (allThemesProxied[name] = res.theme, allThemesRaw[name] = res.themeRaw);
|
|
124
|
+
}
|
|
125
|
+
} catch (err) {
|
|
126
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
127
|
+
} finally {
|
|
128
|
+
try {
|
|
129
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
130
|
+
} finally {
|
|
131
|
+
if (_didIteratorError)
|
|
132
|
+
throw _iteratorError;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
var cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
|
|
136
|
+
return (0, import_react.startTransition)(function() {
|
|
137
|
+
for (var themeName in allThemesProxied) {
|
|
138
|
+
var theme2 = allThemesProxied[themeName];
|
|
139
|
+
updateThemeConfig(themeName, theme2), notifyThemeManagersOfUpdate(themeName, theme2);
|
|
47
140
|
}
|
|
48
141
|
}), {
|
|
49
142
|
themes: allThemesProxied,
|
|
@@ -56,54 +149,64 @@ function _mutateTheme(props) {
|
|
|
56
149
|
process.env.NODE_ENV === "development" && console.warn("Theme mutation is not supported on server side");
|
|
57
150
|
return;
|
|
58
151
|
}
|
|
59
|
-
|
|
152
|
+
var config = (0, import_web.getConfig)(), themeName = props.name, themeIn = props.theme, insertCSS = props.insertCSS, mutationType = props.mutationType;
|
|
60
153
|
if (process.env.NODE_ENV === "development") {
|
|
61
154
|
if (!config)
|
|
62
155
|
throw new Error("No config");
|
|
63
|
-
|
|
64
|
-
if (mutationType !== "add" && !
|
|
65
|
-
throw new Error(
|
|
66
|
-
`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`
|
|
67
|
-
);
|
|
156
|
+
var theme = config.themes[props.name];
|
|
157
|
+
if (mutationType !== "add" && !theme)
|
|
158
|
+
throw new Error("".concat(mutationType === "replace" ? "Replace" : "Update", " theme failed! Theme ").concat(props.name, " does not exist"));
|
|
68
159
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
(0, import_web.ensureThemeVariable)(theme, key);
|
|
75
|
-
const themeProxied = (0, import_web.proxyThemeToParents)(themeName, theme), response = {
|
|
76
|
-
themeRaw: theme,
|
|
160
|
+
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);
|
|
161
|
+
for (var key in theme1)
|
|
162
|
+
(0, import_web.ensureThemeVariable)(theme1, key);
|
|
163
|
+
var themeProxied = (0, import_web.proxyThemeToParents)(themeName, theme1), response = {
|
|
164
|
+
themeRaw: theme1,
|
|
77
165
|
theme: themeProxied,
|
|
78
166
|
cssRules: []
|
|
79
167
|
};
|
|
80
|
-
return props.avoidUpdate || (insertCSS && (response.cssRules = insertThemeCSS({
|
|
81
|
-
[themeName]: theme
|
|
82
|
-
})), updateThemeConfig(themeName, themeProxied), notifyThemeManagersOfUpdate(themeName, themeProxied)), response;
|
|
168
|
+
return props.avoidUpdate || (insertCSS && (response.cssRules = insertThemeCSS(_define_property({}, themeName, theme1))), updateThemeConfig(themeName, themeProxied), notifyThemeManagersOfUpdate(themeName, themeProxied)), response;
|
|
83
169
|
}
|
|
84
170
|
function updateThemeConfig(themeName, theme) {
|
|
85
|
-
|
|
171
|
+
var config = (0, import_web.getConfig)();
|
|
86
172
|
config.themes[themeName] = theme, (0, import_web.updateConfig)("themes", config.themes);
|
|
87
173
|
}
|
|
88
174
|
function notifyThemeManagersOfUpdate(themeName, theme) {
|
|
89
|
-
import_web.activeThemeManagers.forEach((manager)
|
|
90
|
-
manager.state.name === themeName && manager.updateStateFromProps(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
!0
|
|
96
|
-
);
|
|
175
|
+
import_web.activeThemeManagers.forEach(function(manager) {
|
|
176
|
+
manager.state.name === themeName && manager.updateStateFromProps({
|
|
177
|
+
name: themeName,
|
|
178
|
+
forceTheme: theme
|
|
179
|
+
}, !0);
|
|
97
180
|
});
|
|
98
181
|
}
|
|
99
|
-
function insertThemeCSS(themes
|
|
182
|
+
function insertThemeCSS(themes) {
|
|
183
|
+
var batch = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
100
184
|
return [];
|
|
185
|
+
var config, cssRules;
|
|
186
|
+
for (var themeName in themes) {
|
|
187
|
+
var theme = themes[themeName], rules = (0, import_web.getThemeCSSRules)({
|
|
188
|
+
config,
|
|
189
|
+
themeName,
|
|
190
|
+
names: [
|
|
191
|
+
themeName
|
|
192
|
+
],
|
|
193
|
+
hasDarkLight: !0,
|
|
194
|
+
theme
|
|
195
|
+
});
|
|
196
|
+
cssRules = _to_consumable_array(cssRules).concat(_to_consumable_array(rules)), batch || updateStyle("t_theme_style_".concat(themeName), rules);
|
|
197
|
+
}
|
|
198
|
+
if (batch) {
|
|
199
|
+
var id;
|
|
200
|
+
updateStyle("t_theme_style_".concat(id), cssRules);
|
|
201
|
+
}
|
|
101
202
|
}
|
|
102
203
|
function updateStyle(id, rules) {
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
204
|
+
var existing = document.querySelector("#".concat(id)), style = document.createElement("style");
|
|
205
|
+
if (style.id = id, style.appendChild(document.createTextNode(rules.join(`
|
|
206
|
+
`))), document.head.appendChild(style), existing) {
|
|
207
|
+
var _existing_parentElement;
|
|
208
|
+
(_existing_parentElement = existing.parentElement) === null || _existing_parentElement === void 0 || _existing_parentElement.removeChild(existing);
|
|
209
|
+
}
|
|
107
210
|
}
|
|
108
211
|
// Annotate the CommonJS export names for ESM import in node:
|
|
109
212
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/_mutateTheme.ts"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["theme"]
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/theme/src/_mutateTheme.ts"],
|
|
4
|
+
"mappings":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QAAQ,SAACC,SAAAA;AAC3B,IAAIA,QAAQC,MAAMjC,SAASU,aACzBsB,QAAQE,qBACN;MACElC,MAAMU;MACNyB,YAAYlC;IACd,GACA,EAAA;EAGN,CAAA;AACF;AAEA,SAASO,eAAed,QAAoC;MAAEC,QAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAe;AAEzE,SAAO,CAAA;AAGT,MAAMyB,QACFb;AAEJ,WAAWG,aAAahB,QAAQ;AAC9B,QAAMO,QAAQP,OAAOgB,SAAAA,GAEf0B,YAAQC,6BAAiB;MAC7BjB;MACAV;MACA4B,OAAO;QAAC5B;;MACR6B,cAAc;MACdtC;IACF,CAAA;AAEAM,eAAY,qBAAGA,QAAAA,EAAAA,OAAU,qBAAG6B,KAAAA,CAAAA,GAEvBzC,SACH6C,YAAa,iBAA0B,OAAV9B,SAAAA,GAAa0B,KAAAA;EAE9C;AAEA,MAAIzC,OAAO;AACT,QAAM8C;AACND,gBAAa,iBAAmB,OAAHC,EAAAA,GAAMlC,QAAAA;EACrC;AAGF;AAEA,SAASiC,YAAYC,IAAYL,OAAe;AAC9C,MAAMM,WAAWC,SAASC,cAAe,IAAM,OAAHH,EAAAA,CAAAA,GACtCI,QAAQF,SAASG,cAAc,OAAA;AAIrC,MAHAD,MAAMJ,KAAKA,IACXI,MAAME,YAAYJ,SAASK,eAAeZ,MAAMa,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": ["mutateThemes", "themes", "batch", "insertCSS", "props", "allThemesProxied", "allThemesRaw", "name", "theme", "res", "_mutateTheme", "avoidUpdate", "mutationType", "themeRaw", "cssRules", "insertThemeCSS", "startTransition", "themeName", "updateThemeConfig", "notifyThemeManagersOfUpdate", "themesRaw", "isServer", "process", "env", "NODE_ENV", "console", "warn", "config", "getConfig", "themeIn", "Error", "key", "ensureThemeVariable", "themeProxied", "proxyThemeToParents", "response", "updateConfig", "activeThemeManagers", "forEach", "manager", "state", "updateStateFromProps", "forceTheme", "rules", "getThemeCSSRules", "names", "hasDarkLight", "updateStyle", "id", "existing", "document", "querySelector", "style", "createElement", "appendChild", "createTextNode", "join", "head", "parentElement", "removeChild"]
|
|
6
6
|
}
|
|
@@ -19,8 +19,45 @@ __export(addTheme_exports, {
|
|
|
19
19
|
});
|
|
20
20
|
module.exports = __toCommonJS(addTheme_exports);
|
|
21
21
|
var import_mutateTheme = require("./_mutateTheme");
|
|
22
|
+
function _define_property(obj, key, value) {
|
|
23
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
24
|
+
value,
|
|
25
|
+
enumerable: !0,
|
|
26
|
+
configurable: !0,
|
|
27
|
+
writable: !0
|
|
28
|
+
}) : obj[key] = value, obj;
|
|
29
|
+
}
|
|
30
|
+
function _object_spread(target) {
|
|
31
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
32
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
33
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
34
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
35
|
+
}))), ownKeys2.forEach(function(key) {
|
|
36
|
+
_define_property(target, key, source[key]);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return target;
|
|
40
|
+
}
|
|
41
|
+
function ownKeys(object, enumerableOnly) {
|
|
42
|
+
var keys = Object.keys(object);
|
|
43
|
+
if (Object.getOwnPropertySymbols) {
|
|
44
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
45
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
46
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
47
|
+
})), keys.push.apply(keys, symbols);
|
|
48
|
+
}
|
|
49
|
+
return keys;
|
|
50
|
+
}
|
|
51
|
+
function _object_spread_props(target, source) {
|
|
52
|
+
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
53
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
54
|
+
}), target;
|
|
55
|
+
}
|
|
22
56
|
function addTheme(props) {
|
|
23
|
-
return (0, import_mutateTheme._mutateTheme)({
|
|
57
|
+
return (0, import_mutateTheme._mutateTheme)(_object_spread_props(_object_spread({}, props), {
|
|
58
|
+
insertCSS: !0,
|
|
59
|
+
mutationType: "add"
|
|
60
|
+
}));
|
|
24
61
|
}
|
|
25
62
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
63
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/addTheme.ts"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/theme/src/addTheme.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAEA,yBAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtB,SAASA,SAASC,OAIxB;AACC,aAAOC,iCAAa,qBAAA,eAAA,CAAA,GAAKD,KAAAA,GAAAA;IAAOE,WAAW;IAAMC,cAAc;;AACjE;",
|
|
5
|
+
"names": ["addTheme", "props", "_mutateTheme", "insertCSS", "mutationType"]
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/theme/src/index.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;wBAAc,uBAAd;AACA,wBAAc,0BADd;AAEA,wBAAc,2BAFd;AAGA,yBAA6B;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -19,11 +19,14 @@ __export(replaceTheme_exports, {
|
|
|
19
19
|
});
|
|
20
20
|
module.exports = __toCommonJS(replaceTheme_exports);
|
|
21
21
|
var import_mutateTheme = require("./_mutateTheme");
|
|
22
|
-
function replaceTheme({
|
|
23
|
-
name,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
function replaceTheme(param) {
|
|
23
|
+
var name = param.name, theme = param.theme, next = (0, import_mutateTheme._mutateTheme)({
|
|
24
|
+
name,
|
|
25
|
+
theme,
|
|
26
|
+
insertCSS: !0,
|
|
27
|
+
mutationType: "replace"
|
|
28
|
+
});
|
|
29
|
+
return next;
|
|
27
30
|
}
|
|
28
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
32
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/replaceTheme.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/theme/src/replaceTheme.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAEA;;;;;yBAA6B;AAEtB,SAASA,aAAa,OAM5B;MALCC,OAD2B,MAC3BA,MACAC,QAF2B,MAE3BA,OAKMC,WAAOC,iCAAa;IAAEH;IAAMC;IAAOG,WAAW;IAAMC,cAAc;EAAU,CAAA;AAClF,SAAOH;AACT;",
|
|
5
|
+
"names": ["replaceTheme", "name", "theme", "next", "_mutateTheme", "insertCSS", "mutationType"]
|
|
6
6
|
}
|
|
@@ -19,11 +19,14 @@ __export(updateTheme_exports, {
|
|
|
19
19
|
});
|
|
20
20
|
module.exports = __toCommonJS(updateTheme_exports);
|
|
21
21
|
var import_mutateTheme = require("./_mutateTheme");
|
|
22
|
-
function updateTheme({
|
|
23
|
-
name,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
function updateTheme(param) {
|
|
23
|
+
var name = param.name, theme = param.theme;
|
|
24
|
+
return (0, import_mutateTheme._mutateTheme)({
|
|
25
|
+
name,
|
|
26
|
+
theme,
|
|
27
|
+
insertCSS: !0,
|
|
28
|
+
mutationType: "update"
|
|
29
|
+
});
|
|
27
30
|
}
|
|
28
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
32
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/updateTheme.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/theme/src/updateTheme.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAEA;;;;;yBAA6B;AAEtB,SAASA,YAAY,OAM3B;MALCC,OAD0B,MAC1BA,MACAC,QAF0B,MAE1BA;AAKA,aAAOC,iCAAa;IAAEF;IAAMC;IAAOE,WAAW;IAAMC,cAAc;EAAS,CAAA;AAC7E;",
|
|
5
|
+
"names": ["updateTheme", "name", "theme", "_mutateTheme", "insertCSS", "mutationType"]
|
|
6
6
|
}
|