@wordpress/block-library
Version:
Block library for the WordPress editor.
8 lines (7 loc) • 2.32 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/post-navigation-link/variations.js"],
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\n\nconst variations = [\n\t{\n\t\tname: 'post-previous',\n\t\ttitle: __( 'Previous Post' ),\n\t\tdescription: __(\n\t\t\t'Displays the post link that precedes the current post.'\n\t\t),\n\t\ticon: previous,\n\t\tattributes: { type: 'previous' },\n\t\tscope: [ 'inserter', 'transform' ],\n\t\texample: {\n\t\t\tattributes: {\n\t\t\t\tlabel: __( 'Previous post' ),\n\t\t\t\tarrow: 'arrow',\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tisDefault: true,\n\t\tname: 'post-next',\n\t\ttitle: __( 'Next Post' ),\n\t\tdescription: __(\n\t\t\t'Displays the post link that follows the current post.'\n\t\t),\n\t\ticon: next,\n\t\tattributes: { type: 'next' },\n\t\tscope: [ 'inserter', 'transform' ],\n\t\texample: {\n\t\t\tattributes: {\n\t\t\t\tlabel: __( 'Next post' ),\n\t\t\t\tarrow: 'arrow',\n\t\t\t},\n\t\t},\n\t},\n];\n\n/**\n * Add `isActive` function to all `post-navigation-link` 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": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA+B;AAE/B,IAAM,aAAa;AAAA,EAClB;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,eAAgB;AAAA,IAC3B,iBAAa;AAAA,MACZ;AAAA,IACD;AAAA,IACA,MAAM;AAAA,IACN,YAAY,EAAE,MAAM,WAAW;AAAA,IAC/B,OAAO,CAAE,YAAY,WAAY;AAAA,IACjC,SAAS;AAAA,MACR,YAAY;AAAA,QACX,WAAO,gBAAI,eAAgB;AAAA,QAC3B,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,WAAW;AAAA,IACX,MAAM;AAAA,IACN,WAAO,gBAAI,WAAY;AAAA,IACvB,iBAAa;AAAA,MACZ;AAAA,IACD;AAAA,IACA,MAAM;AAAA,IACN,YAAY,EAAE,MAAM,OAAO;AAAA,IAC3B,OAAO,CAAE,YAAY,WAAY;AAAA,IACjC,SAAS;AAAA,MACR,YAAY;AAAA,QACX,WAAO,gBAAI,WAAY;AAAA,QACvB,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;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": []
}