@y14e/disclosure-css 2.0.4 → 2.0.5

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/disclosure-css
13
13
  import Disclosure from "@y14e/disclosure-css";
14
14
 
15
15
  // CDNs
16
- import Disclosure from "https://esm.sh/@y14e/disclosure-css@2.0.4";
16
+ import Disclosure from "https://esm.sh/@y14e/disclosure-css@2.0.5";
17
17
  // or
18
- import Disclosure from "https://cdn.jsdelivr.net/npm/@y14e/disclosure-css@2.0.4/+esm";
18
+ import Disclosure from "https://cdn.jsdelivr.net/npm/@y14e/disclosure-css@2.0.5/+esm";
19
19
  // or
20
- import Disclosure from "https://esm.unpkg.com/@y14e/disclosure-css@2.0.4";
20
+ import Disclosure from "https://esm.unpkg.com/@y14e/disclosure-css@2.0.5";
21
21
  ```
22
22
 
23
23
  ## Usage
@@ -1,37 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  // node_modules/@y14e/attribute-util/dist/index.js
4
- var snapshots = /* @__PURE__ */ new WeakMap();
5
- function restoreAttributes(element_or_elements) {
6
- for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
7
- const snapshot = snapshots.get(element);
8
- if (!snapshot) {
9
- continue;
10
- }
11
- for (const [name, value] of snapshot.entries()) {
12
- value === null ? element.removeAttribute(name) : element.setAttribute(name, value);
13
- }
14
- snapshots.delete(element);
15
- }
16
- }
17
- function saveAttributes(element_or_elements, name_or_names) {
18
- const names = Array.isArray(name_or_names) ? name_or_names : [name_or_names];
19
- (Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]).forEach((element) => {
20
- let snapshot = snapshots.get(element);
21
- if (!snapshot) {
22
- snapshot = /* @__PURE__ */ new Map();
23
- snapshots.set(element, snapshot);
24
- }
25
- names.forEach((name) => {
26
- snapshot.set(name, element.getAttribute(name));
27
- });
28
- });
29
- }
30
-
31
- // node_modules/@y14e/attributes-utils/dist/index.js
32
4
  var DEFAULT_PARSER = (value) => value.split(/\s+/);
33
5
  var DEFAULT_SERIALIZER = (tokens) => tokens.join(" ");
34
- function addTokenToAttribute(element, name, token, options = {}) {
6
+ function addAttributeToken(element, name, token, options = {}) {
35
7
  const value = element.getAttribute(name)?.trim();
36
8
  const {
37
9
  caseInsensitive = false,
@@ -51,26 +23,26 @@ function addTokenToAttribute(element, name, token, options = {}) {
51
23
  element.setAttribute(name, serialize([...set]));
52
24
  }
53
25
  }
54
- var snapshots2 = /* @__PURE__ */ new WeakMap();
55
- function restoreAttributes2(element_or_elements) {
26
+ var snapshots = /* @__PURE__ */ new WeakMap();
27
+ function restoreAttributes(element_or_elements) {
56
28
  for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
57
- const snapshot = snapshots2.get(element);
29
+ const snapshot = snapshots.get(element);
58
30
  if (!snapshot) {
59
31
  continue;
60
32
  }
61
33
  for (const [name, value] of snapshot.entries()) {
62
34
  value === null ? element.removeAttribute(name) : element.setAttribute(name, value);
63
35
  }
64
- snapshots2.delete(element);
36
+ snapshots.delete(element);
65
37
  }
66
38
  }
67
- function saveAttributes2(element_or_elements, name_or_names) {
39
+ function saveAttributes(element_or_elements, name_or_names) {
68
40
  const names = Array.isArray(name_or_names) ? name_or_names : [name_or_names];
69
41
  (Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]).forEach((element) => {
70
- let snapshot = snapshots2.get(element);
42
+ let snapshot = snapshots.get(element);
71
43
  if (!snapshot) {
72
44
  snapshot = /* @__PURE__ */ new Map();
73
- snapshots2.set(element, snapshot);
45
+ snapshots.set(element, snapshot);
74
46
  }
75
47
  names.forEach((name) => {
76
48
  snapshot.set(name, element.getAttribute(name));
@@ -438,7 +410,7 @@ var RovingTabIndex = class _RovingTabIndex {
438
410
  this.#controller = null;
439
411
  this.#focusables.forEach((focusable) => {
440
412
  _RovingTabIndex.#initialized.delete(focusable);
441
- restoreAttributes2(focusable);
413
+ restoreAttributes(focusable);
442
414
  });
443
415
  this.#focusables.clear();
444
416
  this.#focusablesByFirstChar.clear();
@@ -543,7 +515,7 @@ var RovingTabIndex = class _RovingTabIndex {
543
515
  for (const focusable of this.#focusables) {
544
516
  if (!current.has(focusable)) {
545
517
  _RovingTabIndex.#initialized.delete(focusable);
546
- restoreAttributes2(focusable);
518
+ restoreAttributes(focusable);
547
519
  this.#focusables.delete(focusable);
548
520
  for (const [key, focusables] of this.#focusablesByFirstChar) {
549
521
  const index = focusables.indexOf(focusable);
@@ -565,7 +537,7 @@ var RovingTabIndex = class _RovingTabIndex {
565
537
  this.#focusables.add(focusable);
566
538
  _RovingTabIndex.#initialized.add(focusable);
567
539
  if (!navigationOnly) {
568
- saveAttributes2(focusable, "tabindex");
540
+ saveAttributes(focusable, "tabindex");
569
541
  focusable.setAttribute("tabindex", "-1");
570
542
  }
571
543
  if (!typeahead) {
@@ -578,8 +550,8 @@ var RovingTabIndex = class _RovingTabIndex {
578
550
  );
579
551
  if (char) {
580
552
  keys.add(char);
581
- saveAttributes2(focusable, "aria-keyshortcuts");
582
- addTokenToAttribute(focusable, "aria-keyshortcuts", char, {
553
+ saveAttributes(focusable, "aria-keyshortcuts");
554
+ addAttributeToken(focusable, "aria-keyshortcuts", char, {
583
555
  caseInsensitive: true
584
556
  });
585
557
  }
@@ -776,7 +748,7 @@ var Disclosure = class _Disclosure {
776
748
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
777
749
  * Using the <details> and <summary> element.
778
750
  *
779
- * @version 2.0.4
751
+ * @version 2.0.5
780
752
  * @author Yusuke Kamiyamane
781
753
  * @license MIT
782
754
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -788,31 +760,20 @@ var Disclosure = class _Disclosure {
788
760
  (**
789
761
  * Attribute Util
790
762
  *
791
- * @version 2.0.0
763
+ * @version 2.0.1
792
764
  * @author Yusuke Kamiyamane
793
765
  * @license MIT
794
766
  * @copyright Copyright (c) Yusuke Kamiyamane
795
767
  * @see {@link https://github.com/y14e/attribute-util}
796
768
  *)
797
769
 
798
- @y14e/attributes-utils/dist/index.js:
799
- (**
800
- * Attributes Utils
801
- *
802
- * @version 1.1.7
803
- * @author Yusuke Kamiyamane
804
- * @license MIT
805
- * @copyright Copyright (c) Yusuke Kamiyamane
806
- * @see {@link https://github.com/y14e/attributes-utils}
807
- *)
808
-
809
770
  power-focusable/dist/index.js:
810
771
  (**
811
772
  * Power Focusable
812
773
  * High-precision focus management utility with full composed tree support.
813
774
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
814
775
  *
815
- * @version 4.3.23
776
+ * @version 4.3.25
816
777
  * @author Yusuke Kamiyamane
817
778
  * @license MIT
818
779
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -825,7 +786,7 @@ power-focusable/dist/index.js:
825
786
  * Lightweight roving tabindex utility with fully focus management.
826
787
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
827
788
  *
828
- * @version 3.1.20
789
+ * @version 3.1.22
829
790
  * @author Yusuke Kamiyamane
830
791
  * @license MIT
831
792
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1,35 +1,7 @@
1
1
  // node_modules/@y14e/attribute-util/dist/index.js
2
- var snapshots = /* @__PURE__ */ new WeakMap();
3
- function restoreAttributes(element_or_elements) {
4
- for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
5
- const snapshot = snapshots.get(element);
6
- if (!snapshot) {
7
- continue;
8
- }
9
- for (const [name, value] of snapshot.entries()) {
10
- value === null ? element.removeAttribute(name) : element.setAttribute(name, value);
11
- }
12
- snapshots.delete(element);
13
- }
14
- }
15
- function saveAttributes(element_or_elements, name_or_names) {
16
- const names = Array.isArray(name_or_names) ? name_or_names : [name_or_names];
17
- (Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]).forEach((element) => {
18
- let snapshot = snapshots.get(element);
19
- if (!snapshot) {
20
- snapshot = /* @__PURE__ */ new Map();
21
- snapshots.set(element, snapshot);
22
- }
23
- names.forEach((name) => {
24
- snapshot.set(name, element.getAttribute(name));
25
- });
26
- });
27
- }
28
-
29
- // node_modules/@y14e/attributes-utils/dist/index.js
30
2
  var DEFAULT_PARSER = (value) => value.split(/\s+/);
31
3
  var DEFAULT_SERIALIZER = (tokens) => tokens.join(" ");
32
- function addTokenToAttribute(element, name, token, options = {}) {
4
+ function addAttributeToken(element, name, token, options = {}) {
33
5
  const value = element.getAttribute(name)?.trim();
34
6
  const {
35
7
  caseInsensitive = false,
@@ -49,26 +21,26 @@ function addTokenToAttribute(element, name, token, options = {}) {
49
21
  element.setAttribute(name, serialize([...set]));
50
22
  }
51
23
  }
52
- var snapshots2 = /* @__PURE__ */ new WeakMap();
53
- function restoreAttributes2(element_or_elements) {
24
+ var snapshots = /* @__PURE__ */ new WeakMap();
25
+ function restoreAttributes(element_or_elements) {
54
26
  for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
55
- const snapshot = snapshots2.get(element);
27
+ const snapshot = snapshots.get(element);
56
28
  if (!snapshot) {
57
29
  continue;
58
30
  }
59
31
  for (const [name, value] of snapshot.entries()) {
60
32
  value === null ? element.removeAttribute(name) : element.setAttribute(name, value);
61
33
  }
62
- snapshots2.delete(element);
34
+ snapshots.delete(element);
63
35
  }
64
36
  }
65
- function saveAttributes2(element_or_elements, name_or_names) {
37
+ function saveAttributes(element_or_elements, name_or_names) {
66
38
  const names = Array.isArray(name_or_names) ? name_or_names : [name_or_names];
67
39
  (Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]).forEach((element) => {
68
- let snapshot = snapshots2.get(element);
40
+ let snapshot = snapshots.get(element);
69
41
  if (!snapshot) {
70
42
  snapshot = /* @__PURE__ */ new Map();
71
- snapshots2.set(element, snapshot);
43
+ snapshots.set(element, snapshot);
72
44
  }
73
45
  names.forEach((name) => {
74
46
  snapshot.set(name, element.getAttribute(name));
@@ -436,7 +408,7 @@ var RovingTabIndex = class _RovingTabIndex {
436
408
  this.#controller = null;
437
409
  this.#focusables.forEach((focusable) => {
438
410
  _RovingTabIndex.#initialized.delete(focusable);
439
- restoreAttributes2(focusable);
411
+ restoreAttributes(focusable);
440
412
  });
441
413
  this.#focusables.clear();
442
414
  this.#focusablesByFirstChar.clear();
@@ -541,7 +513,7 @@ var RovingTabIndex = class _RovingTabIndex {
541
513
  for (const focusable of this.#focusables) {
542
514
  if (!current.has(focusable)) {
543
515
  _RovingTabIndex.#initialized.delete(focusable);
544
- restoreAttributes2(focusable);
516
+ restoreAttributes(focusable);
545
517
  this.#focusables.delete(focusable);
546
518
  for (const [key, focusables] of this.#focusablesByFirstChar) {
547
519
  const index = focusables.indexOf(focusable);
@@ -563,7 +535,7 @@ var RovingTabIndex = class _RovingTabIndex {
563
535
  this.#focusables.add(focusable);
564
536
  _RovingTabIndex.#initialized.add(focusable);
565
537
  if (!navigationOnly) {
566
- saveAttributes2(focusable, "tabindex");
538
+ saveAttributes(focusable, "tabindex");
567
539
  focusable.setAttribute("tabindex", "-1");
568
540
  }
569
541
  if (!typeahead) {
@@ -576,8 +548,8 @@ var RovingTabIndex = class _RovingTabIndex {
576
548
  );
577
549
  if (char) {
578
550
  keys.add(char);
579
- saveAttributes2(focusable, "aria-keyshortcuts");
580
- addTokenToAttribute(focusable, "aria-keyshortcuts", char, {
551
+ saveAttributes(focusable, "aria-keyshortcuts");
552
+ addAttributeToken(focusable, "aria-keyshortcuts", char, {
581
553
  caseInsensitive: true
582
554
  });
583
555
  }
@@ -774,7 +746,7 @@ var Disclosure = class _Disclosure {
774
746
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
775
747
  * Using the <details> and <summary> element.
776
748
  *
777
- * @version 2.0.4
749
+ * @version 2.0.5
778
750
  * @author Yusuke Kamiyamane
779
751
  * @license MIT
780
752
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -786,31 +758,20 @@ var Disclosure = class _Disclosure {
786
758
  (**
787
759
  * Attribute Util
788
760
  *
789
- * @version 2.0.0
761
+ * @version 2.0.1
790
762
  * @author Yusuke Kamiyamane
791
763
  * @license MIT
792
764
  * @copyright Copyright (c) Yusuke Kamiyamane
793
765
  * @see {@link https://github.com/y14e/attribute-util}
794
766
  *)
795
767
 
796
- @y14e/attributes-utils/dist/index.js:
797
- (**
798
- * Attributes Utils
799
- *
800
- * @version 1.1.7
801
- * @author Yusuke Kamiyamane
802
- * @license MIT
803
- * @copyright Copyright (c) Yusuke Kamiyamane
804
- * @see {@link https://github.com/y14e/attributes-utils}
805
- *)
806
-
807
768
  power-focusable/dist/index.js:
808
769
  (**
809
770
  * Power Focusable
810
771
  * High-precision focus management utility with full composed tree support.
811
772
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
812
773
  *
813
- * @version 4.3.23
774
+ * @version 4.3.25
814
775
  * @author Yusuke Kamiyamane
815
776
  * @license MIT
816
777
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -823,7 +784,7 @@ power-focusable/dist/index.js:
823
784
  * Lightweight roving tabindex utility with fully focus management.
824
785
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
825
786
  *
826
- * @version 3.1.20
787
+ * @version 3.1.22
827
788
  * @author Yusuke Kamiyamane
828
789
  * @license MIT
829
790
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.cjs CHANGED
@@ -184,7 +184,7 @@ var Disclosure = class _Disclosure {
184
184
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
185
185
  * Using the <details> and <summary> element.
186
186
  *
187
- * @version 2.0.4
187
+ * @version 2.0.5
188
188
  * @author Yusuke Kamiyamane
189
189
  * @license MIT
190
190
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@
3
3
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
4
4
  * Using the <details> and <summary> element.
5
5
  *
6
- * @version 2.0.4
6
+ * @version 2.0.5
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
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
4
4
  * Using the <details> and <summary> element.
5
5
  *
6
- * @version 2.0.4
6
+ * @version 2.0.5
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -162,7 +162,7 @@ var Disclosure = class _Disclosure {
162
162
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
163
163
  * Using the <details> and <summary> element.
164
164
  *
165
- * @version 2.0.4
165
+ * @version 2.0.5
166
166
  * @author Yusuke Kamiyamane
167
167
  * @license MIT
168
168
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/disclosure-css",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "WAI-ARIA compliant disclosure pattern implementation in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -51,7 +51,7 @@
51
51
  "node": ">=18"
52
52
  },
53
53
  "dependencies": {
54
- "@y14e/attribute-util": "^2.0.0",
55
- "@y14e/roving-tabindex": "^3.1.20"
54
+ "@y14e/attribute-util": "^2.0.1",
55
+ "@y14e/roving-tabindex": "^3.1.22"
56
56
  }
57
57
  }