motion-dom 11.16.1 → 11.16.4

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/cjs/index.js CHANGED
@@ -32,7 +32,7 @@ class BaseGroupPlaybackControls {
32
32
  if (supportsScrollTimeline() && animation.attachTimeline) {
33
33
  return animation.attachTimeline(timeline);
34
34
  }
35
- else {
35
+ else if (typeof fallback === "function") {
36
36
  return fallback(animation);
37
37
  }
38
38
  });
@@ -363,7 +363,7 @@ function hover(elementOrSelector, onHoverStart, options = {}) {
363
363
  const onPointerEnter = filterEvents$1((enterEvent) => {
364
364
  const { target } = enterEvent;
365
365
  const onHoverEnd = onHoverStart(enterEvent);
366
- if (!onHoverEnd || !target)
366
+ if (typeof onHoverEnd !== "function" || !target)
367
367
  return;
368
368
  const onPointerLeave = filterEvents$1((leaveEvent) => {
369
369
  onHoverEnd(leaveEvent);
@@ -421,7 +421,8 @@ const focusableElements = new Set([
421
421
  "A",
422
422
  ]);
423
423
  function isElementKeyboardAccessible(element) {
424
- return focusableElements.has(element.tagName) || element.tabIndex !== -1;
424
+ return (focusableElements.has(element.tagName) ||
425
+ element.tabIndex !== -1);
425
426
  }
426
427
 
427
428
  const isPressing = new WeakSet();
@@ -502,7 +503,7 @@ function press(elementOrSelector, onPressStart, options = {}) {
502
503
  return;
503
504
  }
504
505
  isPressing.delete(element);
505
- if (onPressEnd) {
506
+ if (typeof onPressEnd === "function") {
506
507
  onPressEnd(endEvent, { success });
507
508
  }
508
509
  };
@@ -793,6 +794,7 @@ class ViewTransitionBuilder {
793
794
  constructor(update, options = {}) {
794
795
  this.currentTarget = "root";
795
796
  this.targets = new Map();
797
+ this.notifyReady = motionUtils.noop;
796
798
  this.readyPromise = new Promise((resolve) => {
797
799
  this.notifyReady = resolve;
798
800
  });
@@ -26,7 +26,7 @@ class BaseGroupPlaybackControls {
26
26
  if (supportsScrollTimeline() && animation.attachTimeline) {
27
27
  return animation.attachTimeline(timeline);
28
28
  }
29
- else {
29
+ else if (typeof fallback === "function") {
30
30
  return fallback(animation);
31
31
  }
32
32
  });
@@ -24,7 +24,7 @@ function hover(elementOrSelector, onHoverStart, options = {}) {
24
24
  const onPointerEnter = filterEvents((enterEvent) => {
25
25
  const { target } = enterEvent;
26
26
  const onHoverEnd = onHoverStart(enterEvent);
27
- if (!onHoverEnd || !target)
27
+ if (typeof onHoverEnd !== "function" || !target)
28
28
  return;
29
29
  const onPointerLeave = filterEvents((leaveEvent) => {
30
30
  onHoverEnd(leaveEvent);
@@ -47,7 +47,7 @@ function press(elementOrSelector, onPressStart, options = {}) {
47
47
  return;
48
48
  }
49
49
  isPressing.delete(element);
50
- if (onPressEnd) {
50
+ if (typeof onPressEnd === "function") {
51
51
  onPressEnd(endEvent, { success });
52
52
  }
53
53
  };
@@ -6,7 +6,8 @@ const focusableElements = new Set([
6
6
  "A",
7
7
  ]);
8
8
  function isElementKeyboardAccessible(element) {
9
- return focusableElements.has(element.tagName) || element.tabIndex !== -1;
9
+ return (focusableElements.has(element.tagName) ||
10
+ element.tabIndex !== -1);
10
11
  }
11
12
 
12
13
  export { isElementKeyboardAccessible };
@@ -1,3 +1,4 @@
1
+ import { noop } from 'motion-utils';
1
2
  import { startViewAnimation } from './start.mjs';
2
3
 
3
4
  /**
@@ -10,6 +11,7 @@ class ViewTransitionBuilder {
10
11
  constructor(update, options = {}) {
11
12
  this.currentTarget = "root";
12
13
  this.targets = new Map();
14
+ this.notifyReady = noop;
13
15
  this.readyPromise = new Promise((resolve) => {
14
16
  this.notifyReady = resolve;
15
17
  });
package/dist/index.d.ts CHANGED
@@ -303,7 +303,7 @@ interface AnimationPlaybackControls {
303
303
  *
304
304
  * This is currently for internal use only.
305
305
  */
306
- attachTimeline?: (timeline: ProgressTimeline, fallback?: (animation: AnimationPlaybackControls) => VoidFunction) => VoidFunction;
306
+ attachTimeline?: (timeline: ProgressTimeline, fallback?: (animation: AnimationPlaybackControls | AnimationPlaybackControlsWithFinished) => VoidFunction) => VoidFunction;
307
307
  /**
308
308
  * Flattens the animation's easing curve to linear.
309
309
  *
@@ -495,7 +495,7 @@ declare class BaseGroupPlaybackControls implements AnimationPlaybackControlsWith
495
495
  */
496
496
  private getAll;
497
497
  private setAll;
498
- attachTimeline(timeline: any, fallback: (animation: AnimationPlaybackControls | AnimationPlaybackControlsWithFinished) => VoidFunction): () => void;
498
+ attachTimeline(timeline: any, fallback?: (animation: AnimationPlaybackControls | AnimationPlaybackControlsWithFinished) => VoidFunction): () => void;
499
499
  get time(): number;
500
500
  set time(time: number);
501
501
  get speed(): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion-dom",
3
- "version": "11.16.1",
3
+ "version": "11.16.4",
4
4
  "author": "Matt Perry",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/motiondivision/motion",
@@ -23,5 +23,5 @@
23
23
  "build": "yarn clean && tsc -p . && rollup -c",
24
24
  "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\""
25
25
  },
26
- "gitHead": "d0d281ab97fe3ceef4d582d8da622faab907998d"
26
+ "gitHead": "6aaf1e2f245f9fd41295c7bb4caf545eefe1d24a"
27
27
  }