1 | import { createElement } from "@wordpress/element";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import { View } from 'react-native';
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | import { __ } from '@wordpress/i18n';
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | import { PlainText } from '@wordpress/block-editor';
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | import styles from './theme.scss';
|
22 |
|
23 |
|
24 | export default function CodeEdit(props) {
|
25 | var attributes = props.attributes,
|
26 | setAttributes = props.setAttributes,
|
27 | style = props.style,
|
28 | onFocus = props.onFocus,
|
29 | onBlur = props.onBlur;
|
30 | return createElement(View, null, createElement(PlainText, {
|
31 | value: attributes.content,
|
32 | style: [style, styles.blockCode],
|
33 | multiline: true,
|
34 | underlineColorAndroid: "transparent",
|
35 | onChange: function onChange(content) {
|
36 | return setAttributes({
|
37 | content: content
|
38 | });
|
39 | },
|
40 | placeholder: __('Write code…'),
|
41 | "aria-label": __('Code'),
|
42 | isSelected: props.isSelected,
|
43 | onFocus: onFocus,
|
44 | onBlur: onBlur,
|
45 | fontFamily: styles.blockCode.fontFamily
|
46 | }));
|
47 | }
|
48 |
|
\ | No newline at end of file |