@pandacss/generator 0.0.0-dev-20230416210337 → 0.0.0-dev-20230417092402
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 +14 -11
- package/dist/index.mjs +14 -11
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -367,26 +367,29 @@ function generateConditions(ctx) {
|
|
|
367
367
|
return {
|
|
368
368
|
js: import_outdent3.default`
|
|
369
369
|
${ctx.file.import("withoutSpace", "../helpers")}
|
|
370
|
-
|
|
370
|
+
|
|
371
371
|
const conditions = new Set([${keys.map((key) => JSON.stringify(key))}])
|
|
372
|
-
|
|
372
|
+
|
|
373
373
|
export function isCondition(value){
|
|
374
374
|
return conditions.has(value) || /^@|&|&$/.test(value)
|
|
375
375
|
}
|
|
376
|
-
|
|
376
|
+
|
|
377
|
+
const underscoreRegex = /^_/
|
|
378
|
+
const selectorRegex = /&|@/
|
|
379
|
+
|
|
377
380
|
export function finalizeConditions(paths){
|
|
378
381
|
return paths.map((path) => {
|
|
379
382
|
if (conditions.has(path)){
|
|
380
|
-
return path.replace(
|
|
383
|
+
return path.replace(underscoreRegex, '')
|
|
381
384
|
}
|
|
382
|
-
|
|
383
|
-
if (
|
|
385
|
+
|
|
386
|
+
if (selectorRegex.test(path)){
|
|
384
387
|
return \`[\${withoutSpace(path.trim())}]\`
|
|
385
388
|
}
|
|
386
|
-
|
|
389
|
+
|
|
387
390
|
return path
|
|
388
391
|
})}
|
|
389
|
-
|
|
392
|
+
|
|
390
393
|
export function sortConditions(paths){
|
|
391
394
|
return paths.sort((a, b) => {
|
|
392
395
|
const aa = isCondition(a)
|
|
@@ -399,7 +402,7 @@ function generateConditions(ctx) {
|
|
|
399
402
|
`,
|
|
400
403
|
dts: import_outdent3.default`
|
|
401
404
|
import type { AnySelector, Selectors } from './selectors'
|
|
402
|
-
|
|
405
|
+
|
|
403
406
|
export type Conditions = {
|
|
404
407
|
${keys.map((key) => ` ${JSON.stringify(key)}: string`).join("\n")}
|
|
405
408
|
}
|
|
@@ -412,7 +415,7 @@ function generateConditions(ctx) {
|
|
|
412
415
|
| {
|
|
413
416
|
[K in keyof Conditions]?: Conditional<V>
|
|
414
417
|
}
|
|
415
|
-
|
|
418
|
+
|
|
416
419
|
export type ConditionalValue<T> = Conditional<T>
|
|
417
420
|
|
|
418
421
|
export type Nested<P> = P & {
|
|
@@ -422,7 +425,7 @@ function generateConditions(ctx) {
|
|
|
422
425
|
} & {
|
|
423
426
|
[K in keyof Conditions]?: Nested<P>
|
|
424
427
|
}
|
|
425
|
-
|
|
428
|
+
|
|
426
429
|
`
|
|
427
430
|
};
|
|
428
431
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -336,26 +336,29 @@ function generateConditions(ctx) {
|
|
|
336
336
|
return {
|
|
337
337
|
js: outdent3`
|
|
338
338
|
${ctx.file.import("withoutSpace", "../helpers")}
|
|
339
|
-
|
|
339
|
+
|
|
340
340
|
const conditions = new Set([${keys.map((key) => JSON.stringify(key))}])
|
|
341
|
-
|
|
341
|
+
|
|
342
342
|
export function isCondition(value){
|
|
343
343
|
return conditions.has(value) || /^@|&|&$/.test(value)
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
|
|
346
|
+
const underscoreRegex = /^_/
|
|
347
|
+
const selectorRegex = /&|@/
|
|
348
|
+
|
|
346
349
|
export function finalizeConditions(paths){
|
|
347
350
|
return paths.map((path) => {
|
|
348
351
|
if (conditions.has(path)){
|
|
349
|
-
return path.replace(
|
|
352
|
+
return path.replace(underscoreRegex, '')
|
|
350
353
|
}
|
|
351
|
-
|
|
352
|
-
if (
|
|
354
|
+
|
|
355
|
+
if (selectorRegex.test(path)){
|
|
353
356
|
return \`[\${withoutSpace(path.trim())}]\`
|
|
354
357
|
}
|
|
355
|
-
|
|
358
|
+
|
|
356
359
|
return path
|
|
357
360
|
})}
|
|
358
|
-
|
|
361
|
+
|
|
359
362
|
export function sortConditions(paths){
|
|
360
363
|
return paths.sort((a, b) => {
|
|
361
364
|
const aa = isCondition(a)
|
|
@@ -368,7 +371,7 @@ function generateConditions(ctx) {
|
|
|
368
371
|
`,
|
|
369
372
|
dts: outdent3`
|
|
370
373
|
import type { AnySelector, Selectors } from './selectors'
|
|
371
|
-
|
|
374
|
+
|
|
372
375
|
export type Conditions = {
|
|
373
376
|
${keys.map((key) => ` ${JSON.stringify(key)}: string`).join("\n")}
|
|
374
377
|
}
|
|
@@ -381,7 +384,7 @@ function generateConditions(ctx) {
|
|
|
381
384
|
| {
|
|
382
385
|
[K in keyof Conditions]?: Conditional<V>
|
|
383
386
|
}
|
|
384
|
-
|
|
387
|
+
|
|
385
388
|
export type ConditionalValue<T> = Conditional<T>
|
|
386
389
|
|
|
387
390
|
export type Nested<P> = P & {
|
|
@@ -391,7 +394,7 @@ function generateConditions(ctx) {
|
|
|
391
394
|
} & {
|
|
392
395
|
[K in keyof Conditions]?: Nested<P>
|
|
393
396
|
}
|
|
394
|
-
|
|
397
|
+
|
|
395
398
|
`
|
|
396
399
|
};
|
|
397
400
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/generator",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230417092402",
|
|
4
4
|
"description": "The css generator for css panda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"pluralize": "8.0.0",
|
|
21
21
|
"postcss": "8.4.22",
|
|
22
22
|
"ts-pattern": "4.2.2",
|
|
23
|
-
"@pandacss/core": "0.0.0-dev-
|
|
24
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
25
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
26
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
27
|
-
"@pandacss/types": "0.0.0-dev-
|
|
28
|
-
"@pandacss/token-dictionary": "0.0.0-dev-
|
|
23
|
+
"@pandacss/core": "0.0.0-dev-20230417092402",
|
|
24
|
+
"@pandacss/logger": "0.0.0-dev-20230417092402",
|
|
25
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230417092402",
|
|
26
|
+
"@pandacss/shared": "0.0.0-dev-20230417092402",
|
|
27
|
+
"@pandacss/types": "0.0.0-dev-20230417092402",
|
|
28
|
+
"@pandacss/token-dictionary": "0.0.0-dev-20230417092402"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.29",
|
|
32
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
32
|
+
"@pandacss/fixture": "0.0.0-dev-20230417092402"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"prebuild": "tsx scripts/prebuild.ts",
|