{"version":3,"file":"deprecated.cjs","names":["useBlockProps","InnerBlocks"],"sources":["../../src/social-links/deprecated.jsx"],"sourcesContent":["import clsx from 'clsx';\nimport { InnerBlocks, useBlockProps } from '@wordpress/block-editor';\n\n/**\n * The specific handling by `className` below is needed because `itemsJustification`\n * was introduced in https://github.com/WordPress/gutenberg/pull/28980/files and wasn't\n * declared in block.json.\n *\n * @param {Object} attributes Block's attributes.\n */\nconst migrateWithLayout = ( attributes ) => {\n\tif ( !! attributes.layout ) {\n\t\treturn attributes;\n\t}\n\tconst { className } = attributes;\n\t// Matches classes with `items-justified-` prefix.\n\tconst prefix = `items-justified-`;\n\tconst justifiedItemsRegex = new RegExp( `\\\\b${ prefix }[^ ]*[ ]?\\\\b`, 'g' );\n\tconst newAttributes = {\n\t\t...attributes,\n\t\tclassName: className?.replace( justifiedItemsRegex, '' ).trim(),\n\t};\n\t/**\n\t * Add `layout` prop only if `justifyContent` is defined, for backwards\n\t * compatibility. In other cases the block's default layout will be used.\n\t * Also noting that due to the missing attribute, it's possible for a block\n\t * to have more than one of `justified` classes.\n\t */\n\tconst justifyContent = className\n\t\t?.match( justifiedItemsRegex )?.[ 0 ]\n\t\t?.trim();\n\tif ( justifyContent ) {\n\t\tObject.assign( newAttributes, {\n\t\t\tlayout: {\n\t\t\t\ttype: 'flex',\n\t\t\t\tjustifyContent: justifyContent.slice( prefix.length ),\n\t\t\t},\n\t\t} );\n\t}\n\treturn newAttributes;\n};\n\n// Social Links block deprecations.\nconst deprecated = [\n\t// V1. Remove CSS variable use for colors.\n\t{\n\t\tattributes: {\n\t\t\ticonColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\tcustomIconColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\ticonColorValue: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\ticonBackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\tcustomIconBackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\ticonBackgroundColorValue: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\topenInNewTab: {\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t},\n\t\tprovidesContext: {\n\t\t\topenInNewTab: 'openInNewTab',\n\t\t},\n\t\tsupports: {\n\t\t\talign: [ 'left', 'center', 'right' ],\n\t\t\tanchor: true,\n\t\t},\n\t\tmigrate: migrateWithLayout,\n\t\tsave: ( props ) => {\n\t\t\tconst {\n\t\t\t\tattributes: {\n\t\t\t\t\ticonBackgroundColorValue,\n\t\t\t\t\ticonColorValue,\n\t\t\t\t\titemsJustification,\n\t\t\t\t\tsize,\n\t\t\t\t},\n\t\t\t} = props;\n\n\t\t\tconst className = clsx( size, {\n\t\t\t\t'has-icon-color': iconColorValue,\n\t\t\t\t'has-icon-background-color': iconBackgroundColorValue,\n\t\t\t\t[ `items-justified-${ itemsJustification }` ]:\n\t\t\t\t\titemsJustification,\n\t\t\t} );\n\n\t\t\tconst style = {\n\t\t\t\t'--wp--social-links--icon-color': iconColorValue,\n\t\t\t\t'--wp--social-links--icon-background-color':\n\t\t\t\t\ticonBackgroundColorValue,\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\t<ul { ...useBlockProps.save( { className, style } ) }>\n\t\t\t\t\t<InnerBlocks.Content />\n\t\t\t\t</ul>\n\t\t\t);\n\t\t},\n\t},\n];\n\nexport default deprecated;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,qBAAsB,eAAgB;CAC3C,IAAK,CAAC,CAAE,WAAW,QAClB,OAAO;CAER,MAAM,EAAE,cAAc;CAEtB,MAAM,SAAS;CACf,MAAM,sBAAsB,IAAI,OAAQ,MAAO,OAAQ,eAAe,GAAI;CAC1E,MAAM,gBAAgB;EACrB,GAAG;EACH,WAAW,WAAW,QAAS,qBAAq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