UNPKG

@wordpress/block-library

Version:
45 lines (42 loc) 1.19 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = save; var _clsx = _interopRequireDefault(require("clsx")); var _blockEditor = require("@wordpress/block-editor"); var _jsxRuntime = require("react/jsx-runtime"); /** * External dependencies */ /** * WordPress dependencies */ function save({ attributes }) { const { textAlign, citation, value } = attributes; const shouldShowCitation = !_blockEditor.RichText.isEmpty(citation); return /*#__PURE__*/(0, _jsxRuntime.jsx)("figure", { ..._blockEditor.useBlockProps.save({ className: (0, _clsx.default)({ [`has-text-align-${textAlign}`]: textAlign }) }), children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("blockquote", { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText.Content, { tagName: "p", value: value }), shouldShowCitation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText.Content, { tagName: "cite", value: citation })] }) }); } //# sourceMappingURL=save.js.map