@pandacss/node 0.0.0-dev-20221124174429 → 0.0.0-dev-20221125162640
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 -2
- package/dist/index.mjs +13 -2
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -125,12 +125,20 @@ function generateConditions(ctx) {
|
|
|
125
125
|
const keys = Object.keys(ctx.conditions.values).concat("_", "base");
|
|
126
126
|
return {
|
|
127
127
|
js: import_outdent.default`
|
|
128
|
+
import { withoutSpace } from '../helpers'
|
|
128
129
|
const conditions = new Set([${keys.map((key) => JSON.stringify(key))}])
|
|
129
130
|
|
|
130
131
|
export function isCondition(value){
|
|
131
132
|
return conditions.has(value) || /^@|&|&$/.test(value)
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
export function finalizeConditions(paths){
|
|
136
|
+
return paths.map((path) => {
|
|
137
|
+
if (conditions.has(path)) return path
|
|
138
|
+
if (/&|@/.test(path)) return \`[\${withoutSpace(path.trim())}]\`
|
|
139
|
+
return path
|
|
140
|
+
})}
|
|
141
|
+
|
|
134
142
|
export function sortConditions(paths){
|
|
135
143
|
return paths.sort((a, b) => {
|
|
136
144
|
const aa = isCondition(a)
|
|
@@ -161,7 +169,7 @@ function generateCssFn(ctx) {
|
|
|
161
169
|
`,
|
|
162
170
|
js: import_outdent2.outdent`
|
|
163
171
|
import { createCss, withoutSpace } from "../helpers"
|
|
164
|
-
import { sortConditions } from "./conditions"
|
|
172
|
+
import { sortConditions, finalizeConditions } from "./conditions"
|
|
165
173
|
|
|
166
174
|
const classNameMap = ${stringify(utility.entries())}
|
|
167
175
|
const shorthands = ${stringify(utility.shorthands)}
|
|
@@ -179,7 +187,7 @@ function generateCssFn(ctx) {
|
|
|
179
187
|
|
|
180
188
|
const context = {
|
|
181
189
|
transform,
|
|
182
|
-
conditions: { shift: sortConditions },
|
|
190
|
+
conditions: { shift: sortConditions, finalize: finalizeConditions },
|
|
183
191
|
hash: ${hash ? "true" : "false"},
|
|
184
192
|
hasShorthand,
|
|
185
193
|
resolveShorthand,
|
|
@@ -1610,6 +1618,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1610
1618
|
semanticTokens,
|
|
1611
1619
|
prefix: cssVarPrefix
|
|
1612
1620
|
});
|
|
1621
|
+
import_logger4.logger.debug({ type: "ctx:token", msg: tokens.allNames });
|
|
1613
1622
|
const utility = new import_core3.Utility({
|
|
1614
1623
|
tokens,
|
|
1615
1624
|
config: utilities,
|
|
@@ -1619,6 +1628,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1619
1628
|
conditions: conditionsProp,
|
|
1620
1629
|
breakpoints
|
|
1621
1630
|
});
|
|
1631
|
+
import_logger4.logger.debug({ type: "ctx:conditions", msg: conditions });
|
|
1622
1632
|
(0, import_core3.assignCompositions)(
|
|
1623
1633
|
{ conditions, utility },
|
|
1624
1634
|
(0, import_shared11.compact)({
|
|
@@ -1741,6 +1751,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1741
1751
|
return import_fast_glob.default.sync(config.include, { cwd, ignore: config.exclude, absolute: true });
|
|
1742
1752
|
}
|
|
1743
1753
|
const files = getFiles();
|
|
1754
|
+
import_logger4.logger.debug({ type: "ctx:files", msg: files });
|
|
1744
1755
|
const importMap = {
|
|
1745
1756
|
css: `${outdir}/css`,
|
|
1746
1757
|
recipe: `${outdir}/recipes`,
|
package/dist/index.mjs
CHANGED
|
@@ -80,12 +80,20 @@ function generateConditions(ctx) {
|
|
|
80
80
|
const keys = Object.keys(ctx.conditions.values).concat("_", "base");
|
|
81
81
|
return {
|
|
82
82
|
js: outdent`
|
|
83
|
+
import { withoutSpace } from '../helpers'
|
|
83
84
|
const conditions = new Set([${keys.map((key) => JSON.stringify(key))}])
|
|
84
85
|
|
|
85
86
|
export function isCondition(value){
|
|
86
87
|
return conditions.has(value) || /^@|&|&$/.test(value)
|
|
87
88
|
}
|
|
88
89
|
|
|
90
|
+
export function finalizeConditions(paths){
|
|
91
|
+
return paths.map((path) => {
|
|
92
|
+
if (conditions.has(path)) return path
|
|
93
|
+
if (/&|@/.test(path)) return \`[\${withoutSpace(path.trim())}]\`
|
|
94
|
+
return path
|
|
95
|
+
})}
|
|
96
|
+
|
|
89
97
|
export function sortConditions(paths){
|
|
90
98
|
return paths.sort((a, b) => {
|
|
91
99
|
const aa = isCondition(a)
|
|
@@ -116,7 +124,7 @@ function generateCssFn(ctx) {
|
|
|
116
124
|
`,
|
|
117
125
|
js: outdent2`
|
|
118
126
|
import { createCss, withoutSpace } from "../helpers"
|
|
119
|
-
import { sortConditions } from "./conditions"
|
|
127
|
+
import { sortConditions, finalizeConditions } from "./conditions"
|
|
120
128
|
|
|
121
129
|
const classNameMap = ${stringify(utility.entries())}
|
|
122
130
|
const shorthands = ${stringify(utility.shorthands)}
|
|
@@ -134,7 +142,7 @@ function generateCssFn(ctx) {
|
|
|
134
142
|
|
|
135
143
|
const context = {
|
|
136
144
|
transform,
|
|
137
|
-
conditions: { shift: sortConditions },
|
|
145
|
+
conditions: { shift: sortConditions, finalize: finalizeConditions },
|
|
138
146
|
hash: ${hash ? "true" : "false"},
|
|
139
147
|
hasShorthand,
|
|
140
148
|
resolveShorthand,
|
|
@@ -1571,6 +1579,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1571
1579
|
semanticTokens,
|
|
1572
1580
|
prefix: cssVarPrefix
|
|
1573
1581
|
});
|
|
1582
|
+
logger4.debug({ type: "ctx:token", msg: tokens.allNames });
|
|
1574
1583
|
const utility = new Utility({
|
|
1575
1584
|
tokens,
|
|
1576
1585
|
config: utilities,
|
|
@@ -1580,6 +1589,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1580
1589
|
conditions: conditionsProp,
|
|
1581
1590
|
breakpoints
|
|
1582
1591
|
});
|
|
1592
|
+
logger4.debug({ type: "ctx:conditions", msg: conditions });
|
|
1583
1593
|
assignCompositions(
|
|
1584
1594
|
{ conditions, utility },
|
|
1585
1595
|
compact({
|
|
@@ -1702,6 +1712,7 @@ function createContext(conf, io = fileSystem) {
|
|
|
1702
1712
|
return glob.sync(config.include, { cwd, ignore: config.exclude, absolute: true });
|
|
1703
1713
|
}
|
|
1704
1714
|
const files = getFiles();
|
|
1715
|
+
logger4.debug({ type: "ctx:files", msg: files });
|
|
1705
1716
|
const importMap = {
|
|
1706
1717
|
css: `${outdir}/css`,
|
|
1707
1718
|
recipe: `${outdir}/recipes`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/node",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20221125162640",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"telejson": "6.0.8",
|
|
31
31
|
"ts-pattern": "4.0.6",
|
|
32
32
|
"ts-morph": "17.0.1",
|
|
33
|
-
"@pandacss/types": "0.0.0-dev-
|
|
34
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
35
|
-
"@pandacss/error": "0.0.0-dev-
|
|
36
|
-
"@pandacss/parser": "0.0.0-dev-
|
|
37
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
38
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
39
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
40
|
-
"@pandacss/core": "0.0.0-dev-
|
|
41
|
-
"@pandacss/config": "0.0.0-dev-
|
|
33
|
+
"@pandacss/types": "0.0.0-dev-20221125162640",
|
|
34
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20221125162640",
|
|
35
|
+
"@pandacss/error": "0.0.0-dev-20221125162640",
|
|
36
|
+
"@pandacss/parser": "0.0.0-dev-20221125162640",
|
|
37
|
+
"@pandacss/shared": "0.0.0-dev-20221125162640",
|
|
38
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20221125162640",
|
|
39
|
+
"@pandacss/logger": "0.0.0-dev-20221125162640",
|
|
40
|
+
"@pandacss/core": "0.0.0-dev-20221125162640",
|
|
41
|
+
"@pandacss/config": "0.0.0-dev-20221125162640"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/fs-extra": "9.0.13",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/glob-parent": "^5.1.1",
|
|
47
47
|
"@types/pluralize": "0.0.29",
|
|
48
48
|
"@types/lodash.merge": "4.6.7",
|
|
49
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
49
|
+
"@pandacss/fixture": "0.0.0-dev-20221125162640"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup src/index.ts --format=cjs,esm --shims --dts",
|