@drskillissue/ganko 0.2.7 → 0.2.9

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.d.cts CHANGED
@@ -1622,7 +1622,7 @@ interface TailwindValidator {
1622
1622
  declare function resolveTailwindValidator(files: readonly {
1623
1623
  path: string;
1624
1624
  content: string;
1625
- }[]): Promise<TailwindValidator | null>;
1625
+ }[], logger?: Logger): Promise<TailwindValidator | null>;
1626
1626
 
1627
1627
  /**
1628
1628
  * CSSInput - Input type for building CSSGraph from CSS/SCSS source files.
@@ -2031,8 +2031,40 @@ interface SelectorAttributeConstraint {
2031
2031
  value: string | null;
2032
2032
  caseInsensitive: boolean;
2033
2033
  }
2034
+ interface NthPattern {
2035
+ readonly step: number;
2036
+ readonly offset: number;
2037
+ }
2038
+ declare const enum PseudoConstraintKind {
2039
+ Simple = 0,
2040
+ FirstChild = 1,
2041
+ LastChild = 2,
2042
+ OnlyChild = 3,
2043
+ NthChild = 4,
2044
+ NthLastChild = 5,
2045
+ NthOfType = 6,
2046
+ NthLastOfType = 7,
2047
+ MatchesAny = 8,
2048
+ NoneOf = 9
2049
+ }
2050
+ interface ParsedPseudoConstraint {
2051
+ readonly name: string;
2052
+ readonly raw: string;
2053
+ readonly kind: PseudoConstraintKind;
2054
+ readonly nthPattern: NthPattern | null;
2055
+ readonly nestedCompounds: readonly SelectorCompound[][] | null;
2056
+ }
2057
+ interface SelectorCompound {
2058
+ readonly parts: readonly SelectorPart[];
2059
+ readonly tagName: string | null;
2060
+ readonly idValue: string | null;
2061
+ readonly classes: readonly string[];
2062
+ readonly attributes: readonly SelectorAttributeConstraint[];
2063
+ readonly pseudoClasses: readonly ParsedPseudoConstraint[];
2064
+ }
2034
2065
  interface SelectorAnchor {
2035
2066
  subjectTag: string | null;
2067
+ idValue: string | null;
2036
2068
  classes: readonly string[];
2037
2069
  attributes: readonly SelectorAttributeConstraint[];
2038
2070
  includesDescendantCombinator: boolean;
@@ -2062,6 +2094,8 @@ interface SelectorEntity {
2062
2094
  specificity: Specificity;
2063
2095
  specificityScore: number;
2064
2096
  complexity: SelectorComplexity;
2097
+ compounds: readonly SelectorCompound[];
2098
+ combinators: readonly CombinatorType[];
2065
2099
  parts: SelectorPart[];
2066
2100
  anchor: SelectorAnchor;
2067
2101
  overrides: SelectorEntity[];
@@ -2293,7 +2327,8 @@ declare class CSSGraph {
2293
2327
  readonly parseErrors: CSSParseError[];
2294
2328
  readonly failedFilePaths: string[];
2295
2329
  readonly tokenCategories: TokenCategory[];
2296
- readonly filesWithLayers: Set<string>;
2330
+ private _filesWithLayers;
2331
+ get filesWithLayers(): ReadonlySet<string>;
2297
2332
  readonly selectorsByPseudoClass: Map<string, SelectorEntity[]>;
2298
2333
  readonly knownKeyframeNames: Set<string>;
2299
2334
  readonly unresolvedAnimationRefs: UnresolvedAnimationRef[];
@@ -2305,17 +2340,14 @@ declare class CSSGraph {
2305
2340
  readonly multiDeclarationProperties: Map<string, readonly DeclarationEntity[]>;
2306
2341
  /** Declarations whose parent rule is inside a @keyframes block. */
2307
2342
  readonly keyframeDeclarations: DeclarationEntity[];
2308
- /** Rules with zero declarations and zero nested rules. */
2309
- readonly emptyRules: RuleEntity[];
2343
+ /** Rules with zero declarations, zero nested rules, and zero nested at-rules. */
2344
+ private _emptyRules;
2345
+ get emptyRules(): readonly RuleEntity[];
2310
2346
  /** @keyframes at-rules with no effective keyframe declarations. */
2311
- readonly emptyKeyframes: AtRuleEntity[];
2312
- readonly colorDeclarations: DeclarationEntity[];
2313
- readonly calcDeclarations: DeclarationEntity[];
2314
- readonly varDeclarations: DeclarationEntity[];
2315
- readonly urlDeclarations: DeclarationEntity[];
2316
- readonly vendorPrefixedDeclarations: DeclarationEntity[];
2317
- readonly hardcodedColorDeclarations: DeclarationEntity[];
2318
- readonly overqualifiedSelectors: SelectorEntity[];
2347
+ private _emptyKeyframes;
2348
+ get emptyKeyframes(): readonly AtRuleEntity[];
2349
+ private _overqualifiedSelectors;
2350
+ get overqualifiedSelectors(): readonly SelectorEntity[];
2319
2351
  readonly idSelectors: SelectorEntity[];
2320
2352
  readonly attributeSelectors: SelectorEntity[];
2321
2353
  readonly universalSelectors: SelectorEntity[];
@@ -2331,7 +2363,8 @@ declare class CSSGraph {
2331
2363
  readonly usedFontFamilies: Set<string>;
2332
2364
  /** Tailwind validator for utility class lookup (null if not a Tailwind project). */
2333
2365
  readonly tailwind: TailwindValidator | null;
2334
- readonly deepNestedRules: RuleEntity[];
2366
+ private _deepNestedRules;
2367
+ get deepNestedRules(): readonly RuleEntity[];
2335
2368
  constructor(input: CSSInput);
2336
2369
  intern(s: string): string;
2337
2370
  nextFileId(): number;
@@ -2377,37 +2410,16 @@ declare class CSSGraph {
2377
2410
  * Called after all phases complete.
2378
2411
  */
2379
2412
  buildDerivedIndexes(): void;
2380
- private buildRuleDeclarationIndexes;
2381
2413
  private buildContainingMediaStacks;
2382
- private buildKeyframeIndex;
2414
+ private buildKeyframeIndexes;
2383
2415
  private buildContainerNameIndexes;
2384
- private buildElementKinds;
2385
- private buildFilesWithLayers;
2386
- private buildSelectorPseudoClassIndex;
2387
2416
  /**
2388
2417
  * Sort each declarationsByProperty list by sourceOrder and populate
2389
2418
  * multiDeclarationProperties with only those having 2+ entries.
2390
2419
  */
2391
2420
  private buildMultiDeclarationProperties;
2392
- /**
2393
- * Collect declarations whose parent rule is inside a @keyframes block.
2394
- */
2395
- private buildKeyframeDeclarations;
2396
- private buildKeyframeLayoutMutationsByName;
2397
- /**
2398
- * Collect rules with no declarations and no nested rules.
2399
- */
2400
- private buildEmptyRules;
2401
- /**
2402
- * Collect @keyframes with no effective keyframe declarations.
2403
- */
2404
- private buildEmptyKeyframes;
2405
- private buildDeclarationDerivedIndexes;
2406
- private buildSelectorDerivedIndexes;
2407
2421
  private buildLayoutPropertiesByClassToken;
2408
- private buildFontFamilyUsageByRule;
2409
- private buildFontFaceDescriptorsByFamily;
2410
- private buildRuleDerivedIndexes;
2422
+ private buildFontIndexes;
2411
2423
  buildUnusedIndexes(): void;
2412
2424
  }
2413
2425
 
@@ -2517,7 +2529,7 @@ interface AlignmentContext {
2517
2529
  readonly evidence: LayoutContextEvidence;
2518
2530
  }
2519
2531
 
2520
- declare const layoutSignalNames: readonly ["line-height", "font-size", "width", "inline-size", "height", "block-size", "min-width", "min-block-size", "min-height", "aspect-ratio", "vertical-align", "display", "white-space", "object-fit", "overflow", "overflow-y", "overflow-anchor", "scrollbar-gutter", "scrollbar-width", "contain-intrinsic-size", "content-visibility", "align-items", "align-self", "justify-items", "place-items", "place-self", "flex-direction", "grid-auto-flow", "appearance", "box-sizing", "padding-top", "padding-left", "padding-right", "padding-bottom", "border-top-width", "border-left-width", "border-right-width", "border-bottom-width", "position", "top", "bottom", "margin-top", "margin-bottom", "transform", "translate", "inset-block-start", "inset-block-end", "writing-mode", "direction", "contain"];
2532
+ declare const layoutSignalNames: readonly ["line-height", "font-size", "width", "inline-size", "height", "block-size", "min-width", "min-block-size", "min-height", "max-width", "max-height", "aspect-ratio", "vertical-align", "display", "white-space", "object-fit", "overflow", "overflow-y", "overflow-anchor", "scrollbar-gutter", "scrollbar-width", "contain-intrinsic-size", "content-visibility", "align-items", "align-self", "justify-items", "place-items", "place-self", "flex-direction", "flex-basis", "grid-auto-flow", "appearance", "box-sizing", "padding-top", "padding-left", "padding-right", "padding-bottom", "border-top-width", "border-left-width", "border-right-width", "border-bottom-width", "position", "top", "bottom", "margin-top", "margin-bottom", "transform", "translate", "inset-block-start", "inset-block-end", "writing-mode", "direction", "contain"];
2521
2533
  type LayoutSignalName = (typeof layoutSignalNames)[number];
2522
2534
  declare const enum LayoutSignalSource {
2523
2535
  Selector = 0,
@@ -2533,18 +2545,26 @@ declare const enum LayoutSignalUnit {
2533
2545
  Keyword = 2,
2534
2546
  Unknown = 3
2535
2547
  }
2548
+ declare const enum SignalValueKind {
2549
+ Known = 0,
2550
+ Unknown = 1
2551
+ }
2552
+ declare const enum SignalQuality {
2553
+ Exact = 0,
2554
+ Estimated = 1
2555
+ }
2536
2556
  interface LayoutKnownSignalValue {
2537
- readonly kind: "known";
2557
+ readonly kind: SignalValueKind.Known;
2538
2558
  readonly name: LayoutSignalName;
2539
2559
  readonly normalized: string;
2540
2560
  readonly source: LayoutSignalSource;
2541
2561
  readonly guard: LayoutRuleGuard;
2542
2562
  readonly unit: LayoutSignalUnit;
2543
2563
  readonly px: number | null;
2544
- readonly quality: "exact" | "estimated";
2564
+ readonly quality: SignalQuality;
2545
2565
  }
2546
2566
  interface LayoutUnknownSignalValue {
2547
- readonly kind: "unknown";
2567
+ readonly kind: SignalValueKind.Unknown;
2548
2568
  readonly name: LayoutSignalName;
2549
2569
  readonly source: LayoutSignalSource | null;
2550
2570
  readonly guard: LayoutRuleGuard;
@@ -2782,10 +2802,10 @@ type LayoutReservedSpaceReason = "height" | "block-size" | "min-height" | "min-b
2782
2802
  interface LayoutReservedSpaceFact {
2783
2803
  readonly hasReservedSpace: boolean;
2784
2804
  readonly reasons: readonly LayoutReservedSpaceReason[];
2785
- readonly hasUsableInlineDimension: boolean;
2786
- readonly hasUsableBlockDimension: boolean;
2787
2805
  readonly hasContainIntrinsicSize: boolean;
2788
2806
  readonly hasUsableAspectRatio: boolean;
2807
+ readonly hasDeclaredInlineDimension: boolean;
2808
+ readonly hasDeclaredBlockDimension: boolean;
2789
2809
  }
2790
2810
  declare const enum LayoutScrollAxis {
2791
2811
  None = 0,
@@ -2843,46 +2863,35 @@ interface LayoutNormalizedRuleDeclaration {
2843
2863
  readonly startColumn: number;
2844
2864
  readonly propertyLength: number;
2845
2865
  }
2846
- interface LayoutGraphTopology {
2866
+ interface LayoutElementRecord {
2867
+ readonly ref: LayoutElementRef | null;
2868
+ readonly edges: readonly LayoutMatchEdge[];
2869
+ readonly cascade: ReadonlyMap<string, LayoutCascadedDeclaration>;
2870
+ readonly snapshot: LayoutSignalSnapshot;
2871
+ readonly hotSignals: LayoutSnapshotHotSignals;
2872
+ readonly reservedSpace: LayoutReservedSpaceFact;
2873
+ readonly scrollContainer: LayoutScrollContainerFact;
2874
+ readonly flowParticipation: LayoutFlowParticipationFact;
2875
+ readonly containingBlock: LayoutContainingBlockFact;
2876
+ readonly conditionalDelta: ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact> | null;
2877
+ readonly baselineOffsets: ReadonlyMap<LayoutSignalName, readonly number[]> | null;
2878
+ }
2879
+ interface LayoutGraph {
2847
2880
  readonly elements: readonly LayoutElementNode[];
2848
2881
  readonly childrenByParentNode: ReadonlyMap<LayoutElementNode, readonly LayoutElementNode[]>;
2849
2882
  readonly elementBySolidFileAndId: ReadonlyMap<string, ReadonlyMap<number, LayoutElementNode>>;
2850
2883
  readonly elementRefsBySolidFileAndId: ReadonlyMap<string, ReadonlyMap<number, LayoutElementRef>>;
2851
2884
  readonly elementsByTagName: ReadonlyMap<string, readonly LayoutElementNode[]>;
2852
2885
  readonly measurementNodeByRootKey: ReadonlyMap<string, LayoutElementNode>;
2853
- /**
2854
- * Maps component call-site nodes to their resolved host DOM element reference.
2855
- * Only populated for nodes that represent a component resolved to a concrete DOM
2856
- * element. Native DOM element nodes and unresolvable components are absent.
2857
- * Used by rules that need to inspect the host element's JSX attributes (e.g.
2858
- * dynamic `width`/`height` expressions not capturable as static strings).
2859
- */
2860
2886
  readonly hostElementRefsByNode: ReadonlyMap<LayoutElementNode, LayoutElementRef>;
2861
- }
2862
- interface LayoutGraphCascade {
2863
2887
  readonly styleRules: readonly LayoutStyleRuleNode[];
2864
2888
  readonly applies: readonly LayoutMatchEdge[];
2865
2889
  readonly cssScopeBySolidFile: ReadonlyMap<string, readonly string[]>;
2866
- readonly appliesByNode: ReadonlyMap<LayoutElementNode, readonly LayoutMatchEdge[]>;
2867
2890
  readonly selectorCandidatesByNode: ReadonlyMap<LayoutElementNode, readonly number[]>;
2868
2891
  readonly selectorsById: ReadonlyMap<number, SelectorEntity>;
2869
- readonly cascadeByElementNode: WeakMap<LayoutElementNode, ReadonlyMap<string, LayoutCascadedDeclaration>>;
2870
- readonly snapshotByElementNode: WeakMap<LayoutElementNode, LayoutSignalSnapshot>;
2871
- readonly snapshotHotSignalsByNode: ReadonlyMap<LayoutElementNode, LayoutSnapshotHotSignals>;
2872
- }
2873
- interface LayoutGraphFacts {
2874
- readonly reservedSpaceFactsByNode: ReadonlyMap<LayoutElementNode, LayoutReservedSpaceFact>;
2875
- readonly scrollContainerFactsByNode: ReadonlyMap<LayoutElementNode, LayoutScrollContainerFact>;
2876
- readonly flowParticipationFactsByNode: ReadonlyMap<LayoutElementNode, LayoutFlowParticipationFact>;
2877
- readonly containingBlockFactsByNode: ReadonlyMap<LayoutElementNode, LayoutContainingBlockFact>;
2878
- readonly conditionalSignalDeltaFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact>>;
2879
- readonly baselineOffsetFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, readonly number[]>>;
2880
- }
2881
- interface LayoutGraphCohorts {
2892
+ readonly records: ReadonlyMap<LayoutElementNode, LayoutElementRecord>;
2882
2893
  readonly cohortStatsByParentNode: ReadonlyMap<LayoutElementNode, LayoutCohortStats>;
2883
2894
  readonly contextByParentNode: ReadonlyMap<LayoutElementNode, AlignmentContext>;
2884
- }
2885
- interface LayoutGraphIndexes {
2886
2895
  readonly elementsWithConditionalDeltaBySignal: ReadonlyMap<LayoutSignalName, readonly LayoutElementNode[]>;
2887
2896
  readonly elementsWithConditionalOverflowDelta: readonly LayoutElementNode[];
2888
2897
  readonly elementsWithConditionalOffsetDelta: readonly LayoutElementNode[];
@@ -2892,8 +2901,6 @@ interface LayoutGraphIndexes {
2892
2901
  readonly statefulSelectorEntriesByRuleId: ReadonlyMap<number, readonly LayoutStatefulSelectorEntry[]>;
2893
2902
  readonly statefulNormalizedDeclarationsByRuleId: ReadonlyMap<number, readonly LayoutNormalizedRuleDeclaration[]>;
2894
2903
  readonly statefulBaseValueIndex: ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>;
2895
- }
2896
- interface LayoutGraph extends LayoutGraphTopology, LayoutGraphCascade, LayoutGraphFacts, LayoutGraphCohorts, LayoutGraphIndexes {
2897
2904
  readonly perf: LayoutPerfStatsMutable;
2898
2905
  }
2899
2906
 
package/dist/index.d.ts CHANGED
@@ -1622,7 +1622,7 @@ interface TailwindValidator {
1622
1622
  declare function resolveTailwindValidator(files: readonly {
1623
1623
  path: string;
1624
1624
  content: string;
1625
- }[]): Promise<TailwindValidator | null>;
1625
+ }[], logger?: Logger): Promise<TailwindValidator | null>;
1626
1626
 
1627
1627
  /**
1628
1628
  * CSSInput - Input type for building CSSGraph from CSS/SCSS source files.
@@ -2031,8 +2031,40 @@ interface SelectorAttributeConstraint {
2031
2031
  value: string | null;
2032
2032
  caseInsensitive: boolean;
2033
2033
  }
2034
+ interface NthPattern {
2035
+ readonly step: number;
2036
+ readonly offset: number;
2037
+ }
2038
+ declare const enum PseudoConstraintKind {
2039
+ Simple = 0,
2040
+ FirstChild = 1,
2041
+ LastChild = 2,
2042
+ OnlyChild = 3,
2043
+ NthChild = 4,
2044
+ NthLastChild = 5,
2045
+ NthOfType = 6,
2046
+ NthLastOfType = 7,
2047
+ MatchesAny = 8,
2048
+ NoneOf = 9
2049
+ }
2050
+ interface ParsedPseudoConstraint {
2051
+ readonly name: string;
2052
+ readonly raw: string;
2053
+ readonly kind: PseudoConstraintKind;
2054
+ readonly nthPattern: NthPattern | null;
2055
+ readonly nestedCompounds: readonly SelectorCompound[][] | null;
2056
+ }
2057
+ interface SelectorCompound {
2058
+ readonly parts: readonly SelectorPart[];
2059
+ readonly tagName: string | null;
2060
+ readonly idValue: string | null;
2061
+ readonly classes: readonly string[];
2062
+ readonly attributes: readonly SelectorAttributeConstraint[];
2063
+ readonly pseudoClasses: readonly ParsedPseudoConstraint[];
2064
+ }
2034
2065
  interface SelectorAnchor {
2035
2066
  subjectTag: string | null;
2067
+ idValue: string | null;
2036
2068
  classes: readonly string[];
2037
2069
  attributes: readonly SelectorAttributeConstraint[];
2038
2070
  includesDescendantCombinator: boolean;
@@ -2062,6 +2094,8 @@ interface SelectorEntity {
2062
2094
  specificity: Specificity;
2063
2095
  specificityScore: number;
2064
2096
  complexity: SelectorComplexity;
2097
+ compounds: readonly SelectorCompound[];
2098
+ combinators: readonly CombinatorType[];
2065
2099
  parts: SelectorPart[];
2066
2100
  anchor: SelectorAnchor;
2067
2101
  overrides: SelectorEntity[];
@@ -2293,7 +2327,8 @@ declare class CSSGraph {
2293
2327
  readonly parseErrors: CSSParseError[];
2294
2328
  readonly failedFilePaths: string[];
2295
2329
  readonly tokenCategories: TokenCategory[];
2296
- readonly filesWithLayers: Set<string>;
2330
+ private _filesWithLayers;
2331
+ get filesWithLayers(): ReadonlySet<string>;
2297
2332
  readonly selectorsByPseudoClass: Map<string, SelectorEntity[]>;
2298
2333
  readonly knownKeyframeNames: Set<string>;
2299
2334
  readonly unresolvedAnimationRefs: UnresolvedAnimationRef[];
@@ -2305,17 +2340,14 @@ declare class CSSGraph {
2305
2340
  readonly multiDeclarationProperties: Map<string, readonly DeclarationEntity[]>;
2306
2341
  /** Declarations whose parent rule is inside a @keyframes block. */
2307
2342
  readonly keyframeDeclarations: DeclarationEntity[];
2308
- /** Rules with zero declarations and zero nested rules. */
2309
- readonly emptyRules: RuleEntity[];
2343
+ /** Rules with zero declarations, zero nested rules, and zero nested at-rules. */
2344
+ private _emptyRules;
2345
+ get emptyRules(): readonly RuleEntity[];
2310
2346
  /** @keyframes at-rules with no effective keyframe declarations. */
2311
- readonly emptyKeyframes: AtRuleEntity[];
2312
- readonly colorDeclarations: DeclarationEntity[];
2313
- readonly calcDeclarations: DeclarationEntity[];
2314
- readonly varDeclarations: DeclarationEntity[];
2315
- readonly urlDeclarations: DeclarationEntity[];
2316
- readonly vendorPrefixedDeclarations: DeclarationEntity[];
2317
- readonly hardcodedColorDeclarations: DeclarationEntity[];
2318
- readonly overqualifiedSelectors: SelectorEntity[];
2347
+ private _emptyKeyframes;
2348
+ get emptyKeyframes(): readonly AtRuleEntity[];
2349
+ private _overqualifiedSelectors;
2350
+ get overqualifiedSelectors(): readonly SelectorEntity[];
2319
2351
  readonly idSelectors: SelectorEntity[];
2320
2352
  readonly attributeSelectors: SelectorEntity[];
2321
2353
  readonly universalSelectors: SelectorEntity[];
@@ -2331,7 +2363,8 @@ declare class CSSGraph {
2331
2363
  readonly usedFontFamilies: Set<string>;
2332
2364
  /** Tailwind validator for utility class lookup (null if not a Tailwind project). */
2333
2365
  readonly tailwind: TailwindValidator | null;
2334
- readonly deepNestedRules: RuleEntity[];
2366
+ private _deepNestedRules;
2367
+ get deepNestedRules(): readonly RuleEntity[];
2335
2368
  constructor(input: CSSInput);
2336
2369
  intern(s: string): string;
2337
2370
  nextFileId(): number;
@@ -2377,37 +2410,16 @@ declare class CSSGraph {
2377
2410
  * Called after all phases complete.
2378
2411
  */
2379
2412
  buildDerivedIndexes(): void;
2380
- private buildRuleDeclarationIndexes;
2381
2413
  private buildContainingMediaStacks;
2382
- private buildKeyframeIndex;
2414
+ private buildKeyframeIndexes;
2383
2415
  private buildContainerNameIndexes;
2384
- private buildElementKinds;
2385
- private buildFilesWithLayers;
2386
- private buildSelectorPseudoClassIndex;
2387
2416
  /**
2388
2417
  * Sort each declarationsByProperty list by sourceOrder and populate
2389
2418
  * multiDeclarationProperties with only those having 2+ entries.
2390
2419
  */
2391
2420
  private buildMultiDeclarationProperties;
2392
- /**
2393
- * Collect declarations whose parent rule is inside a @keyframes block.
2394
- */
2395
- private buildKeyframeDeclarations;
2396
- private buildKeyframeLayoutMutationsByName;
2397
- /**
2398
- * Collect rules with no declarations and no nested rules.
2399
- */
2400
- private buildEmptyRules;
2401
- /**
2402
- * Collect @keyframes with no effective keyframe declarations.
2403
- */
2404
- private buildEmptyKeyframes;
2405
- private buildDeclarationDerivedIndexes;
2406
- private buildSelectorDerivedIndexes;
2407
2421
  private buildLayoutPropertiesByClassToken;
2408
- private buildFontFamilyUsageByRule;
2409
- private buildFontFaceDescriptorsByFamily;
2410
- private buildRuleDerivedIndexes;
2422
+ private buildFontIndexes;
2411
2423
  buildUnusedIndexes(): void;
2412
2424
  }
2413
2425
 
@@ -2517,7 +2529,7 @@ interface AlignmentContext {
2517
2529
  readonly evidence: LayoutContextEvidence;
2518
2530
  }
2519
2531
 
2520
- declare const layoutSignalNames: readonly ["line-height", "font-size", "width", "inline-size", "height", "block-size", "min-width", "min-block-size", "min-height", "aspect-ratio", "vertical-align", "display", "white-space", "object-fit", "overflow", "overflow-y", "overflow-anchor", "scrollbar-gutter", "scrollbar-width", "contain-intrinsic-size", "content-visibility", "align-items", "align-self", "justify-items", "place-items", "place-self", "flex-direction", "grid-auto-flow", "appearance", "box-sizing", "padding-top", "padding-left", "padding-right", "padding-bottom", "border-top-width", "border-left-width", "border-right-width", "border-bottom-width", "position", "top", "bottom", "margin-top", "margin-bottom", "transform", "translate", "inset-block-start", "inset-block-end", "writing-mode", "direction", "contain"];
2532
+ declare const layoutSignalNames: readonly ["line-height", "font-size", "width", "inline-size", "height", "block-size", "min-width", "min-block-size", "min-height", "max-width", "max-height", "aspect-ratio", "vertical-align", "display", "white-space", "object-fit", "overflow", "overflow-y", "overflow-anchor", "scrollbar-gutter", "scrollbar-width", "contain-intrinsic-size", "content-visibility", "align-items", "align-self", "justify-items", "place-items", "place-self", "flex-direction", "flex-basis", "grid-auto-flow", "appearance", "box-sizing", "padding-top", "padding-left", "padding-right", "padding-bottom", "border-top-width", "border-left-width", "border-right-width", "border-bottom-width", "position", "top", "bottom", "margin-top", "margin-bottom", "transform", "translate", "inset-block-start", "inset-block-end", "writing-mode", "direction", "contain"];
2521
2533
  type LayoutSignalName = (typeof layoutSignalNames)[number];
2522
2534
  declare const enum LayoutSignalSource {
2523
2535
  Selector = 0,
@@ -2533,18 +2545,26 @@ declare const enum LayoutSignalUnit {
2533
2545
  Keyword = 2,
2534
2546
  Unknown = 3
2535
2547
  }
2548
+ declare const enum SignalValueKind {
2549
+ Known = 0,
2550
+ Unknown = 1
2551
+ }
2552
+ declare const enum SignalQuality {
2553
+ Exact = 0,
2554
+ Estimated = 1
2555
+ }
2536
2556
  interface LayoutKnownSignalValue {
2537
- readonly kind: "known";
2557
+ readonly kind: SignalValueKind.Known;
2538
2558
  readonly name: LayoutSignalName;
2539
2559
  readonly normalized: string;
2540
2560
  readonly source: LayoutSignalSource;
2541
2561
  readonly guard: LayoutRuleGuard;
2542
2562
  readonly unit: LayoutSignalUnit;
2543
2563
  readonly px: number | null;
2544
- readonly quality: "exact" | "estimated";
2564
+ readonly quality: SignalQuality;
2545
2565
  }
2546
2566
  interface LayoutUnknownSignalValue {
2547
- readonly kind: "unknown";
2567
+ readonly kind: SignalValueKind.Unknown;
2548
2568
  readonly name: LayoutSignalName;
2549
2569
  readonly source: LayoutSignalSource | null;
2550
2570
  readonly guard: LayoutRuleGuard;
@@ -2782,10 +2802,10 @@ type LayoutReservedSpaceReason = "height" | "block-size" | "min-height" | "min-b
2782
2802
  interface LayoutReservedSpaceFact {
2783
2803
  readonly hasReservedSpace: boolean;
2784
2804
  readonly reasons: readonly LayoutReservedSpaceReason[];
2785
- readonly hasUsableInlineDimension: boolean;
2786
- readonly hasUsableBlockDimension: boolean;
2787
2805
  readonly hasContainIntrinsicSize: boolean;
2788
2806
  readonly hasUsableAspectRatio: boolean;
2807
+ readonly hasDeclaredInlineDimension: boolean;
2808
+ readonly hasDeclaredBlockDimension: boolean;
2789
2809
  }
2790
2810
  declare const enum LayoutScrollAxis {
2791
2811
  None = 0,
@@ -2843,46 +2863,35 @@ interface LayoutNormalizedRuleDeclaration {
2843
2863
  readonly startColumn: number;
2844
2864
  readonly propertyLength: number;
2845
2865
  }
2846
- interface LayoutGraphTopology {
2866
+ interface LayoutElementRecord {
2867
+ readonly ref: LayoutElementRef | null;
2868
+ readonly edges: readonly LayoutMatchEdge[];
2869
+ readonly cascade: ReadonlyMap<string, LayoutCascadedDeclaration>;
2870
+ readonly snapshot: LayoutSignalSnapshot;
2871
+ readonly hotSignals: LayoutSnapshotHotSignals;
2872
+ readonly reservedSpace: LayoutReservedSpaceFact;
2873
+ readonly scrollContainer: LayoutScrollContainerFact;
2874
+ readonly flowParticipation: LayoutFlowParticipationFact;
2875
+ readonly containingBlock: LayoutContainingBlockFact;
2876
+ readonly conditionalDelta: ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact> | null;
2877
+ readonly baselineOffsets: ReadonlyMap<LayoutSignalName, readonly number[]> | null;
2878
+ }
2879
+ interface LayoutGraph {
2847
2880
  readonly elements: readonly LayoutElementNode[];
2848
2881
  readonly childrenByParentNode: ReadonlyMap<LayoutElementNode, readonly LayoutElementNode[]>;
2849
2882
  readonly elementBySolidFileAndId: ReadonlyMap<string, ReadonlyMap<number, LayoutElementNode>>;
2850
2883
  readonly elementRefsBySolidFileAndId: ReadonlyMap<string, ReadonlyMap<number, LayoutElementRef>>;
2851
2884
  readonly elementsByTagName: ReadonlyMap<string, readonly LayoutElementNode[]>;
2852
2885
  readonly measurementNodeByRootKey: ReadonlyMap<string, LayoutElementNode>;
2853
- /**
2854
- * Maps component call-site nodes to their resolved host DOM element reference.
2855
- * Only populated for nodes that represent a component resolved to a concrete DOM
2856
- * element. Native DOM element nodes and unresolvable components are absent.
2857
- * Used by rules that need to inspect the host element's JSX attributes (e.g.
2858
- * dynamic `width`/`height` expressions not capturable as static strings).
2859
- */
2860
2886
  readonly hostElementRefsByNode: ReadonlyMap<LayoutElementNode, LayoutElementRef>;
2861
- }
2862
- interface LayoutGraphCascade {
2863
2887
  readonly styleRules: readonly LayoutStyleRuleNode[];
2864
2888
  readonly applies: readonly LayoutMatchEdge[];
2865
2889
  readonly cssScopeBySolidFile: ReadonlyMap<string, readonly string[]>;
2866
- readonly appliesByNode: ReadonlyMap<LayoutElementNode, readonly LayoutMatchEdge[]>;
2867
2890
  readonly selectorCandidatesByNode: ReadonlyMap<LayoutElementNode, readonly number[]>;
2868
2891
  readonly selectorsById: ReadonlyMap<number, SelectorEntity>;
2869
- readonly cascadeByElementNode: WeakMap<LayoutElementNode, ReadonlyMap<string, LayoutCascadedDeclaration>>;
2870
- readonly snapshotByElementNode: WeakMap<LayoutElementNode, LayoutSignalSnapshot>;
2871
- readonly snapshotHotSignalsByNode: ReadonlyMap<LayoutElementNode, LayoutSnapshotHotSignals>;
2872
- }
2873
- interface LayoutGraphFacts {
2874
- readonly reservedSpaceFactsByNode: ReadonlyMap<LayoutElementNode, LayoutReservedSpaceFact>;
2875
- readonly scrollContainerFactsByNode: ReadonlyMap<LayoutElementNode, LayoutScrollContainerFact>;
2876
- readonly flowParticipationFactsByNode: ReadonlyMap<LayoutElementNode, LayoutFlowParticipationFact>;
2877
- readonly containingBlockFactsByNode: ReadonlyMap<LayoutElementNode, LayoutContainingBlockFact>;
2878
- readonly conditionalSignalDeltaFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact>>;
2879
- readonly baselineOffsetFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, readonly number[]>>;
2880
- }
2881
- interface LayoutGraphCohorts {
2892
+ readonly records: ReadonlyMap<LayoutElementNode, LayoutElementRecord>;
2882
2893
  readonly cohortStatsByParentNode: ReadonlyMap<LayoutElementNode, LayoutCohortStats>;
2883
2894
  readonly contextByParentNode: ReadonlyMap<LayoutElementNode, AlignmentContext>;
2884
- }
2885
- interface LayoutGraphIndexes {
2886
2895
  readonly elementsWithConditionalDeltaBySignal: ReadonlyMap<LayoutSignalName, readonly LayoutElementNode[]>;
2887
2896
  readonly elementsWithConditionalOverflowDelta: readonly LayoutElementNode[];
2888
2897
  readonly elementsWithConditionalOffsetDelta: readonly LayoutElementNode[];
@@ -2892,8 +2901,6 @@ interface LayoutGraphIndexes {
2892
2901
  readonly statefulSelectorEntriesByRuleId: ReadonlyMap<number, readonly LayoutStatefulSelectorEntry[]>;
2893
2902
  readonly statefulNormalizedDeclarationsByRuleId: ReadonlyMap<number, readonly LayoutNormalizedRuleDeclaration[]>;
2894
2903
  readonly statefulBaseValueIndex: ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>;
2895
- }
2896
- interface LayoutGraph extends LayoutGraphTopology, LayoutGraphCascade, LayoutGraphFacts, LayoutGraphCohorts, LayoutGraphIndexes {
2897
2904
  readonly perf: LayoutPerfStatsMutable;
2898
2905
  }
2899
2906
 
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  RULES,
3
3
  RULES_BY_CATEGORY,
4
4
  getRule
5
- } from "./chunk-5OEDGKHL.js";
5
+ } from "./chunk-NFDA6LAI.js";
6
6
  import {
7
7
  CSSPlugin,
8
8
  Level,
@@ -20,7 +20,7 @@ import {
20
20
  runSolidRules,
21
21
  scanDependencyCustomProperties,
22
22
  setActivePolicy
23
- } from "./chunk-WY5MMHK2.js";
23
+ } from "./chunk-F5F7F4LG.js";
24
24
  import "./chunk-EGRHWZRV.js";
25
25
 
26
26
  // src/runner.ts