UNPKG

@wordpress/block-library

Version:
8 lines (7 loc) 2.04 kB
{ "version": 3, "sources": ["../../src/categories/variations.js"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { category as icon } from '@wordpress/icons';\n\nconst variations = [\n\t{\n\t\tname: 'terms',\n\t\ttitle: __( 'Terms List' ),\n\t\ticon,\n\t\tattributes: {\n\t\t\t// We need to set an attribute here that will be set when inserting the block.\n\t\t\t// We cannot leave this empty, as that would be interpreted as the default value,\n\t\t\t// which is `category` -- for which we're defining a distinct variation below,\n\t\t\t// for backwards compatibility reasons.\n\t\t\t// The logical fallback is thus the only other built-in and public taxonomy: Tags.\n\t\t\ttaxonomy: 'post_tag',\n\t\t},\n\t\tisActive: ( blockAttributes ) =>\n\t\t\t// This variation is used for any taxonomy other than `category`.\n\t\t\tblockAttributes.taxonomy !== 'category',\n\t},\n\t{\n\t\tname: 'categories',\n\t\ttitle: __( 'Categories List' ),\n\t\tdescription: __( 'Display a list of all categories.' ),\n\t\ticon,\n\t\tattributes: {\n\t\t\ttaxonomy: 'category',\n\t\t},\n\t\tisActive: [ 'taxonomy' ],\n\t\t// The following is needed to prevent \"Terms List\" from showing up twice in the inserter\n\t\t// (once for the block, once for the variation). Fortunately, it does not collide with\n\t\t// `categories` being the default value of the `taxonomy` attribute.\n\t\tisDefault: true,\n\t},\n];\n\nexport default variations;\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAAiC;AAEjC,IAAM,aAAa;AAAA,EAClB;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,YAAa;AAAA,IACxB,mBAAAA;AAAA,IACA,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMX,UAAU;AAAA,IACX;AAAA,IACA,UAAU,CAAE;AAAA;AAAA,MAEX,gBAAgB,aAAa;AAAA;AAAA,EAC/B;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,iBAAkB;AAAA,IAC7B,iBAAa,gBAAI,mCAAoC;AAAA,IACrD,mBAAAA;AAAA,IACA,YAAY;AAAA,MACX,UAAU;AAAA,IACX;AAAA,IACA,UAAU,CAAE,UAAW;AAAA;AAAA;AAAA;AAAA,IAIvB,WAAW;AAAA,EACZ;AACD;AAEA,IAAO,qBAAQ;", "names": ["icon"] }