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/FontSelect.tsx +28 -1 1.3.01.13.0 View file →
@@ -1,5 +1,6 @@
1 -import { FontSizePicker } from '@wordpress/components';
1 +import { SelectControl, FontSizePicker } from '@wordpress/components';
2 +import { __ } from '@wordpress/i18n';
2 3
3 4 // This file ignores types as they are outdated from the source
4 5
5 6 export const FontSizeSelect = ({
@@ -99,7 +100,33 @@
99 100 size: '1.625rem',
100 101 slug: 'relaxed',
101 102 },
102 103 ]}
104 + />
105 + );
106 +};
107 +export const FontFamilySelect = ({
108 + value,
109 + onChange,
110 +}: {
111 + value: string;
112 + onChange: (v: string) => void;
113 +}) => {
114 + const fonts = {
115 + '': __('System Default', 'code-block-pro'),
116 + 'Code-Pro-JetBrains-Mono': 'JetBrains Mono',
117 + 'Code-Pro-Fira-Code': 'Fira Code',
118 + };
119 + return (
120 + <SelectControl
121 + id="code-block-pro-font-family"
122 + label={__('Font Family', 'code-block-pro')}
123 + help={__('Fonts only render on the frontend.', 'code-block-pro')}
124 + value={value}
125 + onChange={onChange}
126 + options={Object.entries(fonts).map(([value, label]) => ({
127 + label,
128 + value,
129 + }))}
103 130 />
104 131 );
105 132 };