Build Tools: Update the @wordpress/*
packages.
Merges [43801,43803] from the 5.0 branch to trunk. See #45145. git-svn-id: https://develop.svn.wordpress.org/trunk@44163 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a8f4e58e75
commit
dc6b225023
1321
package-lock.json
generated
1321
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
72
package.json
72
package.json
@ -13,8 +13,8 @@
|
||||
"author": "The WordPress Contributors",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"devDependencies": {
|
||||
"@wordpress/custom-templated-path-webpack-plugin": "^1.1.5",
|
||||
"@wordpress/library-export-default-webpack-plugin": "^1.0.4",
|
||||
"@wordpress/custom-templated-path-webpack-plugin": "1.1.5",
|
||||
"@wordpress/library-export-default-webpack-plugin": "1.0.4",
|
||||
"autoprefixer": "^9.1.5",
|
||||
"check-node-version": "3.2.0",
|
||||
"copy-webpack-plugin": "^4.5.2",
|
||||
@ -54,40 +54,40 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/polyfill": "^7.0.0",
|
||||
"@wordpress/a11y": "^2.0.2",
|
||||
"@wordpress/api-fetch": "^2.0.2",
|
||||
"@wordpress/autop": "^2.0.2",
|
||||
"@wordpress/blob": "^2.0.2",
|
||||
"@wordpress/block-library": "2.1.0",
|
||||
"@wordpress/block-serialization-default-parser": "^1.0.1",
|
||||
"@wordpress/blocks": "^4.0.1",
|
||||
"@wordpress/components": "^4.1.0",
|
||||
"@wordpress/compose": "^2.0.2",
|
||||
"@wordpress/core-data": "^2.0.2",
|
||||
"@wordpress/data": "^2.1.1",
|
||||
"@wordpress/date": "^2.0.2",
|
||||
"@wordpress/deprecated": "^2.0.2",
|
||||
"@wordpress/dom": "^2.0.2",
|
||||
"@wordpress/dom-ready": "^2.0.2",
|
||||
"@wordpress/edit-post": "1.0.0",
|
||||
"@wordpress/editor": "^4.0.1",
|
||||
"@wordpress/element": "^2.1.1",
|
||||
"@wordpress/escape-html": "^1.0.0-beta.1",
|
||||
"@wordpress/hooks": "^2.0.2",
|
||||
"@wordpress/html-entities": "^2.0.2",
|
||||
"@wordpress/i18n": "^3.0.1",
|
||||
"@wordpress/is-shallow-equal": "^1.1.4",
|
||||
"@wordpress/keycodes": "^2.0.2",
|
||||
"@wordpress/list-reusable-blocks": "^1.1.0",
|
||||
"@wordpress/nux": "^2.0.1",
|
||||
"@wordpress/plugins": "^2.0.2",
|
||||
"@wordpress/redux-routine": "^3.0.1",
|
||||
"@wordpress/rich-text": "^1.0.0-beta.1",
|
||||
"@wordpress/shortcode": "^2.0.2",
|
||||
"@wordpress/token-list": "^1.0.2",
|
||||
"@wordpress/url": "^2.0.2",
|
||||
"@wordpress/viewport": "^2.0.2",
|
||||
"@wordpress/wordcount": "^2.0.2",
|
||||
"@wordpress/a11y": "2.0.2",
|
||||
"@wordpress/api-fetch": "2.1.0",
|
||||
"@wordpress/autop": "2.0.2",
|
||||
"@wordpress/blob": "2.1.0",
|
||||
"@wordpress/block-library": "2.1.4",
|
||||
"@wordpress/block-serialization-default-parser": "1.0.1",
|
||||
"@wordpress/blocks": "4.0.4",
|
||||
"@wordpress/components": "4.2.1",
|
||||
"@wordpress/compose": "2.0.5",
|
||||
"@wordpress/core-data": "2.0.6",
|
||||
"@wordpress/data": "2.1.4",
|
||||
"@wordpress/date": "2.0.3",
|
||||
"@wordpress/deprecated": "2.0.2",
|
||||
"@wordpress/dom": "2.0.4",
|
||||
"@wordpress/dom-ready": "2.0.2",
|
||||
"@wordpress/edit-post": "1.0.4",
|
||||
"@wordpress/editor": "5.0.1",
|
||||
"@wordpress/element": "2.1.4",
|
||||
"@wordpress/escape-html": "1.0.1",
|
||||
"@wordpress/hooks": "2.0.2",
|
||||
"@wordpress/html-entities": "2.0.2",
|
||||
"@wordpress/i18n": "3.0.1",
|
||||
"@wordpress/is-shallow-equal": "1.1.4",
|
||||
"@wordpress/keycodes": "2.0.2",
|
||||
"@wordpress/list-reusable-blocks": "1.1.4",
|
||||
"@wordpress/nux": "2.0.6",
|
||||
"@wordpress/plugins": "2.0.5",
|
||||
"@wordpress/redux-routine": "3.0.3",
|
||||
"@wordpress/rich-text": "1.0.1",
|
||||
"@wordpress/shortcode": "2.0.2",
|
||||
"@wordpress/token-list": "1.0.2",
|
||||
"@wordpress/url": "2.1.0",
|
||||
"@wordpress/viewport": "2.0.5",
|
||||
"@wordpress/wordcount": "2.0.2",
|
||||
"backbone": "1.3.3",
|
||||
"element-closest": "^2.0.2",
|
||||
"formdata-polyfill": "^3.0.12",
|
||||
|
@ -16,11 +16,6 @@ function render_block_core_categories( $attributes ) {
|
||||
static $block_id = 0;
|
||||
$block_id++;
|
||||
|
||||
$align = 'center';
|
||||
if ( isset( $attributes['align'] ) && in_array( $attributes['align'], array( 'left', 'right', 'full' ), true ) ) {
|
||||
$align = $attributes['align'];
|
||||
}
|
||||
|
||||
$args = array(
|
||||
'echo' => false,
|
||||
'hierarchical' => ! empty( $attributes['showHierarchy'] ),
|
||||
@ -46,10 +41,14 @@ function render_block_core_categories( $attributes ) {
|
||||
$type = 'list';
|
||||
}
|
||||
|
||||
$class = "wp-block-categories wp-block-categories-{$type} align{$align}";
|
||||
$class = "wp-block-categories wp-block-categories-{$type}";
|
||||
|
||||
if ( isset( $attributes['align'] ) ) {
|
||||
$class .= " align{$attributes['align']}";
|
||||
}
|
||||
|
||||
if ( isset( $attributes['className'] ) ) {
|
||||
$class .= ' ' . $attributes['className'];
|
||||
$class .= " {$attributes['className']}";
|
||||
}
|
||||
|
||||
$block_content = sprintf(
|
||||
|
@ -5,32 +5,34 @@
|
||||
* @package gutenberg
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the post title.
|
||||
*
|
||||
* The post title is fetched and if it is blank then a default string is
|
||||
* returned.
|
||||
*
|
||||
* Copied from `wp-admin/includes/template.php`, but we can't include that
|
||||
* file because:
|
||||
*
|
||||
* 1. It causes bugs with test fixture generation and strange Docker 255 error
|
||||
* codes.
|
||||
* 2. It's in the admin; ideally we *shouldn't* be including files from the
|
||||
* admin for a block's output. It's a very small/simple function as well,
|
||||
* so duplicating it isn't too terrible.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
|
||||
* @return string The post title if set; "(no title)" if no title is set.
|
||||
*/
|
||||
function gutenberg_draft_or_post_title( $post = 0 ) {
|
||||
$title = get_the_title( $post );
|
||||
if ( empty( $title ) ) {
|
||||
$title = __( '(no title)', 'gutenberg' );
|
||||
if ( ! function_exists( 'gutenberg_draft_or_post_title' ) ) {
|
||||
/**
|
||||
* Get the post title.
|
||||
*
|
||||
* The post title is fetched and if it is blank then a default string is
|
||||
* returned.
|
||||
*
|
||||
* Copied from `wp-admin/includes/template.php`, but we can't include that
|
||||
* file because:
|
||||
*
|
||||
* 1. It causes bugs with test fixture generation and strange Docker 255 error
|
||||
* codes.
|
||||
* 2. It's in the admin; ideally we *shouldn't* be including files from the
|
||||
* admin for a block's output. It's a very small/simple function as well,
|
||||
* so duplicating it isn't too terrible.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
|
||||
* @return string The post title if set; "(no title)" if no title is set.
|
||||
*/
|
||||
function gutenberg_draft_or_post_title( $post = 0 ) {
|
||||
$title = get_the_title( $post );
|
||||
if ( empty( $title ) ) {
|
||||
$title = __( '(no title)', 'gutenberg' );
|
||||
}
|
||||
return esc_html( $title );
|
||||
}
|
||||
return esc_html( $title );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -166,7 +166,7 @@ function wp_default_packages_scripts( &$scripts ) {
|
||||
$suffix = wp_scripts_get_suffix();
|
||||
|
||||
$packages_dependencies = array(
|
||||
'api-fetch' => array( 'wp-polyfill', 'wp-hooks', 'wp-i18n' ),
|
||||
'api-fetch' => array( 'wp-polyfill', 'wp-hooks', 'wp-i18n', 'wp-url' ),
|
||||
'a11y' => array( 'wp-dom-ready', 'wp-polyfill' ),
|
||||
'autop' => array( 'wp-polyfill' ),
|
||||
'blob' => array( 'wp-polyfill' ),
|
||||
@ -962,12 +962,14 @@ function wp_default_scripts( &$scripts ) {
|
||||
'mejs.fullscreen-on' => __( 'Go Fullscreen' ),
|
||||
'mejs.download-video' => __( 'Download Video' ),
|
||||
'mejs.fullscreen' => __( 'Fullscreen' ),
|
||||
'mejs.time-jump-forward' => array( __( 'Jump forward 1 second' ), __( 'Jump forward %1 seconds' ) ),
|
||||
'mejs.loop' => __( 'Toggle Loop' ),
|
||||
'mejs.play' => __( 'Play' ),
|
||||
'mejs.pause' => __( 'Pause' ),
|
||||
'mejs.close' => __( 'Close' ),
|
||||
'mejs.time-slider' => __( 'Time Slider' ),
|
||||
'mejs.time-help-text' => __( 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.' ),
|
||||
'mejs.time-skip-back' => array( __( 'Skip back 1 second' ), __( 'Skip back %1 seconds' ) ),
|
||||
'mejs.captions-subtitles' => __( 'Captions/Subtitles' ),
|
||||
'mejs.captions-chapters' => __( 'Chapters' ),
|
||||
'mejs.none' => __( 'None' ),
|
||||
@ -979,6 +981,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'mejs.video-player' => __( 'Video Player' ),
|
||||
'mejs.audio-player' => __( 'Audio Player' ),
|
||||
'mejs.ad-skip' => __( 'Skip ad' ),
|
||||
'mejs.ad-skip-info' => array( __( 'Skip in 1 second' ), __( 'Skip in %1 seconds' ) ),
|
||||
'mejs.source-chooser' => __( 'Source Chooser' ),
|
||||
'mejs.stop' => __( 'Stop' ),
|
||||
'mejs.speed-rate' => __( 'Speed Rate' ),
|
||||
@ -1067,8 +1070,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'wp-codemirror', '/wp-includes/js/codemirror/codemirror.min.js', array(), '5.29.1-alpha-ee20357' );
|
||||
$scripts->add( 'csslint', '/wp-includes/js/codemirror/csslint.js', array(), '1.0.5' );
|
||||
$scripts->add( 'jshint', '/wp-includes/js/codemirror/fakejshint.js', array( 'esprima' ), '2.9.5' );
|
||||
$scripts->add( 'esprima', '/wp-includes/js/codemirror/esprima.js', array(), '4.0.0' );
|
||||
$scripts->add( 'jshint', '/wp-includes/js/codemirror/jshint.js', array(), '2.9.5.999' );
|
||||
$scripts->add( 'jsonlint', '/wp-includes/js/codemirror/jsonlint.js', array(), '1.6.2' );
|
||||
$scripts->add( 'htmlhint', '/wp-includes/js/codemirror/htmlhint.js', array(), '0.9.14-xwp' );
|
||||
$scripts->add( 'htmlhint-kses', '/wp-includes/js/codemirror/htmlhint-kses.js', array( 'htmlhint' ) );
|
||||
@ -1227,7 +1229,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'themePreviewUnavailable' => __( 'Sorry, you can’t preview new themes when you have changes scheduled or saved as a draft. Please publish your changes, or wait until they publish to preview new themes.' ),
|
||||
'themeInstallUnavailable' => sprintf(
|
||||
/* translators: %s: URL to Add Themes admin screen */
|
||||
__( 'You won’t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ),
|
||||
__( 'You won’t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ),
|
||||
esc_url( admin_url( 'theme-install.php' ) )
|
||||
),
|
||||
'publishSettings' => __( 'Publish Settings' ),
|
||||
@ -1335,17 +1337,6 @@ function wp_default_scripts( &$scripts ) {
|
||||
'termSelected' => __( 'Term selected.' ),
|
||||
'termAdded' => __( 'Term added.' ),
|
||||
'termRemoved' => __( 'Term removed.' ),
|
||||
'restURL' => rest_url( '/wp/v2/tags' ),
|
||||
|
||||
/**
|
||||
* Filters the minimum number of characters required to fire a tag search via Ajax.
|
||||
*
|
||||
* Previous to 5.0.0, this filter passed taxonomy and search context parameters.
|
||||
* @since 4.0.0
|
||||
*
|
||||
* @param int $characters The minimum number of characters required. Default 2.
|
||||
*/
|
||||
'minChars' => (int) apply_filters( 'term_search_min_chars', 2 ),
|
||||
)
|
||||
);
|
||||
|
||||
@ -1398,17 +1389,16 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ) );
|
||||
|
||||
$scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-a11y' ), false, 1 );
|
||||
$scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->add_inline_script(
|
||||
'admin-widgets',
|
||||
sprintf(
|
||||
'wpWidgets.l10n = %s;',
|
||||
wp_json_encode(
|
||||
array(
|
||||
'save' => __( 'Save' ),
|
||||
'saved' => __( 'Saved' ),
|
||||
'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
|
||||
'widgetAdded' => __( 'Widget has been added to the selected sidebar' ),
|
||||
'save' => __( 'Save' ),
|
||||
'saved' => __( 'Saved' ),
|
||||
'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -2416,74 +2406,3 @@ function script_concat_settings() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the enqueueing of block scripts and styles that are common to both
|
||||
* the editor and the front-end.
|
||||
*
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @global WP_Screen $current_screen
|
||||
*/
|
||||
function wp_common_block_scripts_and_styles() {
|
||||
global $current_screen;
|
||||
|
||||
if ( is_admin() && ! $current_screen->is_block_editor() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_style( 'wp-block-library' );
|
||||
|
||||
if ( current_theme_supports( 'wp-block-styles' ) ) {
|
||||
wp_enqueue_style( 'wp-block-library-theme' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires after enqueuing block assets for both editor and front-end.
|
||||
*
|
||||
* Call `add_action` on any hook before 'wp_enqueue_scripts'.
|
||||
*
|
||||
* In the function call you supply, simply use `wp_enqueue_script` and
|
||||
* `wp_enqueue_style` to add your functionality to the Gutenberg editor.
|
||||
*
|
||||
* @since 5.0.0
|
||||
*/
|
||||
do_action( 'enqueue_block_assets' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueues registered block scripts and styles, depending on current rendered
|
||||
* context (only enqueuing editor scripts while in context of the editor).
|
||||
*
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @global WP_Screen $current_screen
|
||||
*/
|
||||
function wp_enqueue_registered_block_scripts_and_styles() {
|
||||
global $current_screen;
|
||||
|
||||
$is_editor = ( is_admin() && $current_screen->is_block_editor() );
|
||||
|
||||
$block_registry = WP_Block_Type_Registry::get_instance();
|
||||
foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) {
|
||||
// Front-end styles.
|
||||
if ( ! empty( $block_type->style ) ) {
|
||||
wp_enqueue_style( $block_type->style );
|
||||
}
|
||||
|
||||
// Front-end script.
|
||||
if ( ! empty( $block_type->script ) ) {
|
||||
wp_enqueue_script( $block_type->script );
|
||||
}
|
||||
|
||||
// Editor styles.
|
||||
if ( $is_editor && ! empty( $block_type->editor_style ) ) {
|
||||
wp_enqueue_style( $block_type->editor_style );
|
||||
}
|
||||
|
||||
// Editor script.
|
||||
if ( $is_editor && ! empty( $block_type->editor_script ) ) {
|
||||
wp_enqueue_script( $block_type->editor_script );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
<ul class="wp-block-categories wp-block-categories-list aligncenter"><li class="cat-item-none">No categories</li></ul>
|
||||
<ul class="wp-block-categories wp-block-categories-list"><li class="cat-item-none">No categories</li></ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user