Skip to content

Commit

Permalink
prep build 04/08
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Apr 8, 2022
2 parents 460875e + 740445e commit a77c83b
Show file tree
Hide file tree
Showing 100 changed files with 2,257 additions and 924 deletions.
20 changes: 19 additions & 1 deletion .github/report-flaky-tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,27 @@ const metaData = {
TEST_RESULTS_LIST.open.length,
body.indexOf( TEST_RESULTS_LIST.close )
)
/**
* Split the text from:
* ```
* <!-- __TEST_RESULT__ --> Test result 1 <!-- /__TEST_RESULT__ -->
* ...
* <!-- __TEST_RESULT__ --> Test result 2 <!-- /__TEST_RESULT__ -->
* <!-- __TEST_RESULT__ --> Test result 3 <!-- /__TEST_RESULT__ -->
* ```
*
* into:
* ```
* [
* '<!-- __TEST_RESULT__ --> Test result 1 <!-- /__TEST_RESULT__ -->',
* '<!-- __TEST_RESULT__ --> Test result 2 <!-- /__TEST_RESULT__ -->',
* '<!-- __TEST_RESULT__ --> Test result 3 <!-- /__TEST_RESULT__ -->',
* ]
* ```
*/
.split(
new RegExp(
`(?<=${ TEST_RESULT.close })\n(?=${ TEST_RESULT.open })`
`(?<=${ TEST_RESULT.close })\n(?:\.\.\.\n)?(?=${ TEST_RESULT.open })`
)
);
// GitHub issues has character limits on issue's body,
Expand Down
4 changes: 3 additions & 1 deletion docs/reference-guides/block-api/block-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ Block type frontend and editor script definition. It will be enqueued both in th

### View Script

- Type: `WPDefinedAsset` ([learn more](#wpdefinedasset))
- Type: `WPDefinedAsset`|`WPDefinedAsset[]` ([learn more](#wpdefinedasset))
- Optional
- Localized: No
- Property: `viewScript`
Expand All @@ -447,6 +447,8 @@ Block type frontend and editor script definition. It will be enqueued both in th

Block type frontend script definition. It will be enqueued only when viewing the content on the front of the site.

_Note: An option to pass also an array of view scripts exists since WordPress `6.0.0`._

### Editor Style

- Type: `WPDefinedAsset`|`WPDefinedAsset[]` ([learn more](#wpdefinedasset))
Expand Down
6 changes: 3 additions & 3 deletions docs/reference-guides/block-api/block-supports.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,17 @@ supports: {
}
```

## __experimentalLock
## lock

- Type: `boolean`
- Default value: `true`

A block may want to disable the ability to toggle the lock state. It can be locked/unlocked by a user from the block "Options" dropdown by default. To disable this behavior, set `__experimentalLock` to `false`.
A block may want to disable the ability to toggle the lock state. It can be locked/unlocked by a user from the block "Options" dropdown by default. To disable this behavior, set `lock` to `false`.

```js
supports: {
// Remove support for locking UI.
__experimentalLock: false
lock: false
}
```

Expand Down
10 changes: 5 additions & 5 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Displays the name of the author of the comment. ([Source](https://github.com/Wor
- **Name:** core/comment-author-name
- **Category:** theme
- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** isLink, linkTarget, textAlign
- **Attributes:** fontSize, isLink, linkTarget, textAlign

## Comment Content

Expand All @@ -141,7 +141,7 @@ Displays the date on which the comment was posted. ([Source](https://github.com/
- **Name:** core/comment-date
- **Category:** theme
- **Supports:** color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** format, isLink
- **Attributes:** fontSize, format, isLink

## Comment Edit Link

Expand All @@ -150,7 +150,7 @@ Displays a link to edit the comment in the WordPress Dashboard. This link is onl
- **Name:** core/comment-edit-link
- **Category:** theme
- **Supports:** color (background, gradients, link, ~~text~~), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** linkTarget, textAlign
- **Attributes:** fontSize, linkTarget, textAlign

## Comment Reply Link

Expand All @@ -159,7 +159,7 @@ Displays a link to reply to a comment. ([Source](https://github.com/WordPress/gu
- **Name:** core/comment-reply-link
- **Category:** theme
- **Supports:** color (background, gradients, link, ~~text~~), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** textAlign
- **Attributes:** fontSize, textAlign

## Comment Template

Expand Down Expand Up @@ -262,7 +262,7 @@ Display multiple images in a rich gallery. ([Source](https://github.com/WordPres

## Group

Combine blocks into a group. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/group))
Gather blocks in a layout container. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/group))

- **Name:** core/group
- **Category:** design
Expand Down
4 changes: 2 additions & 2 deletions lib/block-supports/border.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
function gutenberg_register_border_support( $block_type ) {
// Determine if any border related features are supported.
$has_border_support = gutenberg_block_has_support( $block_type, array( '__experimentalBorder' ) );
$has_border_support = block_has_support( $block_type, array( '__experimentalBorder' ) );
$has_border_color_support = gutenberg_has_border_feature_support( $block_type, 'color' );

// Setup attributes and styles within that if needed.
Expand Down Expand Up @@ -161,7 +161,7 @@ function gutenberg_has_border_feature_support( $block_type, $feature, $default =

// Check if the specific feature has been opted into individually
// via nested flag under `__experimentalBorder`.
return gutenberg_block_has_support( $block_type, array( '__experimentalBorder', $feature ), $default );
return block_has_support( $block_type, array( '__experimentalBorder', $feature ), $default );
}

// Register the block support.
Expand Down
2 changes: 1 addition & 1 deletion lib/block-supports/dimensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function gutenberg_register_dimensions_support( $block_type ) {
return;
}

$has_dimensions_support = gutenberg_block_has_support( $block_type, array( '__experimentalDimensions' ), false );
$has_dimensions_support = block_has_support( $block_type, array( '__experimentalDimensions' ), false );
// Future block supports such as height & width will be added here.

if ( $has_dimensions_support ) {
Expand Down
16 changes: 14 additions & 2 deletions lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @param WP_Block_Type $block_type Block Type.
*/
function gutenberg_register_layout_support( $block_type ) {
$support_layout = gutenberg_block_has_support( $block_type, array( '__experimentalLayout' ), false );
$support_layout = block_has_support( $block_type, array( '__experimentalLayout' ), false );
if ( $support_layout ) {
if ( ! $block_type->attributes ) {
$block_type->attributes = array();
Expand Down Expand Up @@ -83,6 +83,12 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support
'center' => 'center',
);

$vertical_alignment_options = array(
'top' => 'flex-start',
'center' => 'center',
'bottom' => 'flex-end',
);

if ( 'horizontal' === $layout_orientation ) {
$justify_content_options += array( 'space-between' => 'space-between' );
}
Expand Down Expand Up @@ -117,6 +123,12 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support
if ( ! empty( $layout['justifyContent'] ) && array_key_exists( $layout['justifyContent'], $justify_content_options ) ) {
$style .= "justify-content: {$justify_content_options[ $layout['justifyContent'] ]};";
}

if ( ! empty( $layout['verticalAlignment'] ) && array_key_exists( $layout['verticalAlignment'], $vertical_alignment_options ) ) {
$style .= "align-items: {$vertical_alignment_options[ $layout['verticalAlignment'] ]};";
} else {
$style .= 'align-items: center;';
}
} else {
$style .= 'flex-direction: column;';
if ( ! empty( $layout['justifyContent'] ) && array_key_exists( $layout['justifyContent'], $justify_content_options ) ) {
Expand All @@ -142,7 +154,7 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support
*/
function gutenberg_render_layout_support_flag( $block_content, $block ) {
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
$support_layout = gutenberg_block_has_support( $block_type, array( '__experimentalLayout' ), false );
$support_layout = block_has_support( $block_type, array( '__experimentalLayout' ), false );

if ( ! $support_layout ) {
return $block_content;
Expand Down
6 changes: 3 additions & 3 deletions lib/block-supports/spacing.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @param WP_Block_Type $block_type Block Type.
*/
function gutenberg_register_spacing_support( $block_type ) {
$has_spacing_support = gutenberg_block_has_support( $block_type, array( 'spacing' ), false );
$has_spacing_support = block_has_support( $block_type, array( 'spacing' ), false );

// Setup attributes and styles within that if needed.
if ( ! $block_type->attributes ) {
Expand Down Expand Up @@ -44,8 +44,8 @@ function gutenberg_apply_spacing_support( $block_type, $block_attributes ) {
}

$attributes = array();
$has_padding_support = gutenberg_block_has_support( $block_type, array( 'spacing', 'padding' ), false );
$has_margin_support = gutenberg_block_has_support( $block_type, array( 'spacing', 'margin' ), false );
$has_padding_support = block_has_support( $block_type, array( 'spacing', 'padding' ), false );
$has_margin_support = block_has_support( $block_type, array( 'spacing', 'margin' ), false );
$block_styles = isset( $block_attributes['style'] ) ? $block_attributes['style'] : null;

if ( ! $block_styles ) {
Expand Down
Loading

0 comments on commit a77c83b

Please sign in to comment.