PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.1.0
Code Block Pro – Beautiful Syntax Highlighting v1.1.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
code-block-pro / src / front / CopyButton.tsx

CopyButton.tsx in Code Block Pro – Beautiful Syntax Highlighting 1.1.0, at src/front/CopyButton.tsx

35 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2 import { Attributes } from '../types';
3
4 export const CopyButton = ({ attributes }: { attributes: Attributes }) => (
5 <span
6 // Using a span to prevent aggressive button styling from themes
7 role="button"
8 tabIndex={0}
9 data-code={attributes.code}
10 style={{ color: attributes?.textColor ?? 'inherit', display: 'none' }}
11 aria-label={__('Copy', 'code-block-pro')}
12 className="code-block-pro-copy-button">
13 <svg
14 xmlns="http://www.w3.org/2000/svg"
15 style={{ width: 24, height: 24 }}
16 fill="none"
17 viewBox="0 0 24 24"
18 stroke="currentColor"
19 strokeWidth="2">
20 <path
21 className="with-check"
22 strokeLinecap="round"
23 strokeLinejoin="round"
24 d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"
25 />
26 <path
27 className="without-check"
28 strokeLinecap="round"
29 strokeLinejoin="round"
30 d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"
31 />
32 </svg>
33 </span>
34 );
35