motion-dom 12.38.0 → 12.40.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.
- package/dist/cjs/index.js +694 -445
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/animation/interfaces/motion-value.mjs +2 -1
- package/dist/es/animation/interfaces/motion-value.mjs.map +1 -1
- package/dist/es/animation/interfaces/visual-element-target.mjs +8 -0
- package/dist/es/animation/interfaces/visual-element-target.mjs.map +1 -1
- package/dist/es/animation/utils/arc.mjs +188 -0
- package/dist/es/animation/utils/arc.mjs.map +1 -0
- package/dist/es/effects/style/transform.mjs +9 -0
- package/dist/es/effects/style/transform.mjs.map +1 -1
- package/dist/es/index.mjs +1 -0
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/projection/node/create-projection-node.mjs +30 -6
- package/dist/es/projection/node/create-projection-node.mjs.map +1 -1
- package/dist/es/projection/styles/transform.mjs +4 -1
- package/dist/es/projection/styles/transform.mjs.map +1 -1
- package/dist/es/render/VisualElement.mjs +2 -2
- package/dist/es/render/VisualElement.mjs.map +1 -1
- package/dist/es/render/html/utils/build-transform.mjs +8 -0
- package/dist/es/render/html/utils/build-transform.mjs.map +1 -1
- package/dist/es/render/utils/animation-state.mjs +2 -1
- package/dist/es/render/utils/animation-state.mjs.map +1 -1
- package/dist/es/render/utils/keys-transform.mjs +8 -1
- package/dist/es/render/utils/keys-transform.mjs.map +1 -1
- package/dist/es/value/types/maps/transform.mjs +6 -0
- package/dist/es/value/types/maps/transform.mjs.map +1 -1
- package/dist/index.d.ts +1160 -1062
- package/dist/motion-dom.dev.js +694 -445
- package/dist/motion-dom.js +1 -1
- package/dist/size-rollup-motion-value.js.map +1 -1
- package/dist/size-rollup-style-effect.js +1 -1
- package/dist/size-rollup-style-effect.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as motion_utils from 'motion-utils';
|
|
2
|
-
import { Point, BoundingBox, Axis, Box, TransformPoint, Easing, EasingFunction, BezierDefinition,
|
|
2
|
+
import { Point, BoundingBox, Axis, Box, TransformPoint, Easing, Delta, EasingFunction, BezierDefinition, AxisDelta, SubscriptionManager } from 'motion-utils';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Passed in to pan event handlers like `onPan` the `PanInfo` object contains
|
|
@@ -1460,1394 +1460,1485 @@ interface SVGAttributes {
|
|
|
1460
1460
|
zoomAndPan?: string | undefined;
|
|
1461
1461
|
}
|
|
1462
1462
|
|
|
1463
|
+
interface VisualElementAnimationOptions {
|
|
1464
|
+
delay?: number;
|
|
1465
|
+
transitionOverride?: Transition;
|
|
1466
|
+
custom?: any;
|
|
1467
|
+
type?: AnimationType;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
interface AnimationState$1 {
|
|
1471
|
+
animateChanges: (type?: AnimationType) => Promise<any>;
|
|
1472
|
+
setActive: (type: AnimationType, isActive: boolean, options?: VisualElementAnimationOptions) => Promise<any>;
|
|
1473
|
+
setAnimateFunction: (fn: any) => void;
|
|
1474
|
+
getState: () => {
|
|
1475
|
+
[key: string]: AnimationTypeState;
|
|
1476
|
+
};
|
|
1477
|
+
reset: () => void;
|
|
1478
|
+
}
|
|
1479
|
+
type AnimationList = string[] | TargetAndTransition[];
|
|
1480
|
+
declare function createAnimationState(visualElement: any): AnimationState$1;
|
|
1481
|
+
declare function checkVariantsDidChange(prev: any, next: any): boolean;
|
|
1482
|
+
interface AnimationTypeState {
|
|
1483
|
+
isActive: boolean;
|
|
1484
|
+
protectedKeys: {
|
|
1485
|
+
[key: string]: true;
|
|
1486
|
+
};
|
|
1487
|
+
needsAnimating: {
|
|
1488
|
+
[key: string]: boolean;
|
|
1489
|
+
};
|
|
1490
|
+
prevResolvedValues: {
|
|
1491
|
+
[key: string]: any;
|
|
1492
|
+
};
|
|
1493
|
+
prevProp?: VariantLabels | TargetAndTransition;
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1463
1496
|
/**
|
|
1464
|
-
*
|
|
1497
|
+
* Set feature definitions for all VisualElements.
|
|
1498
|
+
* This should be called by the framework layer (e.g., framer-motion) during initialization.
|
|
1465
1499
|
*/
|
|
1466
|
-
|
|
1500
|
+
declare function setFeatureDefinitions(definitions: Partial<FeatureDefinitions>): void;
|
|
1467
1501
|
/**
|
|
1468
|
-
*
|
|
1469
|
-
* could be a synchronous loop, a setInterval, or tied to the device's framerate.
|
|
1502
|
+
* Get the current feature definitions
|
|
1470
1503
|
*/
|
|
1471
|
-
|
|
1472
|
-
start: (keepAlive?: boolean) => void;
|
|
1473
|
-
stop: () => void;
|
|
1474
|
-
now: () => number;
|
|
1475
|
-
}
|
|
1476
|
-
type Driver = (update: Update$1) => DriverControls;
|
|
1477
|
-
|
|
1504
|
+
declare function getFeatureDefinitions(): Partial<FeatureDefinitions>;
|
|
1478
1505
|
/**
|
|
1479
|
-
*
|
|
1480
|
-
* moved to motion-dom
|
|
1506
|
+
* Motion style type - a subset of CSS properties that can contain motion values
|
|
1481
1507
|
*/
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
getValue: (name: string, defaultValue?: any) => any;
|
|
1486
|
-
current?: HTMLElement | SVGElement;
|
|
1487
|
-
measureViewportBox: () => Box;
|
|
1488
|
-
}
|
|
1489
|
-
|
|
1490
|
-
type AnyResolvedKeyframe = string | number;
|
|
1491
|
-
interface ProgressTimeline {
|
|
1492
|
-
currentTime: null | {
|
|
1493
|
-
value: number;
|
|
1494
|
-
};
|
|
1495
|
-
cancel?: VoidFunction;
|
|
1496
|
-
}
|
|
1497
|
-
interface ValueAnimationOptionsWithRenderContext<V extends AnyResolvedKeyframe = number> extends ValueAnimationOptions<V> {
|
|
1498
|
-
KeyframeResolver?: typeof KeyframeResolver;
|
|
1499
|
-
motionValue?: MotionValue<V>;
|
|
1500
|
-
element?: WithRender;
|
|
1501
|
-
}
|
|
1502
|
-
interface TimelineWithFallback {
|
|
1503
|
-
timeline?: ProgressTimeline;
|
|
1504
|
-
rangeStart?: string;
|
|
1505
|
-
rangeEnd?: string;
|
|
1506
|
-
observe: (animation: AnimationPlaybackControls) => VoidFunction;
|
|
1507
|
-
}
|
|
1508
|
+
type MotionStyle = {
|
|
1509
|
+
[K: string]: AnyResolvedKeyframe | MotionValue | undefined;
|
|
1510
|
+
};
|
|
1508
1511
|
/**
|
|
1509
|
-
*
|
|
1512
|
+
* A VisualElement is an imperative abstraction around UI elements such as
|
|
1513
|
+
* HTMLElement, SVGElement, Three.Object3D etc.
|
|
1510
1514
|
*/
|
|
1511
|
-
|
|
1515
|
+
declare abstract class VisualElement<Instance = unknown, RenderState = unknown, Options extends {} = {}> {
|
|
1512
1516
|
/**
|
|
1513
|
-
*
|
|
1517
|
+
* VisualElements are arranged in trees mirroring that of the React tree.
|
|
1518
|
+
* Each type of VisualElement has a unique name, to detect when we're crossing
|
|
1519
|
+
* type boundaries within that tree.
|
|
1514
1520
|
*/
|
|
1515
|
-
|
|
1521
|
+
abstract type: string;
|
|
1516
1522
|
/**
|
|
1517
|
-
*
|
|
1518
|
-
*
|
|
1523
|
+
* An `Array.sort` compatible function that will compare two Instances and
|
|
1524
|
+
* compare their respective positions within the tree.
|
|
1519
1525
|
*/
|
|
1520
|
-
|
|
1526
|
+
abstract sortInstanceNodePosition(a: Instance, b: Instance): number;
|
|
1521
1527
|
/**
|
|
1522
|
-
*
|
|
1528
|
+
* Measure the viewport-relative bounding box of the Instance.
|
|
1523
1529
|
*/
|
|
1524
|
-
|
|
1530
|
+
abstract measureInstanceViewportBox(instance: Instance, props: MotionNodeOptions & Partial<MotionConfigContextProps>): Box;
|
|
1525
1531
|
/**
|
|
1526
|
-
*
|
|
1527
|
-
*
|
|
1528
|
-
*
|
|
1532
|
+
* When a value has been removed from all animation props we need to
|
|
1533
|
+
* pick a target to animate back to. For instance, for HTMLElements
|
|
1534
|
+
* we can look in the style prop.
|
|
1529
1535
|
*/
|
|
1530
|
-
|
|
1531
|
-
duration: number;
|
|
1536
|
+
abstract getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | undefined | MotionValue;
|
|
1532
1537
|
/**
|
|
1533
|
-
*
|
|
1538
|
+
* When we first animate to a value we need to animate it *from* a value.
|
|
1539
|
+
* Often this have been specified via the initial prop but it might be
|
|
1540
|
+
* that the value needs to be read from the Instance.
|
|
1534
1541
|
*/
|
|
1535
|
-
|
|
1542
|
+
abstract readValueFromInstance(instance: Instance, key: string, options: Options): AnyResolvedKeyframe | null | undefined;
|
|
1536
1543
|
/**
|
|
1537
|
-
*
|
|
1538
|
-
*
|
|
1544
|
+
* When a value has been removed from the VisualElement we use this to remove
|
|
1545
|
+
* it from the inherting class' unique render state.
|
|
1539
1546
|
*/
|
|
1540
|
-
|
|
1547
|
+
abstract removeValueFromRenderState(key: string, renderState: RenderState): void;
|
|
1541
1548
|
/**
|
|
1542
|
-
*
|
|
1549
|
+
* Run before a React or VisualElement render, builds the latest motion
|
|
1550
|
+
* values into an Instance-specific format. For example, HTMLVisualElement
|
|
1551
|
+
* will use this step to build `style` and `var` values.
|
|
1543
1552
|
*/
|
|
1544
|
-
|
|
1553
|
+
abstract build(renderState: RenderState, latestValues: ResolvedValues$1, props: MotionNodeOptions): void;
|
|
1545
1554
|
/**
|
|
1546
|
-
*
|
|
1555
|
+
* Apply the built values to the Instance. For example, HTMLElements will have
|
|
1556
|
+
* styles applied via `setProperty` and the style attribute, whereas SVGElements
|
|
1557
|
+
* will have values applied to attributes.
|
|
1547
1558
|
*/
|
|
1548
|
-
|
|
1559
|
+
abstract renderInstance(instance: Instance, renderState: RenderState, styleProp?: MotionStyle, projection?: any): void;
|
|
1549
1560
|
/**
|
|
1550
|
-
*
|
|
1561
|
+
* This method is called when a transform property is bound to a motion value.
|
|
1562
|
+
* It's currently used to measure SVG elements when a new transform property is bound.
|
|
1551
1563
|
*/
|
|
1552
|
-
|
|
1564
|
+
onBindTransform?(): void;
|
|
1553
1565
|
/**
|
|
1554
|
-
*
|
|
1566
|
+
* If the component child is provided as a motion value, handle subscriptions
|
|
1567
|
+
* with the renderer-specific VisualElement.
|
|
1555
1568
|
*/
|
|
1556
|
-
|
|
1569
|
+
handleChildMotionValue?(): void;
|
|
1557
1570
|
/**
|
|
1558
|
-
*
|
|
1571
|
+
* This method takes React props and returns found MotionValues. For example, HTML
|
|
1572
|
+
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
1559
1573
|
*
|
|
1560
|
-
* This
|
|
1574
|
+
* This isn't an abstract method as it needs calling in the constructor, but it is
|
|
1575
|
+
* intended to be one.
|
|
1561
1576
|
*/
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
}
|
|
1565
|
-
type AnimationPlaybackControlsWithThen = AnimationPlaybackControls & {
|
|
1566
|
-
then: (onResolve: VoidFunction, onReject?: VoidFunction) => Promise<void>;
|
|
1567
|
-
};
|
|
1568
|
-
interface AnimationState$1<V> {
|
|
1569
|
-
value: V;
|
|
1570
|
-
done: boolean;
|
|
1571
|
-
}
|
|
1572
|
-
interface KeyframeGenerator<V> {
|
|
1573
|
-
calculatedDuration: null | number;
|
|
1574
|
-
next: (t: number) => AnimationState$1<V>;
|
|
1575
|
-
velocity?: (t: number) => number;
|
|
1576
|
-
toString: () => string;
|
|
1577
|
-
}
|
|
1578
|
-
interface DOMValueAnimationOptions<V extends AnyResolvedKeyframe = number> extends ValueAnimationTransition<V> {
|
|
1579
|
-
element: HTMLElement | SVGElement;
|
|
1580
|
-
keyframes: ValueKeyframesDefinition;
|
|
1581
|
-
name: string;
|
|
1582
|
-
pseudoElement?: string;
|
|
1583
|
-
allowFlatten?: boolean;
|
|
1584
|
-
}
|
|
1585
|
-
interface ValueAnimationOptions<V extends AnyResolvedKeyframe = number> extends ValueAnimationTransition {
|
|
1586
|
-
keyframes: V[];
|
|
1587
|
-
element?: any;
|
|
1588
|
-
name?: string;
|
|
1589
|
-
motionValue?: MotionValue<V>;
|
|
1590
|
-
from?: any;
|
|
1591
|
-
isHandoff?: boolean;
|
|
1592
|
-
allowFlatten?: boolean;
|
|
1593
|
-
finalKeyframe?: V;
|
|
1594
|
-
}
|
|
1595
|
-
type GeneratorFactoryFunction = (options: ValueAnimationOptions<any>) => KeyframeGenerator<any>;
|
|
1596
|
-
interface GeneratorFactory extends GeneratorFactoryFunction {
|
|
1597
|
-
applyToOptions?: (options: Transition) => Transition;
|
|
1598
|
-
}
|
|
1599
|
-
type AnimationGeneratorName = "decay" | "spring" | "keyframes" | "tween" | "inertia";
|
|
1600
|
-
type AnimationGeneratorType = GeneratorFactory | AnimationGeneratorName | false;
|
|
1601
|
-
interface AnimationPlaybackLifecycles<V> {
|
|
1602
|
-
onUpdate?: (latest: V) => void;
|
|
1603
|
-
onPlay?: () => void;
|
|
1604
|
-
onComplete?: () => void;
|
|
1605
|
-
onRepeat?: () => void;
|
|
1606
|
-
onStop?: () => void;
|
|
1607
|
-
}
|
|
1608
|
-
interface ValueAnimationTransition<V = any> extends ValueTransition, AnimationPlaybackLifecycles<V> {
|
|
1609
|
-
isSync?: boolean;
|
|
1610
|
-
}
|
|
1611
|
-
type RepeatType = "loop" | "reverse" | "mirror";
|
|
1612
|
-
interface AnimationPlaybackOptions {
|
|
1577
|
+
scrapeMotionValuesFromProps(_props: MotionNodeOptions, _prevProps: MotionNodeOptions, _visualElement: VisualElement): {
|
|
1578
|
+
[key: string]: MotionValue | AnyResolvedKeyframe;
|
|
1579
|
+
};
|
|
1613
1580
|
/**
|
|
1614
|
-
*
|
|
1615
|
-
*
|
|
1616
|
-
* Without setting `repeatType`, this will loop the animation.
|
|
1617
|
-
*
|
|
1618
|
-
* @public
|
|
1581
|
+
* A reference to the current underlying Instance, e.g. a HTMLElement
|
|
1582
|
+
* or Three.Mesh etc.
|
|
1619
1583
|
*/
|
|
1620
|
-
|
|
1584
|
+
current: Instance | null;
|
|
1621
1585
|
/**
|
|
1622
|
-
*
|
|
1623
|
-
*
|
|
1624
|
-
* "loop": Repeats the animation from the start
|
|
1625
|
-
*
|
|
1626
|
-
* "reverse": Alternates between forward and backwards playback
|
|
1627
|
-
*
|
|
1628
|
-
* "mirror": Switches `from` and `to` alternately
|
|
1629
|
-
*
|
|
1630
|
-
* @public
|
|
1586
|
+
* A reference to the parent VisualElement (if exists).
|
|
1631
1587
|
*/
|
|
1632
|
-
|
|
1588
|
+
parent: VisualElement | undefined;
|
|
1633
1589
|
/**
|
|
1634
|
-
*
|
|
1635
|
-
* duration of the time to wait, in seconds, between each repetition.
|
|
1636
|
-
*
|
|
1637
|
-
* @public
|
|
1590
|
+
* A set containing references to this VisualElement's children.
|
|
1638
1591
|
*/
|
|
1639
|
-
|
|
1640
|
-
}
|
|
1641
|
-
interface VelocityOptions {
|
|
1642
|
-
velocity?: number;
|
|
1592
|
+
children: Set<VisualElement<unknown, unknown, {}>>;
|
|
1643
1593
|
/**
|
|
1644
|
-
*
|
|
1645
|
-
*
|
|
1646
|
-
*
|
|
1647
|
-
* @public
|
|
1594
|
+
* A set containing the latest children of this VisualElement. This is flushed
|
|
1595
|
+
* at the start of every commit. We use it to calculate the stagger delay
|
|
1596
|
+
* for newly-added children.
|
|
1648
1597
|
*/
|
|
1649
|
-
|
|
1598
|
+
enteringChildren?: Set<VisualElement>;
|
|
1650
1599
|
/**
|
|
1651
|
-
*
|
|
1652
|
-
* `restSpeed`. When animation ends, spring gets "snapped" to. Set to
|
|
1653
|
-
* `0.01` by default.
|
|
1654
|
-
*
|
|
1655
|
-
* @public
|
|
1600
|
+
* The depth of this VisualElement within the overall VisualElement tree.
|
|
1656
1601
|
*/
|
|
1657
|
-
|
|
1658
|
-
}
|
|
1659
|
-
interface DurationSpringOptions {
|
|
1602
|
+
depth: number;
|
|
1660
1603
|
/**
|
|
1661
|
-
* The
|
|
1662
|
-
*
|
|
1663
|
-
* @public
|
|
1604
|
+
* The current render state of this VisualElement. Defined by inherting VisualElements.
|
|
1664
1605
|
*/
|
|
1665
|
-
|
|
1606
|
+
renderState: RenderState;
|
|
1666
1607
|
/**
|
|
1667
|
-
*
|
|
1668
|
-
*
|
|
1669
|
-
* The visual duration is a time, set in seconds, that the animation will take to visually appear to reach its target.
|
|
1670
|
-
*
|
|
1671
|
-
* In other words, the bulk of the transition will occur before this time, and the "bouncy bit" will mostly happen after.
|
|
1672
|
-
*
|
|
1673
|
-
* This makes it easier to edit a spring, as well as visually coordinate it with other time-based animations.
|
|
1674
|
-
*
|
|
1675
|
-
* @public
|
|
1608
|
+
* An object containing the latest static values for each of this VisualElement's
|
|
1609
|
+
* MotionValues.
|
|
1676
1610
|
*/
|
|
1677
|
-
|
|
1611
|
+
latestValues: ResolvedValues$1;
|
|
1678
1612
|
/**
|
|
1679
|
-
*
|
|
1680
|
-
*
|
|
1681
|
-
* `0` is no bounce, and `1` is extremely bouncy.
|
|
1682
|
-
*
|
|
1683
|
-
* If `duration` is set, this defaults to `0.25`.
|
|
1684
|
-
*
|
|
1685
|
-
* Note: `bounce` and `duration` will be overridden if `stiffness`, `damping` or `mass` are set.
|
|
1686
|
-
*
|
|
1687
|
-
* @public
|
|
1613
|
+
* Determine what role this visual element should take in the variant tree.
|
|
1688
1614
|
*/
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
interface SpringOptions extends DurationSpringOptions, VelocityOptions {
|
|
1615
|
+
isVariantNode: boolean;
|
|
1616
|
+
isControllingVariants: boolean;
|
|
1692
1617
|
/**
|
|
1693
|
-
*
|
|
1694
|
-
*
|
|
1695
|
-
*
|
|
1696
|
-
* @public
|
|
1618
|
+
* If this component is part of the variant tree, it should track
|
|
1619
|
+
* any children that are also part of the tree. This is essentially
|
|
1620
|
+
* a shadow tree to simplify logic around how to stagger over children.
|
|
1697
1621
|
*/
|
|
1698
|
-
|
|
1622
|
+
variantChildren?: Set<VisualElement>;
|
|
1699
1623
|
/**
|
|
1700
|
-
*
|
|
1701
|
-
*
|
|
1624
|
+
* Decides whether this VisualElement should animate in reduced motion
|
|
1625
|
+
* mode.
|
|
1702
1626
|
*
|
|
1703
|
-
*
|
|
1627
|
+
* TODO: This is currently set on every individual VisualElement but feels
|
|
1628
|
+
* like it could be set globally.
|
|
1704
1629
|
*/
|
|
1705
|
-
|
|
1630
|
+
shouldReduceMotion: boolean | null;
|
|
1706
1631
|
/**
|
|
1707
|
-
*
|
|
1708
|
-
*
|
|
1709
|
-
*
|
|
1710
|
-
* @public
|
|
1632
|
+
* Decides whether animations should be skipped for this VisualElement.
|
|
1633
|
+
* Useful for E2E tests and visual regression testing.
|
|
1711
1634
|
*/
|
|
1712
|
-
|
|
1713
|
-
}
|
|
1714
|
-
/**
|
|
1715
|
-
* @deprecated Use SpringOptions instead
|
|
1716
|
-
*/
|
|
1717
|
-
interface Spring extends SpringOptions {
|
|
1718
|
-
}
|
|
1719
|
-
interface DecayOptions extends VelocityOptions {
|
|
1720
|
-
keyframes?: number[];
|
|
1635
|
+
shouldSkipAnimations: boolean;
|
|
1721
1636
|
/**
|
|
1722
|
-
*
|
|
1637
|
+
* Normally, if a component is controlled by a parent's variants, it can
|
|
1638
|
+
* rely on that ancestor to trigger animations further down the tree.
|
|
1639
|
+
* However, if a component is created after its parent is mounted, the parent
|
|
1640
|
+
* won't trigger that mount animation so the child needs to.
|
|
1723
1641
|
*
|
|
1724
|
-
*
|
|
1642
|
+
* TODO: This might be better replaced with a method isParentMounted
|
|
1725
1643
|
*/
|
|
1726
|
-
|
|
1644
|
+
manuallyAnimateOnMount: boolean;
|
|
1727
1645
|
/**
|
|
1728
|
-
*
|
|
1729
|
-
*
|
|
1730
|
-
*
|
|
1731
|
-
* @public
|
|
1646
|
+
* This can be set by AnimatePresence to force components that mount
|
|
1647
|
+
* at the same time as it to mount as if they have initial={false} set.
|
|
1732
1648
|
*/
|
|
1733
|
-
|
|
1649
|
+
blockInitialAnimation: boolean;
|
|
1734
1650
|
/**
|
|
1735
|
-
* A
|
|
1736
|
-
*
|
|
1737
|
-
* @public
|
|
1651
|
+
* A reference to this VisualElement's projection node, used in layout animations.
|
|
1738
1652
|
*/
|
|
1739
|
-
|
|
1740
|
-
}
|
|
1741
|
-
interface InertiaOptions extends DecayOptions {
|
|
1653
|
+
projection?: any;
|
|
1742
1654
|
/**
|
|
1743
|
-
*
|
|
1744
|
-
*
|
|
1745
|
-
*
|
|
1746
|
-
*
|
|
1747
|
-
* @public
|
|
1655
|
+
* A map of all motion values attached to this visual element. Motion
|
|
1656
|
+
* values are source of truth for any given animated value. A motion
|
|
1657
|
+
* value might be provided externally by the component via props.
|
|
1748
1658
|
*/
|
|
1749
|
-
|
|
1659
|
+
values: Map<string, MotionValue<any>>;
|
|
1750
1660
|
/**
|
|
1751
|
-
*
|
|
1752
|
-
* If set to `0`, spring will oscillate indefinitely. Set to `10` by
|
|
1753
|
-
* default.
|
|
1754
|
-
*
|
|
1755
|
-
* @public
|
|
1661
|
+
* The AnimationState, this is hydrated by the animation Feature.
|
|
1756
1662
|
*/
|
|
1757
|
-
|
|
1663
|
+
animationState?: AnimationState$1;
|
|
1664
|
+
KeyframeResolver: typeof KeyframeResolver;
|
|
1758
1665
|
/**
|
|
1759
|
-
*
|
|
1760
|
-
*
|
|
1761
|
-
* @public
|
|
1666
|
+
* The options used to create this VisualElement. The Options type is defined
|
|
1667
|
+
* by the inheriting VisualElement and is passed straight through to the render functions.
|
|
1762
1668
|
*/
|
|
1763
|
-
|
|
1669
|
+
readonly options: Options;
|
|
1764
1670
|
/**
|
|
1765
|
-
*
|
|
1766
|
-
*
|
|
1767
|
-
* @public
|
|
1671
|
+
* A reference to the latest props provided to the VisualElement's host React component.
|
|
1768
1672
|
*/
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1673
|
+
props: MotionNodeOptions;
|
|
1674
|
+
prevProps?: MotionNodeOptions;
|
|
1675
|
+
presenceContext: PresenceContextProps | null;
|
|
1676
|
+
prevPresenceContext?: PresenceContextProps | null;
|
|
1772
1677
|
/**
|
|
1773
|
-
*
|
|
1774
|
-
*
|
|
1775
|
-
* @public
|
|
1678
|
+
* Cleanup functions for active features (hover/tap/exit etc)
|
|
1776
1679
|
*/
|
|
1777
|
-
|
|
1680
|
+
private features;
|
|
1778
1681
|
/**
|
|
1779
|
-
*
|
|
1780
|
-
* to
|
|
1781
|
-
*
|
|
1782
|
-
* @remarks
|
|
1783
|
-
* When using variants, the transition can be scheduled in relation to its
|
|
1784
|
-
* children with either `"beforeChildren"` to finish this transition before
|
|
1785
|
-
* starting children transitions, `"afterChildren"` to finish children
|
|
1786
|
-
* transitions before starting this transition.
|
|
1787
|
-
*
|
|
1788
|
-
* @public
|
|
1682
|
+
* A map of every subscription that binds the provided or generated
|
|
1683
|
+
* motion values onChange listeners to this visual element.
|
|
1789
1684
|
*/
|
|
1790
|
-
|
|
1685
|
+
private valueSubscriptions;
|
|
1791
1686
|
/**
|
|
1792
|
-
*
|
|
1793
|
-
* (in seconds). You can add the `transition` property to both the `motion.div` and the
|
|
1794
|
-
* `variant` directly. Adding it to the `variant` generally offers more flexibility,
|
|
1795
|
-
* as it allows you to customize the delay per visual state.
|
|
1796
|
-
*
|
|
1797
|
-
* @public
|
|
1687
|
+
* A reference to the ReducedMotionConfig passed to the VisualElement's host React component.
|
|
1798
1688
|
*/
|
|
1799
|
-
|
|
1689
|
+
private reducedMotionConfig;
|
|
1800
1690
|
/**
|
|
1801
|
-
*
|
|
1802
|
-
* duration (in seconds).
|
|
1803
|
-
*
|
|
1804
|
-
* For instance, if `staggerChildren` is `0.01`, the first child will be
|
|
1805
|
-
* delayed by `0` seconds, the second by `0.01`, the third by `0.02` and so
|
|
1806
|
-
* on.
|
|
1807
|
-
*
|
|
1808
|
-
* The calculated stagger delay will be added to `delayChildren`.
|
|
1809
|
-
*
|
|
1810
|
-
* @deprecated - Use `delayChildren: stagger(interval)` instead.
|
|
1691
|
+
* A reference to the skipAnimations config passed to the VisualElement's host React component.
|
|
1811
1692
|
*/
|
|
1812
|
-
|
|
1693
|
+
private skipAnimationsConfig;
|
|
1813
1694
|
/**
|
|
1814
|
-
*
|
|
1815
|
-
*
|
|
1816
|
-
* A value of `1` staggers from the first to the last while `-1`
|
|
1817
|
-
* staggers from the last to the first.
|
|
1818
|
-
*
|
|
1819
|
-
* @deprecated - Use `delayChildren: stagger(interval, { from: "last" })` instead.
|
|
1695
|
+
* On mount, this will be hydrated with a callback to disconnect
|
|
1696
|
+
* this visual element from its parent on unmount.
|
|
1820
1697
|
*/
|
|
1821
|
-
|
|
1822
|
-
}
|
|
1823
|
-
interface KeyframeOptions {
|
|
1698
|
+
private removeFromVariantTree;
|
|
1824
1699
|
/**
|
|
1825
|
-
*
|
|
1826
|
-
*
|
|
1827
|
-
*
|
|
1700
|
+
* A reference to the previously-provided motion values as returned
|
|
1701
|
+
* from scrapeMotionValuesFromProps. We use the keys in here to determine
|
|
1702
|
+
* if any motion values need to be removed after props are updated.
|
|
1828
1703
|
*/
|
|
1829
|
-
|
|
1830
|
-
ease?: Easing | Easing[];
|
|
1831
|
-
times?: number[];
|
|
1832
|
-
}
|
|
1833
|
-
interface ValueTransition extends AnimationOrchestrationOptions, AnimationPlaybackOptions, Omit<SpringOptions, "keyframes">, Omit<InertiaOptions, "keyframes">, KeyframeOptions {
|
|
1704
|
+
private prevMotionValues;
|
|
1834
1705
|
/**
|
|
1835
|
-
*
|
|
1836
|
-
*
|
|
1837
|
-
* @public
|
|
1706
|
+
* When values are removed from all animation props we need to search
|
|
1707
|
+
* for a fallback value to animate to. These values are tracked in baseTarget.
|
|
1838
1708
|
*/
|
|
1839
|
-
|
|
1709
|
+
private baseTarget;
|
|
1840
1710
|
/**
|
|
1841
|
-
*
|
|
1842
|
-
* default.
|
|
1711
|
+
* Create an object of the values we initially animated from (if initial prop present).
|
|
1843
1712
|
*/
|
|
1844
|
-
|
|
1845
|
-
driver?: Driver;
|
|
1713
|
+
private initialValues;
|
|
1846
1714
|
/**
|
|
1847
|
-
*
|
|
1848
|
-
*
|
|
1849
|
-
* - "tween": Duration-based animation with ease curve
|
|
1850
|
-
* - "spring": Physics or duration-based spring animation
|
|
1851
|
-
* - false: Use an instant animation
|
|
1715
|
+
* Track whether this element has been mounted before, to detect
|
|
1716
|
+
* remounts after Suspense unmount/remount cycles.
|
|
1852
1717
|
*/
|
|
1853
|
-
|
|
1718
|
+
private hasBeenMounted;
|
|
1854
1719
|
/**
|
|
1855
|
-
*
|
|
1856
|
-
*
|
|
1857
|
-
* @public
|
|
1720
|
+
* An object containing a SubscriptionManager for each active event.
|
|
1858
1721
|
*/
|
|
1859
|
-
|
|
1860
|
-
autoplay?: boolean;
|
|
1861
|
-
startTime?: number;
|
|
1862
|
-
from?: any;
|
|
1722
|
+
private events;
|
|
1863
1723
|
/**
|
|
1864
|
-
*
|
|
1865
|
-
*
|
|
1866
|
-
*
|
|
1867
|
-
* @public
|
|
1724
|
+
* An object containing an unsubscribe function for each prop event subscription.
|
|
1725
|
+
* For example, every "Update" event can have multiple subscribers via
|
|
1726
|
+
* VisualElement.on(), but only one of those can be defined via the onUpdate prop.
|
|
1868
1727
|
*/
|
|
1869
|
-
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
[K in keyof Omit<SVGAttributes, "from">]: ValueTransition;
|
|
1884
|
-
};
|
|
1885
|
-
interface VariableTransitions {
|
|
1886
|
-
[key: `--${string}`]: ValueTransition;
|
|
1887
|
-
}
|
|
1888
|
-
type StyleTransitions = {
|
|
1889
|
-
[K in keyof CSSStyleDeclarationWithTransform]?: ValueTransition;
|
|
1890
|
-
};
|
|
1891
|
-
type ValueKeyframe<T extends AnyResolvedKeyframe = AnyResolvedKeyframe> = T;
|
|
1892
|
-
type UnresolvedValueKeyframe<T extends AnyResolvedKeyframe = AnyResolvedKeyframe> = ValueKeyframe<T> | null;
|
|
1893
|
-
type ResolvedValueKeyframe = ValueKeyframe | ValueKeyframe[];
|
|
1894
|
-
type ValueKeyframesDefinition = ValueKeyframe | ValueKeyframe[] | UnresolvedValueKeyframe[];
|
|
1895
|
-
type StyleKeyframesDefinition = {
|
|
1896
|
-
[K in keyof CSSStyleDeclarationWithTransform]?: ValueKeyframesDefinition;
|
|
1897
|
-
};
|
|
1898
|
-
type SVGKeyframesDefinition = {
|
|
1899
|
-
[K in keyof Omit<SVGAttributes, "from">]?: ValueKeyframesDefinition;
|
|
1900
|
-
};
|
|
1901
|
-
interface VariableKeyframesDefinition {
|
|
1902
|
-
[key: `--${string}`]: ValueKeyframesDefinition;
|
|
1903
|
-
}
|
|
1904
|
-
type SVGForcedAttrKeyframesDefinition = {
|
|
1905
|
-
[K in keyof SVGForcedAttrProperties]?: ValueKeyframesDefinition;
|
|
1906
|
-
};
|
|
1907
|
-
type SVGPathKeyframesDefinition = {
|
|
1908
|
-
[K in keyof SVGPathProperties]?: ValueKeyframesDefinition;
|
|
1909
|
-
};
|
|
1910
|
-
type DOMKeyframesDefinition = StyleKeyframesDefinition & SVGKeyframesDefinition & SVGPathKeyframesDefinition & SVGForcedAttrKeyframesDefinition & VariableKeyframesDefinition;
|
|
1911
|
-
interface Target extends DOMKeyframesDefinition {
|
|
1912
|
-
}
|
|
1913
|
-
type CSSPropertyKeys = {
|
|
1914
|
-
[K in keyof CSSStyleDeclaration as K extends string ? CSSStyleDeclaration[K] extends AnyResolvedKeyframe ? K : never : never]: CSSStyleDeclaration[K];
|
|
1915
|
-
};
|
|
1916
|
-
interface CSSStyleDeclarationWithTransform extends Omit<CSSPropertyKeys, "direction" | "transition" | "x" | "y" | "z"> {
|
|
1917
|
-
x: number | string;
|
|
1918
|
-
y: number | string;
|
|
1919
|
-
z: number | string;
|
|
1920
|
-
originX: number;
|
|
1921
|
-
originY: number;
|
|
1922
|
-
originZ: number;
|
|
1923
|
-
translateX: number | string;
|
|
1924
|
-
translateY: number | string;
|
|
1925
|
-
translateZ: number | string;
|
|
1926
|
-
rotateX: number | string;
|
|
1927
|
-
rotateY: number | string;
|
|
1928
|
-
rotateZ: number | string;
|
|
1929
|
-
scaleX: number;
|
|
1930
|
-
scaleY: number;
|
|
1931
|
-
scaleZ: number;
|
|
1932
|
-
skewX: number | string;
|
|
1933
|
-
skewY: number | string;
|
|
1934
|
-
transformPerspective: number;
|
|
1935
|
-
}
|
|
1936
|
-
type TransitionWithValueOverrides<V> = ValueAnimationTransition<V> & StyleTransitions & SVGPathTransitions & SVGForcedAttrTransitions & SVGTransitions & VariableTransitions & {
|
|
1937
|
-
default?: ValueTransition;
|
|
1938
|
-
layout?: ValueTransition;
|
|
1939
|
-
};
|
|
1940
|
-
type Transition<V = any> = ValueAnimationTransition<V> | TransitionWithValueOverrides<V>;
|
|
1941
|
-
type DynamicOption<T> = (i: number, total: number) => T;
|
|
1942
|
-
type ValueAnimationWithDynamicDelay = Omit<ValueAnimationTransition<any>, "delay"> & {
|
|
1943
|
-
delay?: number | DynamicOption<number>;
|
|
1944
|
-
};
|
|
1945
|
-
interface ReduceMotionOption {
|
|
1728
|
+
private propEventSubscriptions;
|
|
1729
|
+
constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }: VisualElementOptions<Instance, RenderState>, options?: Options);
|
|
1730
|
+
mount(instance: Instance): void;
|
|
1731
|
+
unmount(): void;
|
|
1732
|
+
addChild(child: VisualElement): void;
|
|
1733
|
+
removeChild(child: VisualElement): void;
|
|
1734
|
+
private bindToMotionValue;
|
|
1735
|
+
sortNodePosition(other: VisualElement<Instance>): number;
|
|
1736
|
+
updateFeatures(): void;
|
|
1737
|
+
notifyUpdate: () => void;
|
|
1738
|
+
triggerBuild(): void;
|
|
1739
|
+
render: () => void;
|
|
1740
|
+
private renderScheduledAt;
|
|
1741
|
+
scheduleRender: () => void;
|
|
1946
1742
|
/**
|
|
1947
|
-
*
|
|
1948
|
-
*
|
|
1949
|
-
*
|
|
1950
|
-
* - `false`: Always animate transforms/layout
|
|
1951
|
-
* - `undefined`: Use device preference (default behavior)
|
|
1743
|
+
* Measure the current viewport box with or without transforms.
|
|
1744
|
+
* Only measures axis-aligned boxes, rotate and skew must be manually
|
|
1745
|
+
* removed with a re-render to work.
|
|
1952
1746
|
*/
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1747
|
+
measureViewportBox(): Box;
|
|
1748
|
+
getStaticValue(key: string): AnyResolvedKeyframe;
|
|
1749
|
+
setStaticValue(key: string, value: AnyResolvedKeyframe): void;
|
|
1750
|
+
/**
|
|
1751
|
+
* Update the provided props. Ensure any newly-added motion values are
|
|
1752
|
+
* added to our map, old ones removed, and listeners updated.
|
|
1753
|
+
*/
|
|
1754
|
+
update(props: MotionNodeOptions, presenceContext: PresenceContextProps | null): void;
|
|
1755
|
+
getProps(): MotionNodeOptions;
|
|
1756
|
+
/**
|
|
1757
|
+
* Returns the variant definition with a given name.
|
|
1758
|
+
*/
|
|
1759
|
+
getVariant(name: string): Variant | undefined;
|
|
1760
|
+
/**
|
|
1761
|
+
* Returns the defined default transition on this component.
|
|
1762
|
+
*/
|
|
1763
|
+
getDefaultTransition(): Transition | undefined;
|
|
1764
|
+
getTransformPagePoint(): any;
|
|
1765
|
+
getClosestVariantNode(): VisualElement | undefined;
|
|
1766
|
+
/**
|
|
1767
|
+
* Add a child visual element to our set of children.
|
|
1768
|
+
*/
|
|
1769
|
+
addVariantChild(child: VisualElement): (() => boolean) | undefined;
|
|
1770
|
+
/**
|
|
1771
|
+
* Add a motion value and bind it to this visual element.
|
|
1772
|
+
*/
|
|
1773
|
+
addValue(key: string, value: MotionValue): void;
|
|
1774
|
+
/**
|
|
1775
|
+
* Remove a motion value and unbind any active subscriptions.
|
|
1776
|
+
*/
|
|
1777
|
+
removeValue(key: string): void;
|
|
1778
|
+
/**
|
|
1779
|
+
* Check whether we have a motion value for this key
|
|
1780
|
+
*/
|
|
1781
|
+
hasValue(key: string): boolean;
|
|
1782
|
+
/**
|
|
1783
|
+
* Get a motion value for this key. If called with a default
|
|
1784
|
+
* value, we'll create one if none exists.
|
|
1785
|
+
*/
|
|
1786
|
+
getValue(key: string): MotionValue | undefined;
|
|
1787
|
+
getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue;
|
|
1788
|
+
/**
|
|
1789
|
+
* If we're trying to animate to a previously unencountered value,
|
|
1790
|
+
* we need to check for it in our state and as a last resort read it
|
|
1791
|
+
* directly from the instance (which might have performance implications).
|
|
1792
|
+
*/
|
|
1793
|
+
readValue(key: string, target?: AnyResolvedKeyframe | null): any;
|
|
1794
|
+
/**
|
|
1795
|
+
* Set the base target to later animate back to. This is currently
|
|
1796
|
+
* only hydrated on creation and when we first read a value.
|
|
1797
|
+
*/
|
|
1798
|
+
setBaseTarget(key: string, value: AnyResolvedKeyframe): void;
|
|
1799
|
+
/**
|
|
1800
|
+
* Find the base target for a value thats been removed from all animation
|
|
1801
|
+
* props.
|
|
1802
|
+
*/
|
|
1803
|
+
getBaseTarget(key: string): ResolvedValues$1[string] | undefined | null;
|
|
1804
|
+
on<EventName extends keyof VisualElementEventCallbacks>(eventName: EventName, callback: VisualElementEventCallbacks[EventName]): VoidFunction;
|
|
1805
|
+
notify<EventName extends keyof VisualElementEventCallbacks>(eventName: EventName, ...args: any): void;
|
|
1806
|
+
scheduleRenderMicrotask(): void;
|
|
1992
1807
|
}
|
|
1993
1808
|
|
|
1994
1809
|
/**
|
|
1995
|
-
*
|
|
1810
|
+
* An update function. It accepts a timestamp used to advance the animation.
|
|
1996
1811
|
*/
|
|
1997
|
-
type
|
|
1812
|
+
type Update$1 = (timestamp: number) => void;
|
|
1998
1813
|
/**
|
|
1999
|
-
*
|
|
1814
|
+
* Drivers accept a update function and call it at an interval. This interval
|
|
1815
|
+
* could be a synchronous loop, a setInterval, or tied to the device's framerate.
|
|
2000
1816
|
*/
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
animationComplete: () => void;
|
|
2006
|
-
animationCancel: () => void;
|
|
2007
|
-
change: (latestValue: V) => void;
|
|
2008
|
-
destroy: () => void;
|
|
1817
|
+
interface DriverControls {
|
|
1818
|
+
start: (keepAlive?: boolean) => void;
|
|
1819
|
+
stop: () => void;
|
|
1820
|
+
now: () => number;
|
|
2009
1821
|
}
|
|
2010
|
-
|
|
2011
|
-
|
|
1822
|
+
type Driver = (update: Update$1) => DriverControls;
|
|
1823
|
+
|
|
1824
|
+
/**
|
|
1825
|
+
* Temporary subset of VisualElement until VisualElement is
|
|
1826
|
+
* moved to motion-dom
|
|
1827
|
+
*/
|
|
1828
|
+
interface WithRender {
|
|
1829
|
+
render: () => void;
|
|
1830
|
+
readValue: (name: string, keyframe: any) => any;
|
|
1831
|
+
getValue: (name: string, defaultValue?: any) => any;
|
|
1832
|
+
current?: HTMLElement | SVGElement;
|
|
1833
|
+
measureViewportBox: () => Box;
|
|
2012
1834
|
}
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
1835
|
+
|
|
1836
|
+
type AnyResolvedKeyframe = string | number;
|
|
1837
|
+
interface ProgressTimeline {
|
|
1838
|
+
currentTime: null | {
|
|
1839
|
+
value: number;
|
|
2018
1840
|
};
|
|
1841
|
+
cancel?: VoidFunction;
|
|
2019
1842
|
}
|
|
2020
|
-
interface
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
ease?: EasingFunction | EasingFunction[];
|
|
2025
|
-
duration: number;
|
|
2026
|
-
isTransformed?: boolean;
|
|
1843
|
+
interface ValueAnimationOptionsWithRenderContext<V extends AnyResolvedKeyframe = number> extends ValueAnimationOptions<V> {
|
|
1844
|
+
KeyframeResolver?: typeof KeyframeResolver;
|
|
1845
|
+
motionValue?: MotionValue<V>;
|
|
1846
|
+
element?: WithRender;
|
|
2027
1847
|
}
|
|
2028
|
-
interface
|
|
2029
|
-
|
|
1848
|
+
interface TimelineWithFallback {
|
|
1849
|
+
timeline?: ProgressTimeline;
|
|
1850
|
+
rangeStart?: string;
|
|
1851
|
+
rangeEnd?: string;
|
|
1852
|
+
observe: (animation: AnimationPlaybackControls) => VoidFunction;
|
|
2030
1853
|
}
|
|
2031
|
-
declare const collectMotionValues: {
|
|
2032
|
-
current: MotionValue[] | undefined;
|
|
2033
|
-
};
|
|
2034
1854
|
/**
|
|
2035
|
-
*
|
|
2036
|
-
*
|
|
2037
|
-
* @public
|
|
1855
|
+
* Methods to control an animation.
|
|
2038
1856
|
*/
|
|
2039
|
-
|
|
1857
|
+
interface AnimationPlaybackControls {
|
|
2040
1858
|
/**
|
|
2041
|
-
*
|
|
2042
|
-
* and therefore has no external listeners. It is therefore safe to animate via WAAPI.
|
|
1859
|
+
* The current time of the animation, in seconds.
|
|
2043
1860
|
*/
|
|
2044
|
-
|
|
1861
|
+
time: number;
|
|
2045
1862
|
/**
|
|
2046
|
-
* The
|
|
1863
|
+
* The playback speed of the animation.
|
|
1864
|
+
* 1 = normal speed, 2 = double speed, 0.5 = half speed.
|
|
2047
1865
|
*/
|
|
2048
|
-
|
|
1866
|
+
speed: number;
|
|
2049
1867
|
/**
|
|
2050
|
-
* The
|
|
1868
|
+
* The start time of the animation, in milliseconds.
|
|
2051
1869
|
*/
|
|
2052
|
-
|
|
1870
|
+
startTime: number | null;
|
|
2053
1871
|
/**
|
|
2054
|
-
* The
|
|
1872
|
+
* The state of the animation.
|
|
1873
|
+
*
|
|
1874
|
+
* This is currently for internal use only.
|
|
2055
1875
|
*/
|
|
2056
|
-
|
|
1876
|
+
state: AnimationPlayState;
|
|
1877
|
+
duration: number;
|
|
2057
1878
|
/**
|
|
2058
|
-
* The
|
|
1879
|
+
* The duration of the animation, including any delay.
|
|
2059
1880
|
*/
|
|
2060
|
-
|
|
1881
|
+
iterationDuration: number;
|
|
2061
1882
|
/**
|
|
2062
|
-
*
|
|
1883
|
+
* Stops the animation at its current state, and prevents it from
|
|
1884
|
+
* resuming when the animation is played again.
|
|
2063
1885
|
*/
|
|
2064
|
-
|
|
2065
|
-
private stopPassiveEffect?;
|
|
1886
|
+
stop: () => void;
|
|
2066
1887
|
/**
|
|
2067
|
-
*
|
|
1888
|
+
* Plays the animation.
|
|
2068
1889
|
*/
|
|
2069
|
-
|
|
1890
|
+
play: () => void;
|
|
2070
1891
|
/**
|
|
2071
|
-
*
|
|
1892
|
+
* Pauses the animation.
|
|
2072
1893
|
*/
|
|
2073
|
-
|
|
1894
|
+
pause: () => void;
|
|
2074
1895
|
/**
|
|
2075
|
-
*
|
|
2076
|
-
* This is a rough start to a proper signal-like dirtying system.
|
|
1896
|
+
* Completes the animation and applies the final state.
|
|
2077
1897
|
*/
|
|
2078
|
-
|
|
1898
|
+
complete: () => void;
|
|
2079
1899
|
/**
|
|
2080
|
-
*
|
|
1900
|
+
* Cancels the animation and applies the initial state.
|
|
2081
1901
|
*/
|
|
2082
|
-
|
|
1902
|
+
cancel: () => void;
|
|
2083
1903
|
/**
|
|
2084
|
-
*
|
|
2085
|
-
*
|
|
2086
|
-
*
|
|
1904
|
+
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
1905
|
+
*
|
|
1906
|
+
* This is currently for internal use only.
|
|
2087
1907
|
*/
|
|
2088
|
-
|
|
1908
|
+
attachTimeline: (timeline: TimelineWithFallback) => VoidFunction;
|
|
1909
|
+
finished: Promise<any>;
|
|
1910
|
+
}
|
|
1911
|
+
type AnimationPlaybackControlsWithThen = AnimationPlaybackControls & {
|
|
1912
|
+
then: (onResolve: VoidFunction, onReject?: VoidFunction) => Promise<void>;
|
|
1913
|
+
};
|
|
1914
|
+
interface AnimationState<V> {
|
|
1915
|
+
value: V;
|
|
1916
|
+
done: boolean;
|
|
1917
|
+
}
|
|
1918
|
+
interface KeyframeGenerator<V> {
|
|
1919
|
+
calculatedDuration: null | number;
|
|
1920
|
+
next: (t: number) => AnimationState<V>;
|
|
1921
|
+
velocity?: (t: number) => number;
|
|
1922
|
+
toString: () => string;
|
|
1923
|
+
}
|
|
1924
|
+
interface DOMValueAnimationOptions<V extends AnyResolvedKeyframe = number> extends ValueAnimationTransition<V> {
|
|
1925
|
+
element: HTMLElement | SVGElement;
|
|
1926
|
+
keyframes: ValueKeyframesDefinition;
|
|
1927
|
+
name: string;
|
|
1928
|
+
pseudoElement?: string;
|
|
1929
|
+
allowFlatten?: boolean;
|
|
1930
|
+
}
|
|
1931
|
+
interface ValueAnimationOptions<V extends AnyResolvedKeyframe = number> extends ValueAnimationTransition {
|
|
1932
|
+
keyframes: V[];
|
|
1933
|
+
element?: any;
|
|
1934
|
+
name?: string;
|
|
1935
|
+
motionValue?: MotionValue<V>;
|
|
1936
|
+
from?: any;
|
|
1937
|
+
isHandoff?: boolean;
|
|
1938
|
+
allowFlatten?: boolean;
|
|
1939
|
+
finalKeyframe?: V;
|
|
1940
|
+
}
|
|
1941
|
+
type GeneratorFactoryFunction = (options: ValueAnimationOptions<any>) => KeyframeGenerator<any>;
|
|
1942
|
+
interface GeneratorFactory extends GeneratorFactoryFunction {
|
|
1943
|
+
applyToOptions?: (options: Transition) => Transition;
|
|
1944
|
+
}
|
|
1945
|
+
type AnimationGeneratorName = "decay" | "spring" | "keyframes" | "tween" | "inertia";
|
|
1946
|
+
type AnimationGeneratorType = GeneratorFactory | AnimationGeneratorName | false;
|
|
1947
|
+
interface AnimationPlaybackLifecycles<V> {
|
|
1948
|
+
onUpdate?: (latest: V) => void;
|
|
1949
|
+
onPlay?: () => void;
|
|
1950
|
+
onComplete?: () => void;
|
|
1951
|
+
onRepeat?: () => void;
|
|
1952
|
+
onStop?: () => void;
|
|
1953
|
+
}
|
|
1954
|
+
interface ValueAnimationTransition<V = any> extends ValueTransition, AnimationPlaybackLifecycles<V> {
|
|
1955
|
+
isSync?: boolean;
|
|
1956
|
+
}
|
|
1957
|
+
type RepeatType = "loop" | "reverse" | "mirror";
|
|
1958
|
+
interface AnimationPlaybackOptions {
|
|
2089
1959
|
/**
|
|
2090
|
-
*
|
|
2091
|
-
* @param config - Optional configuration options
|
|
1960
|
+
* The number of times to repeat the transition. Set to `Infinity` for perpetual repeating.
|
|
2092
1961
|
*
|
|
2093
|
-
*
|
|
1962
|
+
* Without setting `repeatType`, this will loop the animation.
|
|
1963
|
+
*
|
|
1964
|
+
* @public
|
|
2094
1965
|
*/
|
|
2095
|
-
|
|
2096
|
-
setCurrent(current: V): void;
|
|
2097
|
-
setPrevFrameValue(prevFrameValue?: V | undefined): void;
|
|
1966
|
+
repeat?: number;
|
|
2098
1967
|
/**
|
|
2099
|
-
*
|
|
2100
|
-
*
|
|
2101
|
-
* It returns a function that, when called, will cancel the subscription.
|
|
2102
|
-
*
|
|
2103
|
-
* When calling `onChange` inside a React component, it should be wrapped with the
|
|
2104
|
-
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
|
|
2105
|
-
* from the `useEffect` function to ensure you don't add duplicate subscribers..
|
|
2106
|
-
*
|
|
2107
|
-
* ```jsx
|
|
2108
|
-
* export const MyComponent = () => {
|
|
2109
|
-
* const x = useMotionValue(0)
|
|
2110
|
-
* const y = useMotionValue(0)
|
|
2111
|
-
* const opacity = useMotionValue(1)
|
|
1968
|
+
* How to repeat the animation. This can be either:
|
|
2112
1969
|
*
|
|
2113
|
-
*
|
|
2114
|
-
* function updateOpacity() {
|
|
2115
|
-
* const maxXY = Math.max(x.get(), y.get())
|
|
2116
|
-
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
|
|
2117
|
-
* opacity.set(newOpacity)
|
|
2118
|
-
* }
|
|
1970
|
+
* "loop": Repeats the animation from the start
|
|
2119
1971
|
*
|
|
2120
|
-
*
|
|
2121
|
-
* const unsubscribeY = y.on("change", updateOpacity)
|
|
1972
|
+
* "reverse": Alternates between forward and backwards playback
|
|
2122
1973
|
*
|
|
2123
|
-
*
|
|
2124
|
-
* unsubscribeX()
|
|
2125
|
-
* unsubscribeY()
|
|
2126
|
-
* }
|
|
2127
|
-
* }, [])
|
|
1974
|
+
* "mirror": Switches `from` and `to` alternately
|
|
2128
1975
|
*
|
|
2129
|
-
*
|
|
2130
|
-
|
|
2131
|
-
|
|
1976
|
+
* @public
|
|
1977
|
+
*/
|
|
1978
|
+
repeatType?: RepeatType;
|
|
1979
|
+
/**
|
|
1980
|
+
* When repeating an animation, `repeatDelay` will set the
|
|
1981
|
+
* duration of the time to wait, in seconds, between each repetition.
|
|
2132
1982
|
*
|
|
2133
|
-
* @
|
|
2134
|
-
|
|
1983
|
+
* @public
|
|
1984
|
+
*/
|
|
1985
|
+
repeatDelay?: number;
|
|
1986
|
+
}
|
|
1987
|
+
interface VelocityOptions {
|
|
1988
|
+
velocity?: number;
|
|
1989
|
+
/**
|
|
1990
|
+
* End animation if absolute speed (in units per second) drops below this
|
|
1991
|
+
* value and delta is smaller than `restDelta`. Set to `0.01` by default.
|
|
2135
1992
|
*
|
|
2136
|
-
* @
|
|
1993
|
+
* @public
|
|
2137
1994
|
*/
|
|
2138
|
-
|
|
1995
|
+
restSpeed?: number;
|
|
2139
1996
|
/**
|
|
2140
|
-
*
|
|
1997
|
+
* End animation if distance is below this value and speed is below
|
|
1998
|
+
* `restSpeed`. When animation ends, spring gets "snapped" to. Set to
|
|
1999
|
+
* `0.01` by default.
|
|
2000
|
+
*
|
|
2001
|
+
* @public
|
|
2141
2002
|
*/
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2003
|
+
restDelta?: number;
|
|
2004
|
+
}
|
|
2005
|
+
interface DurationSpringOptions {
|
|
2145
2006
|
/**
|
|
2146
|
-
*
|
|
2007
|
+
* The total duration of the animation. Set to `0.3` by default.
|
|
2008
|
+
*
|
|
2009
|
+
* @public
|
|
2147
2010
|
*/
|
|
2148
|
-
|
|
2011
|
+
duration?: number;
|
|
2149
2012
|
/**
|
|
2150
|
-
*
|
|
2013
|
+
* If visualDuration is set, this will override duration.
|
|
2151
2014
|
*
|
|
2152
|
-
*
|
|
2015
|
+
* The visual duration is a time, set in seconds, that the animation will take to visually appear to reach its target.
|
|
2153
2016
|
*
|
|
2154
|
-
*
|
|
2155
|
-
* const x = useMotionValue(0)
|
|
2156
|
-
* x.set(10)
|
|
2157
|
-
* ```
|
|
2017
|
+
* In other words, the bulk of the transition will occur before this time, and the "bouncy bit" will mostly happen after.
|
|
2158
2018
|
*
|
|
2159
|
-
*
|
|
2160
|
-
* @param render - Whether to notify render subscribers. Defaults to `true`
|
|
2019
|
+
* This makes it easier to edit a spring, as well as visually coordinate it with other time-based animations.
|
|
2161
2020
|
*
|
|
2162
2021
|
* @public
|
|
2163
2022
|
*/
|
|
2164
|
-
|
|
2165
|
-
setWithVelocity(prev: V, current: V, delta: number): void;
|
|
2166
|
-
/**
|
|
2167
|
-
* Set the state of the `MotionValue`, stopping any active animations,
|
|
2168
|
-
* effects, and resets velocity to `0`.
|
|
2169
|
-
*/
|
|
2170
|
-
jump(v: V, endAnimation?: boolean): void;
|
|
2171
|
-
dirty(): void;
|
|
2172
|
-
addDependent(dependent: MotionValue): void;
|
|
2173
|
-
removeDependent(dependent: MotionValue): void;
|
|
2174
|
-
updateAndNotify: (v: V) => void;
|
|
2023
|
+
visualDuration?: number;
|
|
2175
2024
|
/**
|
|
2176
|
-
*
|
|
2025
|
+
* `bounce` determines the "bounciness" of a spring animation.
|
|
2177
2026
|
*
|
|
2178
|
-
*
|
|
2027
|
+
* `0` is no bounce, and `1` is extremely bouncy.
|
|
2028
|
+
*
|
|
2029
|
+
* If `duration` is set, this defaults to `0.25`.
|
|
2030
|
+
*
|
|
2031
|
+
* Note: `bounce` and `duration` will be overridden if `stiffness`, `damping` or `mass` are set.
|
|
2179
2032
|
*
|
|
2180
2033
|
* @public
|
|
2181
2034
|
*/
|
|
2182
|
-
|
|
2035
|
+
bounce?: number;
|
|
2036
|
+
}
|
|
2037
|
+
interface SpringOptions extends DurationSpringOptions, VelocityOptions {
|
|
2183
2038
|
/**
|
|
2039
|
+
* Stiffness of the spring. Higher values will create more sudden movement.
|
|
2040
|
+
* Set to `100` by default.
|
|
2041
|
+
*
|
|
2042
|
+
* @default 100
|
|
2043
|
+
*
|
|
2184
2044
|
* @public
|
|
2185
2045
|
*/
|
|
2186
|
-
|
|
2046
|
+
stiffness?: number;
|
|
2187
2047
|
/**
|
|
2188
|
-
*
|
|
2048
|
+
* Strength of opposing force. If set to 0, spring will oscillate
|
|
2049
|
+
* indefinitely. Set to `10` by default.
|
|
2189
2050
|
*
|
|
2190
|
-
* @
|
|
2051
|
+
* @default 10
|
|
2191
2052
|
*
|
|
2192
2053
|
* @public
|
|
2193
2054
|
*/
|
|
2194
|
-
|
|
2195
|
-
hasAnimated: boolean;
|
|
2055
|
+
damping?: number;
|
|
2196
2056
|
/**
|
|
2197
|
-
*
|
|
2198
|
-
*
|
|
2057
|
+
* Mass of the moving object. Higher values will result in more lethargic
|
|
2058
|
+
* movement. Set to `1` by default.
|
|
2199
2059
|
*
|
|
2200
|
-
*
|
|
2201
|
-
* value.start()
|
|
2202
|
-
* ```
|
|
2060
|
+
* @default 1
|
|
2203
2061
|
*
|
|
2204
|
-
* @
|
|
2062
|
+
* @public
|
|
2205
2063
|
*/
|
|
2206
|
-
|
|
2064
|
+
mass?: number;
|
|
2065
|
+
}
|
|
2066
|
+
/**
|
|
2067
|
+
* @deprecated Use SpringOptions instead
|
|
2068
|
+
*/
|
|
2069
|
+
interface Spring extends SpringOptions {
|
|
2070
|
+
}
|
|
2071
|
+
interface DecayOptions extends VelocityOptions {
|
|
2072
|
+
keyframes?: number[];
|
|
2207
2073
|
/**
|
|
2208
|
-
*
|
|
2074
|
+
* A higher power value equals a further target. Set to `0.8` by default.
|
|
2209
2075
|
*
|
|
2210
2076
|
* @public
|
|
2211
2077
|
*/
|
|
2212
|
-
|
|
2078
|
+
power?: number;
|
|
2213
2079
|
/**
|
|
2214
|
-
*
|
|
2080
|
+
* Adjusting the time constant will change the duration of the
|
|
2081
|
+
* deceleration, thereby affecting its feel. Set to `700` by default.
|
|
2215
2082
|
*
|
|
2216
2083
|
* @public
|
|
2217
2084
|
*/
|
|
2218
|
-
|
|
2219
|
-
private clearAnimation;
|
|
2085
|
+
timeConstant?: number;
|
|
2220
2086
|
/**
|
|
2221
|
-
*
|
|
2222
|
-
*
|
|
2223
|
-
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
|
|
2224
|
-
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
|
|
2225
|
-
* created a `MotionValue` via the `motionValue` function.
|
|
2087
|
+
* A function that receives the automatically-calculated target and returns a new one. Useful for snapping the target to a grid.
|
|
2226
2088
|
*
|
|
2227
2089
|
* @public
|
|
2228
2090
|
*/
|
|
2229
|
-
|
|
2091
|
+
modifyTarget?: (v: number) => number;
|
|
2230
2092
|
}
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
type UnresolvedKeyframes<T extends AnyResolvedKeyframe> = Array<T | null>;
|
|
2234
|
-
type ResolvedKeyframes<T extends AnyResolvedKeyframe> = Array<T>;
|
|
2235
|
-
declare function flushKeyframeResolvers(): void;
|
|
2236
|
-
type OnKeyframesResolved<T extends AnyResolvedKeyframe> = (resolvedKeyframes: ResolvedKeyframes<T>, finalKeyframe: T, forced: boolean) => void;
|
|
2237
|
-
declare class KeyframeResolver<T extends AnyResolvedKeyframe = any> {
|
|
2238
|
-
name?: string;
|
|
2239
|
-
element?: WithRender;
|
|
2240
|
-
finalKeyframe?: T;
|
|
2241
|
-
suspendedScrollY?: number;
|
|
2242
|
-
protected unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>;
|
|
2243
|
-
private motionValue?;
|
|
2244
|
-
private onComplete;
|
|
2245
|
-
state: "pending" | "scheduled" | "complete";
|
|
2246
|
-
/**
|
|
2247
|
-
* Track whether this resolver is async. If it is, it'll be added to the
|
|
2248
|
-
* resolver queue and flushed in the next frame. Resolvers that aren't going
|
|
2249
|
-
* to trigger read/write thrashing don't need to be async.
|
|
2250
|
-
*/
|
|
2251
|
-
private isAsync;
|
|
2093
|
+
interface InertiaOptions extends DecayOptions {
|
|
2252
2094
|
/**
|
|
2253
|
-
*
|
|
2254
|
-
*
|
|
2095
|
+
* If `min` or `max` is set, this affects the stiffness of the bounce
|
|
2096
|
+
* spring. Higher values will create more sudden movement. Set to `500` by
|
|
2097
|
+
* default.
|
|
2098
|
+
*
|
|
2099
|
+
* @public
|
|
2255
2100
|
*/
|
|
2256
|
-
|
|
2257
|
-
constructor(unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>, onComplete: OnKeyframesResolved<T>, name?: string, motionValue?: MotionValue<T>, element?: WithRender, isAsync?: boolean);
|
|
2258
|
-
scheduleResolve(): void;
|
|
2259
|
-
readKeyframes(): void;
|
|
2260
|
-
setFinalKeyframe(): void;
|
|
2261
|
-
measureInitialState(): void;
|
|
2262
|
-
renderEndStyles(): void;
|
|
2263
|
-
measureEndState(): void;
|
|
2264
|
-
complete(isForcedComplete?: boolean): void;
|
|
2265
|
-
cancel(): void;
|
|
2266
|
-
resume(): void;
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
declare class WithPromise {
|
|
2270
|
-
protected _finished: Promise<void>;
|
|
2271
|
-
resolve: VoidFunction;
|
|
2272
|
-
constructor();
|
|
2273
|
-
get finished(): Promise<void>;
|
|
2274
|
-
protected updateFinished(): void;
|
|
2275
|
-
protected notifyFinished(): void;
|
|
2101
|
+
bounceStiffness?: number;
|
|
2276
2102
|
/**
|
|
2277
|
-
*
|
|
2103
|
+
* If `min` or `max` is set, this affects the damping of the bounce spring.
|
|
2104
|
+
* If set to `0`, spring will oscillate indefinitely. Set to `10` by
|
|
2105
|
+
* default.
|
|
2278
2106
|
*
|
|
2279
|
-
* @
|
|
2107
|
+
* @public
|
|
2280
2108
|
*/
|
|
2281
|
-
|
|
2282
|
-
}
|
|
2283
|
-
|
|
2284
|
-
type OptionsWithoutKeyframes<T extends AnyResolvedKeyframe> = Omit<ValueAnimationOptions<T>, "keyframes">;
|
|
2285
|
-
declare class AsyncMotionValueAnimation<T extends AnyResolvedKeyframe> extends WithPromise implements AnimationPlaybackControls {
|
|
2286
|
-
private createdAt;
|
|
2287
|
-
private resolvedAt;
|
|
2288
|
-
private _animation;
|
|
2289
|
-
private pendingTimeline;
|
|
2290
|
-
private keyframeResolver;
|
|
2291
|
-
private stopTimeline;
|
|
2292
|
-
constructor({ autoplay, delay, type, repeat, repeatDelay, repeatType, keyframes, name, motionValue, element, ...options }: ValueAnimationOptions<T>);
|
|
2293
|
-
onKeyframesResolved(keyframes: ResolvedKeyframes<T>, finalKeyframe: T, options: OptionsWithoutKeyframes<T>, sync: boolean): void;
|
|
2294
|
-
get finished(): Promise<any>;
|
|
2295
|
-
then(onResolve: VoidFunction, _onReject?: VoidFunction): Promise<void>;
|
|
2296
|
-
get animation(): AnimationPlaybackControls;
|
|
2297
|
-
get duration(): number;
|
|
2298
|
-
get iterationDuration(): number;
|
|
2299
|
-
get time(): number;
|
|
2300
|
-
set time(newTime: number);
|
|
2301
|
-
get speed(): number;
|
|
2302
|
-
get state(): AnimationPlayState;
|
|
2303
|
-
set speed(newSpeed: number);
|
|
2304
|
-
get startTime(): number | null;
|
|
2305
|
-
attachTimeline(timeline: TimelineWithFallback): () => void;
|
|
2306
|
-
play(): void;
|
|
2307
|
-
pause(): void;
|
|
2308
|
-
complete(): void;
|
|
2309
|
-
cancel(): void;
|
|
2109
|
+
bounceDamping?: number;
|
|
2310
2110
|
/**
|
|
2311
|
-
*
|
|
2111
|
+
* Minimum constraint. If set, the value will "bump" against this value (or immediately spring to it if the animation starts as less than this value).
|
|
2112
|
+
*
|
|
2113
|
+
* @public
|
|
2312
2114
|
*/
|
|
2313
|
-
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
|
-
type AcceptedAnimations = AnimationPlaybackControls;
|
|
2317
|
-
type GroupedAnimations = AcceptedAnimations[];
|
|
2318
|
-
declare class GroupAnimation implements AnimationPlaybackControls {
|
|
2319
|
-
animations: GroupedAnimations;
|
|
2320
|
-
constructor(animations: Array<AcceptedAnimations | undefined>);
|
|
2321
|
-
get finished(): Promise<any[]>;
|
|
2115
|
+
min?: number;
|
|
2322
2116
|
/**
|
|
2323
|
-
*
|
|
2117
|
+
* Maximum constraint. If set, the value will "bump" against this value (or immediately snap to it, if the initial animation value exceeds this value).
|
|
2118
|
+
*
|
|
2119
|
+
* @public
|
|
2324
2120
|
*/
|
|
2325
|
-
|
|
2326
|
-
private setAll;
|
|
2327
|
-
attachTimeline(timeline: TimelineWithFallback): () => void;
|
|
2328
|
-
get time(): number;
|
|
2329
|
-
set time(time: number);
|
|
2330
|
-
get speed(): number;
|
|
2331
|
-
set speed(speed: number);
|
|
2332
|
-
get state(): any;
|
|
2333
|
-
get startTime(): any;
|
|
2334
|
-
get duration(): number;
|
|
2335
|
-
get iterationDuration(): number;
|
|
2336
|
-
private runAll;
|
|
2337
|
-
play(): void;
|
|
2338
|
-
pause(): void;
|
|
2339
|
-
stop: () => void;
|
|
2340
|
-
cancel(): void;
|
|
2341
|
-
complete(): void;
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
declare class GroupAnimationWithThen extends GroupAnimation implements AnimationPlaybackControlsWithThen {
|
|
2345
|
-
then(onResolve: VoidFunction, _onReject?: VoidFunction): Promise<void>;
|
|
2121
|
+
max?: number;
|
|
2346
2122
|
}
|
|
2347
|
-
|
|
2348
|
-
declare class JSAnimation<T extends number | string> extends WithPromise implements AnimationPlaybackControlsWithThen {
|
|
2349
|
-
state: AnimationPlayState;
|
|
2350
|
-
startTime: number | null;
|
|
2123
|
+
interface AnimationOrchestrationOptions {
|
|
2351
2124
|
/**
|
|
2352
|
-
*
|
|
2353
|
-
*
|
|
2125
|
+
* Delay the animation by this duration (in seconds). Defaults to `0`.
|
|
2126
|
+
*
|
|
2127
|
+
* @public
|
|
2354
2128
|
*/
|
|
2355
|
-
|
|
2356
|
-
private isStopped;
|
|
2357
|
-
private generator;
|
|
2358
|
-
private calculatedDuration;
|
|
2359
|
-
private resolvedDuration;
|
|
2360
|
-
private totalDuration;
|
|
2361
|
-
private options;
|
|
2129
|
+
delay?: number;
|
|
2362
2130
|
/**
|
|
2363
|
-
*
|
|
2131
|
+
* Describes the relationship between the transition and its children. Set
|
|
2132
|
+
* to `false` by default.
|
|
2133
|
+
*
|
|
2134
|
+
* @remarks
|
|
2135
|
+
* When using variants, the transition can be scheduled in relation to its
|
|
2136
|
+
* children with either `"beforeChildren"` to finish this transition before
|
|
2137
|
+
* starting children transitions, `"afterChildren"` to finish children
|
|
2138
|
+
* transitions before starting this transition.
|
|
2139
|
+
*
|
|
2140
|
+
* @public
|
|
2364
2141
|
*/
|
|
2365
|
-
|
|
2142
|
+
when?: false | "beforeChildren" | "afterChildren" | string;
|
|
2366
2143
|
/**
|
|
2367
|
-
*
|
|
2144
|
+
* When using variants, children animations will start after this duration
|
|
2145
|
+
* (in seconds). You can add the `transition` property to both the `motion.div` and the
|
|
2146
|
+
* `variant` directly. Adding it to the `variant` generally offers more flexibility,
|
|
2147
|
+
* as it allows you to customize the delay per visual state.
|
|
2148
|
+
*
|
|
2149
|
+
* @public
|
|
2368
2150
|
*/
|
|
2369
|
-
|
|
2151
|
+
delayChildren?: number | DynamicOption<number>;
|
|
2370
2152
|
/**
|
|
2371
|
-
*
|
|
2153
|
+
* When using variants, animations of child components can be staggered by this
|
|
2154
|
+
* duration (in seconds).
|
|
2155
|
+
*
|
|
2156
|
+
* For instance, if `staggerChildren` is `0.01`, the first child will be
|
|
2157
|
+
* delayed by `0` seconds, the second by `0.01`, the third by `0.02` and so
|
|
2158
|
+
* on.
|
|
2159
|
+
*
|
|
2160
|
+
* The calculated stagger delay will be added to `delayChildren`.
|
|
2161
|
+
*
|
|
2162
|
+
* @deprecated - Use `delayChildren: stagger(interval)` instead.
|
|
2372
2163
|
*/
|
|
2373
|
-
|
|
2374
|
-
private mixKeyframes;
|
|
2375
|
-
private mirroredGenerator;
|
|
2164
|
+
staggerChildren?: number;
|
|
2376
2165
|
/**
|
|
2377
|
-
*
|
|
2378
|
-
*
|
|
2166
|
+
* The direction in which to stagger children.
|
|
2167
|
+
*
|
|
2168
|
+
* A value of `1` staggers from the first to the last while `-1`
|
|
2169
|
+
* staggers from the last to the first.
|
|
2170
|
+
*
|
|
2171
|
+
* @deprecated - Use `delayChildren: stagger(interval, { from: "last" })` instead.
|
|
2379
2172
|
*/
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
updateTime(timestamp: number): void;
|
|
2384
|
-
tick(timestamp: number, sample?: boolean): AnimationState$1<T>;
|
|
2173
|
+
staggerDirection?: number;
|
|
2174
|
+
}
|
|
2175
|
+
interface KeyframeOptions {
|
|
2385
2176
|
/**
|
|
2386
|
-
*
|
|
2387
|
-
*
|
|
2388
|
-
*
|
|
2177
|
+
* The total duration of the animation. Set to `0.3` by default.
|
|
2178
|
+
*
|
|
2179
|
+
* @public
|
|
2389
2180
|
*/
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2181
|
+
duration?: number;
|
|
2182
|
+
ease?: Easing | Easing[];
|
|
2183
|
+
times?: number[];
|
|
2184
|
+
}
|
|
2185
|
+
interface ValueTransition extends AnimationOrchestrationOptions, AnimationPlaybackOptions, Omit<SpringOptions, "keyframes">, Omit<InertiaOptions, "keyframes">, KeyframeOptions {
|
|
2395
2186
|
/**
|
|
2396
|
-
*
|
|
2397
|
-
*
|
|
2398
|
-
*
|
|
2187
|
+
* Delay the animation by this duration (in seconds). Defaults to `0`.
|
|
2188
|
+
*
|
|
2189
|
+
* @public
|
|
2399
2190
|
*/
|
|
2400
|
-
|
|
2401
|
-
get speed(): number;
|
|
2402
|
-
set speed(newSpeed: number);
|
|
2403
|
-
play(): void;
|
|
2404
|
-
pause(): void;
|
|
2191
|
+
delay?: number;
|
|
2405
2192
|
/**
|
|
2406
|
-
*
|
|
2407
|
-
*
|
|
2193
|
+
* The duration of time already elapsed in the animation. Set to `0` by
|
|
2194
|
+
* default.
|
|
2408
2195
|
*/
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
finish(): void;
|
|
2412
|
-
cancel(): void;
|
|
2413
|
-
private teardown;
|
|
2414
|
-
private stopDriver;
|
|
2415
|
-
sample(sampleTime: number): AnimationState$1<T>;
|
|
2416
|
-
attachTimeline(timeline: TimelineWithFallback): VoidFunction;
|
|
2417
|
-
}
|
|
2418
|
-
declare function animateValue<T extends number | string>(options: ValueAnimationOptions<T>): JSAnimation<T>;
|
|
2419
|
-
|
|
2420
|
-
interface NativeAnimationOptions<V extends AnyResolvedKeyframe = number> extends DOMValueAnimationOptions<V> {
|
|
2421
|
-
pseudoElement?: string;
|
|
2422
|
-
startTime?: number;
|
|
2423
|
-
}
|
|
2424
|
-
/**
|
|
2425
|
-
* NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.
|
|
2426
|
-
*/
|
|
2427
|
-
declare class NativeAnimation<T extends AnyResolvedKeyframe> extends WithPromise implements AnimationPlaybackControlsWithThen {
|
|
2196
|
+
elapsed?: number;
|
|
2197
|
+
driver?: Driver;
|
|
2428
2198
|
/**
|
|
2429
|
-
*
|
|
2199
|
+
* Type of animation to use.
|
|
2200
|
+
*
|
|
2201
|
+
* - "tween": Duration-based animation with ease curve
|
|
2202
|
+
* - "spring": Physics or duration-based spring animation
|
|
2203
|
+
* - false: Use an instant animation
|
|
2430
2204
|
*/
|
|
2431
|
-
|
|
2432
|
-
protected finishedTime: number | null;
|
|
2433
|
-
protected options: NativeAnimationOptions;
|
|
2434
|
-
private allowFlatten;
|
|
2435
|
-
private isStopped;
|
|
2436
|
-
private isPseudoElement;
|
|
2205
|
+
type?: AnimationGeneratorType;
|
|
2437
2206
|
/**
|
|
2438
|
-
*
|
|
2439
|
-
*
|
|
2440
|
-
*
|
|
2207
|
+
* The duration of the tween animation. Set to `0.3` by default, 0r `0.8` if animating a series of keyframes.
|
|
2208
|
+
*
|
|
2209
|
+
* @public
|
|
2441
2210
|
*/
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
pause(): void;
|
|
2447
|
-
complete(): void;
|
|
2448
|
-
cancel(): void;
|
|
2449
|
-
stop(): void;
|
|
2211
|
+
duration?: number;
|
|
2212
|
+
autoplay?: boolean;
|
|
2213
|
+
startTime?: number;
|
|
2214
|
+
from?: any;
|
|
2450
2215
|
/**
|
|
2451
|
-
*
|
|
2216
|
+
* If true, this transition will shallow-merge with its parent transition
|
|
2217
|
+
* instead of replacing it. Inner keys win.
|
|
2452
2218
|
*
|
|
2453
|
-
*
|
|
2454
|
-
|
|
2219
|
+
* @public
|
|
2220
|
+
*/
|
|
2221
|
+
inherit?: boolean;
|
|
2222
|
+
/**
|
|
2223
|
+
* If true, the animation skips straight to its final value instead of
|
|
2224
|
+
* tweening. Used by `MotionConfig`'s `skipAnimations` to opt entire
|
|
2225
|
+
* subtrees out of animation (e.g. for E2E screenshot stability).
|
|
2455
2226
|
*
|
|
2456
|
-
*
|
|
2457
|
-
* will create a renderless JS animation and sample it twice to calculate
|
|
2458
|
-
* its current value, "previous" value, and therefore allow
|
|
2459
|
-
* Motion to also correctly calculate velocity for any subsequent animation
|
|
2460
|
-
* while deferring the commit until the next animation frame.
|
|
2227
|
+
* @public
|
|
2461
2228
|
*/
|
|
2462
|
-
|
|
2463
|
-
get duration(): number;
|
|
2464
|
-
get iterationDuration(): number;
|
|
2465
|
-
get time(): number;
|
|
2466
|
-
set time(newTime: number);
|
|
2229
|
+
skipAnimations?: boolean;
|
|
2467
2230
|
/**
|
|
2468
|
-
* The
|
|
2469
|
-
*
|
|
2231
|
+
* The path the element travels between its old and new x/y positions.
|
|
2232
|
+
* Slot in a path factory (e.g. `arc()`) to swap the default
|
|
2233
|
+
* straight-line interpolation for something curved.
|
|
2234
|
+
*
|
|
2235
|
+
* Can be used in keyframe animations (`transition.path`) and layout
|
|
2236
|
+
* animations (`transition.layout.path`), including with `useAnimate`.
|
|
2237
|
+
*
|
|
2238
|
+
* @public
|
|
2470
2239
|
*/
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2240
|
+
path?: MotionPath;
|
|
2241
|
+
}
|
|
2242
|
+
/**
|
|
2243
|
+
* @deprecated Use KeyframeOptions instead
|
|
2244
|
+
*/
|
|
2245
|
+
interface Tween extends KeyframeOptions {
|
|
2246
|
+
}
|
|
2247
|
+
type SVGForcedAttrTransitions = {
|
|
2248
|
+
[K in keyof SVGForcedAttrProperties]: ValueTransition;
|
|
2249
|
+
};
|
|
2250
|
+
type SVGPathTransitions = {
|
|
2251
|
+
[K in keyof SVGPathProperties]: ValueTransition;
|
|
2252
|
+
};
|
|
2253
|
+
type SVGTransitions = {
|
|
2254
|
+
[K in keyof Omit<SVGAttributes, "from">]: ValueTransition;
|
|
2255
|
+
};
|
|
2256
|
+
interface VariableTransitions {
|
|
2257
|
+
[key: `--${string}`]: ValueTransition;
|
|
2258
|
+
}
|
|
2259
|
+
type StyleTransitions = {
|
|
2260
|
+
[K in keyof CSSStyleDeclarationWithTransform]?: ValueTransition;
|
|
2261
|
+
};
|
|
2262
|
+
type ValueKeyframe<T extends AnyResolvedKeyframe = AnyResolvedKeyframe> = T;
|
|
2263
|
+
type UnresolvedValueKeyframe<T extends AnyResolvedKeyframe = AnyResolvedKeyframe> = ValueKeyframe<T> | null;
|
|
2264
|
+
type ResolvedValueKeyframe = ValueKeyframe | ValueKeyframe[];
|
|
2265
|
+
type ValueKeyframesDefinition = ValueKeyframe | ValueKeyframe[] | UnresolvedValueKeyframe[];
|
|
2266
|
+
type StyleKeyframesDefinition = {
|
|
2267
|
+
[K in keyof CSSStyleDeclarationWithTransform]?: ValueKeyframesDefinition;
|
|
2268
|
+
};
|
|
2269
|
+
type SVGKeyframesDefinition = {
|
|
2270
|
+
[K in keyof Omit<SVGAttributes, "from">]?: ValueKeyframesDefinition;
|
|
2271
|
+
};
|
|
2272
|
+
interface VariableKeyframesDefinition {
|
|
2273
|
+
[key: `--${string}`]: ValueKeyframesDefinition;
|
|
2274
|
+
}
|
|
2275
|
+
type SVGForcedAttrKeyframesDefinition = {
|
|
2276
|
+
[K in keyof SVGForcedAttrProperties]?: ValueKeyframesDefinition;
|
|
2277
|
+
};
|
|
2278
|
+
type SVGPathKeyframesDefinition = {
|
|
2279
|
+
[K in keyof SVGPathProperties]?: ValueKeyframesDefinition;
|
|
2280
|
+
};
|
|
2281
|
+
type DOMKeyframesDefinition = StyleKeyframesDefinition & SVGKeyframesDefinition & SVGPathKeyframesDefinition & SVGForcedAttrKeyframesDefinition & VariableKeyframesDefinition;
|
|
2282
|
+
interface Target extends DOMKeyframesDefinition {
|
|
2283
|
+
}
|
|
2284
|
+
type CSSPropertyKeys = {
|
|
2285
|
+
[K in keyof CSSStyleDeclaration as K extends string ? CSSStyleDeclaration[K] extends AnyResolvedKeyframe ? K : never : never]: CSSStyleDeclaration[K];
|
|
2286
|
+
};
|
|
2287
|
+
interface CSSStyleDeclarationWithTransform extends Omit<CSSPropertyKeys, "direction" | "transition" | "x" | "y" | "z"> {
|
|
2288
|
+
x: number | string;
|
|
2289
|
+
y: number | string;
|
|
2290
|
+
z: number | string;
|
|
2291
|
+
originX: number;
|
|
2292
|
+
originY: number;
|
|
2293
|
+
originZ: number;
|
|
2294
|
+
translateX: number | string;
|
|
2295
|
+
translateY: number | string;
|
|
2296
|
+
translateZ: number | string;
|
|
2297
|
+
rotateX: number | string;
|
|
2298
|
+
rotateY: number | string;
|
|
2299
|
+
rotateZ: number | string;
|
|
2300
|
+
scaleX: number;
|
|
2301
|
+
scaleY: number;
|
|
2302
|
+
scaleZ: number;
|
|
2303
|
+
skewX: number | string;
|
|
2304
|
+
skewY: number | string;
|
|
2305
|
+
transformPerspective: number;
|
|
2306
|
+
}
|
|
2307
|
+
type TransitionWithValueOverrides<V> = ValueAnimationTransition<V> & StyleTransitions & SVGPathTransitions & SVGForcedAttrTransitions & SVGTransitions & VariableTransitions & {
|
|
2308
|
+
default?: ValueTransition;
|
|
2309
|
+
layout?: ValueTransition;
|
|
2310
|
+
};
|
|
2311
|
+
type Transition<V = any> = ValueAnimationTransition<V> | TransitionWithValueOverrides<V>;
|
|
2312
|
+
interface Point2D {
|
|
2313
|
+
x: number;
|
|
2314
|
+
y: number;
|
|
2315
|
+
}
|
|
2316
|
+
interface PathState {
|
|
2317
|
+
x: number;
|
|
2318
|
+
y: number;
|
|
2476
2319
|
/**
|
|
2477
|
-
*
|
|
2320
|
+
* Optional rotation in degrees. If returned, the engine will apply it
|
|
2321
|
+
* to the element's `rotate` value for the duration of the animation.
|
|
2478
2322
|
*/
|
|
2479
|
-
|
|
2323
|
+
rotate?: number;
|
|
2480
2324
|
}
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2325
|
+
/**
|
|
2326
|
+
* Sampling function — returns position (and optionally rotation) at
|
|
2327
|
+
* progress `t` (0–1).
|
|
2328
|
+
*/
|
|
2329
|
+
interface PathInterpolator {
|
|
2330
|
+
(t: number): PathState;
|
|
2331
|
+
}
|
|
2332
|
+
/**
|
|
2333
|
+
* Returned by a path factory such as `arc()` and passed to `transition.path`.
|
|
2334
|
+
* Implements both the keyframe-animation hook (`animateVisualElement`) and
|
|
2335
|
+
* the layout-projection hook (`interpolateProjection`).
|
|
2336
|
+
*/
|
|
2337
|
+
interface MotionPath {
|
|
2338
|
+
animateVisualElement(visualElement: VisualElement, target: TargetAndTransition, transition: Transition | undefined, delay: number, animations: AnimationPlaybackControlsWithThen[]): void;
|
|
2339
|
+
interpolateProjection(delta: Delta): PathInterpolator | undefined;
|
|
2340
|
+
}
|
|
2341
|
+
type DynamicOption<T> = (i: number, total: number) => T;
|
|
2342
|
+
type ValueAnimationWithDynamicDelay = Omit<ValueAnimationTransition<any>, "delay"> & {
|
|
2343
|
+
delay?: number | DynamicOption<number>;
|
|
2344
|
+
};
|
|
2345
|
+
interface ReduceMotionOption {
|
|
2486
2346
|
/**
|
|
2487
|
-
*
|
|
2347
|
+
* Whether to reduce motion for transform/layout animations.
|
|
2488
2348
|
*
|
|
2489
|
-
*
|
|
2490
|
-
*
|
|
2491
|
-
*
|
|
2492
|
-
* Motion to calculate velocity for any subsequent animation.
|
|
2349
|
+
* - `true`: Skip transform/layout animations (instant transition)
|
|
2350
|
+
* - `false`: Always animate transforms/layout
|
|
2351
|
+
* - `undefined`: Use device preference (default behavior)
|
|
2493
2352
|
*/
|
|
2494
|
-
|
|
2495
|
-
}
|
|
2496
|
-
|
|
2497
|
-
declare class NativeAnimationWrapper<T extends AnyResolvedKeyframe> extends NativeAnimation<T> {
|
|
2498
|
-
constructor(animation: Animation);
|
|
2353
|
+
reduceMotion?: boolean;
|
|
2499
2354
|
}
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
interface
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2355
|
+
type AnimationOptions = (ValueAnimationWithDynamicDelay & ReduceMotionOption) | (ValueAnimationWithDynamicDelay & ReduceMotionOption & StyleTransitions & SVGPathTransitions & SVGForcedAttrTransitions & SVGTransitions & VariableTransitions & {
|
|
2356
|
+
default?: ValueTransition;
|
|
2357
|
+
layout?: ValueTransition;
|
|
2358
|
+
});
|
|
2359
|
+
interface TransformProperties {
|
|
2360
|
+
x?: AnyResolvedKeyframe;
|
|
2361
|
+
y?: AnyResolvedKeyframe;
|
|
2362
|
+
z?: AnyResolvedKeyframe;
|
|
2363
|
+
translateX?: AnyResolvedKeyframe;
|
|
2364
|
+
translateY?: AnyResolvedKeyframe;
|
|
2365
|
+
translateZ?: AnyResolvedKeyframe;
|
|
2366
|
+
rotate?: AnyResolvedKeyframe;
|
|
2367
|
+
rotateX?: AnyResolvedKeyframe;
|
|
2368
|
+
rotateY?: AnyResolvedKeyframe;
|
|
2369
|
+
rotateZ?: AnyResolvedKeyframe;
|
|
2370
|
+
scale?: AnyResolvedKeyframe;
|
|
2371
|
+
scaleX?: AnyResolvedKeyframe;
|
|
2372
|
+
scaleY?: AnyResolvedKeyframe;
|
|
2373
|
+
scaleZ?: AnyResolvedKeyframe;
|
|
2374
|
+
skew?: AnyResolvedKeyframe;
|
|
2375
|
+
skewX?: AnyResolvedKeyframe;
|
|
2376
|
+
skewY?: AnyResolvedKeyframe;
|
|
2377
|
+
originX?: AnyResolvedKeyframe;
|
|
2378
|
+
originY?: AnyResolvedKeyframe;
|
|
2379
|
+
originZ?: AnyResolvedKeyframe;
|
|
2380
|
+
perspective?: AnyResolvedKeyframe;
|
|
2381
|
+
transformPerspective?: AnyResolvedKeyframe;
|
|
2509
2382
|
}
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
setAnimateFunction: (fn: any) => void;
|
|
2515
|
-
getState: () => {
|
|
2516
|
-
[key: string]: AnimationTypeState;
|
|
2517
|
-
};
|
|
2518
|
-
reset: () => void;
|
|
2383
|
+
interface SVGForcedAttrProperties {
|
|
2384
|
+
attrX?: number;
|
|
2385
|
+
attrY?: number;
|
|
2386
|
+
attrScale?: number;
|
|
2519
2387
|
}
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
isActive: boolean;
|
|
2525
|
-
protectedKeys: {
|
|
2526
|
-
[key: string]: true;
|
|
2527
|
-
};
|
|
2528
|
-
needsAnimating: {
|
|
2529
|
-
[key: string]: boolean;
|
|
2530
|
-
};
|
|
2531
|
-
prevResolvedValues: {
|
|
2532
|
-
[key: string]: any;
|
|
2533
|
-
};
|
|
2534
|
-
prevProp?: VariantLabels | TargetAndTransition;
|
|
2388
|
+
interface SVGPathProperties {
|
|
2389
|
+
pathLength?: number;
|
|
2390
|
+
pathOffset?: number;
|
|
2391
|
+
pathSpacing?: number;
|
|
2535
2392
|
}
|
|
2536
2393
|
|
|
2537
2394
|
/**
|
|
2538
|
-
*
|
|
2539
|
-
* This should be called by the framework layer (e.g., framer-motion) during initialization.
|
|
2540
|
-
*/
|
|
2541
|
-
declare function setFeatureDefinitions(definitions: Partial<FeatureDefinitions>): void;
|
|
2542
|
-
/**
|
|
2543
|
-
* Get the current feature definitions
|
|
2395
|
+
* @public
|
|
2544
2396
|
*/
|
|
2545
|
-
|
|
2397
|
+
type Subscriber<T> = (v: T) => void;
|
|
2546
2398
|
/**
|
|
2547
|
-
*
|
|
2399
|
+
* @public
|
|
2548
2400
|
*/
|
|
2549
|
-
type
|
|
2550
|
-
|
|
2401
|
+
type PassiveEffect<T> = (v: T, safeSetter: (v: T) => void) => void;
|
|
2402
|
+
type StartAnimation = (complete: () => void) => AnimationPlaybackControlsWithThen | undefined;
|
|
2403
|
+
interface MotionValueEventCallbacks<V> {
|
|
2404
|
+
animationStart: () => void;
|
|
2405
|
+
animationComplete: () => void;
|
|
2406
|
+
animationCancel: () => void;
|
|
2407
|
+
change: (latestValue: V) => void;
|
|
2408
|
+
destroy: () => void;
|
|
2409
|
+
}
|
|
2410
|
+
interface ResolvedValues {
|
|
2411
|
+
[key: string]: AnyResolvedKeyframe;
|
|
2412
|
+
}
|
|
2413
|
+
interface Owner {
|
|
2414
|
+
current: HTMLElement | unknown;
|
|
2415
|
+
getProps: () => {
|
|
2416
|
+
onUpdate?: (latest: ResolvedValues) => void;
|
|
2417
|
+
transformTemplate?: (transform: TransformProperties, generatedTransform: string) => string;
|
|
2418
|
+
};
|
|
2419
|
+
}
|
|
2420
|
+
interface AccelerateConfig {
|
|
2421
|
+
factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction;
|
|
2422
|
+
times: number[];
|
|
2423
|
+
keyframes: any[];
|
|
2424
|
+
ease?: EasingFunction | EasingFunction[];
|
|
2425
|
+
duration: number;
|
|
2426
|
+
isTransformed?: boolean;
|
|
2427
|
+
}
|
|
2428
|
+
interface MotionValueOptions {
|
|
2429
|
+
owner?: Owner;
|
|
2430
|
+
}
|
|
2431
|
+
declare const collectMotionValues: {
|
|
2432
|
+
current: MotionValue[] | undefined;
|
|
2551
2433
|
};
|
|
2552
2434
|
/**
|
|
2553
|
-
*
|
|
2554
|
-
*
|
|
2435
|
+
* `MotionValue` is used to track the state and velocity of motion values.
|
|
2436
|
+
*
|
|
2437
|
+
* @public
|
|
2555
2438
|
*/
|
|
2556
|
-
declare
|
|
2557
|
-
/**
|
|
2558
|
-
* VisualElements are arranged in trees mirroring that of the React tree.
|
|
2559
|
-
* Each type of VisualElement has a unique name, to detect when we're crossing
|
|
2560
|
-
* type boundaries within that tree.
|
|
2561
|
-
*/
|
|
2562
|
-
abstract type: string;
|
|
2563
|
-
/**
|
|
2564
|
-
* An `Array.sort` compatible function that will compare two Instances and
|
|
2565
|
-
* compare their respective positions within the tree.
|
|
2566
|
-
*/
|
|
2567
|
-
abstract sortInstanceNodePosition(a: Instance, b: Instance): number;
|
|
2568
|
-
/**
|
|
2569
|
-
* Measure the viewport-relative bounding box of the Instance.
|
|
2570
|
-
*/
|
|
2571
|
-
abstract measureInstanceViewportBox(instance: Instance, props: MotionNodeOptions & Partial<MotionConfigContextProps>): Box;
|
|
2572
|
-
/**
|
|
2573
|
-
* When a value has been removed from all animation props we need to
|
|
2574
|
-
* pick a target to animate back to. For instance, for HTMLElements
|
|
2575
|
-
* we can look in the style prop.
|
|
2576
|
-
*/
|
|
2577
|
-
abstract getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | undefined | MotionValue;
|
|
2578
|
-
/**
|
|
2579
|
-
* When we first animate to a value we need to animate it *from* a value.
|
|
2580
|
-
* Often this have been specified via the initial prop but it might be
|
|
2581
|
-
* that the value needs to be read from the Instance.
|
|
2582
|
-
*/
|
|
2583
|
-
abstract readValueFromInstance(instance: Instance, key: string, options: Options): AnyResolvedKeyframe | null | undefined;
|
|
2439
|
+
declare class MotionValue<V = any> {
|
|
2584
2440
|
/**
|
|
2585
|
-
*
|
|
2586
|
-
*
|
|
2441
|
+
* If a MotionValue has an owner, it was created internally within Motion
|
|
2442
|
+
* and therefore has no external listeners. It is therefore safe to animate via WAAPI.
|
|
2587
2443
|
*/
|
|
2588
|
-
|
|
2444
|
+
owner?: Owner;
|
|
2589
2445
|
/**
|
|
2590
|
-
*
|
|
2591
|
-
* values into an Instance-specific format. For example, HTMLVisualElement
|
|
2592
|
-
* will use this step to build `style` and `var` values.
|
|
2446
|
+
* The current state of the `MotionValue`.
|
|
2593
2447
|
*/
|
|
2594
|
-
|
|
2448
|
+
private current;
|
|
2595
2449
|
/**
|
|
2596
|
-
*
|
|
2597
|
-
* styles applied via `setProperty` and the style attribute, whereas SVGElements
|
|
2598
|
-
* will have values applied to attributes.
|
|
2450
|
+
* The previous state of the `MotionValue`.
|
|
2599
2451
|
*/
|
|
2600
|
-
|
|
2452
|
+
private prev;
|
|
2601
2453
|
/**
|
|
2602
|
-
*
|
|
2603
|
-
* It's currently used to measure SVG elements when a new transform property is bound.
|
|
2454
|
+
* The previous state of the `MotionValue` at the end of the previous frame.
|
|
2604
2455
|
*/
|
|
2605
|
-
|
|
2456
|
+
private prevFrameValue;
|
|
2606
2457
|
/**
|
|
2607
|
-
*
|
|
2608
|
-
* with the renderer-specific VisualElement.
|
|
2458
|
+
* The last time the `MotionValue` was updated.
|
|
2609
2459
|
*/
|
|
2610
|
-
|
|
2460
|
+
updatedAt: number;
|
|
2611
2461
|
/**
|
|
2612
|
-
*
|
|
2613
|
-
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
2614
|
-
*
|
|
2615
|
-
* This isn't an abstract method as it needs calling in the constructor, but it is
|
|
2616
|
-
* intended to be one.
|
|
2462
|
+
* The time `prevFrameValue` was updated.
|
|
2617
2463
|
*/
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
};
|
|
2464
|
+
prevUpdatedAt: number | undefined;
|
|
2465
|
+
private stopPassiveEffect?;
|
|
2621
2466
|
/**
|
|
2622
|
-
*
|
|
2623
|
-
* or Three.Mesh etc.
|
|
2467
|
+
* Whether the passive effect is active.
|
|
2624
2468
|
*/
|
|
2625
|
-
|
|
2469
|
+
isEffectActive?: boolean;
|
|
2626
2470
|
/**
|
|
2627
|
-
* A reference to the
|
|
2471
|
+
* A reference to the currently-controlling animation.
|
|
2628
2472
|
*/
|
|
2629
|
-
|
|
2473
|
+
animation?: AnimationPlaybackControlsWithThen;
|
|
2630
2474
|
/**
|
|
2631
|
-
* A
|
|
2475
|
+
* A list of MotionValues whose values are computed from this one.
|
|
2476
|
+
* This is a rough start to a proper signal-like dirtying system.
|
|
2632
2477
|
*/
|
|
2633
|
-
|
|
2478
|
+
private dependents;
|
|
2634
2479
|
/**
|
|
2635
|
-
*
|
|
2636
|
-
* at the start of every commit. We use it to calculate the stagger delay
|
|
2637
|
-
* for newly-added children.
|
|
2480
|
+
* Tracks whether this value should be removed
|
|
2638
2481
|
*/
|
|
2639
|
-
|
|
2482
|
+
liveStyle?: boolean;
|
|
2640
2483
|
/**
|
|
2641
|
-
*
|
|
2484
|
+
* Scroll timeline acceleration metadata. When set, VisualElement
|
|
2485
|
+
* can create a native WAAPI animation attached to a scroll timeline
|
|
2486
|
+
* instead of driving updates through JS.
|
|
2642
2487
|
*/
|
|
2643
|
-
|
|
2488
|
+
accelerate?: AccelerateConfig;
|
|
2644
2489
|
/**
|
|
2645
|
-
*
|
|
2490
|
+
* @param init - The initiating value
|
|
2491
|
+
* @param config - Optional configuration options
|
|
2492
|
+
*
|
|
2493
|
+
* - `transformer`: A function to transform incoming values with.
|
|
2646
2494
|
*/
|
|
2647
|
-
|
|
2495
|
+
constructor(init: V, options?: MotionValueOptions);
|
|
2496
|
+
setCurrent(current: V): void;
|
|
2497
|
+
setPrevFrameValue(prevFrameValue?: V | undefined): void;
|
|
2648
2498
|
/**
|
|
2649
|
-
*
|
|
2650
|
-
*
|
|
2499
|
+
* Adds a function that will be notified when the `MotionValue` is updated.
|
|
2500
|
+
*
|
|
2501
|
+
* It returns a function that, when called, will cancel the subscription.
|
|
2502
|
+
*
|
|
2503
|
+
* When calling `onChange` inside a React component, it should be wrapped with the
|
|
2504
|
+
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
|
|
2505
|
+
* from the `useEffect` function to ensure you don't add duplicate subscribers..
|
|
2506
|
+
*
|
|
2507
|
+
* ```jsx
|
|
2508
|
+
* export const MyComponent = () => {
|
|
2509
|
+
* const x = useMotionValue(0)
|
|
2510
|
+
* const y = useMotionValue(0)
|
|
2511
|
+
* const opacity = useMotionValue(1)
|
|
2512
|
+
*
|
|
2513
|
+
* useEffect(() => {
|
|
2514
|
+
* function updateOpacity() {
|
|
2515
|
+
* const maxXY = Math.max(x.get(), y.get())
|
|
2516
|
+
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
|
|
2517
|
+
* opacity.set(newOpacity)
|
|
2518
|
+
* }
|
|
2519
|
+
*
|
|
2520
|
+
* const unsubscribeX = x.on("change", updateOpacity)
|
|
2521
|
+
* const unsubscribeY = y.on("change", updateOpacity)
|
|
2522
|
+
*
|
|
2523
|
+
* return () => {
|
|
2524
|
+
* unsubscribeX()
|
|
2525
|
+
* unsubscribeY()
|
|
2526
|
+
* }
|
|
2527
|
+
* }, [])
|
|
2528
|
+
*
|
|
2529
|
+
* return <motion.div style={{ x }} />
|
|
2530
|
+
* }
|
|
2531
|
+
* ```
|
|
2532
|
+
*
|
|
2533
|
+
* @param subscriber - A function that receives the latest value.
|
|
2534
|
+
* @returns A function that, when called, will cancel this subscription.
|
|
2535
|
+
*
|
|
2536
|
+
* @deprecated
|
|
2651
2537
|
*/
|
|
2652
|
-
|
|
2538
|
+
onChange(subscription: Subscriber<V>): () => void;
|
|
2653
2539
|
/**
|
|
2654
|
-
*
|
|
2540
|
+
* An object containing a SubscriptionManager for each active event.
|
|
2655
2541
|
*/
|
|
2656
|
-
|
|
2657
|
-
|
|
2542
|
+
private events;
|
|
2543
|
+
on<EventName extends keyof MotionValueEventCallbacks<V>>(eventName: EventName, callback: MotionValueEventCallbacks<V>[EventName]): VoidFunction;
|
|
2544
|
+
clearListeners(): void;
|
|
2658
2545
|
/**
|
|
2659
|
-
*
|
|
2660
|
-
* any children that are also part of the tree. This is essentially
|
|
2661
|
-
* a shadow tree to simplify logic around how to stagger over children.
|
|
2546
|
+
* Attaches a passive effect to the `MotionValue`.
|
|
2662
2547
|
*/
|
|
2663
|
-
|
|
2548
|
+
attach(passiveEffect: PassiveEffect<V>, stopPassiveEffect: VoidFunction): void;
|
|
2664
2549
|
/**
|
|
2665
|
-
*
|
|
2666
|
-
* mode.
|
|
2550
|
+
* Sets the state of the `MotionValue`.
|
|
2667
2551
|
*
|
|
2668
|
-
*
|
|
2669
|
-
*
|
|
2552
|
+
* @remarks
|
|
2553
|
+
*
|
|
2554
|
+
* ```jsx
|
|
2555
|
+
* const x = useMotionValue(0)
|
|
2556
|
+
* x.set(10)
|
|
2557
|
+
* ```
|
|
2558
|
+
*
|
|
2559
|
+
* @param latest - Latest value to set.
|
|
2560
|
+
* @param render - Whether to notify render subscribers. Defaults to `true`
|
|
2561
|
+
*
|
|
2562
|
+
* @public
|
|
2670
2563
|
*/
|
|
2671
|
-
|
|
2564
|
+
set(v: V): void;
|
|
2565
|
+
setWithVelocity(prev: V, current: V, delta: number): void;
|
|
2672
2566
|
/**
|
|
2673
|
-
*
|
|
2674
|
-
*
|
|
2567
|
+
* Set the state of the `MotionValue`, stopping any active animations,
|
|
2568
|
+
* effects, and resets velocity to `0`.
|
|
2675
2569
|
*/
|
|
2676
|
-
|
|
2570
|
+
jump(v: V, endAnimation?: boolean): void;
|
|
2571
|
+
dirty(): void;
|
|
2572
|
+
addDependent(dependent: MotionValue): void;
|
|
2573
|
+
removeDependent(dependent: MotionValue): void;
|
|
2574
|
+
updateAndNotify: (v: V) => void;
|
|
2677
2575
|
/**
|
|
2678
|
-
*
|
|
2679
|
-
* rely on that ancestor to trigger animations further down the tree.
|
|
2680
|
-
* However, if a component is created after its parent is mounted, the parent
|
|
2681
|
-
* won't trigger that mount animation so the child needs to.
|
|
2576
|
+
* Returns the latest state of `MotionValue`
|
|
2682
2577
|
*
|
|
2683
|
-
*
|
|
2578
|
+
* @returns - The latest state of `MotionValue`
|
|
2579
|
+
*
|
|
2580
|
+
* @public
|
|
2684
2581
|
*/
|
|
2685
|
-
|
|
2582
|
+
get(): NonNullable<V>;
|
|
2686
2583
|
/**
|
|
2687
|
-
*
|
|
2688
|
-
* at the same time as it to mount as if they have initial={false} set.
|
|
2584
|
+
* @public
|
|
2689
2585
|
*/
|
|
2690
|
-
|
|
2586
|
+
getPrevious(): V | undefined;
|
|
2691
2587
|
/**
|
|
2692
|
-
*
|
|
2588
|
+
* Returns the latest velocity of `MotionValue`
|
|
2589
|
+
*
|
|
2590
|
+
* @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
|
|
2591
|
+
*
|
|
2592
|
+
* @public
|
|
2693
2593
|
*/
|
|
2694
|
-
|
|
2594
|
+
getVelocity(): number;
|
|
2595
|
+
hasAnimated: boolean;
|
|
2695
2596
|
/**
|
|
2696
|
-
*
|
|
2697
|
-
*
|
|
2698
|
-
*
|
|
2597
|
+
* Registers a new animation to control this `MotionValue`. Only one
|
|
2598
|
+
* animation can drive a `MotionValue` at one time.
|
|
2599
|
+
*
|
|
2600
|
+
* ```jsx
|
|
2601
|
+
* value.start()
|
|
2602
|
+
* ```
|
|
2603
|
+
*
|
|
2604
|
+
* @param animation - A function that starts the provided animation
|
|
2699
2605
|
*/
|
|
2700
|
-
|
|
2606
|
+
start(startAnimation: StartAnimation): Promise<void>;
|
|
2701
2607
|
/**
|
|
2702
|
-
*
|
|
2608
|
+
* Stop the currently active animation.
|
|
2609
|
+
*
|
|
2610
|
+
* @public
|
|
2703
2611
|
*/
|
|
2704
|
-
|
|
2705
|
-
KeyframeResolver: typeof KeyframeResolver;
|
|
2612
|
+
stop(): void;
|
|
2706
2613
|
/**
|
|
2707
|
-
*
|
|
2708
|
-
*
|
|
2614
|
+
* Returns `true` if this value is currently animating.
|
|
2615
|
+
*
|
|
2616
|
+
* @public
|
|
2709
2617
|
*/
|
|
2710
|
-
|
|
2618
|
+
isAnimating(): boolean;
|
|
2619
|
+
private clearAnimation;
|
|
2711
2620
|
/**
|
|
2712
|
-
*
|
|
2621
|
+
* Destroy and clean up subscribers to this `MotionValue`.
|
|
2622
|
+
*
|
|
2623
|
+
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
|
|
2624
|
+
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
|
|
2625
|
+
* created a `MotionValue` via the `motionValue` function.
|
|
2626
|
+
*
|
|
2627
|
+
* @public
|
|
2713
2628
|
*/
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2629
|
+
destroy(): void;
|
|
2630
|
+
}
|
|
2631
|
+
declare function motionValue<V>(init: V, options?: MotionValueOptions): MotionValue<V>;
|
|
2632
|
+
|
|
2633
|
+
type UnresolvedKeyframes<T extends AnyResolvedKeyframe> = Array<T | null>;
|
|
2634
|
+
type ResolvedKeyframes<T extends AnyResolvedKeyframe> = Array<T>;
|
|
2635
|
+
declare function flushKeyframeResolvers(): void;
|
|
2636
|
+
type OnKeyframesResolved<T extends AnyResolvedKeyframe> = (resolvedKeyframes: ResolvedKeyframes<T>, finalKeyframe: T, forced: boolean) => void;
|
|
2637
|
+
declare class KeyframeResolver<T extends AnyResolvedKeyframe = any> {
|
|
2638
|
+
name?: string;
|
|
2639
|
+
element?: WithRender;
|
|
2640
|
+
finalKeyframe?: T;
|
|
2641
|
+
suspendedScrollY?: number;
|
|
2642
|
+
protected unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>;
|
|
2643
|
+
private motionValue?;
|
|
2644
|
+
private onComplete;
|
|
2645
|
+
state: "pending" | "scheduled" | "complete";
|
|
2718
2646
|
/**
|
|
2719
|
-
*
|
|
2647
|
+
* Track whether this resolver is async. If it is, it'll be added to the
|
|
2648
|
+
* resolver queue and flushed in the next frame. Resolvers that aren't going
|
|
2649
|
+
* to trigger read/write thrashing don't need to be async.
|
|
2720
2650
|
*/
|
|
2721
|
-
private
|
|
2651
|
+
private isAsync;
|
|
2722
2652
|
/**
|
|
2723
|
-
*
|
|
2724
|
-
*
|
|
2653
|
+
* Track whether this resolver needs to perform a measurement
|
|
2654
|
+
* to resolve its keyframes.
|
|
2725
2655
|
*/
|
|
2726
|
-
|
|
2656
|
+
needsMeasurement: boolean;
|
|
2657
|
+
constructor(unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>, onComplete: OnKeyframesResolved<T>, name?: string, motionValue?: MotionValue<T>, element?: WithRender, isAsync?: boolean);
|
|
2658
|
+
scheduleResolve(): void;
|
|
2659
|
+
readKeyframes(): void;
|
|
2660
|
+
setFinalKeyframe(): void;
|
|
2661
|
+
measureInitialState(): void;
|
|
2662
|
+
renderEndStyles(): void;
|
|
2663
|
+
measureEndState(): void;
|
|
2664
|
+
complete(isForcedComplete?: boolean): void;
|
|
2665
|
+
cancel(): void;
|
|
2666
|
+
resume(): void;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
declare class WithPromise {
|
|
2670
|
+
protected _finished: Promise<void>;
|
|
2671
|
+
resolve: VoidFunction;
|
|
2672
|
+
constructor();
|
|
2673
|
+
get finished(): Promise<void>;
|
|
2674
|
+
protected updateFinished(): void;
|
|
2675
|
+
protected notifyFinished(): void;
|
|
2727
2676
|
/**
|
|
2728
|
-
*
|
|
2677
|
+
* Allows the animation to be awaited.
|
|
2678
|
+
*
|
|
2679
|
+
* @deprecated Use `finished` instead.
|
|
2729
2680
|
*/
|
|
2730
|
-
|
|
2681
|
+
then(onResolve: VoidFunction, onReject?: VoidFunction): Promise<void>;
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2684
|
+
type OptionsWithoutKeyframes<T extends AnyResolvedKeyframe> = Omit<ValueAnimationOptions<T>, "keyframes">;
|
|
2685
|
+
declare class AsyncMotionValueAnimation<T extends AnyResolvedKeyframe> extends WithPromise implements AnimationPlaybackControls {
|
|
2686
|
+
private createdAt;
|
|
2687
|
+
private resolvedAt;
|
|
2688
|
+
private _animation;
|
|
2689
|
+
private pendingTimeline;
|
|
2690
|
+
private keyframeResolver;
|
|
2691
|
+
private stopTimeline;
|
|
2692
|
+
constructor({ autoplay, delay, type, repeat, repeatDelay, repeatType, keyframes, name, motionValue, element, ...options }: ValueAnimationOptions<T>);
|
|
2693
|
+
onKeyframesResolved(keyframes: ResolvedKeyframes<T>, finalKeyframe: T, options: OptionsWithoutKeyframes<T>, sync: boolean): void;
|
|
2694
|
+
get finished(): Promise<any>;
|
|
2695
|
+
then(onResolve: VoidFunction, _onReject?: VoidFunction): Promise<void>;
|
|
2696
|
+
get animation(): AnimationPlaybackControls;
|
|
2697
|
+
get duration(): number;
|
|
2698
|
+
get iterationDuration(): number;
|
|
2699
|
+
get time(): number;
|
|
2700
|
+
set time(newTime: number);
|
|
2701
|
+
get speed(): number;
|
|
2702
|
+
get state(): AnimationPlayState;
|
|
2703
|
+
set speed(newSpeed: number);
|
|
2704
|
+
get startTime(): number | null;
|
|
2705
|
+
attachTimeline(timeline: TimelineWithFallback): () => void;
|
|
2706
|
+
play(): void;
|
|
2707
|
+
pause(): void;
|
|
2708
|
+
complete(): void;
|
|
2709
|
+
cancel(): void;
|
|
2731
2710
|
/**
|
|
2732
|
-
*
|
|
2711
|
+
* Bound to support return animation.stop pattern
|
|
2733
2712
|
*/
|
|
2734
|
-
|
|
2713
|
+
stop: () => void;
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
type AcceptedAnimations = AnimationPlaybackControls;
|
|
2717
|
+
type GroupedAnimations = AcceptedAnimations[];
|
|
2718
|
+
declare class GroupAnimation implements AnimationPlaybackControls {
|
|
2719
|
+
animations: GroupedAnimations;
|
|
2720
|
+
constructor(animations: Array<AcceptedAnimations | undefined>);
|
|
2721
|
+
get finished(): Promise<any[]>;
|
|
2735
2722
|
/**
|
|
2736
|
-
*
|
|
2737
|
-
* this visual element from its parent on unmount.
|
|
2723
|
+
* TODO: Filter out cancelled or stopped animations before returning
|
|
2738
2724
|
*/
|
|
2739
|
-
private
|
|
2725
|
+
private getAll;
|
|
2726
|
+
private setAll;
|
|
2727
|
+
attachTimeline(timeline: TimelineWithFallback): () => void;
|
|
2728
|
+
get time(): number;
|
|
2729
|
+
set time(time: number);
|
|
2730
|
+
get speed(): number;
|
|
2731
|
+
set speed(speed: number);
|
|
2732
|
+
get state(): any;
|
|
2733
|
+
get startTime(): any;
|
|
2734
|
+
get duration(): number;
|
|
2735
|
+
get iterationDuration(): number;
|
|
2736
|
+
private runAll;
|
|
2737
|
+
play(): void;
|
|
2738
|
+
pause(): void;
|
|
2739
|
+
stop: () => void;
|
|
2740
|
+
cancel(): void;
|
|
2741
|
+
complete(): void;
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
declare class GroupAnimationWithThen extends GroupAnimation implements AnimationPlaybackControlsWithThen {
|
|
2745
|
+
then(onResolve: VoidFunction, _onReject?: VoidFunction): Promise<void>;
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
declare class JSAnimation<T extends number | string> extends WithPromise implements AnimationPlaybackControlsWithThen {
|
|
2749
|
+
state: AnimationPlayState;
|
|
2750
|
+
startTime: number | null;
|
|
2740
2751
|
/**
|
|
2741
|
-
*
|
|
2742
|
-
*
|
|
2743
|
-
* if any motion values need to be removed after props are updated.
|
|
2752
|
+
* The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop
|
|
2753
|
+
* but in tests we can pass in a synchronous loop.
|
|
2744
2754
|
*/
|
|
2745
|
-
private
|
|
2755
|
+
private driver?;
|
|
2756
|
+
private isStopped;
|
|
2757
|
+
private generator;
|
|
2758
|
+
private calculatedDuration;
|
|
2759
|
+
private resolvedDuration;
|
|
2760
|
+
private totalDuration;
|
|
2761
|
+
private options;
|
|
2746
2762
|
/**
|
|
2747
|
-
*
|
|
2748
|
-
* for a fallback value to animate to. These values are tracked in baseTarget.
|
|
2763
|
+
* The current time of the animation.
|
|
2749
2764
|
*/
|
|
2750
|
-
private
|
|
2765
|
+
private currentTime;
|
|
2751
2766
|
/**
|
|
2752
|
-
*
|
|
2767
|
+
* The time at which the animation was paused.
|
|
2753
2768
|
*/
|
|
2754
|
-
private
|
|
2769
|
+
private holdTime;
|
|
2755
2770
|
/**
|
|
2756
|
-
*
|
|
2757
|
-
* remounts after Suspense unmount/remount cycles.
|
|
2771
|
+
* Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.
|
|
2758
2772
|
*/
|
|
2759
|
-
private
|
|
2773
|
+
private playbackSpeed;
|
|
2774
|
+
private mixKeyframes;
|
|
2775
|
+
private mirroredGenerator;
|
|
2760
2776
|
/**
|
|
2761
|
-
*
|
|
2777
|
+
* Reusable state object for the delay phase to avoid
|
|
2778
|
+
* allocating a new object every frame.
|
|
2762
2779
|
*/
|
|
2763
|
-
private
|
|
2780
|
+
private delayState;
|
|
2781
|
+
constructor(options: ValueAnimationOptions<T>);
|
|
2782
|
+
initAnimation(): void;
|
|
2783
|
+
updateTime(timestamp: number): void;
|
|
2784
|
+
tick(timestamp: number, sample?: boolean): AnimationState<T>;
|
|
2764
2785
|
/**
|
|
2765
|
-
*
|
|
2766
|
-
*
|
|
2767
|
-
*
|
|
2786
|
+
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
2787
|
+
* resolves when the animation finishes at all but in a future update could/should
|
|
2788
|
+
* reject if its cancels.
|
|
2768
2789
|
*/
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
removeChild(child: VisualElement): void;
|
|
2775
|
-
private bindToMotionValue;
|
|
2776
|
-
sortNodePosition(other: VisualElement<Instance>): number;
|
|
2777
|
-
updateFeatures(): void;
|
|
2778
|
-
notifyUpdate: () => void;
|
|
2779
|
-
triggerBuild(): void;
|
|
2780
|
-
render: () => void;
|
|
2781
|
-
private renderScheduledAt;
|
|
2782
|
-
scheduleRender: () => void;
|
|
2790
|
+
then(resolve: VoidFunction, reject?: VoidFunction): Promise<void>;
|
|
2791
|
+
get duration(): number;
|
|
2792
|
+
get iterationDuration(): number;
|
|
2793
|
+
get time(): number;
|
|
2794
|
+
set time(newTime: number);
|
|
2783
2795
|
/**
|
|
2784
|
-
*
|
|
2785
|
-
*
|
|
2786
|
-
*
|
|
2796
|
+
* Returns the generator's velocity at the current time in units/second.
|
|
2797
|
+
* Uses the analytical derivative when available (springs), avoiding
|
|
2798
|
+
* the MotionValue's frame-dependent velocity estimation.
|
|
2787
2799
|
*/
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2800
|
+
getGeneratorVelocity(): number;
|
|
2801
|
+
get speed(): number;
|
|
2802
|
+
set speed(newSpeed: number);
|
|
2803
|
+
play(): void;
|
|
2804
|
+
pause(): void;
|
|
2791
2805
|
/**
|
|
2792
|
-
*
|
|
2793
|
-
*
|
|
2806
|
+
* This method is bound to the instance to fix a pattern where
|
|
2807
|
+
* animation.stop is returned as a reference from a useEffect.
|
|
2794
2808
|
*/
|
|
2795
|
-
|
|
2796
|
-
|
|
2809
|
+
stop: () => void;
|
|
2810
|
+
complete(): void;
|
|
2811
|
+
finish(): void;
|
|
2812
|
+
cancel(): void;
|
|
2813
|
+
private teardown;
|
|
2814
|
+
private stopDriver;
|
|
2815
|
+
sample(sampleTime: number): AnimationState<T>;
|
|
2816
|
+
attachTimeline(timeline: TimelineWithFallback): VoidFunction;
|
|
2817
|
+
}
|
|
2818
|
+
declare function animateValue<T extends number | string>(options: ValueAnimationOptions<T>): JSAnimation<T>;
|
|
2819
|
+
|
|
2820
|
+
interface NativeAnimationOptions<V extends AnyResolvedKeyframe = number> extends DOMValueAnimationOptions<V> {
|
|
2821
|
+
pseudoElement?: string;
|
|
2822
|
+
startTime?: number;
|
|
2823
|
+
}
|
|
2824
|
+
/**
|
|
2825
|
+
* NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.
|
|
2826
|
+
*/
|
|
2827
|
+
declare class NativeAnimation<T extends AnyResolvedKeyframe> extends WithPromise implements AnimationPlaybackControlsWithThen {
|
|
2797
2828
|
/**
|
|
2798
|
-
*
|
|
2829
|
+
* The interfaced Web Animation API animation
|
|
2799
2830
|
*/
|
|
2800
|
-
|
|
2831
|
+
protected animation: Animation;
|
|
2832
|
+
protected finishedTime: number | null;
|
|
2833
|
+
protected options: NativeAnimationOptions;
|
|
2834
|
+
private allowFlatten;
|
|
2835
|
+
private isStopped;
|
|
2836
|
+
private isPseudoElement;
|
|
2801
2837
|
/**
|
|
2802
|
-
*
|
|
2838
|
+
* Tracks a manually-set start time that takes precedence over WAAPI's
|
|
2839
|
+
* dynamic startTime. This is cleared when play() or time setter is called,
|
|
2840
|
+
* allowing WAAPI to take over timing.
|
|
2803
2841
|
*/
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2842
|
+
protected manualStartTime: number | null;
|
|
2843
|
+
constructor(options?: NativeAnimationOptions);
|
|
2844
|
+
updateMotionValue?(value?: T): void;
|
|
2845
|
+
play(): void;
|
|
2846
|
+
pause(): void;
|
|
2847
|
+
complete(): void;
|
|
2848
|
+
cancel(): void;
|
|
2849
|
+
stop(): void;
|
|
2807
2850
|
/**
|
|
2808
|
-
*
|
|
2851
|
+
* WAAPI doesn't natively have any interruption capabilities.
|
|
2852
|
+
*
|
|
2853
|
+
* In this method, we commit styles back to the DOM before cancelling
|
|
2854
|
+
* the animation.
|
|
2855
|
+
*
|
|
2856
|
+
* This is designed to be overridden by NativeAnimationExtended, which
|
|
2857
|
+
* will create a renderless JS animation and sample it twice to calculate
|
|
2858
|
+
* its current value, "previous" value, and therefore allow
|
|
2859
|
+
* Motion to also correctly calculate velocity for any subsequent animation
|
|
2860
|
+
* while deferring the commit until the next animation frame.
|
|
2809
2861
|
*/
|
|
2810
|
-
|
|
2862
|
+
protected commitStyles(): void;
|
|
2863
|
+
get duration(): number;
|
|
2864
|
+
get iterationDuration(): number;
|
|
2865
|
+
get time(): number;
|
|
2866
|
+
set time(newTime: number);
|
|
2811
2867
|
/**
|
|
2812
|
-
*
|
|
2868
|
+
* The playback speed of the animation.
|
|
2869
|
+
* 1 = normal speed, 2 = double speed, 0.5 = half speed.
|
|
2813
2870
|
*/
|
|
2814
|
-
|
|
2871
|
+
get speed(): number;
|
|
2872
|
+
set speed(newSpeed: number);
|
|
2873
|
+
get state(): AnimationPlayState;
|
|
2874
|
+
get startTime(): number;
|
|
2875
|
+
set startTime(newStartTime: number);
|
|
2815
2876
|
/**
|
|
2816
|
-
*
|
|
2877
|
+
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
2817
2878
|
*/
|
|
2818
|
-
|
|
2879
|
+
attachTimeline({ timeline, rangeStart, rangeEnd, observe, }: TimelineWithFallback): VoidFunction;
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
type NativeAnimationOptionsExtended<T extends AnyResolvedKeyframe> = NativeAnimationOptions & ValueAnimationOptions<T> & NativeAnimationOptions;
|
|
2883
|
+
declare class NativeAnimationExtended<T extends AnyResolvedKeyframe> extends NativeAnimation<T> {
|
|
2884
|
+
options: NativeAnimationOptionsExtended<T>;
|
|
2885
|
+
constructor(options: NativeAnimationOptionsExtended<T>);
|
|
2819
2886
|
/**
|
|
2820
|
-
*
|
|
2887
|
+
* WAAPI doesn't natively have any interruption capabilities.
|
|
2888
|
+
*
|
|
2889
|
+
* Rather than read committed styles back out of the DOM, we can
|
|
2890
|
+
* create a renderless JS animation and sample it twice to calculate
|
|
2891
|
+
* its current value, "previous" value, and therefore allow
|
|
2892
|
+
* Motion to calculate velocity for any subsequent animation.
|
|
2821
2893
|
*/
|
|
2822
|
-
|
|
2894
|
+
updateMotionValue(value?: T): void;
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2897
|
+
declare class NativeAnimationWrapper<T extends AnyResolvedKeyframe> extends NativeAnimation<T> {
|
|
2898
|
+
constructor(animation: Animation);
|
|
2899
|
+
}
|
|
2900
|
+
|
|
2901
|
+
declare const animationMapKey: (name: string, pseudoElement?: string) => string;
|
|
2902
|
+
declare function getAnimationMap(element: Element): Map<string, NativeAnimation<AnyResolvedKeyframe>>;
|
|
2903
|
+
|
|
2904
|
+
declare function calcChildStagger(children: Set<VisualElement>, child: VisualElement, delayChildren?: number | DynamicOption<number>, staggerChildren?: number, staggerDirection?: number): number;
|
|
2905
|
+
|
|
2906
|
+
interface ArcOptions {
|
|
2823
2907
|
/**
|
|
2824
|
-
*
|
|
2825
|
-
*
|
|
2908
|
+
* How far the arc bulges perpendicular to the straight-line path,
|
|
2909
|
+
* as a fraction of the total distance. A value of `1` means the arc
|
|
2910
|
+
* peaks at a height equal to the full travel distance. Default `0.5`.
|
|
2826
2911
|
*/
|
|
2827
|
-
|
|
2828
|
-
getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue;
|
|
2912
|
+
strength?: number;
|
|
2829
2913
|
/**
|
|
2830
|
-
*
|
|
2831
|
-
*
|
|
2832
|
-
* directly from the instance (which might have performance implications).
|
|
2914
|
+
* Where along the path (0–1) the arc reaches its maximum height.
|
|
2915
|
+
* Default `0.5` (symmetric).
|
|
2833
2916
|
*/
|
|
2834
|
-
|
|
2917
|
+
peak?: number;
|
|
2835
2918
|
/**
|
|
2836
|
-
*
|
|
2837
|
-
*
|
|
2919
|
+
* Which side the arc bulges toward.
|
|
2920
|
+
* - `"cw"` / `"ccw"` — locked relative to direction of travel
|
|
2921
|
+
* - unset — auto-pick a stable screen-space side
|
|
2838
2922
|
*/
|
|
2839
|
-
|
|
2923
|
+
direction?: "cw" | "ccw";
|
|
2840
2924
|
/**
|
|
2841
|
-
*
|
|
2842
|
-
*
|
|
2925
|
+
* Rotates the element to follow the tangent of the arc path.
|
|
2926
|
+
* - `true` — full tangent following (1.0)
|
|
2927
|
+
* - number 0–1 — scale factor
|
|
2843
2928
|
*/
|
|
2844
|
-
|
|
2845
|
-
on<EventName extends keyof VisualElementEventCallbacks>(eventName: EventName, callback: VisualElementEventCallbacks[EventName]): VoidFunction;
|
|
2846
|
-
notify<EventName extends keyof VisualElementEventCallbacks>(eventName: EventName, ...args: any): void;
|
|
2847
|
-
scheduleRenderMicrotask(): void;
|
|
2929
|
+
rotate?: boolean | number;
|
|
2848
2930
|
}
|
|
2849
|
-
|
|
2850
|
-
|
|
2931
|
+
/**
|
|
2932
|
+
* Creates a curved path for `transition.path`:
|
|
2933
|
+
*
|
|
2934
|
+
* ```ts
|
|
2935
|
+
* <motion.div animate={{ x: 200, y: 100 }} transition={{ path: arc() }} />
|
|
2936
|
+
* ```
|
|
2937
|
+
*
|
|
2938
|
+
* Reuse the returned value (module scope / useMemo / useRef) so its
|
|
2939
|
+
* continuity closure survives re-renders — a fresh `arc()` has no memory.
|
|
2940
|
+
*/
|
|
2941
|
+
declare function arc(options?: ArcOptions): MotionPath;
|
|
2851
2942
|
|
|
2852
2943
|
type CSSVariableName = `--${string}`;
|
|
2853
2944
|
type CSSVariableToken = `var(${CSSVariableName})`;
|
|
@@ -3232,6 +3323,13 @@ declare const positionalKeys: Set<string>;
|
|
|
3232
3323
|
declare const transformPropOrder: string[];
|
|
3233
3324
|
/**
|
|
3234
3325
|
* A quick lookup for transform props.
|
|
3326
|
+
*
|
|
3327
|
+
* `pathRotation` is a transform for routing purposes (skipped from raw
|
|
3328
|
+
* style application, wired to the transform composite, flags transform
|
|
3329
|
+
* dirty) but is intentionally NOT in `transformPropOrder` — it is
|
|
3330
|
+
* composed onto `rotate` at the build sites, not serialized in its own
|
|
3331
|
+
* slot, and must stay out of the order-array consumers (parse-transform,
|
|
3332
|
+
* unit-conversion, keys-position).
|
|
3235
3333
|
*/
|
|
3236
3334
|
declare const transformProps: Set<string>;
|
|
3237
3335
|
|
|
@@ -4328,7 +4426,7 @@ interface IProjectionNode<I = unknown> {
|
|
|
4328
4426
|
isTreeAnimating?: boolean;
|
|
4329
4427
|
isAnimationBlocked?: boolean;
|
|
4330
4428
|
isTreeAnimationBlocked: () => boolean;
|
|
4331
|
-
setAnimationOrigin(delta: Delta): void;
|
|
4429
|
+
setAnimationOrigin(delta: Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath): void;
|
|
4332
4430
|
startAnimation(transition: ValueTransition): void;
|
|
4333
4431
|
finishAnimation(): void;
|
|
4334
4432
|
hasCheckedOptimisedAppear: boolean;
|
|
@@ -4697,7 +4795,7 @@ declare function createProjectionNode<I>({ attachResizeListener, defaultParent,
|
|
|
4697
4795
|
currentAnimation?: JSAnimation<number> | undefined;
|
|
4698
4796
|
mixTargetDelta: (progress: number) => void;
|
|
4699
4797
|
animationProgress: number;
|
|
4700
|
-
setAnimationOrigin(delta: Delta, hasOnlyRelativeTargetChanged?: boolean): void;
|
|
4798
|
+
setAnimationOrigin(delta: Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath): void;
|
|
4701
4799
|
motionValue?: MotionValue<number> | undefined;
|
|
4702
4800
|
startAnimation(options: ValueAnimationOptions<number>): void;
|
|
4703
4801
|
completeAnimation(): void;
|
|
@@ -4837,7 +4935,7 @@ declare const DocumentProjectionNode: {
|
|
|
4837
4935
|
currentAnimation?: JSAnimation<number> | undefined;
|
|
4838
4936
|
mixTargetDelta: (progress: number) => void;
|
|
4839
4937
|
animationProgress: number;
|
|
4840
|
-
setAnimationOrigin(delta: motion_utils.Delta, hasOnlyRelativeTargetChanged?: boolean): void;
|
|
4938
|
+
setAnimationOrigin(delta: motion_utils.Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath | undefined): void;
|
|
4841
4939
|
motionValue?: MotionValue<number> | undefined;
|
|
4842
4940
|
startAnimation(options: ValueAnimationOptions<number>): void;
|
|
4843
4941
|
completeAnimation(): void;
|
|
@@ -4982,7 +5080,7 @@ declare const HTMLProjectionNode: {
|
|
|
4982
5080
|
currentAnimation?: JSAnimation<number> | undefined;
|
|
4983
5081
|
mixTargetDelta: (progress: number) => void;
|
|
4984
5082
|
animationProgress: number;
|
|
4985
|
-
setAnimationOrigin(delta: motion_utils.Delta, hasOnlyRelativeTargetChanged?: boolean): void;
|
|
5083
|
+
setAnimationOrigin(delta: motion_utils.Delta, hasOnlyRelativeTargetChanged?: boolean, pathFn?: MotionPath | undefined): void;
|
|
4986
5084
|
motionValue?: MotionValue<number> | undefined;
|
|
4987
5085
|
startAnimation(options: ValueAnimationOptions<number>): void;
|
|
4988
5086
|
completeAnimation(): void;
|
|
@@ -5108,4 +5206,4 @@ declare const sync: Batcher;
|
|
|
5108
5206
|
*/
|
|
5109
5207
|
declare const cancelSync: Record<string, (process: Process) => void>;
|
|
5110
5208
|
|
|
5111
|
-
export { type AccelerateConfig, type AcceptedAnimations, type ActiveStatsBuffer, type AnimationDefinition, type AnimationGeneratorName, type AnimationGeneratorType, type AnimationList, type AnimationOptions, type AnimationOrchestrationOptions, type AnimationPlaybackControls, type AnimationPlaybackControlsWithThen, type AnimationPlaybackLifecycles, type AnimationPlaybackOptions, type AnimationScope, type AnimationState, type AnimationType, type AnimationTypeState, type AnyResolvedKeyframe, AsyncMotionValueAnimation, type Batcher, type CSSStyleDeclarationWithTransform, type CSSVariableName, type CSSVariableToken, type CancelProcess, type Color, type ComplexValueInfo, type ComplexValues, type DOMKeyframesDefinition, DOMKeyframesResolver, type DOMValueAnimationOptions, DOMVisualElement, type DOMVisualElementOptions, type DecayOptions, type DelayedFunction, DocumentProjectionNode, type DragElastic, type DragHandler, type DraggableProps, type DurationSpringOptions, type DynamicOption, type ElementOrSelector, type EventInfo, type EventOptions, Feature, type FeatureClass, FlatTree, type FollowValueOptions, type FrameData, type FrameStats, type GeneratorFactory, type GeneratorFactoryFunction, GroupAnimation, GroupAnimationWithThen, type GroupedAnimations, type HSLA, HTMLProjectionNode, type HTMLRenderState, HTMLVisualElement, type HandoffFunction, type IProjectionNode, type InactiveStatsBuffer, type InertiaOptions, type InitialPromotionConfig, type InterpolateOptions, JSAnimation, type KeyframeGenerator, type KeyframeOptions, KeyframeResolver, LayoutAnimationBuilder, type LayoutEvents, type LayoutLifecycles, type LayoutUpdateData, type LayoutUpdateHandler, type LegacyAnimationControls, type MapInputRange, type Measurements, type Mixer, type MixerFactory, type MotionConfigContextProps, type MotionNodeAdvancedOptions, type MotionNodeAnimationOptions, type MotionNodeDragHandlers, type MotionNodeDraggableOptions, type MotionNodeEventOptions, type MotionNodeFocusHandlers, type MotionNodeHoverHandlers, type MotionNodeLayoutOptions, type MotionNodeOptions, type MotionNodePanHandlers, type MotionNodeTapHandlers, type MotionNodeViewportOptions, type MotionStyle, MotionValue, type MotionValueEventCallbacks, type MotionValueOptions, type MultiTransformer, NativeAnimation, NativeAnimationExtended, type NativeAnimationOptions, type NativeAnimationOptionsExtended, NativeAnimationWrapper, type NodeGroup, NodeStack, type NumberMap, ObjectVisualElement, type OnHoverEndEvent, type OnHoverStartEvent, type OnKeyframesResolved, type OnPressEndEvent, type OnPressStartEvent, type Owner, type PanHandler, type PanInfo, type PassiveEffect, type Phase, type PointerEventOptions, type PresenceContextProps, type PressGestureInfo, type Process, type ProgressTimeline, type ProjectionEventName, type ProjectionNodeConfig, type ProjectionNodeOptions, type PropagateOptions, type RGBA, type ReducedMotionConfig, type RepeatType, type ResolvedConstraints, type ResolvedElastic, type ResolvedKeyframes, type ResolvedValueKeyframe, type ResolvedValues$1 as ResolvedValues, type SVGAttributes, type SVGForcedAttrKeyframesDefinition, type SVGForcedAttrProperties, type SVGForcedAttrTransitions, type SVGKeyframesDefinition, type SVGPathKeyframesDefinition, type SVGPathProperties, type SVGPathTransitions, type SVGRenderState, type SVGTransitions, SVGVisualElement, type ScaleCorrectionNode, type ScaleCorrector, type ScaleCorrectorDefinition, type ScaleCorrectorMap, type Schedule, type ScrapeMotionValuesFromProps, type ScrollMeasurements, type SelectorCache, type SingleTransformer, type Spring, type SpringOptions, type StaggerOptions, type StaggerOrigin, type StartAnimation, type Stats, type StatsBuffer, type StatsRecording, type StatsSummary, type Step, type StepId, type Steps, type StyleKeyframesDefinition, type StyleTransitions, type Subscriber, type Summary, type TapHandlers, type TapInfo, type Target, type TargetAndTransition, type TargetResolver, type TimelineWithFallback, type TransformInputRange, type TransformOptions, type TransformOrigin, type TransformProperties, type TransformTemplate, type Transformer, type Transition, type TransitionWithValueOverrides, type Tween, type UnresolvedKeyframes, type UnresolvedValueKeyframe, type UseRenderState, type ValueAnimationOptions, type ValueAnimationOptionsWithRenderContext, type ValueAnimationTransition, type ValueAnimationWithDynamicDelay, type ValueIndexes, type ValueKeyframe, type ValueKeyframesDefinition, type ValueTransformer, type ValueTransition, type ValueType, type ValueTypeMap, type VariableKeyframesDefinition, type VariableTransitions, type Variant, type VariantLabels, type Variants, type VelocityOptions, type ViewTransitionAnimationDefinition, ViewTransitionBuilder, type ViewTransitionOptions, type ViewTransitionTarget, type ViewTransitionTargetDefinition, type ViewportEventHandler, type ViewportOptions, VisualElement, type VisualElementAnimationOptions, type VisualElementEventCallbacks, type VisualElementOptions, type VisualState, type WillChange, type WithAppearProps, type WithDepth, type WithQuerySelectorAll, acceleratedValues, activeAnimations, addAttrValue, addDomEvent, addScaleCorrector, addStyleValue, addValueToWillChange, alpha, analyseComplexValue, animateMotionValue, animateSingleValue, animateTarget, animateValue, animateVariant, animateView, animateVisualElement, animationMapKey, applyAxisDelta, applyBoxDelta, applyGeneratorOptions, applyPointDelta, applyPxDefaults, applyTreeDeltas, aspectRatio, attachFollow, attachSpring, attrEffect, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, buildHTMLStyles, buildProjectionTransform, buildSVGAttrs, buildSVGPath, buildTransform, calcAxisDelta, calcBoxDelta, calcChildStagger, calcGeneratorDuration, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, camelCaseAttributes, camelToDash, cancelFrame, cancelMicrotask, cancelSync, checkVariantsDidChange, cleanDirtyNodes, collectMotionValues, color, compareByDepth, complex, containsCSSVariable, convertBoundingBoxToBox, convertBoxToBoundingBox, convertOffsetToTimes, copyAxisDeltaInto, copyAxisInto, copyBoxInto, correctBorderRadius, correctBoxShadow, createAnimationState, createAxis, createAxisDelta, createBox, createDelta, createGeneratorEasing, createProjectionNode, createRenderBatcher, cubicBezierAsString, defaultEasing, defaultOffset, defaultTransformValue, defaultValueTypes, degrees, delay, delayInSeconds, dimensionValueTypes, eachAxis, fillOffset, fillWildcards, findDimensionValueType, findValueType, flushKeyframeResolvers, followValue, frame, frameData, frameSteps, generateLinearEasing, getAnimatableNone, getAnimationMap, getComputedStyle, getDefaultTransition, getDefaultValueType, getFeatureDefinitions, getFinalKeyframe, getMixer, getOptimisedAppearId, getOriginIndex, getValueAsType, getValueTransition, getVariableValue, getVariantContext, getViewAnimationLayerInfo, getViewAnimations, globalProjectionState, has2DTranslate, hasReducedMotionListener, hasScale, hasTransform, hex, hover, hsla, hslaToRgba, inertia, initPrefersReducedMotion, interpolate, invisibleValues, isAnimationControls, isCSSVariableName, isCSSVariableToken, isControllingVariants, isDeltaZero, isDragActive, isDragging, isElementKeyboardAccessible, isElementTextInput, isForcedMotionValue, isGenerator, isHTMLElement, isKeyframesTarget, isMotionValue, isNear, isNodeOrChild, isPrimaryPointer, isSVGElement, isSVGSVGElement, isSVGTag, isTransitionDefined, isVariantLabel, isVariantNode, isWaapiSupportedEasing, isWillChangeMotionValue, keyframes, makeAnimationInstant, mapEasingToNativeEasing, mapValue, maxGeneratorDuration, measurePageBox, measureViewportBox, microtask, mix, mixArray, mixColor, mixComplex, mixImmediate, mixLinearColor, mixNumber, mixObject, mixValues, mixVisibility, motionValue, nodeGroup, number, numberValueTypes, observeTimeline, optimizedAppearDataAttribute, optimizedAppearDataId, parseAnimateLayoutArgs, parseCSSVariable, parseValueFromTransform, percent, pixelsToPercent, positionalKeys, prefersReducedMotion, press, progressPercentage, propEffect, propagateDirtyNodes, px, readTransformValue, recordStats, removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta, renderHTML, renderSVG, resize, resolveElements, resolveMotionValue, resolveTransition, resolveVariant, resolveVariantFromProps, rgbUnit, rgba, rootProjectionNode, scale, scaleCorrectors, scalePoint, scrapeMotionValuesFromProps$1 as scrapeHTMLMotionValuesFromProps, scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps, setDragLock, setFeatureDefinitions, setStyle, setTarget, spring, springValue, stagger, startWaapiAnimation, statsBuffer, styleEffect, supportedWaapiEasing, supportsBrowserAnimation, supportsFlags, supportsLinearEasing, supportsPartialKeyframes, supportsScrollTimeline, supportsViewTimeline, svgEffect, sync, testValueType, time, transform, transformAxis, transformBox, transformBoxPoints, transformPropOrder, transformProps, transformValue, transformValueTypes, translateAxis, updateMotionValuesFromProps, variantPriorityOrder, variantProps, vh, visualElementStore, vw };
|
|
5209
|
+
export { type AccelerateConfig, type AcceptedAnimations, type ActiveStatsBuffer, type AnimationDefinition, type AnimationGeneratorName, type AnimationGeneratorType, type AnimationList, type AnimationOptions, type AnimationOrchestrationOptions, type AnimationPlaybackControls, type AnimationPlaybackControlsWithThen, type AnimationPlaybackLifecycles, type AnimationPlaybackOptions, type AnimationScope, type AnimationState$1 as AnimationState, type AnimationType, type AnimationTypeState, type AnyResolvedKeyframe, type ArcOptions, AsyncMotionValueAnimation, type Batcher, type CSSStyleDeclarationWithTransform, type CSSVariableName, type CSSVariableToken, type CancelProcess, type Color, type ComplexValueInfo, type ComplexValues, type DOMKeyframesDefinition, DOMKeyframesResolver, type DOMValueAnimationOptions, DOMVisualElement, type DOMVisualElementOptions, type DecayOptions, type DelayedFunction, DocumentProjectionNode, type DragElastic, type DragHandler, type DraggableProps, type DurationSpringOptions, type DynamicOption, type ElementOrSelector, type EventInfo, type EventOptions, Feature, type FeatureClass, FlatTree, type FollowValueOptions, type FrameData, type FrameStats, type GeneratorFactory, type GeneratorFactoryFunction, GroupAnimation, GroupAnimationWithThen, type GroupedAnimations, type HSLA, HTMLProjectionNode, type HTMLRenderState, HTMLVisualElement, type HandoffFunction, type IProjectionNode, type InactiveStatsBuffer, type InertiaOptions, type InitialPromotionConfig, type InterpolateOptions, JSAnimation, type KeyframeGenerator, type KeyframeOptions, KeyframeResolver, LayoutAnimationBuilder, type LayoutEvents, type LayoutLifecycles, type LayoutUpdateData, type LayoutUpdateHandler, type LegacyAnimationControls, type MapInputRange, type Measurements, type Mixer, type MixerFactory, type MotionConfigContextProps, type MotionNodeAdvancedOptions, type MotionNodeAnimationOptions, type MotionNodeDragHandlers, type MotionNodeDraggableOptions, type MotionNodeEventOptions, type MotionNodeFocusHandlers, type MotionNodeHoverHandlers, type MotionNodeLayoutOptions, type MotionNodeOptions, type MotionNodePanHandlers, type MotionNodeTapHandlers, type MotionNodeViewportOptions, type MotionPath, type MotionStyle, MotionValue, type MotionValueEventCallbacks, type MotionValueOptions, type MultiTransformer, NativeAnimation, NativeAnimationExtended, type NativeAnimationOptions, type NativeAnimationOptionsExtended, NativeAnimationWrapper, type NodeGroup, NodeStack, type NumberMap, ObjectVisualElement, type OnHoverEndEvent, type OnHoverStartEvent, type OnKeyframesResolved, type OnPressEndEvent, type OnPressStartEvent, type Owner, type PanHandler, type PanInfo, type PassiveEffect, type PathInterpolator, type PathState, type Phase, type Point2D, type PointerEventOptions, type PresenceContextProps, type PressGestureInfo, type Process, type ProgressTimeline, type ProjectionEventName, type ProjectionNodeConfig, type ProjectionNodeOptions, type PropagateOptions, type RGBA, type ReducedMotionConfig, type RepeatType, type ResolvedConstraints, type ResolvedElastic, type ResolvedKeyframes, type ResolvedValueKeyframe, type ResolvedValues$1 as ResolvedValues, type SVGAttributes, type SVGForcedAttrKeyframesDefinition, type SVGForcedAttrProperties, type SVGForcedAttrTransitions, type SVGKeyframesDefinition, type SVGPathKeyframesDefinition, type SVGPathProperties, type SVGPathTransitions, type SVGRenderState, type SVGTransitions, SVGVisualElement, type ScaleCorrectionNode, type ScaleCorrector, type ScaleCorrectorDefinition, type ScaleCorrectorMap, type Schedule, type ScrapeMotionValuesFromProps, type ScrollMeasurements, type SelectorCache, type SingleTransformer, type Spring, type SpringOptions, type StaggerOptions, type StaggerOrigin, type StartAnimation, type Stats, type StatsBuffer, type StatsRecording, type StatsSummary, type Step, type StepId, type Steps, type StyleKeyframesDefinition, type StyleTransitions, type Subscriber, type Summary, type TapHandlers, type TapInfo, type Target, type TargetAndTransition, type TargetResolver, type TimelineWithFallback, type TransformInputRange, type TransformOptions, type TransformOrigin, type TransformProperties, type TransformTemplate, type Transformer, type Transition, type TransitionWithValueOverrides, type Tween, type UnresolvedKeyframes, type UnresolvedValueKeyframe, type UseRenderState, type ValueAnimationOptions, type ValueAnimationOptionsWithRenderContext, type ValueAnimationTransition, type ValueAnimationWithDynamicDelay, type ValueIndexes, type ValueKeyframe, type ValueKeyframesDefinition, type ValueTransformer, type ValueTransition, type ValueType, type ValueTypeMap, type VariableKeyframesDefinition, type VariableTransitions, type Variant, type VariantLabels, type Variants, type VelocityOptions, type ViewTransitionAnimationDefinition, ViewTransitionBuilder, type ViewTransitionOptions, type ViewTransitionTarget, type ViewTransitionTargetDefinition, type ViewportEventHandler, type ViewportOptions, VisualElement, type VisualElementAnimationOptions, type VisualElementEventCallbacks, type VisualElementOptions, type VisualState, type WillChange, type WithAppearProps, type WithDepth, type WithQuerySelectorAll, acceleratedValues, activeAnimations, addAttrValue, addDomEvent, addScaleCorrector, addStyleValue, addValueToWillChange, alpha, analyseComplexValue, animateMotionValue, animateSingleValue, animateTarget, animateValue, animateVariant, animateView, animateVisualElement, animationMapKey, applyAxisDelta, applyBoxDelta, applyGeneratorOptions, applyPointDelta, applyPxDefaults, applyTreeDeltas, arc, aspectRatio, attachFollow, attachSpring, attrEffect, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, buildHTMLStyles, buildProjectionTransform, buildSVGAttrs, buildSVGPath, buildTransform, calcAxisDelta, calcBoxDelta, calcChildStagger, calcGeneratorDuration, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, camelCaseAttributes, camelToDash, cancelFrame, cancelMicrotask, cancelSync, checkVariantsDidChange, cleanDirtyNodes, collectMotionValues, color, compareByDepth, complex, containsCSSVariable, convertBoundingBoxToBox, convertBoxToBoundingBox, convertOffsetToTimes, copyAxisDeltaInto, copyAxisInto, copyBoxInto, correctBorderRadius, correctBoxShadow, createAnimationState, createAxis, createAxisDelta, createBox, createDelta, createGeneratorEasing, createProjectionNode, createRenderBatcher, cubicBezierAsString, defaultEasing, defaultOffset, defaultTransformValue, defaultValueTypes, degrees, delay, delayInSeconds, dimensionValueTypes, eachAxis, fillOffset, fillWildcards, findDimensionValueType, findValueType, flushKeyframeResolvers, followValue, frame, frameData, frameSteps, generateLinearEasing, getAnimatableNone, getAnimationMap, getComputedStyle, getDefaultTransition, getDefaultValueType, getFeatureDefinitions, getFinalKeyframe, getMixer, getOptimisedAppearId, getOriginIndex, getValueAsType, getValueTransition, getVariableValue, getVariantContext, getViewAnimationLayerInfo, getViewAnimations, globalProjectionState, has2DTranslate, hasReducedMotionListener, hasScale, hasTransform, hex, hover, hsla, hslaToRgba, inertia, initPrefersReducedMotion, interpolate, invisibleValues, isAnimationControls, isCSSVariableName, isCSSVariableToken, isControllingVariants, isDeltaZero, isDragActive, isDragging, isElementKeyboardAccessible, isElementTextInput, isForcedMotionValue, isGenerator, isHTMLElement, isKeyframesTarget, isMotionValue, isNear, isNodeOrChild, isPrimaryPointer, isSVGElement, isSVGSVGElement, isSVGTag, isTransitionDefined, isVariantLabel, isVariantNode, isWaapiSupportedEasing, isWillChangeMotionValue, keyframes, makeAnimationInstant, mapEasingToNativeEasing, mapValue, maxGeneratorDuration, measurePageBox, measureViewportBox, microtask, mix, mixArray, mixColor, mixComplex, mixImmediate, mixLinearColor, mixNumber, mixObject, mixValues, mixVisibility, motionValue, nodeGroup, number, numberValueTypes, observeTimeline, optimizedAppearDataAttribute, optimizedAppearDataId, parseAnimateLayoutArgs, parseCSSVariable, parseValueFromTransform, percent, pixelsToPercent, positionalKeys, prefersReducedMotion, press, progressPercentage, propEffect, propagateDirtyNodes, px, readTransformValue, recordStats, removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta, renderHTML, renderSVG, resize, resolveElements, resolveMotionValue, resolveTransition, resolveVariant, resolveVariantFromProps, rgbUnit, rgba, rootProjectionNode, scale, scaleCorrectors, scalePoint, scrapeMotionValuesFromProps$1 as scrapeHTMLMotionValuesFromProps, scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps, setDragLock, setFeatureDefinitions, setStyle, setTarget, spring, springValue, stagger, startWaapiAnimation, statsBuffer, styleEffect, supportedWaapiEasing, supportsBrowserAnimation, supportsFlags, supportsLinearEasing, supportsPartialKeyframes, supportsScrollTimeline, supportsViewTimeline, svgEffect, sync, testValueType, time, transform, transformAxis, transformBox, transformBoxPoints, transformPropOrder, transformProps, transformValue, transformValueTypes, translateAxis, updateMotionValuesFromProps, variantPriorityOrder, variantProps, vh, visualElementStore, vw };
|