{"version":3,"file":"deprecated.mjs","names":[],"sources":["../../src/group/deprecated.jsx"],"sourcesContent":["import clsx from 'clsx';\nimport {\n\tInnerBlocks,\n\tgetColorClassName,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\n\nconst migrateAttributes = ( attributes ) => {\n\tif ( ! attributes.tagName ) {\n\t\tattributes = {\n\t\t\t...attributes,\n\t\t\ttagName: 'div',\n\t\t};\n\t}\n\n\tif ( ! attributes.customTextColor && ! attributes.customBackgroundColor ) {\n\t\treturn attributes;\n\t}\n\tconst style = { color: {} };\n\tif ( attributes.customTextColor ) {\n\t\tstyle.color.text = attributes.customTextColor;\n\t}\n\tif ( attributes.customBackgroundColor ) {\n\t\tstyle.color.background = attributes.customBackgroundColor;\n\t}\n\n\tconst { customTextColor, customBackgroundColor, ...restAttributes } =\n\t\tattributes;\n\n\treturn {\n\t\t...restAttributes,\n\t\tstyle,\n\t};\n};\n\nconst deprecated = [\n\t// Version with default layout.\n\t{\n\t\tattributes: {\n\t\t\ttagName: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'div',\n\t\t\t},\n\t\t\ttemplateLock: {\n\t\t\t\ttype: [ 'string', 'boolean' ],\n\t\t\t\tenum: [ 'all', 'insert', false ],\n\t\t\t},\n\t\t},\n\t\tsupports: {\n\t\t\t__experimentalOnEnter: true,\n\t\t\t__experimentalSettings: true,\n\t\t\talign: [ 'wide', 'full' ],\n\t\t\tanchor: true,\n\t\t\tariaLabel: true,\n\t\t\thtml: false,\n\t\t\tcolor: {\n\t\t\t\tgradients: true,\n\t\t\t\tlink: true,\n\t\t\t\t__experimentalDefaultControls: {\n\t\t\t\t\tbackground: true,\n\t\t\t\t\ttext: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tmargin: [ 'top', 'bottom' ],\n\t\t\t\tpadding: true,\n\t\t\t\tblockGap: true,\n\t\t\t\t__experimentalDefaultControls: {\n\t\t\t\t\tpadding: true,\n\t\t\t\t\tblockGap: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\t__experimentalBorder: {\n\t\t\t\tcolor: true,\n\t\t\t\tradius: true,\n\t\t\t\tstyle: true,\n\t\t\t\twidth: true,\n\t\t\t\t__experimentalDefaultControls: {\n\t\t\t\t\tcolor: true,\n\t\t\t\t\tradius: true,\n\t\t\t\t\tstyle: true,\n\t\t\t\t\twidth: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontSize: true,\n\t\t\t\tlineHeight: true,\n\t\t\t\t__experimentalFontStyle: true,\n\t\t\t\t__experimentalFontWeight: true,\n\t\t\t\t__experimentalLetterSpacing: true,\n\t\t\t\t__experimentalTextTransform: true,\n\t\t\t\t__experimentalDefaultControls: {\n\t\t\t\t\tfontSize: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tlayout: true,\n\t\t},\n\t\tsave( { attributes: { tagName: Tag } } ) {\n\t\t\treturn (\n\t\t\t\t<Tag { ...useInnerBlocksProps.save( useBlockProps.save() ) } />\n\t\t\t);\n\t\t},\n\t\tisEligible: ( { layout } ) =>\n\t\t\tlayout?.inherit ||\n\t\t\t( layout?.contentSize && layout?.type !== 'constrained' ),\n\t\tmigrate: ( attributes ) => {\n\t\t\tconst { layout = null } = attributes;\n\t\t\tif ( layout?.inherit || layout?.contentSize ) {\n\t\t\t\treturn {\n\t\t\t\t\t...attributes,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...layout,\n\t\t\t\t\t\ttype: 'constrained',\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t},\n\t// Version of the block with the double div.\n\t{\n\t\tattributes: {\n\t\t\ttagName: {\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'div',\n\t\t\t},\n\t\t\ttemplateLock: {\n\t\t\t\ttype: [ 'string', 'boolean' ],\n\t\t\t\tenum: [ 'all', 'insert', false ],\n\t\t\t},\n\t\t},\n\t\tsupports: {\n\t\t\talign: [ 'wide', 'full' ],\n\t\t\tanchor: true,\n\t\t\tcolor: {\n\t\t\t\tgradients: true,\n\t\t\t\tlink: true,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tpadding: true,\n\t\t\t},\n\t\t\t__experimentalBorder: {\n\t\t\t\tradius: true,\n\t\t\t},\n\t\t},\n\t\tsave( { attributes } ) {\n\t\t\tconst { tagName: Tag } = attributes;\n\n\t\t\treturn (\n\t\t\t\t<Tag { ...useBlockProps.save() }>\n\t\t\t\t\t<div className=\"wp-block-group__inner-container\">\n\t\t\t\t\t\t<InnerBlocks.Content />\n\t\t\t\t\t</div>\n\t\t\t\t</Tag>\n\t\t\t);\n\t\t},\n\t},\n\t// Version of the block without global styles support\n\t{\n\t\tattributes: {\n\t\t\tbackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\tcustomBackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\ttextColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\tcustomTextColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t},\n\t\tsupports: {\n\t\t\talign: [ 'wide', 'full' ],\n\t\t\tanchor: true,\n\t\t\thtml: false,\n\t\t},\n\t\tmigrate: migrateAttributes,\n\t\tsave( { attributes } ) {\n\t\t\tconst {\n\t\t\t\tbackgroundColor,\n\t\t\t\tcustomBackgroundColor,\n\t\t\t\ttextColor,\n\t\t\t\tcustomTextColor,\n\t\t\t} = attributes;\n\n\t\t\tconst backgroundClass = getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tbackgroundColor\n\t\t\t);\n\t\t\tconst textClass = getColorClassName( 'color', textColor );\n\t\t\tconst className = clsx( backgroundClass, textClass, {\n\t\t\t\t'has-text-color': textColor || customTextColor,\n\t\t\t\t'has-background': backgroundColor || customBackgroundColor,\n\t\t\t} );\n\n\t\t\tconst styles = {\n\t\t\t\tbackgroundColor: backgroundClass\n\t\t\t\t\t? undefined\n\t\t\t\t\t: customBackgroundColor,\n\t\t\t\tcolor: textClass ? undefined : customTextColor,\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\t<div className={ className } style={ styles }>\n\t\t\t\t\t<div className=\"wp-block-group__inner-container\">\n\t\t\t\t\t\t<InnerBlocks.Content />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t},\n\t},\n\t// Version of the group block with a bug that made text color class not applied.\n\t{\n\t\tattributes: {\n\t\t\tbackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\tcustomBackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\ttextColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\tcustomTextColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t},\n\t\tmigrate: migrateAttributes,\n\t\tsupports: {\n\t\t\talign: [ 'wide', 'full' ],\n\t\t\tanchor: true,\n\t\t\thtml: false,\n\t\t},\n\t\tsave( { attributes } ) {\n\t\t\tconst {\n\t\t\t\tbackgroundColor,\n\t\t\t\tcustomBackgroundColor,\n\t\t\t\ttextColor,\n\t\t\t\tcustomTextColor,\n\t\t\t} = attributes;\n\n\t\t\tconst backgroundClass = getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tbackgroundColor\n\t\t\t);\n\t\t\tconst textClass = getColorClassName( 'color', textColor );\n\t\t\tconst className = clsx( backgroundClass, {\n\t\t\t\t'has-text-color': textColor || customTextColor,\n\t\t\t\t'has-background': backgroundColor || customBackgroundColor,\n\t\t\t} );\n\n\t\t\tconst styles = {\n\t\t\t\tbackgroundColor: backgroundClass\n\t\t\t\t\t? undefined\n\t\t\t\t\t: customBackgroundColor,\n\t\t\t\tcolor: textClass ? undefined : customTextColor,\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\t<div className={ className } style={ styles }>\n\t\t\t\t\t<div className=\"wp-block-group__inner-container\">\n\t\t\t\t\t\t<InnerBlocks.Content />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t},\n\t},\n\t// v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`.\n\t{\n\t\tattributes: {\n\t\t\tbackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\tcustomBackgroundColor: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t},\n\t\tsupports: {\n\t\t\talign: [ 'wide', 'full' ],\n\t\t\tanchor: true,\n\t\t\thtml: false,\n\t\t},\n\t\tmigrate: migrateAttributes,\n\t\tsave( { attributes } ) {\n\t\t\tconst { backgroundColor, customBackgroundColor } = attributes;\n\n\t\t\tconst backgroundClass = getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tbackgroundColor\n\t\t\t);\n\t\t\tconst className = clsx( backgroundClass, {\n\t\t\t\t'has-background': backgroundColor || customBackgroundColor,\n\t\t\t} );\n\n\t\t\tconst styles = {\n\t\t\t\tbackgroundColor: backgroundClass\n\t\t\t\t\t? undefined\n\t\t\t\t\t: customBackgroundColor,\n\t\t\t};\n\n\t\t\treturn (\n\t\t\t\t<div className={ className } style={ styles }>\n\t\t\t\t\t<InnerBlocks.Content />\n\t\t\t\t</div>\n\t\t\t);\n\t\t},\n\t},\n];\n\nexport default deprecated;\n"],"mappings":";;;;AAQA,MAAM,qBAAsB,eAAgB;CAC3C,IAAK,CAAE,WAAW,SACjB,aAAa;EACZ,GAAG;EACH,SAAS;CACV;CAGD,IAAK,CAAE,WAAW,mBAAmB,CAAE,WAAW,uBACjD,OAAO;CAER,MAAM,QAAQ,EAAE,OAAO,CAAC,EAAE;CAC1B,IAAK,WAAW,iBACf,MAAM,MAAM,OAAO,WAAW;CAE/B,IAAK,WAAW,uBACf,MAAM,MAAM,aAAa,WAAW;CAGrC,MAAM,EAAE,iBAAiB,uBAAuB,GAAG,mBAClD;CAED,OAAO;EACN,GAAG;EACH;CACD;AACD;AAEA,MAAM,aAAa;CAElB;EACC,YAAY;GACX,SAAS;IACR,MAA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