@pandacss/parser 0.0.0-dev-20230804140727 → 0.0.0-dev-20230804155540
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.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -3
- package/dist/index.mjs +9 -3
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ts_morph from 'ts-morph';
|
|
2
2
|
import { ProjectOptions as ProjectOptions$1 } from 'ts-morph';
|
|
3
|
-
import { ResultItem, ConfigTsOptions, Runtime, PandaHookable } from '@pandacss/types';
|
|
3
|
+
import { ResultItem, Config, ConfigTsOptions, Runtime, PandaHookable } from '@pandacss/types';
|
|
4
4
|
import { Generator } from '@pandacss/generator';
|
|
5
5
|
|
|
6
6
|
declare class ParserResult {
|
|
@@ -44,6 +44,7 @@ type ParserOptions = {
|
|
|
44
44
|
importMap: Record<'css' | 'recipe' | 'pattern' | 'jsx', string[]>;
|
|
45
45
|
jsx?: {
|
|
46
46
|
factory: string;
|
|
47
|
+
styleProps: Exclude<Config['jsxStyleProps'], undefined>;
|
|
47
48
|
nodes: ParserNodeOptions[];
|
|
48
49
|
isStyleProp: (prop: string) => boolean;
|
|
49
50
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ts_morph from 'ts-morph';
|
|
2
2
|
import { ProjectOptions as ProjectOptions$1 } from 'ts-morph';
|
|
3
|
-
import { ResultItem, ConfigTsOptions, Runtime, PandaHookable } from '@pandacss/types';
|
|
3
|
+
import { ResultItem, Config, ConfigTsOptions, Runtime, PandaHookable } from '@pandacss/types';
|
|
4
4
|
import { Generator } from '@pandacss/generator';
|
|
5
5
|
|
|
6
6
|
declare class ParserResult {
|
|
@@ -44,6 +44,7 @@ type ParserOptions = {
|
|
|
44
44
|
importMap: Record<'css' | 'recipe' | 'pattern' | 'jsx', string[]>;
|
|
45
45
|
jsx?: {
|
|
46
46
|
factory: string;
|
|
47
|
+
styleProps: Exclude<Config['jsxStyleProps'], undefined>;
|
|
47
48
|
nodes: ParserNodeOptions[];
|
|
48
49
|
isStyleProp: (prop: string) => boolean;
|
|
49
50
|
};
|
package/dist/index.js
CHANGED
|
@@ -325,9 +325,7 @@ function createParser(options) {
|
|
|
325
325
|
return false;
|
|
326
326
|
return components.has(tagName) || isUpperCase(tagName) || isFactory(tagName) || isJsxTagRecipe(tagName) || isJsxTagPattern(tagName);
|
|
327
327
|
});
|
|
328
|
-
const
|
|
329
|
-
if (Boolean(components.get(tagName)?.has(propName)) || options.jsx?.isStyleProp(propName) || propertiesMap.has(propName))
|
|
330
|
-
return true;
|
|
328
|
+
const isRecipeOrPatternProp = (0, import_shared2.memo)((tagName, propName) => {
|
|
331
329
|
if (isJsxTagRecipe(tagName)) {
|
|
332
330
|
const recipeList = getRecipesByJsxName(tagName);
|
|
333
331
|
return recipeList.some((recipe) => recipePropertiesByName.get(recipe.baseName)?.has(propName));
|
|
@@ -338,6 +336,14 @@ function createParser(options) {
|
|
|
338
336
|
}
|
|
339
337
|
return false;
|
|
340
338
|
});
|
|
339
|
+
const matchTagProp = (0, import_ts_pattern.match)(jsx?.styleProps).with(
|
|
340
|
+
"all",
|
|
341
|
+
() => (0, import_shared2.memo)((tagName, propName) => {
|
|
342
|
+
return Boolean(components.get(tagName)?.has(propName)) || options.jsx?.isStyleProp(propName) || propertiesMap.has(propName) || isRecipeOrPatternProp(tagName, propName);
|
|
343
|
+
})
|
|
344
|
+
).with("minimal", () => (tagName, propName) => {
|
|
345
|
+
return propName === "css" || isRecipeOrPatternProp(tagName, propName);
|
|
346
|
+
}).otherwise(() => (tagName, propName) => isRecipeOrPatternProp(tagName, propName));
|
|
341
347
|
const matchFn = (0, import_shared2.memo)((fnName) => {
|
|
342
348
|
if (recipes.has(fnName) || patterns.has(fnName))
|
|
343
349
|
return true;
|
package/dist/index.mjs
CHANGED
|
@@ -287,9 +287,7 @@ function createParser(options) {
|
|
|
287
287
|
return false;
|
|
288
288
|
return components.has(tagName) || isUpperCase(tagName) || isFactory(tagName) || isJsxTagRecipe(tagName) || isJsxTagPattern(tagName);
|
|
289
289
|
});
|
|
290
|
-
const
|
|
291
|
-
if (Boolean(components.get(tagName)?.has(propName)) || options.jsx?.isStyleProp(propName) || propertiesMap.has(propName))
|
|
292
|
-
return true;
|
|
290
|
+
const isRecipeOrPatternProp = memo2((tagName, propName) => {
|
|
293
291
|
if (isJsxTagRecipe(tagName)) {
|
|
294
292
|
const recipeList = getRecipesByJsxName(tagName);
|
|
295
293
|
return recipeList.some((recipe) => recipePropertiesByName.get(recipe.baseName)?.has(propName));
|
|
@@ -300,6 +298,14 @@ function createParser(options) {
|
|
|
300
298
|
}
|
|
301
299
|
return false;
|
|
302
300
|
});
|
|
301
|
+
const matchTagProp = match(jsx?.styleProps).with(
|
|
302
|
+
"all",
|
|
303
|
+
() => memo2((tagName, propName) => {
|
|
304
|
+
return Boolean(components.get(tagName)?.has(propName)) || options.jsx?.isStyleProp(propName) || propertiesMap.has(propName) || isRecipeOrPatternProp(tagName, propName);
|
|
305
|
+
})
|
|
306
|
+
).with("minimal", () => (tagName, propName) => {
|
|
307
|
+
return propName === "css" || isRecipeOrPatternProp(tagName, propName);
|
|
308
|
+
}).otherwise(() => (tagName, propName) => isRecipeOrPatternProp(tagName, propName));
|
|
303
309
|
const matchFn = memo2((fnName) => {
|
|
304
310
|
if (recipes.has(fnName) || patterns.has(fnName))
|
|
305
311
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/parser",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230804155540",
|
|
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.4",
|
|
19
|
-
"@pandacss/config": "^0.0.0-dev-
|
|
20
|
-
"@pandacss/extractor": "0.0.0-dev-
|
|
21
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
22
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
23
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
24
|
-
"@pandacss/types": "0.0.0-dev-
|
|
19
|
+
"@pandacss/config": "^0.0.0-dev-20230804155540",
|
|
20
|
+
"@pandacss/extractor": "0.0.0-dev-20230804155540",
|
|
21
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230804155540",
|
|
22
|
+
"@pandacss/logger": "0.0.0-dev-20230804155540",
|
|
23
|
+
"@pandacss/shared": "0.0.0-dev-20230804155540",
|
|
24
|
+
"@pandacss/types": "0.0.0-dev-20230804155540"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"hookable": "5.5.3",
|
|
28
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
29
|
-
"@pandacss/generator": "0.0.0-dev-
|
|
28
|
+
"@pandacss/fixture": "0.0.0-dev-20230804155540",
|
|
29
|
+
"@pandacss/generator": "0.0.0-dev-20230804155540"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist"
|