Skip to content

Commit

Permalink
Mark blocks used by Twenty Twenty-two as stable
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Oct 28, 2021
1 parent 632a0d8 commit f9b13a2
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 85 deletions.
158 changes: 76 additions & 82 deletions packages/block-library/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,71 +12,38 @@ import {
/**
* Internal dependencies
*/
import * as paragraph from './paragraph';
import * as image from './image';
import * as heading from './heading';
import * as quote from './quote';
import * as gallery from './gallery';
import * as archives from './archives';
import * as audio from './audio';
import * as buttons from './buttons';
import * as button from './button';
import * as buttons from './buttons';
import * as calendar from './calendar';
import * as categories from './categories';
import * as classic from './freeform';
import * as code from './code';
import * as columns from './columns';
import * as column from './column';
import * as columns from './columns';
import * as cover from './cover';
import * as embed from './embed';
import * as file from './file';
import * as html from './html';
import * as mediaText from './media-text';
import * as navigation from './navigation';
import * as navigationLink from './navigation-link';
import * as navigationSubmenu from './navigation-submenu';
import * as gallery from './gallery';
import * as group from './group';
import * as heading from './heading';
import * as homeLink from './home-link';
import * as html from './html';
import * as image from './image';
import * as latestComments from './latest-comments';
import * as latestPosts from './latest-posts';
import * as logInOut from './loginout';
import * as list from './list';
import * as logInOut from './loginout';
import * as mediaText from './media-text';
import * as missing from './missing';
import * as more from './more';
import * as navigation from './navigation';
import * as navigationLink from './navigation-link';
import * as navigationSubmenu from './navigation-submenu';
import * as nextpage from './nextpage';
import * as pageList from './page-list';
import * as preformatted from './preformatted';
import * as pullquote from './pullquote';
import * as reusableBlock from './block';
import * as rss from './rss';
import * as search from './search';
import * as group from './group';
import * as separator from './separator';
import * as shortcode from './shortcode';
import * as spacer from './spacer';
import * as table from './table';
// import * as tableOfContents from './table-of-contents';
import * as textColumns from './text-columns';
import * as verse from './verse';
import * as video from './video';
import * as tagCloud from './tag-cloud';
import * as classic from './freeform';
import * as socialLinks from './social-links';
import * as socialLink from './social-link';

// Full Site Editing Blocks
import * as siteLogo from './site-logo';
import * as siteTagline from './site-tagline';
import * as siteTitle from './site-title';
import * as templatePart from './template-part';
import * as query from './query';
import * as postTemplate from './post-template';
import * as queryTitle from './query-title';
import * as queryPagination from './query-pagination';
import * as queryPaginationNext from './query-pagination-next';
import * as queryPaginationNumbers from './query-pagination-numbers';
import * as queryPaginationPrevious from './query-pagination-previous';
import * as postNavigationLink from './post-navigation-link';
import * as postTitle from './post-title';
import * as postContent from './post-content';
import * as paragraph from './paragraph';
import * as postAuthor from './post-author';
import * as postComment from './post-comment';
import * as postCommentAuthor from './post-comment-author';
Expand All @@ -89,11 +56,42 @@ import * as postComments from './post-comments';
import * as postCommentsCount from './post-comments-count';
import * as postCommentsForm from './post-comments-form';
import * as postCommentsLink from './post-comments-link';
import * as postContent from './post-content';
import * as postDate from './post-date';
import * as postExcerpt from './post-excerpt';
import * as postFeaturedImage from './post-featured-image';
import * as postNavigationLink from './post-navigation-link';
import * as postTemplate from './post-template';
import * as postTerms from './post-terms';
import * as postTitle from './post-title';
import * as preformatted from './preformatted';
import * as pullquote from './pullquote';
import * as query from './query';
import * as queryPagination from './query-pagination';
import * as queryPaginationNext from './query-pagination-next';
import * as queryPaginationNumbers from './query-pagination-numbers';
import * as queryPaginationPrevious from './query-pagination-previous';
import * as queryTitle from './query-title';
import * as quote from './quote';
import * as reusableBlock from './block';
import * as rss from './rss';
import * as search from './search';
import * as separator from './separator';
import * as shortcode from './shortcode';
import * as siteLogo from './site-logo';
import * as siteTagline from './site-tagline';
import * as siteTitle from './site-title';
import * as socialLink from './social-link';
import * as socialLinks from './social-links';
import * as spacer from './spacer';
import * as table from './table';
// import * as tableOfContents from './table-of-contents';
import * as tagCloud from './tag-cloud';
import * as templatePart from './template-part';
import * as termDescription from './term-description';
import * as textColumns from './text-columns';
import * as verse from './verse';
import * as video from './video';

/**
* Function to register an individual block.
Expand Down Expand Up @@ -130,66 +128,67 @@ export const __experimentalGetCoreBlocks = () => [
quote,

// Register all remaining core blocks.
shortcode,
archives,
audio,
button,
buttons,
calendar,
categories,
window.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context
code,
columns,
column,
columns,
cover,
embed,
file,
group,
window.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context
html,
mediaText,
latestComments,
latestPosts,
logInOut,
mediaText,
missing,
more,
navigation,
navigationLink,
navigationSubmenu,
nextpage,
pageList,
postAuthor,
postComments,
postContent,
postDate,
postExcerpt,
postFeaturedImage,
postTemplate,
postTerms,
postTitle,
preformatted,
pullquote,
query,
queryPagination,
queryPaginationNext,
queryPaginationNumbers,
queryPaginationPrevious,
queryTitle,
reusableBlock,
rss,
search,
separator,
reusableBlock,
socialLinks,
shortcode,
siteLogo,
siteTagline,
siteTitle,
socialLink,
socialLinks,
spacer,
table,
// tableOfContents,
tagCloud,
templatePart,
textColumns,
verse,
video,

// Theme blocks
siteLogo,
siteTagline,
siteTitle,

query,
postTemplate,
queryTitle,
queryPagination,
queryPaginationNext,
queryPaginationNumbers,
queryPaginationPrevious,

postTitle,
postContent,
postDate,
postExcerpt,
postFeaturedImage,
postTerms,

logInOut,
];

/**
Expand Down Expand Up @@ -232,24 +231,19 @@ export const __experimentalRegisterExperimentalCoreBlocks =
process.env.GUTENBERG_PHASE === 2
? ( { enableFSEBlocks } = {} ) => {
[
navigation,
navigationLink,
// Experimental blocks.
homeLink,
navigationSubmenu,

// Register Full Site Editing Blocks.
// Full Site Editing blocks.
...( enableFSEBlocks
? [
templatePart,
postAuthor,
postComment,
postCommentAuthor,
postCommentAuthorAvatar,
postCommentContent,
postCommentDate,
postCommentEdit,
postCommentReplyLink,
postComments,
postCommentsCount,
postCommentsForm,
postCommentsLink,
Expand Down
10 changes: 8 additions & 2 deletions packages/customize-widgets/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ import './filters';

const { wp } = window;

const DISABLED_BLOCKS = [ 'core/more', 'core/block', 'core/freeform' ];
const DISABLED_BLOCKS = [
'core/more',
'core/block',
'core/freeform',
'core/template-part',
];
const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;

/**
Expand All @@ -50,7 +55,8 @@ export function initialize( editorName, blockEditorSettings ) {
DISABLED_BLOCKS.includes( block.name ) ||
block.name.startsWith( 'core/post' ) ||
block.name.startsWith( 'core/query' ) ||
block.name.startsWith( 'core/site' )
block.name.startsWith( 'core/site' ) ||
block.name.startsWith( 'core/navigation' )
);
} );
registerCoreBlocks( coreBlocks );
Expand Down
4 changes: 3 additions & 1 deletion packages/edit-widgets/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
const disabledBlocks = [
'core/more',
'core/freeform',
'core/template-part',
...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),
];

Expand Down Expand Up @@ -72,7 +73,8 @@ export function initialize( id, settings ) {
disabledBlocks.includes( block.name ) ||
block.name.startsWith( 'core/post' ) ||
block.name.startsWith( 'core/query' ) ||
block.name.startsWith( 'core/site' )
block.name.startsWith( 'core/site' ) ||
block.name.startsWith( 'core/navigation' )
);
} );

Expand Down

0 comments on commit f9b13a2

Please sign in to comment.