1- /* global BFFEditorSettings */
1+ /* global BEAPI_EDITOR_SETTINGS */
22
3- /* Customize BFFEditorSettings in inc/Services/Editor.php or with `bff_editor_custom_settings` filter (see readme). */
3+ /* Customize BEAPI_EDITOR_SETTINGS in inc/Services/Editor.php or with `bff_editor_custom_settings` filter (see readme). */
44import domReady from '@wordpress/dom-ready' ;
55import { subscribe } from '@wordpress/data' ;
66import { addFilter } from '@wordpress/hooks' ;
@@ -13,11 +13,11 @@ import {
1313import './utils/beapi' ;
1414
1515const unregisterDisabledBlockStyles = ( ) => {
16- if ( ! BFFEditorSettings . disabledBlocksStyles ) {
16+ if ( ! BEAPI_EDITOR_SETTINGS . disabledBlocksStyles ) {
1717 return ;
1818 }
1919
20- Object . entries ( BFFEditorSettings . disabledBlocksStyles ) . forEach (
20+ Object . entries ( BEAPI_EDITOR_SETTINGS . disabledBlocksStyles ) . forEach (
2121 ( [ blockName , styles ] ) => {
2222 [ ] . concat ( styles ) . forEach ( ( styleName ) => {
2323 unregisterBlockStyle ( blockName , styleName ) ;
@@ -27,11 +27,11 @@ const unregisterDisabledBlockStyles = () => {
2727} ;
2828
2929const unregisterDisallowedBlockVariations = ( ) => {
30- if ( ! BFFEditorSettings . allowedBlocksVariations ) {
30+ if ( ! BEAPI_EDITOR_SETTINGS . allowedBlocksVariations ) {
3131 return ;
3232 }
3333
34- Object . entries ( BFFEditorSettings . allowedBlocksVariations ) . forEach (
34+ Object . entries ( BEAPI_EDITOR_SETTINGS . allowedBlocksVariations ) . forEach (
3535 ( [ blockName , allowedVariationNames ] ) => {
3636 const blockVariations = getBlockVariations ( blockName ) || [ ] ;
3737
@@ -67,9 +67,9 @@ const whenBlocksRegistered = (blockNames, callback) => {
6767domReady ( ( ) => {
6868 unregisterDisabledBlockStyles ( ) ;
6969
70- if ( BFFEditorSettings . allowedBlocksVariations ) {
70+ if ( BEAPI_EDITOR_SETTINGS . allowedBlocksVariations ) {
7171 const blockNames = Object . keys (
72- BFFEditorSettings . allowedBlocksVariations
72+ BEAPI_EDITOR_SETTINGS . allowedBlocksVariations
7373 ) ;
7474
7575 whenBlocksRegistered ( blockNames , unregisterDisallowedBlockVariations ) ;
@@ -87,8 +87,8 @@ addFilter(
8787 function ( settings , name ) {
8888 // Disable all styles
8989 if (
90- BFFEditorSettings . disableAllBlocksStyles &&
91- BFFEditorSettings . disableAllBlocksStyles . includes ( name )
90+ BEAPI_EDITOR_SETTINGS . disableAllBlocksStyles &&
91+ BEAPI_EDITOR_SETTINGS . disableAllBlocksStyles . includes ( name )
9292 ) {
9393 settings . styles = [ ] ;
9494 }
0 commit comments