Skip to content

Commit

Permalink
refactor(reactflow): add node resizer package
Browse files Browse the repository at this point in the history
  • Loading branch information
moklick committed Mar 28, 2023
1 parent 9ed7d1a commit 6c4af37
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 15 deletions.
4 changes: 1 addition & 3 deletions examples/vite-app/src/examples/NodeResizer/CustomResizer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { memo, FC } from 'react';
import { Handle, Position, NodeProps } from 'reactflow';
import { Handle, Position, NodeProps, NodeResizeControl } from 'reactflow';

import { NodeResizeControl } from '@reactflow/node-resizer';
import '@reactflow/node-resizer/dist/style.css';
import ResizeIcon from './ResizeIcon';

const controlStyle = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { memo, FC } from 'react';
import { Handle, Position, NodeProps } from 'reactflow';
import { NodeResizer } from '@reactflow/node-resizer';

import '@reactflow/node-resizer/dist/style.css';
import { Handle, Position, NodeProps, NodeResizer } from 'reactflow';

const DefaultResizerNode: FC<NodeProps> = ({ data, selected }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { memo, FC } from 'react';
import { Handle, Position, NodeProps } from 'reactflow';
import { NodeResizeControl } from '@reactflow/node-resizer';

import '@reactflow/node-resizer/dist/style.css';
import { Handle, Position, NodeProps, NodeResizeControl } from 'reactflow';

const HorizontalResizerNode: FC<NodeProps> = ({ data }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { memo, FC } from 'react';
import { Handle, Position, NodeProps } from 'reactflow';

import { NodeResizeControl } from '@reactflow/node-resizer';
import '@reactflow/node-resizer/dist/style.css';
import { Handle, Position, NodeProps, NodeResizeControl } from 'reactflow';

const CustomNode: FC<NodeProps> = ({ id, data }) => {
return (
Expand Down
2 changes: 2 additions & 0 deletions examples/vite-app/src/examples/NodeResizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import CustomResizer from './CustomResizer';
import VerticalResizer from './VerticalResizer';
import HorizontalResizer from './HorizontalResizer';

import 'reactflow/dist/style.css';

const nodeTypes = {
defaultResizer: DefaultResizer,
customResizer: CustomResizer,
Expand Down
1 change: 1 addition & 0 deletions packages/reactflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@reactflow/controls": "workspace:*",
"@reactflow/core": "workspace:*",
"@reactflow/minimap": "workspace:*",
"@reactflow/node-resizer": "workspace:*",
"@reactflow/node-toolbar": "workspace:*"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/reactflow/src/base.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import '@reactflow/core/dist/base.css';
@import '@reactflow/controls/dist/style.css';
@import '@reactflow/minimap/dist/style.css';
@import '@reactflow/node-resizer/dist/style.css';
1 change: 1 addition & 0 deletions packages/reactflow/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export * from '@reactflow/minimap';
export * from '@reactflow/controls';
export * from '@reactflow/background';
export * from '@reactflow/node-toolbar';
export * from '@reactflow/node-resizer';

export { ReactFlow as default } from '@reactflow/core';
1 change: 1 addition & 0 deletions packages/reactflow/src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import '@reactflow/core/dist/style.css';
@import '@reactflow/controls/dist/style.css';
@import '@reactflow/minimap/dist/style.css';
@import '@reactflow/node-resizer/dist/style.css';
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6c4af37

Please sign in to comment.