@pandacss/core
Advanced tools
Comparing version 0.0.0-dev-20230106183338 to 0.0.0-dev-20230106195931
@@ -216,3 +216,2 @@ import { RawCondition, Dict, UtilityConfig, PropertyConfig, PatternHelpers, CssKeyframes, RecipeConfig, StaticCssOptions } from '@pandacss/types'; | ||
type ProcessOptions = { | ||
scope?: string[]; | ||
styles: Dict; | ||
@@ -219,0 +218,0 @@ }; |
@@ -723,3 +723,3 @@ "use strict"; | ||
// src/recipe.ts | ||
var import_shared7 = require("@pandacss/shared"); | ||
var import_shared6 = require("@pandacss/shared"); | ||
var import_lodash2 = __toESM(require("lodash.merge")); | ||
@@ -730,3 +730,2 @@ | ||
var import_postcss8 = __toESM(require("postcss")); | ||
var import_shared6 = require("@pandacss/shared"); | ||
var AtomicRule = class { | ||
@@ -749,5 +748,5 @@ constructor(context) { | ||
process = (options) => { | ||
const { scope, styles } = options; | ||
const { styles } = options; | ||
const { conditions: cond } = this.context; | ||
const styleObject = (0, import_shared6.normalizeStyleObject)(styles, this.context); | ||
const styleObject = (0, import_shared5.normalizeStyleObject)(styles, this.context); | ||
const rule = this.rule; | ||
@@ -764,6 +763,2 @@ (0, import_shared5.walkObject)(styleObject, (value, paths) => { | ||
const baseArray = [...cond.finalize(conditions), transformed.className]; | ||
if (scope && scope.length > 0) { | ||
baseArray.unshift(`[${(0, import_shared5.withoutSpace)(scope.join("__"))}]`); | ||
conditions.push(...scope); | ||
} | ||
const selector = this.hash(baseArray.join(":")); | ||
@@ -802,3 +797,3 @@ rule.selector = important ? `.${selector}\\!` : `.${selector}`; | ||
this.context = context; | ||
const { name, jsx = (0, import_shared7.capitalize)(name), base = {}, variants = {}, defaultVariants = {}, description = "" } = config; | ||
const { name, jsx = (0, import_shared6.capitalize)(name), base = {}, variants = {}, defaultVariants = {}, description = "" } = config; | ||
this.name = name; | ||
@@ -841,14 +836,6 @@ const recipe = { | ||
const transformed = {}; | ||
(0, import_shared7.walkStyles)(styleObject, (styles, scopes) => { | ||
const [selector] = scopes || []; | ||
const result = {}; | ||
const currentStyles = serializeStyle(styles, { utility, conditions }); | ||
if (selector) { | ||
result[selector] ||= {}; | ||
(0, import_lodash2.default)(result[selector], currentStyles); | ||
} else { | ||
(0, import_lodash2.default)(result, currentStyles); | ||
} | ||
(0, import_lodash2.default)(transformed, result); | ||
}); | ||
const result = {}; | ||
const currentStyles = serializeStyle(styleObject, { utility, conditions }); | ||
(0, import_lodash2.default)(result, currentStyles); | ||
(0, import_lodash2.default)(transformed, result); | ||
return transformed; | ||
@@ -970,3 +957,2 @@ }; | ||
// src/stylesheet.ts | ||
var import_shared8 = require("@pandacss/shared"); | ||
var import_postcss9 = __toESM(require("postcss")); | ||
@@ -1006,5 +992,3 @@ var Stylesheet = class { | ||
const ruleset = new AtomicRule(this.context); | ||
(0, import_shared8.walkStyles)(styleObject, (styles, scope) => { | ||
ruleset.process({ scope, styles }); | ||
}); | ||
ruleset.process({ styles: styleObject }); | ||
}; | ||
@@ -1040,3 +1024,3 @@ processRecipe = (config, styles) => { | ||
// src/utility.ts | ||
var import_shared9 = require("@pandacss/shared"); | ||
var import_shared7 = require("@pandacss/shared"); | ||
var Utility = class { | ||
@@ -1113,3 +1097,3 @@ tokens; | ||
}; | ||
if ((0, import_shared9.isString)(values)) { | ||
if ((0, import_shared7.isString)(values)) { | ||
return fn?.(values) ?? this.tokens.getValue(values) ?? {}; | ||
@@ -1123,3 +1107,3 @@ } | ||
} | ||
if ((0, import_shared9.isFunction)(values)) { | ||
if ((0, import_shared7.isFunction)(values)) { | ||
return values(resolveFn ? fn : this.getToken.bind(this)); | ||
@@ -1265,5 +1249,5 @@ } | ||
const key = this.resolveShorthand(prop); | ||
return (0, import_shared9.compact)({ | ||
return (0, import_shared7.compact)({ | ||
layer: this.configs.get(key)?.layer, | ||
className: this.getOrCreateClassName(key, (0, import_shared9.withoutSpace)(value)), | ||
className: this.getOrCreateClassName(key, (0, import_shared7.withoutSpace)(value)), | ||
styles: this.getOrCreateStyle(key, value) | ||
@@ -1270,0 +1254,0 @@ }); |
{ | ||
"name": "@pandacss/core", | ||
"version": "0.0.0-dev-20230106183338", | ||
"version": "0.0.0-dev-20230106195931", | ||
"description": "core functions for extract-it", | ||
@@ -29,11 +29,11 @@ "main": "dist/index.js", | ||
"lodash.merge": "4.6.2", | ||
"@pandacss/error": "0.0.0-dev-20230106183338", | ||
"@pandacss/types": "0.0.0-dev-20230106183338", | ||
"@pandacss/shared": "0.0.0-dev-20230106183338", | ||
"@pandacss/logger": "0.0.0-dev-20230106183338", | ||
"@pandacss/token-dictionary": "0.0.0-dev-20230106183338" | ||
"@pandacss/error": "0.0.0-dev-20230106195931", | ||
"@pandacss/types": "0.0.0-dev-20230106195931", | ||
"@pandacss/shared": "0.0.0-dev-20230106195931", | ||
"@pandacss/logger": "0.0.0-dev-20230106195931", | ||
"@pandacss/token-dictionary": "0.0.0-dev-20230106195931" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash.merge": "4.6.7", | ||
"@pandacss/fixture": "0.0.0-dev-20230106183338" | ||
"@pandacss/fixture": "0.0.0-dev-20230106195931" | ||
}, | ||
@@ -40,0 +40,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
83019
2691
+ Added@pandacss/error@0.0.0-dev-20230106195931(transitive)
+ Added@pandacss/logger@0.0.0-dev-20230106195931(transitive)
+ Added@pandacss/shared@0.0.0-dev-20230106195931(transitive)
+ Added@pandacss/token-dictionary@0.0.0-dev-20230106195931(transitive)
+ Added@pandacss/types@0.0.0-dev-20230106195931(transitive)
- Removed@pandacss/error@0.0.0-dev-20230106183338(transitive)
- Removed@pandacss/logger@0.0.0-dev-20230106183338(transitive)
- Removed@pandacss/shared@0.0.0-dev-20230106183338(transitive)
- Removed@pandacss/token-dictionary@0.0.0-dev-20230106183338(transitive)
- Removed@pandacss/types@0.0.0-dev-20230106183338(transitive)