framer-motion 6.3.10 → 6.3.13

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 (234) hide show
  1. package/dist/cjs/index.js +18 -25
  2. package/dist/es/animation/use-animated-state.mjs +0 -1
  3. package/dist/es/animation/utils/transitions.mjs +0 -2
  4. package/dist/es/context/DeprecatedLayoutGroupContext.mjs +0 -1
  5. package/dist/es/context/LayoutGroupContext.mjs +0 -3
  6. package/dist/es/gestures/use-pan-gesture.mjs +1 -1
  7. package/dist/es/motion/index.mjs +0 -2
  8. package/dist/es/motion/utils/valid-prop.mjs +1 -1
  9. package/dist/es/projection/styles/transform.mjs +13 -2
  10. package/dist/es/render/utils/animation.mjs +0 -3
  11. package/dist/es/render/utils/motion-values.mjs +1 -1
  12. package/dist/es/value/index.mjs +2 -5
  13. package/dist/es/value/use-inverted-scale.mjs +0 -1
  14. package/dist/es/value/utils/resolve-motion-value.mjs +0 -2
  15. package/dist/framer-motion.dev.js +18 -25
  16. package/dist/framer-motion.js +1 -1
  17. package/dist/index.d.ts +4188 -0
  18. package/dist/projection.dev.js +16 -12
  19. package/dist/size-rollup-dom-animation.js +1 -1
  20. package/dist/size-rollup-dom-max.js +1 -1
  21. package/dist/size-webpack-dom-max.js +1 -1
  22. package/dist/three-entry.d.ts +2502 -0
  23. package/package.json +5 -5
  24. package/types/animation/animate.d.ts +0 -54
  25. package/types/animation/animation-controls.d.ts +0 -5
  26. package/types/animation/types.d.ts +0 -79
  27. package/types/animation/use-animated-state.d.ts +0 -6
  28. package/types/animation/use-animation.d.ts +0 -31
  29. package/types/animation/utils/default-transitions.d.ts +0 -19
  30. package/types/animation/utils/easing.d.ts +0 -3
  31. package/types/animation/utils/is-animatable.d.ts +0 -11
  32. package/types/animation/utils/is-animation-controls.d.ts +0 -2
  33. package/types/animation/utils/is-keyframes-target.d.ts +0 -2
  34. package/types/animation/utils/transitions.d.ts +0 -29
  35. package/types/animation/utils/variant-resolvers.d.ts +0 -12
  36. package/types/components/AnimatePresence/PresenceChild.d.ts +0 -12
  37. package/types/components/AnimatePresence/index.d.ts +0 -36
  38. package/types/components/AnimatePresence/types.d.ts +0 -61
  39. package/types/components/AnimatePresence/use-presence.d.ts +0 -52
  40. package/types/components/AnimateSharedLayout.d.ts +0 -2
  41. package/types/components/LayoutGroup/index.d.ts +0 -12
  42. package/types/components/LazyMotion/index.d.ts +0 -38
  43. package/types/components/LazyMotion/types.d.ts +0 -54
  44. package/types/components/MotionConfig/index.d.ts +0 -25
  45. package/types/components/Reorder/Group.d.ts +0 -297
  46. package/types/components/Reorder/Item.d.ts +0 -278
  47. package/types/components/Reorder/index.d.ts +0 -509
  48. package/types/components/Reorder/types.d.ts +0 -10
  49. package/types/components/Reorder/utils/check-reorder.d.ts +0 -2
  50. package/types/context/DeprecatedLayoutGroupContext.d.ts +0 -6
  51. package/types/context/LayoutGroupContext.d.ts +0 -11
  52. package/types/context/LazyContext.d.ts +0 -7
  53. package/types/context/MotionConfigContext.d.ts +0 -36
  54. package/types/context/MotionContext/create.d.ts +0 -3
  55. package/types/context/MotionContext/index.d.ts +0 -9
  56. package/types/context/MotionContext/utils.d.ts +0 -3
  57. package/types/context/PresenceContext.d.ts +0 -17
  58. package/types/context/ReorderContext.d.ts +0 -3
  59. package/types/context/SwitchLayoutGroupContext.d.ts +0 -23
  60. package/types/events/event-info.d.ts +0 -5
  61. package/types/events/types.d.ts +0 -10
  62. package/types/events/use-dom-event.d.ts +0 -24
  63. package/types/events/use-pointer-event.d.ts +0 -4
  64. package/types/events/utils.d.ts +0 -3
  65. package/types/gestures/PanSession.d.ts +0 -127
  66. package/types/gestures/drag/VisualElementDragControls.d.ts +0 -56
  67. package/types/gestures/drag/types.d.ts +0 -294
  68. package/types/gestures/drag/use-drag-controls.d.ts +0 -74
  69. package/types/gestures/drag/use-drag.d.ts +0 -7
  70. package/types/gestures/drag/utils/constraints.d.ts +0 -77
  71. package/types/gestures/drag/utils/lock.d.ts +0 -4
  72. package/types/gestures/types.d.ts +0 -225
  73. package/types/gestures/use-focus-gesture.d.ts +0 -8
  74. package/types/gestures/use-hover-gesture.d.ts +0 -2
  75. package/types/gestures/use-pan-gesture.d.ts +0 -14
  76. package/types/gestures/use-tap-gesture.d.ts +0 -6
  77. package/types/gestures/utils/event-type.d.ts +0 -2
  78. package/types/gestures/utils/is-node-or-child.d.ts +0 -8
  79. package/types/index.d.ts +0 -96
  80. package/types/motion/features/animations.d.ts +0 -2
  81. package/types/motion/features/definitions.d.ts +0 -3
  82. package/types/motion/features/drag.d.ts +0 -2
  83. package/types/motion/features/gestures.d.ts +0 -2
  84. package/types/motion/features/layout/MeasureLayout.d.ts +0 -3
  85. package/types/motion/features/layout/index.d.ts +0 -2
  86. package/types/motion/features/layout/types.d.ts +0 -75
  87. package/types/motion/features/types.d.ts +0 -52
  88. package/types/motion/features/use-features.d.ts +0 -8
  89. package/types/motion/features/use-projection.d.ts +0 -3
  90. package/types/motion/features/viewport/observers.d.ts +0 -3
  91. package/types/motion/features/viewport/types.d.ts +0 -21
  92. package/types/motion/features/viewport/use-viewport.d.ts +0 -2
  93. package/types/motion/index.d.ts +0 -25
  94. package/types/motion/types.d.ts +0 -279
  95. package/types/motion/utils/VisualElementHandler.d.ts +0 -18
  96. package/types/motion/utils/is-forced-motion-value.d.ts +0 -2
  97. package/types/motion/utils/make-renderless-component.d.ts +0 -2
  98. package/types/motion/utils/should-inherit-variant.d.ts +0 -2
  99. package/types/motion/utils/use-motion-ref.d.ts +0 -8
  100. package/types/motion/utils/use-visual-element.d.ts +0 -6
  101. package/types/motion/utils/use-visual-state.d.ts +0 -14
  102. package/types/motion/utils/valid-prop.d.ts +0 -9
  103. package/types/projection/animation/mix-values.d.ts +0 -2
  104. package/types/projection/geometry/conversion.d.ts +0 -14
  105. package/types/projection/geometry/copy.d.ts +0 -13
  106. package/types/projection/geometry/delta-apply.d.ts +0 -37
  107. package/types/projection/geometry/delta-calc.d.ts +0 -10
  108. package/types/projection/geometry/delta-remove.d.ts +0 -20
  109. package/types/projection/geometry/models.d.ts +0 -5
  110. package/types/projection/geometry/types.d.ts +0 -29
  111. package/types/projection/geometry/utils.d.ts +0 -3
  112. package/types/projection/index.d.ts +0 -14
  113. package/types/projection/node/DocumentProjectionNode.d.ts +0 -108
  114. package/types/projection/node/HTMLProjectionNode.d.ts +0 -112
  115. package/types/projection/node/create-projection-node.d.ts +0 -301
  116. package/types/projection/node/group.d.ts +0 -7
  117. package/types/projection/node/id.d.ts +0 -1
  118. package/types/projection/node/types.d.ts +0 -136
  119. package/types/projection/shared/stack.d.ts +0 -17
  120. package/types/projection/styles/scale-border-radius.d.ts +0 -11
  121. package/types/projection/styles/scale-box-shadow.d.ts +0 -2
  122. package/types/projection/styles/scale-correction.d.ts +0 -3
  123. package/types/projection/styles/transform-origin.d.ts +0 -0
  124. package/types/projection/styles/transform.d.ts +0 -4
  125. package/types/projection/styles/types.d.ts +0 -9
  126. package/types/projection/use-instant-layout-transition.d.ts +0 -1
  127. package/types/projection/use-reset-projection.d.ts +0 -1
  128. package/types/projection/utils/each-axis.d.ts +0 -3
  129. package/types/projection/utils/has-transform.d.ts +0 -3
  130. package/types/projection/utils/measure.d.ts +0 -4
  131. package/types/render/dom/create-visual-element.d.ts +0 -2
  132. package/types/render/dom/features-animation.d.ts +0 -5
  133. package/types/render/dom/features-max.d.ts +0 -5
  134. package/types/render/dom/motion-minimal.d.ts +0 -5
  135. package/types/render/dom/motion-proxy.d.ts +0 -30
  136. package/types/render/dom/motion.d.ts +0 -25
  137. package/types/render/dom/types.d.ts +0 -28
  138. package/types/render/dom/use-render.d.ts +0 -4
  139. package/types/render/dom/utils/camel-to-dash.d.ts +0 -4
  140. package/types/render/dom/utils/create-config.d.ts +0 -8
  141. package/types/render/dom/utils/css-variables-conversion.d.ts +0 -22
  142. package/types/render/dom/utils/filter-props.d.ts +0 -4
  143. package/types/render/dom/utils/is-css-variable.d.ts +0 -4
  144. package/types/render/dom/utils/is-svg-component.d.ts +0 -2
  145. package/types/render/dom/utils/parse-dom-variant.d.ts +0 -6
  146. package/types/render/dom/utils/unit-conversion.d.ts +0 -27
  147. package/types/render/dom/value-types/animatable-none.d.ts +0 -1
  148. package/types/render/dom/value-types/defaults.d.ts +0 -9
  149. package/types/render/dom/value-types/dimensions.d.ts +0 -8
  150. package/types/render/dom/value-types/find.d.ts +0 -9
  151. package/types/render/dom/value-types/get-as-type.d.ts +0 -5
  152. package/types/render/dom/value-types/number.d.ts +0 -2
  153. package/types/render/dom/value-types/test.d.ts +0 -5
  154. package/types/render/dom/value-types/type-auto.d.ts +0 -5
  155. package/types/render/dom/value-types/type-int.d.ts +0 -8
  156. package/types/render/dom/value-types/types.d.ts +0 -4
  157. package/types/render/html/config-motion.d.ts +0 -3
  158. package/types/render/html/supported-elements.d.ts +0 -7
  159. package/types/render/html/types.d.ts +0 -61
  160. package/types/render/html/use-props.d.ts +0 -8
  161. package/types/render/html/utils/build-styles.d.ts +0 -5
  162. package/types/render/html/utils/build-transform.d.ts +0 -15
  163. package/types/render/html/utils/create-render-state.d.ts +0 -7
  164. package/types/render/html/utils/render.d.ts +0 -4
  165. package/types/render/html/utils/scrape-motion-values.d.ts +0 -2
  166. package/types/render/html/utils/transform.d.ts +0 -15
  167. package/types/render/html/visual-element.d.ts +0 -6
  168. package/types/render/index.d.ts +0 -2
  169. package/types/render/svg/config-motion.d.ts +0 -3
  170. package/types/render/svg/lowercase-elements.d.ts +0 -5
  171. package/types/render/svg/supported-elements.d.ts +0 -7
  172. package/types/render/svg/types.d.ts +0 -44
  173. package/types/render/svg/use-props.d.ts +0 -7
  174. package/types/render/svg/utils/build-attrs.d.ts +0 -8
  175. package/types/render/svg/utils/camel-case-attrs.d.ts +0 -4
  176. package/types/render/svg/utils/create-render-state.d.ts +0 -2
  177. package/types/render/svg/utils/path.d.ts +0 -9
  178. package/types/render/svg/utils/render.d.ts +0 -4
  179. package/types/render/svg/utils/scrape-motion-values.d.ts +0 -2
  180. package/types/render/svg/utils/transform-origin.d.ts +0 -6
  181. package/types/render/svg/visual-element.d.ts +0 -2
  182. package/types/render/types.d.ts +0 -113
  183. package/types/render/utils/animation-state.d.ts +0 -31
  184. package/types/render/utils/animation.d.ts +0 -21
  185. package/types/render/utils/compare-by-depth.d.ts +0 -5
  186. package/types/render/utils/flat-tree.d.ts +0 -8
  187. package/types/render/utils/is-draggable.d.ts +0 -2
  188. package/types/render/utils/lifecycles.d.ts +0 -114
  189. package/types/render/utils/motion-values.d.ts +0 -3
  190. package/types/render/utils/setters.d.ts +0 -792
  191. package/types/render/utils/types.d.ts +0 -9
  192. package/types/render/utils/variants.d.ts +0 -20
  193. package/types/three-entry.d.ts +0 -19
  194. package/types/types.d.ts +0 -981
  195. package/types/utils/array.d.ts +0 -3
  196. package/types/utils/each-axis.d.ts +0 -1
  197. package/types/utils/is-browser.d.ts +0 -1
  198. package/types/utils/is-numerical-string.d.ts +0 -4
  199. package/types/utils/is-ref-object.d.ts +0 -2
  200. package/types/utils/is-zero-value-string.d.ts +0 -4
  201. package/types/utils/noop.d.ts +0 -1
  202. package/types/utils/process.d.ts +0 -1
  203. package/types/utils/resolve-value.d.ts +0 -3
  204. package/types/utils/shallow-compare.d.ts +0 -1
  205. package/types/utils/subscription-manager.d.ts +0 -9
  206. package/types/utils/time-conversion.d.ts +0 -7
  207. package/types/utils/transform.d.ts +0 -91
  208. package/types/utils/use-animation-frame.d.ts +0 -2
  209. package/types/utils/use-constant.d.ts +0 -10
  210. package/types/utils/use-cycle.d.ts +0 -30
  211. package/types/utils/use-force-update.d.ts +0 -1
  212. package/types/utils/use-id.d.ts +0 -6
  213. package/types/utils/use-instant-transition-state.d.ts +0 -3
  214. package/types/utils/use-instant-transition.d.ts +0 -1
  215. package/types/utils/use-is-mounted.d.ts +0 -2
  216. package/types/utils/use-isomorphic-effect.d.ts +0 -2
  217. package/types/utils/use-reduced-motion.d.ts +0 -28
  218. package/types/utils/use-unmount-effect.d.ts +0 -1
  219. package/types/utils/warn-once.d.ts +0 -2
  220. package/types/value/index.d.ts +0 -260
  221. package/types/value/scroll/use-element-scroll.d.ts +0 -28
  222. package/types/value/scroll/use-viewport-scroll.d.ts +0 -22
  223. package/types/value/scroll/utils.d.ts +0 -19
  224. package/types/value/use-combine-values.d.ts +0 -2
  225. package/types/value/use-inverted-scale.d.ts +0 -28
  226. package/types/value/use-motion-template.d.ts +0 -24
  227. package/types/value/use-motion-value.d.ts +0 -19
  228. package/types/value/use-on-change.d.ts +0 -3
  229. package/types/value/use-spring.d.ts +0 -22
  230. package/types/value/use-time.d.ts +0 -1
  231. package/types/value/use-transform.d.ts +0 -93
  232. package/types/value/use-velocity.d.ts +0 -13
  233. package/types/value/utils/is-motion-value.d.ts +0 -2
  234. package/types/value/utils/resolve-motion-value.d.ts +0 -10
@@ -1,112 +0,0 @@
1
- import { IProjectionNode } from "./types";
2
- export declare const rootProjectionNode: {
3
- current: IProjectionNode | undefined;
4
- };
5
- export declare const HTMLProjectionNode: {
6
- new (id: number | undefined, latestValues?: import("../..").ResolvedValues, parent?: IProjectionNode<unknown> | undefined): {
7
- id: number | undefined;
8
- instance: HTMLElement;
9
- root: IProjectionNode<unknown>;
10
- parent?: IProjectionNode<unknown> | undefined;
11
- path: IProjectionNode<unknown>[];
12
- children: Set<IProjectionNode<unknown>>;
13
- options: import("./types").ProjectionNodeOptions;
14
- snapshot: import("./types").Snapshot | undefined;
15
- layout: import("./types").Layout | undefined;
16
- targetLayout?: import("../..").Box | undefined;
17
- layoutCorrected: import("../..").Box;
18
- targetDelta?: import("../..").Delta | undefined;
19
- target?: import("../..").Box | undefined;
20
- relativeTarget?: import("../..").Box | undefined;
21
- relativeTargetOrigin?: import("../..").Box | undefined;
22
- relativeParent?: IProjectionNode<unknown> | undefined;
23
- isTreeAnimating: boolean;
24
- isAnimationBlocked: boolean;
25
- attemptToResolveRelativeTarget?: boolean | undefined;
26
- targetWithTransforms?: import("../..").Box | undefined;
27
- projectionDelta?: import("../..").Delta | undefined;
28
- projectionDeltaWithTransform?: import("../..").Delta | undefined;
29
- scroll?: import("../..").Point | undefined;
30
- isLayoutDirty: boolean;
31
- updateManuallyBlocked: boolean;
32
- updateBlockedByResize: boolean;
33
- isUpdating: boolean;
34
- isSVG: boolean;
35
- needsReset: boolean;
36
- shouldResetTransform: boolean;
37
- treeScale: import("../..").Point;
38
- resumeFrom?: IProjectionNode<unknown> | undefined;
39
- resumingFrom?: IProjectionNode<unknown> | undefined;
40
- latestValues: import("../..").ResolvedValues;
41
- eventHandlers: Map<import("./types").LayoutEvents, import("../../utils/subscription-manager").SubscriptionManager<any>>;
42
- nodes?: import("../..").FlatTree | undefined;
43
- depth: number;
44
- projectionTransform: string;
45
- prevTransformTemplateValue: string | undefined;
46
- preserveOpacity?: boolean | undefined;
47
- addEventListener(name: import("./types").LayoutEvents, handler: any): () => void;
48
- notifyListeners(name: import("./types").LayoutEvents, ...args: any): void;
49
- hasListeners(name: import("./types").LayoutEvents): boolean;
50
- potentialNodes: Map<number, IProjectionNode<unknown>>;
51
- registerPotentialNode(id: number, node: IProjectionNode<unknown>): void;
52
- mount(instance: HTMLElement, isLayoutDirty?: boolean): void;
53
- unmount(): void;
54
- blockUpdate(): void;
55
- unblockUpdate(): void;
56
- isUpdateBlocked(): boolean;
57
- isTreeAnimationBlocked(): boolean;
58
- startUpdate(): void;
59
- willUpdate(shouldNotifyListeners?: boolean): void;
60
- didUpdate(): void;
61
- clearAllSnapshots(): void;
62
- scheduleUpdateProjection(): void;
63
- scheduleCheckAfterUnmount(): void;
64
- checkUpdateFailed: () => void;
65
- updateProjection: () => void;
66
- updateSnapshot(): void;
67
- updateLayout(): void;
68
- updateScroll(): void;
69
- resetTransform(): void;
70
- measure(): import("../..").Box;
71
- removeElementScroll(box: import("../..").Box): import("../..").Box;
72
- applyTransform(box: import("../..").Box, transformOnly?: boolean): import("../..").Box;
73
- removeTransform(box: import("../..").Box): import("../..").Box;
74
- setTargetDelta(delta: import("../..").Delta): void;
75
- setOptions(options: import("./types").ProjectionNodeOptions): void;
76
- clearMeasurements(): void;
77
- resolveTargetDelta(): void;
78
- getClosestProjectingParent(): IProjectionNode<unknown> | undefined;
79
- hasProjected: boolean;
80
- calcProjection(): void;
81
- isVisible: boolean;
82
- hide(): void;
83
- show(): void;
84
- scheduleRender(notifyAll?: boolean): void;
85
- animationValues?: import("../..").ResolvedValues | undefined;
86
- pendingAnimation?: import("framesync").Process | undefined;
87
- currentAnimation?: import("../..").AnimationPlaybackControls | undefined;
88
- mixTargetDelta: (progress: number) => void;
89
- animationProgress: number;
90
- setAnimationOrigin(delta: import("../..").Delta, hasOnlyRelativeTargetChanged?: boolean): void;
91
- startAnimation(options: import("../..").AnimationOptions<number>): void;
92
- completeAnimation(): void;
93
- finishAnimation(): void;
94
- applyTransformsToTarget(): void;
95
- sharedNodes: Map<string, import("../shared/stack").NodeStack>;
96
- registerSharedNode(layoutId: string, node: IProjectionNode<unknown>): void;
97
- isLead(): boolean;
98
- getLead(): IProjectionNode<unknown> | any;
99
- getPrevLead(): IProjectionNode<unknown> | undefined;
100
- getStack(): import("../shared/stack").NodeStack | undefined;
101
- promote({ needsReset, transition, preserveFollowOpacity, }?: {
102
- needsReset?: boolean | undefined;
103
- transition?: import("../..").Transition | undefined;
104
- preserveFollowOpacity?: boolean | undefined;
105
- }): void;
106
- relegate(): boolean;
107
- resetRotation(): void;
108
- getProjectionStyles(styleProp?: import("../..").MotionStyle): import("../..").ResolvedValues;
109
- clearSnapshot(): void;
110
- resetTree(): void;
111
- };
112
- };
@@ -1,301 +0,0 @@
1
- import { Process } from "framesync";
2
- import { AnimationOptions, AnimationPlaybackControls } from "../../animation/animate";
3
- import { ResolvedValues } from "../../render/types";
4
- import { SubscriptionManager } from "../../utils/subscription-manager";
5
- import { Axis, AxisDelta, Box, Delta, Point } from "../geometry/types";
6
- import { NodeStack } from "../shared/stack";
7
- import { IProjectionNode, Layout, LayoutEvents, ProjectionNodeConfig, ProjectionNodeOptions, Snapshot } from "./types";
8
- import { FlatTree } from "../../render/utils/flat-tree";
9
- import { Transition } from "../../types";
10
- import { MotionStyle } from "../../motion/types";
11
- /**
12
- * This should only ever be modified on the client otherwise it'll
13
- * persist through server requests. If we need instanced states we
14
- * could lazy-init via root.
15
- */
16
- export declare const globalProjectionState: {
17
- /**
18
- * Global flag as to whether the tree has animated since the last time
19
- * we resized the window
20
- */
21
- hasAnimatedSinceResize: boolean;
22
- /**
23
- * We set this to true once, on the first update. Any nodes added to the tree beyond that
24
- * update will be given a `data-projection-id` attribute.
25
- */
26
- hasEverUpdated: boolean;
27
- };
28
- export declare function createProjectionNode<I>({ attachResizeListener, defaultParent, measureScroll, resetTransform, }: ProjectionNodeConfig<I>): {
29
- new (id: number | undefined, latestValues?: ResolvedValues, parent?: IProjectionNode | undefined): {
30
- /**
31
- * A unique ID generated for every projection node.
32
- *
33
- * The projection tree's `didUpdate` function will be triggered by the first element
34
- * in the tree to run its layout effects. However, if there are elements entering the tree
35
- * these might not be mounted yet. When React renders a `motion` component we
36
- * give it a unique selector and register it as a potential projection node (not all
37
- * rendered components will be committed by React). In `didUpdate`, we search the DOM for
38
- * these potential nodes with this id and hydrate the projetion node of the ones that were commited.
39
- */
40
- id: number | undefined;
41
- /**
42
- * A reference to the platform-native node (currently this will be a HTMLElement).
43
- */
44
- instance: I;
45
- /**
46
- * A reference to the root projection node. There'll only ever be one tree and one root.
47
- */
48
- root: IProjectionNode;
49
- /**
50
- * A reference to this node's parent.
51
- */
52
- parent?: IProjectionNode<unknown> | undefined;
53
- /**
54
- * A path from this node to the root node. This provides a fast way to iterate
55
- * back up the tree.
56
- */
57
- path: IProjectionNode[];
58
- /**
59
- * A Set containing all this component's children. This is used to iterate
60
- * through the children.
61
- *
62
- * TODO: This could be faster to iterate as a flat array stored on the root node.
63
- */
64
- children: Set<IProjectionNode<unknown>>;
65
- /**
66
- * Options for the node. We use this to configure what kind of layout animations
67
- * we should perform (if any).
68
- */
69
- options: ProjectionNodeOptions;
70
- /**
71
- * A snapshot of the element's state just before the current update. This is
72
- * hydrated when this node's `willUpdate` method is called and scrubbed at the
73
- * end of the tree's `didUpdate` method.
74
- */
75
- snapshot: Snapshot | undefined;
76
- /**
77
- * A box defining the element's layout relative to the page. This will have been
78
- * captured with all parent scrolls and projection transforms unset.
79
- */
80
- layout: Layout | undefined;
81
- /**
82
- * The layout used to calculate the previous layout animation. We use this to compare
83
- * layouts between renders and decide whether we need to trigger a new layout animation
84
- * or just let the current one play out.
85
- */
86
- targetLayout?: Box | undefined;
87
- /**
88
- * A mutable data structure we use to apply all parent transforms currently
89
- * acting on the element's layout. It's from here we can calculate the projectionDelta
90
- * required to get the element from its layout into its calculated target box.
91
- */
92
- layoutCorrected: Box;
93
- /**
94
- * An ideal projection transform we want to apply to the element. This is calculated,
95
- * usually when an element's layout has changed, and we want the element to look as though
96
- * its in its previous layout on the next frame. From there, we animated it down to 0
97
- * to animate the element to its new layout.
98
- */
99
- targetDelta?: Delta | undefined;
100
- /**
101
- * A mutable structure representing the visual bounding box on the page where we want
102
- * and element to appear. This can be set directly but is currently derived once a frame
103
- * from apply targetDelta to layout.
104
- */
105
- target?: Box | undefined;
106
- /**
107
- * A mutable structure describing a visual bounding box relative to the element's
108
- * projected parent. If defined, target will be derived from this rather than targetDelta.
109
- * If not defined, we'll attempt to calculate on the first layout animation frame
110
- * based on the targets calculated from targetDelta. This will transfer a layout animation
111
- * from viewport-relative to parent-relative.
112
- */
113
- relativeTarget?: Box | undefined;
114
- relativeTargetOrigin?: Box | undefined;
115
- relativeParent?: IProjectionNode<unknown> | undefined;
116
- /**
117
- * We use this to detect when its safe to shut down part of a projection tree.
118
- * We have to keep projecting children for scale correction and relative projection
119
- * until all their parents stop performing layout animations.
120
- */
121
- isTreeAnimating: boolean;
122
- isAnimationBlocked: boolean;
123
- /**
124
- * If true, attempt to resolve relativeTarget.
125
- */
126
- attemptToResolveRelativeTarget?: boolean | undefined;
127
- /**
128
- * A mutable structure that represents the target as transformed by the element's
129
- * latest user-set transforms (ie scale, x)
130
- */
131
- targetWithTransforms?: Box | undefined;
132
- /**
133
- * A calculated transform that will project an element from its layoutCorrected
134
- * into the target. This will be used by children to calculate their own layoutCorrect boxes.
135
- */
136
- projectionDelta?: Delta | undefined;
137
- /**
138
- * A calculated transform that will project an element from its layoutCorrected
139
- * into the targetWithTransforms.
140
- */
141
- projectionDeltaWithTransform?: Delta | undefined;
142
- /**
143
- * If we're tracking the scroll of this element, we store it here.
144
- */
145
- scroll?: Point | undefined;
146
- /**
147
- * Flag to true if we think this layout has been changed. We can't always know this,
148
- * currently we set it to true every time a component renders, or if it has a layoutDependency
149
- * if that has changed between renders. Additionally, components can be grouped by LayoutGroup
150
- * and if one node is dirtied, they all are.
151
- */
152
- isLayoutDirty: boolean;
153
- /**
154
- * Block layout updates for instant layout transitions throughout the tree.
155
- */
156
- updateManuallyBlocked: boolean;
157
- updateBlockedByResize: boolean;
158
- /**
159
- * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`
160
- * call.
161
- */
162
- isUpdating: boolean;
163
- /**
164
- * If this is an SVG element we currently disable projection transforms
165
- */
166
- isSVG: boolean;
167
- /**
168
- * Flag to true (during promotion) if a node doing an instant layout transition needs to reset
169
- * its projection styles.
170
- */
171
- needsReset: boolean;
172
- /**
173
- * Flags whether this node should have its transform reset prior to measuring.
174
- */
175
- shouldResetTransform: boolean;
176
- /**
177
- * An object representing the calculated contextual/accumulated/tree scale.
178
- * This will be used to scale calculcated projection transforms, as these are
179
- * calculated in screen-space but need to be scaled for elements to actually
180
- * make it to their calculated destinations.
181
- *
182
- * TODO: Lazy-init
183
- */
184
- treeScale: Point;
185
- /**
186
- * Is hydrated with a projection node if an element is animating from another.
187
- */
188
- resumeFrom?: IProjectionNode<unknown> | undefined;
189
- /**
190
- * Is hydrated with a projection node if an element is animating from another.
191
- */
192
- resumingFrom?: IProjectionNode<unknown> | undefined;
193
- /**
194
- * A reference to the element's latest animated values. This is a reference shared
195
- * between the element's VisualElement and the ProjectionNode.
196
- */
197
- latestValues: ResolvedValues;
198
- /**
199
- *
200
- */
201
- eventHandlers: Map<LayoutEvents, SubscriptionManager<any>>;
202
- nodes?: FlatTree | undefined;
203
- depth: number;
204
- /**
205
- * When we update the projection transform, we also build it into a string.
206
- * If the string changes between frames, we trigger a render.
207
- */
208
- projectionTransform: string;
209
- /**
210
- * If transformTemplate generates a different value before/after the
211
- * update, we need to reset the transform.
212
- */
213
- prevTransformTemplateValue: string | undefined;
214
- preserveOpacity?: boolean | undefined;
215
- addEventListener(name: LayoutEvents, handler: any): () => void;
216
- notifyListeners(name: LayoutEvents, ...args: any): void;
217
- hasListeners(name: LayoutEvents): boolean;
218
- potentialNodes: Map<number, IProjectionNode<unknown>>;
219
- registerPotentialNode(id: number, node: IProjectionNode): void;
220
- /**
221
- * Lifecycles
222
- */
223
- mount(instance: I, isLayoutDirty?: boolean): void;
224
- unmount(): void;
225
- blockUpdate(): void;
226
- unblockUpdate(): void;
227
- isUpdateBlocked(): boolean;
228
- isTreeAnimationBlocked(): boolean;
229
- startUpdate(): void;
230
- willUpdate(shouldNotifyListeners?: boolean): void;
231
- didUpdate(): void;
232
- clearAllSnapshots(): void;
233
- scheduleUpdateProjection(): void;
234
- scheduleCheckAfterUnmount(): void;
235
- checkUpdateFailed: () => void;
236
- updateProjection: () => void;
237
- /**
238
- * Update measurements
239
- */
240
- updateSnapshot(): void;
241
- updateLayout(): void;
242
- updateScroll(): void;
243
- resetTransform(): void;
244
- measure(): Box;
245
- removeElementScroll(box: Box): Box;
246
- applyTransform(box: Box, transformOnly?: boolean): Box;
247
- removeTransform(box: Box): Box;
248
- /**
249
- *
250
- */
251
- setTargetDelta(delta: Delta): void;
252
- setOptions(options: ProjectionNodeOptions): void;
253
- clearMeasurements(): void;
254
- /**
255
- * Frame calculations
256
- */
257
- resolveTargetDelta(): void;
258
- getClosestProjectingParent(): IProjectionNode<unknown> | undefined;
259
- hasProjected: boolean;
260
- calcProjection(): void;
261
- isVisible: boolean;
262
- hide(): void;
263
- show(): void;
264
- scheduleRender(notifyAll?: boolean): void;
265
- /**
266
- * Animation
267
- */
268
- animationValues?: ResolvedValues | undefined;
269
- pendingAnimation?: Process | undefined;
270
- currentAnimation?: AnimationPlaybackControls | undefined;
271
- mixTargetDelta: (progress: number) => void;
272
- animationProgress: number;
273
- setAnimationOrigin(delta: Delta, hasOnlyRelativeTargetChanged?: boolean): void;
274
- startAnimation(options: AnimationOptions<number>): void;
275
- completeAnimation(): void;
276
- finishAnimation(): void;
277
- applyTransformsToTarget(): void;
278
- /**
279
- * Shared layout
280
- */
281
- sharedNodes: Map<string, NodeStack>;
282
- registerSharedNode(layoutId: string, node: IProjectionNode): void;
283
- isLead(): boolean;
284
- getLead(): IProjectionNode<unknown> | any;
285
- getPrevLead(): IProjectionNode<unknown> | undefined;
286
- getStack(): NodeStack | undefined;
287
- promote({ needsReset, transition, preserveFollowOpacity, }?: {
288
- needsReset?: boolean | undefined;
289
- transition?: Transition | undefined;
290
- preserveFollowOpacity?: boolean | undefined;
291
- }): void;
292
- relegate(): boolean;
293
- resetRotation(): void;
294
- getProjectionStyles(styleProp?: MotionStyle): ResolvedValues;
295
- clearSnapshot(): void;
296
- resetTree(): void;
297
- };
298
- };
299
- export declare function mixAxisDelta(output: AxisDelta, delta: AxisDelta, p: number): void;
300
- export declare function mixAxis(output: Axis, from: Axis, to: Axis, p: number): void;
301
- export declare function mixBox(output: Box, from: Box, to: Box, p: number): void;
@@ -1,7 +0,0 @@
1
- import { IProjectionNode } from "./types";
2
- export interface NodeGroup {
3
- add: (node: IProjectionNode) => void;
4
- remove: (node: IProjectionNode) => void;
5
- dirty: VoidFunction;
6
- }
7
- export declare function nodeGroup(): NodeGroup;
@@ -1 +0,0 @@
1
- export declare function useProjectionId(): number | undefined;
@@ -1,136 +0,0 @@
1
- import { Transition } from "../../types";
2
- import { ResolvedValues, VisualElement } from "../../render/types";
3
- import { Box, Delta, Point } from "../geometry/types";
4
- import { NodeStack } from "../shared/stack";
5
- import { AnimationPlaybackControls } from "../../animation/animate";
6
- import { FlatTree } from "../../render/utils/flat-tree";
7
- import { InitialPromotionConfig } from "../../context/SwitchLayoutGroupContext";
8
- import { MotionStyle } from "../../motion/types";
9
- export interface Snapshot {
10
- measured: Box;
11
- layout: Box;
12
- latestValues: ResolvedValues;
13
- isShared?: boolean;
14
- }
15
- export interface Layout {
16
- measured: Box;
17
- actual: Box;
18
- }
19
- export declare type LayoutEvents = "willUpdate" | "didUpdate" | "beforeMeasure" | "measure" | "projectionUpdate" | "animationStart" | "animationComplete";
20
- export interface IProjectionNode<I = unknown> {
21
- id: number | undefined;
22
- parent?: IProjectionNode;
23
- relativeParent?: IProjectionNode;
24
- root?: IProjectionNode;
25
- children: Set<IProjectionNode>;
26
- path: IProjectionNode[];
27
- nodes?: FlatTree;
28
- depth: number;
29
- instance: I;
30
- mount: (node: I, isLayoutDirty?: boolean) => void;
31
- unmount: () => void;
32
- options: ProjectionNodeOptions;
33
- setOptions(options: ProjectionNodeOptions): void;
34
- layout?: Layout;
35
- snapshot?: Snapshot;
36
- target?: Box;
37
- relativeTarget?: Box;
38
- targetDelta?: Delta;
39
- targetWithTransforms?: Box;
40
- scroll?: Point;
41
- treeScale?: Point;
42
- projectionDelta?: Delta;
43
- latestValues: ResolvedValues;
44
- isLayoutDirty: boolean;
45
- shouldResetTransform: boolean;
46
- prevTransformTemplateValue: string | undefined;
47
- isUpdateBlocked(): boolean;
48
- updateManuallyBlocked: boolean;
49
- updateBlockedByResize: boolean;
50
- blockUpdate(): void;
51
- unblockUpdate(): void;
52
- isUpdating: boolean;
53
- needsReset: boolean;
54
- startUpdate(): void;
55
- willUpdate(notifyListeners?: boolean): void;
56
- didUpdate(): void;
57
- measure(): Box;
58
- updateLayout(): void;
59
- updateSnapshot(): void;
60
- clearSnapshot(): void;
61
- updateScroll(): void;
62
- scheduleUpdateProjection(): void;
63
- scheduleCheckAfterUnmount(): void;
64
- checkUpdateFailed(): void;
65
- potentialNodes: Map<number, IProjectionNode>;
66
- sharedNodes: Map<string, NodeStack>;
67
- registerPotentialNode(id: number, node: IProjectionNode): void;
68
- registerSharedNode(id: string, node: IProjectionNode): void;
69
- getStack(): NodeStack | undefined;
70
- isVisible: boolean;
71
- hide(): void;
72
- show(): void;
73
- scheduleRender(notifyAll?: boolean): void;
74
- getClosestProjectingParent(): IProjectionNode | undefined;
75
- setTargetDelta(delta: Delta): void;
76
- resetTransform(): void;
77
- resetRotation(): void;
78
- applyTransform(box: Box, transformOnly?: boolean): Box;
79
- resolveTargetDelta(): void;
80
- calcProjection(): void;
81
- getProjectionStyles(styles?: MotionStyle): MotionStyle | undefined;
82
- clearMeasurements(): void;
83
- resetTree(): void;
84
- animationValues?: ResolvedValues;
85
- currentAnimation?: AnimationPlaybackControls;
86
- isTreeAnimating?: boolean;
87
- isAnimationBlocked?: boolean;
88
- isTreeAnimationBlocked: () => boolean;
89
- setAnimationOrigin(delta: Delta): void;
90
- startAnimation(transition: Transition): void;
91
- finishAnimation(): void;
92
- isLead(): boolean;
93
- promote(options?: {
94
- needsReset?: boolean;
95
- transition?: Transition;
96
- preserveFollowOpacity?: boolean;
97
- }): void;
98
- relegate(): boolean;
99
- resumeFrom?: IProjectionNode;
100
- resumingFrom?: IProjectionNode;
101
- isPresent?: boolean;
102
- addEventListener(name: LayoutEvents, handler: any): VoidFunction;
103
- notifyListeners(name: LayoutEvents, ...args: any): void;
104
- hasListeners(name: LayoutEvents): boolean;
105
- preserveOpacity?: boolean;
106
- }
107
- export interface LayoutUpdateData {
108
- layout: Box;
109
- snapshot: Snapshot;
110
- delta: Delta;
111
- layoutDelta: Delta;
112
- hasLayoutChanged: boolean;
113
- hasRelativeTargetChanged: boolean;
114
- }
115
- export declare type LayoutUpdateHandler = (data: LayoutUpdateData) => void;
116
- export interface ProjectionNodeConfig<I> {
117
- defaultParent?: () => IProjectionNode;
118
- attachResizeListener?: (instance: I, notifyResize: VoidFunction) => VoidFunction;
119
- measureScroll: (instance: I) => Point;
120
- resetTransform?: (instance: I, value?: string) => void;
121
- }
122
- export interface ProjectionNodeOptions {
123
- animate?: boolean;
124
- layoutScroll?: boolean;
125
- alwaysMeasureLayout?: boolean;
126
- scheduleRender?: VoidFunction;
127
- onExitComplete?: VoidFunction;
128
- animationType?: "size" | "position" | "both";
129
- layoutId?: string;
130
- layout?: boolean | string;
131
- visualElement?: VisualElement;
132
- crossfade?: boolean;
133
- transition?: Transition;
134
- initialPromotionConfig?: InitialPromotionConfig;
135
- }
136
- export declare type ProjectionEventName = "layoutUpdate" | "projectionUpdate";
@@ -1,17 +0,0 @@
1
- import { IProjectionNode } from "../node/types";
2
- export declare class NodeStack {
3
- lead?: IProjectionNode;
4
- prevLead?: IProjectionNode;
5
- members: IProjectionNode[];
6
- add(node: IProjectionNode): void;
7
- remove(node: IProjectionNode): void;
8
- relegate(node: IProjectionNode): boolean;
9
- promote(node: IProjectionNode, preserveFollowOpacity?: boolean): void;
10
- exitAnimationComplete(): void;
11
- scheduleRender(): void;
12
- /**
13
- * Clear any leads that have been removed this render to prevent them from being
14
- * used in future animations and to prevent memory leaks
15
- */
16
- removeLeadSnapshot(): void;
17
- }
@@ -1,11 +0,0 @@
1
- import { Axis } from "../geometry/types";
2
- import { ScaleCorrectorDefinition } from "./types";
3
- export declare function pixelsToPercent(pixels: number, axis: Axis): number;
4
- /**
5
- * We always correct borderRadius as a percentage rather than pixels to reduce paints.
6
- * For example, if you are projecting a box that is 100px wide with a 10px borderRadius
7
- * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%
8
- * borderRadius in both states. If we animate between the two in pixels that will trigger
9
- * a paint each time. If we animate between the two in percentage we'll avoid a paint.
10
- */
11
- export declare const correctBorderRadius: ScaleCorrectorDefinition;
@@ -1,2 +0,0 @@
1
- import { ScaleCorrectorDefinition } from "./types";
2
- export declare const correctBoxShadow: ScaleCorrectorDefinition;
@@ -1,3 +0,0 @@
1
- import { ScaleCorrectorMap } from "./types";
2
- export declare const scaleCorrectors: {};
3
- export declare function addScaleCorrector(correctors: ScaleCorrectorMap): void;
File without changes
@@ -1,4 +0,0 @@
1
- import { ResolvedValues } from "../../render/types";
2
- import { Delta, Point } from "../geometry/types";
3
- export declare const identityProjection = "translate3d(0px, 0px, 0) scale(1, 1)";
4
- export declare function buildProjectionTransform(delta: Delta, treeScale: Point, latestTransform?: ResolvedValues): string;
@@ -1,9 +0,0 @@
1
- import { IProjectionNode } from "../node/types";
2
- export declare type ScaleCorrector = (latest: string | number, node: IProjectionNode) => string | number;
3
- export interface ScaleCorrectorDefinition {
4
- correct: ScaleCorrector;
5
- applyTo?: string[];
6
- }
7
- export interface ScaleCorrectorMap {
8
- [key: string]: ScaleCorrectorDefinition;
9
- }
@@ -1 +0,0 @@
1
- export declare function useInstantLayoutTransition(): (cb?: (() => void) | undefined) => void;
@@ -1 +0,0 @@
1
- export declare function useResetProjection(): () => void;
@@ -1,3 +0,0 @@
1
- declare type Callback = (axis: "x" | "y") => void;
2
- export declare function eachAxis(callback: Callback): void[];
3
- export {};
@@ -1,3 +0,0 @@
1
- import { ResolvedValues } from "../../render/types";
2
- export declare function hasScale({ scale, scaleX, scaleY }: ResolvedValues): boolean;
3
- export declare function hasTransform(values: ResolvedValues): string | number | true;
@@ -1,4 +0,0 @@
1
- import { TransformPoint } from "../geometry/types";
2
- import { IProjectionNode } from "../node/types";
3
- export declare function measureViewportBox(instance: HTMLElement, transformPoint?: TransformPoint): import("../geometry/types").Box;
4
- export declare function measurePageBox(element: HTMLElement, rootProjectionNode: IProjectionNode, transformPagePoint?: TransformPoint): import("../geometry/types").Box;
@@ -1,2 +0,0 @@
1
- import { CreateVisualElement } from "../types";
2
- export declare const createDomVisualElement: CreateVisualElement<HTMLElement | SVGElement>;
@@ -1,5 +0,0 @@
1
- import { FeatureBundle } from "../../motion/features/types";
2
- /**
3
- * @public
4
- */
5
- export declare const domAnimation: FeatureBundle;
@@ -1,5 +0,0 @@
1
- import { FeatureBundle } from "../../motion/features/types";
2
- /**
3
- * @public
4
- */
5
- export declare const domMax: FeatureBundle;
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * @public
4
- */
5
- export declare const m: (<Props>(Component: string | import("react").ComponentType<Props>, customMotionComponentConfig?: import("./motion-proxy").CustomMotionComponentConfig) => import("./motion-proxy").CustomDomComponent<Props>) & import("../html/types").HTMLMotionComponents & import("../svg/types").SVGMotionComponents;