Skip to content

Commit 8f07c80

Browse files
authored
Group registration of common blocks at the top to prioritize in inserters. (#5311)
1 parent f56fb20 commit 8f07c80

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

blocks/library/index.js

+15-11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import {
66
setDefaultBlockName,
77
setUnknownTypeHandlerName,
88
} from '../api';
9+
import * as paragraph from './paragraph';
10+
import * as image from './image';
11+
import * as heading from './heading';
12+
import * as quote from './quote';
13+
import * as gallery from './gallery';
914
import * as audio from './audio';
1015
import * as button from './button';
1116
import * as categories from './categories';
@@ -14,17 +19,12 @@ import * as columns from './columns';
1419
import * as coverImage from './cover-image';
1520
import * as embed from './embed';
1621
import * as freeform from './freeform';
17-
import * as gallery from './gallery';
18-
import * as heading from './heading';
1922
import * as html from './html';
20-
import * as image from './image';
2123
import * as latestPosts from './latest-posts';
2224
import * as list from './list';
2325
import * as more from './more';
24-
import * as paragraph from './paragraph';
2526
import * as preformatted from './preformatted';
2627
import * as pullquote from './pullquote';
27-
import * as quote from './quote';
2828
import * as reusableBlock from './block';
2929
import * as separator from './separator';
3030
import * as shortcode from './shortcode';
@@ -56,6 +56,16 @@ export const registerCoreBlocks = () => {
5656
// unknown shortcodes — see `setUnknownTypeHandlerName`.
5757
shortcode,
5858

59+
// Common blocks are grouped at the top to prioritize their display
60+
// in various contexts — like the inserter and auto-complete components.
61+
paragraph,
62+
image,
63+
heading,
64+
gallery,
65+
list,
66+
quote,
67+
68+
// Register all remaining core blocks.
5969
audio,
6070
button,
6171
categories,
@@ -66,17 +76,11 @@ export const registerCoreBlocks = () => {
6676
...embed.common,
6777
...embed.others,
6878
freeform,
69-
gallery,
70-
heading,
7179
html,
72-
image,
73-
list,
7480
latestPosts,
7581
more,
76-
paragraph,
7782
preformatted,
7883
pullquote,
79-
quote,
8084
reusableBlock,
8185
separator,
8286
subhead,

0 commit comments

Comments
 (0)