PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.1
JetFormBuilder — Dynamic Blocks Form Builder v3.1.1
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 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / assets / src / package / hooks / withSelectFormFields.js
jetformbuilder / assets / src / package / hooks Last commit date
useIsHasAttribute.js 2 years ago useMetaState.js 2 years ago useRepeaterState.js 2 years ago useSelectPostMeta.js 2 years ago useStateLoadingClasses.js 2 years ago useStateValidClasses.js 2 years ago useSuccessNotice.js 2 years ago withSelectFormFields.js 2 years ago
withSelectFormFields.js
57 lines
1 const { applyFilters } = wp.hooks;
2
3 const getFormFields = ( blockParserFunc, blocks ) => {
4 blocks.map( block => {
5 blockParserFunc( block );
6
7 if ( block.innerBlocks.length ) {
8 getFormFields( blockParserFunc, block.innerBlocks );
9 }
10 } );
11 };
12
13 const withSelectFormFields = (
14 exclude = [],
15 placeholder = false,
16 suppressFilter = false,
17 ) => select => {
18
19 let formFields = [];
20 let skipFields = [
21 'submit',
22 'form-break',
23 'heading',
24 'group-break',
25 'conditional',
26 ...exclude,
27 ];
28
29 getFormFields( block => {
30 if ( block.name.includes( 'jet-forms/' )
31 && block.attributes.name
32 && !skipFields.find( field => block.name.includes( field ) )
33 ) {
34
35 /*const blockType = select( blocksStore ).getBlockType( block.name );*/
36
37 formFields.push( {
38 blockName: block.name,
39 name: block.attributes.name,
40 label: block.attributes.label || block.attributes.name,
41 value: block.attributes.name,
42 //icon: blockType.icon.src,
43 } );
44 }
45 }, select( 'core/block-editor' ).getBlocks() );
46
47 formFields = placeholder
48 ? [ { value: '', label: placeholder }, ...formFields ]
49 : formFields;
50
51 return {
52 formFields: suppressFilter ? formFields : applyFilters(
53 'jet.fb.getFormFieldsBlocks', formFields ),
54 };
55 };
56
57 export default withSelectFormFields;