@y14e/disclosure 1.3.1 → 1.3.2

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/dist/index.cjs CHANGED
@@ -586,12 +586,6 @@ var Disclosure = class _Disclosure {
586
586
  this.#bindings.set(summary, binding);
587
587
  this.#bindings.set(content, binding);
588
588
  });
589
- this.#cleanupRovingTabIndex = createRovingTabIndex(this.#rootElement, {
590
- direction: "vertical",
591
- navigationOnly: true,
592
- selector: `summary${NOT_NESTED}`,
593
- wrap: true
594
- });
595
589
  this.#initialize();
596
590
  }
597
591
  open(details) {
@@ -619,14 +613,14 @@ var Disclosure = class _Disclosure {
619
613
  return;
620
614
  }
621
615
  this.#isDestroyed = true;
622
- this.#cleanupRovingTabIndex?.();
623
- this.#cleanupRovingTabIndex = null;
624
616
  this.#eventController?.abort();
625
617
  this.#eventController = null;
626
618
  this.#observers.forEach((observer) => {
627
619
  observer.disconnect();
628
620
  });
629
621
  this.#observers.length = 0;
622
+ this.#cleanupRovingTabIndex?.();
623
+ this.#cleanupRovingTabIndex = null;
630
624
  !force && await this.#waitAnimationsFinish();
631
625
  this.#contentElements.forEach((content) => {
632
626
  force && this.#bindings.get(content)?.animation?.finish();
@@ -668,6 +662,12 @@ var Disclosure = class _Disclosure {
668
662
  }
669
663
  summary.addEventListener("click", this.#onSummaryClick, { signal });
670
664
  });
665
+ this.#cleanupRovingTabIndex = createRovingTabIndex(this.#rootElement, {
666
+ direction: "vertical",
667
+ navigationOnly: true,
668
+ selector: `summary:not(:scope summary + * *)`,
669
+ wrap: true
670
+ });
671
671
  this.#rootElement.setAttribute("data-disclosure-initialized", "");
672
672
  }
673
673
  #onSummaryClick = (event) => {
@@ -788,7 +788,7 @@ function waitAnimationFinish(animation) {
788
788
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
789
789
  * Using the <details> and <summary> element.
790
790
  *
791
- * @version 1.3.1
791
+ * @version 1.3.2
792
792
  * @author Yusuke Kamiyamane
793
793
  * @license MIT
794
794
  * @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 1.3.1
6
+ * @version 1.3.2
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 1.3.1
6
+ * @version 1.3.2
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -584,12 +584,6 @@ var Disclosure = class _Disclosure {
584
584
  this.#bindings.set(summary, binding);
585
585
  this.#bindings.set(content, binding);
586
586
  });
587
- this.#cleanupRovingTabIndex = createRovingTabIndex(this.#rootElement, {
588
- direction: "vertical",
589
- navigationOnly: true,
590
- selector: `summary${NOT_NESTED}`,
591
- wrap: true
592
- });
593
587
  this.#initialize();
594
588
  }
595
589
  open(details) {
@@ -617,14 +611,14 @@ var Disclosure = class _Disclosure {
617
611
  return;
618
612
  }
619
613
  this.#isDestroyed = true;
620
- this.#cleanupRovingTabIndex?.();
621
- this.#cleanupRovingTabIndex = null;
622
614
  this.#eventController?.abort();
623
615
  this.#eventController = null;
624
616
  this.#observers.forEach((observer) => {
625
617
  observer.disconnect();
626
618
  });
627
619
  this.#observers.length = 0;
620
+ this.#cleanupRovingTabIndex?.();
621
+ this.#cleanupRovingTabIndex = null;
628
622
  !force && await this.#waitAnimationsFinish();
629
623
  this.#contentElements.forEach((content) => {
630
624
  force && this.#bindings.get(content)?.animation?.finish();
@@ -666,6 +660,12 @@ var Disclosure = class _Disclosure {
666
660
  }
667
661
  summary.addEventListener("click", this.#onSummaryClick, { signal });
668
662
  });
663
+ this.#cleanupRovingTabIndex = createRovingTabIndex(this.#rootElement, {
664
+ direction: "vertical",
665
+ navigationOnly: true,
666
+ selector: `summary:not(:scope summary + * *)`,
667
+ wrap: true
668
+ });
669
669
  this.#rootElement.setAttribute("data-disclosure-initialized", "");
670
670
  }
671
671
  #onSummaryClick = (event) => {
@@ -786,7 +786,7 @@ function waitAnimationFinish(animation) {
786
786
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
787
787
  * Using the <details> and <summary> element.
788
788
  *
789
- * @version 1.3.1
789
+ * @version 1.3.2
790
790
  * @author Yusuke Kamiyamane
791
791
  * @license MIT
792
792
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/disclosure",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "WAI-ARIA compliant disclosure pattern implementation in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",