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/index.tsx +12 -3 1.11.01.13.0 View file →
@@ -2,14 +2,14 @@
2 2 import { createBlock, registerBlockType } from '@wordpress/blocks';
3 3 import { addFilter } from '@wordpress/hooks';
4 4 import { __ } from '@wordpress/i18n';
5 5 import classnames from 'classnames';
6 -import { Lang } from 'shiki';
7 6 import blockConfig from './block.json';
8 7 import { Edit } from './editor/Edit';
9 8 import { BlockFilter } from './editor/components/BlockFilter';
10 9 import { FooterType } from './editor/components/FooterSelect';
11 10 import { HeaderType } from './editor/components/HeaderSelect';
11 +import { SeeMoreType } from './editor/components/SeeMoreSelect';
12 12 import { SidebarControls } from './editor/controls/Sidebar';
13 13 import { ToolbarControls } from './editor/controls/Toolbar';
14 14 import './editor/editor.css';
15 15 import { BlockOutput } from './front/BlockOutput';
@@ -14,9 +14,9 @@
14 14 import './editor/editor.css';
15 15 import { BlockOutput } from './front/BlockOutput';
16 16 import { CopyButton } from './front/CopyButton';
17 17 import { blockIcon } from './icons';
18 -import { Attributes } from './types';
18 +import { Attributes, Lang } from './types';
19 19 import { fontFamilyLong, maybeClamp } from './util/fonts';
20 20 import { getMainAlias } from './util/languages';
21 21
22 22 registerBlockType<Attributes>(blockConfig.name, {
@@ -34,8 +34,9 @@
34 34 fontSize: { type: 'string' },
35 35 fontFamily: { type: 'string' },
36 36 lineHeight: { type: 'string' },
37 37 clampFonts: { type: 'boolean' },
38 + editorHeight: { type: 'string' },
38 39 lineNumbers: { type: 'boolean' },
39 40 headerType: { type: 'string' },
40 41 headerString: { type: 'string' },
41 42 disablePadding: { type: 'boolean' },
@@ -42,8 +43,13 @@
42 43 footerType: { type: 'string' },
43 44 footerString: { type: 'string' },
44 45 footerLink: { type: 'string' },
45 46 footerLinkTarget: { type: 'boolean' },
47 + enableMaxHeight: { type: 'boolean' },
48 + seeMoreType: { type: 'string' },
49 + seeMoreString: { type: 'string' },
50 + seeMoreAfterLine: { type: 'string' },
51 + seeMoreTransition: { type: 'boolean' },
46 52 startingLineNumber: { type: 'string' },
47 53 lineNumbersWidth: { type: 'number' },
48 54 enableHighlighting: { type: 'boolean' },
49 55 lineHighlights: { type: 'string' },
@@ -102,9 +108,11 @@
102 108 attributes?.enableHighlighting
103 109 ? attributes.lineHighlightColor
104 110 : undefined,
105 111 '--cbp-line-height': attributes.lineHeight,
106 - fontFamily: fontFamilyLong(attributes.fontFamily),
112 + // Disabled as ligatures will break the editor line widths
113 + // fontFamily: fontFamilyLong(attributes.fontFamily),
114 + fontFamily: fontFamilyLong(''),
107 115 lineHeight: maybeClamp(
108 116 attributes.lineHeight,
109 117 attributes.clampFonts,
110 118 ),
@@ -115,8 +123,9 @@
115 123 <CopyButton attributes={attributes} />
116 124 )}
117 125 <Edit attributes={attributes} setAttributes={setAttributes} />
118 126 <FooterType {...attributes} />
127 + <SeeMoreType {...attributes} />
119 128 </div>
120 129 </>
121 130 ),
122 131 save: ({ attributes }) => <BlockOutput attributes={attributes} />,