@bamboocss/generator 1.40.1 → 1.41.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.cjs +28 -5
- package/dist/index.mjs +28 -5
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -2424,7 +2424,17 @@ function generatePropTypes(ctx) {
|
|
|
2424
2424
|
* writes on purpose.
|
|
2425
2425
|
*/
|
|
2426
2426
|
type Modifier = "/" | "!" | " !"
|
|
2427
|
-
|
|
2427
|
+
/**
|
|
2428
|
+
* \`Extract\`, not a \`[T] extends [string]\` test, which was the same thing until a utility
|
|
2429
|
+
* carried keywords beside its tokens: \`KnownKeywords\` keeps \`Number\` deliberately, and that
|
|
2430
|
+
* one non-string member turned every modifier form off for the whole property. It rejected
|
|
2431
|
+
* \`roundedBottom: 'lg!'\` while \`rounded: 'lg!'\` passed, purely because the two utilities are
|
|
2432
|
+
* declared differently — both emit \`var(--radii-lg) !important\`.
|
|
2433
|
+
*
|
|
2434
|
+
* Filtering costs nothing the test did not: the same string members distribute either way,
|
|
2435
|
+
* and \`Extract\` of no strings is \`never\`, exactly what the false branch returned.
|
|
2436
|
+
*/
|
|
2437
|
+
type WithModifier<T> = \`\${Extract<T, string>}\${Modifier}\${string}\` & { __modifier?: true }
|
|
2428
2438
|
|
|
2429
2439
|
/**
|
|
2430
2440
|
* A list of candidate values, most-preferred first, emitted as repeated declarations so the
|
|
@@ -2515,6 +2525,19 @@ function generateStyleProps(ctx) {
|
|
|
2515
2525
|
*/
|
|
2516
2526
|
let heldOutTokens = "";
|
|
2517
2527
|
const separateTokens = ctx.config.strictTokens === "unknown-tokens";
|
|
2528
|
+
/**
|
|
2529
|
+
* The keywords go with them, so a mark does not depend on being a token.
|
|
2530
|
+
*
|
|
2531
|
+
* Only what `WithEscapeHatch` wraps carries `!` and `/`, and that used to be the
|
|
2532
|
+
* tokens alone — so `shadow: 'none!'` was an error while `shadow: 'none'` and
|
|
2533
|
+
* `color: 'red.300!'` were both fine, decided by whether the value happened to be a
|
|
2534
|
+
* token rather than by anything the author can see.
|
|
2535
|
+
*
|
|
2536
|
+
* Held out only where there is a narrowed list to hold: an `authorIdentProperty`
|
|
2537
|
+
* keeps csstype's open string, which must stay outside the wrapper or the property
|
|
2538
|
+
* accepts nothing but marked values.
|
|
2539
|
+
*/
|
|
2540
|
+
const heldOutKeywords = separateTokens ? knownFallback : "";
|
|
2518
2541
|
if (propTypes.has(prop)) {
|
|
2519
2542
|
const tokenValue = `UtilityValues["${prop}"]`;
|
|
2520
2543
|
if (separateTokens) heldOutTokens = tokenValue;
|
|
@@ -2522,19 +2545,19 @@ function generateStyleProps(ctx) {
|
|
|
2522
2545
|
if (strictPropertyList.has(key)) union.push([
|
|
2523
2546
|
own,
|
|
2524
2547
|
"CssVars",
|
|
2525
|
-
knownFallback
|
|
2548
|
+
heldOutKeywords ? "" : knownFallback
|
|
2526
2549
|
].filter(Boolean).join(" | "));
|
|
2527
2550
|
else union.push([
|
|
2528
2551
|
own,
|
|
2529
2552
|
"CssVars",
|
|
2530
|
-
gradedFallback
|
|
2553
|
+
heldOutKeywords ? "" : gradedFallback
|
|
2531
2554
|
].filter(Boolean).join(" | "));
|
|
2532
|
-
} else union.push([strictPropertyList.has(key) ? "CssVars" : "", knownFallback || cssFallback].filter(Boolean).join(" | "));
|
|
2555
|
+
} else union.push([strictPropertyList.has(key) ? "CssVars" : "", heldOutKeywords ? "" : knownFallback || cssFallback].filter(Boolean).join(" | "));
|
|
2533
2556
|
const filtered = union.filter(Boolean);
|
|
2534
2557
|
if (!filtered.length) filtered.push("string | number");
|
|
2535
2558
|
let comment = comments?.[prop] || "";
|
|
2536
2559
|
if (ctx.utility.isDeprecated(prop)) comment = comment ? comment.replace("@see", "@deprecated\n@see") : "/** @deprecated */";
|
|
2537
|
-
const line = `${key}?: ${restrict(prop, filtered.filter(Boolean).join(" | "), ctx.config, heldOutTokens)}`;
|
|
2560
|
+
const line = `${key}?: ${restrict(prop, filtered.filter(Boolean).join(" | "), ctx.config, [heldOutTokens, heldOutKeywords].filter(Boolean).join(" | "))}`;
|
|
2538
2561
|
return " " + [comment, line].filter(Boolean).join("\n");
|
|
2539
2562
|
}).join("\n")}
|
|
2540
2563
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -2398,7 +2398,17 @@ function generatePropTypes(ctx) {
|
|
|
2398
2398
|
* writes on purpose.
|
|
2399
2399
|
*/
|
|
2400
2400
|
type Modifier = "/" | "!" | " !"
|
|
2401
|
-
|
|
2401
|
+
/**
|
|
2402
|
+
* \`Extract\`, not a \`[T] extends [string]\` test, which was the same thing until a utility
|
|
2403
|
+
* carried keywords beside its tokens: \`KnownKeywords\` keeps \`Number\` deliberately, and that
|
|
2404
|
+
* one non-string member turned every modifier form off for the whole property. It rejected
|
|
2405
|
+
* \`roundedBottom: 'lg!'\` while \`rounded: 'lg!'\` passed, purely because the two utilities are
|
|
2406
|
+
* declared differently — both emit \`var(--radii-lg) !important\`.
|
|
2407
|
+
*
|
|
2408
|
+
* Filtering costs nothing the test did not: the same string members distribute either way,
|
|
2409
|
+
* and \`Extract\` of no strings is \`never\`, exactly what the false branch returned.
|
|
2410
|
+
*/
|
|
2411
|
+
type WithModifier<T> = \`\${Extract<T, string>}\${Modifier}\${string}\` & { __modifier?: true }
|
|
2402
2412
|
|
|
2403
2413
|
/**
|
|
2404
2414
|
* A list of candidate values, most-preferred first, emitted as repeated declarations so the
|
|
@@ -2489,6 +2499,19 @@ function generateStyleProps(ctx) {
|
|
|
2489
2499
|
*/
|
|
2490
2500
|
let heldOutTokens = "";
|
|
2491
2501
|
const separateTokens = ctx.config.strictTokens === "unknown-tokens";
|
|
2502
|
+
/**
|
|
2503
|
+
* The keywords go with them, so a mark does not depend on being a token.
|
|
2504
|
+
*
|
|
2505
|
+
* Only what `WithEscapeHatch` wraps carries `!` and `/`, and that used to be the
|
|
2506
|
+
* tokens alone — so `shadow: 'none!'` was an error while `shadow: 'none'` and
|
|
2507
|
+
* `color: 'red.300!'` were both fine, decided by whether the value happened to be a
|
|
2508
|
+
* token rather than by anything the author can see.
|
|
2509
|
+
*
|
|
2510
|
+
* Held out only where there is a narrowed list to hold: an `authorIdentProperty`
|
|
2511
|
+
* keeps csstype's open string, which must stay outside the wrapper or the property
|
|
2512
|
+
* accepts nothing but marked values.
|
|
2513
|
+
*/
|
|
2514
|
+
const heldOutKeywords = separateTokens ? knownFallback : "";
|
|
2492
2515
|
if (propTypes.has(prop)) {
|
|
2493
2516
|
const tokenValue = `UtilityValues["${prop}"]`;
|
|
2494
2517
|
if (separateTokens) heldOutTokens = tokenValue;
|
|
@@ -2496,19 +2519,19 @@ function generateStyleProps(ctx) {
|
|
|
2496
2519
|
if (strictPropertyList.has(key)) union.push([
|
|
2497
2520
|
own,
|
|
2498
2521
|
"CssVars",
|
|
2499
|
-
knownFallback
|
|
2522
|
+
heldOutKeywords ? "" : knownFallback
|
|
2500
2523
|
].filter(Boolean).join(" | "));
|
|
2501
2524
|
else union.push([
|
|
2502
2525
|
own,
|
|
2503
2526
|
"CssVars",
|
|
2504
|
-
gradedFallback
|
|
2527
|
+
heldOutKeywords ? "" : gradedFallback
|
|
2505
2528
|
].filter(Boolean).join(" | "));
|
|
2506
|
-
} else union.push([strictPropertyList.has(key) ? "CssVars" : "", knownFallback || cssFallback].filter(Boolean).join(" | "));
|
|
2529
|
+
} else union.push([strictPropertyList.has(key) ? "CssVars" : "", heldOutKeywords ? "" : knownFallback || cssFallback].filter(Boolean).join(" | "));
|
|
2507
2530
|
const filtered = union.filter(Boolean);
|
|
2508
2531
|
if (!filtered.length) filtered.push("string | number");
|
|
2509
2532
|
let comment = comments?.[prop] || "";
|
|
2510
2533
|
if (ctx.utility.isDeprecated(prop)) comment = comment ? comment.replace("@see", "@deprecated\n@see") : "/** @deprecated */";
|
|
2511
|
-
const line = `${key}?: ${restrict(prop, filtered.filter(Boolean).join(" | "), ctx.config, heldOutTokens)}`;
|
|
2534
|
+
const line = `${key}?: ${restrict(prop, filtered.filter(Boolean).join(" | "), ctx.config, [heldOutTokens, heldOutKeywords].filter(Boolean).join(" | "))}`;
|
|
2512
2535
|
return " " + [comment, line].filter(Boolean).join("\n");
|
|
2513
2536
|
}).join("\n")}
|
|
2514
2537
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/generator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.1",
|
|
4
4
|
"description": "The css generator for css bamboo",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"pluralize": "8.0.0",
|
|
39
39
|
"postcss": "8.5.26",
|
|
40
40
|
"ts-pattern": "5.9.0",
|
|
41
|
-
"@bamboocss/core": "1.
|
|
42
|
-
"@bamboocss/is-valid-prop": "^1.
|
|
43
|
-
"@bamboocss/logger": "1.
|
|
44
|
-
"@bamboocss/shared": "1.
|
|
45
|
-
"@bamboocss/token-dictionary": "1.
|
|
46
|
-
"@bamboocss/types": "1.
|
|
41
|
+
"@bamboocss/core": "1.41.1",
|
|
42
|
+
"@bamboocss/is-valid-prop": "^1.41.1",
|
|
43
|
+
"@bamboocss/logger": "1.41.1",
|
|
44
|
+
"@bamboocss/shared": "1.41.1",
|
|
45
|
+
"@bamboocss/token-dictionary": "1.41.1",
|
|
46
|
+
"@bamboocss/types": "1.41.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/pluralize": "0.0.33"
|