framer-motion 12.23.21 → 12.23.22
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/README.md +1 -1
- package/dist/cjs/index.js +4 -0
- package/dist/dom.d.ts +123 -1
- package/dist/es/components/AnimatePresence/PopChild.mjs +1 -1
- package/dist/es/index.mjs +1 -0
- package/dist/es/{components/AnimatePresence → utils}/use-composed-ref.mjs +3 -0
- package/dist/framer-motion.dev.js +4 -0
- package/dist/framer-motion.js +1 -1
- package/dist/types/index.d.ts +93 -82
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -298,87 +298,6 @@ interface MotionConfigProps extends Partial<MotionConfigContext> {
|
|
|
298
298
|
*/
|
|
299
299
|
declare function MotionConfig({ children, isValidProp, ...config }: MotionConfigProps): react_jsx_runtime.JSX.Element;
|
|
300
300
|
|
|
301
|
-
type ReorderElementTag = keyof HTMLElements;
|
|
302
|
-
type DefaultGroupElement = "ul";
|
|
303
|
-
type DefaultItemElement = "li";
|
|
304
|
-
|
|
305
|
-
interface Props$1<V, TagName extends ReorderElementTag = DefaultGroupElement> {
|
|
306
|
-
/**
|
|
307
|
-
* A HTML element to render this component as. Defaults to `"ul"`.
|
|
308
|
-
*
|
|
309
|
-
* @public
|
|
310
|
-
*/
|
|
311
|
-
as?: TagName;
|
|
312
|
-
/**
|
|
313
|
-
* The axis to reorder along. By default, items will be draggable on this axis.
|
|
314
|
-
* To make draggable on both axes, set `<Reorder.Item drag />`
|
|
315
|
-
*
|
|
316
|
-
* @public
|
|
317
|
-
*/
|
|
318
|
-
axis?: "x" | "y";
|
|
319
|
-
/**
|
|
320
|
-
* A callback to fire with the new value order. For instance, if the values
|
|
321
|
-
* are provided as a state from `useState`, this could be the set state function.
|
|
322
|
-
*
|
|
323
|
-
* @public
|
|
324
|
-
*/
|
|
325
|
-
onReorder: (newOrder: V[]) => void;
|
|
326
|
-
/**
|
|
327
|
-
* The latest values state.
|
|
328
|
-
*
|
|
329
|
-
* ```jsx
|
|
330
|
-
* function Component() {
|
|
331
|
-
* const [items, setItems] = useState([0, 1, 2])
|
|
332
|
-
*
|
|
333
|
-
* return (
|
|
334
|
-
* <Reorder.Group values={items} onReorder={setItems}>
|
|
335
|
-
* {items.map((item) => <Reorder.Item key={item} value={item} />)}
|
|
336
|
-
* </Reorder.Group>
|
|
337
|
-
* )
|
|
338
|
-
* }
|
|
339
|
-
* ```
|
|
340
|
-
*
|
|
341
|
-
* @public
|
|
342
|
-
*/
|
|
343
|
-
values: V[];
|
|
344
|
-
}
|
|
345
|
-
type ReorderGroupProps<V, TagName extends ReorderElementTag = DefaultGroupElement> = Props$1<V, TagName> & Omit<HTMLMotionProps<TagName>, "values"> & React$1.PropsWithChildren<{}>;
|
|
346
|
-
declare function ReorderGroupComponent<V, TagName extends ReorderElementTag = DefaultGroupElement>({ children, as, axis, onReorder, values, ...props }: ReorderGroupProps<V, TagName>, externalRef?: React$1.ForwardedRef<any>): JSX.Element;
|
|
347
|
-
declare const ReorderGroup: <V, TagName extends keyof HTMLElements = "ul">(props: ReorderGroupProps<V, TagName> & {
|
|
348
|
-
ref?: React$1.ForwardedRef<any>;
|
|
349
|
-
}) => ReturnType<typeof ReorderGroupComponent>;
|
|
350
|
-
|
|
351
|
-
interface Props<V, TagName extends ReorderElementTag = DefaultItemElement> {
|
|
352
|
-
/**
|
|
353
|
-
* A HTML element to render this component as. Defaults to `"li"`.
|
|
354
|
-
*
|
|
355
|
-
* @public
|
|
356
|
-
*/
|
|
357
|
-
as?: TagName;
|
|
358
|
-
/**
|
|
359
|
-
* The value in the list that this component represents.
|
|
360
|
-
*
|
|
361
|
-
* @public
|
|
362
|
-
*/
|
|
363
|
-
value: V;
|
|
364
|
-
/**
|
|
365
|
-
* A subset of layout options primarily used to disable layout="size"
|
|
366
|
-
*
|
|
367
|
-
* @public
|
|
368
|
-
* @default true
|
|
369
|
-
*/
|
|
370
|
-
layout?: true | "position";
|
|
371
|
-
}
|
|
372
|
-
type ReorderItemProps<V, TagName extends ReorderElementTag = DefaultItemElement> = Props<V, TagName> & Omit<HTMLMotionProps<TagName>, "value" | "layout"> & React$1.PropsWithChildren<{}>;
|
|
373
|
-
declare function ReorderItemComponent<V, TagName extends ReorderElementTag = DefaultItemElement>({ children, style, value, as, onDrag, layout, ...props }: ReorderItemProps<V, TagName>, externalRef?: React$1.ForwardedRef<any>): JSX.Element;
|
|
374
|
-
declare const ReorderItem: <V, TagName extends keyof HTMLElements = "li">(props: ReorderItemProps<V, TagName> & {
|
|
375
|
-
ref?: React$1.ForwardedRef<any>;
|
|
376
|
-
}) => ReturnType<typeof ReorderItemComponent>;
|
|
377
|
-
|
|
378
|
-
declare namespace namespace_d {
|
|
379
|
-
export { ReorderGroup as Group, ReorderItem as Item };
|
|
380
|
-
}
|
|
381
|
-
|
|
382
301
|
type ObjectTarget<O> = {
|
|
383
302
|
[K in keyof O]?: O[K] | UnresolvedValueKeyframe[];
|
|
384
303
|
};
|
|
@@ -527,6 +446,87 @@ declare function delay(callback: DelayedFunction, timeout: number): () => void;
|
|
|
527
446
|
declare const distance: (a: number, b: number) => number;
|
|
528
447
|
declare function distance2D(a: Point, b: Point): number;
|
|
529
448
|
|
|
449
|
+
type ReorderElementTag = keyof HTMLElements;
|
|
450
|
+
type DefaultGroupElement = "ul";
|
|
451
|
+
type DefaultItemElement = "li";
|
|
452
|
+
|
|
453
|
+
interface Props$1<V, TagName extends ReorderElementTag = DefaultGroupElement> {
|
|
454
|
+
/**
|
|
455
|
+
* A HTML element to render this component as. Defaults to `"ul"`.
|
|
456
|
+
*
|
|
457
|
+
* @public
|
|
458
|
+
*/
|
|
459
|
+
as?: TagName;
|
|
460
|
+
/**
|
|
461
|
+
* The axis to reorder along. By default, items will be draggable on this axis.
|
|
462
|
+
* To make draggable on both axes, set `<Reorder.Item drag />`
|
|
463
|
+
*
|
|
464
|
+
* @public
|
|
465
|
+
*/
|
|
466
|
+
axis?: "x" | "y";
|
|
467
|
+
/**
|
|
468
|
+
* A callback to fire with the new value order. For instance, if the values
|
|
469
|
+
* are provided as a state from `useState`, this could be the set state function.
|
|
470
|
+
*
|
|
471
|
+
* @public
|
|
472
|
+
*/
|
|
473
|
+
onReorder: (newOrder: V[]) => void;
|
|
474
|
+
/**
|
|
475
|
+
* The latest values state.
|
|
476
|
+
*
|
|
477
|
+
* ```jsx
|
|
478
|
+
* function Component() {
|
|
479
|
+
* const [items, setItems] = useState([0, 1, 2])
|
|
480
|
+
*
|
|
481
|
+
* return (
|
|
482
|
+
* <Reorder.Group values={items} onReorder={setItems}>
|
|
483
|
+
* {items.map((item) => <Reorder.Item key={item} value={item} />)}
|
|
484
|
+
* </Reorder.Group>
|
|
485
|
+
* )
|
|
486
|
+
* }
|
|
487
|
+
* ```
|
|
488
|
+
*
|
|
489
|
+
* @public
|
|
490
|
+
*/
|
|
491
|
+
values: V[];
|
|
492
|
+
}
|
|
493
|
+
type ReorderGroupProps<V, TagName extends ReorderElementTag = DefaultGroupElement> = Props$1<V, TagName> & Omit<HTMLMotionProps<TagName>, "values"> & React$1.PropsWithChildren<{}>;
|
|
494
|
+
declare function ReorderGroupComponent<V, TagName extends ReorderElementTag = DefaultGroupElement>({ children, as, axis, onReorder, values, ...props }: ReorderGroupProps<V, TagName>, externalRef?: React$1.ForwardedRef<any>): JSX.Element;
|
|
495
|
+
declare const ReorderGroup: <V, TagName extends keyof HTMLElements = "ul">(props: ReorderGroupProps<V, TagName> & {
|
|
496
|
+
ref?: React$1.ForwardedRef<any>;
|
|
497
|
+
}) => ReturnType<typeof ReorderGroupComponent>;
|
|
498
|
+
|
|
499
|
+
interface Props<V, TagName extends ReorderElementTag = DefaultItemElement> {
|
|
500
|
+
/**
|
|
501
|
+
* A HTML element to render this component as. Defaults to `"li"`.
|
|
502
|
+
*
|
|
503
|
+
* @public
|
|
504
|
+
*/
|
|
505
|
+
as?: TagName;
|
|
506
|
+
/**
|
|
507
|
+
* The value in the list that this component represents.
|
|
508
|
+
*
|
|
509
|
+
* @public
|
|
510
|
+
*/
|
|
511
|
+
value: V;
|
|
512
|
+
/**
|
|
513
|
+
* A subset of layout options primarily used to disable layout="size"
|
|
514
|
+
*
|
|
515
|
+
* @public
|
|
516
|
+
* @default true
|
|
517
|
+
*/
|
|
518
|
+
layout?: true | "position";
|
|
519
|
+
}
|
|
520
|
+
type ReorderItemProps<V, TagName extends ReorderElementTag = DefaultItemElement> = Props<V, TagName> & Omit<HTMLMotionProps<TagName>, "value" | "layout"> & React$1.PropsWithChildren<{}>;
|
|
521
|
+
declare function ReorderItemComponent<V, TagName extends ReorderElementTag = DefaultItemElement>({ children, style, value, as, onDrag, layout, ...props }: ReorderItemProps<V, TagName>, externalRef?: React$1.ForwardedRef<any>): JSX.Element;
|
|
522
|
+
declare const ReorderItem: <V, TagName extends keyof HTMLElements = "li">(props: ReorderItemProps<V, TagName> & {
|
|
523
|
+
ref?: React$1.ForwardedRef<any>;
|
|
524
|
+
}) => ReturnType<typeof ReorderItemComponent>;
|
|
525
|
+
|
|
526
|
+
declare namespace namespace_d {
|
|
527
|
+
export { ReorderGroup as Group, ReorderItem as Item };
|
|
528
|
+
}
|
|
529
|
+
|
|
530
530
|
type MotionComponentProps<Props> = {
|
|
531
531
|
[K in Exclude<keyof Props, keyof MotionProps>]?: Props[K];
|
|
532
532
|
} & MotionProps;
|
|
@@ -568,6 +568,17 @@ declare const createBox: () => Box;
|
|
|
568
568
|
|
|
569
569
|
declare const isBrowser: boolean;
|
|
570
570
|
|
|
571
|
+
/**
|
|
572
|
+
* Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx
|
|
573
|
+
*/
|
|
574
|
+
|
|
575
|
+
type PossibleRef<T> = React$1.Ref<T> | undefined;
|
|
576
|
+
/**
|
|
577
|
+
* A custom hook that composes multiple refs
|
|
578
|
+
* Accepts callback refs and RefObject(s)
|
|
579
|
+
*/
|
|
580
|
+
declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): React$1.RefCallback<T>;
|
|
581
|
+
|
|
571
582
|
declare function useForceUpdate(): [VoidFunction, number];
|
|
572
583
|
|
|
573
584
|
declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
@@ -1239,4 +1250,4 @@ interface ScaleMotionValues {
|
|
|
1239
1250
|
*/
|
|
1240
1251
|
declare function useInvertedScale(scale?: Partial<ScaleMotionValues>): ScaleMotionValues;
|
|
1241
1252
|
|
|
1242
|
-
export { type AbsoluteKeyframe, AnimatePresence, type AnimatePresenceProps, AnimateSharedLayout, type AnimationSequence, type At, CreateVisualElement, type Cycle, type CycleState, DOMMotionComponents, type DOMSegment, type DOMSegmentWithTransition, type DelayedFunction, DeprecatedLayoutGroupContext, DragControls, type FeatureBundle, type FeatureDefinition, type FeatureDefinitions, type FeaturePackage, type FeaturePackages, HTMLMotionProps, type HydratedFeatureDefinition, type HydratedFeatureDefinitions, IProjectionNode, LayoutGroup, LayoutGroupContext, type LazyFeatureBundle$1 as LazyFeatureBundle, LazyMotion, type LazyProps, MotionConfig, MotionConfigContext, type MotionConfigProps, MotionContext, MotionProps, type MotionValueSegment, type MotionValueSegmentWithTransition, type ObjectSegment, type ObjectSegmentWithTransition, type ObjectTarget, namespace_d as Reorder, type ResolveKeyframes, type ResolvedAnimationDefinition, type ResolvedAnimationDefinitions, ResolvedValues, type ScrollMotionValues, type Segment, type SequenceLabel, type SequenceLabelWithTime, type SequenceMap, type SequenceOptions, type SequenceTime, type UseInViewOptions, type UseScrollOptions, type ValueSequence, VisualElement, WillChangeMotionValue, addPointerEvent, addPointerInfo, addScaleCorrector, animate, animateMini, animateVisualElement, animationControls, animations, buildTransform, calcLength, createBox, createScopedAnimate, delay, disableInstantTransitions, distance, distance2D, domAnimation, domMax, domMin, filterProps, inView, isBrowser, isMotionComponent, isValidMotionProp, m, motion, resolveMotionValue, scroll, scrollInfo, startOptimizedAppearAnimation, unwrapMotionComponent, useAnimate, useAnimateMini, useAnimation, useAnimationControls, useAnimationFrame, useCycle, useAnimatedState as useDeprecatedAnimatedState, useInvertedScale as useDeprecatedInvertedScale, useDomEvent, useDragControls, useElementScroll, useForceUpdate, useInView, useInstantLayoutTransition, useInstantTransition, useIsPresent, useIsomorphicLayoutEffect, useMotionTemplate, useMotionValue, useMotionValueEvent, usePageInView, usePresence, usePresenceData, useReducedMotion, useReducedMotionConfig, useResetProjection, useScroll, useSpring, useTime, useTransform, useUnmountEffect, useVelocity, useViewportScroll, useWillChange, visualElementStore };
|
|
1253
|
+
export { type AbsoluteKeyframe, AnimatePresence, type AnimatePresenceProps, AnimateSharedLayout, type AnimationSequence, type At, CreateVisualElement, type Cycle, type CycleState, DOMMotionComponents, type DOMSegment, type DOMSegmentWithTransition, type DelayedFunction, DeprecatedLayoutGroupContext, DragControls, type FeatureBundle, type FeatureDefinition, type FeatureDefinitions, type FeaturePackage, type FeaturePackages, HTMLElements, HTMLMotionProps, type HydratedFeatureDefinition, type HydratedFeatureDefinitions, IProjectionNode, LayoutGroup, LayoutGroupContext, type LazyFeatureBundle$1 as LazyFeatureBundle, LazyMotion, type LazyProps, MotionConfig, MotionConfigContext, type MotionConfigProps, MotionContext, MotionProps, type MotionValueSegment, type MotionValueSegmentWithTransition, type ObjectSegment, type ObjectSegmentWithTransition, type ObjectTarget, namespace_d as Reorder, type ResolveKeyframes, type ResolvedAnimationDefinition, type ResolvedAnimationDefinitions, ResolvedValues, type ScrollMotionValues, type Segment, type SequenceLabel, type SequenceLabelWithTime, type SequenceMap, type SequenceOptions, type SequenceTime, type UseInViewOptions, type UseScrollOptions, type ValueSequence, VisualElement, WillChangeMotionValue, addPointerEvent, addPointerInfo, addScaleCorrector, animate, animateMini, animateVisualElement, animationControls, animations, buildTransform, calcLength, createBox, createScopedAnimate, delay, disableInstantTransitions, distance, distance2D, domAnimation, domMax, domMin, filterProps, inView, isBrowser, isMotionComponent, isValidMotionProp, m, motion, resolveMotionValue, scroll, scrollInfo, startOptimizedAppearAnimation, unwrapMotionComponent, useAnimate, useAnimateMini, useAnimation, useAnimationControls, useAnimationFrame, useComposedRefs, useCycle, useAnimatedState as useDeprecatedAnimatedState, useInvertedScale as useDeprecatedInvertedScale, useDomEvent, useDragControls, useElementScroll, useForceUpdate, useInView, useInstantLayoutTransition, useInstantTransition, useIsPresent, useIsomorphicLayoutEffect, useMotionTemplate, useMotionValue, useMotionValueEvent, usePageInView, usePresence, usePresenceData, useReducedMotion, useReducedMotionConfig, useResetProjection, useScroll, useSpring, useTime, useTransform, useUnmountEffect, useVelocity, useViewportScroll, useWillChange, visualElementStore };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "framer-motion",
|
|
3
|
-
"version": "12.23.
|
|
3
|
+
"version": "12.23.22",
|
|
4
4
|
"description": "A simple and powerful JavaScript animation library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.mjs",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"maxSize": "2.26 kB"
|
|
143
143
|
}
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "bb14a6dc82fea534f0f295439d60cc05dd9b935f"
|
|
146
146
|
}
|