@plumeria/utils 18.3.5 → 18.3.6
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/parser.js +17 -18
- package/package.json +1 -1
package/dist/parser.js
CHANGED
|
@@ -726,10 +726,10 @@ function evaluateExpression(node, staticTable, keyframesHashTable, viewTransitio
|
|
|
726
726
|
return staticTable[node.value];
|
|
727
727
|
}
|
|
728
728
|
if (keyframesHashTable[node.value] !== undefined) {
|
|
729
|
-
return keyframesHashTable[node.value];
|
|
729
|
+
return 'kf-' + keyframesHashTable[node.value];
|
|
730
730
|
}
|
|
731
731
|
if (viewTransitionHashTable[node.value] !== undefined) {
|
|
732
|
-
return viewTransitionHashTable[node.value];
|
|
732
|
+
return 'vt-' + viewTransitionHashTable[node.value];
|
|
733
733
|
}
|
|
734
734
|
if (createStaticHashTable[node.value] !== undefined) {
|
|
735
735
|
const hash = createStaticHashTable[node.value];
|
|
@@ -1836,6 +1836,7 @@ function resolveExport(filePath, exportName, visited = new Set()) {
|
|
|
1836
1836
|
}
|
|
1837
1837
|
return null;
|
|
1838
1838
|
}
|
|
1839
|
+
const REFERENCE_MARKER = /(kf|vt|cr)-([0-9a-z]+)/g;
|
|
1839
1840
|
function extractOndemandStyles(obj, extractedSheets, t) {
|
|
1840
1841
|
if (!obj || typeof obj !== 'object')
|
|
1841
1842
|
return;
|
|
@@ -1850,28 +1851,26 @@ function extractOndemandStyles(obj, extractedSheets, t) {
|
|
|
1850
1851
|
visited.add(n);
|
|
1851
1852
|
Object.values(n).forEach((val) => {
|
|
1852
1853
|
if (typeof val === 'string') {
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1854
|
+
for (const [, kind, hash] of val.matchAll(REFERENCE_MARKER)) {
|
|
1855
|
+
if (kind === 'kf') {
|
|
1856
|
+
if (!keyframesHashes.has(hash) && t.keyframesObjectTable[hash]) {
|
|
1857
|
+
keyframesHashes.add(hash);
|
|
1858
|
+
walk(t.keyframesObjectTable[hash]);
|
|
1859
|
+
}
|
|
1858
1860
|
}
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1861
|
+
else if (kind === 'vt') {
|
|
1862
|
+
if (!viewTransitionHashes.has(hash) &&
|
|
1863
|
+
t.viewTransitionObjectTable[hash]) {
|
|
1864
|
+
viewTransitionHashes.add(hash);
|
|
1865
|
+
walk(t.viewTransitionObjectTable[hash]);
|
|
1866
|
+
}
|
|
1865
1867
|
}
|
|
1866
|
-
|
|
1867
|
-
else if (val.startsWith('cr-')) {
|
|
1868
|
-
const hash = val.slice(3);
|
|
1869
|
-
if (!createHashes.has(hash)) {
|
|
1868
|
+
else if (!createHashes.has(hash) && t.createObjectTable[hash]) {
|
|
1870
1869
|
createHashes.add(hash);
|
|
1871
1870
|
walk(t.createObjectTable[hash]);
|
|
1872
1871
|
}
|
|
1873
1872
|
}
|
|
1874
|
-
|
|
1873
|
+
if (val.includes('var(--')) {
|
|
1875
1874
|
let startIdx = 0;
|
|
1876
1875
|
while ((startIdx = val.indexOf('var(--', startIdx)) !== -1) {
|
|
1877
1876
|
startIdx += 4;
|