accented 1.5.0 → 1.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,2 +1,8 @@
1
+ /**
2
+ * We have to do browser sniffing now and explicitly turn off anchor positioning in Safari 26
3
+ * since anchor positioning is enabled there but is buggy:
4
+ * https://bugs.webkit.org/show_bug.cgi?id=304551.
5
+ */
6
+ export declare function isSafari26(ua?: string): boolean;
1
7
  export declare function supportsAnchorPositioning(): boolean;
2
8
  //# sourceMappingURL=supports-anchor-positioning.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"supports-anchor-positioning.d.ts","sourceRoot":"","sources":["../../src/utils/supports-anchor-positioning.ts"],"names":[],"mappings":"AAYA,wBAAgB,yBAAyB,YAIxC"}
1
+ {"version":3,"file":"supports-anchor-positioning.d.ts","sourceRoot":"","sources":["../../src/utils/supports-anchor-positioning.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,SAAsB,WAMlD;AAED,wBAAgB,yBAAyB,YAIxC"}
@@ -1,15 +1,14 @@
1
1
  /**
2
- * We have to do browser sniffing now and explicitly turn off Anchor positioning in Safari
3
- * since anchor positioning is not working correctly in Safari 26 Technology Preview.
2
+ * We have to do browser sniffing now and explicitly turn off anchor positioning in Safari 26
3
+ * since anchor positioning is enabled there but is buggy:
4
+ * https://bugs.webkit.org/show_bug.cgi?id=304551.
4
5
  */
5
- function isWebKit() {
6
- const ua = navigator.userAgent;
7
- return (/AppleWebKit/.test(ua) && !/Chrome/.test(ua)) || /\b(iPad|iPhone|iPod)\b/.test(ua);
6
+ export function isSafari26(ua = navigator.userAgent) {
7
+ return ((/AppleWebKit/.test(ua) && !/Chrome/.test(ua) && /Version\/26\b/.test(ua)) ||
8
+ // Also covers non-Safari iOS browsers, since they're all WebKit under the hood.
9
+ (/\b(iPad|iPhone|iPod)\b/.test(ua) && /\bOS 26_\d/.test(ua)));
8
10
  }
9
- // ATTENTION: sync with the implementation in end-to-end tests.
10
- // I didn't find a way to sync this with automatically with the implementation of supportsAnchorPositioning
11
- // in end-to-end tests, so it has to be synced manually.
12
11
  export function supportsAnchorPositioning() {
13
- return (CSS.supports('anchor-name: --foo') && CSS.supports('position-anchor: --foo') && !isWebKit());
12
+ return (CSS.supports('anchor-name: --foo') && CSS.supports('position-anchor: --foo') && !isSafari26());
14
13
  }
15
14
  //# sourceMappingURL=supports-anchor-positioning.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"supports-anchor-positioning.js","sourceRoot":"","sources":["../../src/utils/supports-anchor-positioning.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,SAAS,QAAQ;IACf,MAAM,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC;IAC/B,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7F,CAAC;AAED,+DAA+D;AAC/D,2GAA2G;AAC3G,wDAAwD;AACxD,MAAM,UAAU,yBAAyB;IACvC,OAAO,CACL,GAAG,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAC5F,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"supports-anchor-positioning.js","sourceRoot":"","sources":["../../src/utils/supports-anchor-positioning.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,GAAG,SAAS,CAAC,SAAS;IACjD,OAAO,CACL,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1E,gFAAgF;QAChF,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAC7D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,OAAO,CACL,GAAG,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAC,UAAU,EAAE,CAC9F,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accented",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
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.14.4",
31
- "axe-core": "~4.13.0"
31
+ "axe-core": "~4.14.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/jsdom": "30.0.0",
35
- "jsdom": "30.1.1"
35
+ "jsdom": "30.1.2"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "pnpm copyCommon && tsc",
@@ -0,0 +1,50 @@
1
+ import assert from 'node:assert/strict';
2
+ import { suite, test } from 'node:test';
3
+ import { isSafari26 } from './supports-anchor-positioning';
4
+
5
+ suite('isSafari26', () => {
6
+ test('matches Safari 26 on iOS', () => {
7
+ assert.equal(
8
+ isSafari26(
9
+ 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.6.1 Mobile/15E148 Safari/604.1',
10
+ ),
11
+ true,
12
+ );
13
+ });
14
+
15
+ test('matches Chrome on iOS 26', () => {
16
+ assert.equal(
17
+ isSafari26(
18
+ 'Mozilla/5.0 (iPhone; CPU iPhone OS 26_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/155.0.8059.37 Mobile/15E148 Safari/604.1',
19
+ ),
20
+ true,
21
+ );
22
+ });
23
+
24
+ test('matches desktop Safari 26', () => {
25
+ assert.equal(
26
+ isSafari26(
27
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15',
28
+ ),
29
+ true,
30
+ );
31
+ });
32
+
33
+ test('does not match desktop Chrome', () => {
34
+ assert.equal(
35
+ isSafari26(
36
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36',
37
+ ),
38
+ false,
39
+ );
40
+ });
41
+
42
+ test('does not match desktop Safari 27', () => {
43
+ assert.equal(
44
+ isSafari26(
45
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/27.0.1 Safari/605.1.15',
46
+ ),
47
+ false,
48
+ );
49
+ });
50
+ });
@@ -1,17 +1,18 @@
1
1
  /**
2
- * We have to do browser sniffing now and explicitly turn off Anchor positioning in Safari
3
- * since anchor positioning is not working correctly in Safari 26 Technology Preview.
2
+ * We have to do browser sniffing now and explicitly turn off anchor positioning in Safari 26
3
+ * since anchor positioning is enabled there but is buggy:
4
+ * https://bugs.webkit.org/show_bug.cgi?id=304551.
4
5
  */
5
- function isWebKit() {
6
- const ua = navigator.userAgent;
7
- return (/AppleWebKit/.test(ua) && !/Chrome/.test(ua)) || /\b(iPad|iPhone|iPod)\b/.test(ua);
6
+ export function isSafari26(ua = navigator.userAgent) {
7
+ return (
8
+ (/AppleWebKit/.test(ua) && !/Chrome/.test(ua) && /Version\/26\b/.test(ua)) ||
9
+ // Also covers non-Safari iOS browsers, since they're all WebKit under the hood.
10
+ (/\b(iPad|iPhone|iPod)\b/.test(ua) && /\bOS 26_\d/.test(ua))
11
+ );
8
12
  }
9
13
 
10
- // ATTENTION: sync with the implementation in end-to-end tests.
11
- // I didn't find a way to sync this with automatically with the implementation of supportsAnchorPositioning
12
- // in end-to-end tests, so it has to be synced manually.
13
14
  export function supportsAnchorPositioning() {
14
15
  return (
15
- CSS.supports('anchor-name: --foo') && CSS.supports('position-anchor: --foo') && !isWebKit()
16
+ CSS.supports('anchor-name: --foo') && CSS.supports('position-anchor: --foo') && !isSafari26()
16
17
  );
17
18
  }