UNPKG

@gechiui/block-editor

Version:
72 lines (63 loc) 1.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _element = require("@gechiui/element"); var _reactNative = require("react-native"); var _blocks = require("@gechiui/blocks"); var _blockEditor = require("@gechiui/block-editor"); var _i18n = require("@gechiui/i18n"); /** * External dependencies */ /** * GeChiUI dependencies */ const Caption = _ref => { let { accessibilityLabelCreator, accessible, inlineToolbar, isSelected, onBlur, onChange, onFocus, placeholder = (0, _i18n.__)('添加说明文字'), placeholderTextColor, shouldDisplay = true, style, value, insertBlocksAfter = () => {} } = _ref; return (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