Posts containing blocks are now correctly handled when displaying on the front end, including dynamic blocks and nested blocks.
Props pento.
Merges [43752] to trunk.
See #45109.
git-svn-id: https://develop.svn.wordpress.org/trunk@44118 602fd350-edb4-49c9-b593-d223f7449a82
The `WP_Block_Parser` class, and the accompanying `parse_blocks()` helper function, can be used to parse an array of blocks out of a content string.
`WP_Block_Parser` is copied from the `@wordpress/block-serialization-default-parser` package. To ensure it stays in sync with the JavaScript parser, changes should be implemented in the package first, then the package version should be upgraded to include the changes.
Props pento.
Merges [43751] to trunk.
See #45109.
git-svn-id: https://develop.svn.wordpress.org/trunk@44116 602fd350-edb4-49c9-b593-d223f7449a82
Adjusts the packages registration after [43723]:
Combine the different registration functions into one `wp_default_packages` function. To reach this goal move the prefix logic into a function so it can be called from different locations. Use a static variable there to prevent duplicate inclusion of `version.php`.
Call this function from the `wp_default_scripts` action by registering it as a default filter.
Combine some of the logic in `_WP_Editors::print_tinymce_scripts` into `wp_register_tinymce_scripts`. The logic to force an uncompressed TinyMCE script file stays in `_WP_Editors::force_uncompressed_tinymce` because that logic is very specific to the classic editor.
The script handle `wp-tinymce` is now a dependency of the editor script handle. In combination with the previous item, this makes the classic editor work.
Adjust the syntax of the script paths to be more consistent with other WordPress code.
Always use "production" mode for the media files to prevent people from inadvertently committing development files.
Props pento, omarreiss, atimmer.
Merges [43738] into trunk.
Fixes#45065.
git-svn-id: https://develop.svn.wordpress.org/trunk@44115 602fd350-edb4-49c9-b593-d223f7449a82
This allows the packages to be consumed by plugins and core itself.
The code has been based on the work done in the Gutenberg plugin.
We've added an array with all the packages and the vendor packages to
loop through. This sets a convention so all packages will be
registered in the same way. This array can eventually be generated by
a webpack plugin.
We need to register TinyMCE explicitly. Previously TinyMCE was used
by inserting custom `<script>` tags into the relevant admin pages.
This is not suitable for the new editor, so we need to explicitly
register TinyMCE. We could, in the future, refactor the custom
`<script>` tags to use the registered TinyMCE script instead.
Polyfills are inserted into the page only when necessary using
`document.write`.
Props omarreiss, herregroen, youknowriad, gziolo, atimmer.
Merges [43723] to trunk.
Fixes#45065.
git-svn-id: https://develop.svn.wordpress.org/trunk@44114 602fd350-edb4-49c9-b593-d223f7449a82
We decided to split the media webpack config into it's own file. The
main webpack config then combines this file with the packages config.
Include vendor scripts by copying them. We copy the minified files if
they are available. If they aren't available we minify the original
files ourselves.
Props omarreiss, herregroen, gziolo, youknowriad, netweb, adamsilverstein.
Merges [43719] to trunk.
See #45065.
git-svn-id: https://develop.svn.wordpress.org/trunk@44112 602fd350-edb4-49c9-b593-d223f7449a82