Skip to content

Commit

Permalink
Merge branch 'trunk' into replace/confirm-et-al
Browse files Browse the repository at this point in the history
* trunk:
  [RNMobile][Embed block] Add device's locale to preview content (#33858)
  Update AlignmentMatrixControl docs post merge. (#34662)
  Chore: Update caniuse package to the latest version (#34685)
  Chore: Move `react-native-url-polyfill` to dev dependencies (#34687)
  Site Editor - add basic plugin support (#34460)
  ESLint Plugin: Use Jest related rules only when the package is installed (#33120)
  Update `@wordpress/components` package's contributing guidelines (#33960)
  chore(release): publish
  Update changelog files
  [RNMobile] [Embed block] Fix content disappearing on Android when switching light/dark mode (#34207)
  Scripts: Convert legacy entry point arguments for compatibility with webpack 5 (#34264)
  Update justication control in `flex` layout (#34651)
  Block Editor: Rename experimental prop used in `BlockControls` (#34644)
  Fix social links deprecation (#34639)
  • Loading branch information
fullofcaffeine committed Sep 9, 2021
2 parents f746119 + 7c88877 commit 5fd979f
Show file tree
Hide file tree
Showing 88 changed files with 806 additions and 160 deletions.
9 changes: 4 additions & 5 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.0",
"react-native-url-polyfill": "1.1.2",
"react-test-renderer": "17.0.1",
"rimraf": "3.0.2",
"rtlcss": "2.6.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/a11y",
"version": "3.2.1",
"version": "3.2.2",
"description": "Accessibility (a11y) utilities for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/annotations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/annotations",
"version": "2.2.2",
"version": "2.2.3",
"description": "Annotate content in the Gutenberg editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-fetch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/api-fetch",
"version": "5.2.1",
"version": "5.2.2",
"description": "Utility to make WordPress REST API requests.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-default/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/babel-preset-default",
"version": "6.3.1",
"version": "6.3.2",
"description": "Default Babel preset for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 2 additions & 0 deletions packages/base-styles/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

## 4.0.0 (2021-09-09)

### Breaking Change

- Remove the background-colors, foreground-colors, and gradient-colors mixins.
Expand Down
2 changes: 1 addition & 1 deletion packages/base-styles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/base-styles",
"version": "3.6.0",
"version": "4.0.0",
"description": "Base SCSS utilities and variables for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-directory/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-directory",
"version": "3.0.1",
"version": "3.0.2",
"description": "Extend editor with block directory features to search, download and install blocks.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-editor",
"version": "7.0.1",
"version": "7.0.2",
"description": "Generic block editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
7 changes: 5 additions & 2 deletions packages/block-editor/src/components/block-controls/fill.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ export default function BlockControlsFill( {
group = 'default',
controls,
children,
__experimentalExposeToChildren = false,
__experimentalShareWithChildBlocks = false,
} ) {
const Fill = useBlockControlsFill( group, __experimentalExposeToChildren );
const Fill = useBlockControlsFill(
group,
__experimentalShareWithChildBlocks
);
if ( ! Fill ) {
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/block-editor/src/components/block-controls/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { store as blockEditorStore } from '../../store';
import { useBlockEditContext } from '../block-edit/context';
import useDisplayBlockControls from '../use-display-block-controls';

export default function useBlockControlsFill( group, exposeToChildren ) {
export default function useBlockControlsFill( group, shareWithChildBlocks ) {
const isDisplayed = useDisplayBlockControls();
const { clientId } = useBlockEditContext();
const isParentDisplayed = useSelect(
Expand All @@ -22,7 +22,7 @@ export default function useBlockControlsFill( group, exposeToChildren ) {
);
const { hasBlockSupport } = select( blocksStore );
return (
exposeToChildren &&
shareWithChildBlocks &&
hasBlockSupport(
getBlockName( clientId ),
'__experimentalExposeControlsToChildren',
Expand All @@ -31,7 +31,7 @@ export default function useBlockControlsFill( group, exposeToChildren ) {
hasSelectedInnerBlock( clientId )
);
},
[ exposeToChildren, clientId ]
[ shareWithChildBlocks, clientId ]
);

if ( isDisplayed ) {
Expand Down
5 changes: 4 additions & 1 deletion packages/block-editor/src/hooks/align.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ export const withToolbarControls = createHigherOrderComponent(
return (
<>
{ blockAllowedAlignments.length > 0 && (
<BlockControls group="block" __experimentalExposeToChildren>
<BlockControls
group="block"
__experimentalShareWithChildBlocks
>
<BlockAlignmentControl
value={ props.attributes.align }
onChange={ updateAlignment }
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/duotone.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function DuotonePanel( { attributes, setAttributes } ) {
}

return (
<BlockControls group="block" __experimentalExposeToChildren>
<BlockControls group="block" __experimentalShareWithChildBlocks>
<DuotoneControl
duotonePalette={ duotonePalette }
colorPalette={ colorPalette }
Expand Down
6 changes: 6 additions & 0 deletions packages/block-editor/src/hooks/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@
.block-editor-hooks__layout-controls-helptext {
font-size: $helptext-font-size;
}

.block-editor-hooks__flex-layout-justification-controls {
legend {
margin-bottom: $grid-unit-10;
}
}
93 changes: 54 additions & 39 deletions packages/block-editor/src/layouts/flex.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/**
* WordPress dependencies
*/
import { __, _x } from '@wordpress/i18n';
import { __ } from '@wordpress/i18n';
import {
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
} from '@wordpress/components';
justifyLeft,
justifyCenter,
justifyRight,
justifySpaceBetween,
} from '@wordpress/icons';
import { Button } from '@wordpress/components';

/**
* Internal dependencies
Expand Down Expand Up @@ -44,7 +47,7 @@ export default {
return null;
}
return (
<BlockControls group="block" __experimentalExposeToChildren>
<BlockControls group="block" __experimentalShareWithChildBlocks>
<FlexLayoutJustifyContentControl
layout={ layout }
onChange={ onChange }
Expand Down Expand Up @@ -87,12 +90,40 @@ export default {
},
};

const justificationOptions = [
{
value: 'left',
icon: justifyLeft,
label: __( 'Justify items left' ),
},
{
value: 'center',
icon: justifyCenter,
label: __( 'Justify items center' ),
},
{
value: 'right',
icon: justifyRight,
label: __( 'Justify items right' ),
},
{
value: 'space-between',
icon: justifySpaceBetween,
label: __( 'Space between items' ),
},
];
function FlexLayoutJustifyContentControl( {
layout,
onChange,
isToolbar = false,
} ) {
const { justifyContent = 'left' } = layout;
const onJustificationChange = ( value ) => {
onChange( {
...layout,
justifyContent: value,
} );
};
if ( isToolbar ) {
return (
<JustifyContentControl
Expand All @@ -103,47 +134,31 @@ function FlexLayoutJustifyContentControl( {
'space-between',
] }
value={ justifyContent }
onChange={ ( value ) => {
onChange( {
...layout,
justifyContent: value,
} );
} }
onChange={ onJustificationChange }
popoverProps={ {
position: 'bottom right',
isAlternate: true,
} }
/>
);
}

return (
<ToggleGroupControl
label={ __( 'Justify content' ) }
value={ justifyContent }
onChange={ ( value ) => {
onChange( {
...layout,
justifyContent: value,
} );
} }
isBlock
>
<ToggleGroupControlOption
value="left"
label={ _x( 'Left', 'Justify content option' ) }
/>
<ToggleGroupControlOption
value="center"
label={ _x( 'Center', 'Justify content option' ) }
/>
<ToggleGroupControlOption
value="right"
label={ _x( 'Right', 'Justify content option' ) }
/>
<ToggleGroupControlOption
value="space-between"
label={ _x( 'Space between', 'Justify content option' ) }
/>
</ToggleGroupControl>
<fieldset className="block-editor-hooks__flex-layout-justification-controls">
<legend>{ __( 'Justification' ) }</legend>
<div>
{ justificationOptions.map( ( { value, icon, label } ) => {
return (
<Button
key={ value }
label={ label }
icon={ icon }
isPressed={ justifyContent === value }
onClick={ () => onJustificationChange( value ) }
/>
);
} ) }
</div>
</fieldset>
);
}
2 changes: 2 additions & 0 deletions packages/block-library/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

## 6.0.0 (2021-09-09)

### Breaking Change

- Remove the background-colors, foreground-colors, and gradient-colors mixins.
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-library",
"version": "5.0.1",
"version": "6.0.0",
"description": "Block library for the WordPress editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/buttons/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function ButtonsEdit( {

return (
<>
<BlockControls group="block" __experimentalExposeToChildren>
<BlockControls group="block" __experimentalShareWithChildBlocks>
<JustifyContentControl
allowedControls={ justifyControls }
value={ contentJustification }
Expand Down
9 changes: 7 additions & 2 deletions packages/block-library/src/embed/embed-preview.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ import classnames from 'classnames/dedupe';
* WordPress dependencies
*/
import { View } from '@wordpress/primitives';

import { BlockCaption } from '@wordpress/block-editor';
import {
BlockCaption,
store as blockEditorStore,
} from '@wordpress/block-editor';
import { __, sprintf } from '@wordpress/i18n';
import { memo, useState } from '@wordpress/element';
import { SandBox } from '@wordpress/components';
import { useSelect } from '@wordpress/data';

/**
* Internal dependencies
Expand All @@ -38,6 +41,7 @@ const EmbedPreview = ( {
url,
} ) => {
const [ isCaptionSelected, setIsCaptionSelected ] = useState( false );
const { locale } = useSelect( blockEditorStore ).getSettings();

const wrapperStyle = styles[ 'embed-preview__wrapper' ];
const wrapperAlignStyle =
Expand Down Expand Up @@ -105,6 +109,7 @@ const EmbedPreview = ( {
>
<PreviewContent
html={ html }
lang={ locale }
title={ iframeTitle }
type={ sandboxClassnames }
providerUrl={ providerUrl }
Expand Down
5 changes: 5 additions & 0 deletions packages/block-library/src/social-links/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ const deprecated = [
type: 'string',
},
},
supports: {
align: [ 'left', 'center', 'right' ],
anchor: true,
__experimentalExposeControlsToChildren: true,
},
isEligible: ( { layout } ) => ! layout,
migrate: migrateWithLayout,
save( props ) {
Expand Down
2 changes: 2 additions & 0 deletions packages/blocks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

## 11.1.0 (2021-09-09)

### Backward Compatibility

- Register a block even when an invalid value provided for the icon setting ([#34350](https://github.com/WordPress/gutenberg/pull/34350)).
Expand Down
2 changes: 1 addition & 1 deletion packages/blocks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/blocks",
"version": "11.0.1",
"version": "11.1.0",
"description": "Block API for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
Loading

0 comments on commit 5fd979f

Please sign in to comment.