-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract Core Blocks to the npm packages folder #8287
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
05ad41a
Extract Core Blocks to the npm packages folder
youknowriad e4cc457
Core blocks: Adjustment after rebase with master
gziolo 81cae91
Build: Add support for all scss files in build-style directory
gziolo 837b3e2
Build: Fix output path for styles generated for packages
gziolo 4fab1ad
Fix sass files after rebase
youknowriad 1f36b25
Fix watching SASS files
youknowriad 1717c65
Rename core-blocks block-library
youknowriad e0a23d7
Fix linting issues
youknowriad e6f6da7
Update docs
youknowriad a23dc80
Deprecate Core Blocks
youknowriad 4b93b84
Update index.js
gziolo 348156c
Update client-assets.php
gziolo 29370a5
Update client-assets.php
gziolo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import "../packages/block-library/src/editor.scss"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
core-blocks/freeform/editor.scss → block-library/freeform/editor.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
registerBlockType, | ||
setDefaultBlockName, | ||
setUnknownTypeHandlerName, | ||
} from '@wordpress/blocks'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import './style.scss'; | ||
import './editor.scss'; | ||
import './theme.scss'; | ||
import * as paragraph from '../packages/block-library/src/paragraph'; | ||
import * as image from '../packages/block-library/src/image'; | ||
import * as heading from '../packages/block-library/src/heading'; | ||
import * as quote from '../packages/block-library/src/quote'; | ||
import * as gallery from '../packages/block-library/src/gallery'; | ||
import * as archives from '../packages/block-library/src/archives'; | ||
import * as audio from '../packages/block-library/src/audio'; | ||
import * as button from '../packages/block-library/src/button'; | ||
import * as categories from '../packages/block-library/src/categories'; | ||
import * as code from '../packages/block-library/src/code'; | ||
import * as columns from '../packages/block-library/src/columns'; | ||
import * as column from '../packages/block-library/src/columns/column'; | ||
import * as coverImage from '../packages/block-library/src/cover-image'; | ||
import * as embed from '../packages/block-library/src/embed'; | ||
import * as file from '../packages/block-library/src/file'; | ||
import * as latestComments from '../packages/block-library/src/latest-comments'; | ||
import * as latestPosts from '../packages/block-library/src/latest-posts'; | ||
import * as list from '../packages/block-library/src/list'; | ||
import * as more from '../packages/block-library/src/more'; | ||
import * as nextpage from '../packages/block-library/src/nextpage'; | ||
import * as preformatted from '../packages/block-library/src/preformatted'; | ||
import * as pullquote from '../packages/block-library/src/pullquote'; | ||
import * as reusableBlock from '../packages/block-library/src/block'; | ||
import * as separator from '../packages/block-library/src/separator'; | ||
import * as shortcode from '../packages/block-library/src/shortcode'; | ||
import * as spacer from '../packages/block-library/src/spacer'; | ||
import * as subhead from '../packages/block-library/src/subhead'; | ||
import * as table from '../packages/block-library/src/table'; | ||
import * as textColumns from '../packages/block-library/src/text-columns'; | ||
import * as verse from '../packages/block-library/src/verse'; | ||
import * as video from '../packages/block-library/src/video'; | ||
|
||
// The freeform block can't be moved to the "npm" packages folder because it requires the wp.oldEditor global. | ||
import * as freeform from './freeform'; | ||
|
||
// The HTML block can't be moved to the "npm" packages folder because it requires the CodeEditor component. | ||
import * as html from './html'; | ||
|
||
export const registerCoreBlocks = () => { | ||
[ | ||
// Common blocks are grouped at the top to prioritize their display | ||
// in various contexts — like the inserter and auto-complete components. | ||
paragraph, | ||
image, | ||
heading, | ||
gallery, | ||
list, | ||
quote, | ||
|
||
// Register all remaining core blocks. | ||
shortcode, | ||
archives, | ||
audio, | ||
button, | ||
categories, | ||
code, | ||
columns, | ||
column, | ||
coverImage, | ||
embed, | ||
...embed.common, | ||
...embed.others, | ||
file, | ||
freeform, | ||
html, | ||
latestComments, | ||
latestPosts, | ||
more, | ||
nextpage, | ||
preformatted, | ||
pullquote, | ||
separator, | ||
reusableBlock, | ||
spacer, | ||
subhead, | ||
table, | ||
textColumns, | ||
verse, | ||
video, | ||
].forEach( ( { name, settings } ) => { | ||
registerBlockType( name, settings ); | ||
} ); | ||
|
||
setDefaultBlockName( paragraph.name ); | ||
setUnknownTypeHandlerName( freeform.name ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import '../packages/block-library/src'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import "../packages/block-library/src/style.scss"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import "../packages/block-library/src/theme.scss"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,14 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
registerBlockType, | ||
setDefaultBlockName, | ||
setUnknownTypeHandlerName, | ||
} from '@wordpress/blocks'; | ||
import { registerCoreBlocks as registerBlockLibrary } from '@wordpress/block-library'; | ||
import deprecated from '@wordpress/deprecated'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import './style.scss'; | ||
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 button from './button'; | ||
import * as categories from './categories'; | ||
import * as code from './code'; | ||
import * as columns from './columns'; | ||
import * as column from './columns/column'; | ||
import * as coverImage from './cover-image'; | ||
import * as embed from './embed'; | ||
import * as file from './file'; | ||
import * as freeform from './freeform'; | ||
import * as html from './html'; | ||
import * as latestComments from './latest-comments'; | ||
import * as latestPosts from './latest-posts'; | ||
import * as list from './list'; | ||
import * as more from './more'; | ||
import * as nextpage from './nextpage'; | ||
import * as preformatted from './preformatted'; | ||
import * as pullquote from './pullquote'; | ||
import * as reusableBlock from './block'; | ||
import * as separator from './separator'; | ||
import * as shortcode from './shortcode'; | ||
import * as spacer from './spacer'; | ||
import * as subhead from './subhead'; | ||
import * as table from './table'; | ||
import * as textColumns from './text-columns'; | ||
import * as verse from './verse'; | ||
import * as video from './video'; | ||
|
||
export const registerCoreBlocks = () => { | ||
[ | ||
// Common blocks are grouped at the top to prioritize their display | ||
// in various contexts — like the inserter and auto-complete components. | ||
paragraph, | ||
image, | ||
heading, | ||
gallery, | ||
list, | ||
quote, | ||
|
||
// Register all remaining core blocks. | ||
shortcode, | ||
archives, | ||
audio, | ||
button, | ||
categories, | ||
code, | ||
columns, | ||
column, | ||
coverImage, | ||
embed, | ||
...embed.common, | ||
...embed.others, | ||
file, | ||
freeform, | ||
html, | ||
latestComments, | ||
latestPosts, | ||
more, | ||
nextpage, | ||
preformatted, | ||
pullquote, | ||
separator, | ||
reusableBlock, | ||
spacer, | ||
subhead, | ||
table, | ||
textColumns, | ||
verse, | ||
video, | ||
].forEach( ( { name, settings } ) => { | ||
registerBlockType( name, settings ); | ||
export const registerCoreBlocks = ( ...args ) => { | ||
deprecated( 'wp.coreBlocks.registerCoreBlocks', { | ||
version: 3.8, | ||
alternative: 'wp.blockLibrary.registerCoreBlocks', | ||
} ); | ||
|
||
setDefaultBlockName( paragraph.name ); | ||
setUnknownTypeHandlerName( freeform.name ); | ||
return registerBlockLibrary( ...args ); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# **core/editor**: The Editor’s Data | ||
|
||
## Selectors | ||
## Selectors | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing whitespace! 😱 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is generated, we might have an issue in the build tool |
||
|
||
### hasEditorUndo | ||
|
||
|
@@ -1422,5 +1422,4 @@ Returns an action object used in signalling that the editor settings have been u | |
|
||
*Parameters* | ||
|
||
* settings: Updated settings | ||
|
||
* settings: Updated settings |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're updating the name, calling these "built-in" or "default" blocks might be nicer than "core blocks". Thoughts?