<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[58328] trunk: Editor: Add theme.json v3 migrations.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/58328">58328</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/58328","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>ellatrix</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-06-04 11:53:37 +0000 (Tue, 04 Jun 2024)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Editor: Add theme.json v3 migrations.
See https://github.com/WordPress/wordpress-develop/pull/6616.
See also the original Gutenberg PRs:
* https://github.com/WordPress/gutenberg/pull/58409
* https://github.com/WordPress/gutenberg/pull/61328
* https://github.com/WordPress/gutenberg/pull/61842
* https://github.com/WordPress/gutenberg/pull/62199
* https://github.com/WordPress/gutenberg/pull/62252
Fixes <a href="https://core.trac.wordpress.org/ticket/61282">#61282</a>.
Props ajlende, talldanwp, ramonopoly, ellatrix.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesblockeditorphp">trunk/src/wp-includes/block-editor.php</a></li>
<li><a href="#trunksrcwpincludesclasswpthemejsondataphp">trunk/src/wp-includes/class-wp-theme-json-data.php</a></li>
<li><a href="#trunksrcwpincludesclasswpthemejsonresolverphp">trunk/src/wp-includes/class-wp-theme-json-resolver.php</a></li>
<li><a href="#trunksrcwpincludesclasswpthemejsonschemaphp">trunk/src/wp-includes/class-wp-theme-json-schema.php</a></li>
<li><a href="#trunksrcwpincludesclasswpthemejsonphp">trunk/src/wp-includes/class-wp-theme-json.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestfontfacescontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestfontfamiliescontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php</a></li>
<li><a href="#trunksrcwpincludesthemejson">trunk/src/wp-includes/theme.json</a></li>
<li><a href="#trunksrcwpincludesthemephp">trunk/src/wp-includes/theme.php</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemestylesvariationajson">trunk/tests/phpunit/data/themedir1/block-theme/styles/variation-a.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemestylesvariationbjson">trunk/tests/phpunit/data/themedir1/block-theme/styles/variation-b.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemestylesvariationjson">trunk/tests/phpunit/data/themedir1/block-theme/styles/variation.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemethemejson">trunk/tests/phpunit/data/themedir1/block-theme/theme.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemechildstylesvariationajson">trunk/tests/phpunit/data/themedir1/block-theme-child/styles/variation-a.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemechildstylesvariationbjson">trunk/tests/phpunit/data/themedir1/block-theme-child/styles/variation-b.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemechildthemejson">trunk/tests/phpunit/data/themedir1/block-theme-child/theme.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemechildwithfluidlayoutthemejson">trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-layout/theme.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemechildwithfluidtypographythemejson">trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography/theme.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemechildwithfluidtypographyconfigthemejson">trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography-config/theme.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemedeprecatedpathstylesvariationjson">trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/styles/variation.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1blockthemewithhookedblocksthemejson">trunk/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/theme.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1emptyfontfacethemethemejson">trunk/tests/phpunit/data/themedir1/empty-fontface-theme/theme.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1fontsblockthemestylesvariationduplicatefontsjson">trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-duplicate-fonts.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1fontsblockthemestylesvariationnewfontfamilyjson">trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-new-font-family.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1fontsblockthemestylesvariationnewfontvariationsjson">trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-new-font-variations.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1fontsblockthemestylesvariationnofontsjson">trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-no-fonts.json</a></li>
<li><a href="#trunktestsphpunitdatathemedir1fontsblockthemethemejson">trunk/tests/phpunit/data/themedir1/fonts-block-theme/theme.json</a></li>
<li><a href="#trunktestsphpunittestsfontsfontlibrarywpRestFontFacesControllerphp">trunk/tests/phpunit/tests/fonts/font-library/wpRestFontFacesController.php</a></li>
<li><a href="#trunktestsphpunittestsfontsfontlibrarywpRestFontFamiliesControllerphp">trunk/tests/phpunit/tests/fonts/font-library/wpRestFontFamiliesController.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestglobalstylescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-global-styles-controller.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestthemescontrollerphp">trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php</a></li>
<li><a href="#trunktestsphpunitteststhemewpThemeJsonphp">trunk/tests/phpunit/tests/theme/wpThemeJson.php</a></li>
<li><a href="#trunktestsphpunitteststhemewpThemeJsonSchemaphp">trunk/tests/phpunit/tests/theme/wpThemeJsonSchema.php</a></li>
<li><a href="#trunktestsqunitfixtureswpapigeneratedjs">trunk/tests/qunit/fixtures/wp-api-generated.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesblockeditorphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/block-editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/block-editor.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/src/wp-includes/block-editor.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -814,6 +814,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Returns the classic theme supports settings for block editor.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.2.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.6.0 Add support for 'editor-spacing-sizes' theme support.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array The classic theme supports settings.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -844,5 +845,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_settings['gradients'] = $gradient_presets;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $spacing_sizes = current( (array) get_theme_support( 'editor-spacing-sizes' ) );
+ if ( false !== $spacing_sizes ) {
+ $theme_settings['spacingSizes'] = $spacing_sizes;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $theme_settings;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpthemejsondataphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-theme-json-data.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-theme-json-data.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/src/wp-includes/class-wp-theme-json-data.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $data Array following the theme.json specification.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $origin The origin of the data: default, theme, user.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct( $data = array(), $origin = 'theme' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct( $data = array( 'version' => WP_Theme_JSON::LATEST_SCHEMA ), $origin = 'theme' ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->origin = $origin;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->theme_json = new WP_Theme_JSON( $data, $this->origin );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpthemejsonresolverphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-theme-json-resolver.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-theme-json-resolver.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/src/wp-includes/class-wp-theme-json-resolver.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,6 +220,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.8.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.9.0 Theme supports have been inlined and the `$theme_support_data` argument removed.
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.0.0 Added an `$options` parameter to allow the theme data to be returned without theme supports.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.6.0 Add support for 'default-font-sizes' and 'default-spacing-sizes' theme supports.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $deprecated Deprecated. Not used.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $options {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,7 +244,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json_data = static::read_json_file( $theme_json_file );
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json_data = static::translate( $theme_json_data, $wp_theme->get( 'TextDomain' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $theme_json_data = array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $theme_json_data = array( 'version' => WP_Theme_JSON::LATEST_SCHEMA );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,6 +311,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_support_data['settings']['color']['defaultGradients'] = $default_gradients;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! isset( $theme_support_data['settings']['typography'] ) ) {
+ $theme_support_data['settings']['typography'] = array();
+ }
+ $default_font_sizes = false;
+ if ( current_theme_supports( 'default-font-sizes' ) ) {
+ $default_font_sizes = true;
+ }
+ if ( ! isset( $theme_support_data['settings']['typography']['fontSizes'] ) ) {
+ // If the theme does not have any font sizes, we still want to show the core one.
+ $default_font_sizes = true;
+ }
+ $theme_support_data['settings']['typography']['defaultFontSizes'] = $default_font_sizes;
+
+ if ( ! isset( $theme_support_data['settings']['spacing'] ) ) {
+ $theme_support_data['settings']['spacing'] = array();
+ }
+ $default_spacing_sizes = false;
+ if ( current_theme_supports( 'default-spacing-sizes' ) ) {
+ $default_spacing_sizes = true;
+ }
+ if ( ! isset( $theme_support_data['settings']['spacing']['spacingSizes'] ) ) {
+ // If the theme does not have any spacing sizes, we still want to show the core one.
+ $default_spacing_sizes = true;
+ }
+ $theme_support_data['settings']['spacing']['defaultSpacingSizes'] = $default_spacing_sizes;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $theme_support_data['settings']['shadow'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_support_data['settings']['shadow'] = array();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -359,7 +386,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return static::$blocks;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $config = array( 'version' => 2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $config = array( 'version' => WP_Theme_JSON::LATEST_SCHEMA );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $blocks as $block_name => $block_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $block_type->supports['__experimentalStyle'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $config['styles']['blocks'][ $block_name ] = static::remove_json_comments( $block_type->supports['__experimentalStyle'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -494,6 +521,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Returns the user's origin config.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.9.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.6.0 The 'isGlobalStylesUserThemeJSON' flag is left on the user data.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return WP_Theme_JSON Entity that holds styles for user data.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -531,15 +559,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> isset( $decoded_data['isGlobalStylesUserThemeJSON'] ) &&
</span><span class="cx" style="display: block; padding: 0 10px"> $decoded_data['isGlobalStylesUserThemeJSON']
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- unset( $decoded_data['isGlobalStylesUserThemeJSON'] );
</del><span class="cx" style="display: block; padding: 0 10px"> $config = $decoded_data;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/class-wp-theme-json-resolver.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) );
- static::$user = $theme_json->get_theme_json();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) );
+ $config = $theme_json->get_data();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Needs to be set for schema migrations of user data.
+ $config['isGlobalStylesUserThemeJSON'] = true;
+
+ static::$user = new WP_Theme_JSON( $config, 'custom' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return static::$user;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -586,7 +618,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = new WP_Theme_JSON();
</span><span class="cx" style="display: block; padding: 0 10px"> $result->merge( static::get_core_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'default' === $origin ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $result->set_spacing_sizes();
</del><span class="cx" style="display: block; padding: 0 10px"> return $result;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -597,12 +628,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result->merge( static::get_theme_data() );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'theme' === $origin ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $result->set_spacing_sizes();
</del><span class="cx" style="display: block; padding: 0 10px"> return $result;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $result->merge( static::get_user_data() );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $result->set_spacing_sizes();
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $result;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpthemejsonschemaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-theme-json-schema.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-theme-json-schema.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/src/wp-includes/class-wp-theme-json-schema.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,6 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Function that migrates a given theme.json structure to the last version.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.9.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.6.0 Migrate up to v3.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $theme_json The structure to migrate.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,8 +48,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 1 === $theme_json['version'] ) {
- $theme_json = self::migrate_v1_to_v2( $theme_json );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Migrate each version in order starting with the current version.
+ switch ( $theme_json['version'] ) {
+ case 1:
+ $theme_json = self::migrate_v1_to_v2( $theme_json );
+ // no break
+ case 2:
+ $theme_json = self::migrate_v2_to_v3( $theme_json );
+ // no break
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $theme_json;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,6 +92,88 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Migrates from v2 to v3.
+ *
+ * - Sets settings.typography.defaultFontSizes to false.
+ *
+ * @since 6.6.0
+ *
+ * @param array $old Data to migrate.
+ *
+ * @return array Data with defaultFontSizes set to false.
+ */
+ private static function migrate_v2_to_v3( $old ) {
+ // Copy everything.
+ $new = $old;
+
+ // Set the new version.
+ $new['version'] = 3;
+
+ /*
+ * Remaining changes do not need to be applied to the custom origin,
+ * as they should take on the value of the theme origin.
+ */
+ if (
+ isset( $new['isGlobalStylesUserThemeJSON'] ) &&
+ true === $new['isGlobalStylesUserThemeJSON']
+ ) {
+ return $new;
+ }
+
+ /*
+ * Even though defaultFontSizes and defaultSpacingSizes are new
+ * settings, we need to migrate them as they each control
+ * PRESETS_METADATA prevent_override values which were previously
+ * hardcoded to false. This only needs to happen when the theme provides
+ * fontSizes or spacingSizes as they could match the default ones and
+ * affect the generated CSS.
+ */
+ if ( isset( $old['settings']['typography']['fontSizes'] ) ) {
+ if ( ! isset( $new['settings'] ) ) {
+ $new['settings'] = array();
+ }
+ if ( ! isset( $new['settings']['typography'] ) ) {
+ $new['settings']['typography'] = array();
+ }
+ $new['settings']['typography']['defaultFontSizes'] = false;
+ }
+
+ /*
+ * Similarly to defaultFontSizes, we need to migrate defaultSpacingSizes
+ * as it controls the PRESETS_METADATA prevent_override which was
+ * previously hardcoded to false. This only needs to happen when the
+ * theme provided spacing sizes via spacingSizes or spacingScale.
+ */
+ if (
+ isset( $old['settings']['spacing']['spacingSizes'] ) ||
+ isset( $old['settings']['spacing']['spacingScale'] )
+ ) {
+ if ( ! isset( $new['settings'] ) ) {
+ $new['settings'] = array();
+ }
+ if ( ! isset( $new['settings']['spacing'] ) ) {
+ $new['settings']['spacing'] = array();
+ }
+ $new['settings']['spacing']['defaultSpacingSizes'] = false;
+ }
+
+ /*
+ * In v3 spacingSizes is merged with the generated spacingScale sizes
+ * instead of completely replacing them. The v3 behavior is what was
+ * documented for the v2 schema, but the code never actually did work
+ * that way. Instead of surprising users with a behavior change two
+ * years after the fact at the same time as a v3 update is introduced,
+ * we'll continue using the "bugged" behavior for v2 themes. And treat
+ * the "bug fix" as a breaking change for v3.
+ */
+ if ( isset( $old['settings']['spacing']['spacingSizes'] ) ) {
+ unset( $new['settings']['spacing']['spacingScale'] );
+ }
+
+ return $new;
+ }
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Processes the settings subtree.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.9.0
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpthemejsonphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-theme-json.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-theme-json.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/src/wp-includes/class-wp-theme-json.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,7 +123,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * `prevent_override` value for `color.duotone` to use `color.defaultDuotone`.
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.2.0 Added 'shadow' presets.
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.3.0 Replaced value_func for duotone with `null`. Custom properties are handled by class-wp-duotone.php.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 6.6.0 Added the `dimensions.aspectRatios` & `dimensions.defaultAspectRatios` preset.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.6.0 Added the `dimensions.aspectRatios` and `dimensions.defaultAspectRatios` presets.
+ * Updated the 'prevent_override' value for font size presets to use 'typography.defaultFontSizes'
+ * and spacing size presets to use `spacing.defaultSpacingSizes`.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> const PRESETS_METADATA = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,7 +171,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'path' => array( 'typography', 'fontSizes' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'prevent_override' => false,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'prevent_override' => array( 'typography', 'defaultFontSizes' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'use_default_names' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'value_func' => 'wp_get_typography_font_size_value',
</span><span class="cx" style="display: block; padding: 0 10px"> 'css_vars' => '--wp--preset--font-size--$slug',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,7 +189,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'path' => array( 'spacing', 'spacingSizes' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'prevent_override' => false,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'prevent_override' => array( 'spacing', 'defaultSpacingSizes' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'use_default_names' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'value_key' => 'size',
</span><span class="cx" style="display: block; padding: 0 10px"> 'css_vars' => '--wp--preset--spacing--$slug',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -378,7 +380,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * `typography.writingMode`, `lightbox.enabled` and `lightbox.allowEditing`.
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.5.0 Added support for `layout.allowCustomContentAndWideSize`,
</span><span class="cx" style="display: block; padding: 0 10px"> * `background.backgroundSize` and `dimensions.aspectRatio`.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 6.6.0 Added support for `dimensions.aspectRatios` and `dimensions.defaultAspectRatios`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.6.0 Added support for 'dimensions.aspectRatios', 'dimensions.defaultAspectRatios',
+ * 'typography.defaultFontSizes', and 'spacing.defaultSpacingSizes'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> const VALID_SETTINGS = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -433,13 +436,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'sticky' => null,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'customSpacingSize' => null,
- 'spacingSizes' => null,
- 'spacingScale' => null,
- 'blockGap' => null,
- 'margin' => null,
- 'padding' => null,
- 'units' => null,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'customSpacingSize' => null,
+ 'defaultSpacingSizes' => null,
+ 'spacingSizes' => null,
+ 'spacingScale' => null,
+ 'blockGap' => null,
+ 'margin' => null,
+ 'padding' => null,
+ 'units' => null,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'shadow' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'presets' => null,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -446,20 +450,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'defaultPresets' => null,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'typography' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'fluid' => null,
- 'customFontSize' => null,
- 'dropCap' => null,
- 'fontFamilies' => null,
- 'fontSizes' => null,
- 'fontStyle' => null,
- 'fontWeight' => null,
- 'letterSpacing' => null,
- 'lineHeight' => null,
- 'textAlign' => null,
- 'textColumns' => null,
- 'textDecoration' => null,
- 'textTransform' => null,
- 'writingMode' => null,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'fluid' => null,
+ 'customFontSize' => null,
+ 'defaultFontSizes' => null,
+ 'dropCap' => null,
+ 'fontFamilies' => null,
+ 'fontSizes' => null,
+ 'fontStyle' => null,
+ 'fontWeight' => null,
+ 'letterSpacing' => null,
+ 'lineHeight' => null,
+ 'textAlign' => null,
+ 'textColumns' => null,
+ 'textDecoration' => null,
+ 'textTransform' => null,
+ 'writingMode' => null,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -728,20 +733,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.8.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.9.0 Changed value from 1 to 2.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.6.0 Changed value from 2 to 3.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- const LATEST_SCHEMA = 2;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const LATEST_SCHEMA = 3;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Constructor.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.8.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.6.0 Key spacingScale by origin, and Pre-generate the
+ * spacingSizes from spacingScale.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $theme_json A structure that follows the theme.json schema.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $origin Optional. What source of data this object represents.
</span><span class="cx" style="display: block; padding: 0 10px"> * One of 'default', 'theme', or 'custom'. Default 'theme'.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function __construct( $theme_json = array(), $origin = 'theme' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct( $theme_json = array( 'version' => WP_Theme_JSON::LATEST_SCHEMA ), $origin = 'theme' ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! in_array( $origin, static::VALID_ORIGINS, true ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $origin = 'theme';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -750,8 +758,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $valid_block_names = array_keys( static::get_blocks_metadata() );
</span><span class="cx" style="display: block; padding: 0 10px"> $valid_element_names = array_keys( static::ELEMENTS );
</span><span class="cx" style="display: block; padding: 0 10px"> $valid_variations = static::get_valid_block_style_variations();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $theme_json = static::sanitize( $this->theme_json, $valid_block_names, $valid_element_names, $valid_variations );
- $this->theme_json = static::maybe_opt_in_into_settings( $theme_json );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->theme_json = static::sanitize( $this->theme_json, $valid_block_names, $valid_element_names, $valid_variations );
+ $this->theme_json = static::maybe_opt_in_into_settings( $this->theme_json );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Internally, presets are keyed by origin.
</span><span class="cx" style="display: block; padding: 0 10px"> $nodes = static::get_setting_nodes( $this->theme_json );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -770,6 +778,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // In addition to presets, spacingScale (which generates presets) is also keyed by origin.
+ $scale_path = array( 'settings', 'spacing', 'spacingScale' );
+ $spacing_scale = _wp_array_get( $this->theme_json, $scale_path, null );
+ if ( null !== $spacing_scale ) {
+ // If the spacingScale is not already keyed by origin.
+ if ( empty( array_intersect( array_keys( $spacing_scale ), static::VALID_ORIGINS ) ) ) {
+ _wp_array_set( $this->theme_json, $scale_path, array( $origin => $spacing_scale ) );
+ }
+ }
+
+ // Pre-generate the spacingSizes from spacingScale.
+ $scale_path = array( 'settings', 'spacing', 'spacingScale', $origin );
+ $spacing_scale = _wp_array_get( $this->theme_json, $scale_path, null );
+ if ( isset( $spacing_scale ) ) {
+ $sizes_path = array( 'settings', 'spacing', 'spacingSizes', $origin );
+ $spacing_sizes = _wp_array_get( $this->theme_json, $sizes_path, array() );
+ $spacing_scale_sizes = static::compute_spacing_sizes( $spacing_scale );
+ $merged_spacing_sizes = static::merge_spacing_sizes( $spacing_scale_sizes, $spacing_sizes );
+ _wp_array_set( $this->theme_json, $sizes_path, $merged_spacing_sizes );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2916,6 +2945,40 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->theme_json = array_replace_recursive( $this->theme_json, $incoming_data );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Recompute all the spacing sizes based on the new hierarchy of data. In the constructor
+ * spacingScale and spacingSizes are both keyed by origin and VALID_ORIGINS is ordered, so
+ * we can allow partial spacingScale data to inherit missing data from earlier layers when
+ * computing the spacing sizes.
+ *
+ * This happens before the presets are merged to ensure that default spacing sizes can be
+ * removed from the theme origin if $prevent_override is true.
+ */
+ $flattened_spacing_scale = array();
+ foreach ( static::VALID_ORIGINS as $origin ) {
+ $scale_path = array( 'settings', 'spacing', 'spacingScale', $origin );
+
+ // Apply the base spacing scale to the current layer.
+ $base_spacing_scale = _wp_array_get( $this->theme_json, $scale_path, array() );
+ $flattened_spacing_scale = array_replace( $flattened_spacing_scale, $base_spacing_scale );
+
+ $spacing_scale = _wp_array_get( $incoming_data, $scale_path, null );
+ if ( ! isset( $spacing_scale ) ) {
+ continue;
+ }
+
+ // Allow partial scale settings by merging with lower layers.
+ $flattened_spacing_scale = array_replace( $flattened_spacing_scale, $spacing_scale );
+
+ // Generate and merge the scales for this layer.
+ $sizes_path = array( 'settings', 'spacing', 'spacingSizes', $origin );
+ $spacing_sizes = _wp_array_get( $incoming_data, $sizes_path, array() );
+ $spacing_scale_sizes = static::compute_spacing_sizes( $flattened_spacing_scale );
+ $merged_spacing_sizes = static::merge_spacing_sizes( $spacing_scale_sizes, $spacing_sizes );
+
+ _wp_array_set( $incoming_data, $sizes_path, $merged_spacing_sizes );
+ }
+
+ /*
</ins><span class="cx" style="display: block; padding: 0 10px"> * The array_replace_recursive algorithm merges at the leaf level,
</span><span class="cx" style="display: block; padding: 0 10px"> * but we don't want leaf arrays to be merged, so we overwrite it.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2951,12 +3014,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Replace the presets.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( static::PRESETS_METADATA as $preset ) {
- $override_preset = ! static::get_metadata_boolean( $this->theme_json['settings'], $preset['prevent_override'], true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( static::PRESETS_METADATA as $preset_metadata ) {
+ $prevent_override = $preset_metadata['prevent_override'];
+ if ( is_array( $prevent_override ) ) {
+ $prevent_override = _wp_array_get( $this->theme_json['settings'], $preset_metadata['prevent_override'] );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( static::VALID_ORIGINS as $origin ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $base_path = $node['path'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $preset['path'] as $leaf ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( $preset_metadata['path'] as $leaf ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $base_path[] = $leaf;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2968,7 +3034,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'theme' === $origin && $preset['use_default_names'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Set names for theme presets based on the slug if they are not set and can use default names.
+ if ( 'theme' === $origin && $preset_metadata['use_default_names'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $content as $key => $item ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $item['name'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $name = static::get_name_from_defaults( $item['slug'], $base_path );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2979,19 +3046,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (
- ( 'theme' !== $origin ) ||
- ( 'theme' === $origin && $override_preset )
- ) {
- _wp_array_set( $this->theme_json, $path, $content );
- } else {
- $slugs_node = static::get_default_slugs( $this->theme_json, $node['path'] );
- $slugs = array_merge_recursive( $slugs_global, $slugs_node );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Filter out default slugs from theme presets when defaults should not be overridden.
+ if ( 'theme' === $origin && $prevent_override ) {
+ $slugs_node = static::get_default_slugs( $this->theme_json, $node['path'] );
+ $preset_global = _wp_array_get( $slugs_global, $preset_metadata['path'], array() );
+ $preset_node = _wp_array_get( $slugs_node, $preset_metadata['path'], array() );
+ $preset_slugs = array_merge_recursive( $preset_global, $preset_node );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $slugs_for_preset = _wp_array_get( $slugs, $preset['path'], array() );
- $content = static::filter_slugs( $content, $slugs_for_preset );
- _wp_array_set( $this->theme_json, $path, $content );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = static::filter_slugs( $content, $preset_slugs );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ _wp_array_set( $this->theme_json, $path, $content );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3530,6 +3595,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_settings['settings']['spacing']['padding'] = $settings['enableCustomSpacing'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $settings['spacingSizes'] ) ) {
+ if ( ! isset( $theme_settings['settings']['spacing'] ) ) {
+ $theme_settings['settings']['spacing'] = array();
+ }
+ $theme_settings['settings']['spacing']['spacingSizes'] = $settings['spacingSizes'];
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $theme_settings;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3703,10 +3775,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Sets the spacingSizes array based on the spacingScale values from theme.json.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.1.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 6.6.0
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $origin Optional. What source of data to set the spacing sizes for.
+ * One of 'default', 'theme', or 'custom'. Default 'default'.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return null|void
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function set_spacing_sizes() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _deprecated_function( __METHOD__, '6.6.0' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $spacing_scale = isset( $this->theme_json['settings']['spacing']['spacingScale'] )
</span><span class="cx" style="display: block; padding: 0 10px"> ? $this->theme_json['settings']['spacing']['spacingScale']
</span><span class="cx" style="display: block; padding: 0 10px"> : array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3740,6 +3818,99 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $spacing_sizes = static::compute_spacing_sizes( $spacing_scale );
+
+ // If there are 7 or fewer steps in the scale revert to numbers for labels instead of t-shirt sizes.
+ if ( $spacing_scale['steps'] <= 7 ) {
+ for ( $spacing_sizes_count = 0; $spacing_sizes_count < count( $spacing_sizes ); $spacing_sizes_count++ ) {
+ $spacing_sizes[ $spacing_sizes_count ]['name'] = (string) ( $spacing_sizes_count + 1 );
+ }
+ }
+
+ _wp_array_set( $this->theme_json, array( 'settings', 'spacing', 'spacingSizes', 'default' ), $spacing_sizes );
+ }
+
+ /**
+ * Merges two sets of spacing size presets.
+ *
+ * @since 6.6.0
+ *
+ * @param array $base The base set of spacing sizes.
+ * @param array $incoming The set of spacing sizes to merge with the base. Duplicate slugs will override the base values.
+ * @return array The merged set of spacing sizes.
+ */
+ private static function merge_spacing_sizes( $base, $incoming ) {
+ // Preserve the order if there are no base (spacingScale) values.
+ if ( empty( $base ) ) {
+ return $incoming;
+ }
+ $merged = array();
+ foreach ( $base as $item ) {
+ $merged[ $item['slug'] ] = $item;
+ }
+ foreach ( $incoming as $item ) {
+ $merged[ $item['slug'] ] = $item;
+ }
+ ksort( $merged, SORT_NUMERIC );
+ return array_values( $merged );
+ }
+
+ /**
+ * Generates a set of spacing sizes by starting with a medium size and
+ * applying an operator with an increment value to generate the rest of the
+ * sizes outward from the medium size. The medium slug is '50' with the rest
+ * of the slugs being 10 apart. The generated names use t-shirt sizing.
+ *
+ * Example:
+ *
+ * $spacing_scale = array(
+ * 'steps' => 4,
+ * 'mediumStep' => 16,
+ * 'unit' => 'px',
+ * 'operator' => '+',
+ * 'increment' => 2,
+ * );
+ * $spacing_sizes = static::compute_spacing_sizes( $spacing_scale );
+ * // -> array(
+ * // array( 'name' => 'Small', 'slug' => '40', 'size' => '14px' ),
+ * // array( 'name' => 'Medium', 'slug' => '50', 'size' => '16px' ),
+ * // array( 'name' => 'Large', 'slug' => '60', 'size' => '18px' ),
+ * // array( 'name' => 'X-Large', 'slug' => '70', 'size' => '20px' ),
+ * // )
+ *
+ * @since 6.6.0
+ *
+ * @param array $spacing_scale {
+ * The spacing scale values. All are required.
+ *
+ * @type int $steps The number of steps in the scale. (up to 10 steps are supported.)
+ * @type float $mediumStep The middle value that gets the slug '50'. (For even number of steps, this becomes the first middle value.)
+ * @type string $unit The CSS unit to use for the sizes.
+ * @type string $operator The mathematical operator to apply to generate the other sizes. Either '+' or '*'.
+ * @type float $increment The value used with the operator to generate the other sizes.
+ * }
+ * @return array The spacing sizes presets or an empty array if some spacing scale values are missing or invalid.
+ */
+ private static function compute_spacing_sizes( $spacing_scale ) {
+ /*
+ * This condition is intentionally missing some checks on ranges for the values in order to
+ * keep backwards compatibility with the previous implementation.
+ */
+ if (
+ ! isset( $spacing_scale['steps'] ) ||
+ ! is_numeric( $spacing_scale['steps'] ) ||
+ 0 === $spacing_scale['steps'] ||
+ ! isset( $spacing_scale['mediumStep'] ) ||
+ ! is_numeric( $spacing_scale['mediumStep'] ) ||
+ ! isset( $spacing_scale['unit'] ) ||
+ ! isset( $spacing_scale['operator'] ) ||
+ ( '+' !== $spacing_scale['operator'] && '*' !== $spacing_scale['operator'] ) ||
+ ! isset( $spacing_scale['increment'] ) ||
+ ! is_numeric( $spacing_scale['increment'] )
+ ) {
+ return array();
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $unit = '%' === $spacing_scale['unit'] ? '%' : sanitize_title( $spacing_scale['unit'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $current_step = $spacing_scale['mediumStep'];
</span><span class="cx" style="display: block; padding: 0 10px"> $steps_mid_point = round( $spacing_scale['steps'] / 2, 0 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3822,14 +3993,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $spacing_sizes[] = $above_sizes_item;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If there are 7 or fewer steps in the scale revert to numbers for labels instead of t-shirt sizes.
- if ( $spacing_scale['steps'] <= 7 ) {
- for ( $spacing_sizes_count = 0; $spacing_sizes_count < count( $spacing_sizes ); $spacing_sizes_count++ ) {
- $spacing_sizes[ $spacing_sizes_count ]['name'] = (string) ( $spacing_sizes_count + 1 );
- }
- }
-
- _wp_array_set( $this->theme_json, array( 'settings', 'spacing', 'spacingSizes', 'default' ), $spacing_sizes );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $spacing_sizes;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestfontfacescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-faces-controller.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,7 +18,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- const LATEST_THEME_JSON_VERSION_SUPPORTED = 2;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const LATEST_THEME_JSON_VERSION_SUPPORTED = 3;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether the controller supports batching.
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestfontfamiliescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-families-controller.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- const LATEST_THEME_JSON_VERSION_SUPPORTED = 2;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const LATEST_THEME_JSON_VERSION_SUPPORTED = 3;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether the controller supports batching.
</span></span></pre></div>
<a id="trunksrcwpincludesthemejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/theme.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/src/wp-includes/theme.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "$schema": "https://schemas.wp.org/trunk/theme.json",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "appearanceTools": false,
</span><span class="cx" style="display: block; padding: 0 10px"> "useRootPaddingAwareAlignments": false,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -265,6 +265,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "margin": false,
</span><span class="cx" style="display: block; padding: 0 10px"> "padding": false,
</span><span class="cx" style="display: block; padding: 0 10px"> "customSpacingSize": true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "defaultSpacingSizes": true,
</ins><span class="cx" style="display: block; padding: 0 10px"> "units": [ "px", "em", "rem", "vh", "vw", "%" ],
</span><span class="cx" style="display: block; padding: 0 10px"> "spacingScale": {
</span><span class="cx" style="display: block; padding: 0 10px"> "operator": "*",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -276,6 +277,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "typography": {
</span><span class="cx" style="display: block; padding: 0 10px"> "customFontSize": true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "defaultFontSizes": true,
</ins><span class="cx" style="display: block; padding: 0 10px"> "dropCap": true,
</span><span class="cx" style="display: block; padding: 0 10px"> "fontSizes": [
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span></span></pre></div>
<a id="trunksrcwpincludesthemephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/theme.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/src/wp-includes/theme.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2642,6 +2642,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.3.0 The `border` feature allows themes without theme.json to add border styles to blocks.
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.5.0 The `appearance-tools` feature enables a few design tools for blocks,
</span><span class="cx" style="display: block; padding: 0 10px"> * see `WP_Theme_JSON::APPEARANCE_TOOLS_OPT_INS` for a complete list.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.6.0 The `editor-spacing-sizes` feature was added.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global array $_wp_theme_features
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2669,6 +2670,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * - 'editor-color-palette'
</span><span class="cx" style="display: block; padding: 0 10px"> * - 'editor-gradient-presets'
</span><span class="cx" style="display: block; padding: 0 10px"> * - 'editor-font-sizes'
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * - 'editor-spacing-sizes'
</ins><span class="cx" style="display: block; padding: 0 10px"> * - 'editor-styles'
</span><span class="cx" style="display: block; padding: 0 10px"> * - 'featured-content'
</span><span class="cx" style="display: block; padding: 0 10px"> * - 'html5'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4227,6 +4229,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> register_theme_feature(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'editor-spacing-sizes',
+ array(
+ 'type' => 'array',
+ 'description' => __( 'Custom spacing sizes if defined by the theme.' ),
+ 'show_in_rest' => array(
+ 'schema' => array(
+ 'items' => array(
+ 'type' => 'object',
+ 'properties' => array(
+ 'name' => array(
+ 'type' => 'string',
+ ),
+ 'size' => array(
+ 'type' => 'string',
+ ),
+ 'slug' => array(
+ 'type' => 'string',
+ ),
+ ),
+ ),
+ ),
+ ),
+ )
+ );
+ register_theme_feature(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'editor-styles',
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'description' => __( 'Whether theme opts in to the editor styles CSS wrapper.' ),
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemestylesvariationajson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme/styles/variation-a.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme/styles/variation-a.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme/styles/variation-a.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "blocks": {
</span><span class="cx" style="display: block; padding: 0 10px"> "core/paragraph": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemestylesvariationbjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme/styles/variation-b.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme/styles/variation-b.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme/styles/variation-b.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "blocks": {
</span><span class="cx" style="display: block; padding: 0 10px"> "core/post-title": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemestylesvariationjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme/styles/variation.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme/styles/variation.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme/styles/variation.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "title": "Block theme variation",
</span><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "color": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemethemejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme/theme.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme/theme.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "$schema": "https://schemas.wp.org/trunk/theme.json",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "title": "Block theme",
</span><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "color": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemechildstylesvariationajson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme-child/styles/variation-a.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-child/styles/variation-a.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme-child/styles/variation-a.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "blocks": {
</span><span class="cx" style="display: block; padding: 0 10px"> "core/paragraph": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemechildstylesvariationbjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme-child/styles/variation-b.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-child/styles/variation-b.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme-child/styles/variation-b.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "blocks": {
</span><span class="cx" style="display: block; padding: 0 10px"> "core/post-title": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemechildthemejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme-child/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-child/theme.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme-child/theme.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "$schema": "https://schemas.wp.org/trunk/theme.json",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "color": {
</span><span class="cx" style="display: block; padding: 0 10px"> "palette": [
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemechildwithfluidlayoutthemejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-layout/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-layout/theme.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-layout/theme.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "$schema": "https://schemas.wp.org/trunk/theme.json",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "appearanceTools": true,
</span><span class="cx" style="display: block; padding: 0 10px"> "layout": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemechildwithfluidtypographythemejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography/theme.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography/theme.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "$schema": "https://schemas.wp.org/trunk/theme.json",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "appearanceTools": true,
</span><span class="cx" style="display: block; padding: 0 10px"> "typography": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemechildwithfluidtypographyconfigthemejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography-config/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography-config/theme.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography-config/theme.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "$schema": "https://schemas.wp.org/trunk/theme.json",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "appearanceTools": true,
</span><span class="cx" style="display: block; padding: 0 10px"> "layout": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemedeprecatedpathstylesvariationjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/styles/variation.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/styles/variation.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme-deprecated-path/styles/variation.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,23 +1,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
- "settings": {
- "color": {
- "palette": [
- {
- "slug": "foreground",
- "color": "#3F67C6",
- "name": "Foreground"
- }
- ]
- }
- },
- "styles": {
- "blocks": {
- "core/post-title": {
- "typography": {
- "fontWeight": "700"
- }
- }
- }
- }
-}
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
+ "settings": {
+ "color": {
+ "palette": [
+ {
+ "slug": "foreground",
+ "color": "#3F67C6",
+ "name": "Foreground"
+ }
+ ]
+ }
+ },
+ "styles": {
+ "blocks": {
+ "core/post-title": {
+ "typography": {
+ "fontWeight": "700"
+ }
+ }
+ }
+ }
+}
</ins></span></pre></div>
<a id="trunktestsphpunitdatathemedir1blockthemewithhookedblocksthemejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/theme.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/theme.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "$schema": "https://schemas.wp.org/trunk/theme.json",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "templateParts": [
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "area": "header",
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1emptyfontfacethemethemejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/empty-fontface-theme/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/empty-fontface-theme/theme.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/empty-fontface-theme/theme.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,89 +1,79 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "$schema": "https://schemas.wp.org/trunk/theme.json",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
- "customTemplates": [
- {
- "name": "blank",
- "title": "Blank",
- "postTypes": [
- "page",
- "post"
- ]
- }
- ],
- "settings": {
- "appearanceTools": true,
- "color": {
- "duotone": [],
- "gradients": [],
- "palette": []
- },
- "custom": {},
- "spacing": {
- "units": [
- "%",
- "px",
- "em",
- "rem",
- "vh",
- "vw"
- ]
- },
- "typography": {
- "dropCap": false,
- "fontFamilies": [
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
+ "customTemplates": [
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "fontFamily": "Roboto",
- "name": "Roboto",
- "slug": "roboto",
- "fontFace": []
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "name": "blank",
+ "title": "Blank",
+ "postTypes": [ "page", "post" ]
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ],
- "fontSizes": [
- {
- "size": "1rem",
- "slug": "small"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ],
+ "settings": {
+ "appearanceTools": true,
+ "color": {
+ "duotone": [],
+ "gradients": [],
+ "palette": []
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {
- "size": "1.125rem",
- "slug": "medium"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "custom": {},
+ "spacing": {
+ "units": [ "%", "px", "em", "rem", "vh", "vw" ]
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {
- "size": "1.75rem",
- "slug": "large"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "typography": {
+ "dropCap": false,
+ "fontFamilies": [
+ {
+ "fontFamily": "Roboto",
+ "name": "Roboto",
+ "slug": "roboto",
+ "fontFace": []
+ }
+ ],
+ "fontSizes": [
+ {
+ "size": "1rem",
+ "slug": "small"
+ },
+ {
+ "size": "1.125rem",
+ "slug": "medium"
+ },
+ {
+ "size": "1.75rem",
+ "slug": "large"
+ },
+ {
+ "size": "clamp(1.75rem, 3vw, 2.25rem)",
+ "slug": "x-large"
+ }
+ ]
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {
- "size": "clamp(1.75rem, 3vw, 2.25rem)",
- "slug": "x-large"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "layout": {
+ "contentSize": "650px",
+ "wideSize": "1000px"
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ]
</del><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "layout": {
- "contentSize": "650px",
- "wideSize": "1000px"
- }
- },
- "styles": {
- "blocks": {},
- "color": {
- "background": "var(--wp--preset--color--background)",
- "text": "var(--wp--preset--color--foreground)"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "styles": {
+ "blocks": {},
+ "color": {
+ "background": "var(--wp--preset--color--background)",
+ "text": "var(--wp--preset--color--foreground)"
+ },
+ "elements": {},
+ "spacing": {
+ "blockGap": "1.5rem"
+ },
+ "typography": {
+ "fontFamily": "var(--wp--preset--font-family--system-font)",
+ "lineHeight": "var(--wp--custom--typography--line-height--normal)",
+ "fontSize": "var(--wp--preset--font-size--medium)"
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "elements": {},
- "spacing": {
- "blockGap": "1.5rem"
- },
- "typography": {
- "fontFamily": "var(--wp--preset--font-family--system-font)",
- "lineHeight": "var(--wp--custom--typography--line-height--normal)",
- "fontSize": "var(--wp--preset--font-size--medium)"
- }
- },
- "templateParts": [
- {
- "name": "header",
- "title": "Header",
- "area": "header"
- }
- ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "templateParts": [
+ {
+ "name": "header",
+ "title": "Header",
+ "area": "header"
+ }
+ ]
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1fontsblockthemestylesvariationduplicatefontsjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-duplicate-fonts.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-duplicate-fonts.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-duplicate-fonts.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "title": "Variation: duplicate fonts",
</span><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "typography": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1fontsblockthemestylesvariationnewfontfamilyjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-new-font-family.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-new-font-family.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-new-font-family.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "title": "Variation: new font family",
</span><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "typography": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1fontsblockthemestylesvariationnewfontvariationsjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-new-font-variations.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-new-font-variations.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-new-font-variations.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "title": "Variation: new font variations",
</span><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "typography": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1fontsblockthemestylesvariationnofontsjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-no-fonts.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-no-fonts.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/fonts-block-theme/styles/variation-no-fonts.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "title": "Variation - no fonts",
</span><span class="cx" style="display: block; padding: 0 10px"> "styles": {
</span><span class="cx" style="display: block; padding: 0 10px"> "typography": {
</span></span></pre></div>
<a id="trunktestsphpunitdatathemedir1fontsblockthemethemejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/themedir1/fonts-block-theme/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/themedir1/fonts-block-theme/theme.json 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/data/themedir1/fonts-block-theme/theme.json 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "$schema": "https://schemas.wp.org/trunk/theme.json",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "settings": {
</span><span class="cx" style="display: block; padding: 0 10px"> "appearanceTools": true,
</span><span class="cx" style="display: block; padding: 0 10px"> "color": {
</span></span></pre></div>
<a id="trunktestsphpunittestsfontsfontlibrarywpRestFontFacesControllerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/fonts/font-library/wpRestFontFacesController.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/fonts/font-library/wpRestFontFacesController.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/tests/fonts/font-library/wpRestFontFacesController.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -623,7 +623,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_create_item_invalid_theme_json_version() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 1 ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- array( 3 ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ array( 4 ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsfontsfontlibrarywpRestFontFamiliesControllerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/fonts/font-library/wpRestFontFamiliesController.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/fonts/font-library/wpRestFontFamiliesController.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/tests/fonts/font-library/wpRestFontFamiliesController.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -431,7 +431,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_create_item_invalid_theme_json_version() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> array( 1 ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- array( 3 ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ array( 4 ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestglobalstylescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-global-styles-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-global-styles-controller.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/tests/rest-api/rest-global-styles-controller.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $response->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'core/paragraph' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -171,7 +171,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'variation-a',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'core/post-title' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -216,7 +216,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'title' => 'Block theme variation',
</span><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestthemescontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -419,6 +419,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'editor-color-palette', $theme_supports );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'editor-font-sizes', $theme_supports );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'editor-gradient-presets', $theme_supports );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertArrayHasKey( 'editor-spacing-sizes', $theme_supports );
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'editor-styles', $theme_supports );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'formats', $theme_supports );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'html5', $theme_supports );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -426,7 +427,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'responsive-embeds', $theme_supports );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'title-tag', $theme_supports );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayHasKey( 'wp-block-styles', $theme_supports );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertCount( 23, $theme_supports, 'There should be 23 theme supports' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertCount( 24, $theme_supports, 'There should be 23 theme supports' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststhemewpThemeJsonphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/theme/wpThemeJson.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/wpThemeJson.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/tests/theme/wpThemeJson.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3300,7 +3300,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_export_data() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'palette' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3321,7 +3321,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'palette' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3345,7 +3345,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $theme->merge( $user );
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $theme->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'palette' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3378,7 +3378,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_export_data_deals_with_empty_user_data() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'palette' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3400,7 +3400,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $theme->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'palette' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3428,7 +3428,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_export_data_deals_with_empty_theme_data() {
</span><span class="cx" style="display: block; padding: 0 10px"> $user = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'palette' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3451,7 +3451,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $user->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'palette' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3477,25 +3477,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 55505
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_export_data_deals_with_empty_data() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $theme_v2 = new WP_Theme_JSON(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $theme = new WP_Theme_JSON(
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'theme'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $actual_v2 = $theme_v2->get_data();
- $expected_v2 = array( 'version' => 2 );
- $this->assertEqualSetsWithIndex( $expected_v2, $actual_v2 );
-
- $theme_v1 = new WP_Theme_JSON(
- array(
- 'version' => 1,
- ),
- 'theme'
- );
- $actual_v1 = $theme_v1->get_data();
- $expected_v1 = array( 'version' => 2 );
- $this->assertEqualSetsWithIndex( $expected_v1, $actual_v1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $actual = $theme->get_data();
+ $expected = array( 'version' => WP_Theme_JSON::LATEST_SCHEMA );
+ $this->assertEqualSetsWithIndex( $expected, $actual );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3504,7 +3494,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_export_data_sets_appearance_tools() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'appearanceTools' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3518,7 +3508,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $theme->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'appearanceTools' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3538,7 +3528,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_export_data_sets_use_root_padding_aware_alignments() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'useRootPaddingAwareAlignments' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3552,7 +3542,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $theme->get_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'useRootPaddingAwareAlignments' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3644,7 +3634,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_property_value_valid() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'background' => '#ffffff',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3729,7 +3719,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_property_value_loop() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'background' => '#ffffff',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3767,7 +3757,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_property_value_recursion() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'background' => '#ffffff',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3804,7 +3794,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_property_value_self() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'color' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'background' => '#ffffff',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3830,7 +3820,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_styles_for_block_with_padding_aware_alignments() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'padding' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3867,7 +3857,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_styles_for_block_without_padding_aware_alignments() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'padding' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3900,7 +3890,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_styles_for_block_with_content_width() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'layout' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'contentSize' => '800px',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3931,7 +3921,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_styles_with_appearance_tools() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'appearanceTools' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3954,7 +3944,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitization() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blockGap' => 'valid value',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3973,7 +3963,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $actual = $theme_json->get_raw_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blockGap' => 'valid value',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3997,7 +3987,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_for_unregistered_style_variations() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'core/quote' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4021,7 +4011,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sanitized_theme_json = $theme_json->get_raw_data();
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'core/quote' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4050,7 +4040,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_for_block_with_style_variations( $theme_json_variations, $expected_sanitized ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'core/quote' => $theme_json_variations,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4134,7 +4124,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_indexed_arrays() {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => '2',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'badKey2' => 'I am Evil!',
</span><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'badKey3' => 'I am Evil!',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4202,7 +4192,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected_sanitized = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => '2',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'typography' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'fontFamilies' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4271,7 +4261,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_sanitize_with_invalid_style_variation( $theme_json_variations ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'core/quote' => $theme_json_variations,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4319,7 +4309,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_styles_for_block_with_style_variations( $theme_json_variations, $metadata_variations, $expected ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'styles' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'core/quote' => $theme_json_variations,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4473,16 +4463,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_spacing_sizes( $spacing_scale, $expected_output ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacingScale' => $spacing_scale,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ),
+ 'default'
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $theme_json->set_spacing_sizes();
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected_output, _wp_array_get( $theme_json->get_raw_data(), array( 'settings', 'spacing', 'spacingSizes', 'default' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4505,7 +4495,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Medium',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '50',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '4rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4521,12 +4511,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Medium',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '50',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '4rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '2',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '60',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '5.5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4542,17 +4532,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Small',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '40',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '2.5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '2',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Medium',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '50',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '4rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '3',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '60',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '5.5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4568,22 +4558,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Small',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '40',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '2.5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '2',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Medium',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '50',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '4rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '3',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '60',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '5.5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '4',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'X-Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '70',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '7rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4599,27 +4589,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Small',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '40',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '2.5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '2',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Medium',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '50',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '3',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '60',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '7.5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '4',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'X-Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '70',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '10rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '5',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => '2X-Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '80',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '12.5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4635,27 +4625,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'X-Small',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '30',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '0.67rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '2',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Small',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '40',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '1rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '3',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Medium',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '50',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '1.5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '4',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '60',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '2.25rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '5',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'X-Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '70',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '3.38rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4671,27 +4661,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '1',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'X-Small',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '30',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '0.09rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '2',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Small',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '40',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '0.38rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '3',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Medium',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '50',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '1.5rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '4',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '60',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '6rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => '5',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => 'X-Large',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'slug' => '70',
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '24rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4762,33 +4752,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $expected_output Expected output from data provider.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_spacing_sizes_when_invalid( $spacing_scale, $expected_output ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->expectException( Exception::class );
- $this->expectExceptionMessage( 'Some of the theme.json settings.spacing.spacingScale values are invalid' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $theme_json = new WP_Theme_JSON(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'version' => 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'settings' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacingScale' => $spacing_scale,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ),
+ 'default'
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Ensure PHPUnit 10 compatibility.
- set_error_handler(
- static function ( $errno, $errstr ) {
- restore_error_handler();
- throw new Exception( $errstr, $errno );
- },
- E_ALL
- );
-
- $theme_json->set_spacing_sizes();
-
- restore_error_handler();
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected_output, _wp_array_get( $theme_json->get_raw_data(), array( 'settings', 'spacing', 'spacingSizes', 'default' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4809,7 +4784,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'mediumStep' => 4,
</span><span class="cx" style="display: block; padding: 0 10px"> 'unit' => 'rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => null,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => array(),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'non numeric increment' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing_scale' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4819,7 +4794,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'mediumStep' => 4,
</span><span class="cx" style="display: block; padding: 0 10px"> 'unit' => 'rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => null,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => array(),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'non numeric steps' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing_scale' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4829,7 +4804,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'mediumStep' => 4,
</span><span class="cx" style="display: block; padding: 0 10px"> 'unit' => 'rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => null,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => array(),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'non numeric medium step' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing_scale' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4839,7 +4814,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'mediumStep' => 'That which is just right',
</span><span class="cx" style="display: block; padding: 0 10px"> 'unit' => 'rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => null,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => array(),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'missing unit value' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'spacing_scale' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4848,7 +4823,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'steps' => 5,
</span><span class="cx" style="display: block; padding: 0 10px"> 'mediumStep' => 4,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => null,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => array(),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunitteststhemewpThemeJsonSchemaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/theme/wpThemeJsonSchema.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/wpThemeJsonSchema.php 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/phpunit/tests/theme/wpThemeJsonSchema.php 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,6 +41,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'typography' => array(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'fontSizes' => array(
+ array(
+ 'name' => 'Small',
+ 'slug' => 'small',
+ 'size' => 12,
+ ),
+ array(
+ 'name' => 'Normal',
+ 'slug' => 'normal',
+ 'size' => 16,
+ ),
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'fontStyle' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> 'fontWeight' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> 'letterSpacing' => false,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,11 +138,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'width' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'typography' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'fontStyle' => false,
- 'fontWeight' => false,
- 'letterSpacing' => false,
- 'textDecoration' => false,
- 'textTransform' => false,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'defaultFontSizes' => false,
+ 'fontSizes' => array(
+ array(
+ 'name' => 'Small',
+ 'slug' => 'small',
+ 'size' => 12,
+ ),
+ array(
+ 'name' => 'Normal',
+ 'slug' => 'normal',
+ 'size' => 16,
+ ),
+ ),
+ 'fontStyle' => false,
+ 'fontWeight' => false,
+ 'letterSpacing' => false,
+ 'textDecoration' => false,
+ 'textTransform' => false,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'blocks' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'core/group' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -185,4 +210,80 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEqualSetsWithIndex( $expected, $actual );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ public function test_migrate_v2_to_latest() {
+ $theme_json_v2 = array(
+ 'version' => 2,
+ 'settings' => array(
+ 'typography' => array(
+ 'fontSizes' => array(
+ array(
+ 'name' => 'Small',
+ 'slug' => 'small',
+ 'size' => 12,
+ ),
+ array(
+ 'name' => 'Normal',
+ 'slug' => 'normal',
+ 'size' => 16,
+ ),
+ ),
+ ),
+ 'spacing' => array(
+ 'spacingSizes' => array(
+ array(
+ 'name' => 'Small',
+ 'slug' => 20,
+ 'size' => '20px',
+ ),
+ array(
+ 'name' => 'Large',
+ 'slug' => 80,
+ 'size' => '80px',
+ ),
+ ),
+ ),
+ ),
+ );
+
+ $actual = WP_Theme_JSON_Schema::migrate( $theme_json_v2 );
+
+ $expected = array(
+ 'version' => WP_Theme_JSON::LATEST_SCHEMA,
+ 'settings' => array(
+ 'typography' => array(
+ 'defaultFontSizes' => false,
+ 'fontSizes' => array(
+ array(
+ 'name' => 'Small',
+ 'slug' => 'small',
+ 'size' => 12,
+ ),
+ array(
+ 'name' => 'Normal',
+ 'slug' => 'normal',
+ 'size' => 16,
+ ),
+ ),
+ ),
+ 'spacing' => array(
+ 'defaultSpacingSizes' => false,
+ 'spacingSizes' => array(
+ array(
+ 'name' => 'Small',
+ 'slug' => 20,
+ 'size' => '20px',
+ ),
+ array(
+ 'name' => 'Large',
+ 'slug' => 80,
+ 'size' => '80px',
+ ),
+ ),
+ ),
+ ),
+ );
+
+ $this->assertEqualSetsWithIndex( $expected, $actual );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsqunitfixtureswpapigeneratedjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/qunit/fixtures/wp-api-generated.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/qunit/fixtures/wp-api-generated.js 2024-06-04 10:59:01 UTC (rev 58327)
+++ trunk/tests/qunit/fixtures/wp-api-generated.js 2024-06-04 11:53:37 UTC (rev 58328)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7855,9 +7855,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "theme_json_version": {
</span><span class="cx" style="display: block; padding: 0 10px"> "description": "Version of the theme.json schema used for the typography settings.",
</span><span class="cx" style="display: block; padding: 0 10px"> "type": "integer",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "default": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "default": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "minimum": 2,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "maximum": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "maximum": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "required": false
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "font_family_settings": {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7924,9 +7924,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "theme_json_version": {
</span><span class="cx" style="display: block; padding: 0 10px"> "description": "Version of the theme.json schema used for the typography settings.",
</span><span class="cx" style="display: block; padding: 0 10px"> "type": "integer",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "default": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "default": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "minimum": 2,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "maximum": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "maximum": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "required": false
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "font_family_settings": {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8057,9 +8057,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "theme_json_version": {
</span><span class="cx" style="display: block; padding: 0 10px"> "description": "Version of the theme.json schema used for the typography settings.",
</span><span class="cx" style="display: block; padding: 0 10px"> "type": "integer",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "default": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "default": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "minimum": 2,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "maximum": 2,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "maximum": 3,
</ins><span class="cx" style="display: block; padding: 0 10px"> "required": false
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "font_face_settings": {
</span></span></pre>
</div>
</div>
</body>
</html>