@wordpress/block-library
Version:
Block library for the WordPress editor.
1 lines • 918 B
Source Map (JSON)
{"version":3,"file":"map-template-part-to-block-pattern.mjs","names":[],"sources":["../../../../src/template-part/edit/utils/map-template-part-to-block-pattern.js"],"sourcesContent":["import { parse } from '@wordpress/blocks';\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":";;;;;;;;AAQA,SAAgB,8BAA+B,cAAe;CAC7D,OAAO;EACN,MAAM,qBAAsB,aAAa,OAAO,aAAa,IAAK;EAClE,OAAO,aAAa,MAAM;EAC1B,QAAQ,MAAO,aAAa,QAAQ,GAAI;EACxC;CACD;AACD"}