UNPKG

1.29 kBJavaScriptView Raw
1import { createElement } from "@wordpress/element";
2
3/**
4 * External dependencies
5 */
6import { View } from 'react-native';
7/**
8 * WordPress dependencies
9 */
10
11import { __ } from '@wordpress/i18n';
12/**
13 * Internal dependencies
14 */
15
16import { PlainText } from '@wordpress/block-editor';
17/**
18 * Block code style
19 */
20
21import styles from './theme.scss'; // Note: styling is applied directly to the (nested) PlainText component. Web-side components
22// apply it to the container 'div' but we don't have a proper proposal for cascading styling yet.
23
24export 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//# sourceMappingURL=edit.native.js.map
\No newline at end of file