framer-motion 5.4.5 → 5.5.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.
Files changed (28) hide show
  1. package/dist/cjs/index.js +2 -1
  2. package/dist/cjs/three-entry.js +157 -24
  3. package/dist/cjs/{use-motion-value-73ed7c77.js → use-motion-value-28b1fded.js} +3 -1
  4. package/dist/es/components/three/LayoutCamera.mjs +21 -0
  5. package/dist/es/components/three/LayoutOrthographicCamera.mjs +21 -0
  6. package/dist/es/components/{MotionCanvas/index.mjs → three/MotionCanvas.mjs} +42 -18
  7. package/dist/es/components/three/MotionCanvasContext.mjs +5 -0
  8. package/dist/es/components/three/use-layout-camera.mjs +86 -0
  9. package/dist/es/context/MotionContext/index.mjs +1 -1
  10. package/dist/es/index.mjs +1 -0
  11. package/dist/es/projection/node/create-projection-node.mjs +3 -1
  12. package/dist/es/render/three/create-visual-element.mjs +3 -1
  13. package/dist/es/render/three/utils/read-value.mjs +3 -2
  14. package/dist/es/three-entry.mjs +3 -1
  15. package/dist/framer-motion.dev.js +4 -1
  16. package/dist/framer-motion.js +1 -1
  17. package/dist/projection.dev.js +3 -1
  18. package/dist/size-rollup-dom-max.js +1 -1
  19. package/package.json +6 -5
  20. package/types/components/three/LayoutCamera.d.ts +26 -0
  21. package/types/components/three/LayoutOrthographicCamera.d.ts +23 -0
  22. package/types/components/{MotionCanvas/index.d.ts → three/MotionCanvas.d.ts} +1 -1
  23. package/types/components/three/MotionCanvasContext.d.ts +13 -0
  24. package/types/components/three/types.d.ts +6 -0
  25. package/types/components/three/use-layout-camera.d.ts +10 -0
  26. package/types/index.d.ts +1 -0
  27. package/types/projection/node/types.d.ts +2 -2
  28. package/types/three-entry.d.ts +3 -1
@@ -0,0 +1,10 @@
1
+ import { RefObject } from "react";
2
+ import { Size } from "@react-three/fiber";
3
+ import { LayoutCameraProps } from "./types";
4
+ export declare function useLayoutCamera<CameraType>({ makeDefault }: LayoutCameraProps, updateCamera: (size: Size) => void): {
5
+ size: Size;
6
+ camera: import("@react-three/fiber").Camera & {
7
+ manual?: boolean | undefined;
8
+ };
9
+ cameraRef: RefObject<CameraType>;
10
+ };
package/types/index.d.ts CHANGED
@@ -58,6 +58,7 @@ export { useResetProjection } from "./projection/use-reset-projection";
58
58
  /**
59
59
  * Contexts
60
60
  */
61
+ export { MotionContext } from "./context/MotionContext";
61
62
  export { MotionConfigContext } from "./context/MotionConfigContext";
62
63
  export { PresenceContext } from "./context/PresenceContext";
63
64
  export { LayoutGroupContext } from "./context/LayoutGroupContext";
@@ -16,7 +16,7 @@ export interface Layout {
16
16
  measured: Box;
17
17
  actual: Box;
18
18
  }
19
- export declare type LayoutEvents = "willUpdate" | "didUpdate" | "measure" | "animationComplete";
19
+ export declare type LayoutEvents = "willUpdate" | "didUpdate" | "measure" | "projectionUpdate" | "animationComplete";
20
20
  export interface IProjectionNode<I = unknown> {
21
21
  id: number | undefined;
22
22
  parent?: IProjectionNode;
@@ -99,7 +99,7 @@ export interface IProjectionNode<I = unknown> {
99
99
  resumeFrom?: IProjectionNode;
100
100
  resumingFrom?: IProjectionNode;
101
101
  isPresent?: boolean;
102
- addEventListener(name: LayoutEvents, handler: VoidFunction): VoidFunction;
102
+ addEventListener(name: LayoutEvents, handler: any): VoidFunction;
103
103
  notifyListeners(name: LayoutEvents, ...args: any): void;
104
104
  hasListeners(name: LayoutEvents): boolean;
105
105
  preserveOpacity?: boolean;
@@ -1,3 +1,5 @@
1
1
  export { motion } from "./render/three/motion";
2
- export { MotionCanvas, MotionCanvasProps } from "./components/MotionCanvas";
2
+ export { MotionCanvas, MotionCanvasProps, } from "./components/three/MotionCanvas";
3
+ export { LayoutCamera } from "./components/three/LayoutCamera";
4
+ export { LayoutOrthographicCamera } from "./components/three/LayoutOrthographicCamera";
3
5
  export { useTime } from "./render/three/utils/use-time";