From 4b843a9539c2e2e1489af16782176a5c2375897f Mon Sep 17 00:00:00 2001 From: SmallStoneSK <575913857@qq.com> Date: Sun, 15 Aug 2021 21:21:33 +0800 Subject: [PATCH] fix: resolve circular dependency --- packages/core/package.json | 2 +- packages/core/src/components/codeRun/index.tsx | 7 ++----- packages/core/src/mods/layout/index.tsx | 6 ++---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 4777673..f1a9929 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -48,7 +48,7 @@ "query-string": "^6.13.7", "react-color": "^2.18.1", "react-json-view": "^1.19.1", - "react-split-pane": "^2.0.3" + "react-split-pane-v2": "^1.0.3" }, "devDependencies": { "@types/lodash.merge": "^4.6.6", diff --git a/packages/core/src/components/codeRun/index.tsx b/packages/core/src/components/codeRun/index.tsx index 715d246..4aa66fb 100644 --- a/packages/core/src/components/codeRun/index.tsx +++ b/packages/core/src/components/codeRun/index.tsx @@ -11,12 +11,9 @@ import { executeScript } from '../../utils'; import { PlayCircleFilled, LoadingOutlined } from '@ant-design/icons'; import { compileForOnline } from '@imove/compile-code'; import { toSelectedCellsJSON } from '../../utils/flowChartUtils'; +import SplitPane from 'react-split-pane-v2'; -// FIXME: https://github.com/tomkp/react-split-pane/issues/541 -// @ts-ignore -import SplitPane from 'react-split-pane/lib/SplitPane'; -// @ts-ignore -import Pane from 'react-split-pane/lib/Pane'; +const Pane = SplitPane.Pane; const defaultInput = { pipe: {}, diff --git a/packages/core/src/mods/layout/index.tsx b/packages/core/src/mods/layout/index.tsx index 04cc236..55a7e97 100644 --- a/packages/core/src/mods/layout/index.tsx +++ b/packages/core/src/mods/layout/index.tsx @@ -3,11 +3,9 @@ import React from 'react'; import styles from './index.module.less'; import { Graph } from '@antv/x6'; +import SplitPane from 'react-split-pane-v2'; -// @ts-ignore -import SplitPane from 'react-split-pane/lib/SplitPane'; -// @ts-ignore -import Pane from 'react-split-pane/lib/Pane'; +const Pane = SplitPane.Pane; interface ISubComponentProps { flowChart: Graph;