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

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