import { useBlockProps as blockProps } from '@wordpress/block-editor';
import { applyFilters } from '@wordpress/hooks';
import classnames from 'classnames';
import defaultThemes from './defaultThemes.json';
import { Edit } from './editor/Edit';
import { FooterType } from './editor/components/FooterSelect';
import { HeaderType } from './editor/components/HeaderSelect';
import { SeeMoreType } from './editor/components/SeeMoreSelect';
import { ButtonList } from './editor/components/buttons/ButtonList';
import { SidebarControls } from './editor/controls/Sidebar';
import { ToolbarControls } from './editor/controls/Toolbar';
import { AttributesPropsAndSetter } from './types';
import { ThemeOption } from './types';
import { findLineNumberColor } from './util/colors';
import { fontFamilyLong, maybeClamp } from './util/fonts';
export const Editor = ({
attributes,
setAttributes,
}: AttributesPropsAndSetter) => {
const {
clampFonts,
disablePadding,
enableBlurring,
enableHighlighting,
footerType,
fontSize,
fontFamily,
highestLineNumber,
highlightingHover,
lineHeight,
lineHighlightColor,
lineNumbers,
lineNumbersWidth,
removeBlurOnHover,
startingLineNumber,
tabSize,
theme,
useTabs,
} = attributes;
// To add custom styles
const themes = applyFilters(
'blocks.codeBlockPro.themes',
defaultThemes,
) as ThemeOption;
const styles = themes[theme]?.styles;
return (
<>