|
| 1 | +diff --git a/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/Easing.web.js b/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/Easing.web.js |
| 2 | +index ed0f9d3..6baf136 100644 |
| 3 | +--- a/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/Easing.web.js |
| 4 | ++++ b/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/Easing.web.js |
| 5 | +@@ -14,4 +14,18 @@ export const WebEasings = { |
| 6 | + export function getEasingByName(easingName) { |
| 7 | + return `cubic-bezier(${WebEasings[easingName].toString()})`; |
| 8 | + } |
| 9 | +-//# sourceMappingURL=Easing.web.js.map |
| 10 | +\ No newline at end of file |
| 11 | ++export function maybeGetBezierEasing(easing) { |
| 12 | ++ if (!('factory' in easing)) { |
| 13 | ++ return null; |
| 14 | ++ } |
| 15 | ++ const easingFactory = easing.factory; |
| 16 | ++ if (!('__closure' in easingFactory)) { |
| 17 | ++ return null; |
| 18 | ++ } |
| 19 | ++ const closure = easingFactory.__closure; |
| 20 | ++ if (!('Bezier' in closure)) { |
| 21 | ++ return null; |
| 22 | ++ } |
| 23 | ++ return `cubic-bezier(${closure.x1}, ${closure.y1}, ${closure.x2}, ${closure.y2})`; |
| 24 | ++} |
| 25 | ++ |
| 26 | +diff --git a/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/componentUtils.js b/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/componentUtils.js |
| 27 | +index 7f724c4..ad53a74 100644 |
| 28 | +--- a/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/componentUtils.js |
| 29 | ++++ b/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/componentUtils.js |
| 30 | +@@ -10,18 +10,28 @@ import { setElementPosition, snapshots } from "./componentStyle.js"; |
| 31 | + import { Animations, TransitionType } from "./config.js"; |
| 32 | + import { TransitionGenerator } from "./createAnimation.js"; |
| 33 | + import { scheduleAnimationCleanup } from "./domUtils.js"; |
| 34 | +-import { getEasingByName, WebEasings } from "./Easing.web.js"; |
| 35 | ++import { |
| 36 | ++ getEasingByName, |
| 37 | ++ maybeGetBezierEasing, |
| 38 | ++ WebEasings |
| 39 | ++} from "./Easing.web.js"; |
| 40 | + import { prepareCurvedTransition } from "./transition/Curved.web.js"; |
| 41 | + function getEasingFromConfig(config) { |
| 42 | + if (!config.easingV) { |
| 43 | + return getEasingByName('linear'); |
| 44 | + } |
| 45 | + const easingName = config.easingV[EasingNameSymbol]; |
| 46 | +- if (!(easingName in WebEasings)) { |
| 47 | +- logger.warn(`Selected easing is not currently supported on web.`); |
| 48 | ++ if (easingName in WebEasings) { |
| 49 | ++ return getEasingByName(easingName); |
| 50 | ++ } |
| 51 | ++ const bezierEasing = maybeGetBezierEasing(config.easingV); |
| 52 | ++ if (!bezierEasing) { |
| 53 | ++ logger.warn( |
| 54 | ++ `Selected easing is not currently supported on web. Using linear easing instead.` |
| 55 | ++ ); |
| 56 | + return getEasingByName('linear'); |
| 57 | + } |
| 58 | +- return getEasingByName(easingName); |
| 59 | ++ return bezierEasing; |
| 60 | + } |
| 61 | + function getRandomDelay(maxDelay = 1000) { |
| 62 | + return Math.floor(Math.random() * (maxDelay + 1)) / 1000; |
0 commit comments