Skip to content
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

[pull] trunk from WordPress:trunk #26

Merged
merged 13 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions .github/ISSUE_TEMPLATE/Bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: Report a bug with the WordPress block editor or Gutenberg plugin
title: '<title>'
title: ''
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -49,10 +49,25 @@ body:
validations:
required: false

- type: checkboxes
- type: dropdown
id: existing
attributes:
label: Pre-checks
description: Please check if the bug has already been reported by searching https://github.com/WordPress/gutenberg/issues and make sure the bug is not related to another plugin.
label: Please confirm that you have searched existing issues in the repo.
description: You can do this by searching https://github.com/WordPress/gutenberg/issues and making sure the bug is not related to another plugin.
multiple: true
options:
- label: I have searched the existing issues.
- label: I have tested with all plugins deactivated except Gutenberg.
- 'Yes'
- 'No'
validations:
required: true

- type: dropdown
id: plugins
attributes:
label: Please confirm that you have tested with all plugins deactivated except Gutenberg.
multiple: true
options:
- 'Yes'
- 'No'
validations:
required: true
5 changes: 4 additions & 1 deletion lib/navigation-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ function gutenberg_navigation_init( $hook ) {
$settings = array_merge(
gutenberg_get_default_block_editor_settings(),
array(
'blockNavMenus' => get_theme_support( 'block-nav-menus' ),
'blockNavMenus' => false,
// We should uncomment the line below when the block-nav-menus feature becomes stable.
// @see https://github.com/WordPress/gutenberg/issues/34265.
/*'blockNavMenus' => get_theme_support( 'block-nav-menus' ),*/
)
);
$settings = gutenberg_experimental_global_styles_settings( $settings );
Expand Down
10 changes: 8 additions & 2 deletions lib/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ function gutenberg_output_block_nav_menu_item( $item_output, $item, $depth, $arg
* @return array Updated menu items, sorted by each menu item's menu order.
*/
function gutenberg_remove_block_nav_menu_items( $menu_items ) {
if ( current_theme_supports( 'block-nav-menus' ) ) {
// We should uncomment the line below when the block-nav-menus feature becomes stable.
// @see https://github.com/WordPress/gutenberg/issues/34265.
/*if ( current_theme_supports( 'block-nav-menus' ) ) {*/
if ( false ) {
return $menu_items;
}

Expand Down Expand Up @@ -246,7 +249,10 @@ function gutenberg_convert_menu_items_to_blocks(
* @return string|null Nav menu output to short-circuit with.
*/
function gutenberg_output_block_nav_menu( $output, $args ) {
if ( ! current_theme_supports( 'block-nav-menus' ) ) {
// We should uncomment the line below when the block-nav-menus feature becomes stable.
// @see https://github.com/WordPress/gutenberg/issues/34265.
/*if ( ! current_theme_supports( 'block-nav-menus' ) ) {*/
if ( true ) {
return null;
}

Expand Down
80 changes: 40 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions packages/block-editor/src/components/use-setting/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { get } from 'lodash';
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
import { __EXPERIMENTAL_PATHS_WITH_MERGE as PATHS_WITH_MERGE } from '@wordpress/blocks';

/**
* Internal dependencies
Expand Down Expand Up @@ -49,13 +50,6 @@ const deprecatedFlags = {
'spacing.customPadding': ( settings ) => settings.enableCustomSpacing,
};

const PATHS_WITH_MERGE = {
'color.gradients': true,
'color.palette': true,
'typography.fontFamilies': true,
'typography.fontSizes': true,
};

/**
* Hook that retrieves the editor setting.
* It works with nested objects using by finding the value at path.
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $blocks-block__margin: 0.5em;
padding: calc(0.667em + 2px) calc(1.333em + 2px); // The extra 2px are added to size solids the same as the outline versions.
text-align: center;
text-decoration: none;
overflow-wrap: break-word;
word-break: break-word; // overflow-wrap doesn't work well if a link is wrapped in the div, so use word-break here.
box-sizing: border-box;

&:hover,
Expand Down
11 changes: 10 additions & 1 deletion packages/block-library/src/embed/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ import {
import { store as coreStore } from '@wordpress/core-data';
import { View } from '@wordpress/primitives';

// The inline preview feature will be released progressible, for this reason
// the embed will only be considered previewable for the following providers list.
const PREVIEWABLE_PROVIDERS = [ 'youtube', 'twitter' ];

const EmbedEdit = ( props ) => {
const {
attributes: { align, providerNameSlug, previewable, responsive, url },
Expand Down Expand Up @@ -243,7 +247,12 @@ const EmbedEdit = ( props ) => {
label={ title }
onFocus={ onFocus }
preview={ preview }
previewable={ previewable }
previewable={
previewable &&
PREVIEWABLE_PROVIDERS.includes(
providerNameSlug
)
}
type={ type }
url={ url }
/>
Expand Down
23 changes: 10 additions & 13 deletions packages/block-library/src/embed/embed-preview.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,16 @@ const EmbedPreview = ( {
disabled={ ! isSelected }
>
<View>
{
// eslint-disable-next-line no-undef
__DEV__ && previewable ? (
embedWrapper
) : (
<EmbedNoPreview
label={ label }
icon={ icon }
isSelected={ isSelected }
onPress={ () => setIsCaptionSelected( false ) }
/>
)
}
{ previewable ? (
embedWrapper
) : (
<EmbedNoPreview
label={ label }
icon={ icon }
isSelected={ isSelected }
onPress={ () => setIsCaptionSelected( false ) }
/>
) }
<BlockCaption
accessibilityLabelCreator={ accessibilityLabelCreator }
accessible
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/embed/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

.wp-block-embed {
margin: 0 0 1em 0;
overflow-wrap: break-word; // Break long strings of text without spaces so they don't overflow the block.

// Supply caption styles to embeds, even if the theme hasn't opted in.
// Reason being: the new markup, figcaptions, are not likely to be styled in the majority of existing themes,
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/heading/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ h3,
h4,
h5,
h6 {
// Break long strings of text without spaces so they don't overflow the block.
overflow-wrap: break-word;

&.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
}
Expand Down
11 changes: 8 additions & 3 deletions packages/block-library/src/list/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
ol.has-background,
ul.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
ol,
ul {
// Break long strings of text without spaces so they don't overflow the block.
overflow-wrap: break-word;

&.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
}
}
7 changes: 7 additions & 0 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
margin-left: 0;
padding-left: 0;
}

// Revert any left/right margins.
// This also makes it work with classic theme auto margins.
.wp-block-navigation-item.wp-block {
margin-left: revert;
margin-right: revert;
}
}

// This element is inline on the frontend but needs to be editable, therefore inline-block, in the editor.
Expand Down
Loading