UNPKG

@wordpress/block-editor

Version:
69 lines (60 loc) 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _element = require("@wordpress/element"); var _reactNative = require("react-native"); var _blocks = require("@wordpress/blocks"); var _blockEditor = require("@wordpress/block-editor"); var _i18n = require("@wordpress/i18n"); /** * External dependencies */ /** * WordPress dependencies */ const Caption = ({ accessibilityLabelCreator, accessible, inlineToolbar, isSelected, onBlur, onChange, onFocus, placeholder = (0, _i18n.__)('Add caption'), placeholderTextColor, shouldDisplay = true, style, value, insertBlocksAfter = () => {} }) => (0, _element.createElement)(_reactNative.View, { accessibilityLabel: accessibilityLabelCreator ? accessibilityLabelCreator(value) : undefined, accessibilityRole: "button", accessible: accessible, style: { flex: 1, display: shouldDisplay ? 'flex' : 'none' } }, (0, _element.createElement)(_blockEditor.RichText, { __unstableMobileNoFocusOnMount: true, fontSize: style && style.fontSize ? style.fontSize : 14, inlineToolbar: inlineToolbar, isSelected: isSelected, onBlur: onBlur, onChange: onChange, placeholder: placeholder, placeholderTextColor: placeholderTextColor, rootTagsToEliminate: ['p'], style: style, tagName: "p", textAlign: "center", underlineColorAndroid: "transparent", unstableOnFocus: onFocus, value: value, __unstableOnSplitAtEnd: () => insertBlocksAfter((0, _blocks.createBlock)('core/paragraph')), deleteEnter: true })); var _default = Caption; exports.default = _default; //# sourceMappingURL=index.native.js.map