@csszyx/compiler 0.9.1 → 0.9.2

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
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const core = require('@csszyx/core');
4
- const transformCore = require('./shared/compiler.DItEsgH4.cjs');
4
+ const transformCore = require('./shared/compiler.BfDLUvcf.cjs');
5
5
  const oxcParser = require('oxc-parser');
6
6
  const t = require('@babel/types');
7
7
  const node_crypto = require('node:crypto');
@@ -3788,6 +3788,7 @@ exports.KNOWN_VARIANTS = transformCore.KNOWN_VARIANTS;
3788
3788
  exports.PROPERTY_CATEGORY_MAP = transformCore.PROPERTY_CATEGORY_MAP;
3789
3789
  exports.PROPERTY_MAP = transformCore.PROPERTY_MAP;
3790
3790
  exports.PropertyCategory = transformCore.PropertyCategory;
3791
+ exports.SPECIAL_VARIANTS = transformCore.SPECIAL_VARIANTS;
3791
3792
  exports.SUGGESTION_MAP = transformCore.SUGGESTION_MAP;
3792
3793
  exports.getCSSVariableName = transformCore.getCSSVariableName;
3793
3794
  exports.getPropertyCategory = transformCore.getPropertyCategory;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SzObject } from './transform-core.cjs';
2
- export { BOOLEAN_SHORTHANDS, KNOWN_VARIANTS, PROPERTY_MAP, SUGGESTION_MAP, SzValue, isValidSzProp, normalizeClassName, transform } from './transform-core.cjs';
2
+ export { BOOLEAN_SHORTHANDS, KNOWN_VARIANTS, PROPERTY_MAP, SPECIAL_VARIANTS, SUGGESTION_MAP, SzValue, isValidSzProp, normalizeClassName, transform } from './transform-core.cjs';
3
3
  import * as t from '@babel/types';
4
4
 
5
5
  /**
@@ -13514,7 +13514,10 @@ interface VariantModifiers {
13514
13514
  detailsContent?: SzPropsBase;
13515
13515
  invertedColors?: SzPropsBase;
13516
13516
  noscript?: SzPropsBase;
13517
+ forcedColors?: SzPropsBase;
13517
13518
  print?: SzPropsBase;
13519
+ starting?: SzPropsBase;
13520
+ inert?: SzPropsBase;
13518
13521
  portrait?: SzPropsBase;
13519
13522
  landscape?: SzPropsBase;
13520
13523
  rtl?: SzPropsBase;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SzObject } from './transform-core.mjs';
2
- export { BOOLEAN_SHORTHANDS, KNOWN_VARIANTS, PROPERTY_MAP, SUGGESTION_MAP, SzValue, isValidSzProp, normalizeClassName, transform } from './transform-core.mjs';
2
+ export { BOOLEAN_SHORTHANDS, KNOWN_VARIANTS, PROPERTY_MAP, SPECIAL_VARIANTS, SUGGESTION_MAP, SzValue, isValidSzProp, normalizeClassName, transform } from './transform-core.mjs';
3
3
  import * as t from '@babel/types';
4
4
 
5
5
  /**
@@ -13514,7 +13514,10 @@ interface VariantModifiers {
13514
13514
  detailsContent?: SzPropsBase;
13515
13515
  invertedColors?: SzPropsBase;
13516
13516
  noscript?: SzPropsBase;
13517
+ forcedColors?: SzPropsBase;
13517
13518
  print?: SzPropsBase;
13519
+ starting?: SzPropsBase;
13520
+ inert?: SzPropsBase;
13518
13521
  portrait?: SzPropsBase;
13519
13522
  landscape?: SzPropsBase;
13520
13523
  rtl?: SzPropsBase;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { init, version, transform_sz, encode } from '@csszyx/core';
2
- import { t as transform, C as COLOR_PROPERTIES, P as PROPERTY_MAP, g as getCSSVariableName, a as PropertyCategory, K as KNOWN_VARIANTS, b as getVariantPrefix, c as getPropertyCategory, s as stripInvalidColorStrings } from './shared/compiler.CIBwOKUt.mjs';
3
- export { B as BOOLEAN_SHORTHANDS, d as PROPERTY_CATEGORY_MAP, S as SUGGESTION_MAP, i as isValidSzProp, n as normalizeClassName } from './shared/compiler.CIBwOKUt.mjs';
2
+ import { t as transform, C as COLOR_PROPERTIES, P as PROPERTY_MAP, g as getCSSVariableName, a as PropertyCategory, K as KNOWN_VARIANTS, b as getVariantPrefix, c as getPropertyCategory, s as stripInvalidColorStrings } from './shared/compiler.wyFFQW-b.mjs';
3
+ export { B as BOOLEAN_SHORTHANDS, d as PROPERTY_CATEGORY_MAP, S as SPECIAL_VARIANTS, e as SUGGESTION_MAP, i as isValidSzProp, n as normalizeClassName } from './shared/compiler.wyFFQW-b.mjs';
4
4
  import { parseSync } from 'oxc-parser';
5
5
  import * as t from '@babel/types';
6
6
  import { createHash } from 'node:crypto';
@@ -756,6 +756,8 @@ const VARIANT_MAP = {
756
756
  // Details / inverted-colors variants (v4.1)
757
757
  detailsContent: "details-content",
758
758
  invertedColors: "inverted-colors",
759
+ // Forced-colors media variant
760
+ forcedColors: "forced-colors",
759
761
  // Screen orientation
760
762
  screenPortrait: "portrait",
761
763
  screenLandscape: "landscape",
@@ -766,6 +768,15 @@ const VARIANT_MAP = {
766
768
  "@maxXl": "@max-xl",
767
769
  "@max2xl": "@max-2xl"
768
770
  };
771
+ const SPECIAL_VARIANTS = /* @__PURE__ */ new Set([
772
+ "group",
773
+ "peer",
774
+ "has",
775
+ "not",
776
+ "data",
777
+ "aria",
778
+ "supports"
779
+ ]);
769
780
  const KNOWN_VARIANTS = /* @__PURE__ */ new Set([
770
781
  // Responsive
771
782
  "sm",
@@ -880,6 +891,12 @@ const KNOWN_VARIANTS = /* @__PURE__ */ new Set([
880
891
  "invertedColors",
881
892
  // Noscript (v4.1)
882
893
  "noscript",
894
+ // Forced-colors media variant
895
+ "forced-colors",
896
+ "forcedColors",
897
+ // Starting-style + inert state variants
898
+ "starting",
899
+ "inert",
883
900
  // Open
884
901
  "open",
885
902
  // RTL/LTR
@@ -2195,9 +2212,8 @@ function transform(szProp, prefix = "", mangleMap) {
2195
2212
  }
2196
2213
  if (process.env.NODE_ENV !== "production" && typeof window === "undefined") {
2197
2214
  const isKnown = PROPERTY_MAP[rawKey] || BOOLEAN_SHORTHANDS.has(rawKey) || SNAP_DIRECT_MAP[rawKey] || rawKey === "fromPos" || rawKey === "viaPos" || rawKey === "toPos" || rawKey.startsWith("--") || rawKey.startsWith("[") || rawKey.startsWith("@") || // Variants that fell through (e.g. empty object)
2198
- KNOWN_VARIANTS.has(rawKey) || // Groups/Peers
2199
- rawKey === "group" || rawKey === "peer" || // Special variant objects
2200
- rawKey === "has" || rawKey === "not" || rawKey === "data" || rawKey === "aria" || rawKey === "supports" || rawKey === "min" || rawKey === "max";
2215
+ KNOWN_VARIANTS.has(rawKey) || // Parametric/scope variants (group, peer, has, not, data, aria, supports)
2216
+ SPECIAL_VARIANTS.has(rawKey) || rawKey === "min" || rawKey === "max";
2201
2217
  if (!isKnown) {
2202
2218
  const suggestion = SUGGESTION_MAP[rawKey];
2203
2219
  if (suggestion) {
@@ -2331,6 +2347,7 @@ exports.KNOWN_VARIANTS = KNOWN_VARIANTS;
2331
2347
  exports.PROPERTY_CATEGORY_MAP = PROPERTY_CATEGORY_MAP;
2332
2348
  exports.PROPERTY_MAP = PROPERTY_MAP;
2333
2349
  exports.PropertyCategory = PropertyCategory;
2350
+ exports.SPECIAL_VARIANTS = SPECIAL_VARIANTS;
2334
2351
  exports.SUGGESTION_MAP = SUGGESTION_MAP;
2335
2352
  exports.VARIANT_MAP = VARIANT_MAP;
2336
2353
  exports.getCSSVariableName = getCSSVariableName;
@@ -754,6 +754,8 @@ const VARIANT_MAP = {
754
754
  // Details / inverted-colors variants (v4.1)
755
755
  detailsContent: "details-content",
756
756
  invertedColors: "inverted-colors",
757
+ // Forced-colors media variant
758
+ forcedColors: "forced-colors",
757
759
  // Screen orientation
758
760
  screenPortrait: "portrait",
759
761
  screenLandscape: "landscape",
@@ -764,6 +766,15 @@ const VARIANT_MAP = {
764
766
  "@maxXl": "@max-xl",
765
767
  "@max2xl": "@max-2xl"
766
768
  };
769
+ const SPECIAL_VARIANTS = /* @__PURE__ */ new Set([
770
+ "group",
771
+ "peer",
772
+ "has",
773
+ "not",
774
+ "data",
775
+ "aria",
776
+ "supports"
777
+ ]);
767
778
  const KNOWN_VARIANTS = /* @__PURE__ */ new Set([
768
779
  // Responsive
769
780
  "sm",
@@ -878,6 +889,12 @@ const KNOWN_VARIANTS = /* @__PURE__ */ new Set([
878
889
  "invertedColors",
879
890
  // Noscript (v4.1)
880
891
  "noscript",
892
+ // Forced-colors media variant
893
+ "forced-colors",
894
+ "forcedColors",
895
+ // Starting-style + inert state variants
896
+ "starting",
897
+ "inert",
881
898
  // Open
882
899
  "open",
883
900
  // RTL/LTR
@@ -2193,9 +2210,8 @@ function transform(szProp, prefix = "", mangleMap) {
2193
2210
  }
2194
2211
  if (process.env.NODE_ENV !== "production" && typeof window === "undefined") {
2195
2212
  const isKnown = PROPERTY_MAP[rawKey] || BOOLEAN_SHORTHANDS.has(rawKey) || SNAP_DIRECT_MAP[rawKey] || rawKey === "fromPos" || rawKey === "viaPos" || rawKey === "toPos" || rawKey.startsWith("--") || rawKey.startsWith("[") || rawKey.startsWith("@") || // Variants that fell through (e.g. empty object)
2196
- KNOWN_VARIANTS.has(rawKey) || // Groups/Peers
2197
- rawKey === "group" || rawKey === "peer" || // Special variant objects
2198
- rawKey === "has" || rawKey === "not" || rawKey === "data" || rawKey === "aria" || rawKey === "supports" || rawKey === "min" || rawKey === "max";
2213
+ KNOWN_VARIANTS.has(rawKey) || // Parametric/scope variants (group, peer, has, not, data, aria, supports)
2214
+ SPECIAL_VARIANTS.has(rawKey) || rawKey === "min" || rawKey === "max";
2199
2215
  if (!isKnown) {
2200
2216
  const suggestion = SUGGESTION_MAP[rawKey];
2201
2217
  if (suggestion) {
@@ -2323,4 +2339,4 @@ function normalizeClassName(className) {
2323
2339
  return className.split(/\s+/).filter(Boolean).join(" ");
2324
2340
  }
2325
2341
 
2326
- export { BOOLEAN_SHORTHANDS as B, COLOR_PROPERTIES as C, KNOWN_VARIANTS as K, PROPERTY_MAP as P, SUGGESTION_MAP as S, VARIANT_MAP as V, PropertyCategory as a, getVariantPrefix as b, getPropertyCategory as c, PROPERTY_CATEGORY_MAP as d, normalizeArbitraryValue as e, normalizeArbitraryVariant as f, getCSSVariableName as g, isValidSzProp as i, normalizeClassName as n, stripInvalidColorStrings as s, transform as t };
2342
+ export { BOOLEAN_SHORTHANDS as B, COLOR_PROPERTIES as C, KNOWN_VARIANTS as K, PROPERTY_MAP as P, SPECIAL_VARIANTS as S, VARIANT_MAP as V, PropertyCategory as a, getVariantPrefix as b, getPropertyCategory as c, PROPERTY_CATEGORY_MAP as d, SUGGESTION_MAP as e, normalizeArbitraryValue as f, getCSSVariableName as g, normalizeArbitraryVariant as h, isValidSzProp as i, normalizeClassName as n, stripInvalidColorStrings as s, transform as t };
@@ -1,12 +1,13 @@
1
1
  'use strict';
2
2
 
3
- const transformCore = require('./shared/compiler.DItEsgH4.cjs');
3
+ const transformCore = require('./shared/compiler.BfDLUvcf.cjs');
4
4
 
5
5
 
6
6
 
7
7
  exports.BOOLEAN_SHORTHANDS = transformCore.BOOLEAN_SHORTHANDS;
8
8
  exports.KNOWN_VARIANTS = transformCore.KNOWN_VARIANTS;
9
9
  exports.PROPERTY_MAP = transformCore.PROPERTY_MAP;
10
+ exports.SPECIAL_VARIANTS = transformCore.SPECIAL_VARIANTS;
10
11
  exports.SUGGESTION_MAP = transformCore.SUGGESTION_MAP;
11
12
  exports.VARIANT_MAP = transformCore.VARIANT_MAP;
12
13
  exports.getVariantPrefix = transformCore.getVariantPrefix;
@@ -31,6 +31,7 @@ interface ReadonlySzObject {
31
31
  declare const PROPERTY_MAP: Record<string, string>;
32
32
  declare const SUGGESTION_MAP: Record<string, string>;
33
33
  declare const VARIANT_MAP: Record<string, string>;
34
+ declare const SPECIAL_VARIANTS: Set<string>;
34
35
  declare const KNOWN_VARIANTS: Set<string>;
35
36
  declare const BOOLEAN_SHORTHANDS: Set<string>;
36
37
  /**
@@ -82,5 +83,5 @@ declare function isValidSzProp(szProp: unknown): szProp is SzObject;
82
83
  */
83
84
  declare function normalizeClassName(className: string): string;
84
85
 
85
- export { BOOLEAN_SHORTHANDS, KNOWN_VARIANTS, PROPERTY_MAP, SUGGESTION_MAP, VARIANT_MAP, getVariantPrefix, isValidSzProp, normalizeArbitraryValue, normalizeArbitraryVariant, normalizeClassName, transform };
86
+ export { BOOLEAN_SHORTHANDS, KNOWN_VARIANTS, PROPERTY_MAP, SPECIAL_VARIANTS, SUGGESTION_MAP, VARIANT_MAP, getVariantPrefix, isValidSzProp, normalizeArbitraryValue, normalizeArbitraryVariant, normalizeClassName, transform };
86
87
  export type { ReadonlySzObject, ReadonlySzValue, SzObject, SzValue, TransformResult };
@@ -31,6 +31,7 @@ interface ReadonlySzObject {
31
31
  declare const PROPERTY_MAP: Record<string, string>;
32
32
  declare const SUGGESTION_MAP: Record<string, string>;
33
33
  declare const VARIANT_MAP: Record<string, string>;
34
+ declare const SPECIAL_VARIANTS: Set<string>;
34
35
  declare const KNOWN_VARIANTS: Set<string>;
35
36
  declare const BOOLEAN_SHORTHANDS: Set<string>;
36
37
  /**
@@ -82,5 +83,5 @@ declare function isValidSzProp(szProp: unknown): szProp is SzObject;
82
83
  */
83
84
  declare function normalizeClassName(className: string): string;
84
85
 
85
- export { BOOLEAN_SHORTHANDS, KNOWN_VARIANTS, PROPERTY_MAP, SUGGESTION_MAP, VARIANT_MAP, getVariantPrefix, isValidSzProp, normalizeArbitraryValue, normalizeArbitraryVariant, normalizeClassName, transform };
86
+ export { BOOLEAN_SHORTHANDS, KNOWN_VARIANTS, PROPERTY_MAP, SPECIAL_VARIANTS, SUGGESTION_MAP, VARIANT_MAP, getVariantPrefix, isValidSzProp, normalizeArbitraryValue, normalizeArbitraryVariant, normalizeClassName, transform };
86
87
  export type { ReadonlySzObject, ReadonlySzValue, SzObject, SzValue, TransformResult };
@@ -1 +1 @@
1
- export { B as BOOLEAN_SHORTHANDS, K as KNOWN_VARIANTS, P as PROPERTY_MAP, S as SUGGESTION_MAP, V as VARIANT_MAP, b as getVariantPrefix, i as isValidSzProp, e as normalizeArbitraryValue, f as normalizeArbitraryVariant, n as normalizeClassName, t as transform } from './shared/compiler.CIBwOKUt.mjs';
1
+ export { B as BOOLEAN_SHORTHANDS, K as KNOWN_VARIANTS, P as PROPERTY_MAP, S as SPECIAL_VARIANTS, e as SUGGESTION_MAP, V as VARIANT_MAP, b as getVariantPrefix, i as isValidSzProp, f as normalizeArbitraryValue, h as normalizeArbitraryVariant, n as normalizeClassName, t as transform } from './shared/compiler.wyFFQW-b.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/compiler",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Core compiler and transformation logic for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -65,7 +65,7 @@
65
65
  "@babel/types": "^7.23.6",
66
66
  "magic-string": "0.30.21",
67
67
  "oxc-parser": "0.131.0",
68
- "@csszyx/core": "0.9.1"
68
+ "@csszyx/core": "0.9.2"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/babel__core": "^7.20.5",