Skip to content

Commit

Permalink
Improve constant usage
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Jun 24, 2021
1 parent e34e0f5 commit 57492c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/edit-widgets/src/constants.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const ALLOW_REUSABLE_BLOCKS = false;
export const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
10 changes: 6 additions & 4 deletions packages/edit-widgets/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ import './store';
import './filters';
import * as widgetArea from './blocks/widget-area';
import Layout from './components/layout';
import { ALLOW_REUSABLE_BLOCKS } from './constants';
import {
ALLOW_REUSABLE_BLOCKS,
ENABLE_EXPERIMENTAL_FSE_BLOCKS,
} from './constants';

const DISABLED_BLOCKS = [
const disabledBlocks = [
'core/more',
'core/freeform',
...( ! ALLOW_REUSABLE_BLOCKS && [ 'core/block' ] ),
];
const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;

/**
* Initializes the block editor in the widgets screen.
Expand All @@ -42,7 +44,7 @@ const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
export function initialize( id, settings ) {
const coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {
return ! (
DISABLED_BLOCKS.includes( block.name ) ||
disabledBlocks.includes( block.name ) ||
block.name.startsWith( 'core/post' ) ||
block.name.startsWith( 'core/query' ) ||
block.name.startsWith( 'core/site' )
Expand Down

0 comments on commit 57492c2

Please sign in to comment.