diff --git a/package.json b/package.json index 9980a17..51e7361 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "test": "jest --coverage", "e2e": "cypress open", "doc": "dumi dev", - "example": "concurrently \"APP_ROOT=example umi dev\" \"imove -d\"", + "example": "concurrently \"APP_ROOT=example umi dev\" \"npm run build --prefix packages/core\" \"imove -d\"", "postinstall": "lerna init && lerna bootstrap && npm link packages/cli" }, "jest": { @@ -44,6 +44,7 @@ }, "dependencies": { "@imove/core": "^0.3.6", + "@monaco-editor/react": "^3.7.4", "lowdb": "^1.0.0", "umi": "^3.2.2" } diff --git a/packages/core/src/mods/flowChart/createFlowChart.ts b/packages/core/src/mods/flowChart/createFlowChart.ts index e0943ec..be6c8c4 100644 --- a/packages/core/src/mods/flowChart/createFlowChart.ts +++ b/packages/core/src/mods/flowChart/createFlowChart.ts @@ -88,6 +88,7 @@ const createFlowChart = (container: HTMLDivElement, miniMapContainer: HTMLDivEle rubberband: true, movable: true, showNodeSelectionBox: true, + showEdgeSelectionBox: true }, // https://x6.antv.vision/zh/docs/tutorial/basic/snapline snapline: { diff --git a/packages/core/src/mods/settingBar/components/code/index.tsx b/packages/core/src/mods/settingBar/components/code/index.tsx index f196a96..b39bede 100644 --- a/packages/core/src/mods/settingBar/components/code/index.tsx +++ b/packages/core/src/mods/settingBar/components/code/index.tsx @@ -4,13 +4,14 @@ import 'antd/es/modal/style'; import 'antd/es/button/style'; import styles from './index.module.less'; -import AceEditor from 'react-ace'; +// import AceEditor from 'react-ace'; +import { ControlledEditor } from "@monaco-editor/react"; import { Button, Modal } from 'antd'; -import { Graph } from '@antv/x6'; -import 'ace-builds/src-noconflict/theme-dracula'; -import 'ace-builds/src-noconflict/mode-javascript'; -import 'ace-builds/src-noconflict/snippets/javascript'; -import 'ace-builds/src-noconflict/ext-language_tools'; +import { Graph } from '@antv/x6'; +// import 'ace-builds/src-noconflict/theme-dracula'; +// import 'ace-builds/src-noconflict/mode-javascript'; +// import 'ace-builds/src-noconflict/snippets/javascript'; +// import 'ace-builds/src-noconflict/ext-language_tools'; interface IProps { value: any; @@ -93,7 +94,7 @@ const EditModal: React.FC = (props) => { const onClickOk = (): void => { onOk(code); }; - const onChangeCode = (newCode: string): void => { + const onChangeCode = (ev: any, newCode: string): void => { if (newCode !== code) { setCode(newCode); } @@ -110,7 +111,16 @@ const EditModal: React.FC = (props) => { onOk={onClickOk} onCancel={onCancel} > - + {/* = (props) => { enableBasicAutocompletion={true} setOptions={CODE_EDITOR_OPTIONS} onChange={onChangeCode} - /> + /> */} ); }; diff --git a/packages/core/src/mods/settingBar/components/json/index.tsx b/packages/core/src/mods/settingBar/components/json/index.tsx index 2904ad8..8a5d77c 100644 --- a/packages/core/src/mods/settingBar/components/json/index.tsx +++ b/packages/core/src/mods/settingBar/components/json/index.tsx @@ -5,14 +5,15 @@ import 'antd/es/button/style'; import 'antd/es/message/style'; import styles from './index.module.less'; -import AceEditor from 'react-ace'; +// import AceEditor from 'react-ace'; +import { ControlledEditor } from "@monaco-editor/react"; import JsonView from 'react-json-view'; import { Button, Modal, message } from 'antd'; import { safeParse } from '../../../../utils'; -import 'ace-builds/src-noconflict/mode-json'; -import 'ace-builds/src-noconflict/theme-dracula'; -import 'ace-builds/src-noconflict/snippets/json'; -import 'ace-builds/src-noconflict/ext-language_tools'; +// import 'ace-builds/src-noconflict/mode-json'; +// import 'ace-builds/src-noconflict/theme-dracula'; +// import 'ace-builds/src-noconflict/snippets/json'; +// import 'ace-builds/src-noconflict/ext-language_tools'; interface IJsonProps { value: any; @@ -103,7 +104,7 @@ const EditModal: React.FC = (props) => { console.log('save failed, the error is:', error.message); } }; - const onChangeJson = (newJson: string): void => { + const onChangeJson = (ev: any, newJson: string): void => { if (newJson !== json) { setJson(newJson); } @@ -119,7 +120,16 @@ const EditModal: React.FC = (props) => { onOk={onClickOk} onCancel={onCancel} > - + {/* = (props) => { enableBasicAutocompletion={true} setOptions={CODE_EDITOR_OPTIONS} onChange={onChangeJson} - /> + /> */} ); };