@wordpress/block-library
Version:
Block library for the WordPress editor.
36 lines (35 loc) • 1.18 kB
JavaScript
import { __ } from "@wordpress/i18n";
import { gallery, grid } from "@wordpress/icons";
import { ATTACHED_MEDIA } from "./dynamic-source.mjs";
import { isGalleryFlexLayout } from "./shared.mjs";
// packages/block-library/src/gallery/variations.js
const variations = [
{
name: "dynamic-gallery",
title: __("Dynamic Gallery"),
description: __("Display images from a source, such as those attached to the current post."),
attributes: { dynamicContent: { source: ATTACHED_MEDIA } },
isActive: (blockAttributes) => !!blockAttributes.dynamicContent,
scope: []
},
{
name: "gallery-flex",
title: __("Gallery"),
description: __("Arrange images in flexible rows."),
icon: gallery,
attributes: { layout: { type: "flex" } },
isActive: (blockAttributes) => isGalleryFlexLayout(blockAttributes.layout),
scope: ["transform"]
},
{
name: "gallery-grid",
title: __("Gallery Grid"),
description: __("Arrange images in a grid."),
icon: grid,
attributes: { layout: { type: "grid" } },
isActive: (blockAttributes) => blockAttributes.layout?.type === "grid",
scope: ["transform"]
}
];
export { variations as default };
//# sourceMappingURL=variations.mjs.map