PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 0.0.3
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v0.0.3
2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 0.0.2 0.0.3 All 96 releases
sureforms / modules / gutenberg / src / blocks.js
blocks.js
75 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Gutenberg Blocks
3 *
4 * All blocks related JavaScript files should be imported here.
5 * You can create a new block folder in this dir and include code
6 * for that block here as well.
7 *
8 * All blocks should be included here since this is the file that
9 * Webpack is compiling as the input file.
10 */
11
12 import getUAGEditorStateLocalStorage from '@Controls/getUAGEditorStateLocalStorage';
13
14 // Delete the local storage on every refresh.
15 const uagLocalStorage = getUAGEditorStateLocalStorage();
16 if ( uagLocalStorage ) {
17 uagLocalStorage.removeItem( 'uagSettingState' );
18 uagLocalStorage.removeItem( 'isSpectraFontAwesomeAPILoading' );
19 }
20
21 import fontAwesomePollyfiller from './font-awesome-pollyfiller';
22
23 __webpack_public_path__ = srfm_spec_blocks_info.uagb_url + 'dist/';
24
25 // Merge all icon chunks.
26 srfm_spec_blocks_info.uagb_svg_icons = {};
27 if ( srfm_spec_blocks_info?.number_of_icon_chunks ) {
28 for (
29 let iconChunk = 0;
30 iconChunk < srfm_spec_blocks_info.number_of_icon_chunks;
31 iconChunk++
32 ) {
33 srfm_spec_blocks_info.uagb_svg_icons = {
34 ...srfm_spec_blocks_info.uagb_svg_icons,
35 ...window[ 'uagb_svg_icons_' + iconChunk ],
36 };
37 }
38 }
39
40 // Add Font Awesome Polyfiller to localized variable.
41 srfm_spec_blocks_info.font_awesome_5_polyfill = fontAwesomePollyfiller;
42
43 // Setting local storage key for svg Confirmation data.
44 uagLocalStorage.setItem(
45 'uagSvgConfirmation',
46 JSON.stringify( srfm_spec_blocks_info?.svg_confirmation || false )
47 );
48
49 import './editor.scss';
50 import './blocks/separator/block.js';
51 import './blocks/advanced-heading/block.js';
52 import './blocks/image/block.js';
53 import './blocks/icon/block.js';
54
55 // Keep category list in separate variable and remove category list from icons list.
56 if ( srfm_spec_blocks_info.uagb_svg_icons?.uagb_category_list ) {
57 wp.uagb_icon_category_list = [
58 ...srfm_spec_blocks_info.uagb_svg_icons.uagb_category_list,
59 ];
60 delete srfm_spec_blocks_info.uagb_svg_icons.uagb_category_list;
61 }
62
63 wp.UAGBSvgIcons = Object.keys( srfm_spec_blocks_info.uagb_svg_icons );
64
65 const addCfResponsiveCondtionBlocks = function ( blocks ) {
66 blocks.push( 'wcfb/' );
67 return blocks;
68 };
69
70 wp.hooks.addFilter(
71 'uag_reponsive_conditions_compatible_blocks',
72 'enable_reponsive_condition_for_cf_blocks',
73 addCfResponsiveCondtionBlocks
74 );
75