|
| 1 | +import lazySizes from 'lazysizes' |
| 2 | +import 'lazysizes/plugins/native-loading/ls.native-loading' |
| 3 | +import 'lazysizes/plugins/object-fit/ls.object-fit' |
| 4 | + |
| 5 | +/** |
| 6 | + * LazySizes configuration |
| 7 | + * https://github.com/aFarkas/lazysizes/#js-api---options |
| 8 | + */ |
| 9 | +lazySizes.cfg.nativeLoading = { |
| 10 | + setLoadingAttribute: false, |
| 11 | +} |
| 12 | + |
| 13 | +// Native Gutenberg |
| 14 | +if (typeof wp !== 'undefined') { |
| 15 | + wp.domReady(() => { |
| 16 | + // Disable block styles |
| 17 | + |
| 18 | + // block image |
| 19 | + // wp.blocks.unregisterBlockStyle('core/image', 'rounded') |
| 20 | + // wp.blocks.unregisterBlockStyle('core/image', 'default') |
| 21 | + |
| 22 | + // block quote |
| 23 | + // wp.blocks.unregisterBlockStyle('core/quote', 'default') |
| 24 | + // wp.blocks.unregisterBlockStyle('core/quote', 'large') |
| 25 | + |
| 26 | + // block pullquote |
| 27 | + // wp.blocks.unregisterBlockStyle('core/pullquote', 'default') |
| 28 | + // wp.blocks.unregisterBlockStyle('core/pullquote', 'solid-color') |
| 29 | + |
| 30 | + // block separator |
| 31 | + // wp.blocks.unregisterBlockStyle('core/separator', 'default') |
| 32 | + // wp.blocks.unregisterBlockStyle('core/separator', 'wide') |
| 33 | + // wp.blocks.unregisterBlockStyle('core/separator', 'dots') |
| 34 | + |
| 35 | + // block table |
| 36 | + // wp.blocks.unregisterBlockStyle('core/table', 'regular') |
| 37 | + // wp.blocks.unregisterBlockStyle('core/table', 'stripes') |
| 38 | + |
| 39 | + // Disable core embed blocks |
| 40 | + |
| 41 | + var embedVariations = [ |
| 42 | + 'amazon-kindle', |
| 43 | + 'animoto', |
| 44 | + 'cloudup', |
| 45 | + 'collegehumor', |
| 46 | + 'crowdsignal', |
| 47 | + 'dailymotion', |
| 48 | + 'facebook', |
| 49 | + 'flickr', |
| 50 | + 'imgur', |
| 51 | + 'instagram', |
| 52 | + 'issuu', |
| 53 | + 'kickstarter', |
| 54 | + 'meetup-com', |
| 55 | + 'mixcloud', |
| 56 | + 'reddit', |
| 57 | + 'reverbnation', |
| 58 | + 'screencast', |
| 59 | + 'scribd', |
| 60 | + 'slideshare', |
| 61 | + 'smugmug', |
| 62 | + 'soundcloud', |
| 63 | + 'speaker-deck', |
| 64 | + 'spotify', |
| 65 | + 'ted', |
| 66 | + 'tiktok', |
| 67 | + 'tumblr', |
| 68 | + 'twitter', |
| 69 | + 'videopress', |
| 70 | + 'vimeo', |
| 71 | + 'wordpress', |
| 72 | + 'wordpress-tv', |
| 73 | + // 'youtube' |
| 74 | + ] |
| 75 | + |
| 76 | + for (var i = embedVariations.length - 1; i >= 0; i--) { |
| 77 | + wp.blocks.unregisterBlockVariation('core/embed', embedVariations[i]) |
| 78 | + } |
| 79 | + }) |
| 80 | +} |
| 81 | + |
| 82 | +// ACF Blocks |
| 83 | +if (window.acf) { |
| 84 | + // Do stuff |
| 85 | +} |
0 commit comments