@y14e/roving-tabindex 2.0.7 → 2.0.8

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/README.md CHANGED
@@ -10,14 +10,14 @@ npm i @y14e/roving-tabindex
10
10
 
11
11
  ```ts
12
12
  // npm
13
- import { createRovingTabIndex } from '@y14e/roving-tabindex@2.0.7';
13
+ import { createRovingTabIndex } from '@y14e/roving-tabindex@2.0.8';
14
14
 
15
15
  // CDNs
16
- import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@2.0.7';
16
+ import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@2.0.8';
17
17
  // or
18
- import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@2.0.7/+esm';
18
+ import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@2.0.8/+esm';
19
19
  // or
20
- import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@2.0.7';
20
+ import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@2.0.8';
21
21
  ```
22
22
 
23
23
  ## 📦 APIs
package/dist/index.cjs CHANGED
@@ -13,11 +13,10 @@ function addTokenToAttribute(element, attribute, token, options = {}) {
13
13
  const tokens = value ? parse(value).filter(Boolean) : [];
14
14
  if (caseInsensitive) {
15
15
  const lower = token.toLowerCase();
16
- if (tokens.some((token2) => token2.toLowerCase() === lower)) {
17
- return;
16
+ if (tokens.every((token2) => token2.toLowerCase() !== lower)) {
17
+ tokens.push(token);
18
+ element.setAttribute(attribute, serialize(tokens));
18
19
  }
19
- tokens.push(token);
20
- element.setAttribute(attribute, serialize(tokens));
21
20
  return;
22
21
  }
23
22
  const set = new Set(tokens);
@@ -527,7 +526,7 @@ function getActiveElement() {
527
526
  * Lightweight roving tabindex utility with fully focus management.
528
527
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
529
528
  *
530
- * @version 2.0.7
529
+ * @version 2.0.8
531
530
  * @author Yusuke Kamiyamane
532
531
  * @license MIT
533
532
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -539,7 +538,7 @@ function getActiveElement() {
539
538
  (**
540
539
  * Attributes Utils
541
540
  *
542
- * @version 1.1.0
541
+ * @version 1.1.1
543
542
  * @author Yusuke Kamiyamane
544
543
  * @license MIT
545
544
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -552,7 +551,7 @@ power-focusable/dist/index.js:
552
551
  * High-precision focus management utility with full composed tree support.
553
552
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
554
553
  *
555
- * @version 4.3.1
554
+ * @version 4.3.2
556
555
  * @author Yusuke Kamiyamane
557
556
  * @license MIT
558
557
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Lightweight roving tabindex utility with fully focus management.
4
4
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
5
5
  *
6
- * @version 2.0.7
6
+ * @version 2.0.8
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Lightweight roving tabindex utility with fully focus management.
4
4
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
5
5
  *
6
- * @version 2.0.7
6
+ * @version 2.0.8
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -11,11 +11,10 @@ function addTokenToAttribute(element, attribute, token, options = {}) {
11
11
  const tokens = value ? parse(value).filter(Boolean) : [];
12
12
  if (caseInsensitive) {
13
13
  const lower = token.toLowerCase();
14
- if (tokens.some((token2) => token2.toLowerCase() === lower)) {
15
- return;
14
+ if (tokens.every((token2) => token2.toLowerCase() !== lower)) {
15
+ tokens.push(token);
16
+ element.setAttribute(attribute, serialize(tokens));
16
17
  }
17
- tokens.push(token);
18
- element.setAttribute(attribute, serialize(tokens));
19
18
  return;
20
19
  }
21
20
  const set = new Set(tokens);
@@ -525,7 +524,7 @@ function getActiveElement() {
525
524
  * Lightweight roving tabindex utility with fully focus management.
526
525
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
527
526
  *
528
- * @version 2.0.7
527
+ * @version 2.0.8
529
528
  * @author Yusuke Kamiyamane
530
529
  * @license MIT
531
530
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -537,7 +536,7 @@ function getActiveElement() {
537
536
  (**
538
537
  * Attributes Utils
539
538
  *
540
- * @version 1.1.0
539
+ * @version 1.1.1
541
540
  * @author Yusuke Kamiyamane
542
541
  * @license MIT
543
542
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -550,7 +549,7 @@ power-focusable/dist/index.js:
550
549
  * High-precision focus management utility with full composed tree support.
551
550
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
552
551
  *
553
- * @version 4.3.1
552
+ * @version 4.3.2
554
553
  * @author Yusuke Kamiyamane
555
554
  * @license MIT
556
555
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/roving-tabindex",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "Lightweight roving tabindex utility with fully focus management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -48,9 +48,9 @@
48
48
  },
49
49
  "homepage": "https://github.com/y14e/roving-tabindex#readme",
50
50
  "devDependencies": {
51
- "@y14e/attributes-utils": "^1.1.0",
51
+ "@y14e/attributes-utils": "^1.1.1",
52
52
  "bun-types": "latest",
53
- "power-focusable": "^4.3.1",
53
+ "power-focusable": "^4.3.2",
54
54
  "tsup": "^8.0.0",
55
55
  "typescript": "^5.6.0"
56
56
  },