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