@wordpress/block-library
Version:
Block library for the WordPress editor.
43 lines (41 loc) • 1.49 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _i18n = require("@wordpress/i18n");
var _icons = require("@wordpress/icons");
/**
* WordPress dependencies
*/
const variations = [{
name: 'terms',
title: (0, _i18n.__)('Terms List'),
icon: _icons.category,
attributes: {
// We need to set an attribute here that will be set when inserting the block.
// We cannot leave this empty, as that would be interpreted as the default value,
// which is `category` -- for which we're defining a distinct variation below,
// for backwards compatibility reasons.
// The logical fallback is thus the only other built-in and public taxonomy: Tags.
taxonomy: 'post_tag'
},
isActive: blockAttributes =>
// This variation is used for any taxonomy other than `category`.
blockAttributes.taxonomy !== 'category'
}, {
name: 'categories',
title: (0, _i18n.__)('Categories List'),
description: (0, _i18n.__)('Display a list of all categories.'),
icon: _icons.category,
attributes: {
taxonomy: 'category'
},
isActive: ['taxonomy'],
// The following is needed to prevent "Terms List" from showing up twice in the inserter
// (once for the block, once for the variation). Fortunately, it does not collide with
// `categories` being the default value of the `taxonomy` attribute.
isDefault: true
}];
var _default = exports.default = variations;
//# sourceMappingURL=variations.js.map
;