@pandacss/generator 0.12.2 → 0.13.0
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 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -5
- package/dist/index.mjs +7 -6
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -28,7 +28,7 @@ declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
|
28
28
|
styleFnName: string;
|
|
29
29
|
jsxName: string;
|
|
30
30
|
}[];
|
|
31
|
-
|
|
31
|
+
find: (jsxName: string) => string;
|
|
32
32
|
filter: (jsxName: string) => {
|
|
33
33
|
props: string[];
|
|
34
34
|
blocklistType: string;
|
|
@@ -258,7 +258,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
258
258
|
styleFnName: string;
|
|
259
259
|
jsxName: string;
|
|
260
260
|
}[];
|
|
261
|
-
|
|
261
|
+
find: (jsxName: string) => string;
|
|
262
262
|
filter: (jsxName: string) => {
|
|
263
263
|
props: string[];
|
|
264
264
|
blocklistType: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ declare const getEngine: (conf: ConfigResultWithHooks) => {
|
|
|
28
28
|
styleFnName: string;
|
|
29
29
|
jsxName: string;
|
|
30
30
|
}[];
|
|
31
|
-
|
|
31
|
+
find: (jsxName: string) => string;
|
|
32
32
|
filter: (jsxName: string) => {
|
|
33
33
|
props: string[];
|
|
34
34
|
blocklistType: string;
|
|
@@ -258,7 +258,7 @@ declare const createGenerator: (conf: ConfigResultWithHooks) => {
|
|
|
258
258
|
styleFnName: string;
|
|
259
259
|
jsxName: string;
|
|
260
260
|
}[];
|
|
261
|
-
|
|
261
|
+
find: (jsxName: string) => string;
|
|
262
262
|
filter: (jsxName: string) => {
|
|
263
263
|
props: string[];
|
|
264
264
|
blocklistType: string;
|
package/dist/index.js
CHANGED
|
@@ -2934,6 +2934,7 @@ function getGeneratedTypes(ctx) {
|
|
|
2934
2934
|
var import_outdent39 = require("outdent");
|
|
2935
2935
|
var generateTypesEntry = () => ({
|
|
2936
2936
|
global: import_outdent39.outdent`
|
|
2937
|
+
import type { TextStyles, LayerStyles } from '@pandacss/dev'
|
|
2937
2938
|
import type { RecipeVariantRecord, RecipeConfig, SlotRecipeVariantRecord, SlotRecipeConfig } from './recipe'
|
|
2938
2939
|
import type { Parts } from './parts'
|
|
2939
2940
|
import type { PatternConfig, PatternProperties } from './pattern'
|
|
@@ -2945,8 +2946,8 @@ var generateTypesEntry = () => ({
|
|
|
2945
2946
|
export function defineSlotRecipe<S extends string, V extends SlotRecipeVariantRecord<S>>(config: SlotRecipeConfig<S, V>): SlotRecipeConfig
|
|
2946
2947
|
export function defineStyles(definition: SystemStyleObject): SystemStyleObject
|
|
2947
2948
|
export function defineGlobalStyles(definition: GlobalStyleObject): GlobalStyleObject
|
|
2948
|
-
export function defineTextStyles(definition: CompositionStyles['textStyles']):
|
|
2949
|
-
export function defineLayerStyles(definition: CompositionStyles['layerStyles']):
|
|
2949
|
+
export function defineTextStyles(definition: CompositionStyles['textStyles']): TextStyles
|
|
2950
|
+
export function defineLayerStyles(definition: CompositionStyles['layerStyles']): LayerStyles
|
|
2950
2951
|
export function definePattern<T extends PatternProperties>(config: PatternConfig<T>): PatternConfig
|
|
2951
2952
|
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>
|
|
2952
2953
|
}
|
|
@@ -3414,7 +3415,7 @@ var generateParserCss = (ctx) => (result) => (0, import_func.pipe)(
|
|
|
3414
3415
|
for (const pattern of patternSet) {
|
|
3415
3416
|
(0, import_ts_pattern10.match)(pattern).with({ type: "jsx-pattern", name: import_ts_pattern10.P.string }, ({ name: jsxName }) => {
|
|
3416
3417
|
pattern.data.forEach((data) => {
|
|
3417
|
-
const fnName = patterns.
|
|
3418
|
+
const fnName = patterns.find(jsxName);
|
|
3418
3419
|
const styleProps = patterns.transform(fnName, data);
|
|
3419
3420
|
sheet.processStyleProps(styleProps);
|
|
3420
3421
|
});
|
|
@@ -3613,8 +3614,8 @@ var getPatternEngine = (config) => {
|
|
|
3613
3614
|
},
|
|
3614
3615
|
getNames,
|
|
3615
3616
|
details,
|
|
3616
|
-
|
|
3617
|
-
return details.find((node) => node.jsxName
|
|
3617
|
+
find: (0, import_shared7.memo)((jsxName) => {
|
|
3618
|
+
return details.find((node) => node.match.test(jsxName))?.baseName ?? (0, import_shared7.uncapitalize)(jsxName);
|
|
3618
3619
|
}),
|
|
3619
3620
|
filter: (0, import_shared7.memo)((jsxName) => {
|
|
3620
3621
|
return details.filter((node) => node.match.test(jsxName));
|
package/dist/index.mjs
CHANGED
|
@@ -2903,6 +2903,7 @@ function getGeneratedTypes(ctx) {
|
|
|
2903
2903
|
import { outdent as outdent39 } from "outdent";
|
|
2904
2904
|
var generateTypesEntry = () => ({
|
|
2905
2905
|
global: outdent39`
|
|
2906
|
+
import type { TextStyles, LayerStyles } from '@pandacss/dev'
|
|
2906
2907
|
import type { RecipeVariantRecord, RecipeConfig, SlotRecipeVariantRecord, SlotRecipeConfig } from './recipe'
|
|
2907
2908
|
import type { Parts } from './parts'
|
|
2908
2909
|
import type { PatternConfig, PatternProperties } from './pattern'
|
|
@@ -2914,8 +2915,8 @@ var generateTypesEntry = () => ({
|
|
|
2914
2915
|
export function defineSlotRecipe<S extends string, V extends SlotRecipeVariantRecord<S>>(config: SlotRecipeConfig<S, V>): SlotRecipeConfig
|
|
2915
2916
|
export function defineStyles(definition: SystemStyleObject): SystemStyleObject
|
|
2916
2917
|
export function defineGlobalStyles(definition: GlobalStyleObject): GlobalStyleObject
|
|
2917
|
-
export function defineTextStyles(definition: CompositionStyles['textStyles']):
|
|
2918
|
-
export function defineLayerStyles(definition: CompositionStyles['layerStyles']):
|
|
2918
|
+
export function defineTextStyles(definition: CompositionStyles['textStyles']): TextStyles
|
|
2919
|
+
export function defineLayerStyles(definition: CompositionStyles['layerStyles']): LayerStyles
|
|
2919
2920
|
export function definePattern<T extends PatternProperties>(config: PatternConfig<T>): PatternConfig
|
|
2920
2921
|
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>
|
|
2921
2922
|
}
|
|
@@ -3383,7 +3384,7 @@ var generateParserCss = (ctx) => (result) => pipe(
|
|
|
3383
3384
|
for (const pattern of patternSet) {
|
|
3384
3385
|
match10(pattern).with({ type: "jsx-pattern", name: P.string }, ({ name: jsxName }) => {
|
|
3385
3386
|
pattern.data.forEach((data) => {
|
|
3386
|
-
const fnName = patterns.
|
|
3387
|
+
const fnName = patterns.find(jsxName);
|
|
3387
3388
|
const styleProps = patterns.transform(fnName, data);
|
|
3388
3389
|
sheet.processStyleProps(styleProps);
|
|
3389
3390
|
});
|
|
@@ -3554,7 +3555,7 @@ var getPathEngine = ({ cwd, emitPackage, outdir }) => {
|
|
|
3554
3555
|
};
|
|
3555
3556
|
|
|
3556
3557
|
// src/engines/pattern.ts
|
|
3557
|
-
import { capitalize as capitalize3, dashCase, mapObject as mapObject2, memo as memo2,
|
|
3558
|
+
import { capitalize as capitalize3, dashCase, mapObject as mapObject2, memo as memo2, createRegex, uncapitalize } from "@pandacss/shared";
|
|
3558
3559
|
var helpers2 = { map: mapObject2 };
|
|
3559
3560
|
var getPatternEngine = (config) => {
|
|
3560
3561
|
const patterns = config.patterns ?? {};
|
|
@@ -3588,8 +3589,8 @@ var getPatternEngine = (config) => {
|
|
|
3588
3589
|
},
|
|
3589
3590
|
getNames,
|
|
3590
3591
|
details,
|
|
3591
|
-
|
|
3592
|
-
return details.find((node) => node.jsxName
|
|
3592
|
+
find: memo2((jsxName) => {
|
|
3593
|
+
return details.find((node) => node.match.test(jsxName))?.baseName ?? uncapitalize(jsxName);
|
|
3593
3594
|
}),
|
|
3594
3595
|
filter: memo2((jsxName) => {
|
|
3595
3596
|
return details.filter((node) => node.match.test(jsxName));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"pluralize": "8.0.0",
|
|
21
21
|
"postcss": "8.4.27",
|
|
22
22
|
"ts-pattern": "5.0.4",
|
|
23
|
-
"@pandacss/core": "0.
|
|
24
|
-
"@pandacss/is-valid-prop": "0.
|
|
25
|
-
"@pandacss/logger": "0.
|
|
26
|
-
"@pandacss/shared": "0.
|
|
27
|
-
"@pandacss/token-dictionary": "0.
|
|
28
|
-
"@pandacss/types": "0.
|
|
23
|
+
"@pandacss/core": "0.13.0",
|
|
24
|
+
"@pandacss/is-valid-prop": "0.13.0",
|
|
25
|
+
"@pandacss/logger": "0.13.0",
|
|
26
|
+
"@pandacss/shared": "0.13.0",
|
|
27
|
+
"@pandacss/token-dictionary": "0.13.0",
|
|
28
|
+
"@pandacss/types": "0.13.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.30",
|
|
32
32
|
"hookable": "5.5.3",
|
|
33
|
-
"@pandacss/fixture": "0.
|
|
33
|
+
"@pandacss/fixture": "0.13.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"prebuild": "tsx scripts/prebuild.ts",
|