PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.5
JetFormBuilder — Dynamic Blocks Form Builder v3.1.5
3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 All 130 releases
jetformbuilder / assets / src / package / blocks / components / FieldSettingsWrapper.js
FieldSettingsWrapper.js
43 lines 814 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const {
2 __,
3 } = wp.i18n;
4 const {
5 PanelBody,
6 } = wp.components;
7 const {
8 applyFilters,
9 } = wp.hooks;
10 const {
11 useBlockProps,
12 } = wp.blockEditor;
13
14 /**
15 * @param props
16 * @return {boolean|JSX.Element}
17 * @constructor
18 */
19 function FieldSettingsWrapper( props ) {
20 const {
21 title,
22 children,
23 } = props;
24
25 const blockProps = useBlockProps();
26 const blockName = blockProps[ 'data-type' ].replace( '/', '-' );
27
28 const CustomSettings = applyFilters(
29 `jet.fb.render.settings.${ blockName }`,
30 null,
31 );
32
33 return (
34 children || CustomSettings
35 ) && <PanelBody
36 title={ title || __( 'Field', 'jet-form-builder' ) }
37 >
38 { children }
39 { CustomSettings }
40 </PanelBody>;
41 }
42
43 export default FieldSettingsWrapper;