| @@ -1,8 +1,9 @@ | ||
| 1 | 1 | import { RichText, useBlockProps as blockProps } from '@wordpress/block-editor'; |
| 2 | 2 | import classNames from 'classnames'; |
| 3 | -import { colord, AnyColor } from 'colord'; | |
| 3 | +import { FooterType } from '../editor/components/FooterSelect'; | |
| 4 | 4 | import { HeaderType } from '../editor/components/HeaderSelect'; |
| 5 | +import { SeeMoreType } from '../editor/components/SeeMoreSelect'; | |
| 5 | 6 | import { Attributes } from '../types'; |
| 6 | 7 | import { fontFamilyLong, maybeClamp } from '../util/fonts'; |
| 7 | 8 | import { CopyButton } from './CopyButton'; |
| 8 | 9 | import './style.css'; |
| @@ -11,9 +12,13 @@ | ||
| 11 | 12 | <div |
| 12 | 13 | {...blockProps.save({ |
| 13 | 14 | className: classNames({ |
| 14 | 15 | 'padding-disabled': attributes.disablePadding, |
| 16 | + 'padding-bottom-disabled': | |
| 17 | + attributes?.footerType && attributes?.footerType !== 'none', | |
| 15 | 18 | 'cbp-has-line-numbers': attributes.lineNumbers, |
| 19 | + 'cbp-blur-enabled': attributes.enableBlurring, | |
| 20 | + 'cbp-unblur-on-hover': attributes.removeBlurOnHover, | |
| 16 | 21 | }), |
| 17 | 22 | })} |
| 18 | 23 | data-code-block-pro-font-family={attributes.fontFamily} |
| 19 | 24 | style={ |
| @@ -33,8 +38,11 @@ | ||
| 33 | 38 | : undefined, |
| 34 | 39 | '--cbp-line-number-width': attributes.lineNumbersWidth |
| 35 | 40 | ? `${attributes.lineNumbersWidth}px` |
| 36 | 41 | : undefined, |
| 42 | + '--cbp-line-highlight-color': attributes?.enableHighlighting | |
| 43 | + ? attributes.lineHighlightColor | |
| 44 | + : undefined, | |
| 37 | 45 | lineHeight: maybeClamp( |
| 38 | 46 | attributes.lineHeight, |
| 39 | 47 | attributes.clampFonts, |
| 40 | 48 | ), |
| @@ -46,8 +54,10 @@ | ||
| 46 | 54 | {attributes.copyButton && ( |
| 47 | 55 | <CopyButton attributes={attributes} /> |
| 48 | 56 | )} |
| 49 | 57 | <RichText.Content value={attributes.codeHTML} /> |
| 58 | + <FooterType {...attributes} /> | |
| 59 | + <SeeMoreType {...attributes} /> | |
| 50 | 60 | </> |
| 51 | 61 | ) : null} |
| 52 | 62 | </div> |
| 53 | 63 | ); |