@plumeria/utils 18.3.10 → 18.3.12
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 +33 -23
- package/package.json +1 -1
package/dist/parser.js
CHANGED
|
@@ -825,15 +825,23 @@ function resolveVariantsTableMemberExpression(node, variantsHashTable) {
|
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
827
|
function resolveStaticTableMemberExpression(node, staticTable) {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
828
|
+
const keys = [];
|
|
829
|
+
let current = node;
|
|
830
|
+
while (exports.t.isMemberExpression(current)) {
|
|
831
|
+
if (!exports.t.isIdentifier(current.property))
|
|
832
|
+
return undefined;
|
|
833
|
+
keys.unshift(current.property.value);
|
|
834
|
+
current = current.object;
|
|
835
835
|
}
|
|
836
|
-
|
|
836
|
+
if (!exports.t.isIdentifier(current))
|
|
837
|
+
return undefined;
|
|
838
|
+
let value = staticTable[current.value];
|
|
839
|
+
for (const key of keys) {
|
|
840
|
+
if (!value || typeof value !== 'object' || !(key in value))
|
|
841
|
+
return undefined;
|
|
842
|
+
value = value[key];
|
|
843
|
+
}
|
|
844
|
+
return value;
|
|
837
845
|
}
|
|
838
846
|
function resolveCreateThemeTableMemberExpressionByNode(node, createThemeHashTable, createThemeObjectTable) {
|
|
839
847
|
if (exports.t.isMemberExpression(node) && exports.t.isIdentifier(node.object)) {
|
|
@@ -1852,23 +1860,25 @@ function extractOndemandStyles(obj, extractedSheets, t) {
|
|
|
1852
1860
|
visited.add(n);
|
|
1853
1861
|
Object.values(n).forEach((val) => {
|
|
1854
1862
|
if (typeof val === 'string') {
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
if (
|
|
1858
|
-
keyframesHashes.
|
|
1859
|
-
|
|
1863
|
+
if (val.includes('kf-') || val.includes('vt-') || val.includes('cr-')) {
|
|
1864
|
+
for (const [, kind, hash] of val.matchAll(REFERENCE_MARKER)) {
|
|
1865
|
+
if (kind === 'kf') {
|
|
1866
|
+
if (!keyframesHashes.has(hash) && t.keyframesObjectTable[hash]) {
|
|
1867
|
+
keyframesHashes.add(hash);
|
|
1868
|
+
walk(t.keyframesObjectTable[hash]);
|
|
1869
|
+
}
|
|
1860
1870
|
}
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1871
|
+
else if (kind === 'vt') {
|
|
1872
|
+
if (!viewTransitionHashes.has(hash) &&
|
|
1873
|
+
t.viewTransitionObjectTable[hash]) {
|
|
1874
|
+
viewTransitionHashes.add(hash);
|
|
1875
|
+
walk(t.viewTransitionObjectTable[hash]);
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
else if (!createHashes.has(hash) && t.createObjectTable[hash]) {
|
|
1879
|
+
createHashes.add(hash);
|
|
1880
|
+
walk(t.createObjectTable[hash]);
|
|
1867
1881
|
}
|
|
1868
|
-
}
|
|
1869
|
-
else if (!createHashes.has(hash) && t.createObjectTable[hash]) {
|
|
1870
|
-
createHashes.add(hash);
|
|
1871
|
-
walk(t.createObjectTable[hash]);
|
|
1872
1882
|
}
|
|
1873
1883
|
}
|
|
1874
1884
|
if (val.includes('var(')) {
|