motion 11.16.0 → 11.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/react-client.js +139 -134
- package/dist/cjs/react-m.js +156 -152
- package/dist/es/framer-motion/dist/es/motion/index.mjs +11 -7
- package/dist/es/framer-motion/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/framer-motion/dist/es/value/index.mjs +1 -1
- package/dist/es/motion/lib/react.mjs +29 -29
- package/dist/es/motion-dom/dist/es/gestures/press/index.mjs +4 -3
- package/dist/motion.dev.js +2 -2
- package/dist/motion.js +1 -1
- package/package.json +3 -3
package/dist/cjs/react-m.js
CHANGED
|
@@ -5,6 +5,27 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
|
|
8
|
+
const noop = (any) => any;
|
|
9
|
+
|
|
10
|
+
let warning = noop;
|
|
11
|
+
let invariant = noop;
|
|
12
|
+
if (process.env.NODE_ENV !== "production") {
|
|
13
|
+
warning = (check, message) => {
|
|
14
|
+
if (!check && typeof console !== "undefined") {
|
|
15
|
+
console.warn(message);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
invariant = (check, message) => {
|
|
19
|
+
if (!check) {
|
|
20
|
+
throw new Error(message);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const LayoutGroupContext = react.createContext({});
|
|
26
|
+
|
|
27
|
+
const LazyContext = react.createContext({ strict: false });
|
|
28
|
+
|
|
8
29
|
/**
|
|
9
30
|
* @public
|
|
10
31
|
*/
|
|
@@ -17,15 +38,142 @@ const MotionConfigContext = react.createContext({
|
|
|
17
38
|
const MotionContext = react.createContext({});
|
|
18
39
|
|
|
19
40
|
/**
|
|
20
|
-
*
|
|
41
|
+
* Decides if the supplied variable is variant label
|
|
21
42
|
*/
|
|
22
|
-
|
|
43
|
+
function isVariantLabel(v) {
|
|
44
|
+
return typeof v === "string" || Array.isArray(v);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function isAnimationControls(v) {
|
|
48
|
+
return (v !== null &&
|
|
49
|
+
typeof v === "object" &&
|
|
50
|
+
typeof v.start === "function");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const variantPriorityOrder = [
|
|
54
|
+
"animate",
|
|
55
|
+
"whileInView",
|
|
56
|
+
"whileFocus",
|
|
57
|
+
"whileHover",
|
|
58
|
+
"whileTap",
|
|
59
|
+
"whileDrag",
|
|
60
|
+
"exit",
|
|
61
|
+
];
|
|
62
|
+
const variantProps = ["initial", ...variantPriorityOrder];
|
|
63
|
+
|
|
64
|
+
function isControllingVariants(props) {
|
|
65
|
+
return (isAnimationControls(props.animate) ||
|
|
66
|
+
variantProps.some((name) => isVariantLabel(props[name])));
|
|
67
|
+
}
|
|
68
|
+
function isVariantNode(props) {
|
|
69
|
+
return Boolean(isControllingVariants(props) || props.variants);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function getCurrentTreeVariants(props, context) {
|
|
73
|
+
if (isControllingVariants(props)) {
|
|
74
|
+
const { initial, animate } = props;
|
|
75
|
+
return {
|
|
76
|
+
initial: initial === false || isVariantLabel(initial)
|
|
77
|
+
? initial
|
|
78
|
+
: undefined,
|
|
79
|
+
animate: isVariantLabel(animate) ? animate : undefined,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return props.inherit !== false ? context : {};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function useCreateMotionContext(props) {
|
|
86
|
+
const { initial, animate } = getCurrentTreeVariants(props, react.useContext(MotionContext));
|
|
87
|
+
return react.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);
|
|
88
|
+
}
|
|
89
|
+
function variantLabelsAsDependency(prop) {
|
|
90
|
+
return Array.isArray(prop) ? prop.join(" ") : prop;
|
|
91
|
+
}
|
|
23
92
|
|
|
24
93
|
const isBrowser = typeof window !== "undefined";
|
|
25
94
|
|
|
26
|
-
const
|
|
95
|
+
const featureProps = {
|
|
96
|
+
animation: [
|
|
97
|
+
"animate",
|
|
98
|
+
"variants",
|
|
99
|
+
"whileHover",
|
|
100
|
+
"whileTap",
|
|
101
|
+
"exit",
|
|
102
|
+
"whileInView",
|
|
103
|
+
"whileFocus",
|
|
104
|
+
"whileDrag",
|
|
105
|
+
],
|
|
106
|
+
exit: ["exit"],
|
|
107
|
+
drag: ["drag", "dragControls"],
|
|
108
|
+
focus: ["whileFocus"],
|
|
109
|
+
hover: ["whileHover", "onHoverStart", "onHoverEnd"],
|
|
110
|
+
tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
|
|
111
|
+
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
112
|
+
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
113
|
+
layout: ["layout", "layoutId"],
|
|
114
|
+
};
|
|
115
|
+
const featureDefinitions = {};
|
|
116
|
+
for (const key in featureProps) {
|
|
117
|
+
featureDefinitions[key] = {
|
|
118
|
+
isEnabled: (props) => featureProps[key].some((name) => !!props[name]),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
27
121
|
|
|
28
|
-
|
|
122
|
+
function loadFeatures(features) {
|
|
123
|
+
for (const key in features) {
|
|
124
|
+
featureDefinitions[key] = {
|
|
125
|
+
...featureDefinitions[key],
|
|
126
|
+
...features[key],
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const motionComponentSymbol = Symbol.for("motionComponentSymbol");
|
|
132
|
+
|
|
133
|
+
function isRefObject(ref) {
|
|
134
|
+
return (ref &&
|
|
135
|
+
typeof ref === "object" &&
|
|
136
|
+
Object.prototype.hasOwnProperty.call(ref, "current"));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Creates a ref function that, when called, hydrates the provided
|
|
141
|
+
* external ref and VisualElement.
|
|
142
|
+
*/
|
|
143
|
+
function useMotionRef(visualState, visualElement, externalRef) {
|
|
144
|
+
return react.useCallback((instance) => {
|
|
145
|
+
instance && visualState.mount && visualState.mount(instance);
|
|
146
|
+
if (visualElement) {
|
|
147
|
+
if (instance) {
|
|
148
|
+
visualElement.mount(instance);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
visualElement.unmount();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (externalRef) {
|
|
155
|
+
if (typeof externalRef === "function") {
|
|
156
|
+
externalRef(instance);
|
|
157
|
+
}
|
|
158
|
+
else if (isRefObject(externalRef)) {
|
|
159
|
+
externalRef.current = instance;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* Only pass a new ref callback to React if we've received a visual element
|
|
165
|
+
* factory. Otherwise we'll be mounting/remounting every time externalRef
|
|
166
|
+
* or other dependencies change.
|
|
167
|
+
*/
|
|
168
|
+
[visualElement]);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @public
|
|
173
|
+
*/
|
|
174
|
+
const PresenceContext = react.createContext(null);
|
|
175
|
+
|
|
176
|
+
const useIsomorphicLayoutEffect = isBrowser ? react.useLayoutEffect : react.useEffect;
|
|
29
177
|
|
|
30
178
|
/**
|
|
31
179
|
* Convert camelCase to dash-case properties.
|
|
@@ -185,12 +333,6 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
|
185
333
|
|
|
186
334
|
const { schedule: microtask, cancel: cancelMicrotask } = createRenderBatcher(queueMicrotask, false);
|
|
187
335
|
|
|
188
|
-
function isRefObject(ref) {
|
|
189
|
-
return (ref &&
|
|
190
|
-
typeof ref === "object" &&
|
|
191
|
-
Object.prototype.hasOwnProperty.call(ref, "current"));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
336
|
/**
|
|
195
337
|
* Internal, exported only for usage in Framer
|
|
196
338
|
*/
|
|
@@ -318,148 +460,6 @@ function getClosestProjectingNode(visualElement) {
|
|
|
318
460
|
: getClosestProjectingNode(visualElement.parent);
|
|
319
461
|
}
|
|
320
462
|
|
|
321
|
-
/**
|
|
322
|
-
* Creates a ref function that, when called, hydrates the provided
|
|
323
|
-
* external ref and VisualElement.
|
|
324
|
-
*/
|
|
325
|
-
function useMotionRef(visualState, visualElement, externalRef) {
|
|
326
|
-
return react.useCallback((instance) => {
|
|
327
|
-
instance && visualState.mount && visualState.mount(instance);
|
|
328
|
-
if (visualElement) {
|
|
329
|
-
if (instance) {
|
|
330
|
-
visualElement.mount(instance);
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
333
|
-
visualElement.unmount();
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
if (externalRef) {
|
|
337
|
-
if (typeof externalRef === "function") {
|
|
338
|
-
externalRef(instance);
|
|
339
|
-
}
|
|
340
|
-
else if (isRefObject(externalRef)) {
|
|
341
|
-
externalRef.current = instance;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
},
|
|
345
|
-
/**
|
|
346
|
-
* Only pass a new ref callback to React if we've received a visual element
|
|
347
|
-
* factory. Otherwise we'll be mounting/remounting every time externalRef
|
|
348
|
-
* or other dependencies change.
|
|
349
|
-
*/
|
|
350
|
-
[visualElement]);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Decides if the supplied variable is variant label
|
|
355
|
-
*/
|
|
356
|
-
function isVariantLabel(v) {
|
|
357
|
-
return typeof v === "string" || Array.isArray(v);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
function isAnimationControls(v) {
|
|
361
|
-
return (v !== null &&
|
|
362
|
-
typeof v === "object" &&
|
|
363
|
-
typeof v.start === "function");
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
const variantPriorityOrder = [
|
|
367
|
-
"animate",
|
|
368
|
-
"whileInView",
|
|
369
|
-
"whileFocus",
|
|
370
|
-
"whileHover",
|
|
371
|
-
"whileTap",
|
|
372
|
-
"whileDrag",
|
|
373
|
-
"exit",
|
|
374
|
-
];
|
|
375
|
-
const variantProps = ["initial", ...variantPriorityOrder];
|
|
376
|
-
|
|
377
|
-
function isControllingVariants(props) {
|
|
378
|
-
return (isAnimationControls(props.animate) ||
|
|
379
|
-
variantProps.some((name) => isVariantLabel(props[name])));
|
|
380
|
-
}
|
|
381
|
-
function isVariantNode(props) {
|
|
382
|
-
return Boolean(isControllingVariants(props) || props.variants);
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
function getCurrentTreeVariants(props, context) {
|
|
386
|
-
if (isControllingVariants(props)) {
|
|
387
|
-
const { initial, animate } = props;
|
|
388
|
-
return {
|
|
389
|
-
initial: initial === false || isVariantLabel(initial)
|
|
390
|
-
? initial
|
|
391
|
-
: undefined,
|
|
392
|
-
animate: isVariantLabel(animate) ? animate : undefined,
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
return props.inherit !== false ? context : {};
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
function useCreateMotionContext(props) {
|
|
399
|
-
const { initial, animate } = getCurrentTreeVariants(props, react.useContext(MotionContext));
|
|
400
|
-
return react.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);
|
|
401
|
-
}
|
|
402
|
-
function variantLabelsAsDependency(prop) {
|
|
403
|
-
return Array.isArray(prop) ? prop.join(" ") : prop;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
const featureProps = {
|
|
407
|
-
animation: [
|
|
408
|
-
"animate",
|
|
409
|
-
"variants",
|
|
410
|
-
"whileHover",
|
|
411
|
-
"whileTap",
|
|
412
|
-
"exit",
|
|
413
|
-
"whileInView",
|
|
414
|
-
"whileFocus",
|
|
415
|
-
"whileDrag",
|
|
416
|
-
],
|
|
417
|
-
exit: ["exit"],
|
|
418
|
-
drag: ["drag", "dragControls"],
|
|
419
|
-
focus: ["whileFocus"],
|
|
420
|
-
hover: ["whileHover", "onHoverStart", "onHoverEnd"],
|
|
421
|
-
tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
|
|
422
|
-
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
423
|
-
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
424
|
-
layout: ["layout", "layoutId"],
|
|
425
|
-
};
|
|
426
|
-
const featureDefinitions = {};
|
|
427
|
-
for (const key in featureProps) {
|
|
428
|
-
featureDefinitions[key] = {
|
|
429
|
-
isEnabled: (props) => featureProps[key].some((name) => !!props[name]),
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
function loadFeatures(features) {
|
|
434
|
-
for (const key in features) {
|
|
435
|
-
featureDefinitions[key] = {
|
|
436
|
-
...featureDefinitions[key],
|
|
437
|
-
...features[key],
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
const LayoutGroupContext = react.createContext({});
|
|
443
|
-
|
|
444
|
-
const motionComponentSymbol = Symbol.for("motionComponentSymbol");
|
|
445
|
-
|
|
446
|
-
const noop = (any) => any;
|
|
447
|
-
|
|
448
|
-
let warning = noop;
|
|
449
|
-
let invariant = noop;
|
|
450
|
-
if (process.env.NODE_ENV !== "production") {
|
|
451
|
-
warning = (check, message) => {
|
|
452
|
-
if (!check && typeof console !== "undefined") {
|
|
453
|
-
console.warn(message);
|
|
454
|
-
}
|
|
455
|
-
};
|
|
456
|
-
invariant = (check, message) => {
|
|
457
|
-
if (!check) {
|
|
458
|
-
throw new Error(message);
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
|
|
463
463
|
/**
|
|
464
464
|
* Create a `motion` component.
|
|
465
465
|
*
|
|
@@ -470,6 +470,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
470
470
|
* component "offline", or outside the React render cycle.
|
|
471
471
|
*/
|
|
472
472
|
function createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }) {
|
|
473
|
+
var _a, _b;
|
|
473
474
|
preloadedFeatures && loadFeatures(preloadedFeatures);
|
|
474
475
|
function MotionComponent(props, externalRef) {
|
|
475
476
|
/**
|
|
@@ -503,6 +504,9 @@ function createRendererMotionComponent({ preloadedFeatures, createVisualElement,
|
|
|
503
504
|
*/
|
|
504
505
|
return (jsxRuntime.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsxRuntime.jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)] }));
|
|
505
506
|
}
|
|
507
|
+
MotionComponent.displayName = `motion.${typeof Component === "string"
|
|
508
|
+
? Component
|
|
509
|
+
: `create(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : ""})`}`;
|
|
506
510
|
const ForwardRefMotionComponent = react.forwardRef(MotionComponent);
|
|
507
511
|
ForwardRefMotionComponent[motionComponentSymbol] = Component;
|
|
508
512
|
return ForwardRefMotionComponent;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { warning, invariant } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
3
4
|
import { forwardRef, useContext } from 'react';
|
|
5
|
+
import { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';
|
|
6
|
+
import { LazyContext } from '../context/LazyContext.mjs';
|
|
4
7
|
import { MotionConfigContext } from '../context/MotionConfigContext.mjs';
|
|
5
8
|
import { MotionContext } from '../context/MotionContext/index.mjs';
|
|
6
|
-
import { useVisualElement } from './utils/use-visual-element.mjs';
|
|
7
|
-
import { useMotionRef } from './utils/use-motion-ref.mjs';
|
|
8
9
|
import { useCreateMotionContext } from '../context/MotionContext/create.mjs';
|
|
9
|
-
import { loadFeatures } from './features/load-features.mjs';
|
|
10
10
|
import { isBrowser } from '../utils/is-browser.mjs';
|
|
11
|
-
import { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';
|
|
12
|
-
import { LazyContext } from '../context/LazyContext.mjs';
|
|
13
|
-
import { motionComponentSymbol } from './utils/symbol.mjs';
|
|
14
|
-
import { warning, invariant } from '../../../../motion-utils/dist/es/errors.mjs';
|
|
15
11
|
import { featureDefinitions } from './features/definitions.mjs';
|
|
12
|
+
import { loadFeatures } from './features/load-features.mjs';
|
|
13
|
+
import { motionComponentSymbol } from './utils/symbol.mjs';
|
|
14
|
+
import { useMotionRef } from './utils/use-motion-ref.mjs';
|
|
15
|
+
import { useVisualElement } from './utils/use-visual-element.mjs';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Create a `motion` component.
|
|
@@ -24,6 +24,7 @@ import { featureDefinitions } from './features/definitions.mjs';
|
|
|
24
24
|
* component "offline", or outside the React render cycle.
|
|
25
25
|
*/
|
|
26
26
|
function createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }) {
|
|
27
|
+
var _a, _b;
|
|
27
28
|
preloadedFeatures && loadFeatures(preloadedFeatures);
|
|
28
29
|
function MotionComponent(props, externalRef) {
|
|
29
30
|
/**
|
|
@@ -57,6 +58,9 @@ function createRendererMotionComponent({ preloadedFeatures, createVisualElement,
|
|
|
57
58
|
*/
|
|
58
59
|
return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)] }));
|
|
59
60
|
}
|
|
61
|
+
MotionComponent.displayName = `motion.${typeof Component === "string"
|
|
62
|
+
? Component
|
|
63
|
+
: `create(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : ""})`}`;
|
|
60
64
|
const ForwardRefMotionComponent = forwardRef(MotionComponent);
|
|
61
65
|
ForwardRefMotionComponent[motionComponentSymbol] = Component;
|
|
62
66
|
return ForwardRefMotionComponent;
|
|
@@ -17,7 +17,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
17
17
|
* and warn against mismatches.
|
|
18
18
|
*/
|
|
19
19
|
if (process.env.NODE_ENV === "development") {
|
|
20
|
-
warnOnce(nextValue.version === "11.16.
|
|
20
|
+
warnOnce(nextValue.version === "11.16.2", `Attempting to mix Motion versions ${nextValue.version} with 11.16.2 may not work as expected.`);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
else if (isMotionValue(prevValue)) {
|
|
@@ -34,7 +34,7 @@ class MotionValue {
|
|
|
34
34
|
* This will be replaced by the build step with the latest version number.
|
|
35
35
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
36
36
|
*/
|
|
37
|
-
this.version = "11.16.
|
|
37
|
+
this.version = "11.16.2";
|
|
38
38
|
/**
|
|
39
39
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
40
40
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { motion } from '../../framer-motion/dist/es/render/components/motion/proxy.mjs';
|
|
3
|
-
export { m } from '../../framer-motion/dist/es/render/components/m/proxy.mjs';
|
|
4
2
|
export { AnimatePresence } from '../../framer-motion/dist/es/components/AnimatePresence/index.mjs';
|
|
5
|
-
export { MotionConfig } from '../../framer-motion/dist/es/components/MotionConfig/index.mjs';
|
|
6
|
-
export { LazyMotion } from '../../framer-motion/dist/es/components/LazyMotion/index.mjs';
|
|
7
3
|
export { LayoutGroup } from '../../framer-motion/dist/es/components/LayoutGroup/index.mjs';
|
|
8
|
-
export {
|
|
4
|
+
export { LazyMotion } from '../../framer-motion/dist/es/components/LazyMotion/index.mjs';
|
|
5
|
+
export { MotionConfig } from '../../framer-motion/dist/es/components/MotionConfig/index.mjs';
|
|
6
|
+
export { m } from '../../framer-motion/dist/es/render/components/m/proxy.mjs';
|
|
7
|
+
export { motion } from '../../framer-motion/dist/es/render/components/motion/proxy.mjs';
|
|
9
8
|
export { domAnimation } from '../../framer-motion/dist/es/render/dom/features-animation.mjs';
|
|
10
9
|
export { domMax } from '../../framer-motion/dist/es/render/dom/features-max.mjs';
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export { resolveMotionValue } from '../../framer-motion/dist/es/value/utils/resolve-motion-value.mjs';
|
|
14
|
-
export { useTransform } from '../../framer-motion/dist/es/value/use-transform.mjs';
|
|
15
|
-
export { useSpring } from '../../framer-motion/dist/es/value/use-spring.mjs';
|
|
16
|
-
export { useVelocity } from '../../framer-motion/dist/es/value/use-velocity.mjs';
|
|
17
|
-
export { useScroll } from '../../framer-motion/dist/es/value/use-scroll.mjs';
|
|
10
|
+
export { domMin } from '../../framer-motion/dist/es/render/dom/features-min.mjs';
|
|
11
|
+
export { useMotionValueEvent } from '../../framer-motion/dist/es/utils/use-motion-value-event.mjs';
|
|
18
12
|
export { useElementScroll } from '../../framer-motion/dist/es/value/scroll/use-element-scroll.mjs';
|
|
19
13
|
export { useViewportScroll } from '../../framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs';
|
|
14
|
+
export { useMotionTemplate } from '../../framer-motion/dist/es/value/use-motion-template.mjs';
|
|
15
|
+
export { useMotionValue } from '../../framer-motion/dist/es/value/use-motion-value.mjs';
|
|
16
|
+
export { useScroll } from '../../framer-motion/dist/es/value/use-scroll.mjs';
|
|
17
|
+
export { useSpring } from '../../framer-motion/dist/es/value/use-spring.mjs';
|
|
20
18
|
export { useTime } from '../../framer-motion/dist/es/value/use-time.mjs';
|
|
19
|
+
export { useTransform } from '../../framer-motion/dist/es/value/use-transform.mjs';
|
|
20
|
+
export { useVelocity } from '../../framer-motion/dist/es/value/use-velocity.mjs';
|
|
21
21
|
export { useWillChange } from '../../framer-motion/dist/es/value/use-will-change/index.mjs';
|
|
22
|
-
export {
|
|
22
|
+
export { resolveMotionValue } from '../../framer-motion/dist/es/value/utils/resolve-motion-value.mjs';
|
|
23
23
|
export { useReducedMotion } from '../../framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs';
|
|
24
24
|
export { useReducedMotionConfig } from '../../framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs';
|
|
25
|
+
export { AcceleratedAnimation } from '../../framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs';
|
|
26
|
+
export { animateValue } from '../../framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs';
|
|
25
27
|
export { animationControls } from '../../framer-motion/dist/es/animation/hooks/animation-controls.mjs';
|
|
26
28
|
export { useAnimate } from '../../framer-motion/dist/es/animation/hooks/use-animate.mjs';
|
|
27
29
|
export { useAnimateMini } from '../../framer-motion/dist/es/animation/hooks/use-animate-style.mjs';
|
|
28
30
|
export { useAnimation, useAnimationControls } from '../../framer-motion/dist/es/animation/hooks/use-animation.mjs';
|
|
29
|
-
export { useAnimationFrame } from '../../framer-motion/dist/es/utils/use-animation-frame.mjs';
|
|
30
31
|
export { animateVisualElement } from '../../framer-motion/dist/es/animation/interfaces/visual-element.mjs';
|
|
31
|
-
export { useCycle } from '../../framer-motion/dist/es/utils/use-cycle.mjs';
|
|
32
|
-
export { isValidMotionProp } from '../../framer-motion/dist/es/motion/utils/valid-prop.mjs';
|
|
33
32
|
export { useIsPresent, usePresence } from '../../framer-motion/dist/es/components/AnimatePresence/use-presence.mjs';
|
|
34
|
-
export { useInView } from '../../framer-motion/dist/es/utils/use-in-view.mjs';
|
|
35
|
-
export { DragControls, useDragControls } from '../../framer-motion/dist/es/gestures/drag/use-drag-controls.mjs';
|
|
36
33
|
export { useDomEvent } from '../../framer-motion/dist/es/events/use-dom-event.mjs';
|
|
34
|
+
export { DragControls, useDragControls } from '../../framer-motion/dist/es/gestures/drag/use-drag-controls.mjs';
|
|
37
35
|
export { createRendererMotionComponent } from '../../framer-motion/dist/es/motion/index.mjs';
|
|
38
36
|
export { isMotionComponent } from '../../framer-motion/dist/es/motion/utils/is-motion-component.mjs';
|
|
39
37
|
export { unwrapMotionComponent } from '../../framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs';
|
|
40
|
-
export {
|
|
38
|
+
export { isValidMotionProp } from '../../framer-motion/dist/es/motion/utils/valid-prop.mjs';
|
|
41
39
|
export { addScaleCorrector } from '../../framer-motion/dist/es/projection/styles/scale-correction.mjs';
|
|
42
|
-
export { disableInstantTransitions, useInstantTransition } from '../../framer-motion/dist/es/utils/use-instant-transition.mjs';
|
|
43
40
|
export { useInstantLayoutTransition } from '../../framer-motion/dist/es/projection/use-instant-layout-transition.mjs';
|
|
44
41
|
export { useResetProjection } from '../../framer-motion/dist/es/projection/use-reset-projection.mjs';
|
|
45
42
|
export { buildTransform } from '../../framer-motion/dist/es/render/html/utils/build-transform.mjs';
|
|
46
43
|
export { visualElementStore } from '../../framer-motion/dist/es/render/store.mjs';
|
|
47
|
-
export {
|
|
44
|
+
export { VisualElement } from '../../framer-motion/dist/es/render/VisualElement.mjs';
|
|
45
|
+
export { MotionGlobalConfig } from '../../framer-motion/dist/es/utils/GlobalConfig.mjs';
|
|
46
|
+
export { useAnimationFrame } from '../../framer-motion/dist/es/utils/use-animation-frame.mjs';
|
|
47
|
+
export { useCycle } from '../../framer-motion/dist/es/utils/use-cycle.mjs';
|
|
48
|
+
export { useInView } from '../../framer-motion/dist/es/utils/use-in-view.mjs';
|
|
49
|
+
export { disableInstantTransitions, useInstantTransition } from '../../framer-motion/dist/es/utils/use-instant-transition.mjs';
|
|
48
50
|
export { color } from '../../framer-motion/dist/es/value/types/color/index.mjs';
|
|
49
51
|
export { complex } from '../../framer-motion/dist/es/value/types/complex/index.mjs';
|
|
50
52
|
export { px } from '../../framer-motion/dist/es/value/types/numbers/units.mjs';
|
|
51
|
-
export { MotionGlobalConfig } from '../../framer-motion/dist/es/utils/GlobalConfig.mjs';
|
|
52
|
-
export { AcceleratedAnimation } from '../../framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs';
|
|
53
|
-
export { startOptimizedAppearAnimation } from '../../framer-motion/dist/es/animation/optimized-appear/start.mjs';
|
|
54
|
-
export { optimizedAppearDataAttribute } from '../../framer-motion/dist/es/animation/optimized-appear/data-id.mjs';
|
|
55
53
|
export { spring } from '../../framer-motion/dist/es/animation/generators/spring/index.mjs';
|
|
56
54
|
export { findSpring } from '../../framer-motion/dist/es/animation/generators/spring/find.mjs';
|
|
57
|
-
export {
|
|
55
|
+
export { optimizedAppearDataAttribute } from '../../framer-motion/dist/es/animation/optimized-appear/data-id.mjs';
|
|
56
|
+
export { startOptimizedAppearAnimation } from '../../framer-motion/dist/es/animation/optimized-appear/start.mjs';
|
|
57
|
+
export { LayoutGroupContext } from '../../framer-motion/dist/es/context/LayoutGroupContext.mjs';
|
|
58
58
|
export { MotionConfigContext } from '../../framer-motion/dist/es/context/MotionConfigContext.mjs';
|
|
59
|
+
export { MotionContext } from '../../framer-motion/dist/es/context/MotionContext/index.mjs';
|
|
59
60
|
export { PresenceContext } from '../../framer-motion/dist/es/context/PresenceContext.mjs';
|
|
60
|
-
export { LayoutGroupContext } from '../../framer-motion/dist/es/context/LayoutGroupContext.mjs';
|
|
61
61
|
export { SwitchLayoutGroupContext } from '../../framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs';
|
|
62
62
|
export { FlatTree } from '../../framer-motion/dist/es/render/utils/flat-tree.mjs';
|
|
63
|
-
export { DeprecatedLayoutGroupContext } from '../../framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs';
|
|
64
63
|
export { useAnimatedState as useDeprecatedAnimatedState } from '../../framer-motion/dist/es/animation/hooks/use-animated-state.mjs';
|
|
65
|
-
export { useInvertedScale as useDeprecatedInvertedScale } from '../../framer-motion/dist/es/value/use-inverted-scale.mjs';
|
|
66
64
|
export { AnimateSharedLayout } from '../../framer-motion/dist/es/components/AnimateSharedLayout.mjs';
|
|
65
|
+
export { DeprecatedLayoutGroupContext } from '../../framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs';
|
|
66
|
+
export { useInvertedScale as useDeprecatedInvertedScale } from '../../framer-motion/dist/es/value/use-inverted-scale.mjs';
|
|
67
67
|
export { delay } from '../../framer-motion/dist/es/utils/delay.mjs';
|
|
68
68
|
export { isDragActive } from '../../motion-dom/dist/es/gestures/drag/state/is-active.mjs';
|
|
69
69
|
export { invariant } from '../../motion-utils/dist/es/errors.mjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isDragActive } from '../drag/state/is-active.mjs';
|
|
2
|
+
import { isNodeOrChild } from '../utils/is-node-or-child.mjs';
|
|
2
3
|
import { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';
|
|
3
4
|
import { setupGesture } from '../utils/setup.mjs';
|
|
4
|
-
import { enableKeyboardPress } from './utils/keyboard.mjs';
|
|
5
5
|
import { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs';
|
|
6
|
-
import {
|
|
6
|
+
import { enableKeyboardPress } from './utils/keyboard.mjs';
|
|
7
7
|
import { isPressing } from './utils/state.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -62,7 +62,8 @@ function press(elementOrSelector, onPressStart, options = {}) {
|
|
|
62
62
|
window.addEventListener("pointercancel", onPointerCancel, eventOptions);
|
|
63
63
|
};
|
|
64
64
|
elements.forEach((element) => {
|
|
65
|
-
if (!isElementKeyboardAccessible(element)
|
|
65
|
+
if (!isElementKeyboardAccessible(element) &&
|
|
66
|
+
element.getAttribute("tabindex") === null) {
|
|
66
67
|
element.tabIndex = 0;
|
|
67
68
|
}
|
|
68
69
|
const target = options.useGlobalTarget ? window : element;
|
package/dist/motion.dev.js
CHANGED
|
@@ -1359,7 +1359,7 @@
|
|
|
1359
1359
|
* This will be replaced by the build step with the latest version number.
|
|
1360
1360
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
1361
1361
|
*/
|
|
1362
|
-
this.version = "11.16.
|
|
1362
|
+
this.version = "11.16.2";
|
|
1363
1363
|
/**
|
|
1364
1364
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
1365
1365
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -4295,7 +4295,7 @@
|
|
|
4295
4295
|
* and warn against mismatches.
|
|
4296
4296
|
*/
|
|
4297
4297
|
{
|
|
4298
|
-
warnOnce(nextValue.version === "11.16.
|
|
4298
|
+
warnOnce(nextValue.version === "11.16.2", `Attempting to mix Motion versions ${nextValue.version} with 11.16.2 may not work as expected.`);
|
|
4299
4299
|
}
|
|
4300
4300
|
}
|
|
4301
4301
|
else if (isMotionValue(prevValue)) {
|