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 / form / fields / hidden / edit.js

edit.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.4.1, at gutenberg/blocks/form/fields/hidden/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 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 __next40pxDefaultSize
40 __nextHasNoMarginBottom
41 />
42 </PanelBody>
43 </InspectorControls>
44 <div {...blockProps}>
45 <FieldLabel {...props} />
46 <TextControl
47 type="text"
48 __next40pxDefaultSize
49 __nextHasNoMarginBottom
50 {...getFieldAttributes(attributes)}
51 />
52 </div>
53 </>
54 );
55 }
56