Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Pass block pattern name when using insertBlocks #25165
Conversation
…k pattern namespace if blocks have been inserted from a pattern.
Size Change: +262 B (0%) Total Size: 1.2 MB
|
Filename | Size | Change | |
---|---|---|---|
build/a11y/index.js |
1.14 kB | 0 B | |
build/api-fetch/index.js |
3.41 kB | 0 B | |
build/autop/index.js |
2.82 kB | 0 B | |
build/blob/index.js |
620 B | 0 B | |
build/block-directory/style-rtl.css |
953 B | 0 B | |
build/block-directory/style.css |
952 B | 0 B | |
build/block-library/style-rtl.css |
7.59 kB | 0 B | |
build/block-library/style.css |
7.58 kB | 0 B | |
build/block-library/theme-rtl.css |
754 B | 0 B | |
build/block-library/theme.css |
754 B | 0 B | |
build/block-serialization-default-parser/index.js |
1.88 kB | 0 B | |
build/block-serialization-spec-parser/index.js |
3.1 kB | 0 B | |
build/components/style-rtl.css |
15.5 kB | 0 B | |
build/components/style.css |
15.5 kB | 0 B | |
build/deprecated/index.js |
772 B | 0 B | |
build/dom-ready/index.js |
568 B | 0 B | |
build/edit-navigation/style-rtl.css |
1.16 kB | 0 B | |
build/edit-navigation/style.css |
1.16 kB | 0 B | |
build/edit-post/style-rtl.css |
6.26 kB | 0 B | |
build/edit-post/style.css |
6.25 kB | 0 B | |
build/edit-site/style-rtl.css |
3.06 kB | 0 B | |
build/edit-site/style.css |
3.06 kB | 0 B | |
build/editor/editor-styles-rtl.css |
492 B | 0 B | |
build/editor/editor-styles.css |
493 B | 0 B | |
build/editor/style-rtl.css |
3.81 kB | 0 B | |
build/editor/style.css |
3.81 kB | 0 B | |
build/escape-html/index.js |
733 B | 0 B | |
build/format-library/style-rtl.css |
547 B | 0 B | |
build/format-library/style.css |
548 B | 0 B | |
build/hooks/index.js |
2.13 kB | 0 B | |
build/list-reusable-blocks/style-rtl.css |
476 B | 0 B | |
build/list-reusable-blocks/style.css |
476 B | 0 B | |
build/nux/index.js |
3.4 kB | 0 B | |
build/nux/style-rtl.css |
671 B | 0 B | |
build/nux/style.css |
668 B | 0 B | |
build/primitives/index.js |
1.41 kB | 0 B | |
build/priority-queue/index.js |
789 B | 0 B | |
build/shortcode/index.js |
1.7 kB | 0 B | |
build/token-list/index.js |
1.27 kB | 0 B | |
build/viewport/index.js |
1.85 kB | 0 B | |
build/wordcount/index.js |
1.17 kB | 0 B |
I've had a little trouble testing this one using Redux DevTools. The action is pretty elusive and disappears before I can select it and inspect its data. Using The test suite all passed as well. |
Updated to use |
@youknowriad How does this look now with the meta change implemented? |
This is looking good to me. @mtias thoughts? |
apeatling commentedSep 8, 2020
•
edited
Description
With the
INSERT_BLOCKS
action, there is currently no way to tell the difference between a number of arbitrary blocks being inserted versus a defined block pattern being inserted.Providing the pattern namespace/name within the
insertBlocks
action creator means that we can determine whether or not these blocks were inserted via a block pattern.The value of
patternName
is the block pattern namespace and name if inserted via a pattern, and booleanfalse
if not.This is information that could be useful for showing the pattern in the undo history, or for plugins to take advantage of.
How has this been tested?
Tested locally, all automated tests passing.
Types of changes
New feature (non-breaking change which adds functionality)
To Test
INSERT_BLOCK
action has passed the pattern name in the objectChecklist: