@plumeria/core 0.22.0 → 0.22.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/index.js +23 -4
- package/dist/index.mjs +24 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8,13 +8,32 @@ function create(object) {
|
|
|
8
8
|
const flat = {};
|
|
9
9
|
const nonFlat = {};
|
|
10
10
|
(0, zss_engine.splitAtomicAndNested)(styleObj, flat, nonFlat);
|
|
11
|
+
const props$1 = Object.keys(flat);
|
|
12
|
+
const finalFlat = {};
|
|
13
|
+
for (let i = 0; i < props$1.length; i++) {
|
|
14
|
+
const prop = props$1[i];
|
|
15
|
+
const kebab = (0, zss_engine.camelToKebabCase)(prop);
|
|
16
|
+
const isShorthand = !!zss_engine.SHORTHAND_PROPERTIES[kebab];
|
|
17
|
+
if (isShorthand) finalFlat[prop] = flat[prop];
|
|
18
|
+
else {
|
|
19
|
+
let isOverridden = false;
|
|
20
|
+
const shorthands = zss_engine.LONG_TO_SHORT[kebab] || [];
|
|
21
|
+
for (let j = i + 1; j < props$1.length; j++) {
|
|
22
|
+
const futureProp = props$1[j];
|
|
23
|
+
const futureKebab = (0, zss_engine.camelToKebabCase)(futureProp);
|
|
24
|
+
if (shorthands.includes(futureKebab)) {
|
|
25
|
+
isOverridden = true;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (!isOverridden) finalFlat[prop] = flat[prop];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
11
32
|
const records = [];
|
|
12
|
-
Object.entries(
|
|
33
|
+
Object.entries(finalFlat).forEach(([prop, value]) => {
|
|
13
34
|
const hashes = new Set();
|
|
14
35
|
const sheets = new Set();
|
|
15
|
-
|
|
16
|
-
const resultQueue = [];
|
|
17
|
-
(0, zss_engine.processAtomicProps)({ [prop]: value }, hashes, sheets, seen, resultQueue);
|
|
36
|
+
(0, zss_engine.processAtomicProps)({ [prop]: value }, hashes, sheets);
|
|
18
37
|
const hashArray = [...hashes];
|
|
19
38
|
const sheetArray = [...sheets];
|
|
20
39
|
const baseSheetParts = [];
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { globalPromise_1, globalPromise_2, initPromise_1, initPromise_2, resolvePromise_1, resolvePromise_2 } from "./css.mjs";
|
|
2
|
-
import { camelToKebabCase, genBase36Hash, injectClientCSS, injectClientGlobalCSS, injectClientQuery, isHashInStyleSheets, isServer, isTestingDevelopment, processAtomicProps, splitAtomicAndNested, transpile } from "zss-engine";
|
|
2
|
+
import { LONG_TO_SHORT, SHORTHAND_PROPERTIES, camelToKebabCase, genBase36Hash, injectClientCSS, injectClientGlobalCSS, injectClientQuery, isHashInStyleSheets, isServer, isTestingDevelopment, processAtomicProps, splitAtomicAndNested, transpile } from "zss-engine";
|
|
3
3
|
|
|
4
4
|
const styleAtomMap = new WeakMap();
|
|
5
5
|
function create(object) {
|
|
@@ -8,13 +8,32 @@ function create(object) {
|
|
|
8
8
|
const flat = {};
|
|
9
9
|
const nonFlat = {};
|
|
10
10
|
splitAtomicAndNested(styleObj, flat, nonFlat);
|
|
11
|
+
const props$1 = Object.keys(flat);
|
|
12
|
+
const finalFlat = {};
|
|
13
|
+
for (let i = 0; i < props$1.length; i++) {
|
|
14
|
+
const prop = props$1[i];
|
|
15
|
+
const kebab = camelToKebabCase(prop);
|
|
16
|
+
const isShorthand = !!SHORTHAND_PROPERTIES[kebab];
|
|
17
|
+
if (isShorthand) finalFlat[prop] = flat[prop];
|
|
18
|
+
else {
|
|
19
|
+
let isOverridden = false;
|
|
20
|
+
const shorthands = LONG_TO_SHORT[kebab] || [];
|
|
21
|
+
for (let j = i + 1; j < props$1.length; j++) {
|
|
22
|
+
const futureProp = props$1[j];
|
|
23
|
+
const futureKebab = camelToKebabCase(futureProp);
|
|
24
|
+
if (shorthands.includes(futureKebab)) {
|
|
25
|
+
isOverridden = true;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (!isOverridden) finalFlat[prop] = flat[prop];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
11
32
|
const records = [];
|
|
12
|
-
Object.entries(
|
|
33
|
+
Object.entries(finalFlat).forEach(([prop, value]) => {
|
|
13
34
|
const hashes = new Set();
|
|
14
35
|
const sheets = new Set();
|
|
15
|
-
|
|
16
|
-
const resultQueue = [];
|
|
17
|
-
processAtomicProps({ [prop]: value }, hashes, sheets, seen, resultQueue);
|
|
36
|
+
processAtomicProps({ [prop]: value }, hashes, sheets);
|
|
18
37
|
const hashArray = [...hashes];
|
|
19
38
|
const sheetArray = [...sheets];
|
|
20
39
|
const baseSheetParts = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/core",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "The atomic on-demand CSS-in-JS.",
|
|
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": "0.2.
|
|
48
|
+
"zss-engine": "0.2.94"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|