UNPKG

@wordpress/block-library

Version:
8 lines (7 loc) 1.06 kB
{ "version": 3, "sources": ["../../../../src/template-part/edit/utils/map-template-part-to-block-pattern.js"], "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { createTemplatePartId } from './create-template-part-id';\n\n/**\n * This maps the properties of a template part to those of a block pattern.\n * @param {Object} templatePart\n * @return {Object} The template part in the shape of block pattern.\n */\nexport function mapTemplatePartToBlockPattern( templatePart ) {\n\treturn {\n\t\tname: createTemplatePartId( templatePart.theme, templatePart.slug ),\n\t\ttitle: templatePart.title.rendered,\n\t\tblocks: parse( templatePart.content.raw ),\n\t\ttemplatePart,\n\t};\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAsB;AAKtB,qCAAqC;AAO9B,SAAS,8BAA+B,cAAe;AAC7D,SAAO;AAAA,IACN,UAAM,qDAAsB,aAAa,OAAO,aAAa,IAAK;AAAA,IAClE,OAAO,aAAa,MAAM;AAAA,IAC1B,YAAQ,qBAAO,aAAa,QAAQ,GAAI;AAAA,IACxC;AAAA,EACD;AACD;", "names": [] }