@drskillissue/ganko 0.1.23 → 0.1.25

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
@@ -2425,6 +2425,11 @@ declare class CSSGraph {
2425
2425
  buildUnusedIndexes(): void;
2426
2426
  }
2427
2427
 
2428
+ interface ReservoirSampler {
2429
+ readonly buffer: number[];
2430
+ count: number;
2431
+ readonly capacity: number;
2432
+ }
2428
2433
  interface LayoutPerfStatsMutable {
2429
2434
  elementsScanned: number;
2430
2435
  selectorCandidatesChecked: number;
@@ -2445,7 +2450,7 @@ interface LayoutPerfStatsMutable {
2445
2450
  cohortUnimodalFalse: number;
2446
2451
  factorCoverageSum: number;
2447
2452
  factorCoverageCount: number;
2448
- posteriorWidths: number[];
2453
+ posteriorWidths: ReservoirSampler;
2449
2454
  uncertaintyEscalations: number;
2450
2455
  signalSnapshotsBuilt: number;
2451
2456
  signalSnapshotCacheHits: number;
@@ -2464,7 +2469,11 @@ type LayoutAxisModel = "horizontal-tb" | "vertical-rl" | "vertical-lr";
2464
2469
  type InlineDirectionModel = "ltr" | "rtl";
2465
2470
  type AlignmentContextKind = "inline-formatting" | "table-cell" | "flex-cross-axis" | "grid-cross-axis" | "block-flow" | "positioned-offset";
2466
2471
  type LayoutContextContainerKind = "table" | "flex" | "grid" | "inline" | "block";
2467
- type ContextCertainty = "resolved" | "conditional" | "unknown";
2472
+ declare const enum ContextCertainty {
2473
+ Resolved = 0,
2474
+ Conditional = 1,
2475
+ Unknown = 2
2476
+ }
2468
2477
  /**
2469
2478
  * Whether the CSS formatting context consults baselines for vertical positioning.
2470
2479
  *
@@ -2506,35 +2515,44 @@ interface AlignmentContext {
2506
2515
  readonly parentAlignItems: string | null;
2507
2516
  readonly parentPlaceItems: string | null;
2508
2517
  readonly hasPositionedOffset: boolean;
2518
+ /**
2519
+ * Whether the layout container's cross axis aligns with the document's
2520
+ * block axis. When `true`, vertical sibling offset differences represent
2521
+ * genuine alignment issues. When `false`, the block axis is the container's
2522
+ * main axis — vertical positioning is controlled by the layout algorithm
2523
+ * (gap, justify-content), and offset evidence should be suppressed.
2524
+ *
2525
+ * For non-flex/grid contexts (block flow, inline formatting, table-cell),
2526
+ * this is always `true`.
2527
+ */
2528
+ readonly crossAxisIsBlockAxis: boolean;
2529
+ readonly crossAxisIsBlockAxisCertainty: ContextCertainty;
2509
2530
  readonly baselineRelevance: BaselineRelevance;
2510
2531
  readonly evidence: LayoutContextEvidence;
2511
2532
  }
2512
2533
 
2513
- type LayoutGuardConditionKind = "media" | "supports" | "container";
2514
- interface LayoutGuardConditionProvenance {
2515
- readonly kind: LayoutGuardConditionKind;
2516
- readonly query: string | null;
2517
- readonly key: string;
2518
- }
2519
-
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", "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"];
2534
+ 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"];
2521
2535
  type LayoutSignalName = (typeof layoutSignalNames)[number];
2522
- type LayoutSignalSource = "selector" | "inline-style";
2523
- type LayoutSignalGuard = "unconditional" | "conditional";
2524
- interface LayoutGuardProvenance {
2525
- readonly kind: LayoutSignalGuard;
2526
- readonly conditions: readonly LayoutGuardConditionProvenance[];
2527
- readonly key: string;
2536
+ declare const enum LayoutSignalSource {
2537
+ Selector = 0,
2538
+ InlineStyle = 1
2539
+ }
2540
+ declare const enum LayoutSignalGuard {
2541
+ Unconditional = 0,
2542
+ Conditional = 1
2543
+ }
2544
+ declare const enum LayoutSignalUnit {
2545
+ Px = 0,
2546
+ Unitless = 1,
2547
+ Keyword = 2,
2548
+ Unknown = 3
2528
2549
  }
2529
- type LayoutSignalUnit = "px" | "unitless" | "keyword" | "unknown";
2530
2550
  interface LayoutKnownSignalValue {
2531
2551
  readonly kind: "known";
2532
2552
  readonly name: LayoutSignalName;
2533
- readonly raw: string;
2534
2553
  readonly normalized: string;
2535
2554
  readonly source: LayoutSignalSource;
2536
- readonly guard: LayoutSignalGuard;
2537
- readonly guardProvenance: LayoutGuardProvenance;
2555
+ readonly guard: LayoutRuleGuard;
2538
2556
  readonly unit: LayoutSignalUnit;
2539
2557
  readonly px: number | null;
2540
2558
  readonly quality: "exact" | "estimated";
@@ -2542,22 +2560,19 @@ interface LayoutKnownSignalValue {
2542
2560
  interface LayoutUnknownSignalValue {
2543
2561
  readonly kind: "unknown";
2544
2562
  readonly name: LayoutSignalName;
2545
- readonly raw: string | null;
2546
2563
  readonly source: LayoutSignalSource | null;
2547
- readonly guard: LayoutSignalGuard;
2548
- readonly guardProvenance: LayoutGuardProvenance;
2564
+ readonly guard: LayoutRuleGuard;
2549
2565
  readonly reason: string;
2550
2566
  }
2551
2567
  type LayoutSignalValue = LayoutKnownSignalValue | LayoutUnknownSignalValue;
2552
- type LayoutTextualContentState = "yes" | "no" | "unknown" | "dynamic-text";
2568
+ declare const enum LayoutTextualContentState {
2569
+ Yes = 0,
2570
+ No = 1,
2571
+ Unknown = 2,
2572
+ DynamicText = 3
2573
+ }
2553
2574
  interface LayoutSignalSnapshot {
2554
- readonly solidFile: string;
2555
- readonly elementId: number;
2556
- readonly elementKey: string;
2557
- readonly tag: string | null;
2558
- readonly textualContent: LayoutTextualContentState;
2559
- readonly isControl: boolean;
2560
- readonly isReplaced: boolean;
2575
+ readonly node: LayoutElementNode;
2561
2576
  readonly signals: ReadonlyMap<LayoutSignalName, LayoutSignalValue>;
2562
2577
  readonly knownSignalCount: number;
2563
2578
  readonly unknownSignalCount: number;
@@ -2570,8 +2585,16 @@ interface AlignmentElementEvidence {
2570
2585
  readonly tag: string | null;
2571
2586
  readonly snapshot: LayoutSignalSnapshot;
2572
2587
  }
2573
- type AlignmentTextContrast = "different" | "same" | "unknown";
2574
- type SignalConflictValue = "conflict" | "aligned" | "unknown";
2588
+ declare const enum AlignmentTextContrast {
2589
+ Different = 0,
2590
+ Same = 1,
2591
+ Unknown = 2
2592
+ }
2593
+ declare const enum SignalConflictValue {
2594
+ Conflict = 0,
2595
+ Aligned = 1,
2596
+ Unknown = 2
2597
+ }
2575
2598
  interface SignalConflictEvidence {
2576
2599
  readonly value: SignalConflictValue;
2577
2600
  readonly kind: EvidenceValueKind;
@@ -2583,7 +2606,12 @@ interface AlignmentCohortSignals {
2583
2606
  readonly hasControlOrReplacedPeer: boolean;
2584
2607
  readonly textContrastWithPeers: AlignmentTextContrast;
2585
2608
  }
2586
- type CohortSubjectMembership = "dominant" | "nondominant" | "ambiguous" | "insufficient";
2609
+ declare const enum CohortSubjectMembership {
2610
+ Dominant = 0,
2611
+ Nondominant = 1,
2612
+ Ambiguous = 2,
2613
+ Insufficient = 3
2614
+ }
2587
2615
  interface CohortIdentifiability {
2588
2616
  readonly dominantShare: number;
2589
2617
  readonly subjectExcludedDominantShare: number;
@@ -2623,6 +2651,8 @@ interface LayoutSnapshotHotSignals {
2623
2651
  readonly verticalAlign: HotNormalizedSignalEvidence;
2624
2652
  readonly alignSelf: HotNormalizedSignalEvidence;
2625
2653
  readonly placeSelf: HotNormalizedSignalEvidence;
2654
+ readonly flexDirection: HotNormalizedSignalEvidence;
2655
+ readonly gridAutoFlow: HotNormalizedSignalEvidence;
2626
2656
  readonly writingMode: HotNormalizedSignalEvidence;
2627
2657
  readonly direction: HotNormalizedSignalEvidence;
2628
2658
  readonly display: HotNormalizedSignalEvidence;
@@ -2659,7 +2689,14 @@ interface LayoutCohortStats {
2659
2689
  /** Element keys excluded from cohort analysis (e.g. visually-hidden accessible elements). */
2660
2690
  readonly excludedElementKeys: ReadonlySet<string>;
2661
2691
  }
2662
- type ContentCompositionClassification = "text-only" | "replaced-only" | "mixed-unmitigated" | "mixed-mitigated" | "block-segmented" | "unknown";
2692
+ declare const enum ContentCompositionClassification {
2693
+ TextOnly = 0,
2694
+ ReplacedOnly = 1,
2695
+ MixedUnmitigated = 2,
2696
+ MixedMitigated = 3,
2697
+ BlockSegmented = 4,
2698
+ Unknown = 5
2699
+ }
2663
2700
  /**
2664
2701
  * Distinguishes intrinsically-replaced elements (img, svg, video, canvas) from
2665
2702
  * inline-block/inline-flex containers. Their baseline rules differ: an img uses
@@ -2679,7 +2716,12 @@ interface ContentCompositionFingerprint {
2679
2716
  readonly totalChildCount: number;
2680
2717
  readonly hasOnlyBlockChildren: boolean;
2681
2718
  }
2682
- type EvidenceValueKind = "exact" | "interval" | "conditional" | "unknown";
2719
+ declare const enum EvidenceValueKind {
2720
+ Exact = 0,
2721
+ Interval = 1,
2722
+ Conditional = 2,
2723
+ Unknown = 3
2724
+ }
2683
2725
  interface EvidenceWitness<T> {
2684
2726
  readonly value: T | null;
2685
2727
  readonly kind: EvidenceValueKind;
@@ -2691,11 +2733,26 @@ interface EvidenceProvenance {
2691
2733
  readonly guards: readonly LayoutGuardConditionProvenance[];
2692
2734
  }
2693
2735
 
2736
+ type LayoutGuardConditionKind = "media" | "supports" | "container";
2737
+ interface LayoutGuardConditionProvenance {
2738
+ readonly kind: LayoutGuardConditionKind;
2739
+ readonly query: string | null;
2740
+ readonly key: string;
2741
+ }
2742
+ type LayoutRuleGuard = {
2743
+ readonly kind: LayoutSignalGuard.Unconditional;
2744
+ readonly conditions: readonly LayoutGuardConditionProvenance[];
2745
+ readonly key: "always";
2746
+ } | {
2747
+ readonly kind: LayoutSignalGuard.Conditional;
2748
+ readonly conditions: readonly LayoutGuardConditionProvenance[];
2749
+ readonly key: string;
2750
+ };
2751
+
2694
2752
  interface LayoutCascadedDeclaration {
2695
2753
  readonly value: string;
2696
- readonly source: "selector" | "inline-style";
2697
- readonly guard: LayoutSignalGuard;
2698
- readonly guardProvenance: LayoutGuardProvenance;
2754
+ readonly source: LayoutSignalSource;
2755
+ readonly guardProvenance: LayoutRuleGuard;
2699
2756
  }
2700
2757
  interface LayoutElementNode {
2701
2758
  readonly key: string;
@@ -2706,8 +2763,6 @@ interface LayoutElementNode {
2706
2763
  readonly classTokens: readonly string[];
2707
2764
  readonly classTokenSet: ReadonlySet<string>;
2708
2765
  readonly inlineStyleKeys: readonly string[];
2709
- readonly parentElementId: number | null;
2710
- readonly parentElementKey: string | null;
2711
2766
  readonly parentElementNode: LayoutElementNode | null;
2712
2767
  readonly previousSiblingNode: LayoutElementNode | null;
2713
2768
  readonly siblingIndex: number;
@@ -2717,7 +2772,7 @@ interface LayoutElementNode {
2717
2772
  readonly selectorDispatchKeys: readonly string[];
2718
2773
  readonly attributes: ReadonlyMap<string, string | null>;
2719
2774
  readonly inlineStyleValues: ReadonlyMap<string, string>;
2720
- readonly textualContent: "yes" | "no" | "unknown" | "dynamic-text";
2775
+ readonly textualContent: LayoutTextualContentState;
2721
2776
  readonly isControl: boolean;
2722
2777
  readonly isReplaced: boolean;
2723
2778
  }
@@ -2727,9 +2782,6 @@ interface LayoutStyleRuleNode {
2727
2782
  readonly selectorId: number;
2728
2783
  }
2729
2784
  interface LayoutMatchEdge {
2730
- readonly solidFile: string;
2731
- readonly elementId: number;
2732
- readonly elementKey: string;
2733
2785
  readonly selectorId: number;
2734
2786
  readonly specificityScore: number;
2735
2787
  readonly sourceOrder: number;
@@ -2747,7 +2799,12 @@ interface LayoutReservedSpaceFact {
2747
2799
  readonly hasContainIntrinsicSize: boolean;
2748
2800
  readonly hasUsableAspectRatio: boolean;
2749
2801
  }
2750
- type LayoutScrollAxis = "x" | "y" | "both" | "none";
2802
+ declare const enum LayoutScrollAxis {
2803
+ None = 0,
2804
+ X = 1,
2805
+ Y = 2,
2806
+ Both = 3
2807
+ }
2751
2808
  interface LayoutScrollContainerFact {
2752
2809
  readonly isScrollContainer: boolean;
2753
2810
  readonly axis: LayoutScrollAxis;
@@ -2810,20 +2867,20 @@ interface LayoutGraphCascade {
2810
2867
  readonly styleRules: readonly LayoutStyleRuleNode[];
2811
2868
  readonly applies: readonly LayoutMatchEdge[];
2812
2869
  readonly cssScopeBySolidFile: ReadonlyMap<string, readonly string[]>;
2813
- readonly appliesByElementKey: ReadonlyMap<string, readonly LayoutMatchEdge[]>;
2814
- readonly selectorCandidatesByElementKey: ReadonlyMap<string, readonly number[]>;
2870
+ readonly appliesByNode: ReadonlyMap<LayoutElementNode, readonly LayoutMatchEdge[]>;
2871
+ readonly selectorCandidatesByNode: ReadonlyMap<LayoutElementNode, readonly number[]>;
2815
2872
  readonly selectorsById: ReadonlyMap<number, SelectorEntity>;
2816
2873
  readonly cascadeByElementNode: WeakMap<LayoutElementNode, ReadonlyMap<string, LayoutCascadedDeclaration>>;
2817
2874
  readonly snapshotByElementNode: WeakMap<LayoutElementNode, LayoutSignalSnapshot>;
2818
- readonly snapshotHotSignalsByElementKey: ReadonlyMap<string, LayoutSnapshotHotSignals>;
2875
+ readonly snapshotHotSignalsByNode: ReadonlyMap<LayoutElementNode, LayoutSnapshotHotSignals>;
2819
2876
  }
2820
2877
  interface LayoutGraphFacts {
2821
- readonly reservedSpaceFactsByElementKey: ReadonlyMap<string, LayoutReservedSpaceFact>;
2822
- readonly scrollContainerFactsByElementKey: ReadonlyMap<string, LayoutScrollContainerFact>;
2823
- readonly flowParticipationFactsByElementKey: ReadonlyMap<string, LayoutFlowParticipationFact>;
2824
- readonly containingBlockFactsByElementKey: ReadonlyMap<string, LayoutContainingBlockFact>;
2825
- readonly conditionalSignalDeltaFactsByElementKey: ReadonlyMap<string, ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact>>;
2826
- readonly baselineOffsetFactsByElementKey: ReadonlyMap<string, ReadonlyMap<LayoutSignalName, readonly number[]>>;
2878
+ readonly reservedSpaceFactsByNode: ReadonlyMap<LayoutElementNode, LayoutReservedSpaceFact>;
2879
+ readonly scrollContainerFactsByNode: ReadonlyMap<LayoutElementNode, LayoutScrollContainerFact>;
2880
+ readonly flowParticipationFactsByNode: ReadonlyMap<LayoutElementNode, LayoutFlowParticipationFact>;
2881
+ readonly containingBlockFactsByNode: ReadonlyMap<LayoutElementNode, LayoutContainingBlockFact>;
2882
+ readonly conditionalSignalDeltaFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact>>;
2883
+ readonly baselineOffsetFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, readonly number[]>>;
2827
2884
  }
2828
2885
  interface LayoutGraphCohorts {
2829
2886
  readonly cohortStatsByParentNode: ReadonlyMap<LayoutElementNode, LayoutCohortStats>;
package/dist/index.d.ts CHANGED
@@ -2425,6 +2425,11 @@ declare class CSSGraph {
2425
2425
  buildUnusedIndexes(): void;
2426
2426
  }
2427
2427
 
2428
+ interface ReservoirSampler {
2429
+ readonly buffer: number[];
2430
+ count: number;
2431
+ readonly capacity: number;
2432
+ }
2428
2433
  interface LayoutPerfStatsMutable {
2429
2434
  elementsScanned: number;
2430
2435
  selectorCandidatesChecked: number;
@@ -2445,7 +2450,7 @@ interface LayoutPerfStatsMutable {
2445
2450
  cohortUnimodalFalse: number;
2446
2451
  factorCoverageSum: number;
2447
2452
  factorCoverageCount: number;
2448
- posteriorWidths: number[];
2453
+ posteriorWidths: ReservoirSampler;
2449
2454
  uncertaintyEscalations: number;
2450
2455
  signalSnapshotsBuilt: number;
2451
2456
  signalSnapshotCacheHits: number;
@@ -2464,7 +2469,11 @@ type LayoutAxisModel = "horizontal-tb" | "vertical-rl" | "vertical-lr";
2464
2469
  type InlineDirectionModel = "ltr" | "rtl";
2465
2470
  type AlignmentContextKind = "inline-formatting" | "table-cell" | "flex-cross-axis" | "grid-cross-axis" | "block-flow" | "positioned-offset";
2466
2471
  type LayoutContextContainerKind = "table" | "flex" | "grid" | "inline" | "block";
2467
- type ContextCertainty = "resolved" | "conditional" | "unknown";
2472
+ declare const enum ContextCertainty {
2473
+ Resolved = 0,
2474
+ Conditional = 1,
2475
+ Unknown = 2
2476
+ }
2468
2477
  /**
2469
2478
  * Whether the CSS formatting context consults baselines for vertical positioning.
2470
2479
  *
@@ -2506,35 +2515,44 @@ interface AlignmentContext {
2506
2515
  readonly parentAlignItems: string | null;
2507
2516
  readonly parentPlaceItems: string | null;
2508
2517
  readonly hasPositionedOffset: boolean;
2518
+ /**
2519
+ * Whether the layout container's cross axis aligns with the document's
2520
+ * block axis. When `true`, vertical sibling offset differences represent
2521
+ * genuine alignment issues. When `false`, the block axis is the container's
2522
+ * main axis — vertical positioning is controlled by the layout algorithm
2523
+ * (gap, justify-content), and offset evidence should be suppressed.
2524
+ *
2525
+ * For non-flex/grid contexts (block flow, inline formatting, table-cell),
2526
+ * this is always `true`.
2527
+ */
2528
+ readonly crossAxisIsBlockAxis: boolean;
2529
+ readonly crossAxisIsBlockAxisCertainty: ContextCertainty;
2509
2530
  readonly baselineRelevance: BaselineRelevance;
2510
2531
  readonly evidence: LayoutContextEvidence;
2511
2532
  }
2512
2533
 
2513
- type LayoutGuardConditionKind = "media" | "supports" | "container";
2514
- interface LayoutGuardConditionProvenance {
2515
- readonly kind: LayoutGuardConditionKind;
2516
- readonly query: string | null;
2517
- readonly key: string;
2518
- }
2519
-
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", "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"];
2534
+ 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"];
2521
2535
  type LayoutSignalName = (typeof layoutSignalNames)[number];
2522
- type LayoutSignalSource = "selector" | "inline-style";
2523
- type LayoutSignalGuard = "unconditional" | "conditional";
2524
- interface LayoutGuardProvenance {
2525
- readonly kind: LayoutSignalGuard;
2526
- readonly conditions: readonly LayoutGuardConditionProvenance[];
2527
- readonly key: string;
2536
+ declare const enum LayoutSignalSource {
2537
+ Selector = 0,
2538
+ InlineStyle = 1
2539
+ }
2540
+ declare const enum LayoutSignalGuard {
2541
+ Unconditional = 0,
2542
+ Conditional = 1
2543
+ }
2544
+ declare const enum LayoutSignalUnit {
2545
+ Px = 0,
2546
+ Unitless = 1,
2547
+ Keyword = 2,
2548
+ Unknown = 3
2528
2549
  }
2529
- type LayoutSignalUnit = "px" | "unitless" | "keyword" | "unknown";
2530
2550
  interface LayoutKnownSignalValue {
2531
2551
  readonly kind: "known";
2532
2552
  readonly name: LayoutSignalName;
2533
- readonly raw: string;
2534
2553
  readonly normalized: string;
2535
2554
  readonly source: LayoutSignalSource;
2536
- readonly guard: LayoutSignalGuard;
2537
- readonly guardProvenance: LayoutGuardProvenance;
2555
+ readonly guard: LayoutRuleGuard;
2538
2556
  readonly unit: LayoutSignalUnit;
2539
2557
  readonly px: number | null;
2540
2558
  readonly quality: "exact" | "estimated";
@@ -2542,22 +2560,19 @@ interface LayoutKnownSignalValue {
2542
2560
  interface LayoutUnknownSignalValue {
2543
2561
  readonly kind: "unknown";
2544
2562
  readonly name: LayoutSignalName;
2545
- readonly raw: string | null;
2546
2563
  readonly source: LayoutSignalSource | null;
2547
- readonly guard: LayoutSignalGuard;
2548
- readonly guardProvenance: LayoutGuardProvenance;
2564
+ readonly guard: LayoutRuleGuard;
2549
2565
  readonly reason: string;
2550
2566
  }
2551
2567
  type LayoutSignalValue = LayoutKnownSignalValue | LayoutUnknownSignalValue;
2552
- type LayoutTextualContentState = "yes" | "no" | "unknown" | "dynamic-text";
2568
+ declare const enum LayoutTextualContentState {
2569
+ Yes = 0,
2570
+ No = 1,
2571
+ Unknown = 2,
2572
+ DynamicText = 3
2573
+ }
2553
2574
  interface LayoutSignalSnapshot {
2554
- readonly solidFile: string;
2555
- readonly elementId: number;
2556
- readonly elementKey: string;
2557
- readonly tag: string | null;
2558
- readonly textualContent: LayoutTextualContentState;
2559
- readonly isControl: boolean;
2560
- readonly isReplaced: boolean;
2575
+ readonly node: LayoutElementNode;
2561
2576
  readonly signals: ReadonlyMap<LayoutSignalName, LayoutSignalValue>;
2562
2577
  readonly knownSignalCount: number;
2563
2578
  readonly unknownSignalCount: number;
@@ -2570,8 +2585,16 @@ interface AlignmentElementEvidence {
2570
2585
  readonly tag: string | null;
2571
2586
  readonly snapshot: LayoutSignalSnapshot;
2572
2587
  }
2573
- type AlignmentTextContrast = "different" | "same" | "unknown";
2574
- type SignalConflictValue = "conflict" | "aligned" | "unknown";
2588
+ declare const enum AlignmentTextContrast {
2589
+ Different = 0,
2590
+ Same = 1,
2591
+ Unknown = 2
2592
+ }
2593
+ declare const enum SignalConflictValue {
2594
+ Conflict = 0,
2595
+ Aligned = 1,
2596
+ Unknown = 2
2597
+ }
2575
2598
  interface SignalConflictEvidence {
2576
2599
  readonly value: SignalConflictValue;
2577
2600
  readonly kind: EvidenceValueKind;
@@ -2583,7 +2606,12 @@ interface AlignmentCohortSignals {
2583
2606
  readonly hasControlOrReplacedPeer: boolean;
2584
2607
  readonly textContrastWithPeers: AlignmentTextContrast;
2585
2608
  }
2586
- type CohortSubjectMembership = "dominant" | "nondominant" | "ambiguous" | "insufficient";
2609
+ declare const enum CohortSubjectMembership {
2610
+ Dominant = 0,
2611
+ Nondominant = 1,
2612
+ Ambiguous = 2,
2613
+ Insufficient = 3
2614
+ }
2587
2615
  interface CohortIdentifiability {
2588
2616
  readonly dominantShare: number;
2589
2617
  readonly subjectExcludedDominantShare: number;
@@ -2623,6 +2651,8 @@ interface LayoutSnapshotHotSignals {
2623
2651
  readonly verticalAlign: HotNormalizedSignalEvidence;
2624
2652
  readonly alignSelf: HotNormalizedSignalEvidence;
2625
2653
  readonly placeSelf: HotNormalizedSignalEvidence;
2654
+ readonly flexDirection: HotNormalizedSignalEvidence;
2655
+ readonly gridAutoFlow: HotNormalizedSignalEvidence;
2626
2656
  readonly writingMode: HotNormalizedSignalEvidence;
2627
2657
  readonly direction: HotNormalizedSignalEvidence;
2628
2658
  readonly display: HotNormalizedSignalEvidence;
@@ -2659,7 +2689,14 @@ interface LayoutCohortStats {
2659
2689
  /** Element keys excluded from cohort analysis (e.g. visually-hidden accessible elements). */
2660
2690
  readonly excludedElementKeys: ReadonlySet<string>;
2661
2691
  }
2662
- type ContentCompositionClassification = "text-only" | "replaced-only" | "mixed-unmitigated" | "mixed-mitigated" | "block-segmented" | "unknown";
2692
+ declare const enum ContentCompositionClassification {
2693
+ TextOnly = 0,
2694
+ ReplacedOnly = 1,
2695
+ MixedUnmitigated = 2,
2696
+ MixedMitigated = 3,
2697
+ BlockSegmented = 4,
2698
+ Unknown = 5
2699
+ }
2663
2700
  /**
2664
2701
  * Distinguishes intrinsically-replaced elements (img, svg, video, canvas) from
2665
2702
  * inline-block/inline-flex containers. Their baseline rules differ: an img uses
@@ -2679,7 +2716,12 @@ interface ContentCompositionFingerprint {
2679
2716
  readonly totalChildCount: number;
2680
2717
  readonly hasOnlyBlockChildren: boolean;
2681
2718
  }
2682
- type EvidenceValueKind = "exact" | "interval" | "conditional" | "unknown";
2719
+ declare const enum EvidenceValueKind {
2720
+ Exact = 0,
2721
+ Interval = 1,
2722
+ Conditional = 2,
2723
+ Unknown = 3
2724
+ }
2683
2725
  interface EvidenceWitness<T> {
2684
2726
  readonly value: T | null;
2685
2727
  readonly kind: EvidenceValueKind;
@@ -2691,11 +2733,26 @@ interface EvidenceProvenance {
2691
2733
  readonly guards: readonly LayoutGuardConditionProvenance[];
2692
2734
  }
2693
2735
 
2736
+ type LayoutGuardConditionKind = "media" | "supports" | "container";
2737
+ interface LayoutGuardConditionProvenance {
2738
+ readonly kind: LayoutGuardConditionKind;
2739
+ readonly query: string | null;
2740
+ readonly key: string;
2741
+ }
2742
+ type LayoutRuleGuard = {
2743
+ readonly kind: LayoutSignalGuard.Unconditional;
2744
+ readonly conditions: readonly LayoutGuardConditionProvenance[];
2745
+ readonly key: "always";
2746
+ } | {
2747
+ readonly kind: LayoutSignalGuard.Conditional;
2748
+ readonly conditions: readonly LayoutGuardConditionProvenance[];
2749
+ readonly key: string;
2750
+ };
2751
+
2694
2752
  interface LayoutCascadedDeclaration {
2695
2753
  readonly value: string;
2696
- readonly source: "selector" | "inline-style";
2697
- readonly guard: LayoutSignalGuard;
2698
- readonly guardProvenance: LayoutGuardProvenance;
2754
+ readonly source: LayoutSignalSource;
2755
+ readonly guardProvenance: LayoutRuleGuard;
2699
2756
  }
2700
2757
  interface LayoutElementNode {
2701
2758
  readonly key: string;
@@ -2706,8 +2763,6 @@ interface LayoutElementNode {
2706
2763
  readonly classTokens: readonly string[];
2707
2764
  readonly classTokenSet: ReadonlySet<string>;
2708
2765
  readonly inlineStyleKeys: readonly string[];
2709
- readonly parentElementId: number | null;
2710
- readonly parentElementKey: string | null;
2711
2766
  readonly parentElementNode: LayoutElementNode | null;
2712
2767
  readonly previousSiblingNode: LayoutElementNode | null;
2713
2768
  readonly siblingIndex: number;
@@ -2717,7 +2772,7 @@ interface LayoutElementNode {
2717
2772
  readonly selectorDispatchKeys: readonly string[];
2718
2773
  readonly attributes: ReadonlyMap<string, string | null>;
2719
2774
  readonly inlineStyleValues: ReadonlyMap<string, string>;
2720
- readonly textualContent: "yes" | "no" | "unknown" | "dynamic-text";
2775
+ readonly textualContent: LayoutTextualContentState;
2721
2776
  readonly isControl: boolean;
2722
2777
  readonly isReplaced: boolean;
2723
2778
  }
@@ -2727,9 +2782,6 @@ interface LayoutStyleRuleNode {
2727
2782
  readonly selectorId: number;
2728
2783
  }
2729
2784
  interface LayoutMatchEdge {
2730
- readonly solidFile: string;
2731
- readonly elementId: number;
2732
- readonly elementKey: string;
2733
2785
  readonly selectorId: number;
2734
2786
  readonly specificityScore: number;
2735
2787
  readonly sourceOrder: number;
@@ -2747,7 +2799,12 @@ interface LayoutReservedSpaceFact {
2747
2799
  readonly hasContainIntrinsicSize: boolean;
2748
2800
  readonly hasUsableAspectRatio: boolean;
2749
2801
  }
2750
- type LayoutScrollAxis = "x" | "y" | "both" | "none";
2802
+ declare const enum LayoutScrollAxis {
2803
+ None = 0,
2804
+ X = 1,
2805
+ Y = 2,
2806
+ Both = 3
2807
+ }
2751
2808
  interface LayoutScrollContainerFact {
2752
2809
  readonly isScrollContainer: boolean;
2753
2810
  readonly axis: LayoutScrollAxis;
@@ -2810,20 +2867,20 @@ interface LayoutGraphCascade {
2810
2867
  readonly styleRules: readonly LayoutStyleRuleNode[];
2811
2868
  readonly applies: readonly LayoutMatchEdge[];
2812
2869
  readonly cssScopeBySolidFile: ReadonlyMap<string, readonly string[]>;
2813
- readonly appliesByElementKey: ReadonlyMap<string, readonly LayoutMatchEdge[]>;
2814
- readonly selectorCandidatesByElementKey: ReadonlyMap<string, readonly number[]>;
2870
+ readonly appliesByNode: ReadonlyMap<LayoutElementNode, readonly LayoutMatchEdge[]>;
2871
+ readonly selectorCandidatesByNode: ReadonlyMap<LayoutElementNode, readonly number[]>;
2815
2872
  readonly selectorsById: ReadonlyMap<number, SelectorEntity>;
2816
2873
  readonly cascadeByElementNode: WeakMap<LayoutElementNode, ReadonlyMap<string, LayoutCascadedDeclaration>>;
2817
2874
  readonly snapshotByElementNode: WeakMap<LayoutElementNode, LayoutSignalSnapshot>;
2818
- readonly snapshotHotSignalsByElementKey: ReadonlyMap<string, LayoutSnapshotHotSignals>;
2875
+ readonly snapshotHotSignalsByNode: ReadonlyMap<LayoutElementNode, LayoutSnapshotHotSignals>;
2819
2876
  }
2820
2877
  interface LayoutGraphFacts {
2821
- readonly reservedSpaceFactsByElementKey: ReadonlyMap<string, LayoutReservedSpaceFact>;
2822
- readonly scrollContainerFactsByElementKey: ReadonlyMap<string, LayoutScrollContainerFact>;
2823
- readonly flowParticipationFactsByElementKey: ReadonlyMap<string, LayoutFlowParticipationFact>;
2824
- readonly containingBlockFactsByElementKey: ReadonlyMap<string, LayoutContainingBlockFact>;
2825
- readonly conditionalSignalDeltaFactsByElementKey: ReadonlyMap<string, ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact>>;
2826
- readonly baselineOffsetFactsByElementKey: ReadonlyMap<string, ReadonlyMap<LayoutSignalName, readonly number[]>>;
2878
+ readonly reservedSpaceFactsByNode: ReadonlyMap<LayoutElementNode, LayoutReservedSpaceFact>;
2879
+ readonly scrollContainerFactsByNode: ReadonlyMap<LayoutElementNode, LayoutScrollContainerFact>;
2880
+ readonly flowParticipationFactsByNode: ReadonlyMap<LayoutElementNode, LayoutFlowParticipationFact>;
2881
+ readonly containingBlockFactsByNode: ReadonlyMap<LayoutElementNode, LayoutContainingBlockFact>;
2882
+ readonly conditionalSignalDeltaFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact>>;
2883
+ readonly baselineOffsetFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, readonly number[]>>;
2827
2884
  }
2828
2885
  interface LayoutGraphCohorts {
2829
2886
  readonly cohortStatsByParentNode: ReadonlyMap<LayoutElementNode, LayoutCohortStats>;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  RULES,
3
3
  RULES_BY_CATEGORY,
4
4
  getRule
5
- } from "./chunk-4PJEULOI.js";
5
+ } from "./chunk-KVZ56NZ5.js";
6
6
  import {
7
7
  CSSPlugin,
8
8
  SolidPlugin,
@@ -21,7 +21,7 @@ import {
21
21
  runSolidRules,
22
22
  scanDependencyCustomProperties,
23
23
  setActivePolicy
24
- } from "./chunk-V6U7TQCD.js";
24
+ } from "./chunk-64TMAKYI.js";
25
25
  import "./chunk-EGRHWZRV.js";
26
26
 
27
27
  // src/runner.ts