@wordpress/block-library
Version:
Block library for the WordPress editor.
8 lines (7 loc) • 1.22 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/table-of-contents/save.js"],
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsList from './list';\nimport { linearToNestedHeadingList } from './utils';\n\nexport default function save( {\n\tattributes: { headings = [], ordered = true },\n} ) {\n\tif ( headings.length === 0 ) {\n\t\treturn null;\n\t}\n\tconst ListTag = ordered ? 'ol' : 'ul';\n\treturn (\n\t\t<nav { ...useBlockProps.save() }>\n\t\t\t<ListTag>\n\t\t\t\t<TableOfContentsList\n\t\t\t\t\tnestedHeadingList={ linearToNestedHeadingList( headings ) }\n\t\t\t\t\tordered={ ordered }\n\t\t\t\t/>\n\t\t\t</ListTag>\n\t\t</nav>\n\t);\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAA8B;AAK9B,kBAAgC;AAChC,mBAA0C;AAYtC;AAVW,SAAR,KAAuB;AAAA,EAC7B,YAAY,EAAE,WAAW,CAAC,GAAG,UAAU,KAAK;AAC7C,GAAI;AACH,MAAK,SAAS,WAAW,GAAI;AAC5B,WAAO;AAAA,EACR;AACA,QAAM,UAAU,UAAU,OAAO;AACjC,SACC,4CAAC,SAAM,GAAG,kCAAc,KAAK,GAC5B,sDAAC,WACA;AAAA,IAAC,YAAAA;AAAA,IAAA;AAAA,MACA,uBAAoB,wCAA2B,QAAS;AAAA,MACxD;AAAA;AAAA,EACD,GACD,GACD;AAEF;",
"names": ["TableOfContentsList"]
}