html-validate 7.5.0 → 7.6.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.
@@ -1,5 +1,5 @@
1
- import { q as Report, c as ConfigLoader, H as HtmlValidate, a as ConfigData } from './core.js';
2
- export { A as AttributeData, a0 as AttributeEvent, f as CSSStyleDeclaration, ad as CompatibilityOptions, a2 as ConditionalEvent, C as Config, a as ConfigData, b as ConfigError, c as ConfigLoader, K as ConfigReadyEvent, a5 as DOMLoadEvent, a6 as DOMReadyEvent, u as DeferredMessage, a3 as DirectiveEvent, a4 as DoctypeEvent, D as DynamicValue, $ as ElementReadyEvent, J as Event, I as EventCallback, E as EventDump, G as EventHandler, a9 as FileSystemConfigLoader, aa as Formatter, e as HtmlElement, H as HtmlValidate, a8 as ListenEventMap, L as Location, s as Message, m as MetaCopyableProperty, M as MetaData, j as MetaDataTable, k as MetaElement, l as MetaTable, i as NestedError, N as NodeClosed, B as Parser, z as Plugin, P as ProcessElementContext, q as Report, r as Reporter, t as Result, R as Rule, n as RuleDocumentation, h as SchemaValidationError, S as Severity, o as Source, O as SourceReadyEvent, d as StaticConfigLoader, Z as TagCloseEvent, Y as TagEndEvent, X as TagOpenEvent, _ as TagReadyEvent, V as TagStartEvent, y as TemplateExtractor, T as TextNode, g as TokenDump, Q as TokenEvent, w as TransformContext, x as Transformer, a7 as TriggerEventMap, U as UserError, a1 as WhitespaceEvent, W as WrappedError, ac as compatibilityCheck, p as configPresets, ab as formatterFactory, F as ruleExists, v as version } from './core.js';
1
+ import { s as Report, c as ConfigLoader, H as HtmlValidate, a as ConfigData } from './core.js';
2
+ export { A as AttributeData, a2 as AttributeEvent, f as CSSStyleDeclaration, af as CompatibilityOptions, a4 as ConditionalEvent, C as Config, a as ConfigData, b as ConfigError, c as ConfigLoader, Q as ConfigReadyEvent, a7 as DOMLoadEvent, a8 as DOMReadyEvent, x as DeferredMessage, a5 as DirectiveEvent, a6 as DoctypeEvent, D as DynamicValue, a1 as ElementReadyEvent, O as Event, K as EventCallback, E as EventDump, J as EventHandler, ab as FileSystemConfigLoader, ac as Formatter, e as HtmlElement, H as HtmlValidate, aa as ListenEventMap, L as Location, u as Message, m as MetaCopyableProperty, M as MetaData, j as MetaDataTable, k as MetaElement, l as MetaTable, i as NestedError, N as NodeClosed, G as Parser, F as Plugin, P as ProcessElementContext, s as Report, t as Reporter, w as Result, R as Rule, n as RuleDocumentation, h as SchemaValidationError, S as Severity, r as Source, V as SourceReadyEvent, d as StaticConfigLoader, $ as TagCloseEvent, _ as TagEndEvent, Z as TagOpenEvent, a0 as TagReadyEvent, Y as TagStartEvent, B as TemplateExtractor, q as TextClassification, T as TextNode, g as TokenDump, X as TokenEvent, y as TransformContext, z as Transformer, a9 as TriggerEventMap, U as UserError, a3 as WhitespaceEvent, W as WrappedError, o as classifyNodeText, ae as compatibilityCheck, p as configPresets, ad as formatterFactory, I as ruleExists, v as version } from './core.js';
3
3
  import 'ajv';
4
4
 
5
5
  interface ExpandOptions {
package/dist/cjs/index.js CHANGED
@@ -46,9 +46,14 @@ Object.defineProperty(exports, 'Severity', {
46
46
  });
47
47
  exports.StaticConfigLoader = core.StaticConfigLoader;
48
48
  exports.TemplateExtractor = core.TemplateExtractor;
49
+ Object.defineProperty(exports, 'TextClassification', {
50
+ enumerable: true,
51
+ get: function () { return core.TextClassification; }
52
+ });
49
53
  exports.TextNode = core.TextNode;
50
54
  exports.UserError = core.UserError;
51
55
  exports.WrappedError = core.WrappedError;
56
+ exports.classifyNodeText = core.classifyNodeText;
52
57
  exports.compatibilityCheck = core.compatibilityCheck;
53
58
  exports.configPresets = core.presets;
54
59
  exports.formatterFactory = core.getFormatter;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { s as Message, a as ConfigData } from './core.js';
1
+ import { u as Message, a as ConfigData } from './core.js';
2
2
  import 'ajv';
3
3
 
4
4
  declare global {
@@ -1,4 +1,4 @@
1
- import { x as Transformer, o as Source } from './core.js';
1
+ import { z as Transformer, r as Source } from './core.js';
2
2
  import 'ajv';
3
3
 
4
4
  /**
@@ -1,2 +1,2 @@
1
- export { A as AttributeData, a0 as AttributeEvent, f as CSSStyleDeclaration, a2 as ConditionalEvent, C as Config, a as ConfigData, b as ConfigError, c as ConfigLoader, K as ConfigReadyEvent, a5 as DOMLoadEvent, a6 as DOMReadyEvent, u as DeferredMessage, a3 as DirectiveEvent, a4 as DoctypeEvent, D as DynamicValue, $ as ElementReadyEvent, J as Event, I as EventCallback, E as EventDump, G as EventHandler, e as HtmlElement, H as HtmlValidate, a8 as ListenEventMap, L as Location, s as Message, m as MetaCopyableProperty, M as MetaData, j as MetaDataTable, k as MetaElement, l as MetaTable, i as NestedError, N as NodeClosed, B as Parser, z as Plugin, P as ProcessElementContext, q as Report, r as Reporter, t as Result, R as Rule, n as RuleDocumentation, h as SchemaValidationError, S as Severity, o as Source, O as SourceReadyEvent, d as StaticConfigLoader, Z as TagCloseEvent, Y as TagEndEvent, X as TagOpenEvent, _ as TagReadyEvent, V as TagStartEvent, y as TemplateExtractor, T as TextNode, g as TokenDump, Q as TokenEvent, w as TransformContext, x as Transformer, a7 as TriggerEventMap, U as UserError, a1 as WhitespaceEvent, W as WrappedError, p as configPresets, F as ruleExists, v as version } from './core.js';
1
+ export { A as AttributeData, a2 as AttributeEvent, f as CSSStyleDeclaration, a4 as ConditionalEvent, C as Config, a as ConfigData, b as ConfigError, c as ConfigLoader, Q as ConfigReadyEvent, a7 as DOMLoadEvent, a8 as DOMReadyEvent, x as DeferredMessage, a5 as DirectiveEvent, a6 as DoctypeEvent, D as DynamicValue, a1 as ElementReadyEvent, O as Event, K as EventCallback, E as EventDump, J as EventHandler, e as HtmlElement, H as HtmlValidate, aa as ListenEventMap, L as Location, u as Message, m as MetaCopyableProperty, M as MetaData, j as MetaDataTable, k as MetaElement, l as MetaTable, i as NestedError, N as NodeClosed, G as Parser, F as Plugin, P as ProcessElementContext, s as Report, t as Reporter, w as Result, R as Rule, n as RuleDocumentation, h as SchemaValidationError, S as Severity, r as Source, V as SourceReadyEvent, d as StaticConfigLoader, $ as TagCloseEvent, _ as TagEndEvent, Z as TagOpenEvent, a0 as TagReadyEvent, Y as TagStartEvent, B as TemplateExtractor, q as TextClassification, T as TextNode, g as TokenDump, X as TokenEvent, y as TransformContext, z as Transformer, a9 as TriggerEventMap, U as UserError, a3 as WhitespaceEvent, W as WrappedError, o as classifyNodeText, p as configPresets, I as ruleExists, v as version } from './core.js';
2
2
  import 'ajv';
@@ -1,4 +1,4 @@
1
- export { C as Config, a as ConfigError, b as ConfigLoader, D as DynamicValue, E as EventHandler, d as HtmlElement, H as HtmlValidate, g as MetaCopyableProperty, M as MetaTable, f as NestedError, N as NodeClosed, P as Parser, h as Reporter, R as Rule, e as SchemaValidationError, S as Severity, c as StaticConfigLoader, i as TemplateExtractor, T as TextNode, U as UserError, W as WrappedError, p as configPresets, r as ruleExists, v as version } from './core.js';
1
+ export { C as Config, a as ConfigError, b as ConfigLoader, D as DynamicValue, E as EventHandler, d as HtmlElement, H as HtmlValidate, g as MetaCopyableProperty, M as MetaTable, f as NestedError, N as NodeClosed, P as Parser, j as Reporter, R as Rule, e as SchemaValidationError, S as Severity, c as StaticConfigLoader, k as TemplateExtractor, i as TextClassification, T as TextNode, U as UserError, W as WrappedError, h as classifyNodeText, p as configPresets, r as ruleExists, v as version } from './core.js';
2
2
  import 'fs';
3
3
  import 'semver';
4
4
  import 'kleur';
package/dist/es/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as getFormatter$1, l as legacyRequire, U as UserError, k as ensureError, F as FileSystemConfigLoader, H as HtmlValidate, m as configDataFromFile, h as Reporter } from './core.js';
1
+ import { l as getFormatter$1, m as legacyRequire, U as UserError, n as ensureError, F as FileSystemConfigLoader, H as HtmlValidate, o as configDataFromFile, j as Reporter } from './core.js';
2
2
  import fs from 'fs';
3
3
  import 'semver';
4
4
  import kleur from 'kleur';
package/dist/es/core.d.ts CHANGED
@@ -1262,6 +1262,15 @@ declare class HtmlElement extends DOMNode {
1262
1262
  * E.g. `my-annotation` or `<div>`.
1263
1263
  */
1264
1264
  get annotatedName(): string;
1265
+ /**
1266
+ * Get list of IDs referenced by `aria-labelledby`.
1267
+ *
1268
+ * If the attribute is unset or empty this getter returns null.
1269
+ * If the attribute is dynamic the original {@link DynamicValue} is returned.
1270
+ *
1271
+ * @public
1272
+ */
1273
+ get ariaLabelledby(): string[] | DynamicValue | null;
1265
1274
  /**
1266
1275
  * Similar to childNodes but only elements.
1267
1276
  */
@@ -2239,6 +2248,48 @@ declare class StaticConfigLoader extends ConfigLoader {
2239
2248
  /** @public */
2240
2249
  declare const version: string;
2241
2250
 
2251
+ declare const HTML_CACHE_KEY: unique symbol;
2252
+ declare const A11Y_CACHE_KEY: unique symbol;
2253
+ declare const IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY: unique symbol;
2254
+ declare const IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY: unique symbol;
2255
+ /**
2256
+ * @public
2257
+ */
2258
+ declare enum TextClassification {
2259
+ EMPTY_TEXT = 0,
2260
+ DYNAMIC_TEXT = 1,
2261
+ STATIC_TEXT = 2
2262
+ }
2263
+ /**
2264
+ * @public
2265
+ */
2266
+ interface TextClassificationOptions {
2267
+ /** If `true` only accessible text is considered (default false) */
2268
+ accessible?: boolean;
2269
+ /** If `true` the `hidden` and `aria-hidden` attribute is ignored on the root
2270
+ * (and parents) elements (default false) */
2271
+ ignoreHiddenRoot?: boolean;
2272
+ }
2273
+ declare module "../../dom/cache" {
2274
+ interface DOMNodeCache {
2275
+ [HTML_CACHE_KEY]: TextClassification;
2276
+ [A11Y_CACHE_KEY]: TextClassification;
2277
+ [IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY]: TextClassification;
2278
+ [IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY]: TextClassification;
2279
+ }
2280
+ }
2281
+ /**
2282
+ * Checks text content of an element.
2283
+ *
2284
+ * Any text is considered including text from descendant elements. Whitespace is
2285
+ * ignored.
2286
+ *
2287
+ * If any text is dynamic `TextClassification.DYNAMIC_TEXT` is returned.
2288
+ *
2289
+ * @public
2290
+ */
2291
+ declare function classifyNodeText(node: HtmlElement, options?: TextClassificationOptions): TextClassification;
2292
+
2242
2293
  /**
2243
2294
  * @public
2244
2295
  */
@@ -2345,4 +2396,4 @@ declare type Formatter = (results: Result[]) => string;
2345
2396
  */
2346
2397
  declare function getFormatter(name: string): Formatter | null;
2347
2398
 
2348
- export { ElementReadyEvent as $, AttributeData as A, Parser as B, Config as C, DynamicValue as D, EventDump as E, ruleExists as F, EventHandler as G, HtmlValidate as H, EventCallback as I, Event as J, ConfigReadyEvent as K, Location as L, MetaData as M, NodeClosed as N, SourceReadyEvent as O, ProcessElementContext as P, TokenEvent as Q, Rule as R, Severity as S, TextNode as T, UserError as U, TagStartEvent as V, WrappedError as W, TagOpenEvent as X, TagEndEvent as Y, TagCloseEvent as Z, TagReadyEvent as _, ConfigData as a, AttributeEvent as a0, WhitespaceEvent as a1, ConditionalEvent as a2, DirectiveEvent as a3, DoctypeEvent as a4, DOMLoadEvent as a5, DOMReadyEvent as a6, TriggerEventMap as a7, ListenEventMap as a8, FileSystemConfigLoader as a9, Formatter as aa, getFormatter as ab, compatibilityCheck as ac, CompatibilityOptions as ad, ConfigError as b, ConfigLoader as c, StaticConfigLoader as d, HtmlElement as e, CSSStyleDeclaration as f, TokenDump as g, SchemaValidationError as h, NestedError as i, MetaDataTable as j, MetaElement as k, MetaTable as l, MetaCopyableProperty as m, RuleDocumentation as n, Source as o, presets as p, Report as q, Reporter as r, Message as s, Result as t, DeferredMessage as u, version as v, TransformContext as w, Transformer as x, TemplateExtractor as y, Plugin as z };
2399
+ export { TagCloseEvent as $, AttributeData as A, TemplateExtractor as B, Config as C, DynamicValue as D, EventDump as E, Plugin as F, Parser as G, HtmlValidate as H, ruleExists as I, EventHandler as J, EventCallback as K, Location as L, MetaData as M, NodeClosed as N, Event as O, ProcessElementContext as P, ConfigReadyEvent as Q, Rule as R, Severity as S, TextNode as T, UserError as U, SourceReadyEvent as V, WrappedError as W, TokenEvent as X, TagStartEvent as Y, TagOpenEvent as Z, TagEndEvent as _, ConfigData as a, TagReadyEvent as a0, ElementReadyEvent as a1, AttributeEvent as a2, WhitespaceEvent as a3, ConditionalEvent as a4, DirectiveEvent as a5, DoctypeEvent as a6, DOMLoadEvent as a7, DOMReadyEvent as a8, TriggerEventMap as a9, ListenEventMap as aa, FileSystemConfigLoader as ab, Formatter as ac, getFormatter as ad, compatibilityCheck as ae, CompatibilityOptions as af, ConfigError as b, ConfigLoader as c, StaticConfigLoader as d, HtmlElement as e, CSSStyleDeclaration as f, TokenDump as g, SchemaValidationError as h, NestedError as i, MetaDataTable as j, MetaElement as k, MetaTable as l, MetaCopyableProperty as m, RuleDocumentation as n, classifyNodeText as o, presets as p, TextClassification as q, Source as r, Report as s, Reporter as t, Message as u, version as v, Result as w, DeferredMessage as x, TransformContext as y, Transformer as z };