accented 1.2.2 → 1.2.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":"get-scan-context.d.ts","sourceRoot":"","sources":["../../src/utils/get-scan-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAcxD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CA6BhF"}
1
+ {"version":3,"file":"get-scan-context.d.ts","sourceRoot":"","sources":["../../src/utils/get-scan-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAMxD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CA6BhF"}
@@ -1,14 +1,7 @@
1
1
  import { contains } from './contains.js';
2
2
  import { deduplicateNodes } from './deduplicate-nodes.js';
3
- import { isDocumentFragment, isShadowRoot } from './dom-helpers.js';
4
3
  import { isNodeInScanContext } from './is-node-in-scan-context.js';
5
4
  import { normalizeContext } from './normalize-context.js';
6
- function replaceShadowRootsWithHosts(nodes) {
7
- // If an element is a shadow root, we can't use it in context directly,
8
- // we have to pass its host instead:
9
- // https://github.com/dequelabs/axe-core/issues/4941
10
- return nodes.map((node) => (isDocumentFragment(node) && isShadowRoot(node) ? node.host : node));
11
- }
12
5
  export function getScanContext(nodes, context) {
13
6
  const { include: contextInclude, exclude: contextExclude } = normalizeContext(context);
14
7
  // Filter only nodes that are included by context (see isNodeInContext above).
@@ -28,8 +21,8 @@ export function getScanContext(nodes, context) {
28
21
  exclude.push(...excludeDescendants);
29
22
  }
30
23
  return {
31
- include: replaceShadowRootsWithHosts(deduplicateNodes(include)),
32
- exclude: replaceShadowRootsWithHosts(deduplicateNodes(exclude)),
24
+ include: deduplicateNodes(include),
25
+ exclude: deduplicateNodes(exclude),
33
26
  };
34
27
  }
35
28
  //# sourceMappingURL=get-scan-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-scan-context.js","sourceRoot":"","sources":["../../src/utils/get-scan-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,SAAS,2BAA2B,CAAC,KAAkB;IACrD,uEAAuE;IACvE,oCAAoC;IACpC,oDAAoD;IACpD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAkB,EAAE,OAAgB;IACjE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEvF,8EAA8E;IAC9E,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAC3C,mBAAmB,CAAC,IAAI,EAAE;QACxB,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,cAAc;KACxB,CAAC,CACH,CAAC;IAEF,MAAM,OAAO,GAAgB,EAAE,CAAC;IAChC,MAAM,OAAO,GAAgB,EAAE,CAAC;IAEhC,gDAAgD;IA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;QACxB,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,cAAc;KACxB,CAAC,CACH,CAAC;IAEF,MAAM,OAAO,GAAgB,EAAE,CAAC;IAChC,MAAM,OAAO,GAAgB,EAAE,CAAC;IAEhC,gDAAgD;IAChD,OAAO,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;IAEhC,mGAAmG;IACnG,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,kBAAkB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACjF,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC;QACpC,MAAM,kBAAkB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACjF,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,OAAO;QACL,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC;QAClC,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC;KACnC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accented",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "A frontend library for continuous accessibility testing and issue highlighting",
5
5
  "type": "module",
6
6
  "main": "dist/accented.js",
@@ -28,11 +28,11 @@
28
28
  "homepage": "https://accented.dev",
29
29
  "dependencies": {
30
30
  "@preact/signals-core": "^1.12.1",
31
- "axe-core": "^4.11.0"
31
+ "axe-core": "^4.11.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/jsdom": "^27.0.0",
35
- "jsdom": "^27.1.0"
35
+ "jsdom": "^27.4.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "pnpm copyCommon && tsc",
@@ -1,17 +1,9 @@
1
1
  import type { Context, ScanContext } from '../types.ts';
2
2
  import { contains } from './contains.js';
3
3
  import { deduplicateNodes } from './deduplicate-nodes.js';
4
- import { isDocumentFragment, isShadowRoot } from './dom-helpers.js';
5
4
  import { isNodeInScanContext } from './is-node-in-scan-context.js';
6
5
  import { normalizeContext } from './normalize-context.js';
7
6
 
8
- function replaceShadowRootsWithHosts(nodes: Array<Node>) {
9
- // If an element is a shadow root, we can't use it in context directly,
10
- // we have to pass its host instead:
11
- // https://github.com/dequelabs/axe-core/issues/4941
12
- return nodes.map((node) => (isDocumentFragment(node) && isShadowRoot(node) ? node.host : node));
13
- }
14
-
15
7
  export function getScanContext(nodes: Array<Node>, context: Context): ScanContext {
16
8
  const { include: contextInclude, exclude: contextExclude } = normalizeContext(context);
17
9
 
@@ -38,7 +30,7 @@ export function getScanContext(nodes: Array<Node>, context: Context): ScanContex
38
30
  }
39
31
 
40
32
  return {
41
- include: replaceShadowRootsWithHosts(deduplicateNodes(include)),
42
- exclude: replaceShadowRootsWithHosts(deduplicateNodes(exclude)),
33
+ include: deduplicateNodes(include),
34
+ exclude: deduplicateNodes(exclude),
43
35
  };
44
36
  }