// import React, { useRef, useState } from 'react'; // import MonacoEditor from 'react-monaco-editor'; // import type MonacoEditorApi from 'monaco-editor/esm/vs/editor/editor.api'; // import 'monaco-editor/min/vs/editor/editor.main.nls.js' // export default { // title: 'editors/monaco/demo', // }; // // // require.config({ paths: { 'vs': '../node_modules/monaco-editor/min/vs' }}); // // require.config({ // // 'vs/nls' : { // // availableLanguages: { // // '*': 'zh-cn' // // } // // } // // }); // // const DemoMonaco: React.FC = () => { // const [value, setValue] = useState('{"name":"wener"}'); // const ref = useRef<[MonacoEditorApi.editor.IStandaloneCodeEditor, typeof MonacoEditorApi]>(); // const onEditorMount = (editor: MonacoEditorApi.editor.IStandaloneCodeEditor, monaco: typeof MonacoEditorApi) => { // ref.current = [editor, monaco]; // editor.focus(); // }; // return ( // setValue(v)} // editorDidMount={onEditorMount} // /> // ); // }; // // export const FirstDemo = () => { // return ; // }; // // // class App extends React.Component { // // constructor(props) { // // super(props); // // this.state = { // // code: '// type your code...', // // } // // } // // editorDidMount(editor, monaco) { // // console.log('editorDidMount', editor); // // editor.focus(); // // } // // onChange(newValue, e) { // // console.log('onChange', newValue, e); // // } // // render() { // // const code = this.state.code; // // const options = { // // selectOnLineNumbers: true // // }; // // return ( // // // // ); // // } // // } // // // override worker in ssr // /* // { // window.MonacoEnvironment.getWorkerUrl = (_moduleId: string, label: string) => { // if (label === 'json') return 'static/monaco/json.worker.js'; // if (label === 'css') return 'static/monaco/css.worker.js'; // if (label === 'html') return 'static/monaco/html.worker.js'; // if (label === 'typescript' || label === 'javascript') // return 'static/monaco/ts.worker.js'; // return 'static/monaco/editor.worker.js'; // }; // }} // */ export {};