@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.
- package/dist/cjs/_mutateTheme.cjs +68 -63
- package/dist/cjs/_mutateTheme.native.js +73 -94
- package/dist/cjs/_mutateTheme.native.js.map +1 -1
- package/dist/cjs/addTheme.cjs +13 -11
- package/dist/cjs/addTheme.native.js +13 -11
- package/dist/cjs/addTheme.native.js.map +1 -1
- package/dist/cjs/index.cjs +13 -11
- package/dist/cjs/index.native.js +13 -11
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/replaceTheme.cjs +15 -12
- package/dist/cjs/replaceTheme.native.js +21 -19
- package/dist/cjs/replaceTheme.native.js.map +1 -1
- package/dist/cjs/updateTheme.cjs +13 -11
- package/dist/cjs/updateTheme.native.js +13 -11
- package/dist/cjs/updateTheme.native.js.map +1 -1
- package/dist/esm/_mutateTheme.mjs +53 -50
- package/dist/esm/_mutateTheme.mjs.map +1 -1
- package/dist/esm/_mutateTheme.native.js +58 -81
- package/dist/esm/_mutateTheme.native.js.map +1 -1
- package/dist/esm/addTheme.mjs +1 -1
- package/dist/esm/addTheme.native.js +1 -1
- package/dist/esm/index.js +5 -7
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/replaceTheme.mjs +3 -2
- package/dist/esm/replaceTheme.mjs.map +1 -1
- package/dist/esm/replaceTheme.native.js +9 -9
- package/dist/esm/replaceTheme.native.js.map +1 -1
- package/dist/esm/updateTheme.mjs +1 -1
- package/dist/esm/updateTheme.native.js +1 -1
- package/package.json +8 -11
- package/dist/cjs/_mutateTheme.js +0 -121
- package/dist/cjs/_mutateTheme.js.map +0 -6
- package/dist/cjs/addTheme.js +0 -24
- package/dist/cjs/addTheme.js.map +0 -6
- package/dist/cjs/index.js +0 -24
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/replaceTheme.js +0 -27
- package/dist/cjs/replaceTheme.js.map +0 -6
- package/dist/cjs/updateTheme.js +0 -27
- package/dist/cjs/updateTheme.js.map +0 -6
- package/dist/esm/_mutateTheme.js +0 -116
- package/dist/esm/_mutateTheme.js.map +0 -6
- package/dist/esm/addTheme.js +0 -8
- package/dist/esm/addTheme.js.map +0 -6
- package/dist/esm/replaceTheme.js +0 -11
- package/dist/esm/replaceTheme.js.map +0 -6
- package/dist/esm/updateTheme.js +0 -11
- 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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
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
|
-
|
|
29
|
-
|
|
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 =
|
|
35
|
+
insertCSS = true,
|
|
34
36
|
...props
|
|
35
37
|
}) {
|
|
36
|
-
const allThemesProxied = {}
|
|
37
|
-
|
|
38
|
+
const allThemesProxied = {};
|
|
39
|
+
const allThemesRaw = {};
|
|
38
40
|
for (const {
|
|
39
41
|
name,
|
|
40
42
|
theme
|
|
@@ -43,21 +45,23 @@ function mutateThemes({
|
|
|
43
45
|
...props,
|
|
44
46
|
name,
|
|
45
47
|
theme,
|
|
46
|
-
|
|
47
|
-
avoidUpdate: !0,
|
|
48
|
-
// always add which also replaces but doesnt fail first time
|
|
48
|
+
avoidUpdate: true,
|
|
49
49
|
mutationType: "add"
|
|
50
50
|
});
|
|
51
|
-
|
|
51
|
+
if (res) {
|
|
52
|
+
allThemesProxied[name] = res.theme;
|
|
53
|
+
allThemesRaw[name] = res.themeRaw;
|
|
54
|
+
}
|
|
52
55
|
}
|
|
53
56
|
const cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
|
|
54
|
-
|
|
57
|
+
(0, import_start_transition.startTransition)(() => {
|
|
55
58
|
for (const themeName in allThemesProxied) {
|
|
56
59
|
const theme = allThemesProxied[themeName];
|
|
57
60
|
updateThemeConfig(themeName, theme);
|
|
58
61
|
}
|
|
59
62
|
updateThemeStates();
|
|
60
|
-
})
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
61
65
|
themes: allThemesProxied,
|
|
62
66
|
themesRaw: allThemesRaw,
|
|
63
67
|
cssRules
|
|
@@ -65,16 +69,16 @@ function mutateThemes({
|
|
|
65
69
|
}
|
|
66
70
|
function _mutateTheme(props) {
|
|
67
71
|
if (import_constants.isServer) {
|
|
68
|
-
process.env.NODE_ENV === "development"
|
|
72
|
+
if (process.env.NODE_ENV === "development") console.warn("Theme mutation is not supported on server side");
|
|
69
73
|
return;
|
|
70
74
|
}
|
|
71
|
-
const config = (0, import_web.getConfig)()
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
const config = (0, import_web.getConfig)();
|
|
76
|
+
const {
|
|
77
|
+
name: themeName,
|
|
78
|
+
theme: themeIn,
|
|
79
|
+
insertCSS,
|
|
80
|
+
mutationType
|
|
81
|
+
} = props;
|
|
78
82
|
if (process.env.NODE_ENV === "development") {
|
|
79
83
|
if (!config) throw new Error("No config");
|
|
80
84
|
const theme2 = config.themes[props.name];
|
|
@@ -85,52 +89,53 @@ function _mutateTheme(props) {
|
|
|
85
89
|
...themeIn
|
|
86
90
|
};
|
|
87
91
|
for (const key in theme) (0, import_web.ensureThemeVariable)(theme, key);
|
|
88
|
-
const themeProxied = (0, import_web.proxyThemeToParents)(themeName, theme)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
const themeProxied = (0, import_web.proxyThemeToParents)(themeName, theme);
|
|
93
|
+
const response = {
|
|
94
|
+
themeRaw: theme,
|
|
95
|
+
theme: themeProxied,
|
|
96
|
+
cssRules: []
|
|
97
|
+
};
|
|
98
|
+
if (props.avoidUpdate) return response;
|
|
99
|
+
if (insertCSS) response.cssRules = insertThemeCSS({
|
|
95
100
|
[themeName]: theme
|
|
96
|
-
})
|
|
101
|
+
});
|
|
102
|
+
updateThemeConfig(themeName, themeProxied);
|
|
103
|
+
updateThemeStates();
|
|
104
|
+
return response;
|
|
97
105
|
}
|
|
98
106
|
function updateThemeConfig(themeName, theme) {
|
|
99
107
|
const config = (0, import_web.getConfig)();
|
|
100
|
-
config.themes[themeName] = theme
|
|
108
|
+
config.themes[themeName] = theme;
|
|
109
|
+
(0, import_web.updateConfig)("themes", config.themes);
|
|
101
110
|
}
|
|
102
111
|
function updateThemeStates() {
|
|
103
112
|
(0, import_web.forceUpdateThemes)();
|
|
104
113
|
}
|
|
105
|
-
function insertThemeCSS(themes, batch =
|
|
114
|
+
function insertThemeCSS(themes, batch = false) {
|
|
106
115
|
const config = (0, import_web.getConfig)();
|
|
107
116
|
let cssRules = [];
|
|
108
117
|
for (const themeName in themes) {
|
|
109
|
-
const theme = themes[themeName]
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
if (import_web.mutatedAutoVariables.length > 0) {
|
|
122
|
-
const autoVarCSS = `:root{${import_web.mutatedAutoVariables.map(v => `--${v.name}:${v.val}`).join(";")}}`;
|
|
123
|
-
updateStyle("t_mutate_vars", [autoVarCSS]);
|
|
124
|
-
}
|
|
125
|
-
if (batch) {
|
|
126
|
-
const id = typeof batch == "string" ? batch : (0, import_web.simpleHash)(Object.keys(themes).join(""));
|
|
127
|
-
updateStyle(`t_theme_style_${id}`, cssRules);
|
|
118
|
+
const theme = themes[themeName];
|
|
119
|
+
const rules = (0, import_web.getThemeCSSRules)({
|
|
120
|
+
config,
|
|
121
|
+
themeName,
|
|
122
|
+
names: [themeName],
|
|
123
|
+
hasDarkLight: true,
|
|
124
|
+
theme,
|
|
125
|
+
useMutatedVariables: true
|
|
126
|
+
});
|
|
127
|
+
cssRules = [...cssRules, ...rules];
|
|
128
|
+
if (!batch) updateStyle(`t_theme_style_${themeName}`, rules);
|
|
128
129
|
}
|
|
130
|
+
if (import_web.mutatedAutoVariables.length > 0) updateStyle(`t_mutate_vars`, [`:root{${import_web.mutatedAutoVariables.map(v => `--${v.name}:${v.val}`).join(";")}}`]);
|
|
131
|
+
if (batch) updateStyle(`t_theme_style_${typeof batch == "string" ? batch : (0, import_web.simpleHash)(Object.keys(themes).join(""))}`, cssRules);
|
|
129
132
|
return cssRules;
|
|
130
133
|
}
|
|
131
134
|
function updateStyle(id, rules) {
|
|
132
|
-
const existing = document.querySelector(`#${id}`)
|
|
133
|
-
|
|
134
|
-
style.id = id
|
|
135
|
-
|
|
135
|
+
const existing = document.querySelector(`#${id}`);
|
|
136
|
+
const style = document.createElement("style");
|
|
137
|
+
style.id = id;
|
|
138
|
+
style.appendChild(document.createTextNode(rules.join("\n")));
|
|
139
|
+
document.head.appendChild(style);
|
|
140
|
+
if (existing) existing.parentElement?.removeChild(existing);
|
|
136
141
|
}
|
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
23
|
+
value: true
|
|
22
24
|
}), mod);
|
|
23
25
|
var mutateTheme_exports = {};
|
|
24
26
|
__export(mutateTheme_exports, {
|
|
@@ -26,55 +28,58 @@ __export(mutateTheme_exports, {
|
|
|
26
28
|
mutateThemes: () => mutateThemes
|
|
27
29
|
});
|
|
28
30
|
module.exports = __toCommonJS(mutateTheme_exports);
|
|
29
|
-
var import_constants = require("@tamagui/constants")
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_didIteratorError =
|
|
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 =
|
|
47
|
+
for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
46
48
|
var {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
name,
|
|
50
|
+
theme
|
|
51
|
+
} = _step.value;
|
|
52
|
+
var res = _mutateTheme({
|
|
53
|
+
...props,
|
|
54
|
+
name,
|
|
55
|
+
theme,
|
|
56
|
+
avoidUpdate: true,
|
|
57
|
+
mutationType: "add"
|
|
58
|
+
});
|
|
59
|
+
if (res) {
|
|
60
|
+
allThemesProxied[name] = res.theme;
|
|
61
|
+
allThemesRaw[name] = res.themeRaw;
|
|
62
|
+
}
|
|
60
63
|
}
|
|
61
64
|
} catch (err) {
|
|
62
|
-
_didIteratorError =
|
|
65
|
+
_didIteratorError = true;
|
|
66
|
+
_iteratorError = err;
|
|
63
67
|
} finally {
|
|
64
68
|
try {
|
|
65
|
-
!_iteratorNormalCompletion && _iterator.return != null
|
|
69
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
66
70
|
} finally {
|
|
67
71
|
if (_didIteratorError) throw _iteratorError;
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
var cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
|
|
71
|
-
|
|
75
|
+
(0, import_start_transition.startTransition)(function () {
|
|
72
76
|
for (var themeName in allThemesProxied) {
|
|
73
77
|
var theme2 = allThemesProxied[themeName];
|
|
74
78
|
updateThemeConfig(themeName, theme2);
|
|
75
79
|
}
|
|
76
80
|
updateThemeStates();
|
|
77
|
-
})
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
78
83
|
themes: allThemesProxied,
|
|
79
84
|
themesRaw: allThemesRaw,
|
|
80
85
|
cssRules
|
|
@@ -82,77 +87,51 @@ function mutateThemes(param) {
|
|
|
82
87
|
}
|
|
83
88
|
function _mutateTheme(props) {
|
|
84
89
|
if (import_constants.isServer) {
|
|
85
|
-
process.env.NODE_ENV === "development"
|
|
90
|
+
if (process.env.NODE_ENV === "development") console.warn("Theme mutation is not supported on server side");
|
|
86
91
|
return;
|
|
87
92
|
}
|
|
88
|
-
var config = (0, import_web.getConfig)()
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
var config = (0, import_web.getConfig)();
|
|
94
|
+
var {
|
|
95
|
+
name: themeName,
|
|
96
|
+
theme: themeIn,
|
|
97
|
+
insertCSS,
|
|
98
|
+
mutationType
|
|
99
|
+
} = props;
|
|
95
100
|
if (process.env.NODE_ENV === "development") {
|
|
96
101
|
if (!config) throw new Error("No config");
|
|
97
102
|
var theme = config.themes[props.name];
|
|
98
103
|
if (mutationType !== "add" && !theme) throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
|
|
99
104
|
}
|
|
100
|
-
var _config_themes_themeName
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
var _config_themes_themeName;
|
|
106
|
+
var theme1 = {
|
|
107
|
+
...(mutationType === "update" ? (_config_themes_themeName = config.themes[themeName]) !== null && _config_themes_themeName !== void 0 ? _config_themes_themeName : {} : {}),
|
|
108
|
+
...themeIn
|
|
109
|
+
};
|
|
105
110
|
for (var key in theme1) (0, import_web.ensureThemeVariable)(theme1, key);
|
|
106
|
-
var themeProxied = (0, import_web.proxyThemeToParents)(themeName, theme1)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
var themeProxied = (0, import_web.proxyThemeToParents)(themeName, theme1);
|
|
112
|
+
var response = {
|
|
113
|
+
themeRaw: theme1,
|
|
114
|
+
theme: themeProxied,
|
|
115
|
+
cssRules: []
|
|
116
|
+
};
|
|
117
|
+
if (props.avoidUpdate) return response;
|
|
118
|
+
if (insertCSS) response.cssRules = insertThemeCSS({
|
|
113
119
|
[themeName]: theme1
|
|
114
|
-
})
|
|
120
|
+
});
|
|
121
|
+
updateThemeConfig(themeName, themeProxied);
|
|
122
|
+
updateThemeStates();
|
|
123
|
+
return response;
|
|
115
124
|
}
|
|
116
125
|
function updateThemeConfig(themeName, theme) {
|
|
117
126
|
var config = (0, import_web.getConfig)();
|
|
118
|
-
config.themes[themeName] = theme
|
|
127
|
+
config.themes[themeName] = theme;
|
|
128
|
+
(0, import_web.updateConfig)("themes", config.themes);
|
|
119
129
|
}
|
|
120
130
|
function updateThemeStates() {
|
|
121
131
|
(0, import_web.forceUpdateThemes)();
|
|
122
132
|
}
|
|
123
133
|
function insertThemeCSS(themes) {
|
|
124
|
-
|
|
134
|
+
arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
|
|
125
135
|
return [];
|
|
126
|
-
var config, cssRules;
|
|
127
|
-
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);
|
|
139
|
-
}
|
|
140
|
-
if (import_web.mutatedAutoVariables.length > 0) {
|
|
141
|
-
var autoVarCSS;
|
|
142
|
-
updateStyle("t_mutate_vars", [autoVarCSS]);
|
|
143
|
-
}
|
|
144
|
-
if (batch) {
|
|
145
|
-
var id;
|
|
146
|
-
updateStyle(`t_theme_style_${id}`, cssRules);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
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) {
|
|
154
|
-
var _existing_parentElement;
|
|
155
|
-
(_existing_parentElement = existing.parentElement) === null || _existing_parentElement === void 0 || _existing_parentElement.removeChild(existing);
|
|
156
|
-
}
|
|
157
136
|
}
|
|
158
137
|
//# 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"
|
|
1
|
+
{"version":3,"names":["to","__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"],"sources":["../../src/_mutateTheme.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;EAAA;EAAA,OAAAA,EAAA;AAAA;AAAA,IAAAC,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,mBAAA;AAAAC,QAAA,CAAAD,mBAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAA,YAAyB;EACzBC,YAAA,EAAAA,CAAA,KAAAA;AAEA;AA4BOC,MAAA,CAAAC,OAAS,GAAAV,YAAa,CAAAK,mBAAA;AAAA,IAC3BM,gBAAA,GAAAC,OAAA;AAAA,IACAC,uBAAA,GAAAD,OAAA;AA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B,YAAe;EAAAhB,iBACvB,CAAG;EAAA,OACdkB,QAAA;AAAA;AAGH,SAAAnB,iBAAkBA,CAAAF,SAAW,EAAAV,KAAY;EACzC,IAAAqB,MAAA,OAAAvC,UAAkB,CAAAwC,SAAA;EAElBD,MAAA,CAAArC,MAAO,CAAA0B,SAAA,IAAAV,KAAA;EACT,IAAAlB,UAAA,CAAAkD,YAAA,YAAAX,MAAA,CAAArC,MAAA;AAEA;AACE,SAAM6B,iBAASA,CAAA;EACf,IAAA/B,UAAO,CAAOmD,iBAAa;AAC3B;AACF,SAAAzB,eAAAxB,MAAA;EAEAkD,SAAS,CAAAC,MAAA,QAAAD,SAAoB,kBAAAA,SAAA;EAC3B;AACF","ignoreList":[]}
|
package/dist/cjs/addTheme.cjs
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
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:
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
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:
|
|
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":"
|
|
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":[]}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,21 +3,23 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
21
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
20
|
-
value:
|
|
22
|
+
value: true
|
|
21
23
|
}), mod);
|
|
22
24
|
var index_exports = {};
|
|
23
25
|
__export(index_exports, {
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -5,21 +5,23 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
23
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
22
|
-
value:
|
|
24
|
+
value: true
|
|
23
25
|
}), mod);
|
|
24
26
|
var index_exports = {};
|
|
25
27
|
__export(index_exports, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","mutateThemes","import_mutateTheme","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","mutateThemes","import_mutateTheme","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAC,kBAAA,CAAAD;AAAA;AAAAE,MAAA,CAAAC,OAAA,GAAAV,YAAc,CAAAK,aAAA;AACdM,UAAA,CAAAN,aAAA,EAAcO,OAAA,0BAAAH,MADd,CAAAC,OAAA;AAEAC,UAAA,CAAAN,aAAA,EAAcO,OAAA,6BAAAH,MAFd,CAAAC,OAAA;AAGAC,UAAA,CAAAN,aAAA,EAA6BO,OAAA,8BAAAH,MAAA,CAAAC,OAAA","ignoreList":[]}
|