motion 11.12.0 → 11.13.0

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.
Files changed (55) hide show
  1. package/.turbo/turbo-build.log +14 -14
  2. package/dist/cjs/index.js +54 -48
  3. package/dist/cjs/mini.js +21 -25
  4. package/dist/cjs/react-client.js +142 -104
  5. package/dist/cjs/react-mini.js +21 -25
  6. package/dist/es/framer-motion/dist/es/animation/animate/resolve-subjects.mjs +1 -1
  7. package/dist/es/framer-motion/dist/es/animation/animate/subject.mjs +1 -1
  8. package/dist/es/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs +2 -1
  9. package/dist/es/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs +1 -1
  10. package/dist/es/framer-motion/dist/es/animation/animators/utils/can-animate.mjs +1 -1
  11. package/dist/es/framer-motion/dist/es/animation/animators/waapi/NativeAnimation.mjs +2 -2
  12. package/dist/es/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs +2 -2
  13. package/dist/es/framer-motion/dist/es/animation/generators/spring/find.mjs +1 -1
  14. package/dist/es/framer-motion/dist/es/animation/hooks/animation-controls.mjs +1 -1
  15. package/dist/es/framer-motion/dist/es/animation/optimized-appear/start.mjs +2 -1
  16. package/dist/es/framer-motion/dist/es/components/AnimatePresence/index.mjs +1 -1
  17. package/dist/es/framer-motion/dist/es/components/AnimateSharedLayout.mjs +1 -1
  18. package/dist/es/framer-motion/dist/es/components/Reorder/Group.mjs +1 -1
  19. package/dist/es/framer-motion/dist/es/components/Reorder/Item.mjs +1 -1
  20. package/dist/es/framer-motion/dist/es/easing/cubic-bezier.mjs +2 -1
  21. package/dist/es/framer-motion/dist/es/easing/utils/map.mjs +2 -2
  22. package/dist/es/framer-motion/dist/es/events/event-info.mjs +3 -3
  23. package/dist/es/framer-motion/dist/es/frameloop/frame.mjs +2 -1
  24. package/dist/es/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +12 -15
  25. package/dist/es/framer-motion/dist/es/gestures/drag/index.mjs +2 -1
  26. package/dist/es/framer-motion/dist/es/gestures/hover.mjs +18 -22
  27. package/dist/es/framer-motion/dist/es/gestures/pan/index.mjs +2 -1
  28. package/dist/es/framer-motion/dist/es/gestures/press.mjs +3 -2
  29. package/dist/es/framer-motion/dist/es/motion/index.mjs +1 -1
  30. package/dist/es/framer-motion/dist/es/projection/animation/mix-values.mjs +2 -1
  31. package/dist/es/framer-motion/dist/es/projection/node/create-projection-node.mjs +2 -1
  32. package/dist/es/framer-motion/dist/es/render/dom/resize/handle-element.mjs +1 -1
  33. package/dist/es/framer-motion/dist/es/render/dom/scroll/index.mjs +2 -1
  34. package/dist/es/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +1 -1
  35. package/dist/es/framer-motion/dist/es/render/dom/viewport/index.mjs +1 -1
  36. package/dist/es/framer-motion/dist/es/render/utils/motion-values.mjs +1 -1
  37. package/dist/es/framer-motion/dist/es/utils/interpolate.mjs +2 -2
  38. package/dist/es/framer-motion/dist/es/utils/mix/color.mjs +1 -1
  39. package/dist/es/framer-motion/dist/es/utils/mix/complex.mjs +1 -1
  40. package/dist/es/framer-motion/dist/es/value/index.mjs +1 -1
  41. package/dist/es/framer-motion/dist/es/value/use-inverted-scale.mjs +1 -1
  42. package/dist/es/framer-motion/dist/es/value/use-scroll.mjs +1 -1
  43. package/dist/es/motion/lib/index.mjs +3 -1
  44. package/dist/es/motion/lib/react.mjs +3 -2
  45. package/dist/es/motion-dom/dist/es/gestures/drag/state/is-active.mjs +9 -0
  46. package/dist/es/motion-dom/dist/es/gestures/drag/state/set-active.mjs +28 -0
  47. package/dist/es/motion-dom/dist/es/gestures/hover.mjs +46 -0
  48. package/dist/es/motion-dom/dist/es/utils/resolve-elements.mjs +22 -0
  49. package/dist/motion.dev.js +54 -48
  50. package/dist/motion.js +1 -1
  51. package/package.json +3 -3
  52. package/dist/es/framer-motion/dist/es/gestures/drag/utils/lock.mjs +0 -53
  53. package/dist/es/framer-motion/dist/es/render/dom/utils/resolve-element.mjs +0 -28
  54. /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/errors.mjs +0 -0
  55. /package/dist/es/{framer-motion/dist/es/utils → motion-utils/dist/es}/noop.mjs +0 -0
@@ -1,53 +0,0 @@
1
- function createLock(name) {
2
- let lock = null;
3
- return () => {
4
- const openLock = () => {
5
- lock = null;
6
- };
7
- if (lock === null) {
8
- lock = name;
9
- return openLock;
10
- }
11
- return false;
12
- };
13
- }
14
- const globalHorizontalLock = createLock("dragHorizontal");
15
- const globalVerticalLock = createLock("dragVertical");
16
- function getGlobalLock(drag) {
17
- let lock = false;
18
- if (drag === "y") {
19
- lock = globalVerticalLock();
20
- }
21
- else if (drag === "x") {
22
- lock = globalHorizontalLock();
23
- }
24
- else {
25
- const openHorizontal = globalHorizontalLock();
26
- const openVertical = globalVerticalLock();
27
- if (openHorizontal && openVertical) {
28
- lock = () => {
29
- openHorizontal();
30
- openVertical();
31
- };
32
- }
33
- else {
34
- // Release the locks because we don't use them
35
- if (openHorizontal)
36
- openHorizontal();
37
- if (openVertical)
38
- openVertical();
39
- }
40
- }
41
- return lock;
42
- }
43
- function isDragActive() {
44
- // Check the gesture lock - if we get it, it means no drag gesture is active
45
- // and we can safely fire the tap gesture.
46
- const openGestureLock = getGlobalLock(true);
47
- if (!openGestureLock)
48
- return true;
49
- openGestureLock();
50
- return false;
51
- }
52
-
53
- export { createLock, getGlobalLock, isDragActive };
@@ -1,28 +0,0 @@
1
- import { invariant } from '../../../utils/errors.mjs';
2
-
3
- function resolveElements(elements, scope, selectorCache) {
4
- var _a;
5
- if (typeof elements === "string") {
6
- let root = document;
7
- if (scope) {
8
- invariant(Boolean(scope.current), "Scope provided, but no element detected.");
9
- root = scope.current;
10
- }
11
- if (selectorCache) {
12
- (_a = selectorCache[elements]) !== null && _a !== void 0 ? _a : (selectorCache[elements] = root.querySelectorAll(elements));
13
- elements = selectorCache[elements];
14
- }
15
- else {
16
- elements = root.querySelectorAll(elements);
17
- }
18
- }
19
- else if (elements instanceof Element) {
20
- elements = [elements];
21
- }
22
- /**
23
- * Return an empty array
24
- */
25
- return Array.from(elements || []);
26
- }
27
-
28
- export { resolveElements };