@pandacss/parser 0.15.0 → 0.15.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/index.js +18 -2
- package/dist/index.mjs +18 -2
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -206,7 +206,9 @@ var fallback = (box2) => ({
|
|
|
206
206
|
getNode: () => box2.getNode(),
|
|
207
207
|
getStack: () => box2.getStack()
|
|
208
208
|
});
|
|
209
|
-
var defaultEnv = { preset: "
|
|
209
|
+
var defaultEnv = { preset: "ECMA" };
|
|
210
|
+
var identityFn = (styles) => styles;
|
|
211
|
+
var evaluateOptions = { environment: defaultEnv };
|
|
210
212
|
function createParser(options) {
|
|
211
213
|
const { jsx, getRecipesByJsxName, getPatternsByJsxName, tsOptions, join } = options;
|
|
212
214
|
const importMap = Object.fromEntries(Object.entries(options.importMap).map(([key, value]) => [key, join(...value)]));
|
|
@@ -370,7 +372,21 @@ function createParser(options) {
|
|
|
370
372
|
taggedTemplates: {
|
|
371
373
|
matchTaggedTemplate: (tag) => matchFn(tag.fnName)
|
|
372
374
|
},
|
|
373
|
-
getEvaluateOptions: (node) =>
|
|
375
|
+
getEvaluateOptions: (node) => {
|
|
376
|
+
if (!import_ts_morph.Node.isCallExpression(node))
|
|
377
|
+
return evaluateOptions;
|
|
378
|
+
const propAccessExpr = node.getExpression();
|
|
379
|
+
if (!import_ts_morph.Node.isPropertyAccessExpression(propAccessExpr))
|
|
380
|
+
return evaluateOptions;
|
|
381
|
+
let name = propAccessExpr.getText();
|
|
382
|
+
if (!isRawFn(name)) {
|
|
383
|
+
return evaluateOptions;
|
|
384
|
+
}
|
|
385
|
+
name = name.replace(".raw", "");
|
|
386
|
+
return {
|
|
387
|
+
environment: Object.assign({}, defaultEnv, { extra: { [name]: { raw: identityFn } } })
|
|
388
|
+
};
|
|
389
|
+
},
|
|
374
390
|
flags: { skipTraverseFiles: true }
|
|
375
391
|
});
|
|
376
392
|
measure();
|
package/dist/index.mjs
CHANGED
|
@@ -168,7 +168,9 @@ var fallback = (box2) => ({
|
|
|
168
168
|
getNode: () => box2.getNode(),
|
|
169
169
|
getStack: () => box2.getStack()
|
|
170
170
|
});
|
|
171
|
-
var defaultEnv = { preset: "
|
|
171
|
+
var defaultEnv = { preset: "ECMA" };
|
|
172
|
+
var identityFn = (styles) => styles;
|
|
173
|
+
var evaluateOptions = { environment: defaultEnv };
|
|
172
174
|
function createParser(options) {
|
|
173
175
|
const { jsx, getRecipesByJsxName, getPatternsByJsxName, tsOptions, join } = options;
|
|
174
176
|
const importMap = Object.fromEntries(Object.entries(options.importMap).map(([key, value]) => [key, join(...value)]));
|
|
@@ -332,7 +334,21 @@ function createParser(options) {
|
|
|
332
334
|
taggedTemplates: {
|
|
333
335
|
matchTaggedTemplate: (tag) => matchFn(tag.fnName)
|
|
334
336
|
},
|
|
335
|
-
getEvaluateOptions: (node) =>
|
|
337
|
+
getEvaluateOptions: (node) => {
|
|
338
|
+
if (!Node.isCallExpression(node))
|
|
339
|
+
return evaluateOptions;
|
|
340
|
+
const propAccessExpr = node.getExpression();
|
|
341
|
+
if (!Node.isPropertyAccessExpression(propAccessExpr))
|
|
342
|
+
return evaluateOptions;
|
|
343
|
+
let name = propAccessExpr.getText();
|
|
344
|
+
if (!isRawFn(name)) {
|
|
345
|
+
return evaluateOptions;
|
|
346
|
+
}
|
|
347
|
+
name = name.replace(".raw", "");
|
|
348
|
+
return {
|
|
349
|
+
environment: Object.assign({}, defaultEnv, { extra: { [name]: { raw: identityFn } } })
|
|
350
|
+
};
|
|
351
|
+
},
|
|
336
352
|
flags: { skipTraverseFiles: true }
|
|
337
353
|
});
|
|
338
354
|
measure();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/parser",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "The static parser for panda css",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -15,18 +15,18 @@
|
|
|
15
15
|
"lil-fp": "1.4.5",
|
|
16
16
|
"magic-string": "^0.30.2",
|
|
17
17
|
"ts-morph": "19.0.0",
|
|
18
|
-
"ts-pattern": "5.0.
|
|
19
|
-
"@pandacss/config": "^0.15.
|
|
20
|
-
"@pandacss/extractor": "0.15.
|
|
21
|
-
"@pandacss/is-valid-prop": "0.15.
|
|
22
|
-
"@pandacss/logger": "0.15.
|
|
23
|
-
"@pandacss/shared": "0.15.
|
|
24
|
-
"@pandacss/types": "0.15.
|
|
18
|
+
"ts-pattern": "5.0.5",
|
|
19
|
+
"@pandacss/config": "^0.15.2",
|
|
20
|
+
"@pandacss/extractor": "0.15.2",
|
|
21
|
+
"@pandacss/is-valid-prop": "0.15.2",
|
|
22
|
+
"@pandacss/logger": "0.15.2",
|
|
23
|
+
"@pandacss/shared": "0.15.2",
|
|
24
|
+
"@pandacss/types": "0.15.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"hookable": "5.5.3",
|
|
28
|
-
"@pandacss/fixture": "0.15.
|
|
29
|
-
"@pandacss/generator": "0.15.
|
|
28
|
+
"@pandacss/fixture": "0.15.2",
|
|
29
|
+
"@pandacss/generator": "0.15.2"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist"
|