diff --git a/examples/nextjs/cypress/components/hooks/useEdges.cy.tsx b/examples/nextjs/cypress/components/hooks/useEdges.cy.tsx
index 772e6fb3..c4884f9d 100644
--- a/examples/nextjs/cypress/components/hooks/useEdges.cy.tsx
+++ b/examples/nextjs/cypress/components/hooks/useEdges.cy.tsx
@@ -1,5 +1,5 @@
import { useEffect } from 'react';
-import { ReactFlow, Edge, useEdges } from '@react-flow/bundle';
+import ReactFlow, { Edge, useEdges } from 'reactflow';
import { nodes as initialNodes, edges as initialEdges } from '../../fixtures/simpleflow';
diff --git a/examples/nextjs/cypress/components/hooks/useNodes.cy.tsx b/examples/nextjs/cypress/components/hooks/useNodes.cy.tsx
index 3946ddd1..e80947dc 100644
--- a/examples/nextjs/cypress/components/hooks/useNodes.cy.tsx
+++ b/examples/nextjs/cypress/components/hooks/useNodes.cy.tsx
@@ -1,5 +1,5 @@
import { useEffect } from 'react';
-import { Node, ReactFlow, useNodes } from '@react-flow/bundle';
+import ReactFlow, { Node, useNodes } from 'reactflow';
import { nodes } from '../../fixtures/simpleflow';
diff --git a/examples/nextjs/cypress/components/hooks/useOnViewportChange.cy.tsx b/examples/nextjs/cypress/components/hooks/useOnViewportChange.cy.tsx
index baf04807..2f6edd8e 100644
--- a/examples/nextjs/cypress/components/hooks/useOnViewportChange.cy.tsx
+++ b/examples/nextjs/cypress/components/hooks/useOnViewportChange.cy.tsx
@@ -1,4 +1,4 @@
-import { ReactFlow, useOnViewportChange, Viewport } from '@react-flow/bundle';
+import ReactFlow, { useOnViewportChange, Viewport } from 'reactflow';
describe('useOnViewportChange.cy.tsx', () => {
it('listen to viewport drag', () => {
diff --git a/examples/nextjs/cypress/components/hooks/useViewport.cy.tsx b/examples/nextjs/cypress/components/hooks/useViewport.cy.tsx
index 27f9eb94..cf57f7c5 100644
--- a/examples/nextjs/cypress/components/hooks/useViewport.cy.tsx
+++ b/examples/nextjs/cypress/components/hooks/useViewport.cy.tsx
@@ -1,4 +1,4 @@
-import { ReactFlow, useViewport, Viewport } from '@react-flow/bundle';
+import ReactFlow, { useViewport, Viewport } from 'reactflow';
describe('useViewport.cy.tsx', () => {
it('handles drag', () => {
diff --git a/examples/nextjs/cypress/components/reactflow/basic-props.cy.tsx b/examples/nextjs/cypress/components/reactflow/basic-props.cy.tsx
index cd9eb7aa..ff57d3d8 100644
--- a/examples/nextjs/cypress/components/reactflow/basic-props.cy.tsx
+++ b/examples/nextjs/cypress/components/reactflow/basic-props.cy.tsx
@@ -1,4 +1,4 @@
-import { ReactFlow, EdgeProps } from '@react-flow/bundle';
+import ReactFlow, { EdgeProps } from 'reactflow';
import ControlledFlow from '../../support/ControlledFlow';
import * as simpleflow from '../../fixtures/simpleflow';
diff --git a/examples/nextjs/cypress/components/reactflow/uncontrolled.cy.tsx b/examples/nextjs/cypress/components/reactflow/uncontrolled.cy.tsx
index 09ab24a2..e0f6cfaa 100644
--- a/examples/nextjs/cypress/components/reactflow/uncontrolled.cy.tsx
+++ b/examples/nextjs/cypress/components/reactflow/uncontrolled.cy.tsx
@@ -1,4 +1,4 @@
-import { ReactFlow } from '@react-flow/bundle';
+import ReactFlow from 'reactflow';
import { nodes, edges } from '../../fixtures/simpleflow';
diff --git a/examples/nextjs/cypress/components/reactflow/view-props.cy.tsx b/examples/nextjs/cypress/components/reactflow/view-props.cy.tsx
index f6958d90..c73c94d1 100644
--- a/examples/nextjs/cypress/components/reactflow/view-props.cy.tsx
+++ b/examples/nextjs/cypress/components/reactflow/view-props.cy.tsx
@@ -1,4 +1,4 @@
-import { ReactFlow, ReactFlowProps, Viewport, useViewport, SnapGrid, CoordinateExtent, Node } from '@react-flow/bundle';
+import ReactFlow, { ReactFlowProps, Viewport, useViewport, SnapGrid, CoordinateExtent, Node } from 'reactflow';
import ControlledFlow from '../../support/ControlledFlow';
import * as simpleflow from '../../fixtures/simpleflow';
diff --git a/examples/nextjs/cypress/components/utils/graph-utils.cy.ts b/examples/nextjs/cypress/components/utils/graph-utils.cy.ts
index 6ebded1b..74119444 100644
--- a/examples/nextjs/cypress/components/utils/graph-utils.cy.ts
+++ b/examples/nextjs/cypress/components/utils/graph-utils.cy.ts
@@ -1,4 +1,4 @@
-import { Node, Edge, isNode, isEdge, getOutgoers, getIncomers, addEdge } from '@react-flow/bundle';
+import { Node, Edge, isNode, isEdge, getOutgoers, getIncomers, addEdge } from 'reactflow';
const nodes: Node[] = [
{
diff --git a/examples/nextjs/cypress/fixtures/simpleflow.ts b/examples/nextjs/cypress/fixtures/simpleflow.ts
index 86cd16b0..ede9ac5c 100644
--- a/examples/nextjs/cypress/fixtures/simpleflow.ts
+++ b/examples/nextjs/cypress/fixtures/simpleflow.ts
@@ -1,4 +1,4 @@
-import { Node, Edge } from '@react-flow/bundle';
+import { Node, Edge } from 'reactflow';
export const nodes: Node[] = [
{
diff --git a/examples/nextjs/cypress/support/ControlledFlow.tsx b/examples/nextjs/cypress/support/ControlledFlow.tsx
index 3a190889..6181f113 100644
--- a/examples/nextjs/cypress/support/ControlledFlow.tsx
+++ b/examples/nextjs/cypress/support/ControlledFlow.tsx
@@ -10,7 +10,7 @@ import {
Connection,
addEdge,
ReactFlowProps,
-} from '@react-flow/bundle';
+} from 'reactflow';
function ControlledFlow({
addOnNodeChangeHandler = true,
diff --git a/examples/nextjs/cypress/support/component.ts b/examples/nextjs/cypress/support/component.ts
index fa281e06..a84b87c0 100644
--- a/examples/nextjs/cypress/support/component.ts
+++ b/examples/nextjs/cypress/support/component.ts
@@ -20,7 +20,7 @@ import './commands';
// require('./commands')
import { mount } from 'cypress/react18';
-import { XYPosition } from '@react-flow/bundle';
+import { XYPosition } from 'reactflow';
import '../../styles/globals.css';
import '../../styles/rf-style.css';
diff --git a/examples/nextjs/pages/UpdatableEdge/index.tsx b/examples/nextjs/pages/UpdatableEdge/index.tsx
index 7b14ffd6..38ca5191 100644
--- a/examples/nextjs/pages/UpdatableEdge/index.tsx
+++ b/examples/nextjs/pages/UpdatableEdge/index.tsx
@@ -13,7 +13,7 @@ import ReactFlow, {
HandleType,
} from 'reactflow';
-import { Controls } from '@react-flow/controls';
+import { Controls } from '@rctflw/controls';
const initialNodes: Node[] = [
{
diff --git a/examples/nextjs/pages/_app.tsx b/examples/nextjs/pages/_app.tsx
index ce2b55b9..d197bdcc 100755
--- a/examples/nextjs/pages/_app.tsx
+++ b/examples/nextjs/pages/_app.tsx
@@ -4,7 +4,7 @@ import '../styles/globals.css';
// Unfortunately this doesn't work because preconsruct clears the dist folder and there is
// no way to hook into the watch process to copy the files back to the dist folder
-// import '@react-flow/core/dist/theme-default.css';
+// import '@rctflw/core/dist/theme-default.css';
// this is a workaround for testing the theme. See explanation above.
import '../styles/rf-style.css';
diff --git a/package.json b/package.json
index 57b02e59..d722fe95 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
"dev": "preconstruct watch",
"dev:example": "cd examples/nextjs && yarn dev",
"build": "preconstruct build && yarn run packages",
- "packages": "yarn workspaces foreach --include '@react-flow/**' --include 'reactflow' run build",
+ "packages": "yarn workspaces foreach --include '@rctflw/**' --include 'reactflow' run build",
"test:all": "yarn test:chrome && yarn test:firefox",
"test:e2e": "cd examples/nextjs && cypress run",
"test:component": "cd examples/nextjs && cypress run --component",
diff --git a/packages/background/README.md b/packages/background/README.md
index 0c664fa9..f875b9f9 100644
--- a/packages/background/README.md
+++ b/packages/background/README.md
@@ -1,10 +1,10 @@
-# @react-flow/background
+# @rctflw/background
Background component for React Flow.
## Installation
```sh
-npm install @react-flow/background
+npm install @rctflw/background
```
diff --git a/packages/background/package.json b/packages/background/package.json
index d99dcccc..527b2048 100644
--- a/packages/background/package.json
+++ b/packages/background/package.json
@@ -1,5 +1,5 @@
{
- "name": "@react-flow/background",
+ "name": "@rctflw/background",
"version": "11.0.0-next.0",
"description": "Background component with different variants for React Flow",
"keywords": [
@@ -13,9 +13,9 @@
"files": [
"dist"
],
- "main": "dist/react-flow-background.cjs.js",
- "module": "dist/react-flow-background.esm.js",
- "types": "dist/react-flow-background.cjs.d.ts",
+ "main": "dist/rctflw-background.cjs.js",
+ "module": "dist/rctflw-background.esm.js",
+ "types": "dist/rctflw-background.cjs.d.ts",
"sideEffects": false,
"license": "MIT",
"repository": {
@@ -25,7 +25,7 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
- "@react-flow/core": "workspace:*",
+ "@rctflw/core": "workspace:*",
"classcat": "^5.0.3"
},
"peerDependencies": {
diff --git a/packages/background/src/Background.tsx b/packages/background/src/Background.tsx
index 9d9709fd..27abff8a 100644
--- a/packages/background/src/Background.tsx
+++ b/packages/background/src/Background.tsx
@@ -1,6 +1,6 @@
import { memo, useRef, useId } from 'react';
import cc from 'classcat';
-import { useStore, ReactFlowState } from '@react-flow/core';
+import { useStore, ReactFlowState } from '@rctflw/core';
import { BackgroundProps, BackgroundVariant } from './types';
import { DotPattern, LinePattern } from './Patterns';
@@ -39,15 +39,10 @@ function Background({
const isDots = variant === BackgroundVariant.Dots;
const isCross = variant === BackgroundVariant.Cross;
const gapXY: [number, number] = Array.isArray(gap) ? gap : [gap, gap];
- const scaledGap: [number, number] = [
- gapXY[0] * tScale || 1,
- gapXY[1] * tScale || 1,
- ];
+ const scaledGap: [number, number] = [gapXY[0] * tScale || 1, gapXY[1] * tScale || 1];
const scaledSize = patternSize * tScale;
- const patternDimensions: [number, number] = isCross
- ? [scaledSize, scaledSize]
- : scaledGap;
+ const patternDimensions: [number, number] = isCross ? [scaledSize, scaledSize] : scaledGap;
const patternOffset = isDots
? [scaledSize / 2, scaledSize / 2]
@@ -78,20 +73,10 @@ function Background({
{isDots ? (
) : (
-
+
)}
-
+
);
}
diff --git a/packages/controls/README.md b/packages/controls/README.md
index 23deb61f..a45eda41 100644
--- a/packages/controls/README.md
+++ b/packages/controls/README.md
@@ -1,10 +1,10 @@
-# @react-flow/controls
+# @rctflw/controls
Controls component for React Flow.
## Installation
```sh
-npm install @react-flow/controls
+npm install @rctflw/controls
```
diff --git a/packages/controls/package.json b/packages/controls/package.json
index 2c59e161..cbb2e92f 100644
--- a/packages/controls/package.json
+++ b/packages/controls/package.json
@@ -1,5 +1,5 @@
{
- "name": "@react-flow/controls",
+ "name": "@rctflw/controls",
"version": "11.0.0-next.0",
"description": "Component to control the viewport of a React Flow instance",
"keywords": [
@@ -13,9 +13,9 @@
"files": [
"dist"
],
- "main": "dist/react-flow-controls.cjs.js",
- "module": "dist/react-flow-controls.esm.js",
- "types": "dist/react-flow-controls.cjs.d.ts",
+ "main": "dist/rctflw-controls.cjs.js",
+ "module": "dist/rctflw-controls.esm.js",
+ "types": "dist/rctflw-controls.cjs.d.ts",
"sideEffects": false,
"license": "MIT",
"repository": {
@@ -28,7 +28,7 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
- "@react-flow/core": "workspace:*",
+ "@rctflw/core": "workspace:*",
"classcat": "^5.0.3"
},
"peerDependencies": {
diff --git a/packages/controls/src/Controls.tsx b/packages/controls/src/Controls.tsx
index 124a6ca1..e124a490 100644
--- a/packages/controls/src/Controls.tsx
+++ b/packages/controls/src/Controls.tsx
@@ -1,6 +1,6 @@
import { memo, FC, useEffect, useState, PropsWithChildren } from 'react';
import cc from 'classcat';
-import { useStore, useStoreApi, useReactFlow, ReactFlowState, Panel } from '@react-flow/core';
+import { useStore, useStoreApi, useReactFlow, ReactFlowState, Panel } from '@rctflw/core';
import PlusIcon from './Icons/Plus';
import MinusIcon from './Icons/Minus';
diff --git a/packages/controls/src/types.ts b/packages/controls/src/types.ts
index 0d4bb114..b7aa795f 100644
--- a/packages/controls/src/types.ts
+++ b/packages/controls/src/types.ts
@@ -1,5 +1,5 @@
import { ButtonHTMLAttributes, HTMLAttributes } from 'react';
-import { FitViewOptions, PanelPosition } from '@react-flow/core';
+import { FitViewOptions, PanelPosition } from '@rctflw/core';
export interface ControlProps extends HTMLAttributes {
showZoom?: boolean;
diff --git a/packages/core/README.md b/packages/core/README.md
index 788992bd..40a90cb9 100644
--- a/packages/core/README.md
+++ b/packages/core/README.md
@@ -1,10 +1,10 @@
-# @react-flow/core
+# @rctflw/core
Core components and util functions of React Flow.
## Installation
```sh
-npm install @react-flow/core
+npm install @rctflw/core
```
diff --git a/packages/core/package.json b/packages/core/package.json
index 586146f0..c8e238aa 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -1,5 +1,5 @@
{
- "name": "@react-flow/core",
+ "name": "@rctflw/core",
"version": "11.0.0-next.0",
"description": "Core components and util functions of React Flow.",
"keywords": [
@@ -13,9 +13,9 @@
"files": [
"dist"
],
- "main": "dist/react-flow-core.cjs.js",
- "module": "dist/react-flow-core.esm.js",
- "types": "dist/react-flow-core.cjs.d.ts",
+ "main": "dist/rctflw-core.cjs.js",
+ "module": "dist/rctflw-core.esm.js",
+ "types": "dist/rctflw-core.cjs.d.ts",
"sideEffects": false,
"license": "MIT",
"repository": {
diff --git a/packages/minimap/README.md b/packages/minimap/README.md
index 76dafe39..bf46de5c 100644
--- a/packages/minimap/README.md
+++ b/packages/minimap/README.md
@@ -1,10 +1,10 @@
-# @react-flow/minimap
+# @rctflw/minimap
Mini map component for React Flow.
## Installation
```sh
-npm install @react-flow/minimap
+npm install @rctflw/minimap
```
diff --git a/packages/minimap/package.json b/packages/minimap/package.json
index 9aab3df0..85c28ba9 100644
--- a/packages/minimap/package.json
+++ b/packages/minimap/package.json
@@ -1,5 +1,5 @@
{
- "name": "@react-flow/minimap",
+ "name": "@rctflw/minimap",
"version": "11.0.0-next.0",
"description": "Minimap component for React Flow.",
"keywords": [
@@ -13,9 +13,9 @@
"files": [
"dist"
],
- "main": "dist/react-flow-minimap.cjs.js",
- "module": "dist/react-flow-minimap.esm.js",
- "types": "dist/react-flow-minimap.cjs.d.ts",
+ "main": "dist/rctflw-minimap.cjs.js",
+ "module": "dist/rctflw-minimap.esm.js",
+ "types": "dist/rctflw-minimap.cjs.d.ts",
"sideEffects": false,
"license": "MIT",
"repository": {
@@ -28,7 +28,7 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
- "@react-flow/core": "workspace:*",
+ "@rctflw/core": "workspace:*",
"classcat": "^5.0.3",
"zustand": "^4.0.0"
},
diff --git a/packages/minimap/src/MiniMap.tsx b/packages/minimap/src/MiniMap.tsx
index 6e390b1d..b5fa84ae 100644
--- a/packages/minimap/src/MiniMap.tsx
+++ b/packages/minimap/src/MiniMap.tsx
@@ -2,7 +2,7 @@
import { memo, useId } from 'react';
import cc from 'classcat';
import shallow from 'zustand/shallow';
-import { useStore, getRectOfNodes, ReactFlowState, Rect, Panel, getBoundsOfRects } from '@react-flow/core';
+import { useStore, getRectOfNodes, ReactFlowState, Rect, Panel, getBoundsOfRects } from '@rctflw/core';
import MiniMapNode from './MiniMapNode';
import { MiniMapProps, GetMiniMapNodeAttribute } from './types';
diff --git a/packages/minimap/src/types.ts b/packages/minimap/src/types.ts
index c41e9063..51324df5 100644
--- a/packages/minimap/src/types.ts
+++ b/packages/minimap/src/types.ts
@@ -1,13 +1,10 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { HTMLAttributes } from 'react';
-import { Node, PanelPosition } from '@react-flow/core';
+import { Node, PanelPosition } from '@rctflw/core';
-export type GetMiniMapNodeAttribute = (
- node: Node
-) => string;
+export type GetMiniMapNodeAttribute = (node: Node) => string;
-export interface MiniMapProps
- extends HTMLAttributes {
+export interface MiniMapProps extends HTMLAttributes {
nodeColor?: string | GetMiniMapNodeAttribute;
nodeStrokeColor?: string | GetMiniMapNodeAttribute;
nodeClassName?: string | GetMiniMapNodeAttribute;
diff --git a/packages/reactflow/package.json b/packages/reactflow/package.json
index 83fdaff0..7a9c5f04 100644
--- a/packages/reactflow/package.json
+++ b/packages/reactflow/package.json
@@ -1,6 +1,6 @@
{
"name": "reactflow",
- "version": "11.0.0-next.0",
+ "version": "11.0.0-next.2",
"description": "A highly customizable React library for building node-based editors and interactive flow charts",
"keywords": [
"react",
@@ -28,10 +28,10 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
- "@react-flow/background": "workspace:*",
- "@react-flow/controls": "workspace:*",
- "@react-flow/core": "workspace:*",
- "@react-flow/minimap": "workspace:*"
+ "@rctflw/background": "workspace:*",
+ "@rctflw/controls": "workspace:*",
+ "@rctflw/core": "workspace:*",
+ "@rctflw/minimap": "workspace:*"
},
"peerDependencies": {
"react": ">=18",
diff --git a/packages/reactflow/src/index.ts b/packages/reactflow/src/index.ts
index 145d5063..550bdd6e 100644
--- a/packages/reactflow/src/index.ts
+++ b/packages/reactflow/src/index.ts
@@ -1,8 +1,8 @@
-export * from '@react-flow/core';
-export * from '@react-flow/minimap';
-export * from '@react-flow/controls';
-export * from '@react-flow/background';
+export * from '@rctflw/core';
+export * from '@rctflw/minimap';
+export * from '@rctflw/controls';
+export * from '@rctflw/background';
-import { ReactFlow } from '@react-flow/core';
+import { ReactFlow } from '@rctflw/core';
export default ReactFlow;
diff --git a/yarn.lock b/yarn.lock
index 3fd8b3e1..9bb39f21 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2301,12 +2301,12 @@ __metadata:
languageName: node
linkType: hard
-"@react-flow/background@workspace:*, @react-flow/background@workspace:packages/background":
+"@rctflw/background@workspace:*, @rctflw/background@workspace:packages/background":
version: 0.0.0-use.local
- resolution: "@react-flow/background@workspace:packages/background"
+ resolution: "@rctflw/background@workspace:packages/background"
dependencies:
"@babel/runtime": ^7.18.9
- "@react-flow/core": "workspace:*"
+ "@rctflw/core": "workspace:*"
classcat: ^5.0.3
peerDependencies:
react: ">=18"
@@ -2314,12 +2314,12 @@ __metadata:
languageName: unknown
linkType: soft
-"@react-flow/controls@workspace:*, @react-flow/controls@workspace:packages/controls":
+"@rctflw/controls@workspace:*, @rctflw/controls@workspace:packages/controls":
version: 0.0.0-use.local
- resolution: "@react-flow/controls@workspace:packages/controls"
+ resolution: "@rctflw/controls@workspace:packages/controls"
dependencies:
"@babel/runtime": ^7.18.9
- "@react-flow/core": "workspace:*"
+ "@rctflw/core": "workspace:*"
autoprefixer: ^10.4.8
classcat: ^5.0.3
postcss: ^8.4.16
@@ -2333,9 +2333,9 @@ __metadata:
languageName: unknown
linkType: soft
-"@react-flow/core@workspace:*, @react-flow/core@workspace:packages/core":
+"@rctflw/core@workspace:*, @rctflw/core@workspace:packages/core":
version: 0.0.0-use.local
- resolution: "@react-flow/core@workspace:packages/core"
+ resolution: "@rctflw/core@workspace:packages/core"
dependencies:
"@babel/runtime": ^7.18.9
"@types/d3": ^7.4.0
@@ -2357,12 +2357,12 @@ __metadata:
languageName: unknown
linkType: soft
-"@react-flow/minimap@workspace:*, @react-flow/minimap@workspace:packages/minimap":
+"@rctflw/minimap@workspace:*, @rctflw/minimap@workspace:packages/minimap":
version: 0.0.0-use.local
- resolution: "@react-flow/minimap@workspace:packages/minimap"
+ resolution: "@rctflw/minimap@workspace:packages/minimap"
dependencies:
"@babel/runtime": ^7.18.9
- "@react-flow/core": "workspace:*"
+ "@rctflw/core": "workspace:*"
autoprefixer: ^10.4.8
classcat: ^5.0.3
postcss: ^8.4.16
@@ -8520,10 +8520,10 @@ __metadata:
resolution: "reactflow@workspace:packages/reactflow"
dependencies:
"@babel/runtime": ^7.18.9
- "@react-flow/background": "workspace:*"
- "@react-flow/controls": "workspace:*"
- "@react-flow/core": "workspace:*"
- "@react-flow/minimap": "workspace:*"
+ "@rctflw/background": "workspace:*"
+ "@rctflw/controls": "workspace:*"
+ "@rctflw/core": "workspace:*"
+ "@rctflw/minimap": "workspace:*"
autoprefixer: ^10.4.8
postcss: ^8.4.14
postcss-cli: ^10.0.0