@plumeria/utils 2.0.0 → 2.0.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/transform.js +34 -31
- package/package.json +9 -3
package/dist/transform.js
CHANGED
|
@@ -14,40 +14,43 @@ function compileToSingleCSS(object) {
|
|
|
14
14
|
const finalFlat = (0, zss_engine_1.overrideLonghand)(flat);
|
|
15
15
|
const records = [];
|
|
16
16
|
Object.entries(finalFlat).forEach(([prop, value]) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
if ((prop.startsWith('@media') || prop.startsWith('@container')) &&
|
|
18
|
+
typeof value === 'object' &&
|
|
19
|
+
value !== null) {
|
|
20
|
+
Object.entries(value).forEach(([innerProp, innerValue]) => {
|
|
21
|
+
const atomicMap = new Map();
|
|
22
|
+
(0, zss_engine_1.processAtomicProps)({ [innerProp]: innerValue }, atomicMap, prop);
|
|
23
|
+
const querySheetParts = [];
|
|
24
|
+
const queryHashParts = [];
|
|
25
|
+
for (const [hash, sheet] of atomicMap) {
|
|
26
|
+
querySheetParts.push(sheet.replace(`.${hash}`, `.${hash}:not(#\\#):not(#\\#)`));
|
|
27
|
+
queryHashParts.push(hash);
|
|
28
|
+
}
|
|
29
|
+
if (querySheetParts.length > 0) {
|
|
30
|
+
records.push({
|
|
31
|
+
key: prop + innerProp,
|
|
32
|
+
hash: queryHashParts.join(' '),
|
|
33
|
+
sheet: querySheetParts.join(''),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const atomicMap = new Map();
|
|
40
|
+
(0, zss_engine_1.processAtomicProps)({ [prop]: value }, atomicMap);
|
|
41
|
+
const baseSheetParts = [];
|
|
42
|
+
const baseHashParts = [];
|
|
43
|
+
for (const [hash, sheet] of atomicMap) {
|
|
34
44
|
baseSheetParts.push(sheet);
|
|
35
45
|
baseHashParts.push(hash);
|
|
36
46
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (querySheetParts.length > 0) {
|
|
46
|
-
records.push({
|
|
47
|
-
key: prop + '__queries__',
|
|
48
|
-
hash: queryHashParts.join(' '),
|
|
49
|
-
sheet: querySheetParts.join(''),
|
|
50
|
-
});
|
|
47
|
+
if (baseSheetParts.length > 0) {
|
|
48
|
+
records.push({
|
|
49
|
+
key: prop,
|
|
50
|
+
hash: baseHashParts.join(' '),
|
|
51
|
+
sheet: baseSheetParts.join(''),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
51
54
|
}
|
|
52
55
|
});
|
|
53
56
|
if (Object.keys(nonFlat).length > 0) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/utils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Plumeria Utils",
|
|
5
|
+
"author": "Refirst 11",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"funding": "https://github.com/sponsors/refirst11",
|
|
8
|
+
"homepage": "https://plumeria.dev",
|
|
5
9
|
"repository": {
|
|
6
10
|
"type": "git",
|
|
7
11
|
"url": "git+https://github.com/zss-in-js/plumeria.git",
|
|
8
12
|
"directory": "packages/utils"
|
|
9
13
|
},
|
|
10
|
-
"
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/zss-in-js/plumeria/issues"
|
|
16
|
+
},
|
|
11
17
|
"sideEffects": false,
|
|
12
18
|
"main": "dist/index.js",
|
|
13
19
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +24,7 @@
|
|
|
18
24
|
"@swc/core": "1.15.2"
|
|
19
25
|
},
|
|
20
26
|
"devDependencies": {
|
|
21
|
-
"zss-engine": "1.
|
|
27
|
+
"zss-engine": "1.2.0"
|
|
22
28
|
},
|
|
23
29
|
"publishConfig": {
|
|
24
30
|
"access": "public",
|