@webability/core 1.15.0 → 1.17.0

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/engine.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as ScanIssue, m as JudgeOptions, I as InternalBug, q as JudgedEntry, P as PageLike } from './types-gjAJ8j0I.cjs';
1
+ import { c as ScanIssue, m as JudgeOptions, I as InternalBug, q as JudgedEntry, P as PageLike } from './types-Bk-B2Y9X.cjs';
2
2
  import { d as FixJudgeTransport, f as FixJudgeVerdictKind } from './hostedFixJudge-DXYes7X1.cjs';
3
3
 
4
4
  /**
@@ -293,8 +293,11 @@ type EngineIssue = ScanIssue;
293
293
  * A WebAbility detector's own record of a reported issue: the fields scan()'s
294
294
  * issue row drops, for a consumer that writes values itself (the platform's
295
295
  * DetectedIssue). One per `source: 'webability'` issue in `issues[]`, same
296
- * `id`; axe-core rows have none. Only issues that survived scan()'s judging,
297
- * dedup and level gate get one.
296
+ * `id`; axe-core rows have none, except `target-size` (WCAG 2.5.8): an axe row
297
+ * with a checked min-size fix gets a synthetic record (issueType
298
+ * `target_too_small`, attribute `style`, fixValue the write, same `id` as the axe
299
+ * row) so a consumer that joins fixes through findings[] sees it. Only issues
300
+ * that survived scan()'s judging, dedup and level gate get one.
298
301
  */
299
302
  interface EngineFinding {
300
303
  /** The issue row's id (`issues[k].id`). */
@@ -352,6 +355,8 @@ interface EngineStats {
352
355
  * rejected candidate never blocks a valid one.
353
356
  * `rejectedByEmptyValue`: a detector fix with an empty value on an attribute
354
357
  * other than alt (a boolean attribute such as controls=""), why `empty_value`.
358
+ * `targetSizeSkipped`: axe target-size findings with no safe min-size fix, by skip reason
359
+ * (informational: the findings stay; not a degraded stage and not part of the identity above).
355
360
  */
356
361
  fixes: {
357
362
  candidates: number;
@@ -365,6 +370,7 @@ interface EngineStats {
365
370
  rejectedByEmptyValue: number;
366
371
  rejectedByNeverHarm: number;
367
372
  rejectedByVerify: number;
373
+ targetSizeSkipped: Record<string, number>;
368
374
  rejected: Array<{
369
375
  sel: string;
370
376
  attr: string;
@@ -877,4 +883,80 @@ interface SelectorQualityResult {
877
883
  declare const BARE_TAGS: Set<string>;
878
884
  declare function scoreSelectorQuality(selector: string): SelectorQualityResult;
879
885
 
880
- export { BARE_TAGS, type EngineFinding, type EngineFix, type EngineInput, type EngineIssue, type EngineOptions, type EngineResult, type EngineStats, FORM_CONTROL_ROLES, type HazardElementView, type HtmlDecision, type HtmlRequest, type HtmlRequestPolicy, InternalBug, type JudgedFix, LABEL_IN_NAME_JS, type Model, type ModelRequest, type ModelResponse, type Page, type PlaywrightPageLike, type ProtectedScope, type PuppeteerPageLike, SERVED_FIX_KEYS, TOKEN_QUERY_KEY, classifyFixRisk, detectPageLanguage, dropHazardousHidingFixes, foldContains, foldLabel, fromPlaywright, fromPuppeteer, htmlRequestPolicy, isHidingFix, isHtmlLangFix, isInteractiveOrContainsFocusable, isLabelText, labelContainsText, labelInNameCheck, languageFromText, languageFromUrl, loadSnapshot, normalizeVisibleText, parseContext, primaryLanguage, runEngine, scoreSelectorQuality, selectorParses, toPageLike, validateAttribute, validateFix, validateRoleValue, validateSelector, validateSelectorForAttribute, validateTextValue };
886
+ /**
887
+ * Hidden-at-rest text, listed as facts.
888
+ *
889
+ * Read-only and mechanical: this never clicks, hovers, scrolls, focuses or screenshots, and it decides nothing
890
+ * about whether a user can reach the content or whether it passes. It reports what the page says about itself:
891
+ * why a text group is not painted at rest, what the CSS backdrop is, and which interactive elements sit near it.
892
+ * A caller that has a browser and a judge (the platform lane) decides how to reveal a candidate and what it measures.
893
+ */
894
+
895
+ type HiddenKind = 'display' | 'visibility' | 'opacity' | 'offscreen' | 'overflow-clip' | 'zero-size';
896
+ type BackdropKind = 'plain' | 'image' | 'gradient' | 'sibling-layer' | 'unknown';
897
+ interface HiddenCause {
898
+ kind: HiddenKind;
899
+ /** The element that causes it (may be the text element itself). */
900
+ selector: string;
901
+ /** True when the element is moved out of view by a transform. */
902
+ transformed?: boolean;
903
+ }
904
+ interface HiddenText {
905
+ selector: string;
906
+ text: string;
907
+ fg: string | null;
908
+ /** Plain CSS backdrop colour when one is known from the cascade. */
909
+ bg: string | null;
910
+ backdropKind: BackdropKind;
911
+ /** Contrast of fg on bg ignoring the hiding (opacity treated as 1). Null unless the backdrop is plain. */
912
+ staticRatio: number | null;
913
+ threshold: number;
914
+ rect: {
915
+ x: number;
916
+ y: number;
917
+ w: number;
918
+ h: number;
919
+ } | null;
920
+ }
921
+ interface NearbyInteractive {
922
+ selector: string;
923
+ tag: string;
924
+ role: string | null;
925
+ name: string;
926
+ hrefKind: 'none' | 'hash' | 'javascript' | 'same-page' | 'external';
927
+ inForm: boolean;
928
+ expanded: string | null;
929
+ selected: string | null;
930
+ current: string | null;
931
+ pressed: string | null;
932
+ /** Levels above the group root at which it was found (1 = a child of the root's parent). */
933
+ distance: number;
934
+ relation: 'ancestor' | 'in-ancestor';
935
+ }
936
+ interface HiddenCandidate {
937
+ id: number;
938
+ /** The topmost hidden ancestor-or-self of the texts. */
939
+ root: string;
940
+ hiddenBy: HiddenCause[];
941
+ ariaHidden: boolean;
942
+ inert: boolean;
943
+ texts: HiddenText[];
944
+ interactiveNearby: NearbyInteractive[];
945
+ }
946
+ interface HiddenCandidateList {
947
+ candidates: HiddenCandidate[];
948
+ /** Hidden groups found on the page, before the cap. */
949
+ found: number;
950
+ truncated?: {
951
+ found: number;
952
+ kept: number;
953
+ cap: number;
954
+ };
955
+ }
956
+ declare const DEFAULT_MAX_CANDIDATES = 200;
957
+ /** List hidden-at-rest text groups with facts. Read-only. */
958
+ declare function listHiddenCandidates(page: PageLike, opts?: {
959
+ max?: number;
960
+ }): Promise<HiddenCandidateList>;
961
+
962
+ export { BARE_TAGS, type BackdropKind, DEFAULT_MAX_CANDIDATES, type EngineFinding, type EngineFix, type EngineInput, type EngineIssue, type EngineOptions, type EngineResult, type EngineStats, FORM_CONTROL_ROLES, type HazardElementView, type HiddenCandidate, type HiddenCandidateList, type HiddenCause, type HiddenKind, type HiddenText, type HtmlDecision, type HtmlRequest, type HtmlRequestPolicy, InternalBug, type JudgedFix, LABEL_IN_NAME_JS, type Model, type ModelRequest, type ModelResponse, type NearbyInteractive, type Page, type PlaywrightPageLike, type ProtectedScope, type PuppeteerPageLike, SERVED_FIX_KEYS, TOKEN_QUERY_KEY, classifyFixRisk, detectPageLanguage, dropHazardousHidingFixes, foldContains, foldLabel, fromPlaywright, fromPuppeteer, htmlRequestPolicy, isHidingFix, isHtmlLangFix, isInteractiveOrContainsFocusable, isLabelText, labelContainsText, labelInNameCheck, languageFromText, languageFromUrl, listHiddenCandidates, loadSnapshot, normalizeVisibleText, parseContext, primaryLanguage, runEngine, scoreSelectorQuality, selectorParses, toPageLike, validateAttribute, validateFix, validateRoleValue, validateSelector, validateSelectorForAttribute, validateTextValue };
package/dist/engine.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as ScanIssue, m as JudgeOptions, I as InternalBug, q as JudgedEntry, P as PageLike } from './types-gjAJ8j0I.js';
1
+ import { c as ScanIssue, m as JudgeOptions, I as InternalBug, q as JudgedEntry, P as PageLike } from './types-Bk-B2Y9X.js';
2
2
  import { d as FixJudgeTransport, f as FixJudgeVerdictKind } from './hostedFixJudge-DXYes7X1.js';
3
3
 
4
4
  /**
@@ -293,8 +293,11 @@ type EngineIssue = ScanIssue;
293
293
  * A WebAbility detector's own record of a reported issue: the fields scan()'s
294
294
  * issue row drops, for a consumer that writes values itself (the platform's
295
295
  * DetectedIssue). One per `source: 'webability'` issue in `issues[]`, same
296
- * `id`; axe-core rows have none. Only issues that survived scan()'s judging,
297
- * dedup and level gate get one.
296
+ * `id`; axe-core rows have none, except `target-size` (WCAG 2.5.8): an axe row
297
+ * with a checked min-size fix gets a synthetic record (issueType
298
+ * `target_too_small`, attribute `style`, fixValue the write, same `id` as the axe
299
+ * row) so a consumer that joins fixes through findings[] sees it. Only issues
300
+ * that survived scan()'s judging, dedup and level gate get one.
298
301
  */
299
302
  interface EngineFinding {
300
303
  /** The issue row's id (`issues[k].id`). */
@@ -352,6 +355,8 @@ interface EngineStats {
352
355
  * rejected candidate never blocks a valid one.
353
356
  * `rejectedByEmptyValue`: a detector fix with an empty value on an attribute
354
357
  * other than alt (a boolean attribute such as controls=""), why `empty_value`.
358
+ * `targetSizeSkipped`: axe target-size findings with no safe min-size fix, by skip reason
359
+ * (informational: the findings stay; not a degraded stage and not part of the identity above).
355
360
  */
356
361
  fixes: {
357
362
  candidates: number;
@@ -365,6 +370,7 @@ interface EngineStats {
365
370
  rejectedByEmptyValue: number;
366
371
  rejectedByNeverHarm: number;
367
372
  rejectedByVerify: number;
373
+ targetSizeSkipped: Record<string, number>;
368
374
  rejected: Array<{
369
375
  sel: string;
370
376
  attr: string;
@@ -877,4 +883,80 @@ interface SelectorQualityResult {
877
883
  declare const BARE_TAGS: Set<string>;
878
884
  declare function scoreSelectorQuality(selector: string): SelectorQualityResult;
879
885
 
880
- export { BARE_TAGS, type EngineFinding, type EngineFix, type EngineInput, type EngineIssue, type EngineOptions, type EngineResult, type EngineStats, FORM_CONTROL_ROLES, type HazardElementView, type HtmlDecision, type HtmlRequest, type HtmlRequestPolicy, InternalBug, type JudgedFix, LABEL_IN_NAME_JS, type Model, type ModelRequest, type ModelResponse, type Page, type PlaywrightPageLike, type ProtectedScope, type PuppeteerPageLike, SERVED_FIX_KEYS, TOKEN_QUERY_KEY, classifyFixRisk, detectPageLanguage, dropHazardousHidingFixes, foldContains, foldLabel, fromPlaywright, fromPuppeteer, htmlRequestPolicy, isHidingFix, isHtmlLangFix, isInteractiveOrContainsFocusable, isLabelText, labelContainsText, labelInNameCheck, languageFromText, languageFromUrl, loadSnapshot, normalizeVisibleText, parseContext, primaryLanguage, runEngine, scoreSelectorQuality, selectorParses, toPageLike, validateAttribute, validateFix, validateRoleValue, validateSelector, validateSelectorForAttribute, validateTextValue };
886
+ /**
887
+ * Hidden-at-rest text, listed as facts.
888
+ *
889
+ * Read-only and mechanical: this never clicks, hovers, scrolls, focuses or screenshots, and it decides nothing
890
+ * about whether a user can reach the content or whether it passes. It reports what the page says about itself:
891
+ * why a text group is not painted at rest, what the CSS backdrop is, and which interactive elements sit near it.
892
+ * A caller that has a browser and a judge (the platform lane) decides how to reveal a candidate and what it measures.
893
+ */
894
+
895
+ type HiddenKind = 'display' | 'visibility' | 'opacity' | 'offscreen' | 'overflow-clip' | 'zero-size';
896
+ type BackdropKind = 'plain' | 'image' | 'gradient' | 'sibling-layer' | 'unknown';
897
+ interface HiddenCause {
898
+ kind: HiddenKind;
899
+ /** The element that causes it (may be the text element itself). */
900
+ selector: string;
901
+ /** True when the element is moved out of view by a transform. */
902
+ transformed?: boolean;
903
+ }
904
+ interface HiddenText {
905
+ selector: string;
906
+ text: string;
907
+ fg: string | null;
908
+ /** Plain CSS backdrop colour when one is known from the cascade. */
909
+ bg: string | null;
910
+ backdropKind: BackdropKind;
911
+ /** Contrast of fg on bg ignoring the hiding (opacity treated as 1). Null unless the backdrop is plain. */
912
+ staticRatio: number | null;
913
+ threshold: number;
914
+ rect: {
915
+ x: number;
916
+ y: number;
917
+ w: number;
918
+ h: number;
919
+ } | null;
920
+ }
921
+ interface NearbyInteractive {
922
+ selector: string;
923
+ tag: string;
924
+ role: string | null;
925
+ name: string;
926
+ hrefKind: 'none' | 'hash' | 'javascript' | 'same-page' | 'external';
927
+ inForm: boolean;
928
+ expanded: string | null;
929
+ selected: string | null;
930
+ current: string | null;
931
+ pressed: string | null;
932
+ /** Levels above the group root at which it was found (1 = a child of the root's parent). */
933
+ distance: number;
934
+ relation: 'ancestor' | 'in-ancestor';
935
+ }
936
+ interface HiddenCandidate {
937
+ id: number;
938
+ /** The topmost hidden ancestor-or-self of the texts. */
939
+ root: string;
940
+ hiddenBy: HiddenCause[];
941
+ ariaHidden: boolean;
942
+ inert: boolean;
943
+ texts: HiddenText[];
944
+ interactiveNearby: NearbyInteractive[];
945
+ }
946
+ interface HiddenCandidateList {
947
+ candidates: HiddenCandidate[];
948
+ /** Hidden groups found on the page, before the cap. */
949
+ found: number;
950
+ truncated?: {
951
+ found: number;
952
+ kept: number;
953
+ cap: number;
954
+ };
955
+ }
956
+ declare const DEFAULT_MAX_CANDIDATES = 200;
957
+ /** List hidden-at-rest text groups with facts. Read-only. */
958
+ declare function listHiddenCandidates(page: PageLike, opts?: {
959
+ max?: number;
960
+ }): Promise<HiddenCandidateList>;
961
+
962
+ export { BARE_TAGS, type BackdropKind, DEFAULT_MAX_CANDIDATES, type EngineFinding, type EngineFix, type EngineInput, type EngineIssue, type EngineOptions, type EngineResult, type EngineStats, FORM_CONTROL_ROLES, type HazardElementView, type HiddenCandidate, type HiddenCandidateList, type HiddenCause, type HiddenKind, type HiddenText, type HtmlDecision, type HtmlRequest, type HtmlRequestPolicy, InternalBug, type JudgedFix, LABEL_IN_NAME_JS, type Model, type ModelRequest, type ModelResponse, type NearbyInteractive, type Page, type PlaywrightPageLike, type ProtectedScope, type PuppeteerPageLike, SERVED_FIX_KEYS, TOKEN_QUERY_KEY, classifyFixRisk, detectPageLanguage, dropHazardousHidingFixes, foldContains, foldLabel, fromPlaywright, fromPuppeteer, htmlRequestPolicy, isHidingFix, isHtmlLangFix, isInteractiveOrContainsFocusable, isLabelText, labelContainsText, labelInNameCheck, languageFromText, languageFromUrl, listHiddenCandidates, loadSnapshot, normalizeVisibleText, parseContext, primaryLanguage, runEngine, scoreSelectorQuality, selectorParses, toPageLike, validateAttribute, validateFix, validateRoleValue, validateSelector, validateSelectorForAttribute, validateTextValue };