Skip to content

Commit 330321c

Browse files
authored
Upgrade framer-motion to motion (#270)
* upgrade motion * fix port position off * release
1 parent 7f329c2 commit 330321c

File tree

11 files changed

+236
-297
lines changed

11 files changed

+236
-297
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 5.3.2 - 1/17/25
2+
- [chore] upgrade framer-motion to motion
3+
- [chore] upgrade reablocks
4+
15
# 5.3.1 - 7/11/24
26
- [improvement] Update pan drag cursor #260
37

@@ -299,4 +303,4 @@
299303
- [Feature] Undo Redo Hook
300304

301305
# 2.4.5 - 12/16/20
302-
- [Feature] Add adjustable padding for nested nodes and add storybook story for custom nested nodes #30
306+
- [Feature] Add adjustable padding for nested nodes and add storybook story for custom nested nodes #30

docs/tools/templates/reaflow-codesandbox-template/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "src/index.js",
66
"dependencies": {
7-
"framer-motion": "^2.1.2",
7+
"motion": "^11.18.0",
88
"react": "latest",
99
"react-dom": "latest",
1010
"react-scripts": "3.0.1",

package-lock.json

+94-58
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reaflow",
3-
"version": "5.3.1",
3+
"version": "5.3.2",
44
"description": "Node-based Visualizations for React",
55
"scripts": {
66
"build": "vite build --mode library",
@@ -54,11 +54,11 @@
5454
"d3-shape": "^3.0.1",
5555
"elkjs": "^0.8.2",
5656
"ellipsize": "^0.2.0",
57-
"framer-motion": "^11.0.6",
57+
"motion": "^11.18.0",
5858
"kld-affine": "^2.1.1",
5959
"kld-intersections": "^0.7.0",
6060
"p-cancelable": "^3.0.0",
61-
"reablocks": "^8.0.3",
61+
"reablocks": "^8.7.4",
6262
"react-cool-dimensions": "^2.0.7",
6363
"react-fast-compare": "^3.2.2",
6464
"react-use-gesture": "^8.0.1",

src/Canvas.tsx

+17-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { CanvasPosition, EdgeData, NodeData, PortData } from './types';
99
import classNames from 'classnames';
1010
import { CanvasProvider, useCanvas } from './utils/CanvasProvider';
1111
import { getDragNodeData } from './utils/helpers';
12-
import { motion } from 'framer-motion';
12+
import { motion } from 'motion/react';
1313
import { ZoomResult } from './utils/useZoom';
1414
import css from './Canvas.module.css';
1515

@@ -327,17 +327,17 @@ const InternalCanvas: FC<CanvasProps & { ref?: Ref<CanvasRef> }> = forwardRef(({
327327
scale: zoom,
328328
transition: animated
329329
? {
330-
velocity: 100,
331-
translateX: { duration: mount.current ? 0.3 : 0 },
332-
translateY: { duration: mount.current ? 0.3 : 0 },
333-
opacity: { duration: 0.8 },
334-
when: 'beforeChildren'
335-
}
330+
velocity: 100,
331+
translateX: { duration: mount.current ? 0.3 : 0 },
332+
translateY: { duration: mount.current ? 0.3 : 0 },
333+
opacity: { duration: 0.8 },
334+
when: 'beforeChildren'
335+
}
336336
: {
337-
type: false,
338-
duration: 0,
339-
when: 'beforeChildren'
340-
}
337+
type: false,
338+
duration: 0,
339+
when: 'beforeChildren'
340+
}
341341
}}
342342
>
343343
{layout?.children?.map(({ children, ...n }) => {
@@ -367,11 +367,15 @@ const InternalCanvas: FC<CanvasProps & { ref?: Ref<CanvasRef> }> = forwardRef(({
367367
{ports?.length > 0 && (
368368
<motion.g
369369
key={n.id}
370+
initial={{
371+
translateX: n.x,
372+
translateY: n.y
373+
}}
370374
animate={{
371375
translateX: n.x,
372-
translateY: n.y,
373-
transition: { duration: 0 }
376+
translateY: n.y
374377
}}
378+
transition={{ duration: 0 }}
375379
>
376380
{ports.map((port, index) => (
377381
<use key={index} xlinkHref={`#${id}-node-${n.id}-port-${port.id}`} style={{ pointerEvents: 'none' }} />

0 commit comments

Comments
 (0)