@vitus-labs/rocketstyle 2.0.0-alpha.2 → 2.0.0-alpha.21
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/lib/index.js +19 -12
- package/package.json +9 -9
package/lib/index.js
CHANGED
|
@@ -259,14 +259,11 @@ const RocketStyleProviderComponent = (WrappedComponent) => forwardRef(({ onMouse
|
|
|
259
259
|
|
|
260
260
|
//#endregion
|
|
261
261
|
//#region src/utils/attrs.ts
|
|
262
|
-
const removeUndefinedProps = (props) =>
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
};
|
|
268
|
-
return acc;
|
|
269
|
-
}, {});
|
|
262
|
+
const removeUndefinedProps = (props) => {
|
|
263
|
+
const result = {};
|
|
264
|
+
for (const key in props) if (props[key] !== void 0) result[key] = props[key];
|
|
265
|
+
return result;
|
|
266
|
+
};
|
|
270
267
|
const pickStyledAttrs = (props, keywords) => Object.keys(props).reduce((acc, key) => {
|
|
271
268
|
if (keywords[key] && props[key]) acc[key] = props[key];
|
|
272
269
|
return acc;
|
|
@@ -280,9 +277,9 @@ const calculateStylingAttrs = ({ useBooleans, multiKeys }) => ({ props, dimensio
|
|
|
280
277
|
const result = {};
|
|
281
278
|
Object.keys(dimensions).forEach((item) => {
|
|
282
279
|
const pickedProp = props[item];
|
|
283
|
-
const
|
|
280
|
+
const t = typeof pickedProp;
|
|
284
281
|
if (multiKeys?.[item] && Array.isArray(pickedProp)) result[item] = pickedProp;
|
|
285
|
-
else if (
|
|
282
|
+
else if (t === "string" || t === "number") result[item] = pickedProp;
|
|
286
283
|
else result[item] = void 0;
|
|
287
284
|
});
|
|
288
285
|
if (useBooleans) {
|
|
@@ -550,11 +547,21 @@ const rocketComponent = (options) => {
|
|
|
550
547
|
...rocketstate,
|
|
551
548
|
pseudo: pseudoRocketstate
|
|
552
549
|
};
|
|
553
|
-
|
|
550
|
+
let rsKey = "";
|
|
551
|
+
for (const k in rocketstate) {
|
|
552
|
+
const v = rocketstate[k];
|
|
553
|
+
rsKey += k;
|
|
554
|
+
rsKey += Array.isArray(v) ? v.join(",") : v;
|
|
555
|
+
}
|
|
556
|
+
const rocketstyle = useMemo(() => getTheme({
|
|
554
557
|
rocketstate,
|
|
555
558
|
themes: currentModeThemes,
|
|
556
559
|
baseTheme: currentModeBaseTheme
|
|
557
|
-
})
|
|
560
|
+
}), [
|
|
561
|
+
rsKey,
|
|
562
|
+
currentModeThemes,
|
|
563
|
+
currentModeBaseTheme
|
|
564
|
+
]);
|
|
558
565
|
const finalProps = {
|
|
559
566
|
...omit(mergeProps, [
|
|
560
567
|
...RESERVED_STYLING_PROPS_KEYS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitus-labs/rocketstyle",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.21",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Vit Bokisch <vit@bokisch.cz>",
|
|
6
6
|
"maintainers": [
|
|
@@ -63,16 +63,16 @@
|
|
|
63
63
|
"typecheck": "tsc --noEmit"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@vitus-labs/core": "
|
|
66
|
+
"@vitus-labs/core": "workspace:*",
|
|
67
67
|
"react": ">= 19"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@vitus-labs/core": "2.0.0-alpha.
|
|
71
|
-
"@vitus-labs/elements": "2.0.0-alpha.
|
|
72
|
-
"@vitus-labs/tools-rolldown": "^1.
|
|
73
|
-
"@vitus-labs/tools-storybook": "^1.
|
|
74
|
-
"@vitus-labs/tools-typescript": "^1.
|
|
75
|
-
"@vitus-labs/unistyle": "2.0.0-alpha.
|
|
70
|
+
"@vitus-labs/core": "2.0.0-alpha.21",
|
|
71
|
+
"@vitus-labs/elements": "2.0.0-alpha.21",
|
|
72
|
+
"@vitus-labs/tools-rolldown": "^1.7.0",
|
|
73
|
+
"@vitus-labs/tools-storybook": "^1.7.0",
|
|
74
|
+
"@vitus-labs/tools-typescript": "^1.7.0",
|
|
75
|
+
"@vitus-labs/unistyle": "2.0.0-alpha.21"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "e8ae357c45cbd6e2af4981259cd38adfe244bcfb"
|
|
78
78
|
}
|