UNPKG

@wordpress/global-styles-ui

Version:
1 lines • 2.35 kB
{"version":3,"file":"screen-css.mjs","names":["blockEditorPrivateApis"],"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,wBAAwB,OAAQA,WAAuB;AAE9E,SAAS,YAAY;CAEpB,MAAM,CAAE,OAAO,YAAa,SAAU,IAAI,KAAA,GAAW,QAAQ,KAAM;CAEnE,MAAM,CAAE,kBAAmB,SAAU,IAAI,KAAA,GAAW,UAAU,KAAM;CAEpE,OACC,qBAAA,UAAA,EAAA,UAAA,CACC,oBAAC,cAAD;EACC,OAAQ,GAAI,gBAAiB;EAC7B,aACC,qBAAA,UAAA,EAAA,UAAA;GACG,GACD,qFACD;GACA,oBAAC,MAAD,CAAK,CAAA;GACL,oBAAC,cAAD;IACC,MAAO,GACN,wEACD;IACA,WAAU;IAER,UAAA,GAAI,sBAAuB;GAChB,CAAA;EACb,EAAA,CAAA;CAEH,CAAA,GACD,oBAAC,OAAD;EAAK,WAAU;EACd,UAAA,oBAAC,qBAAD;GACC,OAAQ;GACR,UAAW;GACX,gBAAiB;EACjB,CAAA;CACG,CAAA,CACJ,EAAA,CAAA;AAEJ"}