@y14e/roving-tabindex 3.0.9 → 3.0.10

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@3.0.9';
13
+ import { createRovingTabIndex } from '@y14e/roving-tabindex@3.0.10';
14
14
 
15
15
  // CDNs
16
- import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@3.0.9';
16
+ import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@3.0.10';
17
17
  // or
18
- import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@3.0.9/+esm';
18
+ import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@3.0.10/+esm';
19
19
  // or
20
- import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@3.0.9';
20
+ import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@3.0.10';
21
21
  ```
22
22
 
23
23
  ## 📦 APIs
package/dist/index.cjs CHANGED
@@ -297,8 +297,8 @@ function createRovingTabIndex(container, options = {}) {
297
297
  const roving = new RovingTabIndex(container, options);
298
298
  return () => roving.destroy();
299
299
  }
300
- var initialized = /* @__PURE__ */ new Set();
301
- var RovingTabIndex = class {
300
+ var RovingTabIndex = class _RovingTabIndex {
301
+ static #initialized = /* @__PURE__ */ new Set();
302
302
  #container;
303
303
  #settings;
304
304
  #focusables = /* @__PURE__ */ new Set();
@@ -369,7 +369,6 @@ var RovingTabIndex = class {
369
369
  restoreAttributes([...this.#focusables]);
370
370
  this.#focusables.clear();
371
371
  this.#focusablesByFirstChar.clear();
372
- this.#container.removeAttribute("data-roving-tabindex-initialized");
373
372
  }
374
373
  #initialize() {
375
374
  this.#update(document.activeElement);
@@ -386,7 +385,6 @@ var RovingTabIndex = class {
386
385
  capture: true,
387
386
  signal
388
387
  });
389
- this.#container.setAttribute("data-roving-tabindex-initialized", "");
390
388
  }
391
389
  #onFocusIn = (event) => {
392
390
  const { target } = event;
@@ -470,14 +468,14 @@ var RovingTabIndex = class {
470
468
  }
471
469
  const { navigationOnly, noStart, typeahead } = this.#settings;
472
470
  for (const focusable of current) {
473
- if (initialized.has(focusable)) {
474
- throw new TypeError("Already initialized");
475
- }
476
471
  if (this.#focusables.has(focusable)) {
477
472
  continue;
478
473
  }
474
+ if (_RovingTabIndex.#initialized.has(focusable)) {
475
+ throw new TypeError("Already initialized");
476
+ }
479
477
  this.#focusables.add(focusable);
480
- initialized.add(focusable);
478
+ _RovingTabIndex.#initialized.add(focusable);
481
479
  if (!navigationOnly) {
482
480
  saveAttributes([focusable], ["tabindex"]);
483
481
  focusable.setAttribute("tabindex", "-1");
@@ -533,7 +531,7 @@ var RovingTabIndex = class {
533
531
  * Lightweight roving tabindex utility with fully focus management.
534
532
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
535
533
  *
536
- * @version 3.0.9
534
+ * @version 3.0.10
537
535
  * @author Yusuke Kamiyamane
538
536
  * @license MIT
539
537
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -6,7 +6,7 @@ export { focusElement, getActiveElement, getFocusables } from 'power-focusable';
6
6
  * Lightweight roving tabindex utility with fully focus management.
7
7
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
8
8
  *
9
- * @version 3.0.9
9
+ * @version 3.0.10
10
10
  * @author Yusuke Kamiyamane
11
11
  * @license MIT
12
12
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { focusElement, getActiveElement, getFocusables } from 'power-focusable';
6
6
  * Lightweight roving tabindex utility with fully focus management.
7
7
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
8
8
  *
9
- * @version 3.0.9
9
+ * @version 3.0.10
10
10
  * @author Yusuke Kamiyamane
11
11
  * @license MIT
12
12
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -295,8 +295,8 @@ function createRovingTabIndex(container, options = {}) {
295
295
  const roving = new RovingTabIndex(container, options);
296
296
  return () => roving.destroy();
297
297
  }
298
- var initialized = /* @__PURE__ */ new Set();
299
- var RovingTabIndex = class {
298
+ var RovingTabIndex = class _RovingTabIndex {
299
+ static #initialized = /* @__PURE__ */ new Set();
300
300
  #container;
301
301
  #settings;
302
302
  #focusables = /* @__PURE__ */ new Set();
@@ -367,7 +367,6 @@ var RovingTabIndex = class {
367
367
  restoreAttributes([...this.#focusables]);
368
368
  this.#focusables.clear();
369
369
  this.#focusablesByFirstChar.clear();
370
- this.#container.removeAttribute("data-roving-tabindex-initialized");
371
370
  }
372
371
  #initialize() {
373
372
  this.#update(document.activeElement);
@@ -384,7 +383,6 @@ var RovingTabIndex = class {
384
383
  capture: true,
385
384
  signal
386
385
  });
387
- this.#container.setAttribute("data-roving-tabindex-initialized", "");
388
386
  }
389
387
  #onFocusIn = (event) => {
390
388
  const { target } = event;
@@ -468,14 +466,14 @@ var RovingTabIndex = class {
468
466
  }
469
467
  const { navigationOnly, noStart, typeahead } = this.#settings;
470
468
  for (const focusable of current) {
471
- if (initialized.has(focusable)) {
472
- throw new TypeError("Already initialized");
473
- }
474
469
  if (this.#focusables.has(focusable)) {
475
470
  continue;
476
471
  }
472
+ if (_RovingTabIndex.#initialized.has(focusable)) {
473
+ throw new TypeError("Already initialized");
474
+ }
477
475
  this.#focusables.add(focusable);
478
- initialized.add(focusable);
476
+ _RovingTabIndex.#initialized.add(focusable);
479
477
  if (!navigationOnly) {
480
478
  saveAttributes([focusable], ["tabindex"]);
481
479
  focusable.setAttribute("tabindex", "-1");
@@ -531,7 +529,7 @@ var RovingTabIndex = class {
531
529
  * Lightweight roving tabindex utility with fully focus management.
532
530
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
533
531
  *
534
- * @version 3.0.9
532
+ * @version 3.0.10
535
533
  * @author Yusuke Kamiyamane
536
534
  * @license MIT
537
535
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/roving-tabindex",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "description": "Lightweight roving tabindex utility with fully focus management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",