@hanzogui/theme 3.0.5 → 4.3.1
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 +91 -58
- package/dist/cjs/_mutateTheme.native.js +128 -89
- 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 +76 -45
- package/dist/esm/_mutateTheme.mjs.map +1 -1
- package/dist/esm/_mutateTheme.native.js +113 -76
- 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/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 +5 -5
- package/src/_mutateTheme.ts +1 -1
|
@@ -3,50 +3,59 @@ import { startTransition } from "@hanzogui/start-transition";
|
|
|
3
3
|
import { ensureThemeVariable, forceUpdateThemes, getConfig, getThemeCSSRules, mutatedAutoVariables, proxyThemeToParents, simpleHash, updateConfig } from "@hanzogui/web";
|
|
4
4
|
function mutateThemes(param) {
|
|
5
5
|
var {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
_didIteratorError =
|
|
6
|
+
themes,
|
|
7
|
+
batch,
|
|
8
|
+
insertCSS = true,
|
|
9
|
+
...props
|
|
10
|
+
} = param;
|
|
11
|
+
var allThemesProxied = {};
|
|
12
|
+
var allThemesRaw = {};
|
|
13
|
+
var _iteratorNormalCompletion = true,
|
|
14
|
+
_didIteratorError = false,
|
|
15
15
|
_iteratorError = void 0;
|
|
16
16
|
try {
|
|
17
|
-
for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion =
|
|
17
|
+
for (var _iterator = themes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
18
18
|
var {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
name,
|
|
20
|
+
theme
|
|
21
|
+
} = _step.value;
|
|
22
|
+
var res = _mutateTheme({
|
|
23
|
+
...props,
|
|
24
|
+
name,
|
|
25
|
+
theme,
|
|
26
|
+
// we'll do one update at the end
|
|
27
|
+
avoidUpdate: true,
|
|
28
|
+
// always add which also replaces but doesnt fail first time
|
|
29
|
+
mutationType: "add"
|
|
30
|
+
});
|
|
31
|
+
if (res) {
|
|
32
|
+
allThemesProxied[name] = res.theme;
|
|
33
|
+
allThemesRaw[name] = res.themeRaw;
|
|
34
|
+
}
|
|
32
35
|
}
|
|
33
36
|
} catch (err) {
|
|
34
|
-
_didIteratorError =
|
|
37
|
+
_didIteratorError = true;
|
|
38
|
+
_iteratorError = err;
|
|
35
39
|
} finally {
|
|
36
40
|
try {
|
|
37
|
-
!_iteratorNormalCompletion && _iterator.return != null
|
|
41
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
42
|
+
_iterator.return();
|
|
43
|
+
}
|
|
38
44
|
} finally {
|
|
39
|
-
if (_didIteratorError)
|
|
45
|
+
if (_didIteratorError) {
|
|
46
|
+
throw _iteratorError;
|
|
47
|
+
}
|
|
40
48
|
}
|
|
41
49
|
}
|
|
42
50
|
var cssRules = insertCSS ? insertThemeCSS(allThemesRaw, batch) : [];
|
|
43
|
-
|
|
51
|
+
startTransition(function () {
|
|
44
52
|
for (var themeName in allThemesProxied) {
|
|
45
53
|
var theme2 = allThemesProxied[themeName];
|
|
46
54
|
updateThemeConfig(themeName, theme2);
|
|
47
55
|
}
|
|
48
56
|
updateThemeStates();
|
|
49
|
-
})
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
50
59
|
themes: allThemesProxied,
|
|
51
60
|
themesRaw: allThemesRaw,
|
|
52
61
|
cssRules
|
|
@@ -54,77 +63,105 @@ function mutateThemes(param) {
|
|
|
54
63
|
}
|
|
55
64
|
function _mutateTheme(props) {
|
|
56
65
|
if (isServer) {
|
|
57
|
-
process.env.NODE_ENV === "development"
|
|
66
|
+
if (process.env.NODE_ENV === "development") {
|
|
67
|
+
console.warn("Theme mutation is not supported on server side");
|
|
68
|
+
}
|
|
58
69
|
return;
|
|
59
70
|
}
|
|
60
|
-
var config = getConfig()
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
var config = getConfig();
|
|
72
|
+
var {
|
|
73
|
+
name: themeName,
|
|
74
|
+
theme: themeIn,
|
|
75
|
+
insertCSS,
|
|
76
|
+
mutationType
|
|
77
|
+
} = props;
|
|
67
78
|
if (process.env.NODE_ENV === "development") {
|
|
68
|
-
if (!config)
|
|
79
|
+
if (!config) {
|
|
80
|
+
throw new Error("No config");
|
|
81
|
+
}
|
|
69
82
|
var theme = config.themes[props.name];
|
|
70
|
-
if (mutationType !== "add" && !theme)
|
|
83
|
+
if (mutationType !== "add" && !theme) {
|
|
84
|
+
throw new Error(`${mutationType === "replace" ? "Replace" : "Update"} theme failed! Theme ${props.name} does not exist`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
var _config_themes_themeName;
|
|
88
|
+
var theme1 = {
|
|
89
|
+
...(mutationType === "update" ? (_config_themes_themeName = config.themes[themeName]) !== null && _config_themes_themeName !== void 0 ? _config_themes_themeName : {} : {}),
|
|
90
|
+
...themeIn
|
|
91
|
+
};
|
|
92
|
+
for (var key in theme1) {
|
|
93
|
+
ensureThemeVariable(theme1, key);
|
|
71
94
|
}
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
response
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
var themeProxied = proxyThemeToParents(themeName, theme1);
|
|
96
|
+
var response = {
|
|
97
|
+
themeRaw: theme1,
|
|
98
|
+
theme: themeProxied,
|
|
99
|
+
cssRules: []
|
|
100
|
+
};
|
|
101
|
+
if (props.avoidUpdate) {
|
|
102
|
+
return response;
|
|
103
|
+
}
|
|
104
|
+
if (insertCSS) {
|
|
105
|
+
response.cssRules = insertThemeCSS({
|
|
106
|
+
[themeName]: theme1
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
updateThemeConfig(themeName, themeProxied);
|
|
110
|
+
updateThemeStates();
|
|
111
|
+
return response;
|
|
87
112
|
}
|
|
88
113
|
function updateThemeConfig(themeName, theme) {
|
|
89
114
|
var config = getConfig();
|
|
90
|
-
config.themes[themeName] = theme
|
|
115
|
+
config.themes[themeName] = theme;
|
|
116
|
+
updateConfig("themes", config.themes);
|
|
91
117
|
}
|
|
92
118
|
function updateThemeStates() {
|
|
93
119
|
forceUpdateThemes();
|
|
94
120
|
}
|
|
95
121
|
function insertThemeCSS(themes) {
|
|
96
|
-
var batch = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
97
|
-
|
|
98
|
-
|
|
122
|
+
var batch = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
123
|
+
if (true) {
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
var config = getConfig();
|
|
127
|
+
var cssRules = [];
|
|
99
128
|
for (var themeName in themes) {
|
|
100
|
-
var theme = themes[themeName]
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
cssRules = [...cssRules, ...rules]
|
|
129
|
+
var theme = themes[themeName];
|
|
130
|
+
var rules = getThemeCSSRules({
|
|
131
|
+
config,
|
|
132
|
+
themeName,
|
|
133
|
+
names: [themeName],
|
|
134
|
+
hasDarkLight: true,
|
|
135
|
+
theme,
|
|
136
|
+
// Use mutated variable creator which starts from high index to avoid conflicts
|
|
137
|
+
useMutatedVariables: true
|
|
138
|
+
});
|
|
139
|
+
cssRules = [...cssRules, ...rules];
|
|
140
|
+
if (!batch) {
|
|
141
|
+
updateStyle(`t_theme_style_${themeName}`, rules);
|
|
142
|
+
}
|
|
111
143
|
}
|
|
112
144
|
if (mutatedAutoVariables.length > 0) {
|
|
113
|
-
var autoVarCSS
|
|
114
|
-
|
|
145
|
+
var autoVarCSS = `:root{${mutatedAutoVariables.map(function (v) {
|
|
146
|
+
return `--${v.name}:${v.val}`;
|
|
147
|
+
}).join(";")}}`;
|
|
148
|
+
updateStyle(`t_mutate_vars`, [autoVarCSS]);
|
|
115
149
|
}
|
|
116
150
|
if (batch) {
|
|
117
|
-
var id;
|
|
151
|
+
var id = typeof batch == "string" ? batch : simpleHash(Object.keys(themes).join(""));
|
|
118
152
|
updateStyle(`t_theme_style_${id}`, cssRules);
|
|
119
153
|
}
|
|
154
|
+
return cssRules;
|
|
120
155
|
}
|
|
121
156
|
function updateStyle(id, rules) {
|
|
122
|
-
var existing = document.querySelector(`#${id}`)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
157
|
+
var existing = document.querySelector(`#${id}`);
|
|
158
|
+
var style = document.createElement("style");
|
|
159
|
+
style.id = id;
|
|
160
|
+
style.appendChild(document.createTextNode(rules.join("\n")));
|
|
161
|
+
document.head.appendChild(style);
|
|
162
|
+
if (existing) {
|
|
126
163
|
var _existing_parentElement;
|
|
127
|
-
(_existing_parentElement = existing.parentElement) === null || _existing_parentElement === void 0
|
|
164
|
+
(_existing_parentElement = existing.parentElement) === null || _existing_parentElement === void 0 ? void 0 : _existing_parentElement.removeChild(existing);
|
|
128
165
|
}
|
|
129
166
|
}
|
|
130
167
|
export { _mutateTheme, mutateThemes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isServer","startTransition","ensureThemeVariable","forceUpdateThemes","getConfig","getThemeCSSRules","mutatedAutoVariables","proxyThemeToParents","simpleHash","updateConfig","mutateThemes","param","themes","batch","insertCSS","props","allThemesProxied","allThemesRaw","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","name","theme","value","res","_mutateTheme","avoidUpdate","mutationType","themeRaw","err","return","cssRules","insertThemeCSS","themeName","theme2","updateThemeConfig","updateThemeStates","themesRaw","process","env","NODE_ENV","console","warn","config","themeIn","Error","_config_themes_themeName","theme1","key","themeProxied","response","arguments","length","rules","names","hasDarkLight","useMutatedVariables","updateStyle","autoVarCSS","
|
|
1
|
+
{"version":3,"names":["isServer","startTransition","ensureThemeVariable","forceUpdateThemes","getConfig","getThemeCSSRules","mutatedAutoVariables","proxyThemeToParents","simpleHash","updateConfig","mutateThemes","param","themes","batch","insertCSS","props","allThemesProxied","allThemesRaw","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","name","theme","value","res","_mutateTheme","avoidUpdate","mutationType","themeRaw","err","return","cssRules","insertThemeCSS","themeName","theme2","updateThemeConfig","updateThemeStates","themesRaw","process","env","NODE_ENV","console","warn","config","themeIn","Error","_config_themes_themeName","theme1","key","themeProxied","response","arguments","length","rules","names","hasDarkLight","useMutatedVariables","updateStyle","autoVarCSS","map","v","val","join","id","Object","keys"],"sources":["../../src/_mutateTheme.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AACzB,SAASC,eAAA,QAAuB;AAEhC,SAAAC,mBAAA,EAAAC,iBAAA,EAAAC,SAAA,EAAAC,gBAAA,EAAAC,oBAAA,EAAAC,mBAAA,EAAAC,UAAA,EAAAC,YAAA;AAAA,SACEC,aAAAC,KAAA;EACA;IAAAC,MAAA;IAAAC,KAAA;IAAAC,SAAA;IAAA,GAAAC;EAAA,IAAAJ,KAAA;EACA,IAAAK,gBAAA;EACA,IAAAC,YAAA;EACA,IAAAC,yBAAA;IAAAC,iBAAA;IAAAC,cAAA;EACA;IACA,SAAAC,SAAA,GAAAT,MAAA,CAAAU,MAAA,CAAAC,QAAA,KAAAC,KAAA,IAAAN,yBAAA,IAAAM,KAAA,GAAAH,SAAA,CAAAI,IAAA,IAAAC,IAAA,GAAAR,yBAAA;MACA;QAAAS,IAAA;QAAAC;MAAA,IAAAJ,KAAA,CAAAK,KAAA;MAAA,IACKC,GAAA,GAAAC,YAAA;QAmBA,GAAShB,KAAA;QACdY,IAAA;QACAC,KAAA;QACA;QACGI,WAAA;QAMF;QACKC,YAAA;MACN,EAAM;MACN,IAAAH,GAAW,EAAE;QACXd,gBAAY,CAAAW,IAAa,IAAAG,GAAA,CAAAF,KAAA;QACvBX,YAAG,CAAAU,IAAA,IAAAG,GAAA,CAAAI,QAAA;MACH;IAAA;EACA,SAAAC,GAAA;IAAAhB,iBAEa;IAAAC,cAAA,GAAAe,GAAA;EAAA,UAEb;IACF,IAAC;MACD,IAAI,CAAAjB,yBAAK,IAAAG,SAAA,CAAAe,MAAA;QACPf,SAAA,CAAAe,MAAiB;MACjB;IACF;MACF,IAAAjB,iBAAA;QAEM,MAAAC,cAAW;MAEjB;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AAA2D,GAAA,WAAAC,CAAA;MAChD,OAAM,KAAAA,CAAW,CAAAvC,IAAA,IAASuC,CAAA,CAAAC,GAAA;IAC1B,GAAAC,IAAM,KAAQ;IACdL,WAAW,mBACXC,UAAM,CACN;EACA;EACE,IAAAnD,KAAA,EAAS;IACX,IAAAwD,EAAA,UAAAxD,KAAA,eAAAA,KAAA,GAAAL,UAAA,CAAA8D,MAAA,CAAAC,IAAA,CAAA3D,MAAA,EAAAwD,IAAA;IACFL,WAAA,kBAAAM,EAAA,IAAAhC,QAAA","ignoreList":[]}
|
package/dist/esm/addTheme.mjs
CHANGED
|
@@ -3,12 +3,13 @@ function replaceTheme({
|
|
|
3
3
|
name,
|
|
4
4
|
theme
|
|
5
5
|
}) {
|
|
6
|
-
|
|
6
|
+
const next = _mutateTheme({
|
|
7
7
|
name,
|
|
8
8
|
theme,
|
|
9
|
-
insertCSS:
|
|
9
|
+
insertCSS: true,
|
|
10
10
|
mutationType: "replace"
|
|
11
11
|
});
|
|
12
|
+
return next;
|
|
12
13
|
}
|
|
13
14
|
export { replaceTheme };
|
|
14
15
|
//# sourceMappingURL=replaceTheme.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_mutateTheme","replaceTheme","name","theme","insertCSS","mutationType"],"sources":["../../src/replaceTheme.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,YAAA,QAAoB;AAEtB,SAASC,aAAa;EAC3BC,IAAA;EACAC;AACF,GAGG;
|
|
1
|
+
{"version":3,"names":["_mutateTheme","replaceTheme","name","theme","next","insertCSS","mutationType"],"sources":["../../src/replaceTheme.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,YAAA,QAAoB;AAEtB,SAASC,aAAa;EAC3BC,IAAA;EACAC;AACF,GAGG;EACD,MAAMC,IAAA,GAAOJ,YAAA,CAAa;IAAEE,IAAA;IAAMC,KAAA;IAAOE,SAAA,EAAW;IAAMC,YAAA,EAAc;EAAU,CAAC;EACnF,OAAOF,IAAA;AACT","ignoreList":[]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { _mutateTheme } from "./_mutateTheme.native.js";
|
|
2
2
|
function replaceTheme(param) {
|
|
3
3
|
var {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
name,
|
|
5
|
+
theme
|
|
6
|
+
} = param;
|
|
7
|
+
var next = _mutateTheme({
|
|
8
|
+
name,
|
|
9
|
+
theme,
|
|
10
|
+
insertCSS: true,
|
|
11
|
+
mutationType: "replace"
|
|
12
|
+
});
|
|
13
13
|
return next;
|
|
14
14
|
}
|
|
15
15
|
export { replaceTheme };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_mutateTheme","replaceTheme","param","name","theme","next","insertCSS","mutationType"],"sources":["../../src/replaceTheme.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,YAAA,QAAoB;AAEtB,SAASC,aAAaC,KAAA;EAC3B;
|
|
1
|
+
{"version":3,"names":["_mutateTheme","replaceTheme","param","name","theme","next","insertCSS","mutationType"],"sources":["../../src/replaceTheme.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,YAAA,QAAoB;AAEtB,SAASC,aAAaC,KAAA;EAC3B;IAAAC,IAAA;IAAAC;EAAA,IAAAF,KAAA;EACA,IAAAG,IAAA,GAAAL,YAAA;IAICG,IAAA;IACDC,KAAM;IACNE,SAAO;IACTC,YAAA","ignoreList":[]}
|
package/dist/esm/updateTheme.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/theme",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"clean:build": "hanzo-gui-build clean:build"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@hanzogui/constants": "3.0.
|
|
38
|
-
"@hanzogui/start-transition": "3.0.
|
|
39
|
-
"@hanzogui/web": "3.0.
|
|
37
|
+
"@hanzogui/constants": "3.0.6",
|
|
38
|
+
"@hanzogui/start-transition": "3.0.6",
|
|
39
|
+
"@hanzogui/web": "3.0.6"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@hanzogui/build": "3.0.
|
|
42
|
+
"@hanzogui/build": "3.0.6",
|
|
43
43
|
"react": ">=19"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
package/src/_mutateTheme.ts
CHANGED