UNPKG

@wordpress/block-library

Version:
82 lines (81 loc) • 3.3 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); // \0rolldown/runtime.js var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { key = keys[i]; if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: ((k) => from[k]).bind(null, key), enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); let _wordpress_icons = require("@wordpress/icons"); let _wordpress_i18n = require("@wordpress/i18n"); let ___utils_init_block_js = require("../utils/init-block.cjs"); ___utils_init_block_js = __toESM(___utils_init_block_js); let __block_json = require("./block.json"); __block_json = __toESM(__block_json); let __edit_jsx = require("./edit.cjs"); __edit_jsx = __toESM(__edit_jsx); let __save_jsx = require("./save.cjs"); __save_jsx = __toESM(__save_jsx); let __transforms_js = require("./transforms.cjs"); __transforms_js = __toESM(__transforms_js); // packages/block-library/src/details/index.js const { name } = __block_json.default; const TEMPLATE = [["core/paragraph", { placeholder: (0, _wordpress_i18n.__)("Type / to add a hidden block") }]]; const settings = { icon: _wordpress_icons.details, template: TEMPLATE, example: { attributes: { summary: (0, _wordpress_i18n.__)("La Mancha"), showContent: true }, innerBlocks: [{ name: "core/paragraph", attributes: { content: (0, _wordpress_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.") } }] }, __experimentalLabel(attributes, { context }) { const { summary } = attributes; const customName = attributes?.metadata?.name; const hasSummary = summary?.trim().length > 0; if (context === "list-view" && (customName || hasSummary)) return customName || summary; if (context === "breadcrumb" && customName) return customName; if (context === "accessibility") return !hasSummary ? (0, _wordpress_i18n.__)("Details. Empty.") : (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("Details. %s"), summary); }, save: __save_jsx.default, edit: __edit_jsx.default, transforms: __transforms_js.default }; const init = () => (0, ___utils_init_block_js.default)({ name, metadata: __block_json.default, settings }); exports.init = init; Object.defineProperty(exports, "metadata", { enumerable: true, get: function() { return __block_json.default; } }); exports.name = name; exports.settings = settings; //# sourceMappingURL=index.cjs.map