From 07a373c99f3cb2d0abb5618dcb029d17206c3747 Mon Sep 17 00:00:00 2001 From: harry Date: Wed, 11 Mar 2020 23:54:31 +0800 Subject: [PATCH] =?UTF-8?q?monaco-editor=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config-overrides.js | 2 +- public/react/package-lock.json | 9 --------- public/react/package.json | 1 - .../component/monaco => components}/TPIMonacoConfig.js | 0 .../TPIMonaco.css => components/monaco-editor.css} | 6 ++++++ .../component/monaco => components}/monaco-editor.jsx | 3 +-- .../Shixunworkdetails/ShixunCustomsPass.js | 2 +- .../modules/developer/components/errorResult/index.js | 2 +- .../modules/developer/components/myMonacoEditor/index.js | 2 +- public/react/src/modules/developer/recordDetail/index.js | 2 +- .../react/src/modules/page/component/monaco/TPIMonaco.js | 2 +- .../src/modules/page/component/monaco/monaco-editor.less | 5 ----- .../src/modules/tpm/TPMsettings/Shixuninformation.js | 2 +- 13 files changed, 14 insertions(+), 24 deletions(-) rename public/react/src/{modules/page/component/monaco => components}/TPIMonacoConfig.js (100%) rename public/react/src/{modules/page/component/monaco/TPIMonaco.css => components/monaco-editor.css} (95%) rename public/react/src/{modules/page/component/monaco => components}/monaco-editor.jsx (98%) delete mode 100644 public/react/src/modules/page/component/monaco/monaco-editor.less diff --git a/public/react/config-overrides.js b/public/react/config-overrides.js index e22849fec..487fbfbbf 100644 --- a/public/react/config-overrides.js +++ b/public/react/config-overrides.js @@ -14,7 +14,7 @@ const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); module.exports = override( disableEsLint(), - // addBundleVisualizer(), + addBundleVisualizer(), addWebpackAlias({ "educoder": path.resolve(__dirname, 'src/common/educoder.js') }), diff --git a/public/react/package-lock.json b/public/react/package-lock.json index 19a8be8bc..81a5cd62d 100644 --- a/public/react/package-lock.json +++ b/public/react/package-lock.json @@ -12581,15 +12581,6 @@ "prop-types": "^15.5.0" } }, - "react-monaco-editor": { - "version": "0.34.0", - "resolved": "https://registry.npm.taobao.org/react-monaco-editor/download/react-monaco-editor-0.34.0.tgz", - "integrity": "sha1-FOyLENRIvxH4X3EaudkRF7xGs7g=", - "requires": { - "@types/react": "^15.x || ^16.x", - "prop-types": "^15.7.2" - } - }, "react-player": { "version": "1.15.2", "resolved": "https://registry.npm.taobao.org/react-player/download/react-player-1.15.2.tgz", diff --git a/public/react/package.json b/public/react/package.json index 2ead28574..0d0aa18c5 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -38,7 +38,6 @@ "react-dom": "^16.13.0", "react-infinite-scroller": "^1.2.4", "react-loadable": "^5.3.1", - "react-monaco-editor": "^0.34.0", "react-player": "^1.11.1", "react-redux": "5.0.7", "react-router": "^5.1.2", diff --git a/public/react/src/modules/page/component/monaco/TPIMonacoConfig.js b/public/react/src/components/TPIMonacoConfig.js similarity index 100% rename from public/react/src/modules/page/component/monaco/TPIMonacoConfig.js rename to public/react/src/components/TPIMonacoConfig.js diff --git a/public/react/src/modules/page/component/monaco/TPIMonaco.css b/public/react/src/components/monaco-editor.css similarity index 95% rename from public/react/src/modules/page/component/monaco/TPIMonaco.css rename to public/react/src/components/monaco-editor.css index dd83fab65..51522c42f 100644 --- a/public/react/src/modules/page/component/monaco/TPIMonaco.css +++ b/public/react/src/components/monaco-editor.css @@ -429,4 +429,10 @@ /* 选中行边框 */ .monaco-editor .view-overlays .current-line { border-width: 1px !important; +} + +#extend-challenge-file-edit { + width: '100%'; + height: '100%'; + border: '1px solid grey'; } \ No newline at end of file diff --git a/public/react/src/modules/page/component/monaco/monaco-editor.jsx b/public/react/src/components/monaco-editor.jsx similarity index 98% rename from public/react/src/modules/page/component/monaco/monaco-editor.jsx rename to public/react/src/components/monaco-editor.jsx index 1961a4479..1b79f8ff1 100644 --- a/public/react/src/modules/page/component/monaco/monaco-editor.jsx +++ b/public/react/src/components/monaco-editor.jsx @@ -1,8 +1,7 @@ import React, { useEffect, useRef, useState } from 'react' import * as monaco from 'monaco-editor' import './TPIMonacoConfig' -import './TPIMonaco.css' -import './monaco-editor.less' +import './monaco-editor.css' function processSize(size) { return !/^\d+$/.test(size) ? size : `${size}px` diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js index 0b3a23639..7b4508bff 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js @@ -1,7 +1,7 @@ import React, { Component } from "react"; import { Table, InputNumber } from "antd"; import moment from 'moment'; -import MonacoDiffEditor from 'react-monaco-editor'; +import MonacoDiffEditor from '../../../../components/monaco-editor'; import axios from 'axios'; class ShixunCustomsPass extends Component { diff --git a/public/react/src/modules/developer/components/errorResult/index.js b/public/react/src/modules/developer/components/errorResult/index.js index dd7a4cd29..f1e425f5e 100644 --- a/public/react/src/modules/developer/components/errorResult/index.js +++ b/public/react/src/modules/developer/components/errorResult/index.js @@ -8,7 +8,7 @@ */ import './index.less'; import React from 'react'; -import MonacoEditor from 'react-monaco-editor'; +import MonacoEditor from '../../../../components/monaco-editor'; function ErrorResult(props) { diff --git a/public/react/src/modules/developer/components/myMonacoEditor/index.js b/public/react/src/modules/developer/components/myMonacoEditor/index.js index 0638e5ed4..a3bf6c069 100644 --- a/public/react/src/modules/developer/components/myMonacoEditor/index.js +++ b/public/react/src/modules/developer/components/myMonacoEditor/index.js @@ -11,7 +11,7 @@ import React, { useState, useRef, useEffect } from 'react'; import { Drawer, Tooltip, Badge } from 'antd'; import { fromStore, CNotificationHOC } from 'educoder'; import { connect } from 'react-redux'; -import MonacoEditor from 'react-monaco-editor'; +import MonacoEditor from '../../../../components/monaco-editor'; import SettingDrawer from '../../components/monacoSetting'; import CONST from '../../../../constants'; import MyIcon from '../../../../common/components/MyIcon'; diff --git a/public/react/src/modules/developer/recordDetail/index.js b/public/react/src/modules/developer/recordDetail/index.js index 3b00f515c..d6afa0590 100644 --- a/public/react/src/modules/developer/recordDetail/index.js +++ b/public/react/src/modules/developer/recordDetail/index.js @@ -11,7 +11,7 @@ import React, { useState, useEffect } from 'react'; import { Button } from 'antd'; import moment from 'moment'; import ErrorResult from '../components/errorResult'; -import MonacoEditor from 'react-monaco-editor'; +import MonacoEditor from '../../../components/monaco-editor'; import { connect } from 'react-redux'; import { withRouter } from 'react-router' import actions from '../../../redux/actions'; diff --git a/public/react/src/modules/page/component/monaco/TPIMonaco.js b/public/react/src/modules/page/component/monaco/TPIMonaco.js index 59bad9ed7..fb0a39ac4 100644 --- a/public/react/src/modules/page/component/monaco/TPIMonaco.js +++ b/public/react/src/modules/page/component/monaco/TPIMonaco.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import { Drawer } from 'antd' -import MonacoEditor from './monaco-editor' +import MonacoEditor from '../../../../components/monaco-editor' import TPICodeSetting from '../TPICodeSetting' import { fromStore, toStore } from 'educoder' diff --git a/public/react/src/modules/page/component/monaco/monaco-editor.less b/public/react/src/modules/page/component/monaco/monaco-editor.less deleted file mode 100644 index 9d446016b..000000000 --- a/public/react/src/modules/page/component/monaco/monaco-editor.less +++ /dev/null @@ -1,5 +0,0 @@ -#extend-challenge-file-edit { - width: '100%'; - height: '100%'; - border: '1px solid grey'; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js index fa0bbef2f..ba37e1967 100644 --- a/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js +++ b/public/react/src/modules/tpm/TPMsettings/Shixuninformation.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import MonacoEditor from 'react-monaco-editor'; +import MonacoEditor from '../../../components/monaco-editor'; import { Input,