PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 2.25.0
Block Animations, Motion & Scroll Effects – Ghost Kit v2.25.0
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 2.25.0, at gutenberg/components/code-editor/index.js

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