@pandacss/generator 0.33.0 → 0.34.1
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 +13 -4
- package/dist/index.mjs +14 -5
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -483,12 +483,11 @@ function generateIsValidProp(ctx) {
|
|
|
483
483
|
import type { DistributiveOmit, HTMLPandaProps, JsxStyleProps, Pretty } from '../types';
|
|
484
484
|
|
|
485
485
|
declare const isCssProperty: (value: string) => boolean;
|
|
486
|
-
|
|
486
|
+
|
|
487
487
|
type CssPropKey = keyof JsxStyleProps
|
|
488
|
-
type PickedCssProps<T> = Pretty<Pick<T, CssPropKey>>
|
|
489
488
|
type OmittedCssProps<T> = Pretty<DistributiveOmit<T, CssPropKey>>
|
|
490
489
|
|
|
491
|
-
declare const splitCssProps: <T>(props: T) => [
|
|
490
|
+
declare const splitCssProps: <T>(props: T) => [JsxStyleProps, OmittedCssProps<T>]
|
|
492
491
|
|
|
493
492
|
export { isCssProperty, splitCssProps };
|
|
494
493
|
`
|
|
@@ -3761,6 +3760,7 @@ var generateStaticCss = (ctx, sheet) => {
|
|
|
3761
3760
|
// src/artifacts/css/token-css.ts
|
|
3762
3761
|
var import_core4 = require("@pandacss/core");
|
|
3763
3762
|
var import_postcss = __toESM(require("postcss"));
|
|
3763
|
+
var import_logger2 = require("@pandacss/logger");
|
|
3764
3764
|
function generateTokenCss(ctx, sheet) {
|
|
3765
3765
|
const {
|
|
3766
3766
|
config: { cssVarRoot },
|
|
@@ -3822,8 +3822,17 @@ function getDeepestNode(node) {
|
|
|
3822
3822
|
}
|
|
3823
3823
|
return node;
|
|
3824
3824
|
}
|
|
3825
|
+
var parse = (str) => {
|
|
3826
|
+
try {
|
|
3827
|
+
return import_postcss.default.parse(str);
|
|
3828
|
+
} catch (error) {
|
|
3829
|
+
if (error instanceof import_postcss.CssSyntaxError) {
|
|
3830
|
+
import_logger2.logger.error("tokens:process", error.showSourceCode(true));
|
|
3831
|
+
}
|
|
3832
|
+
}
|
|
3833
|
+
};
|
|
3825
3834
|
function cleanupSelectors(css, varSelector) {
|
|
3826
|
-
const root = import_postcss.default.
|
|
3835
|
+
const root = parse(css) ?? import_postcss.default.root();
|
|
3827
3836
|
root.walkRules((rule) => {
|
|
3828
3837
|
const selectors = [];
|
|
3829
3838
|
rule.selectors.forEach((selector) => {
|
package/dist/index.mjs
CHANGED
|
@@ -447,12 +447,11 @@ function generateIsValidProp(ctx) {
|
|
|
447
447
|
import type { DistributiveOmit, HTMLPandaProps, JsxStyleProps, Pretty } from '../types';
|
|
448
448
|
|
|
449
449
|
declare const isCssProperty: (value: string) => boolean;
|
|
450
|
-
|
|
450
|
+
|
|
451
451
|
type CssPropKey = keyof JsxStyleProps
|
|
452
|
-
type PickedCssProps<T> = Pretty<Pick<T, CssPropKey>>
|
|
453
452
|
type OmittedCssProps<T> = Pretty<DistributiveOmit<T, CssPropKey>>
|
|
454
453
|
|
|
455
|
-
declare const splitCssProps: <T>(props: T) => [
|
|
454
|
+
declare const splitCssProps: <T>(props: T) => [JsxStyleProps, OmittedCssProps<T>]
|
|
456
455
|
|
|
457
456
|
export { isCssProperty, splitCssProps };
|
|
458
457
|
`
|
|
@@ -3724,7 +3723,8 @@ var generateStaticCss = (ctx, sheet) => {
|
|
|
3724
3723
|
|
|
3725
3724
|
// src/artifacts/css/token-css.ts
|
|
3726
3725
|
import { expandNestedCss, extractParentSelectors, stringify as stringify4 } from "@pandacss/core";
|
|
3727
|
-
import postcss from "postcss";
|
|
3726
|
+
import postcss, { CssSyntaxError } from "postcss";
|
|
3727
|
+
import { logger as logger2 } from "@pandacss/logger";
|
|
3728
3728
|
function generateTokenCss(ctx, sheet) {
|
|
3729
3729
|
const {
|
|
3730
3730
|
config: { cssVarRoot },
|
|
@@ -3786,8 +3786,17 @@ function getDeepestNode(node) {
|
|
|
3786
3786
|
}
|
|
3787
3787
|
return node;
|
|
3788
3788
|
}
|
|
3789
|
+
var parse = (str) => {
|
|
3790
|
+
try {
|
|
3791
|
+
return postcss.parse(str);
|
|
3792
|
+
} catch (error) {
|
|
3793
|
+
if (error instanceof CssSyntaxError) {
|
|
3794
|
+
logger2.error("tokens:process", error.showSourceCode(true));
|
|
3795
|
+
}
|
|
3796
|
+
}
|
|
3797
|
+
};
|
|
3789
3798
|
function cleanupSelectors(css, varSelector) {
|
|
3790
|
-
const root =
|
|
3799
|
+
const root = parse(css) ?? postcss.root();
|
|
3791
3800
|
root.walkRules((rule) => {
|
|
3792
3801
|
const selectors = [];
|
|
3793
3802
|
rule.selectors.forEach((selector) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.1",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"pluralize": "8.0.0",
|
|
38
38
|
"postcss": "8.4.35",
|
|
39
39
|
"ts-pattern": "5.0.8",
|
|
40
|
-
"@pandacss/core": "0.
|
|
41
|
-
"@pandacss/is-valid-prop": "^0.
|
|
42
|
-
"@pandacss/logger": "0.
|
|
43
|
-
"@pandacss/shared": "0.
|
|
44
|
-
"@pandacss/token-dictionary": "0.
|
|
45
|
-
"@pandacss/types": "0.
|
|
40
|
+
"@pandacss/core": "0.34.1",
|
|
41
|
+
"@pandacss/is-valid-prop": "^0.34.1",
|
|
42
|
+
"@pandacss/logger": "0.34.1",
|
|
43
|
+
"@pandacss/shared": "0.34.1",
|
|
44
|
+
"@pandacss/token-dictionary": "0.34.1",
|
|
45
|
+
"@pandacss/types": "0.34.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/pluralize": "0.0.33"
|