@accesslint/core 0.6.1 → 0.6.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"color-contrast.d.ts","sourceRoot":"","sources":["../../../src/rules/color/color-contrast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AA4MrC,eAAO,MAAM,aAAa,EAAE,IAc3B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,IAYnC,CAAC"}
1
+ {"version":3,"file":"color-contrast.d.ts","sourceRoot":"","sources":["../../../src/rules/color/color-contrast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAkOrC,eAAO,MAAM,aAAa,EAAE,IAc3B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,IAYnC,CAAC"}
@@ -6,21 +6,20 @@ export interface ChunkedAudit {
6
6
  /** Return all violations collected so far. */
7
7
  getViolations(): Violation[];
8
8
  }
9
- export declare const defaultDisabledRuleIds: Set<string>;
10
9
  export interface ConfigureOptions {
11
10
  /** Additional rules to include (e.g. compiled declarative rules) */
12
11
  additionalRules?: Rule[];
13
- /** Rule IDs to disable (in addition to default-disabled rules) */
12
+ /** Rule IDs to disable */
14
13
  disabledRules?: string[];
15
- /** Rule IDs to re-enable from the default-disabled set */
16
- enabledRules?: string[];
14
+ /** Include AAA-level rules (excluded by default) */
15
+ includeAAA?: boolean;
17
16
  /** Locale for translated rule descriptions/guidance (e.g. 'en', 'es') */
18
17
  locale?: string;
19
18
  }
20
19
  export declare function configureRules(options: ConfigureOptions): void;
21
20
  /**
22
- * Return the full set of active rules: bundled (minus default-disabled and
23
- * user-disabled, plus re-enabled) plus any additional rules via configureRules().
21
+ * Return the full set of active rules: bundled (minus user-disabled, minus
22
+ * AAA unless includeAAA is set) plus any additional rules via configureRules().
24
23
  * When a locale is active, returns shallow-cloned rules with translated fields.
25
24
  */
26
25
  export declare function getActiveRules(): Rule[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAoG5D,eAAO,MAAM,KAAK,EAAE,IAAI,EAqHvB,CAAC;AAGF,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IACxC,8CAA8C;IAC9C,aAAa,IAAI,SAAS,EAAE,CAAC;CAC9B;AAOD,eAAO,MAAM,sBAAsB,aAMjC,CAAC;AAUH,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAc9D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,EAAE,CAiBvC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,GAAG,YAAY,CAwB9D;AAED,wBAAgB,cAAc,IAAI,IAAI,CAOrC;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAkBnD;AAID,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAQxD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAoG5D,eAAO,MAAM,KAAK,EAAE,IAAI,EAqHvB,CAAC;AAGF,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IACxC,8CAA8C;IAC9C,aAAa,IAAI,SAAS,EAAE,CAAC;CAC9B;AAUD,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC;IACzB,0BAA0B;IAC1B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAc9D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,EAAE,CAgBvC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,GAAG,YAAY,CAwB9D;AAED,wBAAgB,cAAc,IAAI,IAAI,CAOrC;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAkBnD;AAID,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAQxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/keyboard/interactive-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAa,MAAM,UAAU,CAAC;AAuFhD,eAAO,MAAM,iBAAiB,EAAE,IAkD/B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,IAmFvC,CAAC"}
1
+ {"version":3,"file":"interactive-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/keyboard/interactive-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAa,MAAM,UAAU,CAAC;AAuFhD,eAAO,MAAM,iBAAiB,EAAE,IAkD/B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,IAqFvC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"link-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/links/link-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAUrC,eAAO,MAAM,QAAQ,EAAE,IA4CtB,CAAC;AA2DF,eAAO,MAAM,eAAe,EAAE,IA+E7B,CAAC"}
1
+ {"version":3,"file":"link-rules.d.ts","sourceRoot":"","sources":["../../../src/rules/links/link-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAUrC,eAAO,MAAM,QAAQ,EAAE,IA4CtB,CAAC;AAuEF,eAAO,MAAM,eAAe,EAAE,IAgF7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"table-headers.d.ts","sourceRoot":"","sources":["../../../src/rules/tables/table-headers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIrC,eAAO,MAAM,aAAa,EAAE,IA2C3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,IA8B5B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,IA8FzB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,IA6B5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,IAiC9B,CAAC"}
1
+ {"version":3,"file":"table-headers.d.ts","sourceRoot":"","sources":["../../../src/rules/tables/table-headers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIrC,eAAO,MAAM,aAAa,EAAE,IA2C3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,IA8B5B,CAAC;AAwCF,eAAO,MAAM,WAAW,EAAE,IAwFzB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,IA6B5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,IAiC9B,CAAC"}
@@ -14,6 +14,11 @@ export declare function parseColorAlpha(color: string): number;
14
14
  */
15
15
  export declare function compositeColors(fg: [number, number, number], bg: [number, number, number], alpha: number): [number, number, number];
16
16
  export declare function getEffectiveBackgroundColor(el: Element): [number, number, number] | null;
17
+ /**
18
+ * Split a string by commas, respecting parentheses.
19
+ * e.g. "to right, rgb(255, 0, 0), blue 50%" → ["to right", "rgb(255, 0, 0)", "blue 50%"]
20
+ */
21
+ export declare function splitByComma(content: string): string[];
17
22
  /**
18
23
  * Extract color stops from a CSS gradient value.
19
24
  * Returns parsed RGB colors for each stop, skipping positions/angles.
@@ -21,11 +26,28 @@ export declare function getEffectiveBackgroundColor(el: Element): [number, numbe
21
26
  */
22
27
  export declare function parseGradientStops(bgImage: string, transparentFallback?: [number, number, number]): [number, number, number][];
23
28
  /**
24
- * Detects whether text may be visually overlaid on a media element (<img>,
25
- * <picture>, <video>, <svg>) via CSS positioning. Returns true when either
26
- * the text or a sibling media element is positioned out of normal flow
29
+ * Detects whether text may be visually overlaid on an image via CSS
30
+ * positioning. Checks sibling branches for media elements (<img>, <picture>,
31
+ * <video>, <svg>) including those nested inside wrapper divs and for
32
+ * positioned siblings with CSS background-image. Returns true when either
33
+ * the text or a sibling visual element is positioned out of normal flow
27
34
  * within a shared positioning context — the common hero/card overlay pattern.
28
35
  */
29
36
  export declare function mayBeOverImage(el: Element): boolean;
30
37
  export declare function isLargeText(el: Element): boolean;
38
+ export interface TextShadow {
39
+ color: [number, number, number];
40
+ blur: number;
41
+ }
42
+ /**
43
+ * Parse a CSS text-shadow value into structured shadow objects.
44
+ * Computed styles always use rgb()/rgba() format.
45
+ * Returns null if any shadow is unparseable.
46
+ */
47
+ export declare function parseTextShadow(textShadow: string): TextShadow[] | null;
48
+ /**
49
+ * Check if an element (or an ancestor up to the nearest opaque background)
50
+ * has a ::before or ::after pseudo-element that provides a visual background.
51
+ */
52
+ export declare function hasPseudoElementBackground(el: Element): boolean;
31
53
  //# sourceMappingURL=color.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/rules/utils/color.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,OAAO,GAAG,mBAAmB,CAMvE;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAMpE;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAI/D;AAWD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CA+BzE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWrD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC5B,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAC5B,KAAK,EAAE,MAAM,GACZ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAM1B;AAED,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAOxF;AAgED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,mBAAmB,GAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAmB,GAC9D,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CA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,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAmB,GAC9D,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAmC5B;AAID;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAMnD;AAmDD,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAOhD;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,EAAE,GAAG,IAAI,CAgBvE;AAMD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAiC/D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accesslint/core",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Pure accessibility rule engine — WCAG audit with zero browser dependencies",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",