diff --git a/packages/demo/public/assets.json b/packages/demo/public/assets.json index c5fd05dda..ef8650e05 100644 --- a/packages/demo/public/assets.json +++ b/packages/demo/public/assets.json @@ -26,13 +26,6 @@ "version": "1.0.0", "urls": ["https://unpkg.alibaba-inc.com/mc-breadcrumb@1.0.0/dist/MCBreadcrumb.js", "https://unpkg.alibaba-inc.com/mc-breadcrumb@1.0.0/dist/MCBreadcrumb.css"], "library": "MCBreadcrumb" - }, - { - "title": "krumpDemo", - "package": "krumpDemo", - "version": "1.0.0", - "urls": ["http://30.37.82.74:8000/lc-engine.js"], - "library": "krump-test-module" } ], "components": [ diff --git a/packages/editor-setters/src/expression-setter/index.tsx b/packages/editor-setters/src/expression-setter/index.tsx index a4195a7a1..040c6f5b1 100644 --- a/packages/editor-setters/src/expression-setter/index.tsx +++ b/packages/editor-setters/src/expression-setter/index.tsx @@ -89,17 +89,17 @@ export default class ExpressionView extends PureComponent { return null; } - onChange(value: string, actionType: string) { - let realInputValue = value; + onChange(value: string) { + const realInputValue = value; const realDataSource = null; let nextCursorIndex: number; // 更新值 - if (actionType === 'itemClick' || actionType === 'enter') { - const curValue = this.state.value; - if (curValue) { - realInputValue = curValue + realInputValue; - } - } + // if (actionType === 'itemClick' || actionType === 'enter') { + // // const curValue = this.state.value; + // // if (curValue) { + // // realInputValue = curValue + realInputValue; + // // } + // } // 更新数据源 const newState = { value: realInputValue, diff --git a/packages/plugin-source-editor/src/index.tsx b/packages/plugin-source-editor/src/index.tsx index fb8551d6b..50e1228a3 100644 --- a/packages/plugin-source-editor/src/index.tsx +++ b/packages/plugin-source-editor/src/index.tsx @@ -58,12 +58,12 @@ export default class SourceEditor extends Component<{ private originSize: { width: '', height: '' - } + }; state = { isShowSaveBtn: true, visiable: false, - fullScreenStatus:false + fullScreenStatus: false, }; // eslint-disable-next-line react/no-deprecated @@ -103,7 +103,7 @@ export default class SourceEditor extends Component<{ componentDidMount() { - this.editorNode = this.editorJsRef.current; // 记录当前dom节点; + // this.editorNode = this.editorJsRef.current; // 记录当前dom节点; } /** @@ -152,6 +152,7 @@ export default class SourceEditor extends Component<{ css, selectTab: TAB_KEY.JS_TAB, visiable: true, + fullScreenStatus: false, }); }; @@ -204,9 +205,14 @@ export default class SourceEditor extends Component<{ if (this.editorCmd) { this.callEditorEvent(this.editorCmd.eventName, this.editorCmd.params); } + + setTimeout(() => { + this.editorNode = this.editorJsRef.current; // 记录当前dom节点; + }, 0); }; fullScreen = () => { + console.log(this.editorNode); document.body.appendChild(this.editorNode); // this.originSize = { // width: this.editorNode.clientWidth, @@ -224,33 +230,34 @@ export default class SourceEditor extends Component<{ this.monocoEditor.layout({ height: document.body.clientHeight, - width: document.body.clientWidth - }) + width: document.body.clientWidth, + }); this.monocoEditor.updateOptions(fullScreenOption); this.setState({ - fullScreenStatus:true - }) + fullScreenStatus: true, + }); }; minScreen = () => { - - // document.body.removeChild(this.editorNode); - let node=document.getElementById("editor-context-container").lastChild; - document.getElementById('editor-context-container')?.insertBefore(node,this.editorNode); + const listNode = document.getElementById('editor-context-container'); + listNode.insertBefore(this.editorNode, listNode.childNodes[0]); const minScreenOption = { - ...defaultEditorOption + ...defaultEditorOption, + minimap: { + enabled: false, + }, }; this.monocoEditor.updateOptions(minScreenOption); this.setState({ - fullScreenStatus:false - }) + fullScreenStatus: false, + }); - } + }; onTabChange = (key) => { const { editor } = this.props; @@ -312,7 +319,7 @@ export default class SourceEditor extends Component<{ }; render() { - const { selectTab, jsCode, css, isShowSaveBtn, visiable,fullScreenStatus } = this.state; + const { selectTab, jsCode, css, isShowSaveBtn, visiable, fullScreenStatus } = this.state; const tabs = [ { tab: 'index.js', key: TAB_KEY.JS_TAB }, { tab: 'style.css', key: TAB_KEY.CSS_TAB }, @@ -331,7 +338,7 @@ export default class SourceEditor extends Component<{ { visiable &&
-
-
+
+