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

Font Library: Font Collection backend #54097

Closed
wants to merge 56 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
80997a4
Mobile Release v1.101.2 (#53936)
derekblank Aug 28, 2023
1db3a34
Cover block: fix exception when adding video background (#53961)
glendaviesnz Aug 28, 2023
6c2a629
Date: add relative time translations for moment.js (#53931)
ramonjd Aug 28, 2023
dc06193
[RNMobile] Remove third-party dependency on react-native-hsv-color-pi…
derekblank Aug 28, 2023
4316be5
Make mid size parameter settable for Query Pagination block. (#51216)
krokodok Aug 28, 2023
640150a
Interactivity API: router with region-based client-side navigation (#…
luisherranz Aug 28, 2023
12c60c7
Icons: Fix invalid namespaces (#53955)
Aug 28, 2023
a9252ec
Always render the fallback Popover anchor within the Popover's parent…
youknowriad Aug 28, 2023
f2b1fc5
[Commands]: Add toggle list view command in site editor (#53983)
ntsekouras Aug 28, 2023
3a86baa
Mobile Release v1.102.1 (#53946)
dcalhoun Aug 28, 2023
58f5e9a
Update translation domains (#53995)
oandregal Aug 28, 2023
902a300
Interactivity API: Update `data-wp-bind` directive logic (#54003)
DAreRodz Aug 29, 2023
a7350b0
Pass entire link value on new tab toggle (#53949)
getdave Aug 29, 2023
db18bf3
Bump plugin version to 16.5.1
gutenbergplugin Aug 29, 2023
470730f
Interactivity API: add Slot and Fill directives (#53958)
DAreRodz Aug 29, 2023
1231506
Fix: indicator style when block moving mode (#53972)
t-hamano Aug 29, 2023
df40f46
Auto-inserting blocks: Add block inspector panel (#52969)
ockham Aug 29, 2023
2653b5e
test: Automate mobile editor tests (#53991)
dcalhoun Aug 29, 2023
935be24
test: Social Icons (#54001)
dcalhoun Aug 29, 2023
0074c5a
Post Editor: Fix browser console error when changing device preview m…
t-hamano Aug 29, 2023
3a7404d
Update Changelog for 16.5.1
gutenbergplugin Aug 29, 2023
a8eead8
[Commands]: Fix block editor commands availability (#53994)
ntsekouras Aug 29, 2023
4f6d1b3
Fix query loop bugs by correctly relying on the main query and removi…
felixarntz Aug 29, 2023
2db2dc0
Patterns: Disable the preview option button when editing (#53913)
t-hamano Aug 29, 2023
2436169
PaletteEdit: Fix component height (#54000)
Aug 29, 2023
abfe3c6
Query block: client-side pagination (#53812)
luisherranz Aug 29, 2023
5dbe0da
RichTextValue: improve types (#54002)
margolisj Aug 29, 2023
8c165c1
[RNMobile] Add block outline to all Social Link blocks when selected …
derekblank Aug 30, 2023
4cd8320
BlockList: Ensure element styles (and svg) are always appended at the…
andrewserong Aug 30, 2023
324e9b3
Simplify check for no posts in query-no-results block (#53772)
ocean90 Aug 30, 2023
6ede5e2
Migrate shortcut help e2e tests to Playwright (#53832)
stokesman Aug 30, 2023
37dbd03
[Commands]: Fix `move to` command condition for registering (#54049)
ntsekouras Aug 30, 2023
cd5d5fe
Docs: Extend the information about using `render` with `block.json` (…
gziolo Aug 30, 2023
0ae22b5
Search block: Fix width input field (#53952)
Aug 30, 2023
67dc1bc
Popover: update `@floating-ui` to latest version, remove custom fix f…
ciampo Aug 30, 2023
bd630b7
Blocks: move bootstrapped block types to Redux state (#53807)
jsnajdr Aug 30, 2023
f706c86
Toggle Distraction free mode mode based on compatibility (#54030)
ntsekouras Aug 30, 2023
69dabb1
Bump plugin version to 16.6.0-rc.1
gutenbergplugin Aug 30, 2023
2d4314d
Update Changelog for 16.6.0-rc.1
gutenbergplugin Aug 30, 2023
22d24f3
Mobile - Columns block - Fix transforming into a Group block crash (#…
Aug 30, 2023
5410389
Improving error messages and codes in jest-console, matcher.js (#53743)
MericKarabulut Aug 30, 2023
dcb4df6
Update versions for 6.3.1 (#54069)
annezazu Aug 31, 2023
d67a8d5
Update the components changelog to mark the popover slot removal as a…
youknowriad Aug 31, 2023
3db444b
Post navigation link: Fix the writing mode setting on the front. (#54…
carolinan Aug 31, 2023
a8dbc88
Design Tools: Add block instance elements support for buttons and hea…
aaronrobertshaw Aug 31, 2023
e691d32
Packages: Ensure that the release branch is fetched from origin durin…
gziolo Aug 31, 2023
5b42dda
Update changelog files
gutenbergplugin Aug 31, 2023
cc85f9b
chore(release): publish
gutenbergplugin Aug 31, 2023
ad410d8
[Post editor]: Toggle Distraction free mode mode based on compatibili…
ntsekouras Aug 31, 2023
0d7548f
Update editor pckg config to address "multiple Podfile" warn (#54077)
mokagio Aug 31, 2023
9ce5048
Post Terms: Fix the 'useSelect' warning in the 'usePostTerms' hook (#…
Mamaduka Aug 31, 2023
ea3c23d
E2E: Do not run page actions in beforeEach hook when using fixme (#54…
WunderBart Aug 31, 2023
6d77fd2
Adds 'nofollow' setting to inline links (rich text only) (#53945)
getdave Aug 31, 2023
4df5573
useMediaQuery: Avoid crashing on Safari < 14 (#54023)
Mamaduka Aug 31, 2023
3c27042
Prevent the list view shortcut from typing unexpected characters (#54…
youknowriad Aug 31, 2023
0ecfa2b
Footnotes: Add missing placeholder instructions text (#54056)
Mamaduka Aug 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions bin/plugin/commands/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ async function runNpmReleaseBranchSyncStep( pluginReleaseBranch, config ) {
*/
await repo
.raw( 'rm', '-r', '.' )
.fetch( 'origin', pluginReleaseBranch, [ '--depth=1' ] )
.raw( 'checkout', `origin/${ pluginReleaseBranch }`, '--', '.' );

const { commit: commitHash } = await repo.commit(
Expand Down
271 changes: 271 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/contributors/versions-in-wordpress.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ If anything looks incorrect here, please bring it up in #core-editor in [WordPre

| Gutenberg Versions | WordPress Version |
| ------------------ | ----------------- |
| 15.2-16.1 | 6.3.1 |
| 15.2-16.1 | 6.3 |
| 14.2-15.1 | 6.2 |
| 13.1-14.1 | 6.1.1 |
Expand Down
10 changes: 10 additions & 0 deletions docs/reference-guides/block-api/block-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,16 @@ PHP file to use when rendering the block type on the server to show on the front
- `$content` (`string`): The block default content.
- `$block` (`WP_Block`): The block instance.

An example implementation of the `render.php` file defined with `render` could look like:

```php
<div <?php echo get_block_wrapper_attributes(); ?>>
<?php echo esc_html( $attributes['label'] ); ?>
</div>
```

_Note: This file loads for every instance of the block type when rendering the page HTML on the server. Accounting for that is essential when declaring functions or classes in the file. The simplest way to avoid the risk of errors is to consume that shared logic from another file._

## Assets

### `WPDefinedPath`
Expand Down
6 changes: 3 additions & 3 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ Gather blocks in a layout container. ([Source](https://github.com/WordPress/gute

- **Name:** core/group
- **Category:** design
- **Supports:** align (full, wide), anchor, ariaLabel, color (background, gradients, heading, link, text), dimensions (minHeight), layout (allowSizingOnChildren), position (sticky), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Supports:** align (full, wide), anchor, ariaLabel, color (background, button, gradients, heading, link, text), dimensions (minHeight), layout (allowSizingOnChildren), position (sticky), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** allowedBlocks, tagName, templateLock

## Heading
Expand Down Expand Up @@ -665,7 +665,7 @@ An advanced block that allows displaying post types based on different query par
- **Name:** core/query
- **Category:** theme
- **Supports:** align (full, wide), layout, ~~html~~
- **Attributes:** namespace, query, queryId, tagName
- **Attributes:** enhancedPagination, namespace, query, queryId, tagName

## No results

Expand Down Expand Up @@ -705,7 +705,7 @@ Displays a list of page numbers for pagination ([Source](https://github.com/Word
- **Category:** theme
- **Parent:** core/query-pagination
- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**
- **Attributes:** midSize

## Previous Page

Expand Down
6 changes: 5 additions & 1 deletion docs/reference-guides/data/data-core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ The actions in this package shouldn't be used directly. Instead, use the functio

<!-- START TOKEN(Autogenerated actions|../../../packages/blocks/src/store/actions.js) -->

Nothing to document.
### reapplyBlockTypeFilters

Signals that all block types should be computed again. It uses stored unprocessed block types and all the most recent list of registered filters.

It addresses the issue where third party block filters get registered after third party blocks. A sample sequence: 1. Filter A. 2. Block B. 3. Block C. 4. Filter D. 5. Filter E. 6. Block F. 7. Filter G. In this scenario some filters would not get applied for all blocks because they are registered too late.

<!-- END TOKEN(Autogenerated actions|../../../packages/blocks/src/store/actions.js) -->
4 changes: 4 additions & 0 deletions docs/reference-guides/data/data-core-edit-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,10 @@ _Parameters_

- _mode_ `string`: The editor mode.

### toggleDistractionFree

Action that toggles Distraction free mode. Distraction free mode expects there are no sidebars, as due to the z-index values set, you can't close sidebars.

### toggleEditorPanelEnabled

Returns an action object used to enable or disable a panel in the editor.
Expand Down
4 changes: 4 additions & 0 deletions docs/reference-guides/data/data-core-edit-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,10 @@ _Returns_

Undocumented declaration.

### toggleDistractionFree

Action that toggles Distraction free mode. Distraction free mode expects there are no sidebars, as due to the z-index values set, you can't close sidebars.

### toggleFeature

Dispatches an action that toggles a feature flag.
Expand Down
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality.
* Requires at least: 6.1
* Requires PHP: 7.0
* Version: 16.5.0
* Version: 16.6.0-rc.1
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
6 changes: 5 additions & 1 deletion lib/block-supports/colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ function gutenberg_register_colors_support( $block_type ) {
$has_background_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'background' ), true ) );
$has_gradients_support = _wp_array_get( $color_support, array( 'gradients' ), false );
$has_link_colors_support = _wp_array_get( $color_support, array( 'link' ), false );
$has_button_colors_support = _wp_array_get( $color_support, array( 'button' ), false );
$has_heading_colors_support = _wp_array_get( $color_support, array( 'heading' ), false );
$has_color_support = $has_text_colors_support ||
$has_background_colors_support ||
$has_gradients_support ||
$has_link_colors_support;
$has_link_colors_support ||
$has_button_colors_support ||
$has_heading_colors_support;

if ( ! $block_type->attributes ) {
$block_type->attributes = array();
Expand Down
176 changes: 136 additions & 40 deletions lib/block-supports/elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,79 @@ function gutenberg_get_elements_class_name( $block ) {
* @return string Filtered block content.
*/
function gutenberg_render_elements_support( $block_content, $block ) {
if ( ! $block_content ) {
if ( ! $block_content || empty( $block['attrs'] ) ) {
return $block_content;
}

$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
$skip_link_color_serialization = wp_should_skip_block_supports_serialization( $block_type, 'color', 'link' );
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );

$element_color_properties = array(
'button' => array(
'skip' => wp_should_skip_block_supports_serialization( $block_type, 'color', 'button' ),
'paths' => array(
'style.elements.button.color.text',
'style.elements.button.color.background',
'style.elements.button.color.gradient',
),
),
'link' => array(
'skip' => wp_should_skip_block_supports_serialization( $block_type, 'color', 'link' ),
'paths' => array(
'style.elements.link.color.text',
'style.elements.link.:hover.color.text',
),
),
'heading' => array(
'skip' => wp_should_skip_block_supports_serialization( $block_type, 'color', 'heading' ),
'paths' => array(
'style.elements.heading.color.text',
'style.elements.heading.color.background',
'style.elements.heading.color.gradient',
'style.elements.h1.color.text',
'style.elements.h1.color.background',
'style.elements.h1.color.gradient',
'style.elements.h2.color.text',
'style.elements.h2.color.background',
'style.elements.h2.color.gradient',
'style.elements.h3.color.text',
'style.elements.h3.color.background',
'style.elements.h3.color.gradient',
'style.elements.h4.color.text',
'style.elements.h4.color.background',
'style.elements.h4.color.gradient',
'style.elements.h5.color.text',
'style.elements.h5.color.background',
'style.elements.h5.color.gradient',
'style.elements.h6.color.text',
'style.elements.h6.color.background',
'style.elements.h6.color.gradient',
),
),
);

$skip_all_element_color_serialization = $element_color_properties['button']['skip'] &&
$element_color_properties['link']['skip'] &&
$element_color_properties['heading']['skip'];

if ( $skip_link_color_serialization ) {
if ( $skip_all_element_color_serialization ) {
return $block_content;
}

$link_color = null;
if ( ! empty( $block['attrs'] ) ) {
$link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', 'color', 'text' ), null );
}
$element_colors_set = 0;

foreach ( $element_color_properties as $element_config ) {
if ( $element_config['skip'] ) {
continue;
}

$hover_link_color = null;
if ( ! empty( $block['attrs'] ) ) {
$hover_link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', ':hover', 'color', 'text' ), null );
foreach ( $element_config['paths'] as $path ) {
if ( null !== _wp_array_get( $block['attrs'], explode( '.', $path ), null ) ) {
$element_colors_set++;
}
}
}

/*
* For now we only care about link colors.
* This code in the future when we have a public API
* should take advantage of WP_Theme_JSON_Gutenberg::compute_style_properties
* and work for any element and style.
*/
if ( null === $link_color && null === $hover_link_color ) {
if ( ! $element_colors_set ) {
return $block_content;
}

Expand Down Expand Up @@ -80,33 +125,84 @@ function gutenberg_render_elements_support_styles( $pre_render, $block ) {
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
$element_block_styles = isset( $block['attrs']['style']['elements'] ) ? $block['attrs']['style']['elements'] : null;

/*
* For now we only care about link color.
*/
$skip_link_color_serialization = wp_should_skip_block_supports_serialization( $block_type, 'color', 'link' );
if ( ! $element_block_styles ) {
return null;
}

if ( $skip_link_color_serialization ) {
$skip_link_color_serialization = wp_should_skip_block_supports_serialization( $block_type, 'color', 'link' );
$skip_heading_color_serialization = wp_should_skip_block_supports_serialization( $block_type, 'color', 'heading' );
$skip_button_color_serialization = wp_should_skip_block_supports_serialization( $block_type, 'color', 'button' );
$skips_all_element_color_serialization = $skip_link_color_serialization &&
$skip_heading_color_serialization &&
$skip_button_color_serialization;

if ( $skips_all_element_color_serialization ) {
return null;
}
$class_name = gutenberg_get_elements_class_name( $block );
$link_block_styles = isset( $element_block_styles['link'] ) ? $element_block_styles['link'] : null;

gutenberg_style_engine_get_styles(
$link_block_styles,
array(
'selector' => ".$class_name a",
'context' => 'block-supports',
)

$class_name = gutenberg_get_elements_class_name( $block );

$element_types = array(
'button' => array(
'selector' => ".$class_name .wp-element-button, .$class_name .wp-block-button__link",
'skip' => $skip_button_color_serialization,
),
'link' => array(
'selector' => ".$class_name a",
'hover_selector' => ".$class_name a:hover",
'skip' => $skip_link_color_serialization,
),
'heading' => array(
'selector' => ".$class_name h1, .$class_name h2, .$class_name h3, .$class_name h4, .$class_name h5, .$class_name h6",
'skip' => $skip_heading_color_serialization,
'elements' => array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ),
),
);

if ( isset( $link_block_styles[':hover'] ) ) {
gutenberg_style_engine_get_styles(
$link_block_styles[':hover'],
array(
'selector' => ".$class_name a:hover",
'context' => 'block-supports',
)
);
foreach ( $element_types as $element_type => $element_config ) {
if ( $element_config['skip'] ) {
continue;
}

$element_style_object = _wp_array_get( $element_block_styles, array( $element_type ), null );

// Process primary element type styles.
if ( $element_style_object ) {
gutenberg_style_engine_get_styles(
$element_style_object,
array(
'selector' => $element_config['selector'],
'context' => 'block-supports',
)
);

if ( isset( $element_style_object[':hover'] ) ) {
gutenberg_style_engine_get_styles(
$element_style_object[':hover'],
array(
'selector' => $element_config['hover_selector'],
'context' => 'block-supports',
)
);
}
}

// Process related elements e.g. h1-h6 for headings.
if ( isset( $element_config['elements'] ) ) {
foreach ( $element_config['elements'] as $element ) {
$element_style_object = _wp_array_get( $element_block_styles, array( $element ), null );

if ( $element_style_object ) {
gutenberg_style_engine_get_styles(
$element_style_object,
array(
'selector' => ".$class_name $element",
'context' => 'block-supports',
)
);
}
}
}
}

return null;
Expand Down
Loading