UNPKG

@wordpress/block-library

Version:
60 lines (59 loc) • 2.58 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 clsx = require("clsx"); clsx = __toESM(clsx); let _wordpress_i18n = require("@wordpress/i18n"); let ___utils_caption_jsx = require("../utils/caption.cjs"); let __shared_js = require("./shared.cjs"); let react_jsx_runtime = require("react/jsx-runtime"); // packages/block-library/src/gallery/gallery.jsx function Gallery(props) { const { attributes, isSelected, setAttributes, insertBlocksAfter, blockProps, __unstableLayoutClassNames: layoutClassNames, isContentLocked, multiGallerySelection } = props; const { align, columns, imageCrop, layout } = attributes; const isFlexLayout = (0, __shared_js.isGalleryFlexLayout)(layout); return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("figure", { ...blockProps, className: (0, clsx.default)(blockProps.className, layoutClassNames, "blocks-gallery-grid", { [`align${align}`]: align, [`columns-${columns}`]: isFlexLayout && columns !== void 0, [`columns-default`]: isFlexLayout && columns === void 0, "is-cropped": isFlexLayout && imageCrop }), children: [blockProps.children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___utils_caption_jsx.Caption, { attributes, setAttributes, isSelected, insertBlocksAfter, showToolbarButton: !multiGallerySelection && !isContentLocked, className: "blocks-gallery-caption", label: (0, _wordpress_i18n.__)("Gallery caption text"), placeholder: (0, _wordpress_i18n.__)("Add gallery caption") })] }); } exports.default = Gallery; //# sourceMappingURL=gallery.cjs.map