@bamboocss/generator 1.41.0 → 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 CHANGED
@@ -2525,6 +2525,19 @@ function generateStyleProps(ctx) {
2525
2525
  */
2526
2526
  let heldOutTokens = "";
2527
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 : "";
2528
2541
  if (propTypes.has(prop)) {
2529
2542
  const tokenValue = `UtilityValues["${prop}"]`;
2530
2543
  if (separateTokens) heldOutTokens = tokenValue;
@@ -2532,19 +2545,19 @@ function generateStyleProps(ctx) {
2532
2545
  if (strictPropertyList.has(key)) union.push([
2533
2546
  own,
2534
2547
  "CssVars",
2535
- knownFallback
2548
+ heldOutKeywords ? "" : knownFallback
2536
2549
  ].filter(Boolean).join(" | "));
2537
2550
  else union.push([
2538
2551
  own,
2539
2552
  "CssVars",
2540
- gradedFallback
2553
+ heldOutKeywords ? "" : gradedFallback
2541
2554
  ].filter(Boolean).join(" | "));
2542
- } 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(" | "));
2543
2556
  const filtered = union.filter(Boolean);
2544
2557
  if (!filtered.length) filtered.push("string | number");
2545
2558
  let comment = comments?.[prop] || "";
2546
2559
  if (ctx.utility.isDeprecated(prop)) comment = comment ? comment.replace("@see", "@deprecated\n@see") : "/** @deprecated */";
2547
- 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(" | "))}`;
2548
2561
  return " " + [comment, line].filter(Boolean).join("\n");
2549
2562
  }).join("\n")}
2550
2563
  }
package/dist/index.mjs CHANGED
@@ -2499,6 +2499,19 @@ function generateStyleProps(ctx) {
2499
2499
  */
2500
2500
  let heldOutTokens = "";
2501
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 : "";
2502
2515
  if (propTypes.has(prop)) {
2503
2516
  const tokenValue = `UtilityValues["${prop}"]`;
2504
2517
  if (separateTokens) heldOutTokens = tokenValue;
@@ -2506,19 +2519,19 @@ function generateStyleProps(ctx) {
2506
2519
  if (strictPropertyList.has(key)) union.push([
2507
2520
  own,
2508
2521
  "CssVars",
2509
- knownFallback
2522
+ heldOutKeywords ? "" : knownFallback
2510
2523
  ].filter(Boolean).join(" | "));
2511
2524
  else union.push([
2512
2525
  own,
2513
2526
  "CssVars",
2514
- gradedFallback
2527
+ heldOutKeywords ? "" : gradedFallback
2515
2528
  ].filter(Boolean).join(" | "));
2516
- } 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(" | "));
2517
2530
  const filtered = union.filter(Boolean);
2518
2531
  if (!filtered.length) filtered.push("string | number");
2519
2532
  let comment = comments?.[prop] || "";
2520
2533
  if (ctx.utility.isDeprecated(prop)) comment = comment ? comment.replace("@see", "@deprecated\n@see") : "/** @deprecated */";
2521
- 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(" | "))}`;
2522
2535
  return " " + [comment, line].filter(Boolean).join("\n");
2523
2536
  }).join("\n")}
2524
2537
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/generator",
3
- "version": "1.41.0",
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.41.0",
42
- "@bamboocss/logger": "1.41.0",
43
- "@bamboocss/token-dictionary": "1.41.0",
44
- "@bamboocss/is-valid-prop": "^1.41.0",
45
- "@bamboocss/types": "1.41.0",
46
- "@bamboocss/shared": "1.41.0"
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"