@y14e/disclosure 2.0.10 → 2.0.11

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.10";
16
+ import { Disclosure } from "https://esm.sh/@y14e/disclosure@2.0.11";
17
17
  // or
18
- import { Disclosure } from "https://cdn.jsdelivr.net/npm/@y14e/disclosure@2.0.10/+esm";
18
+ import { Disclosure } from "https://cdn.jsdelivr.net/npm/@y14e/disclosure@2.0.11/+esm";
19
19
  // or
20
- import { Disclosure } from "https://esm.unpkg.com/@y14e/disclosure@2.0.10";
20
+ import { Disclosure } from "https://esm.unpkg.com/@y14e/disclosure@2.0.11";
21
21
  ```
22
22
 
23
23
  ## Usage
@@ -839,21 +839,22 @@ var Disclosure = class _Disclosure {
839
839
  ...source,
840
840
  animation: { ...target.animation, ...source.animation ?? {} }
841
841
  };
842
- const animation = merged.animation;
843
- const duration = animation.duration;
842
+ const mergedAnimation = merged.animation;
843
+ const duration = mergedAnimation.duration;
844
+ const defaultAnimation = this.#defaults.animation;
844
845
  if (typeof duration !== "number" || Number.isNaN(duration)) {
845
- const duration2 = this.#defaults.animation.duration;
846
+ const duration2 = defaultAnimation.duration;
846
847
  console.warn(`Invalid animation duration. Fallback: ${duration2} (ms).`);
847
- animation.duration = duration2;
848
+ mergedAnimation.duration = duration2;
848
849
  }
849
850
  if (duration < 0) {
850
851
  console.warn("Invalid animation duration. Fallback: 0 (ms).");
851
- animation.duration = 0;
852
+ mergedAnimation.duration = 0;
852
853
  }
853
- if (!CSS.supports("animation-timing-function", animation.easing)) {
854
- const easing = this.#defaults.animation.easing;
854
+ if (!CSS.supports("animation-timing-function", mergedAnimation.easing)) {
855
+ const easing = defaultAnimation.easing;
855
856
  console.warn(`Invalid animation easing. Fallback: '${easing}'.`);
856
- animation.easing = easing;
857
+ mergedAnimation.easing = easing;
857
858
  }
858
859
  if (typeof merged.collapsible !== "boolean") {
859
860
  const collapsible = this.#defaults.collapsible;
@@ -881,7 +882,7 @@ function waitAnimationFinish(animation) {
881
882
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
882
883
  * Using the <details> and <summary> element.
883
884
  *
884
- * @version 2.0.10
885
+ * @version 2.0.11
885
886
  * @author Yusuke Kamiyamane
886
887
  * @license MIT
887
888
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -837,21 +837,22 @@ var Disclosure = class _Disclosure {
837
837
  ...source,
838
838
  animation: { ...target.animation, ...source.animation ?? {} }
839
839
  };
840
- const animation = merged.animation;
841
- const duration = animation.duration;
840
+ const mergedAnimation = merged.animation;
841
+ const duration = mergedAnimation.duration;
842
+ const defaultAnimation = this.#defaults.animation;
842
843
  if (typeof duration !== "number" || Number.isNaN(duration)) {
843
- const duration2 = this.#defaults.animation.duration;
844
+ const duration2 = defaultAnimation.duration;
844
845
  console.warn(`Invalid animation duration. Fallback: ${duration2} (ms).`);
845
- animation.duration = duration2;
846
+ mergedAnimation.duration = duration2;
846
847
  }
847
848
  if (duration < 0) {
848
849
  console.warn("Invalid animation duration. Fallback: 0 (ms).");
849
- animation.duration = 0;
850
+ mergedAnimation.duration = 0;
850
851
  }
851
- if (!CSS.supports("animation-timing-function", animation.easing)) {
852
- const easing = this.#defaults.animation.easing;
852
+ if (!CSS.supports("animation-timing-function", mergedAnimation.easing)) {
853
+ const easing = defaultAnimation.easing;
853
854
  console.warn(`Invalid animation easing. Fallback: '${easing}'.`);
854
- animation.easing = easing;
855
+ mergedAnimation.easing = easing;
855
856
  }
856
857
  if (typeof merged.collapsible !== "boolean") {
857
858
  const collapsible = this.#defaults.collapsible;
@@ -879,7 +880,7 @@ function waitAnimationFinish(animation) {
879
880
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
880
881
  * Using the <details> and <summary> element.
881
882
  *
882
- * @version 2.0.10
883
+ * @version 2.0.11
883
884
  * @author Yusuke Kamiyamane
884
885
  * @license MIT
885
886
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.cjs CHANGED
@@ -283,21 +283,22 @@ var Disclosure = class _Disclosure {
283
283
  ...source,
284
284
  animation: { ...target.animation, ...source.animation ?? {} }
285
285
  };
286
- const animation = merged.animation;
287
- const duration = animation.duration;
286
+ const mergedAnimation = merged.animation;
287
+ const duration = mergedAnimation.duration;
288
+ const defaultAnimation = this.#defaults.animation;
288
289
  if (typeof duration !== "number" || Number.isNaN(duration)) {
289
- const duration2 = this.#defaults.animation.duration;
290
+ const duration2 = defaultAnimation.duration;
290
291
  console.warn(`Invalid animation duration. Fallback: ${duration2} (ms).`);
291
- animation.duration = duration2;
292
+ mergedAnimation.duration = duration2;
292
293
  }
293
294
  if (duration < 0) {
294
295
  console.warn("Invalid animation duration. Fallback: 0 (ms).");
295
- animation.duration = 0;
296
+ mergedAnimation.duration = 0;
296
297
  }
297
- if (!CSS.supports("animation-timing-function", animation.easing)) {
298
- const easing = this.#defaults.animation.easing;
298
+ if (!CSS.supports("animation-timing-function", mergedAnimation.easing)) {
299
+ const easing = defaultAnimation.easing;
299
300
  console.warn(`Invalid animation easing. Fallback: '${easing}'.`);
300
- animation.easing = easing;
301
+ mergedAnimation.easing = easing;
301
302
  }
302
303
  if (typeof merged.collapsible !== "boolean") {
303
304
  const collapsible = this.#defaults.collapsible;
@@ -325,7 +326,7 @@ function waitAnimationFinish(animation) {
325
326
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
326
327
  * Using the <details> and <summary> element.
327
328
  *
328
- * @version 2.0.10
329
+ * @version 2.0.11
329
330
  * @author Yusuke Kamiyamane
330
331
  * @license MIT
331
332
  * @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.10
6
+ * @version 2.0.11
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.10
6
+ * @version 2.0.11
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -261,21 +261,22 @@ var Disclosure = class _Disclosure {
261
261
  ...source,
262
262
  animation: { ...target.animation, ...source.animation ?? {} }
263
263
  };
264
- const animation = merged.animation;
265
- const duration = animation.duration;
264
+ const mergedAnimation = merged.animation;
265
+ const duration = mergedAnimation.duration;
266
+ const defaultAnimation = this.#defaults.animation;
266
267
  if (typeof duration !== "number" || Number.isNaN(duration)) {
267
- const duration2 = this.#defaults.animation.duration;
268
+ const duration2 = defaultAnimation.duration;
268
269
  console.warn(`Invalid animation duration. Fallback: ${duration2} (ms).`);
269
- animation.duration = duration2;
270
+ mergedAnimation.duration = duration2;
270
271
  }
271
272
  if (duration < 0) {
272
273
  console.warn("Invalid animation duration. Fallback: 0 (ms).");
273
- animation.duration = 0;
274
+ mergedAnimation.duration = 0;
274
275
  }
275
- if (!CSS.supports("animation-timing-function", animation.easing)) {
276
- const easing = this.#defaults.animation.easing;
276
+ if (!CSS.supports("animation-timing-function", mergedAnimation.easing)) {
277
+ const easing = defaultAnimation.easing;
277
278
  console.warn(`Invalid animation easing. Fallback: '${easing}'.`);
278
- animation.easing = easing;
279
+ mergedAnimation.easing = easing;
279
280
  }
280
281
  if (typeof merged.collapsible !== "boolean") {
281
282
  const collapsible = this.#defaults.collapsible;
@@ -303,7 +304,7 @@ function waitAnimationFinish(animation) {
303
304
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
304
305
  * Using the <details> and <summary> element.
305
306
  *
306
- * @version 2.0.10
307
+ * @version 2.0.11
307
308
  * @author Yusuke Kamiyamane
308
309
  * @license MIT
309
310
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/disclosure",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "WAI-ARIA compliant disclosure pattern implementation in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",