@wordpress/global-styles-ui
Version:
Global Styles UI components for WordPress.
1 lines • 2.73 kB
Source Map (JSON)
{"version":3,"file":"screen-css.cjs","names":["unlock","blockEditorPrivateApis","useStyle","ScreenHeader","__","ExternalLink"],"sources":["../src/screen-css.tsx"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { ExternalLink } from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { ScreenHeader } from './screen-header';\nimport { useStyle } from './hooks';\nimport { unlock } from './lock-unlock';\n\n// Access AdvancedPanel from block-editor private APIs\nconst { AdvancedPanel: StylesAdvancedPanel } = unlock( blockEditorPrivateApis );\n\nfunction ScreenCSS() {\n\t// User-only styles (should not decode/encode to preserve raw CSS).\n\tconst [ style, setStyle ] = useStyle( '', undefined, 'user', false );\n\t// Merged (theme.json + user) styles, previewed when there's no local override.\n\tconst [ inheritedStyle ] = useStyle( '', undefined, 'merged', false );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Additional CSS' ) }\n\t\t\t\tdescription={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'You can add custom CSS to further customize the appearance and layout of your site.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t'https://developer.wordpress.org/advanced-administration/wordpress/css/'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tclassName=\"global-styles-ui-screen-css-help-link\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Learn more about CSS' ) }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<div className=\"global-styles-ui-screen-css\">\n\t\t\t\t<StylesAdvancedPanel\n\t\t\t\t\tvalue={ style }\n\t\t\t\t\tonChange={ setStyle }\n\t\t\t\t\tinheritedValue={ inheritedStyle }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenCSS;\n"],"mappings":";;;;;;;;;;;;;AAQA,MAAM,EAAE,eAAe,yBAAA,GAAwBA,iBAAAA,OAAAA,CAAQC,wBAAAA,WAAuB;AAE9E,SAAS,YAAY;CAEpB,MAAM,CAAE,OAAO,aAAA,GAAaC,WAAAA,SAAAA,CAAU,IAAI,KAAA,GAAW,QAAQ,KAAM;CAEnE,MAAM,CAAE,mBAAA,GAAmBA,WAAAA,SAAAA,CAAU,IAAI,KAAA,GAAW,UAAU,KAAM;CAEpE,OACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA,CACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,cAAD;EACC,QAAA,GAAQC,gBAAAA,GAAAA,CAAI,gBAAiB;EAC7B,aACC,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA;IACGA,GAAAA,gBAAAA,GAAAA,CACD,qFACD;GACA,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD,CAAK,CAAA;GACL,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,cAAD;IACC,OAAA,GAAOD,gBAAAA,GAAAA,CACN,wEACD;IACA,WAAU;IAERA,WAAAA,GAAAA,gBAAAA,GAAAA,CAAI,sBAAuB;GAChB,CAAA;EACb,EAAA,CAAA;CAEH,CAAA,GACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAD;GACC,OAAQ;GACR,UAAW;GACX,gBAAiB;EACjB,CAAA;CACG,CAAA,CACJ,EAAA,CAAA;AAEJ"}