{"version":3,"file":"deprecated.cjs","names":["getColorClassName","useBlockProps"],"sources":["../../src/separator/deprecated.jsx"],"sourcesContent":["import clsx from 'clsx';\nimport { getColorClassName, useBlockProps } from '@wordpress/block-editor';\n\nconst v1 = {\n\tattributes: {\n\t\tcolor: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tcustomColor: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { color, customColor } = attributes;\n\n\t\t// the hr support changing color using border-color, since border-color\n\t\t// is not yet supported in the color palette, we use background-color\n\t\tconst backgroundClass = getColorClassName( 'background-color', color );\n\t\t// the dots styles uses text for the dots, to change those dots color is\n\t\t// using color, not backgroundColor\n\t\tconst colorClass = getColorClassName( 'color', color );\n\n\t\tconst className = clsx( {\n\t\t\t'has-text-color has-background': color || customColor,\n\t\t\t[ backgroundClass ]: backgroundClass,\n\t\t\t[ colorClass ]: colorClass,\n\t\t} );\n\n\t\tconst style = {\n\t\t\tbackgroundColor: backgroundClass ? undefined : customColor,\n\t\t\tcolor: colorClass ? undefined : customColor,\n\t\t};\n\n\t\treturn <hr { ...useBlockProps.save( { className, style } ) } />;\n\t},\n\tmigrate( attributes ) {\n\t\tconst { color, customColor, ...restAttributes } = attributes;\n\t\treturn {\n\t\t\t...restAttributes,\n\t\t\tbackgroundColor: color ? color : undefined,\n\t\t\topacity: 'css',\n\t\t\tstyle: customColor\n\t\t\t\t? { color: { background: customColor } }\n\t\t\t\t: undefined,\n\t\t\ttagName: 'hr',\n\t\t};\n\t},\n};\n\nexport default [ v1 ];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAA,qBAAe,CAAE;CA7ChB,YAAY;EACX,OAAO,EACN,MAAM,SACP;EACA,aAAa,EACZ,MAAM,SACP;CACD;CACA,KAAM,EAAE,cAAe;EACtB,MAAM,EAAE,OAAO,gBAAgB;EAI/B,MAAM,mBAAA,GAAkBA,wBAAAA,kBAAAA,CAAmB,oBAAoB,KAAM;EAGrE,MAAM,cAAA,GAAaA,wBAAAA,kBAAAA,CAAmB,SAAS,KAAM;EAErD,MAAM,aAAA,GAAY,KAAA,QAAA,CAAM;GACvB,iCAAiC,SAAS;IACxC,kBAAmB;IACnB,aAAc;EACjB,CAAE;EAEF,MAAM,QAAQ;GACb,iBAAiB,kBAAkB,KAAA,IAAY;GAC/C,OAAO,aAAa,KAAA,IAAY;EACjC;EAEA,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD,EAAI,GAAKC,wBAAAA,cAAc,KAAM;GAAE;GAAW;EAAM,CAAE,EAAK,CAAA;CAC/D;CACA,QAAS,YAAa;EACrB,MAAM,EAAE,OAAO,aAAa,GAAG,mBAAmB;EAClD,OAAO;GACN,GAAG;GACH,iBAAiB,QAAQ,QAAQ,KAAA;GACjC,SAAS;GACT,OAAO,cACJ,EAAE,OAAO,EAAE,YAAY,YAAY,EAAE,IACrC,KAAA;GACH,SAAS;EACV;CACD;AAGgB,CAAG"}