UNPKG

@wordpress/block-library

Version:
156 lines (136 loc) 3.47 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.settings = exports.name = exports.metadata = exports.init = void 0; var _lodash = require("lodash"); var _i18n = require("@wordpress/i18n"); var _icons = require("@wordpress/icons"); var _initBlock = _interopRequireDefault(require("../utils/init-block")); var _deprecated = _interopRequireDefault(require("./deprecated")); var _edit = _interopRequireDefault(require("./edit")); var _save = _interopRequireDefault(require("./save")); var _transforms = _interopRequireDefault(require("./transforms")); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 2, name: "core/paragraph", title: "Paragraph", category: "text", description: "Start with the basic building block of all narrative.", keywords: ["text"], textdomain: "default", attributes: { align: { type: "string" }, content: { type: "string", source: "html", selector: "p", "default": "", __experimentalRole: "content" }, dropCap: { type: "boolean", "default": false }, placeholder: { type: "string" }, direction: { type: "string", "enum": ["ltr", "rtl"] } }, supports: { anchor: true, className: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalTextDecoration: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalSelector: "p", __unstablePasteTextInline: true }, editorStyle: "wp-block-paragraph-editor", style: "wp-block-paragraph" }; exports.metadata = metadata; const { name } = metadata; exports.name = name; const settings = { icon: _icons.paragraph, example: { attributes: { content: (0, _i18n.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'), style: { typography: { fontSize: 28 } }, dropCap: true } }, __experimentalLabel(attributes, _ref) { let { context } = _ref; if (context === 'accessibility') { const { content } = attributes; return (0, _lodash.isEmpty)(content) ? (0, _i18n.__)('Empty') : content; } }, transforms: _transforms.default, deprecated: _deprecated.default, merge(attributes, attributesToMerge) { return { content: (attributes.content || '') + (attributesToMerge.content || '') }; }, edit: _edit.default, save: _save.default }; exports.settings = settings; const init = () => (0, _initBlock.default)({ name, metadata, settings }); exports.init = init; //# sourceMappingURL=index.js.map