import { InspectorControls } from '@wordpress/block-editor'; import { PanelBody, BaseControl, SelectControl, CheckboxControl, } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { Theme } from 'shiki'; import { useLanguage } from '../../hooks/useLanguage'; import { useGlobalStore } from '../../state/global'; import { useThemeStore } from '../../state/theme'; import { AttributesPropsAndSetter } from '../../types'; import { languages } from '../../util/languages'; import { FontSizeSelect, FontLineHeightSelect } from '../components/FontSelect'; import { Notice } from '../components/Notice'; import { ThemeSelect } from '../components/ThemeSelect'; export const SidebarControls = ({ attributes, setAttributes, }: AttributesPropsAndSetter) => { const [language, setLanguage] = useLanguage({ attributes, setAttributes }); const { updateThemeHistory } = useThemeStore(); const { setPreviousSettings } = useGlobalStore(); return (
({ label, value, }), )} />

{__('Font Size', 'code-block-pro')}

{ setAttributes({ fontSize }); updateThemeHistory({ ...attributes, fontSize }); }} />

{__('Line Height', 'code-block-pro')}

{ setAttributes({ lineHeight }); updateThemeHistory({ ...attributes, lineHeight, }); }} />
{ setAttributes({ theme: slug }); updateThemeHistory({ ...attributes, theme: slug }); }} /> { setPreviousSettings({ copyButton: value }); setAttributes({ copyButton: value }); }} />
); };