PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.3
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.3
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / components / code-editor / index.js

index.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.3, at gutenberg/components/code-editor/index.js

52 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // eslint-disable-next-line simple-import-sort/imports
2 import AceEditor from 'react-ace';
3 import 'ace-builds/src-noconflict/mode-css';
4 import 'ace-builds/src-noconflict/mode-javascript';
5 import 'ace-builds/src-noconflict/snippets/css';
6 import 'ace-builds/src-noconflict/snippets/javascript';
7 import 'ace-builds/src-noconflict/snippets/text';
8 import 'ace-builds/src-noconflict/ext-language_tools';
9
10 /**
11 * Component Class
12 *
13 * @param props
14 */
15 export default function CodeEditor(props) {
16 const { setOptions = {}, editorProps = {}, ...restProps } = props;
17
18 return (
19 <AceEditor
20 className="ghostkit-component-code-editor"
21 theme="textmate"
22 onLoad={(editor) => {
23 editor.renderer.setScrollMargin(16, 16, 16, 16);
24 editor.renderer.setPadding(16);
25 }}
26 fontSize={12}
27 showPrintMargin
28 showGutter
29 highlightActiveLine={false}
30 width="100%"
31 setOptions={{
32 enableBasicAutocompletion: true,
33 enableLiveAutocompletion: true,
34 enableSnippets: true,
35 showLineNumbers: true,
36 printMargin: false,
37 tabSize: 2,
38
39 // When worker is enabled, a lot of errors displayed in the console.
40 useWorker: false,
41
42 ...setOptions,
43 }}
44 editorProps={{
45 $blockScrolling: Infinity,
46 ...editorProps,
47 }}
48 {...restProps}
49 />
50 );
51 }
52