PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.7.0
Block Animations, Motion & Scroll Effects – Ghost Kit v3.7.0
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / formats / uppercase / index.js

index.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.7.0, at gutenberg/formats/uppercase/index.js

46 lines 952 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {
2 RichTextShortcut,
3 RichTextToolbarButton,
4 } from '@wordpress/block-editor';
5 import { __ } from '@wordpress/i18n';
6 import { toggleFormat } from '@wordpress/rich-text';
7
8 import getIcon from '../../utils/get-icon';
9
10 export const name = 'ghostkit/uppercase';
11
12 export const settings = {
13 title: __('Uppercase', 'ghostkit'),
14 tagName: 'span',
15 className: 'ghostkit-text-uppercase',
16 edit: function BadgeFormat(props) {
17 const { value, onChange, isActive } = props;
18
19 function toggleUppercase() {
20 onChange(
21 toggleFormat(value, {
22 type: name,
23 })
24 );
25 }
26
27 return (
28 <>
29 <RichTextShortcut
30 type="access"
31 character="u"
32 onUse={() => toggleUppercase()}
33 />
34 <RichTextToolbarButton
35 shortcutCharacter="u"
36 shortcutType="access"
37 title={__('Uppercase', 'ghostkit')}
38 icon={getIcon('icon-text-uppercase')}
39 onClick={() => toggleUppercase()}
40 isActive={isActive}
41 />
42 </>
43 );
44 },
45 };
46