@plumeria/core 4.0.5 → 4.1.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/css.d.ts +1 -1
- package/dist/css.js +11 -19
- package/dist/css.mjs +11 -19
- package/package.json +1 -1
package/dist/css.d.ts
CHANGED
package/dist/css.js
CHANGED
|
@@ -2,27 +2,19 @@ function errorFn(fn) {
|
|
|
2
2
|
throw new Error(`css.${fn} requires bundler-plugin setup`);
|
|
3
3
|
}
|
|
4
4
|
function props(...rules) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
for (let i =
|
|
5
|
+
const defined = [];
|
|
6
|
+
let result = "";
|
|
7
|
+
for (let i = rules.length - 1; i >= 0; i--) {
|
|
8
8
|
const arg = rules[i];
|
|
9
|
-
if (!arg || typeof arg
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
for (let i = 0; i <= lastIdx; i++) {
|
|
15
|
-
const arg = rules[i];
|
|
16
|
-
if (!arg) continue;
|
|
17
|
-
if (typeof arg === "string") {
|
|
18
|
-
classList.push(arg);
|
|
19
|
-
continue;
|
|
9
|
+
if (!arg || typeof arg !== "object") continue;
|
|
10
|
+
let chunk = "";
|
|
11
|
+
for (const key in arg) if (arg[key] && !defined.includes(key)) {
|
|
12
|
+
defined.push(key);
|
|
13
|
+
chunk += chunk ? " " + arg[key] : arg[key];
|
|
20
14
|
}
|
|
21
|
-
|
|
22
|
-
else classList.push(arg[key]);
|
|
15
|
+
if (chunk) result = result ? chunk + " " + result : chunk;
|
|
23
16
|
}
|
|
24
|
-
|
|
25
|
-
return classList.join(" ");
|
|
17
|
+
return result;
|
|
26
18
|
}
|
|
27
19
|
const css = class _css {
|
|
28
20
|
static create(_rule) {
|
|
@@ -48,4 +40,4 @@ const x = (className, style) => ({
|
|
|
48
40
|
});
|
|
49
41
|
|
|
50
42
|
exports.css = css;
|
|
51
|
-
exports.x = x;
|
|
43
|
+
exports.x = x;
|
package/dist/css.mjs
CHANGED
|
@@ -2,27 +2,19 @@ function errorFn(fn) {
|
|
|
2
2
|
throw new Error(`css.${fn} requires bundler-plugin setup`);
|
|
3
3
|
}
|
|
4
4
|
function props(...rules) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
for (let i =
|
|
5
|
+
const defined = [];
|
|
6
|
+
let result = "";
|
|
7
|
+
for (let i = rules.length - 1; i >= 0; i--) {
|
|
8
8
|
const arg = rules[i];
|
|
9
|
-
if (!arg || typeof arg
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
for (let i = 0; i <= lastIdx; i++) {
|
|
15
|
-
const arg = rules[i];
|
|
16
|
-
if (!arg) continue;
|
|
17
|
-
if (typeof arg === "string") {
|
|
18
|
-
classList.push(arg);
|
|
19
|
-
continue;
|
|
9
|
+
if (!arg || typeof arg !== "object") continue;
|
|
10
|
+
let chunk = "";
|
|
11
|
+
for (const key in arg) if (arg[key] && !defined.includes(key)) {
|
|
12
|
+
defined.push(key);
|
|
13
|
+
chunk += chunk ? " " + arg[key] : arg[key];
|
|
20
14
|
}
|
|
21
|
-
|
|
22
|
-
else classList.push(arg[key]);
|
|
15
|
+
if (chunk) result = result ? chunk + " " + result : chunk;
|
|
23
16
|
}
|
|
24
|
-
|
|
25
|
-
return classList.join(" ");
|
|
17
|
+
return result;
|
|
26
18
|
}
|
|
27
19
|
const css = class _css {
|
|
28
20
|
static create(_rule) {
|
|
@@ -47,4 +39,4 @@ const x = (className, style) => ({
|
|
|
47
39
|
style
|
|
48
40
|
});
|
|
49
41
|
|
|
50
|
-
export { css, x };
|
|
42
|
+
export { css, x };
|