@pandacss/parser 0.15.3 → 0.15.5
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 +17 -3
- package/dist/index.mjs +17 -3
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -293,10 +293,10 @@ function createParser(options) {
|
|
|
293
293
|
const functions = /* @__PURE__ */ new Map();
|
|
294
294
|
const components = /* @__PURE__ */ new Map();
|
|
295
295
|
const propertiesMap = /* @__PURE__ */ new Map();
|
|
296
|
-
const
|
|
296
|
+
const recipePropertiesByJsxName = /* @__PURE__ */ new Map();
|
|
297
297
|
const recipeJsxLists = (jsx?.nodes ?? []).filter(isNodeRecipe).reduce(
|
|
298
298
|
(acc, recipe) => {
|
|
299
|
-
|
|
299
|
+
recipePropertiesByJsxName.set(recipe.jsxName, new Set(recipe.props ?? []));
|
|
300
300
|
recipe.jsx?.forEach((jsx2) => {
|
|
301
301
|
if (typeof jsx2 === "string") {
|
|
302
302
|
acc.string.add(jsx2);
|
|
@@ -334,7 +334,7 @@ function createParser(options) {
|
|
|
334
334
|
const isRecipeOrPatternProp = (0, import_shared2.memo)((tagName, propName) => {
|
|
335
335
|
if (isJsxTagRecipe(tagName)) {
|
|
336
336
|
const recipeList = getRecipesByJsxName(tagName);
|
|
337
|
-
return recipeList.some((recipe) =>
|
|
337
|
+
return recipeList.some((recipe) => recipePropertiesByJsxName.get(recipe.jsxName)?.has(propName));
|
|
338
338
|
}
|
|
339
339
|
if (isJsxTagPattern(tagName)) {
|
|
340
340
|
const patternList = getPatternsByJsxName(tagName);
|
|
@@ -459,6 +459,20 @@ function createParser(options) {
|
|
|
459
459
|
} else {
|
|
460
460
|
collector.set("css", result2);
|
|
461
461
|
}
|
|
462
|
+
const options2 = query.box.value[2];
|
|
463
|
+
if (import_extractor.box.isUnresolvable(map) && options2 && import_extractor.box.isMap(options2) && options2.value.has("defaultProps")) {
|
|
464
|
+
const maybeIdentifier = map.getNode();
|
|
465
|
+
if (import_ts_morph.Node.isIdentifier(maybeIdentifier)) {
|
|
466
|
+
const name2 = maybeIdentifier.getText();
|
|
467
|
+
const recipeName = imports.getName(name2);
|
|
468
|
+
collector.setRecipe(recipeName, {
|
|
469
|
+
type: "jsx-recipe",
|
|
470
|
+
name: recipeName,
|
|
471
|
+
box: options2,
|
|
472
|
+
data: combineResult((0, import_extractor.unbox)(options2.value.get("defaultProps")))
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
}
|
|
462
476
|
} else if (query.kind === "tagged-template") {
|
|
463
477
|
const obj = (0, import_shared2.astish)(query.box.value);
|
|
464
478
|
collector.set("css", {
|
package/dist/index.mjs
CHANGED
|
@@ -255,10 +255,10 @@ function createParser(options) {
|
|
|
255
255
|
const functions = /* @__PURE__ */ new Map();
|
|
256
256
|
const components = /* @__PURE__ */ new Map();
|
|
257
257
|
const propertiesMap = /* @__PURE__ */ new Map();
|
|
258
|
-
const
|
|
258
|
+
const recipePropertiesByJsxName = /* @__PURE__ */ new Map();
|
|
259
259
|
const recipeJsxLists = (jsx?.nodes ?? []).filter(isNodeRecipe).reduce(
|
|
260
260
|
(acc, recipe) => {
|
|
261
|
-
|
|
261
|
+
recipePropertiesByJsxName.set(recipe.jsxName, new Set(recipe.props ?? []));
|
|
262
262
|
recipe.jsx?.forEach((jsx2) => {
|
|
263
263
|
if (typeof jsx2 === "string") {
|
|
264
264
|
acc.string.add(jsx2);
|
|
@@ -296,7 +296,7 @@ function createParser(options) {
|
|
|
296
296
|
const isRecipeOrPatternProp = memo2((tagName, propName) => {
|
|
297
297
|
if (isJsxTagRecipe(tagName)) {
|
|
298
298
|
const recipeList = getRecipesByJsxName(tagName);
|
|
299
|
-
return recipeList.some((recipe) =>
|
|
299
|
+
return recipeList.some((recipe) => recipePropertiesByJsxName.get(recipe.jsxName)?.has(propName));
|
|
300
300
|
}
|
|
301
301
|
if (isJsxTagPattern(tagName)) {
|
|
302
302
|
const patternList = getPatternsByJsxName(tagName);
|
|
@@ -421,6 +421,20 @@ function createParser(options) {
|
|
|
421
421
|
} else {
|
|
422
422
|
collector.set("css", result2);
|
|
423
423
|
}
|
|
424
|
+
const options2 = query.box.value[2];
|
|
425
|
+
if (box.isUnresolvable(map) && options2 && box.isMap(options2) && options2.value.has("defaultProps")) {
|
|
426
|
+
const maybeIdentifier = map.getNode();
|
|
427
|
+
if (Node.isIdentifier(maybeIdentifier)) {
|
|
428
|
+
const name2 = maybeIdentifier.getText();
|
|
429
|
+
const recipeName = imports.getName(name2);
|
|
430
|
+
collector.setRecipe(recipeName, {
|
|
431
|
+
type: "jsx-recipe",
|
|
432
|
+
name: recipeName,
|
|
433
|
+
box: options2,
|
|
434
|
+
data: combineResult(unbox(options2.value.get("defaultProps")))
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
}
|
|
424
438
|
} else if (query.kind === "tagged-template") {
|
|
425
439
|
const obj = astish(query.box.value);
|
|
426
440
|
collector.set("css", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/parser",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.5",
|
|
4
4
|
"description": "The static parser for panda css",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"magic-string": "^0.30.2",
|
|
17
17
|
"ts-morph": "19.0.0",
|
|
18
18
|
"ts-pattern": "5.0.5",
|
|
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.
|
|
19
|
+
"@pandacss/config": "^0.15.5",
|
|
20
|
+
"@pandacss/extractor": "0.15.5",
|
|
21
|
+
"@pandacss/is-valid-prop": "0.15.5",
|
|
22
|
+
"@pandacss/logger": "0.15.5",
|
|
23
|
+
"@pandacss/shared": "0.15.5",
|
|
24
|
+
"@pandacss/types": "0.15.5"
|
|
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.5",
|
|
29
|
+
"@pandacss/generator": "0.15.5"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist"
|