From 76f1883aa93938f031bd7b64db8a4a7613078bca Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Thu, 16 Feb 2023 11:32:17 +0800 Subject: [PATCH] upgrade framer motion --- package.json | 2 +- src/SegmentList.jsx | 6 +- src/Timeline.jsx | 2 +- src/TimelineSeg.jsx | 3 +- yarn.lock | 165 ++++++++++++++++++++++---------------------- 5 files changed, 90 insertions(+), 88 deletions(-) diff --git a/package.json b/package.json index 1991b71e..9335fa5a 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "eslint-plugin-react-hooks": "^4.3.0", "evergreen-ui": "^6.13.1", "fast-xml-parser": "^4.0.3", - "framer-motion": "1", + "framer-motion": "^9.0.3", "i18next-scanner": "^4.1.0", "icon-gen": "^3.0.0", "ky": "^0.33.1", diff --git a/src/SegmentList.jsx b/src/SegmentList.jsx index f0f0816a..7b875b45 100644 --- a/src/SegmentList.jsx +++ b/src/SegmentList.jsx @@ -109,10 +109,10 @@ const Segment = memo(({ seg, index, currentSegIndex, formatTimecode, getFrameCou role="button" onClick={() => !invertCutSegments && onClick(index)} onDoubleClick={onDoubleClick} - positionTransition - style={{ originY: 0, margin: '5px 0', background: 'rgba(0,0,0,0.1)', border: `1px solid rgba(255,255,255,${isActive ? 1 : 0.3})`, padding: 5, borderRadius: 5, position: 'relative', opacity: !enabled && !invertCutSegments ? 0.5 : undefined }} + layouy + style={{ originY: 0, margin: '5px 0', background: 'rgba(0,0,0,0.1)', border: `1px solid rgba(255,255,255,${isActive ? 1 : 0.3})`, padding: 5, borderRadius: 5, position: 'relative' }} initial={{ scaleY: 0 }} - animate={{ scaleY: 1 }} + animate={{ scaleY: 1, opacity: !enabled && !invertCutSegments ? 0.5 : undefined }} exit={{ scaleY: 0 }} className="segment-list-entry" > diff --git a/src/Timeline.jsx b/src/Timeline.jsx index 46dba881..9edb0b81 100644 --- a/src/Timeline.jsx +++ b/src/Timeline.jsx @@ -123,7 +123,7 @@ const Timeline = memo(({ const spring = useSpring(scrollLeftMotion, { damping: 100, stiffness: 1000 }); useEffect(() => { - spring.onChange(value => { + spring.on('change', (value) => { if (timelineScrollerSkipEventRef.current) return; // Don't animate while zooming timelineScrollerRef.current.scrollLeft = value; }); diff --git a/src/TimelineSeg.jsx b/src/TimelineSeg.jsx index c4b0f051..2b5baa96 100644 --- a/src/TimelineSeg.jsx +++ b/src/TimelineSeg.jsx @@ -52,7 +52,8 @@ const TimelineSeg = memo(({ return (