@wordpress/block-library
Version:
Block library for the WordPress editor.
1 lines • 1.95 kB
Source Map (JSON)
{"version":3,"file":"variations.mjs","names":[],"sources":["../../src/heading/variations.js"],"sourcesContent":["import { __, sprintf } from '@wordpress/i18n';\nimport {\n\theadingLevel1,\n\theadingLevel2,\n\theadingLevel3,\n\theadingLevel4,\n\theadingLevel5,\n\theadingLevel6,\n} from '@wordpress/icons';\n\nconst LEVEL_ICONS = [\n\theadingLevel1,\n\theadingLevel2,\n\theadingLevel3,\n\theadingLevel4,\n\theadingLevel5,\n\theadingLevel6,\n];\n\nconst variations = [\n\t...[ 1, 2, 3, 4, 5, 6 ].map( ( level ) => ( {\n\t\tname: `h${ level }`,\n\t\ttitle: sprintf(\n\t\t\t/* translators: %d: heading level e.g: \"1\", \"2\", \"3\" */\n\t\t\t__( 'Heading %d' ),\n\t\t\tlevel\n\t\t),\n\t\tdescription: __(\n\t\t\t'Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.'\n\t\t),\n\t\ticon: LEVEL_ICONS[ level - 1 ],\n\t\tattributes: { level },\n\t\tscope: [ 'block', 'transform' ],\n\t\tkeywords: [ `h${ level }` ],\n\t\tisActive: ( blockAttributes ) => blockAttributes.level === level,\n\t\tshortcut: {\n\t\t\tname: `core/block-editor/transform-to-heading-${ level }`,\n\t\t\tdescription: sprintf(\n\t\t\t\t/* translators: %d: heading level e.g: \"1\", \"2\", \"3\" */\n\t\t\t\t__( 'Transform the selected block into a heading %d.' ),\n\t\t\t\tlevel\n\t\t\t),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: `${ level }`,\n\t\t\t},\n\t\t},\n\t} ) ),\n];\n\nexport default variations;\n"],"mappings":";;;AAUA,MAAM,cAAc;CACnB;CACA;CACA;CACA;CACA;CACA;AACD;AAEA,MAAM,aAAa,CAClB,GAAG;CAAE;CAAG;CAAG;CAAG;CAAG;CAAG;AAAE,CAAC,CAAC,KAAO,WAAa;CAC3C,MAAM,IAAK;CACX,OAAO,QAEN,GAAI,YAAa,GACjB,KACD;CACA,aAAa,GACZ,6HACD;CACA,MAAM,YAAa,QAAQ;CAC3B,YAAY,EAAE,MAAM;CACpB,OAAO,CAAE,SAAS,WAAY;CAC9B,UAAU,CAAE,IAAK,OAAS;CAC1B,WAAY,oBAAqB,gBAAgB,UAAU;CAC3D,UAAU;EACT,MAAM,0CAA2C;EACjD,aAAa,QAEZ,GAAI,iDAAkD,GACtD,KACD;EACA,gBAAgB;GACf,UAAU;GACV,WAAW,GAAI;EAChB;CACD;AACD,EAAI,CACL"}