PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.4.1
Block Animations, Motion & Scroll Effects – Ghost Kit v3.4.1
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 / blocks / icon / edit.js

edit.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.4.1, at gutenberg/blocks/icon/edit.js

57 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import classnames from 'classnames/dedupe';
2
3 import { useBlockProps } from '@wordpress/block-editor';
4 import { applyFilters } from '@wordpress/hooks';
5
6 import IconPicker from '../../components/icon-picker';
7 import EditBlockControls from './edit/block-controls';
8 import ColorControls from './edit/color-controls';
9 import EditInspectorControls from './edit/inspector-controls';
10
11 export default function BlockEdit(props) {
12 const { attributes, setAttributes, isSelected, clientId } = props;
13 const { flipV, flipH } = attributes;
14
15 let { className = '' } = props;
16
17 className = classnames(
18 'ghostkit-icon',
19 {
20 'ghostkit-icon-flip-vertical': flipV,
21 'ghostkit-icon-flip-horizontal': flipH,
22 },
23 className
24 );
25
26 className = applyFilters('ghostkit.editor.className', className, props);
27
28 const blockProps = useBlockProps({ className });
29
30 return (
31 <>
32 <EditInspectorControls
33 attributes={attributes}
34 setAttributes={setAttributes}
35 />
36 <ColorControls
37 attributes={attributes}
38 setAttributes={setAttributes}
39 clientId={clientId}
40 />
41 <EditBlockControls
42 attributes={attributes}
43 setAttributes={setAttributes}
44 isSelected={isSelected}
45 />
46
47 <span {...blockProps}>
48 <IconPicker.Preview
49 tag="div"
50 name={attributes.icon}
51 className="ghostkit-icon-inner"
52 />
53 </span>
54 </>
55 );
56 }
57