import { RichText, useBlockProps as blockProps } from '@wordpress/block-editor'; import { applyFilters } from '@wordpress/hooks'; import classNames from 'classnames'; import defaultThemes from '../defaultThemes.json'; 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 { Attributes, ThemeOption } from '../types'; import { findLineNumberColor } from '../util/colors'; import { fontFamilyLong, maybeClamp } from '../util/fonts'; import './style.css'; export const BlockOutput = ({ attributes }: { attributes: Attributes }) => { const { clampFonts, code, codeHTML, disablePadding, enableBlurring, enableHighlighting, footerType, fontSize, fontFamily, highestLineNumber, highlightingHover, lineHeight, lineHighlightColor, lineNumbers, lineNumbersWidth, removeBlurOnHover, startingLineNumber, tabSize, theme, useTabs, } = attributes; const fontFamilyRatio = (fontFamily: string) => fontFamily === 'Code-Pro-Fantasque-Sans-Mono' ? 0.5 : 0.6; // To add custom styles const themes = applyFilters( 'blocks.codeBlockPro.themes', defaultThemes, ) as ThemeOption; const styles = themes[theme]?.styles; return (