@plumeria/core 2.3.0 → 2.4.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/README.md +4 -4
- package/dist/index.js +21 -13
- package/dist/index.mjs +21 -13
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,19 +21,19 @@ const className = css.props(styles.text, styles.size);
|
|
|
21
21
|
**Generated CSS:**
|
|
22
22
|
|
|
23
23
|
```css
|
|
24
|
-
.
|
|
24
|
+
.xhrr6ses:not(#\#) {
|
|
25
25
|
font-size: 12px;
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.xvbwmxqp {
|
|
28
28
|
color: navy;
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
.xhk51flp {
|
|
31
31
|
width: 120px;
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
```
|
|
36
|
-
"
|
|
36
|
+
"xhrr6ses xvbwmxqp xhk51flp"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
## Documentation
|
package/dist/index.js
CHANGED
|
@@ -49,25 +49,33 @@ function create(rule) {
|
|
|
49
49
|
if (atRule.startsWith("@media") || atRule.startsWith("@container")) nonFlatQuery[atRule] = nestedObj;
|
|
50
50
|
else nonFlatBase[atRule] = nestedObj;
|
|
51
51
|
});
|
|
52
|
-
Object.entries(nonFlatBase).forEach(([selector, style]) => {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
Object.entries(nonFlatBase).forEach(([selector, style], index) => {
|
|
53
|
+
const hashObj = { [key]: {
|
|
54
|
+
[selector]: style,
|
|
55
|
+
index
|
|
56
|
+
} };
|
|
57
|
+
const hash = (0, zss_engine.genBase36Hash)(hashObj, 1, 7);
|
|
58
|
+
const transpileObj = { [key]: { [selector]: style } };
|
|
59
|
+
const { styleSheet } = (0, zss_engine.transpile)(transpileObj, hash);
|
|
56
60
|
records.push({
|
|
57
|
-
key: selector,
|
|
58
|
-
hash
|
|
61
|
+
key: selector + index,
|
|
62
|
+
hash,
|
|
59
63
|
sheet: styleSheet
|
|
60
64
|
});
|
|
61
65
|
});
|
|
62
66
|
Object.entries(nonFlatQuery).forEach(([atRule, nestedStyles]) => {
|
|
63
|
-
Object.entries(nestedStyles).forEach(([selector, style]) => {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
Object.entries(nestedStyles).forEach(([selector, style], index) => {
|
|
68
|
+
const hashObj = { [key]: { [atRule]: {
|
|
69
|
+
[selector]: style,
|
|
70
|
+
index
|
|
71
|
+
} } };
|
|
72
|
+
const hash = (0, zss_engine.genBase36Hash)(hashObj, 1, 7);
|
|
73
|
+
const transpileObj = { [key]: { [atRule]: { [selector]: style } } };
|
|
74
|
+
const { styleSheet } = (0, zss_engine.transpile)(transpileObj, hash);
|
|
75
|
+
const finalSheet = styleSheet.replace(`.${hash}`, `.${hash}:not(#\\#)`);
|
|
68
76
|
records.push({
|
|
69
|
-
key: atRule + selector,
|
|
70
|
-
hash
|
|
77
|
+
key: atRule + selector + index,
|
|
78
|
+
hash,
|
|
71
79
|
sheet: finalSheet
|
|
72
80
|
});
|
|
73
81
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -49,25 +49,33 @@ function create(rule) {
|
|
|
49
49
|
if (atRule.startsWith("@media") || atRule.startsWith("@container")) nonFlatQuery[atRule] = nestedObj;
|
|
50
50
|
else nonFlatBase[atRule] = nestedObj;
|
|
51
51
|
});
|
|
52
|
-
Object.entries(nonFlatBase).forEach(([selector, style]) => {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
Object.entries(nonFlatBase).forEach(([selector, style], index) => {
|
|
53
|
+
const hashObj = { [key]: {
|
|
54
|
+
[selector]: style,
|
|
55
|
+
index
|
|
56
|
+
} };
|
|
57
|
+
const hash = genBase36Hash(hashObj, 1, 7);
|
|
58
|
+
const transpileObj = { [key]: { [selector]: style } };
|
|
59
|
+
const { styleSheet } = transpile(transpileObj, hash);
|
|
56
60
|
records.push({
|
|
57
|
-
key: selector,
|
|
58
|
-
hash
|
|
61
|
+
key: selector + index,
|
|
62
|
+
hash,
|
|
59
63
|
sheet: styleSheet
|
|
60
64
|
});
|
|
61
65
|
});
|
|
62
66
|
Object.entries(nonFlatQuery).forEach(([atRule, nestedStyles]) => {
|
|
63
|
-
Object.entries(nestedStyles).forEach(([selector, style]) => {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
Object.entries(nestedStyles).forEach(([selector, style], index) => {
|
|
68
|
+
const hashObj = { [key]: { [atRule]: {
|
|
69
|
+
[selector]: style,
|
|
70
|
+
index
|
|
71
|
+
} } };
|
|
72
|
+
const hash = genBase36Hash(hashObj, 1, 7);
|
|
73
|
+
const transpileObj = { [key]: { [atRule]: { [selector]: style } } };
|
|
74
|
+
const { styleSheet } = transpile(transpileObj, hash);
|
|
75
|
+
const finalSheet = styleSheet.replace(`.${hash}`, `.${hash}:not(#\\#)`);
|
|
68
76
|
records.push({
|
|
69
|
-
key: atRule + selector,
|
|
70
|
-
hash
|
|
77
|
+
key: atRule + selector + index,
|
|
78
|
+
hash,
|
|
71
79
|
sheet: finalSheet
|
|
72
80
|
});
|
|
73
81
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "An atomic CSS runtime designed to disappear.",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"stylesheet.css"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"zss-engine": "2.
|
|
48
|
+
"zss-engine": "2.1.0"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public",
|