Skip to content

Commit b9dd4eb

Browse files
committed
prep build 11/04
2 parents 68d62af + c5921d7 commit b9dd4eb

File tree

31 files changed

+979
-235
lines changed

31 files changed

+979
-235
lines changed

backport-changelog/6.8/7069.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/7069
2+
3+
* https://github.com/WordPress/gutenberg/pull/63401

backport-changelog/6.8/7698.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/7698
2+
3+
* https://github.com/WordPress/gutenberg/pull/66662

lib/block-supports/typography.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ function gutenberg_register_typography_support( $block_type ) {
2020
return;
2121
}
2222

23-
$has_font_family_support = $typography_supports['__experimentalFontFamily'] ?? false;
23+
$has_font_family_support = $typography_supports['fontFamily'] ?? false;
2424
$has_font_size_support = $typography_supports['fontSize'] ?? false;
25-
$has_font_style_support = $typography_supports['__experimentalFontStyle'] ?? false;
26-
$has_font_weight_support = $typography_supports['__experimentalFontWeight'] ?? false;
27-
$has_letter_spacing_support = $typography_supports['__experimentalLetterSpacing'] ?? false;
25+
$has_font_style_support = $typography_supports['fontStyle'] ?? false;
26+
$has_font_weight_support = $typography_supports['fontWeight'] ?? false;
27+
$has_letter_spacing_support = $typography_supports['letterSpacing'] ?? false;
2828
$has_line_height_support = $typography_supports['lineHeight'] ?? false;
2929
$has_text_align_support = $typography_supports['textAlign'] ?? false;
3030
$has_text_columns_support = $typography_supports['textColumns'] ?? false;
31-
$has_text_decoration_support = $typography_supports['__experimentalTextDecoration'] ?? false;
32-
$has_text_transform_support = $typography_supports['__experimentalTextTransform'] ?? false;
31+
$has_text_decoration_support = $typography_supports['textDecoration'] ?? false;
32+
$has_text_transform_support = $typography_supports['textTransform'] ?? false;
3333
$has_writing_mode_support = $typography_supports['__experimentalWritingMode'] ?? false;
3434

3535
$has_typography_support = $has_font_family_support
@@ -91,16 +91,16 @@ function gutenberg_apply_typography_support( $block_type, $block_attributes ) {
9191
return array();
9292
}
9393

94-
$has_font_family_support = $typography_supports['__experimentalFontFamily'] ?? false;
94+
$has_font_family_support = $typography_supports['fontFamily'] ?? false;
9595
$has_font_size_support = $typography_supports['fontSize'] ?? false;
96-
$has_font_style_support = $typography_supports['__experimentalFontStyle'] ?? false;
97-
$has_font_weight_support = $typography_supports['__experimentalFontWeight'] ?? false;
98-
$has_letter_spacing_support = $typography_supports['__experimentalLetterSpacing'] ?? false;
96+
$has_font_style_support = $typography_supports['fontStyle'] ?? false;
97+
$has_font_weight_support = $typography_supports['fontWeight'] ?? false;
98+
$has_letter_spacing_support = $typography_supports['letterSpacing'] ?? false;
9999
$has_line_height_support = $typography_supports['lineHeight'] ?? false;
100100
$has_text_align_support = $typography_supports['textAlign'] ?? false;
101101
$has_text_columns_support = $typography_supports['textColumns'] ?? false;
102-
$has_text_decoration_support = $typography_supports['__experimentalTextDecoration'] ?? false;
103-
$has_text_transform_support = $typography_supports['__experimentalTextTransform'] ?? false;
102+
$has_text_decoration_support = $typography_supports['textDecoration'] ?? false;
103+
$has_text_transform_support = $typography_supports['textTransform'] ?? false;
104104
$has_writing_mode_support = $typography_supports['__experimentalWritingMode'] ?? false;
105105

106106
// Whether to skip individual block support features.

lib/class-wp-theme-json-resolver-gutenberg.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -920,18 +920,14 @@ public static function resolve_theme_file_uris( $theme_json ) {
920920
return $theme_json;
921921
}
922922

923-
$resolved_theme_json_data = array(
924-
'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA,
925-
);
923+
$resolved_theme_json_data = $theme_json->get_raw_data();
926924

927925
foreach ( $resolved_urls as $resolved_url ) {
928926
$path = explode( '.', $resolved_url['target'] );
929927
_wp_array_set( $resolved_theme_json_data, $path, $resolved_url['href'] );
930928
}
931929

932-
$theme_json->merge( new WP_Theme_JSON_Gutenberg( $resolved_theme_json_data ) );
933-
934-
return $theme_json;
930+
return new WP_Theme_JSON_Gutenberg( $resolved_theme_json_data );
935931
}
936932

937933
/**

lib/compat/wordpress-6.8/blocks.php

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Temporary compatibility shims for block APIs present in Gutenberg.
4+
*
5+
* @package gutenberg
6+
*/
7+
8+
/**
9+
* Filters the block type arguments during registration to stabilize experimental block supports.
10+
*
11+
* This is a temporary compatibility shim as the approach in core is for this to be handled
12+
* within the WP_Block_Type class rather than requiring a filter.
13+
*
14+
* @param array $args Array of arguments for registering a block type.
15+
* @return array Array of arguments for registering a block type.
16+
*/
17+
function gutenberg_stabilize_experimental_block_supports( $args ) {
18+
if ( empty( $args['supports']['typography'] ) ) {
19+
return $args;
20+
}
21+
22+
$experimental_typography_supports_to_stable = array(
23+
'__experimentalFontFamily' => 'fontFamily',
24+
'__experimentalFontStyle' => 'fontStyle',
25+
'__experimentalFontWeight' => 'fontWeight',
26+
'__experimentalLetterSpacing' => 'letterSpacing',
27+
'__experimentalTextDecoration' => 'textDecoration',
28+
'__experimentalTextTransform' => 'textTransform',
29+
);
30+
31+
$current_typography_supports = $args['supports']['typography'];
32+
$stable_typography_supports = array();
33+
34+
foreach ( $current_typography_supports as $key => $value ) {
35+
if ( array_key_exists( $key, $experimental_typography_supports_to_stable ) ) {
36+
$stable_typography_supports[ $experimental_typography_supports_to_stable[ $key ] ] = $value;
37+
} else {
38+
$stable_typography_supports[ $key ] = $value;
39+
}
40+
}
41+
42+
$args['supports']['typography'] = $stable_typography_supports;
43+
44+
return $args;
45+
}
46+
47+
add_filter( 'register_block_type_args', 'gutenberg_stabilize_experimental_block_supports', PHP_INT_MAX, 1 );

lib/load.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ function gutenberg_is_experiment_enabled( $name ) {
118118

119119
// WordPress 6.8 compat.
120120
require __DIR__ . '/compat/wordpress-6.8/preload.php';
121+
require __DIR__ . '/compat/wordpress-6.8/blocks.php';
121122

122123
// Experimental features.
123124
require __DIR__ . '/experimental/block-editor-settings-mobile.php';

packages/block-editor/src/components/block-inspector/style.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
margin-bottom: 1.5em;
1111
}
1212

13-
.components-base-control {
13+
.components-base-control,
14+
.components-radio-control {
1415
&:where(:not(:last-child)) {
1516
margin-bottom: $grid-unit-20;
1617
}

packages/block-editor/src/hooks/font-family.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { shouldSkipSerialization } from './utils';
1313
import { TYPOGRAPHY_SUPPORT_KEY } from './typography';
1414
import { unlock } from '../lock-unlock';
1515

16-
export const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
16+
export const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';
1717
const { kebabCase } = unlock( componentsPrivateApis );
1818

1919
/**

packages/block-editor/src/hooks/supports.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ const ALIGN_WIDE_SUPPORT_KEY = 'alignWide';
99
const BORDER_SUPPORT_KEY = '__experimentalBorder';
1010
const COLOR_SUPPORT_KEY = 'color';
1111
const CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';
12-
const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
12+
const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';
1313
const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
1414
const LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';
1515
/**
1616
* Key within block settings' support array indicating support for font style.
1717
*/
18-
const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
18+
const FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';
1919
/**
2020
* Key within block settings' support array indicating support for font weight.
2121
*/
22-
const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
22+
const FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';
2323
/**
2424
* Key within block settings' supports array indicating support for text
2525
* align e.g. settings found in `block.json`.
@@ -34,7 +34,7 @@ const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
3434
* Key within block settings' supports array indicating support for text
3535
* decorations e.g. settings found in `block.json`.
3636
*/
37-
const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
37+
const TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';
3838
/**
3939
* Key within block settings' supports array indicating support for writing mode
4040
* e.g. settings found in `block.json`.
@@ -44,13 +44,13 @@ const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
4444
* Key within block settings' supports array indicating support for text
4545
* transforms e.g. settings found in `block.json`.
4646
*/
47-
const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
47+
const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';
4848

4949
/**
5050
* Key within block settings' supports array indicating support for letter-spacing
5151
* e.g. settings found in `block.json`.
5252
*/
53-
const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
53+
const LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';
5454
const LAYOUT_SUPPORT_KEY = 'layout';
5555
const TYPOGRAPHY_SUPPORT_KEYS = [
5656
LINE_HEIGHT_SUPPORT_KEY,

packages/block-editor/src/hooks/typography.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ function omit( object, keys ) {
2727
);
2828
}
2929

30-
const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
31-
const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
32-
const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
30+
const LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';
31+
const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';
32+
const TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';
3333
const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
34-
const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
35-
const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
34+
const FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';
35+
const FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';
3636
const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
3737
export const TYPOGRAPHY_SUPPORT_KEY = 'typography';
3838
export const TYPOGRAPHY_SUPPORT_KEYS = [

packages/block-library/src/latest-posts/edit.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
238238
/>
239239
{ displayPostContent && (
240240
<RadioControl
241-
className="wp-block-latest-posts__post-content-radio"
242241
label={ __( 'Show' ) }
243242
selected={ displayPostContentRadio }
244243
options={ [

packages/block-library/src/latest-posts/editor.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,3 @@
1818
padding-left: 0;
1919
}
2020
}
21-
22-
// Apply the same styles that would be applied to
23-
// ".block-editor-block-inspector .components-base-control"
24-
// (see packages/block-editor/src/components/block-inspector/style.scss)
25-
.wp-block-latest-posts__post-content-radio {
26-
margin-bottom: #{ $grid-unit-30 };
27-
28-
&:last-child {
29-
margin-bottom: $grid-unit-10;
30-
}
31-
}

packages/blocks/src/api/constants.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export const __EXPERIMENTAL_STYLE_PROPERTY = {
183183
},
184184
fontFamily: {
185185
value: [ 'typography', 'fontFamily' ],
186-
support: [ 'typography', '__experimentalFontFamily' ],
186+
support: [ 'typography', 'fontFamily' ],
187187
useEngine: true,
188188
},
189189
fontSize: {
@@ -193,12 +193,12 @@ export const __EXPERIMENTAL_STYLE_PROPERTY = {
193193
},
194194
fontStyle: {
195195
value: [ 'typography', 'fontStyle' ],
196-
support: [ 'typography', '__experimentalFontStyle' ],
196+
support: [ 'typography', 'fontStyle' ],
197197
useEngine: true,
198198
},
199199
fontWeight: {
200200
value: [ 'typography', 'fontWeight' ],
201-
support: [ 'typography', '__experimentalFontWeight' ],
201+
support: [ 'typography', 'fontWeight' ],
202202
useEngine: true,
203203
},
204204
lineHeight: {
@@ -240,17 +240,17 @@ export const __EXPERIMENTAL_STYLE_PROPERTY = {
240240
},
241241
textDecoration: {
242242
value: [ 'typography', 'textDecoration' ],
243-
support: [ 'typography', '__experimentalTextDecoration' ],
243+
support: [ 'typography', 'textDecoration' ],
244244
useEngine: true,
245245
},
246246
textTransform: {
247247
value: [ 'typography', 'textTransform' ],
248-
support: [ 'typography', '__experimentalTextTransform' ],
248+
support: [ 'typography', 'textTransform' ],
249249
useEngine: true,
250250
},
251251
letterSpacing: {
252252
value: [ 'typography', 'letterSpacing' ],
253-
support: [ 'typography', '__experimentalLetterSpacing' ],
253+
support: [ 'typography', 'letterSpacing' ],
254254
useEngine: true,
255255
},
256256
writingMode: {
@@ -297,3 +297,12 @@ export const __EXPERIMENTAL_PATHS_WITH_OVERRIDE = {
297297
'typography.fontSizes': true,
298298
'spacing.spacingSizes': true,
299299
};
300+
301+
export const TYPOGRAPHY_SUPPORTS_EXPERIMENTAL_TO_STABLE = {
302+
__experimentalFontFamily: 'fontFamily',
303+
__experimentalFontStyle: 'fontStyle',
304+
__experimentalFontWeight: 'fontWeight',
305+
__experimentalLetterSpacing: 'letterSpacing',
306+
__experimentalTextDecoration: 'textDecoration',
307+
__experimentalTextTransform: 'textTransform',
308+
};

0 commit comments

Comments
 (0)