UNPKG

@wordpress/block-library

Version:
8 lines (7 loc) 2.39 kB
{ "version": 3, "sources": ["../../src/query-title/variations.js"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { title } from '@wordpress/icons';\nconst variations = [\n\t{\n\t\tisDefault: true,\n\t\tname: 'archive-title',\n\t\ttitle: __( 'Archive Title' ),\n\t\tdescription: __(\n\t\t\t'Display the archive title based on the queried object.'\n\t\t),\n\t\ticon: title,\n\t\tattributes: {\n\t\t\ttype: 'archive',\n\t\t},\n\t\tscope: [ 'inserter' ],\n\t},\n\t{\n\t\tisDefault: false,\n\t\tname: 'search-title',\n\t\ttitle: __( 'Search Results Title' ),\n\t\tdescription: __(\n\t\t\t'Display the search results title based on the queried object.'\n\t\t),\n\t\ticon: title,\n\t\tattributes: {\n\t\t\ttype: 'search',\n\t\t},\n\t\tscope: [ 'inserter' ],\n\t},\n\t{\n\t\tisDefault: false,\n\t\tname: 'post-type-label',\n\t\ttitle: __( 'Post Type Label' ),\n\t\tdescription: __(\n\t\t\t'Display the post type label based on the queried object.'\n\t\t),\n\t\ticon: title,\n\t\tattributes: {\n\t\t\ttype: 'post-type',\n\t\t},\n\t\tscope: [ 'inserter' ],\n\t},\n];\n\n/**\n * Add `isActive` function to all `query-title` variations, if not defined.\n * `isActive` function is used to find a variation match from a created\n * Block by providing its attributes.\n */\nvariations.forEach( ( variation ) => {\n\tif ( variation.isActive ) {\n\t\treturn;\n\t}\n\tvariation.isActive = ( blockAttributes, variationAttributes ) =>\n\t\tblockAttributes.type === variationAttributes.type;\n} );\n\nexport default variations;\n"], "mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,aAAa;AACtB,IAAM,aAAa;AAAA,EAClB;AAAA,IACC,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO,GAAI,eAAgB;AAAA,IAC3B,aAAa;AAAA,MACZ;AAAA,IACD;AAAA,IACA,MAAM;AAAA,IACN,YAAY;AAAA,MACX,MAAM;AAAA,IACP;AAAA,IACA,OAAO,CAAE,UAAW;AAAA,EACrB;AAAA,EACA;AAAA,IACC,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO,GAAI,sBAAuB;AAAA,IAClC,aAAa;AAAA,MACZ;AAAA,IACD;AAAA,IACA,MAAM;AAAA,IACN,YAAY;AAAA,MACX,MAAM;AAAA,IACP;AAAA,IACA,OAAO,CAAE,UAAW;AAAA,EACrB;AAAA,EACA;AAAA,IACC,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO,GAAI,iBAAkB;AAAA,IAC7B,aAAa;AAAA,MACZ;AAAA,IACD;AAAA,IACA,MAAM;AAAA,IACN,YAAY;AAAA,MACX,MAAM;AAAA,IACP;AAAA,IACA,OAAO,CAAE,UAAW;AAAA,EACrB;AACD;AAOA,WAAW,QAAS,CAAE,cAAe;AACpC,MAAK,UAAU,UAAW;AACzB;AAAA,EACD;AACA,YAAU,WAAW,CAAE,iBAAiB,wBACvC,gBAAgB,SAAS,oBAAoB;AAC/C,CAAE;AAEF,IAAO,qBAAQ;", "names": [] }