-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afab13a
commit aef09f7
Showing
10 changed files
with
7,834 additions
and
4,383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); | ||
const { prependWebpackPlugin } = require("@rescripts/utilities"); | ||
|
||
console.log("loaded rescripts file"); | ||
|
||
module.exports = function override(config, env) { | ||
console.log("mangling webpack config"); | ||
//do stuff with the webpack config... | ||
config.plugins.unshift(new MonacoWebpackPlugin({ | ||
// available options are documented at https://github.com/Microsoft/monaco-editor-webpack-plugin#options | ||
languages: ["json", "html"] | ||
})) | ||
return config; | ||
} |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { RefObject } from "react"; | ||
import MonacoEditor from "./MonacoEditor"; | ||
|
||
interface IProps { | ||
value: string; | ||
language: string; | ||
editorDidMount: (editor: any, ref: React.RefObject<any>) => any; | ||
options?: any; | ||
theme: string; | ||
line?: number; | ||
loading?: Element | string; | ||
width?: string | number; | ||
height?: string | number; | ||
onChange: any; | ||
} | ||
|
||
const ControlledMonacoEditor: React.FC<IProps> = ({value, onChange, editorDidMount, ...props}) => { | ||
return ( | ||
<MonacoEditor | ||
value={value} | ||
editorDidMount={editorDidMount} | ||
controlled={true} | ||
{...props} | ||
/> | ||
); | ||
}; | ||
|
||
export default ControlledMonacoEditor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React, { RefObject } from "react"; | ||
import { makeStyles } from "@material-ui/core/styles"; | ||
|
||
interface IProps { | ||
width?: string | number; | ||
height?: string | number; | ||
loading?: Element | string; | ||
isEditorReady: boolean; | ||
reference: RefObject<any>; | ||
} | ||
|
||
const useStyles = makeStyles({ | ||
wrapper: { | ||
display: "flex", | ||
position: "relative", | ||
textAlign: "initial", | ||
}, | ||
fullWidth: { | ||
width: "100%", | ||
}, | ||
hide: { | ||
display: "none", | ||
}, | ||
}); | ||
|
||
const MonacoContainer: React.FC<IProps> = ({ width, height, isEditorReady, loading, reference }) => { | ||
const classes = useStyles({}); | ||
return ( | ||
<section className={classes.wrapper} style={{ width, height }}> | ||
{/* {!isEditorReady && <Loading content={loading} />} */} | ||
<div | ||
ref={reference} | ||
className={classes.fullWidth} | ||
/> | ||
</section> | ||
); | ||
}; | ||
|
||
export default MonacoContainer; |
Oops, something went wrong.