@wordpress/blocks
Version:
Block API for WordPress.
8 lines (7 loc) • 18.1 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/api/serializer.js"],
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tComponent,\n\tcloneElement,\n\trenderToString,\n\tRawHTML,\n} from '@wordpress/element';\nimport { hasFilter, applyFilters } from '@wordpress/hooks';\nimport { isShallowEqual } from '@wordpress/is-shallow-equal';\nimport { removep } from '@wordpress/autop';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockType,\n\tgetFreeformContentHandlerName,\n\tgetUnregisteredTypeHandlerName,\n} from './registration';\nimport { serializeRawBlock } from './parser/serialize-raw-block';\nimport { isUnmodifiedDefaultBlock, normalizeBlockType } from './utils';\n\n/** @typedef {import('./parser').WPBlock} WPBlock */\n\n/**\n * @typedef {Object} WPBlockSerializationOptions Serialization Options.\n *\n * @property {boolean} isInnerBlocks Whether we are serializing inner blocks.\n */\n\n/**\n * Returns the block's default classname from its name.\n *\n * @param {string} blockName The block name.\n *\n * @return {string} The block's default class.\n */\nexport function getBlockDefaultClassName( blockName ) {\n\t// Generated HTML classes for blocks follow the `wp-block-{name}` nomenclature.\n\t// Blocks provided by WordPress drop the prefixes 'core/' or 'core-' (historically used in 'core-embed/').\n\tconst className =\n\t\t'wp-block-' + blockName.replace( /\\//, '-' ).replace( /^core-/, '' );\n\n\treturn applyFilters(\n\t\t'blocks.getBlockDefaultClassName',\n\t\tclassName,\n\t\tblockName\n\t);\n}\n\n/**\n * Returns the block's default menu item classname from its name.\n *\n * @param {string} blockName The block name.\n *\n * @return {string} The block's default menu item class.\n */\nexport function getBlockMenuDefaultClassName( blockName ) {\n\t// Generated HTML classes for blocks follow the `editor-block-list-item-{name}` nomenclature.\n\t// Blocks provided by WordPress drop the prefixes 'core/' or 'core-' (historically used in 'core-embed/').\n\tconst className =\n\t\t'editor-block-list-item-' +\n\t\tblockName.replace( /\\//, '-' ).replace( /^core-/, '' );\n\n\treturn applyFilters(\n\t\t'blocks.getBlockMenuDefaultClassName',\n\t\tclassName,\n\t\tblockName\n\t);\n}\n\nconst blockPropsProvider = {};\nconst innerBlocksPropsProvider = {};\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nexport function getBlockProps( props = {} ) {\n\tconst { blockType, attributes } = blockPropsProvider;\n\treturn getBlockProps.skipFilters\n\t\t? props\n\t\t: applyFilters(\n\t\t\t\t'blocks.getSaveContent.extraProps',\n\t\t\t\t{ ...props },\n\t\t\t\tblockType,\n\t\t\t\tattributes\n\t\t );\n}\n\n/**\n * Call within a save function to get the props for the inner blocks wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nexport function getInnerBlocksProps( props = {} ) {\n\tconst { innerBlocks } = innerBlocksPropsProvider;\n\t// Allow a different component to be passed to getSaveElement to handle\n\t// inner blocks, bypassing the default serialisation.\n\tif ( ! Array.isArray( innerBlocks ) ) {\n\t\treturn { ...props, children: innerBlocks };\n\t}\n\t// Value is an array of blocks, so defer to block serializer.\n\tconst html = serialize( innerBlocks, { isInnerBlocks: true } );\n\t// Use special-cased raw HTML tag to avoid default escaping.\n\tconst children = <RawHTML>{ html }</RawHTML>;\n\n\treturn { ...props, children };\n}\n\n/**\n * Given a block type containing a save render implementation and attributes, returns the\n * enhanced element to be saved or string when raw HTML expected.\n *\n * @param {string|Object} blockTypeOrName Block type or name.\n * @param {Object} attributes Block attributes.\n * @param {?Array} innerBlocks Nested blocks.\n *\n * @return {Object|string} Save element or raw HTML string.\n */\nexport function getSaveElement(\n\tblockTypeOrName,\n\tattributes,\n\tinnerBlocks = []\n) {\n\tconst blockType = normalizeBlockType( blockTypeOrName );\n\n\tif ( ! blockType?.save ) {\n\t\treturn null;\n\t}\n\n\tlet { save } = blockType;\n\n\t// Component classes are unsupported for save since serialization must\n\t// occur synchronously. For improved interoperability with higher-order\n\t// components which often return component class, emulate basic support.\n\tif ( save.prototype instanceof Component ) {\n\t\tconst instance = new save( { attributes } );\n\t\tsave = instance.render.bind( instance );\n\t}\n\n\tblockPropsProvider.blockType = blockType;\n\tblockPropsProvider.attributes = attributes;\n\tinnerBlocksPropsProvider.innerBlocks = innerBlocks;\n\n\tlet element = save( { attributes, innerBlocks } );\n\n\tif (\n\t\telement !== null &&\n\t\ttypeof element === 'object' &&\n\t\thasFilter( 'blocks.getSaveContent.extraProps' ) &&\n\t\t! ( blockType.apiVersion > 1 )\n\t) {\n\t\t/**\n\t\t * Filters the props applied to the block save result element.\n\t\t *\n\t\t * @param {Object} props Props applied to save element.\n\t\t * @param {WPBlock} blockType Block type definition.\n\t\t * @param {Object} attributes Block attributes.\n\t\t */\n\t\tconst props = applyFilters(\n\t\t\t'blocks.getSaveContent.extraProps',\n\t\t\t{ ...element.props },\n\t\t\tblockType,\n\t\t\tattributes\n\t\t);\n\n\t\tif ( ! isShallowEqual( props, element.props ) ) {\n\t\t\telement = cloneElement( element, props );\n\t\t}\n\t}\n\n\t/**\n\t * Filters the save result of a block during serialization.\n\t *\n\t * @param {Element} element Block save result.\n\t * @param {WPBlock} blockType Block type definition.\n\t * @param {Object} attributes Block attributes.\n\t */\n\treturn applyFilters(\n\t\t'blocks.getSaveElement',\n\t\telement,\n\t\tblockType,\n\t\tattributes\n\t);\n}\n\n/**\n * Given a block type containing a save render implementation and attributes, returns the\n * static markup to be saved.\n *\n * @param {string|Object} blockTypeOrName Block type or name.\n * @param {Object} attributes Block attributes.\n * @param {?Array} innerBlocks Nested blocks.\n *\n * @return {string} Save content.\n */\nexport function getSaveContent( blockTypeOrName, attributes, innerBlocks ) {\n\tconst blockType = normalizeBlockType( blockTypeOrName );\n\n\treturn renderToString(\n\t\tgetSaveElement( blockType, attributes, innerBlocks )\n\t);\n}\n\n/**\n * Returns attributes which are to be saved and serialized into the block\n * comment delimiter.\n *\n * When a block exists in memory it contains as its attributes both those\n * parsed the block comment delimiter _and_ those which matched from the\n * contents of the block.\n *\n * This function returns only those attributes which are needed to persist and\n * which cannot be matched from the block content.\n *\n * @param {Object<string,*>} blockType Block type.\n * @param {Object<string,*>} attributes Attributes from in-memory block data.\n *\n * @return {Object<string,*>} Subset of attributes for comment serialization.\n */\nexport function getCommentAttributes( blockType, attributes ) {\n\treturn Object.entries( blockType.attributes ?? {} ).reduce(\n\t\t( accumulator, [ key, attributeSchema ] ) => {\n\t\t\tconst value = attributes[ key ];\n\t\t\t// Ignore undefined values.\n\t\t\tif ( undefined === value ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\t// Ignore all attributes but the ones with an \"undefined\" source\n\t\t\t// \"undefined\" source refers to attributes saved in the block comment.\n\t\t\tif ( attributeSchema.source !== undefined ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\t// Ignore all local attributes\n\t\t\tif ( attributeSchema.role === 'local' ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\tif ( attributeSchema.__experimentalRole === 'local' ) {\n\t\t\t\tdeprecated( '__experimentalRole attribute', {\n\t\t\t\t\tsince: '6.7',\n\t\t\t\t\tversion: '6.8',\n\t\t\t\t\talternative: 'role attribute',\n\t\t\t\t\thint: `Check the block.json of the ${ blockType?.name } block.`,\n\t\t\t\t} );\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\t// Ignore default value.\n\t\t\tif (\n\t\t\t\t'default' in attributeSchema &&\n\t\t\t\tJSON.stringify( attributeSchema.default ) ===\n\t\t\t\t\tJSON.stringify( value )\n\t\t\t) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\t// Otherwise, include in comment set.\n\t\t\taccumulator[ key ] = value;\n\t\t\treturn accumulator;\n\t\t},\n\t\t{}\n\t);\n}\n\n/**\n * Given an attributes object, returns a string in the serialized attributes\n * format prepared for post content.\n *\n * @param {Object} attributes Attributes object.\n *\n * @return {string} Serialized attributes.\n */\nexport function serializeAttributes( attributes ) {\n\treturn (\n\t\tJSON.stringify( attributes )\n\t\t\t// Replace escaped `\\` characters with the unicode escape sequence.\n\t\t\t.replaceAll( '\\\\\\\\', '\\\\u005c' )\n\n\t\t\t// Don't break HTML comments.\n\t\t\t.replaceAll( '--', '\\\\u002d\\\\u002d' )\n\n\t\t\t// Don't break non-standard-compliant tools.\n\t\t\t.replaceAll( '<', '\\\\u003c' )\n\t\t\t.replaceAll( '>', '\\\\u003e' )\n\t\t\t.replaceAll( '&', '\\\\u0026' )\n\n\t\t\t// Replace escaped quotes (`\\\"`) to prevent problems with wp_kses_stripsplashes.\n\t\t\t// This simple replacement is safe because `\\\\` has already been replaced.\n\t\t\t// `\\\"` is not a JSON string quote like `\"\\\\\"`.\n\t\t\t.replaceAll( '\\\\\"', '\\\\u0022' )\n\t);\n}\n\n/**\n * Given a block object, returns the Block's Inner HTML markup.\n *\n * @param {Object} block Block instance.\n *\n * @return {string} HTML.\n */\nexport function getBlockInnerHTML( block ) {\n\t// If block was parsed as invalid or encounters an error while generating\n\t// save content, use original content instead to avoid content loss. If a\n\t// block contains nested content, exempt it from this condition because we\n\t// otherwise have no access to its original content and content loss would\n\t// still occur.\n\tlet saveContent = block.originalContent;\n\tif ( block.isValid || block.innerBlocks.length ) {\n\t\ttry {\n\t\t\tsaveContent = getSaveContent(\n\t\t\t\tblock.name,\n\t\t\t\tblock.attributes,\n\t\t\t\tblock.innerBlocks\n\t\t\t);\n\t\t} catch ( error ) {}\n\t}\n\n\treturn saveContent;\n}\n\n/**\n * Returns the content of a block, including comment delimiters.\n *\n * @param {string} rawBlockName Block name.\n * @param {Object} attributes Block attributes.\n * @param {string} content Block save content.\n *\n * @return {string} Comment-delimited block content.\n */\nexport function getCommentDelimitedContent(\n\trawBlockName,\n\tattributes,\n\tcontent\n) {\n\tconst serializedAttributes =\n\t\tattributes && Object.entries( attributes ).length\n\t\t\t? serializeAttributes( attributes ) + ' '\n\t\t\t: '';\n\n\t// Strip core blocks of their namespace prefix.\n\tconst blockName = rawBlockName?.startsWith( 'core/' )\n\t\t? rawBlockName.slice( 5 )\n\t\t: rawBlockName;\n\n\t// @todo make the `wp:` prefix potentially configurable.\n\n\tif ( ! content ) {\n\t\treturn `<!-- wp:${ blockName } ${ serializedAttributes }/-->`;\n\t}\n\n\treturn (\n\t\t`<!-- wp:${ blockName } ${ serializedAttributes }-->\\n` +\n\t\tcontent +\n\t\t`\\n<!-- /wp:${ blockName } -->`\n\t);\n}\n\n/**\n * Returns the content of a block, including comment delimiters, determining\n * serialized attributes and content form from the current state of the block.\n *\n * @param {WPBlock} block Block instance.\n * @param {WPBlockSerializationOptions} options Serialization options.\n *\n * @return {string} Serialized block.\n */\nexport function serializeBlock( block, { isInnerBlocks = false } = {} ) {\n\tif ( ! block.isValid && block.__unstableBlockSource ) {\n\t\treturn serializeRawBlock( block.__unstableBlockSource );\n\t}\n\n\tconst blockName = block.name;\n\tconst saveContent = getBlockInnerHTML( block );\n\n\tif (\n\t\tblockName === getUnregisteredTypeHandlerName() ||\n\t\t( ! isInnerBlocks && blockName === getFreeformContentHandlerName() )\n\t) {\n\t\treturn saveContent;\n\t}\n\n\tconst blockType = getBlockType( blockName );\n\tif ( ! blockType ) {\n\t\treturn saveContent;\n\t}\n\n\tconst saveAttributes = getCommentAttributes( blockType, block.attributes );\n\treturn getCommentDelimitedContent( blockName, saveAttributes, saveContent );\n}\n\nexport const __unstableSerializeAndClean = ( () => {\n\tconst cache = new WeakMap();\n\n\treturn ( blocks ) => {\n\t\tconst cached = cache.get( blocks );\n\t\tif ( cached !== undefined ) {\n\t\t\treturn cached;\n\t\t}\n\n\t\tlet effectiveBlocks = blocks;\n\n\t\t// A single unmodified default block is assumed to\n\t\t// be equivalent to an empty post.\n\t\tif (\n\t\t\teffectiveBlocks.length === 1 &&\n\t\t\tisUnmodifiedDefaultBlock( effectiveBlocks[ 0 ] )\n\t\t) {\n\t\t\teffectiveBlocks = [];\n\t\t}\n\n\t\tlet content = serialize( effectiveBlocks );\n\n\t\t// For compatibility, treat a post consisting of a\n\t\t// single freeform block as legacy content and apply\n\t\t// pre-block-editor removep'd content formatting.\n\t\tif (\n\t\t\teffectiveBlocks.length === 1 &&\n\t\t\teffectiveBlocks[ 0 ].name === getFreeformContentHandlerName() &&\n\t\t\teffectiveBlocks[ 0 ].name === 'core/freeform'\n\t\t) {\n\t\t\tcontent = removep( content );\n\t\t}\n\n\t\tcache.set( blocks, content );\n\t\treturn content;\n\t};\n} )();\n\n/**\n * Takes a block or set of blocks and returns the serialized post content.\n *\n * @param {Array} blocks Block(s) to serialize.\n * @param {WPBlockSerializationOptions} options Serialization options.\n *\n * @return {string} The post content.\n */\nexport default function serialize( blocks, options ) {\n\tconst blocksArray = Array.isArray( blocks ) ? blocks : [ blocks ];\n\treturn blocksArray\n\t\t.map( ( block ) => serializeBlock( block, options ) )\n\t\t.join( '\\n\\n' );\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAKO;AACP,mBAAwC;AACxC,8BAA+B;AAC/B,mBAAwB;AACxB,wBAAuB;AAKvB,0BAIO;AACP,iCAAkC;AAClC,mBAA6D;AAsF3C;AArEX,SAAS,yBAA0B,WAAY;AAGrD,QAAM,YACL,cAAc,UAAU,QAAS,MAAM,GAAI,EAAE,QAAS,UAAU,EAAG;AAEpE,aAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AASO,SAAS,6BAA8B,WAAY;AAGzD,QAAM,YACL,4BACA,UAAU,QAAS,MAAM,GAAI,EAAE,QAAS,UAAU,EAAG;AAEtD,aAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AAEA,IAAM,qBAAqB,CAAC;AAC5B,IAAM,2BAA2B,CAAC;AAO3B,SAAS,cAAe,QAAQ,CAAC,GAAI;AAC3C,QAAM,EAAE,WAAW,WAAW,IAAI;AAClC,S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