@plumeria/core 4.1.0 → 4.1.2
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.js +11 -18
- package/dist/css.mjs +11 -18
- package/package.json +1 -1
package/dist/css.js
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
function errorFn(fn) {
|
|
2
2
|
throw new Error(`css.${fn} requires bundler-plugin setup`);
|
|
3
3
|
}
|
|
4
|
+
const defined = new Set();
|
|
4
5
|
function props(...rules) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (let i =
|
|
6
|
+
defined.clear();
|
|
7
|
+
let result = "";
|
|
8
|
+
for (let i = rules.length - 1; i >= 0; i--) {
|
|
8
9
|
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;
|
|
10
|
+
if (!arg || typeof arg !== "object") continue;
|
|
11
|
+
let chunk = "";
|
|
12
|
+
for (const key in arg) if (arg[key] && !defined.has(key)) {
|
|
13
|
+
defined.add(key);
|
|
14
|
+
chunk += chunk ? " " + arg[key] : arg[key];
|
|
20
15
|
}
|
|
21
|
-
|
|
22
|
-
else classList.push(arg[key]);
|
|
16
|
+
if (chunk) result = result ? chunk + " " + result : chunk;
|
|
23
17
|
}
|
|
24
|
-
|
|
25
|
-
return classList.join(" ");
|
|
18
|
+
return result;
|
|
26
19
|
}
|
|
27
20
|
const css = class _css {
|
|
28
21
|
static create(_rule) {
|
package/dist/css.mjs
CHANGED
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
function errorFn(fn) {
|
|
2
2
|
throw new Error(`css.${fn} requires bundler-plugin setup`);
|
|
3
3
|
}
|
|
4
|
+
const defined = new Set();
|
|
4
5
|
function props(...rules) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (let i =
|
|
6
|
+
defined.clear();
|
|
7
|
+
let result = "";
|
|
8
|
+
for (let i = rules.length - 1; i >= 0; i--) {
|
|
8
9
|
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;
|
|
10
|
+
if (!arg || typeof arg !== "object") continue;
|
|
11
|
+
let chunk = "";
|
|
12
|
+
for (const key in arg) if (arg[key] && !defined.has(key)) {
|
|
13
|
+
defined.add(key);
|
|
14
|
+
chunk += chunk ? " " + arg[key] : arg[key];
|
|
20
15
|
}
|
|
21
|
-
|
|
22
|
-
else classList.push(arg[key]);
|
|
16
|
+
if (chunk) result = result ? chunk + " " + result : chunk;
|
|
23
17
|
}
|
|
24
|
-
|
|
25
|
-
return classList.join(" ");
|
|
18
|
+
return result;
|
|
26
19
|
}
|
|
27
20
|
const css = class _css {
|
|
28
21
|
static create(_rule) {
|