@bamboocss/generator 1.61.0 → 1.62.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
@@ -2657,7 +2657,9 @@ function generateStyleProps(ctx) {
2657
2657
  if (!filtered.length) filtered.push("string | number");
2658
2658
  let comment = comments?.[prop] || "";
2659
2659
  if (ctx.utility.isDeprecated(prop)) comment = comment ? comment.replace("@see", "@deprecated\n@see") : "/** @deprecated */";
2660
- const line = `${key}?: ${restrict(prop, filtered.filter(Boolean).join(" | "), ctx.config)} | undefined`;
2660
+ const value = filtered.filter(Boolean).join(" | ");
2661
+ if (key === MIXIN) return " " + [MIXIN_COMMENT, `${key}?: ${mixinValue(value)} | undefined`].join("\n");
2662
+ const line = `${key}?: ${restrict(prop, value, ctx.config)} | undefined`;
2661
2663
  return " " + [comment, line].filter(Boolean).join("\n");
2662
2664
  }).join("\n")}
2663
2665
  }
@@ -2727,6 +2729,17 @@ const strictPropertyList = new Set([
2727
2729
  "wordBreak",
2728
2730
  "writingMode"
2729
2731
  ]);
2732
+ const MIXIN = "mixin";
2733
+ /** What applying mixins means, where an editor shows the key's documentation. */
2734
+ const MIXIN_COMMENT = [
2735
+ "/**",
2736
+ ` * The mixins this style starts from: their declarations first, then this style's own, which`,
2737
+ " * override them wherever this key is written. Several apply in the order listed, a later one over",
2738
+ " * an earlier one.",
2739
+ " */"
2740
+ ].join("\n");
2741
+ /** A mixin's name, or names applied in order, either chosen per condition. */
2742
+ const mixinValue = (value) => `ConditionalValue<${value} | AnyString | ReadonlyArray<${value} | AnyString>>`;
2730
2743
  const restrict = (key, value, config) => {
2731
2744
  if (config.strictPropertyValues && strictPropertyList.has(key)) return `ConditionalValue<WithEscapeHatch<OnlyKnown<"${key}", ${value}>>>`;
2732
2745
  return `ConditionalValue<${value} | AnyString>`;
package/dist/index.mjs CHANGED
@@ -2631,7 +2631,9 @@ function generateStyleProps(ctx) {
2631
2631
  if (!filtered.length) filtered.push("string | number");
2632
2632
  let comment = comments?.[prop] || "";
2633
2633
  if (ctx.utility.isDeprecated(prop)) comment = comment ? comment.replace("@see", "@deprecated\n@see") : "/** @deprecated */";
2634
- const line = `${key}?: ${restrict(prop, filtered.filter(Boolean).join(" | "), ctx.config)} | undefined`;
2634
+ const value = filtered.filter(Boolean).join(" | ");
2635
+ if (key === MIXIN) return " " + [MIXIN_COMMENT, `${key}?: ${mixinValue(value)} | undefined`].join("\n");
2636
+ const line = `${key}?: ${restrict(prop, value, ctx.config)} | undefined`;
2635
2637
  return " " + [comment, line].filter(Boolean).join("\n");
2636
2638
  }).join("\n")}
2637
2639
  }
@@ -2701,6 +2703,17 @@ const strictPropertyList = new Set([
2701
2703
  "wordBreak",
2702
2704
  "writingMode"
2703
2705
  ]);
2706
+ const MIXIN = "mixin";
2707
+ /** What applying mixins means, where an editor shows the key's documentation. */
2708
+ const MIXIN_COMMENT = [
2709
+ "/**",
2710
+ ` * The mixins this style starts from: their declarations first, then this style's own, which`,
2711
+ " * override them wherever this key is written. Several apply in the order listed, a later one over",
2712
+ " * an earlier one.",
2713
+ " */"
2714
+ ].join("\n");
2715
+ /** A mixin's name, or names applied in order, either chosen per condition. */
2716
+ const mixinValue = (value) => `ConditionalValue<${value} | AnyString | ReadonlyArray<${value} | AnyString>>`;
2704
2717
  const restrict = (key, value, config) => {
2705
2718
  if (config.strictPropertyValues && strictPropertyList.has(key)) return `ConditionalValue<WithEscapeHatch<OnlyKnown<"${key}", ${value}>>>`;
2706
2719
  return `ConditionalValue<${value} | AnyString>`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/generator",
3
- "version": "1.61.0",
3
+ "version": "1.62.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.61.0",
42
- "@bamboocss/is-valid-prop": "^1.61.0",
43
- "@bamboocss/logger": "1.61.0",
44
- "@bamboocss/shared": "1.61.0",
45
- "@bamboocss/token-dictionary": "1.61.0",
46
- "@bamboocss/types": "1.61.0"
41
+ "@bamboocss/core": "1.62.1",
42
+ "@bamboocss/is-valid-prop": "^1.62.1",
43
+ "@bamboocss/logger": "1.62.1",
44
+ "@bamboocss/shared": "1.62.1",
45
+ "@bamboocss/token-dictionary": "1.62.1",
46
+ "@bamboocss/types": "1.62.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/pluralize": "0.0.33"