PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.13.0
Code Block Pro – Beautiful Syntax Highlighting v1.13.0
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
← All changes | src/editor/components/footers/SimpleStringStart.tsx +14 -19 1.27.11.13.0 View file →
@@ -1,25 +1,20 @@
1 1 import { colord, AnyColor } from 'colord';
2 2 import { Attributes, Lang } from '../../../types';
3 -import { findBackgroundColor, findTextColor } from '../../../util/colors';
4 3 import { languages } from '../../../util/languages';
5 4
6 -export const SimpleStringStart = (attributes: Attributes) => {
7 - const {
8 - language,
9 - bgColor,
10 - textColor,
11 - footerString,
12 - footerLink,
13 - footerLinkTarget,
14 - disablePadding,
15 - } = attributes;
5 +export const SimpleStringStart = ({
6 + language,
7 + bgColor,
8 + textColor,
9 + footerString,
10 + footerLink,
11 + footerLinkTarget,
12 + disablePadding,
13 +}: Partial<Attributes>) => {
14 + const bgC = colord(bgColor as AnyColor);
16 15 const textC = colord(textColor as AnyColor);
17 - const text = textColor?.startsWith('var(')
18 - ? findTextColor(attributes) ?? textColor
19 - : textC.isDark()
20 - ? textC.lighten(0.05).toHex()
21 - : textC.darken(0.05).toHex();
16 + const text = textC.isDark() ? textC.lighten(0.05) : textC.darken(0.05);
22 17 return (
23 18 <span
24 19 style={{
25 20 display: 'flex',
@@ -26,10 +21,10 @@
26 21 alignItems: 'flex-end',
27 22 padding: disablePadding ? '10px 0 0 0' : '10px',
28 23 width: '100%',
29 24 justifyContent: 'flex-start',
30 - backgroundColor: findBackgroundColor(attributes) ?? bgColor,
31 - color: text,
25 + backgroundColor: bgC.toHex(),
26 + color: text.toHex(),
32 27 fontSize: '12px',
33 28 lineHeight: '1',
34 29 position: 'relative',
35 30 }}>
@@ -34,9 +29,9 @@
34 29 position: 'relative',
35 30 }}>
36 31 <Inner
37 32 text={footerString || languages[language as Lang]}
38 - color={text}
33 + color={text.toHex()}
39 34 link={footerLink}
40 35 linkTarget={footerLinkTarget}
41 36 />
42 37 </span>