@y14e/accordion 2.0.5 → 2.0.6

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
@@ -13,11 +13,11 @@ npm i @y14e/accordion
13
13
  import Accordion from "@y14e/accordion";
14
14
 
15
15
  // CDNs
16
- import Accordion from "https://esm.sh/@y14e/accordion@2.0.5";
16
+ import Accordion from "https://esm.sh/@y14e/accordion@2.0.6";
17
17
  // or
18
- import Accordion from "https://cdn.jsdelivr.net/npm/@y14e/accordion@2.0.5/+esm";
18
+ import Accordion from "https://cdn.jsdelivr.net/npm/@y14e/accordion@2.0.6/+esm";
19
19
  // or
20
- import Accordion from "https://esm.unpkg.com/@y14e/accordion@2.0.5";
20
+ import Accordion from "https://esm.unpkg.com/@y14e/accordion@2.0.6";
21
21
  ```
22
22
 
23
23
  ## Usage
@@ -368,56 +368,6 @@ var Button = class {
368
368
  };
369
369
  };
370
370
 
371
- // node_modules/@y14e/attributes-utils/dist/index.js
372
- var DEFAULT_PARSER2 = (value) => value.split(/\s+/);
373
- var DEFAULT_SERIALIZER2 = (tokens) => tokens.join(" ");
374
- function addTokenToAttribute(element, name, token, options = {}) {
375
- const value = element.getAttribute(name)?.trim();
376
- const {
377
- caseInsensitive = false,
378
- parse = DEFAULT_PARSER2,
379
- serialize = DEFAULT_SERIALIZER2
380
- } = options;
381
- const tokens = value ? parse(value).filter(Boolean) : [];
382
- if (caseInsensitive) {
383
- const lower = token.toLowerCase();
384
- if (tokens.every((token2) => token2.toLowerCase() !== lower)) {
385
- tokens.push(token);
386
- element.setAttribute(name, serialize(tokens));
387
- }
388
- } else {
389
- const set = new Set(tokens);
390
- set.add(token);
391
- element.setAttribute(name, serialize([...set]));
392
- }
393
- }
394
- var snapshots2 = /* @__PURE__ */ new WeakMap();
395
- function restoreAttributes2(element_or_elements) {
396
- for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
397
- const snapshot = snapshots2.get(element);
398
- if (!snapshot) {
399
- continue;
400
- }
401
- for (const [name, value] of snapshot.entries()) {
402
- value === null ? element.removeAttribute(name) : element.setAttribute(name, value);
403
- }
404
- snapshots2.delete(element);
405
- }
406
- }
407
- function saveAttributes2(element_or_elements, name_or_names) {
408
- const names = Array.isArray(name_or_names) ? name_or_names : [name_or_names];
409
- (Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]).forEach((element) => {
410
- let snapshot = snapshots2.get(element);
411
- if (!snapshot) {
412
- snapshot = /* @__PURE__ */ new Map();
413
- snapshots2.set(element, snapshot);
414
- }
415
- names.forEach((name) => {
416
- snapshot.set(name, element.getAttribute(name));
417
- });
418
- });
419
- }
420
-
421
371
  // node_modules/@y14e/roving-tabindex/dist/index.js
422
372
  function createRovingTabIndex(container, options = {}) {
423
373
  if (!(container instanceof Element)) {
@@ -509,7 +459,7 @@ var RovingTabIndex = class _RovingTabIndex {
509
459
  this.#controller = null;
510
460
  this.#focusables.forEach((focusable) => {
511
461
  _RovingTabIndex.#initialized.delete(focusable);
512
- restoreAttributes2(focusable);
462
+ restoreAttributes(focusable);
513
463
  });
514
464
  this.#focusables.clear();
515
465
  this.#focusablesByFirstChar.clear();
@@ -614,7 +564,7 @@ var RovingTabIndex = class _RovingTabIndex {
614
564
  for (const focusable of this.#focusables) {
615
565
  if (!current.has(focusable)) {
616
566
  _RovingTabIndex.#initialized.delete(focusable);
617
- restoreAttributes2(focusable);
567
+ restoreAttributes(focusable);
618
568
  this.#focusables.delete(focusable);
619
569
  for (const [key, focusables] of this.#focusablesByFirstChar) {
620
570
  const index = focusables.indexOf(focusable);
@@ -636,7 +586,7 @@ var RovingTabIndex = class _RovingTabIndex {
636
586
  this.#focusables.add(focusable);
637
587
  _RovingTabIndex.#initialized.add(focusable);
638
588
  if (!navigationOnly) {
639
- saveAttributes2(focusable, "tabindex");
589
+ saveAttributes(focusable, "tabindex");
640
590
  focusable.setAttribute("tabindex", "-1");
641
591
  }
642
592
  if (!typeahead) {
@@ -649,8 +599,8 @@ var RovingTabIndex = class _RovingTabIndex {
649
599
  );
650
600
  if (char) {
651
601
  keys.add(char);
652
- saveAttributes2(focusable, "aria-keyshortcuts");
653
- addTokenToAttribute(focusable, "aria-keyshortcuts", char, {
602
+ saveAttributes(focusable, "aria-keyshortcuts");
603
+ addAttributeToken(focusable, "aria-keyshortcuts", char, {
654
604
  caseInsensitive: true
655
605
  });
656
606
  }
@@ -967,7 +917,7 @@ function waitAnimationFinish(animation) {
967
917
  * Accordion
968
918
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
969
919
  *
970
- * @version 2.0.5
920
+ * @version 2.0.6
971
921
  * @author Yusuke Kamiyamane
972
922
  * @license MIT
973
923
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -979,7 +929,7 @@ function waitAnimationFinish(animation) {
979
929
  (**
980
930
  * Attribute Util
981
931
  *
982
- * @version 2.0.0
932
+ * @version 2.0.1
983
933
  * @author Yusuke Kamiyamane
984
934
  * @license MIT
985
935
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -992,7 +942,7 @@ power-focusable/dist/index.js:
992
942
  * High-precision focus management utility with full composed tree support.
993
943
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
994
944
  *
995
- * @version 4.3.23
945
+ * @version 4.3.25
996
946
  * @author Yusuke Kamiyamane
997
947
  * @license MIT
998
948
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1003,31 +953,20 @@ power-focusable/dist/index.js:
1003
953
  (**
1004
954
  * Button
1005
955
  *
1006
- * @version 1.0.6
956
+ * @version 1.0.7
1007
957
  * @author Yusuke Kamiyamane
1008
958
  * @license MIT
1009
959
  * @copyright Copyright (c) Yusuke Kamiyamane
1010
960
  * @see {@link https://github.com/y14e/button}
1011
961
  *)
1012
962
 
1013
- @y14e/attributes-utils/dist/index.js:
1014
- (**
1015
- * Attributes Utils
1016
- *
1017
- * @version 1.1.7
1018
- * @author Yusuke Kamiyamane
1019
- * @license MIT
1020
- * @copyright Copyright (c) Yusuke Kamiyamane
1021
- * @see {@link https://github.com/y14e/attributes-utils}
1022
- *)
1023
-
1024
963
  @y14e/roving-tabindex/dist/index.js:
1025
964
  (**
1026
965
  * Roving Tabindex
1027
966
  * Lightweight roving tabindex utility with fully focus management.
1028
967
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
1029
968
  *
1030
- * @version 3.1.20
969
+ * @version 3.1.22
1031
970
  * @author Yusuke Kamiyamane
1032
971
  * @license MIT
1033
972
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -366,56 +366,6 @@ var Button = class {
366
366
  };
367
367
  };
368
368
 
369
- // node_modules/@y14e/attributes-utils/dist/index.js
370
- var DEFAULT_PARSER2 = (value) => value.split(/\s+/);
371
- var DEFAULT_SERIALIZER2 = (tokens) => tokens.join(" ");
372
- function addTokenToAttribute(element, name, token, options = {}) {
373
- const value = element.getAttribute(name)?.trim();
374
- const {
375
- caseInsensitive = false,
376
- parse = DEFAULT_PARSER2,
377
- serialize = DEFAULT_SERIALIZER2
378
- } = options;
379
- const tokens = value ? parse(value).filter(Boolean) : [];
380
- if (caseInsensitive) {
381
- const lower = token.toLowerCase();
382
- if (tokens.every((token2) => token2.toLowerCase() !== lower)) {
383
- tokens.push(token);
384
- element.setAttribute(name, serialize(tokens));
385
- }
386
- } else {
387
- const set = new Set(tokens);
388
- set.add(token);
389
- element.setAttribute(name, serialize([...set]));
390
- }
391
- }
392
- var snapshots2 = /* @__PURE__ */ new WeakMap();
393
- function restoreAttributes2(element_or_elements) {
394
- for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
395
- const snapshot = snapshots2.get(element);
396
- if (!snapshot) {
397
- continue;
398
- }
399
- for (const [name, value] of snapshot.entries()) {
400
- value === null ? element.removeAttribute(name) : element.setAttribute(name, value);
401
- }
402
- snapshots2.delete(element);
403
- }
404
- }
405
- function saveAttributes2(element_or_elements, name_or_names) {
406
- const names = Array.isArray(name_or_names) ? name_or_names : [name_or_names];
407
- (Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]).forEach((element) => {
408
- let snapshot = snapshots2.get(element);
409
- if (!snapshot) {
410
- snapshot = /* @__PURE__ */ new Map();
411
- snapshots2.set(element, snapshot);
412
- }
413
- names.forEach((name) => {
414
- snapshot.set(name, element.getAttribute(name));
415
- });
416
- });
417
- }
418
-
419
369
  // node_modules/@y14e/roving-tabindex/dist/index.js
420
370
  function createRovingTabIndex(container, options = {}) {
421
371
  if (!(container instanceof Element)) {
@@ -507,7 +457,7 @@ var RovingTabIndex = class _RovingTabIndex {
507
457
  this.#controller = null;
508
458
  this.#focusables.forEach((focusable) => {
509
459
  _RovingTabIndex.#initialized.delete(focusable);
510
- restoreAttributes2(focusable);
460
+ restoreAttributes(focusable);
511
461
  });
512
462
  this.#focusables.clear();
513
463
  this.#focusablesByFirstChar.clear();
@@ -612,7 +562,7 @@ var RovingTabIndex = class _RovingTabIndex {
612
562
  for (const focusable of this.#focusables) {
613
563
  if (!current.has(focusable)) {
614
564
  _RovingTabIndex.#initialized.delete(focusable);
615
- restoreAttributes2(focusable);
565
+ restoreAttributes(focusable);
616
566
  this.#focusables.delete(focusable);
617
567
  for (const [key, focusables] of this.#focusablesByFirstChar) {
618
568
  const index = focusables.indexOf(focusable);
@@ -634,7 +584,7 @@ var RovingTabIndex = class _RovingTabIndex {
634
584
  this.#focusables.add(focusable);
635
585
  _RovingTabIndex.#initialized.add(focusable);
636
586
  if (!navigationOnly) {
637
- saveAttributes2(focusable, "tabindex");
587
+ saveAttributes(focusable, "tabindex");
638
588
  focusable.setAttribute("tabindex", "-1");
639
589
  }
640
590
  if (!typeahead) {
@@ -647,8 +597,8 @@ var RovingTabIndex = class _RovingTabIndex {
647
597
  );
648
598
  if (char) {
649
599
  keys.add(char);
650
- saveAttributes2(focusable, "aria-keyshortcuts");
651
- addTokenToAttribute(focusable, "aria-keyshortcuts", char, {
600
+ saveAttributes(focusable, "aria-keyshortcuts");
601
+ addAttributeToken(focusable, "aria-keyshortcuts", char, {
652
602
  caseInsensitive: true
653
603
  });
654
604
  }
@@ -965,7 +915,7 @@ function waitAnimationFinish(animation) {
965
915
  * Accordion
966
916
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
967
917
  *
968
- * @version 2.0.5
918
+ * @version 2.0.6
969
919
  * @author Yusuke Kamiyamane
970
920
  * @license MIT
971
921
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -977,7 +927,7 @@ function waitAnimationFinish(animation) {
977
927
  (**
978
928
  * Attribute Util
979
929
  *
980
- * @version 2.0.0
930
+ * @version 2.0.1
981
931
  * @author Yusuke Kamiyamane
982
932
  * @license MIT
983
933
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -990,7 +940,7 @@ power-focusable/dist/index.js:
990
940
  * High-precision focus management utility with full composed tree support.
991
941
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
992
942
  *
993
- * @version 4.3.23
943
+ * @version 4.3.25
994
944
  * @author Yusuke Kamiyamane
995
945
  * @license MIT
996
946
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1001,31 +951,20 @@ power-focusable/dist/index.js:
1001
951
  (**
1002
952
  * Button
1003
953
  *
1004
- * @version 1.0.6
954
+ * @version 1.0.7
1005
955
  * @author Yusuke Kamiyamane
1006
956
  * @license MIT
1007
957
  * @copyright Copyright (c) Yusuke Kamiyamane
1008
958
  * @see {@link https://github.com/y14e/button}
1009
959
  *)
1010
960
 
1011
- @y14e/attributes-utils/dist/index.js:
1012
- (**
1013
- * Attributes Utils
1014
- *
1015
- * @version 1.1.7
1016
- * @author Yusuke Kamiyamane
1017
- * @license MIT
1018
- * @copyright Copyright (c) Yusuke Kamiyamane
1019
- * @see {@link https://github.com/y14e/attributes-utils}
1020
- *)
1021
-
1022
961
  @y14e/roving-tabindex/dist/index.js:
1023
962
  (**
1024
963
  * Roving Tabindex
1025
964
  * Lightweight roving tabindex utility with fully focus management.
1026
965
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
1027
966
  *
1028
- * @version 3.1.20
967
+ * @version 3.1.22
1029
968
  * @author Yusuke Kamiyamane
1030
969
  * @license MIT
1031
970
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.cjs CHANGED
@@ -308,7 +308,7 @@ function waitAnimationFinish(animation) {
308
308
  * Accordion
309
309
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
310
310
  *
311
- * @version 2.0.5
311
+ * @version 2.0.6
312
312
  * @author Yusuke Kamiyamane
313
313
  * @license MIT
314
314
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Accordion
3
3
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
4
4
  *
5
- * @version 2.0.5
5
+ * @version 2.0.6
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Accordion
3
3
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
4
4
  *
5
- * @version 2.0.5
5
+ * @version 2.0.6
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -283,7 +283,7 @@ function waitAnimationFinish(animation) {
283
283
  * Accordion
284
284
  * WAI-ARIA compliant accordion pattern implementation in TypeScript.
285
285
  *
286
- * @version 2.0.5
286
+ * @version 2.0.6
287
287
  * @author Yusuke Kamiyamane
288
288
  * @license MIT
289
289
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/accordion",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "WAI-ARIA compliant accordion pattern implementation in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -51,8 +51,8 @@
51
51
  "node": ">=18"
52
52
  },
53
53
  "dependencies": {
54
- "@y14e/attribute-util": "^2.0.0",
55
- "@y14e/button": "^1.0.6",
56
- "@y14e/roving-tabindex": "^3.1.20"
54
+ "@y14e/attribute-util": "^2.0.1",
55
+ "@y14e/button": "^1.0.7",
56
+ "@y14e/roving-tabindex": "^3.1.22"
57
57
  }
58
58
  }