@y14e/disclosure 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
13
13
  import Disclosure from "@y14e/disclosure";
14
14
 
15
15
  // CDNs
16
- import Disclosure from "https://esm.sh/@y14e/disclosure@2.0.4";
16
+ import Disclosure from "https://esm.sh/@y14e/disclosure@2.0.5";
17
17
  // or
18
- import Disclosure from "https://cdn.jsdelivr.net/npm/@y14e/disclosure@2.0.4/+esm";
18
+ import Disclosure from "https://cdn.jsdelivr.net/npm/@y14e/disclosure@2.0.5/+esm";
19
19
  // or
20
- import Disclosure from "https://esm.unpkg.com/@y14e/disclosure@2.0.4";
20
+ import Disclosure from "https://esm.unpkg.com/@y14e/disclosure@2.0.5";
21
21
  ```
22
22
 
23
23
  ## Usage
@@ -35,8 +35,8 @@ new Disclosure(root, options);
35
35
  ```ts
36
36
  interface DisclosureOptions {
37
37
  animation: {
38
- duration: number; // ms (default: 300)
39
- easing: string; // <easing-function> (default: 'ease')
38
+ duration: number; // ms (default: 300)
39
+ easing: string; // <easing-function> (default: 'ease')
40
40
  };
41
41
  collapsible: boolean; // default: true
42
42
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- // node_modules/@y14e/attributes-utils/dist/index.js
3
+ // node_modules/@y14e/attribute-util/dist/index.js
4
4
  var snapshots = /* @__PURE__ */ new WeakMap();
5
5
  function restoreAttributes(element_or_elements) {
6
6
  for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
@@ -895,7 +895,7 @@ function waitAnimationFinish(animation) {
895
895
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
896
896
  * Using the <details> and <summary> element.
897
897
  *
898
- * @version 2.0.4
898
+ * @version 2.0.5
899
899
  * @author Yusuke Kamiyamane
900
900
  * @license MIT
901
901
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -903,15 +903,15 @@ function waitAnimationFinish(animation) {
903
903
  */
904
904
  /*! Bundled license information:
905
905
 
906
- @y14e/attributes-utils/dist/index.js:
906
+ @y14e/attribute-util/dist/index.js:
907
907
  (**
908
- * Attributes Utils
908
+ * Attribute Util
909
909
  *
910
910
  * @version 2.0.0
911
911
  * @author Yusuke Kamiyamane
912
912
  * @license MIT
913
913
  * @copyright Copyright (c) Yusuke Kamiyamane
914
- * @see {@link https://github.com/y14e/attributes-utils}
914
+ * @see {@link https://github.com/y14e/attribute-util}
915
915
  *)
916
916
 
917
917
  @y14e/attributes-utils/dist/index.js:
@@ -1,4 +1,4 @@
1
- // node_modules/@y14e/attributes-utils/dist/index.js
1
+ // node_modules/@y14e/attribute-util/dist/index.js
2
2
  var snapshots = /* @__PURE__ */ new WeakMap();
3
3
  function restoreAttributes(element_or_elements) {
4
4
  for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
@@ -893,7 +893,7 @@ function waitAnimationFinish(animation) {
893
893
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
894
894
  * Using the <details> and <summary> element.
895
895
  *
896
- * @version 2.0.4
896
+ * @version 2.0.5
897
897
  * @author Yusuke Kamiyamane
898
898
  * @license MIT
899
899
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -901,15 +901,15 @@ function waitAnimationFinish(animation) {
901
901
  */
902
902
  /*! Bundled license information:
903
903
 
904
- @y14e/attributes-utils/dist/index.js:
904
+ @y14e/attribute-util/dist/index.js:
905
905
  (**
906
- * Attributes Utils
906
+ * Attribute Util
907
907
  *
908
908
  * @version 2.0.0
909
909
  * @author Yusuke Kamiyamane
910
910
  * @license MIT
911
911
  * @copyright Copyright (c) Yusuke Kamiyamane
912
- * @see {@link https://github.com/y14e/attributes-utils}
912
+ * @see {@link https://github.com/y14e/attribute-util}
913
913
  *)
914
914
 
915
915
  @y14e/attributes-utils/dist/index.js:
package/dist/index.cjs CHANGED
@@ -1,8 +1,28 @@
1
1
  'use strict';
2
2
 
3
- var attributesUtils = require('@y14e/attributes-utils');
3
+ var util = require('@y14e/attribute-util');
4
4
  var rovingTabindex = require('@y14e/roving-tabindex');
5
5
 
6
+ function _interopNamespace(e) {
7
+ if (e && e.__esModule) return e;
8
+ var n = Object.create(null);
9
+ if (e) {
10
+ Object.keys(e).forEach(function (k) {
11
+ if (k !== 'default') {
12
+ var d = Object.getOwnPropertyDescriptor(e, k);
13
+ Object.defineProperty(n, k, d.get ? d : {
14
+ enumerable: true,
15
+ get: function () { return e[k]; }
16
+ });
17
+ }
18
+ });
19
+ }
20
+ n.default = e;
21
+ return Object.freeze(n);
22
+ }
23
+
24
+ var util__namespace = /*#__PURE__*/_interopNamespace(util);
25
+
6
26
  // src/index.ts
7
27
  var Disclosure = class _Disclosure {
8
28
  static defaults = {};
@@ -113,7 +133,7 @@ var Disclosure = class _Disclosure {
113
133
  });
114
134
  });
115
135
  this.#detailsElements.length = 0;
116
- attributesUtils.restoreAttributes(this.#summaryElements);
136
+ util__namespace.restoreAttributes(this.#summaryElements);
117
137
  this.#summaryElements.length = 0;
118
138
  this.#contentElements.length = 0;
119
139
  this.#rootElement.removeAttribute("data-disclosure-initialized");
@@ -129,7 +149,7 @@ var Disclosure = class _Disclosure {
129
149
  this.#toggle(details, true);
130
150
  }
131
151
  #initialize() {
132
- attributesUtils.saveAttributes(this.#summaryElements, [
152
+ util__namespace.saveAttributes(this.#summaryElements, [
133
153
  "aria-disabled",
134
154
  "style",
135
155
  "tabindex"
@@ -283,7 +303,7 @@ function waitAnimationFinish(animation) {
283
303
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
284
304
  * Using the <details> and <summary> element.
285
305
  *
286
- * @version 2.0.4
306
+ * @version 2.0.5
287
307
  * @author Yusuke Kamiyamane
288
308
  * @license MIT
289
309
  * @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
@@ -1,4 +1,4 @@
1
- import { restoreAttributes, saveAttributes } from '@y14e/attributes-utils';
1
+ import * as util from '@y14e/attribute-util';
2
2
  import { createRovingTabIndex } from '@y14e/roving-tabindex';
3
3
 
4
4
  // src/index.ts
@@ -111,7 +111,7 @@ var Disclosure = class _Disclosure {
111
111
  });
112
112
  });
113
113
  this.#detailsElements.length = 0;
114
- restoreAttributes(this.#summaryElements);
114
+ util.restoreAttributes(this.#summaryElements);
115
115
  this.#summaryElements.length = 0;
116
116
  this.#contentElements.length = 0;
117
117
  this.#rootElement.removeAttribute("data-disclosure-initialized");
@@ -127,7 +127,7 @@ var Disclosure = class _Disclosure {
127
127
  this.#toggle(details, true);
128
128
  }
129
129
  #initialize() {
130
- saveAttributes(this.#summaryElements, [
130
+ util.saveAttributes(this.#summaryElements, [
131
131
  "aria-disabled",
132
132
  "style",
133
133
  "tabindex"
@@ -281,7 +281,7 @@ function waitAnimationFinish(animation) {
281
281
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
282
282
  * Using the <details> and <summary> element.
283
283
  *
284
- * @version 2.0.4
284
+ * @version 2.0.5
285
285
  * @author Yusuke Kamiyamane
286
286
  * @license MIT
287
287
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/disclosure",
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/attributes-utils": "^2.0.0",
54
+ "@y14e/attribute-util": "^2.0.0",
55
55
  "@y14e/roving-tabindex": "^3.1.20"
56
56
  }
57
57
  }