@wordpress/block-library
Version:
Block library for the WordPress editor.
1 lines • 13.6 kB
Source Map (JSON)
{"version":3,"file":"deprecated.cjs","names":["useBlockProps","getSpacingClassesAndStyles","RichText","getTypographyClassesAndStyles"],"sources":["../../src/accordion-heading/deprecated.jsx"],"sourcesContent":["import {\n\tuseBlockProps,\n\t__experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles,\n\tRichText,\n\tgetTypographyClassesAndStyles,\n} from '@wordpress/block-editor';\n\nconst v1 = {\n\tattributes: {\n\t\topenByDefault: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\ttitle: {\n\t\t\ttype: 'rich-text',\n\t\t\tsource: 'rich-text',\n\t\t\tselector: '.wp-block-accordion-heading__toggle-title',\n\t\t\trole: 'content',\n\t\t},\n\t\tlevel: {\n\t\t\ttype: 'number',\n\t\t},\n\t\ticonPosition: {\n\t\t\ttype: 'string',\n\t\t\tenum: [ 'left', 'right' ],\n\t\t\tdefault: 'right',\n\t\t},\n\t\tshowIcon: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\tcolor: {\n\t\t\tbackground: true,\n\t\t\tgradients: true,\n\t\t},\n\t\talign: false,\n\t\tinteractivity: true,\n\t\tspacing: {\n\t\t\tpadding: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tpadding: true,\n\t\t\t},\n\t\t\t__experimentalSkipSerialization: true,\n\t\t\t__experimentalSelector: '.wp-block-accordion-heading__toggle',\n\t\t},\n\t\t__experimentalBorder: {\n\t\t\tcolor: true,\n\t\t\tradius: true,\n\t\t\tstyle: true,\n\t\t\twidth: true,\n\t\t\t__experimentalDefaultControls: {\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},\n\t\t},\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalTextDecoration: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t\tfontFamily: true,\n\t\t\t},\n\t\t},\n\t\tshadow: true,\n\t\tvisibility: false,\n\t},\n\tsave( { attributes } ) {\n\t\tconst { level, title, iconPosition, showIcon } = attributes;\n\t\tconst TagName = 'h' + ( level || 3 );\n\n\t\tconst blockProps = useBlockProps.save();\n\t\tconst spacingProps = getSpacingClassesAndStyles( attributes );\n\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle\"\n\t\t\t\t\tstyle={ spacingProps.style }\n\t\t\t\t>\n\t\t\t\t\t{ showIcon && iconPosition === 'left' && (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle-icon\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t+\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t<RichText.Content\n\t\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle-title\"\n\t\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t/>\n\t\t\t\t\t{ showIcon && iconPosition === 'right' && (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle-icon\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t+\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</button>\n\t\t\t</TagName>\n\t\t);\n\t},\n};\n\nconst v2 = {\n\tattributes: {\n\t\topenByDefault: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\ttitle: {\n\t\t\ttype: 'rich-text',\n\t\t\tsource: 'rich-text',\n\t\t\tselector: '.wp-block-accordion-heading__toggle-title',\n\t\t\trole: 'content',\n\t\t},\n\t\tlevel: {\n\t\t\ttype: 'number',\n\t\t},\n\t\ticonPosition: {\n\t\t\ttype: 'string',\n\t\t\tenum: [ 'left', 'right' ],\n\t\t\tdefault: 'right',\n\t\t},\n\t\tshowIcon: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\tcolor: {\n\t\t\tbackground: true,\n\t\t\tgradients: true,\n\t\t},\n\t\talign: false,\n\t\tinteractivity: true,\n\t\tspacing: {\n\t\t\tpadding: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tpadding: true,\n\t\t\t},\n\t\t\t__experimentalSkipSerialization: true,\n\t\t\t__experimentalSelector: '.wp-block-accordion-heading__toggle',\n\t\t},\n\t\t__experimentalBorder: {\n\t\t\tcolor: true,\n\t\t\tradius: true,\n\t\t\tstyle: true,\n\t\t\twidth: true,\n\t\t\t__experimentalDefaultControls: {\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},\n\t\t},\n\t\ttypography: {\n\t\t\t__experimentalSkipSerialization: [\n\t\t\t\t'textDecoration',\n\t\t\t\t'letterSpacing',\n\t\t\t],\n\t\t\tfontSize: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalTextDecoration: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t\tfontFamily: true,\n\t\t\t},\n\t\t},\n\t\tshadow: true,\n\t\tvisibility: false,\n\t\tlock: false,\n\t},\n\tsave( { attributes } ) {\n\t\tconst { level, title, iconPosition, showIcon } = attributes;\n\t\tconst TagName = 'h' + ( level || 3 );\n\t\tconst typographyProps = getTypographyClassesAndStyles( attributes );\n\n\t\tconst blockProps = useBlockProps.save();\n\t\tconst spacingProps = getSpacingClassesAndStyles( attributes );\n\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle\"\n\t\t\t\t\tstyle={ spacingProps.style }\n\t\t\t\t>\n\t\t\t\t\t{ showIcon && iconPosition === 'left' && (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle-icon\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t+\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t<RichText.Content\n\t\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle-title\"\n\t\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\tletterSpacing: typographyProps.style.letterSpacing,\n\t\t\t\t\t\t\ttextDecoration:\n\t\t\t\t\t\t\t\ttypographyProps.style.textDecoration,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ showIcon && iconPosition === 'right' && (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle-icon\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t+\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</button>\n\t\t\t</TagName>\n\t\t);\n\t},\n};\n\nconst v3 = {\n\tattributes: {\n\t\topenByDefault: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\ttitle: {\n\t\t\ttype: 'rich-text',\n\t\t\tsource: 'rich-text',\n\t\t\tselector: '.wp-block-accordion-heading__toggle-title',\n\t\t\trole: 'content',\n\t\t},\n\t\tlevel: {\n\t\t\ttype: 'number',\n\t\t},\n\t\ticonPosition: {\n\t\t\ttype: 'string',\n\t\t\tenum: [ 'left', 'right' ],\n\t\t\tdefault: 'right',\n\t\t},\n\t\tshowIcon: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\tcolor: {\n\t\t\tbackground: true,\n\t\t\tgradients: true,\n\t\t},\n\t\talign: false,\n\t\tinteractivity: true,\n\t\tspacing: {\n\t\t\tpadding: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tpadding: true,\n\t\t\t},\n\t\t\t__experimentalSkipSerialization: true,\n\t\t\t__experimentalSelector: '.wp-block-accordion-heading__toggle',\n\t\t},\n\t\t__experimentalBorder: {\n\t\t\tcolor: true,\n\t\t\tradius: true,\n\t\t\tstyle: true,\n\t\t\twidth: true,\n\t\t\t__experimentalDefaultControls: {\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},\n\t\t},\n\t\ttypography: {\n\t\t\t__experimentalSkipSerialization: [\n\t\t\t\t'textDecoration',\n\t\t\t\t'letterSpacing',\n\t\t\t],\n\t\t\tfontSize: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalTextDecoration: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t\tfontFamily: true,\n\t\t\t},\n\t\t},\n\t\tshadow: true,\n\t\tvisibility: false,\n\t\tlock: false,\n\t},\n\tsave( { attributes } ) {\n\t\tconst { level, title, iconPosition, showIcon } = attributes;\n\t\tconst TagName = 'h' + ( level || 3 );\n\t\tconst typographyProps = getTypographyClassesAndStyles( attributes );\n\n\t\tconst blockProps = useBlockProps.save();\n\t\tconst spacingProps = getSpacingClassesAndStyles( attributes );\n\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle\"\n\t\t\t\t\tstyle={ spacingProps.style }\n\t\t\t\t>\n\t\t\t\t\t{ showIcon && iconPosition === 'left' && (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle-icon\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t+\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t<RichText.Content\n\t\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle-title\"\n\t\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\tletterSpacing: typographyProps.style.letterSpacing,\n\t\t\t\t\t\t\ttextDecoration:\n\t\t\t\t\t\t\t\ttypographyProps.style.textDecoration,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ showIcon && iconPosition === 'right' && (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"wp-block-accordion-heading__toggle-icon\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t+\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</button>\n\t\t\t</TagName>\n\t\t);\n\t},\n};\n\nexport default [ v3, v2, v1 ];\n"],"mappings":";;;;;;;AAqWA,IAAA,qBAAe;CAAE;EAxHhB,YAAY;GACX,eAAe;IACd,MAAM;IACN,SAAS;GACV;GACA,OAAO;IACN,MAAM;IACN,QAAQ;IACR,UAAU;IACV,MAAM;GACP;GACA,OAAO,EACN,MAAM,SACP;GACA,cAAc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