motion-v 0.13.0-beta.4 → 0.13.1-alpha.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.
@@ -18,4 +18,8 @@ export interface LayoutOptions extends LayoutLifecycles {
18
18
  'layoutRoot'?: boolean;
19
19
  'data-framer-portal-id'?: string;
20
20
  'crossfade'?: boolean;
21
+ /**
22
+ * @public
23
+ */
24
+ 'layoutDependency'?: any;
21
25
  }
@@ -36,7 +36,8 @@ function animateUpdates({
36
36
  });
37
37
  }
38
38
  function resolveDirectAnimation(directAnimate, directTransition) {
39
- const variant = resolveVariant(directAnimate, this.options.variants, this.options.custom);
39
+ var _a;
40
+ const variant = resolveVariant(directAnimate, this.options.variants, this.options.custom || ((_a = this.options.animatePresenceContext) == null ? void 0 : _a.custom));
40
41
  if (!variant)
41
42
  return {};
42
43
  const transition = variant.transition || directTransition || this.options.transition || {};
@@ -1,6 +1,7 @@
1
1
  import { MotionStateContext, Options } from '../types';
2
2
  import { DOMKeyframesDefinition, VisualElement } from 'framer-motion';
3
3
  import { frame } from 'framer-motion/dom';
4
+ import { PresenceContext } from '../components/presence';
4
5
  import { StateType, animateUpdates } from './animate-updates';
5
6
  export declare const mountedStates: WeakMap<Element, MotionState>;
6
7
  /**
@@ -11,7 +12,9 @@ export declare class MotionState {
11
12
  readonly id: string;
12
13
  element: HTMLElement | null;
13
14
  private parent?;
14
- options: Options;
15
+ options: Options & {
16
+ animatePresenceContext?: PresenceContext;
17
+ };
15
18
  isSafeToRemove: boolean;
16
19
  isVShow: boolean;
17
20
  private children?;
@@ -45,6 +48,8 @@ export declare class MotionState {
45
48
  setActive(name: StateType, isActive: boolean, isAnimate?: boolean): void;
46
49
  animateUpdates: typeof animateUpdates;
47
50
  isMounted(): boolean;
48
- getOptions(): Options<any>;
51
+ getOptions(): Options<any> & {
52
+ animatePresenceContext?: PresenceContext;
53
+ };
49
54
  willUpdate(label: string): void;
50
55
  }
@@ -60,15 +60,12 @@ const SVG_STYLE_TO_ATTRIBUTES = {
60
60
  cy: true,
61
61
  r: true,
62
62
  d: true,
63
- x: true,
64
- y: true,
65
63
  x1: true,
66
64
  y1: true,
67
65
  x2: true,
68
66
  y2: true,
69
67
  points: true,
70
68
  pathLength: true,
71
- transform: true,
72
69
  viewBox: true,
73
70
  width: true,
74
71
  height: true,
@@ -0,0 +1,4 @@
1
+ import { Component, DefineComponent, ExtractPropTypes, ExtractPublicPropTypes, IntrinsicElementAttributes } from 'vue';
2
+ export type ComponentProps<T> = T extends DefineComponent<ExtractPropTypes<infer Props>, any, any> ? ExtractPublicPropTypes<Props> : never;
3
+ export type ElementType = keyof IntrinsicElementAttributes;
4
+ export type AsTag = keyof IntrinsicElementAttributes | (Component & string);
@@ -2,3 +2,4 @@ export * from './transform';
2
2
  export * from './framer-motion';
3
3
  export * from './motion-values';
4
4
  export * from './state';
5
+ export * from './common';
@@ -1,6 +1,7 @@
1
1
  import { MotionValue } from 'framer-motion/dom';
2
- import { ElementType, Options } from './state';
2
+ import { Options } from './state';
3
3
  import { AriaAttributes, Events, IntrinsicElementAttributes, SVGAttributes } from 'vue';
4
+ import { ElementType } from './common';
4
5
  type EventHandlers<E> = {
5
6
  [K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void;
6
7
  };
@@ -1,6 +1,5 @@
1
1
  import { DOMKeyframesDefinition, ResolvedValues, Target, TargetAndTransition } from 'framer-motion';
2
2
  import { MotionValue, TransformProperties, animate } from 'framer-motion/dom';
3
- import { IntrinsicElementAttributes } from 'vue';
4
3
  import { LayoutOptions } from '../features/layout/types';
5
4
  import { DragProps } from '../features/gestures/drag/types';
6
5
  import { PressProps } from '../features/gestures/press/types';
@@ -12,6 +11,7 @@ import { MotionConfigState } from '../components/motion-config/types';
12
11
  import { $Transition } from './framer-motion';
13
12
  import { FocusProps } from '../features/gestures/focus/types';
14
13
  import { AnimationControls } from '../animation/types';
14
+ import { AsTag } from './common';
15
15
  type AnimationPlaybackControls = ReturnType<typeof animate>;
16
16
  export type TargetResolver = (custom: any, current: Target, velocity: Target) => TargetAndTransition | string;
17
17
  export interface Variant extends DOMKeyframesDefinition {
@@ -39,16 +39,16 @@ type TransformPropertiesWithoutTransition = Omit<TransformProperties, 'transitio
39
39
  export type MotionStyle = Partial<{
40
40
  [K in keyof Omit<Variant & TransformPropertiesWithoutTransition, 'attrX' | 'attrY' | 'attrScale'>]: string | number | undefined | MotionValue;
41
41
  }>;
42
- export type ElementType = keyof IntrinsicElementAttributes;
43
42
  export interface Options<T = any> extends LayoutOptions, PressProps, HoverProps, InViewProps, DragProps, PanProps, FocusProps {
44
43
  custom?: T;
45
- as?: ElementType;
44
+ as?: AsTag;
46
45
  initial?: VariantLabels | Variant | boolean;
47
46
  animate?: VariantLabels | Variant | AnimationControls;
48
47
  exit?: VariantLabels | Variant;
49
48
  variants?: {
50
49
  [k: string]: Variant | ((custom: T) => Variant);
51
50
  };
51
+ inherit?: boolean;
52
52
  style?: MotionStyle;
53
53
  transformTemplate?: (transform: TransformProperties, generatedTransform: string) => string;
54
54
  transition?: $Transition & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion-v",
3
- "version": "0.13.0-beta.4",
3
+ "version": "0.13.1-alpha.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",
File without changes
File without changes