PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.3
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.3
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 / form / fields / hidden / edit.js

edit.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.3, at gutenberg/blocks/form/fields/hidden/edit.js

49 lines 1.2 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 { InspectorControls, useBlockProps } from '@wordpress/block-editor';
4 import { PanelBody, TextControl } from '@wordpress/components';
5 import { applyFilters } from '@wordpress/hooks';
6 import { __ } from '@wordpress/i18n';
7
8 import { getFieldAttributes } from '../../field-attributes';
9 import FieldLabel from '../../field-label';
10
11 /**
12 * Block Edit Class.
13 *
14 * @param props
15 */
16 export default function BlockEdit(props) {
17 const { attributes, setAttributes } = props;
18
19 const { default: defaultVal } = props;
20
21 let { className = '' } = props;
22
23 className = classnames(
24 'ghostkit-form-field ghostkit-form-field-hidden',
25 className
26 );
27 className = applyFilters('ghostkit.editor.className', className, props);
28
29 const blockProps = useBlockProps({ className });
30
31 return (
32 <>
33 <InspectorControls>
34 <PanelBody>
35 <TextControl
36 label={__('Value', 'ghostkit')}
37 value={defaultVal}
38 onChange={(val) => setAttributes({ default: val })}
39 />
40 </PanelBody>
41 </InspectorControls>
42 <div {...blockProps}>
43 <FieldLabel {...props} />
44 <TextControl type="text" {...getFieldAttributes(attributes)} />
45 </div>
46 </>
47 );
48 }
49