<!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>[50959] trunk: Block Editor: Add Global Settings support using theme.json file.</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/50959">50959</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/50959","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>youknowriad</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-05-24 08:36:11 +0000 (Mon, 24 May 2021)</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'>Block Editor: Add Global Settings support using theme.json file.

This is the first piece of landing the theme.json processing in WordPress core. 
It allows themes to configure the different editor settings, allow cusomizations and define presets in theme.json file.
 
Props jorgefilipecosta, nosolosw.
See <a href="https://core.trac.wordpress.org/ticket/53175">#53175</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesblockeditorphp">trunk/src/wp-includes/block-editor.php</a></li>
<li><a href="#trunksrcwpsettingsphp">trunk/src/wp-settings.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswpthemejsonresolverphp">trunk/src/wp-includes/class-wp-theme-json-resolver.php</a></li>
<li><a href="#trunksrcwpincludesclasswpthemejsonphp">trunk/src/wp-includes/class-wp-theme-json.php</a></li>
<li><a href="#trunksrcwpincludesthemei18njson">trunk/src/wp-includes/theme-i18n.json</a></li>
<li><a href="#trunksrcwpincludesthemejson">trunk/src/wp-includes/theme.json</a></li>
<li><a href="#trunktestsphpunittestsblocksclasswpthemejsonresolvertestphp">trunk/tests/phpunit/tests/blocks/class-wp-theme-json-resolver-test.php</a></li>
<li><a href="#trunktestsphpunittestsblocksclasswpthemejsontestphp">trunk/tests/phpunit/tests/blocks/class-wp-theme-json-test.php</a></li>
<li>trunk/tests/phpunit/tests/blocks/data/</li>
<li>trunk/tests/phpunit/tests/blocks/data/languages/</li>
<li>trunk/tests/phpunit/tests/blocks/data/languages/themes/</li>
<li><a href="#trunktestsphpunittestsblocksdatalanguagesthemesfsepl_PLpo">trunk/tests/phpunit/tests/blocks/data/languages/themes/fse-pl_PL.po</a></li>
<li>trunk/tests/phpunit/tests/blocks/data/themedir1/</li>
<li>trunk/tests/phpunit/tests/blocks/data/themedir1/fse/</li>
<li><a href="#trunktestsphpunittestsblocksdatathemedir1fsestylecss">trunk/tests/phpunit/tests/blocks/data/themedir1/fse/style.css</a></li>
<li><a href="#trunktestsphpunittestsblocksdatathemedir1fsethemejson">trunk/tests/phpunit/tests/blocks/data/themedir1/fse/theme.json</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    2021-05-24 08:29:03 UTC (rev 50958)
+++ trunk/src/wp-includes/block-editor.php      2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,6 +243,50 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $custom_settings
</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">+        $editor_settings['__experimentalFeatures'] = WP_Theme_JSON_Resolver::get_merged_data( $editor_settings )->get_settings();
+
+       // These settings may need to be updated based on data coming from theme.json sources.
+       if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) {
+               $editor_settings['colors'] = $editor_settings['__experimentalFeatures']['color']['palette'];
+               unset( $editor_settings['__experimentalFeatures']['color']['palette'] );
+       }
+       if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) {
+               $editor_settings['gradients'] = $editor_settings['__experimentalFeatures']['color']['gradients'];
+               unset( $editor_settings['__experimentalFeatures']['color']['gradients'] );
+       }
+       if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) {
+               $editor_settings['disableCustomColors'] = $editor_settings['__experimentalFeatures']['color']['custom'];
+               unset( $editor_settings['__experimentalFeatures']['color']['custom'] );
+       }
+       if ( isset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ) ) {
+               $editor_settings['disableCustomGradients'] = $editor_settings['__experimentalFeatures']['color']['customGradient'];
+               unset( $editor_settings['__experimentalFeatures']['color']['customGradient'] );
+       }
+       if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) {
+               $editor_settings['fontSizes'] = $editor_settings['__experimentalFeatures']['typography']['fontSizes'];
+               unset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] );
+       }
+       if ( isset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ) ) {
+               $editor_settings['disableCustomFontSizes'] = $editor_settings['__experimentalFeatures']['typography']['customFontSize'];
+               unset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] );
+       }
+       if ( isset( $editor_settings['__experimentalFeatures']['typography']['customLineHeight'] ) ) {
+               $editor_settings['enableCustomLineHeight'] = $editor_settings['__experimentalFeatures']['typography']['customLineHeight'];
+               unset( $editor_settings['__experimentalFeatures']['typography']['customLineHeight'] );
+       }
+       if ( isset( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) {
+               if ( ! is_array( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) {
+                       $editor_settings['enableCustomUnits'] = false;
+               } else {
+                       $editor_settings['enableCustomUnits'] = count( $editor_settings['__experimentalFeatures']['spacing']['units'] ) > 0;
+               }
+               unset( $editor_settings['__experimentalFeatures']['spacing']['units'] );
+       }
+       if ( isset( $editor_settings['__experimentalFeatures']['spacing']['customPadding'] ) ) {
+               $editor_settings['enableCustomSpacing'] = $editor_settings['__experimentalFeatures']['spacing']['customPadding'];
+               unset( $editor_settings['__experimentalFeatures']['spacing']['customPadding'] );
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Filters the settings to pass to the block editor for all editor type.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpthemejsonresolverphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: 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                            (rev 0)
+++ trunk/src/wp-includes/class-wp-theme-json-resolver.php      2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,362 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Process the different data sources for site-level
+ * config and offers and API to work with them.
+ *
+ * @package WordPress
+ */
+
+/**
+ * Class that abstracts the processing
+ * of the different data sources.
+ *
+ * @access private
+ */
+class WP_Theme_JSON_Resolver {
+
+       /**
+        * Container for data coming from core.
+        *
+        * @var WP_Theme_JSON
+        */
+       private static $core = null;
+
+       /**
+        * Container for data coming from the theme.
+        *
+        * @var WP_Theme_JSON
+        */
+       private static $theme = null;
+
+       /**
+        * Whether or not the theme supports theme.json.
+        *
+        * @var boolean
+        */
+       private static $theme_has_support = null;
+
+       /**
+        * Structure to hold i18n metadata.
+        *
+        * @var Array
+        */
+       private static $theme_json_i18n = null;
+
+       /**
+        * Processes a file that adheres to the theme.json
+        * schema and returns an array with its contents,
+        * or a void array if none found.
+        *
+        * @param string $file_path Path to file. Empty if no file.
+        *
+        * @return array Contents that adhere to the theme.json schema.
+        */
+       private static function read_json_file( $file_path ) {
+               $config = array();
+               if ( $file_path ) {
+                       $decoded_file = json_decode(
+                               file_get_contents( $file_path ),
+                               true
+                       );
+
+                       $json_decoding_error = json_last_error();
+                       if ( JSON_ERROR_NONE !== $json_decoding_error ) {
+                               error_log( 'Error when decoding file schema: ' . json_last_error_msg() );
+                               return $config;
+                       }
+
+                       if ( is_array( $decoded_file ) ) {
+                               $config = $decoded_file;
+                       }
+               }
+               return $config;
+       }
+
+       /**
+        * Converts a tree as in i18n-theme.json into a linear array
+        * containing metadata to translate a theme.json file.
+        *
+        * For example, given this input:
+        *
+        * {
+        *   "settings": {
+        *     "*": {
+        *       "typography": {
+        *         "fontSizes": [ { "name": "Font size name" } ],
+        *         "fontStyles": [ { "name": "Font size name" } ]
+        *       }
+        *     }
+        *   }
+        * }
+        *
+        * will return this output:
+        *
+        * [
+        *   0 => [
+        *     'path'    => [ 'settings', '*', 'typography', 'fontSizes' ],
+        *     'key'     => 'name',
+        *     'context' => 'Font size name'
+        *   ],
+        *   1 => [
+        *     'path'    => [ 'settings', '*', 'typography', 'fontStyles' ],
+        *     'key'     => 'name',
+        *     'context' => 'Font style name'
+        *   ]
+        * ]
+        *
+        * @param array $i18n_partial A tree that follows the format of i18n-theme.json.
+        * @param array $current_path Keeps track of the path as we walk down the given tree.
+        *
+        * @return array A linear array containing the paths to translate.
+        */
+       private static function extract_paths_to_translate( $i18n_partial, $current_path = array() ) {
+               $result = array();
+               foreach ( $i18n_partial as $property => $partial_child ) {
+                       if ( is_numeric( $property ) ) {
+                               foreach ( $partial_child as $key => $context ) {
+                                       return array(
+                                               array(
+                                                       'path'    => $current_path,
+                                                       'key'     => $key,
+                                                       'context' => $context,
+                                               ),
+                                       );
+                               }
+                       }
+                       $result = array_merge(
+                               $result,
+                               self::extract_paths_to_translate( $partial_child, array_merge( $current_path, array( $property ) ) )
+                       );
+               }
+               return $result;
+       }
+
+       /**
+        * Returns a data structure used in theme.json translation.
+        *
+        * @return array An array of theme.json fields that are translatable and the keys that are translatable
+        */
+       public static function get_fields_to_translate() {
+               if ( null === self::$theme_json_i18n ) {
+                       $file_structure        = self::read_json_file( __DIR__ . '/theme-i18n.json' );
+                       self::$theme_json_i18n = self::extract_paths_to_translate( $file_structure );
+               }
+               return self::$theme_json_i18n;
+       }
+
+       /**
+        * Translates a chunk of the loaded theme.json structure.
+        *
+        * @param array  $array_to_translate The chunk of theme.json to translate.
+        * @param string $key                The key of the field that contains the string to translate.
+        * @param string $context            The context to apply in the translation call.
+        * @param string $domain             Text domain. Unique identifier for retrieving translated strings.
+        *
+        * @return array Returns the modified $theme_json chunk.
+        */
+       private static function translate_theme_json_chunk( array $array_to_translate, $key, $context, $domain ) {
+               foreach ( $array_to_translate as $item_key => $item_to_translate ) {
+                       if ( empty( $item_to_translate[ $key ] ) ) {
+                               continue;
+                       }
+
+                       // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralContext,WordPress.WP.I18n.NonSingularStringLiteralDomain
+                       $array_to_translate[ $item_key ][ $key ] = translate_with_gettext_context( $array_to_translate[ $item_key ][ $key ], $context, $domain );
+               }
+
+               return $array_to_translate;
+       }
+
+       /**
+        * Given a theme.json structure modifies it in place
+        * to update certain values by its translated strings
+        * according to the language set by the user.
+        *
+        * @param array  $theme_json The theme.json to translate.
+        * @param string $domain    Optional. Text domain. Unique identifier for retrieving translated strings.
+        *                          Default 'default'.
+        *
+        * @return array Returns the modified $theme_json_structure.
+        */
+       private static function translate( $theme_json, $domain = 'default' ) {
+               $fields = self::get_fields_to_translate();
+               foreach ( $fields as $field ) {
+                       $path    = $field['path'];
+                       $key     = $field['key'];
+                       $context = $field['context'];
+
+                       /*
+                        * We need to process the paths that include '*' separately.
+                        * One example of such a path would be:
+                        * [ 'settings', 'blocks', '*', 'color', 'palette' ]
+                        */
+                       $nodes_to_iterate = array_keys( $path, '*', true );
+                       if ( ! empty( $nodes_to_iterate ) ) {
+                               /*
+                                * At the moment, we only need to support one '*' in the path, so take it directly.
+                                * - base will be [ 'settings', 'blocks' ]
+                                * - data will be [ 'color', 'palette' ]
+                                */
+                               $base_path = array_slice( $path, 0, $nodes_to_iterate[0] );
+                               $data_path = array_slice( $path, $nodes_to_iterate[0] + 1 );
+                               $base_tree = _wp_array_get( $theme_json, $base_path, array() );
+                               foreach ( $base_tree as $node_name => $node_data ) {
+                                       $array_to_translate = _wp_array_get( $node_data, $data_path, null );
+                                       if ( is_null( $array_to_translate ) ) {
+                                               continue;
+                                       }
+
+                                       // Whole path will be [ 'settings', 'blocks', 'core/paragraph', 'color', 'palette' ].
+                                       $whole_path       = array_merge( $base_path, array( $node_name ), $data_path );
+                                       $translated_array = self::translate_theme_json_chunk( $array_to_translate, $key, $context, $domain );
+                                       _wp_array_set( $theme_json, $whole_path, $translated_array );
+                               }
+                       } else {
+                               $array_to_translate = _wp_array_get( $theme_json, $path, null );
+                               if ( is_null( $array_to_translate ) ) {
+                                       continue;
+                               }
+
+                               $translated_array = self::translate_theme_json_chunk( $array_to_translate, $key, $context, $domain );
+                               _wp_array_set( $theme_json, $path, $translated_array );
+                       }
+               }
+
+               return $theme_json;
+       }
+
+       /**
+        * Return core's origin config.
+        *
+        * @return WP_Theme_JSON Entity that holds core data.
+        */
+       public static function get_core_data() {
+               if ( null !== self::$core ) {
+                       return self::$core;
+               }
+
+               $config     = self::read_json_file( __DIR__ . '/theme.json' );
+               $config     = self::translate( $config );
+               self::$core = new WP_Theme_JSON( $config );
+
+               return self::$core;
+       }
+
+       /**
+        * Returns the theme's data.
+        *
+        * Data from theme.json can be augmented via the
+        * $theme_support_data variable. This is useful, for example,
+        * to backfill the gaps in theme.json that a theme has declared
+        * via add_theme_supports.
+        *
+        * Note that if the same data is present in theme.json
+        * and in $theme_support_data, the theme.json's is not overwritten.
+        *
+        * @param array $theme_support_data Theme support data in theme.json format.
+        *
+        * @return WP_Theme_JSON Entity that holds theme data.
+        */
+       public static function get_theme_data( $theme_support_data = array() ) {
+               if ( null === self::$theme ) {
+                       $theme_json_data = self::read_json_file( self::get_file_path_from_theme( 'theme.json' ) );
+                       $theme_json_data = self::translate( $theme_json_data, wp_get_theme()->get( 'TextDomain' ) );
+                       self::$theme     = new WP_Theme_JSON( $theme_json_data );
+               }
+
+               if ( empty( $theme_support_data ) ) {
+                       return self::$theme;
+               }
+
+               /*
+                * We want the presets and settings declared in theme.json
+                * to override the ones declared via add_theme_support.
+                */
+               $with_theme_supports = new WP_Theme_JSON( $theme_support_data );
+               $with_theme_supports->merge( self::$theme );
+
+               return $with_theme_supports;
+       }
+
+       /**
+        * There are different sources of data for a site:
+        * core and theme.
+        *
+        * While the getters {@link get_core_data},
+        * {@link get_theme_data} return the raw data
+        * from the respective origins, this method merges them
+        * all together.
+        *
+        * If the same piece of data is declared in different origins (core and theme),
+        * the last origin overrides the previous. For example,
+        * if core disables custom colors but a theme enables them,
+        * the theme config wins.
+        *
+        * @param array  $settings Existing block editor settings.
+        *                         Empty array by default.
+        *
+        * @return WP_Theme_JSON
+        */
+       public static function get_merged_data( $settings = array() ) {
+               $theme_support_data = WP_Theme_JSON::get_from_editor_settings( $settings );
+
+               $result = new WP_Theme_JSON();
+               $result->merge( self::get_core_data() );
+               $result->merge( self::get_theme_data( $theme_support_data ) );
+
+               return $result;
+       }
+
+       /**
+        * Whether the current theme has a theme.json file.
+        *
+        * @return boolean
+        */
+       public static function theme_has_support() {
+               if ( ! isset( self::$theme_has_support ) ) {
+                       self::$theme_has_support = (bool) self::get_file_path_from_theme( 'theme.json' );
+               }
+
+               return self::$theme_has_support;
+       }
+
+       /**
+        * Builds the path to the given file
+        * and checks that it is readable.
+        *
+        * If it isn't, returns an empty string,
+        * otherwise returns the whole file path.
+        *
+        * @param string $file_name Name of the file.
+        * @return string The whole file path or empty if the file doesn't exist.
+        */
+       private static function get_file_path_from_theme( $file_name ) {
+               // This used to be a locate_template call.
+               // However, that method proved problematic
+               // due to its use of constants (STYLESHEETPATH)
+               // that threw errors in some scenarios.
+               //
+               // When the theme.json merge algorithm properly supports
+               // child themes, this should also fallback
+               // to the template path, as locate_template did.
+               $located   = '';
+               $candidate = get_stylesheet_directory() . '/' . $file_name;
+               if ( is_readable( $candidate ) ) {
+                       $located = $candidate;
+               }
+               return $located;
+       }
+
+       /**
+        * Cleans the cached data so it can be recalculated.
+        */
+       public static function clean_cached_data() {
+               self::$core                     = null;
+               self::$theme                    = null;
+               self::$theme_has_support        = null;
+               self::$theme_json_i18n          = null;
+       }
+
+}
+
+add_action( 'switch_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/class-wp-theme-json-resolver.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesclasswpthemejsonphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: 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                             (rev 0)
+++ trunk/src/wp-includes/class-wp-theme-json.php       2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,389 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Process of structures that adhere to the theme.json schema.
+ *
+ * @package WordPress
+ */
+
+/**
+ * Class that encapsulates the processing of
+ * structures that adhere to the theme.json spec.
+ *
+ * @access private
+ */
+class WP_Theme_JSON {
+
+       /**
+        * Container of data in theme.json format.
+        *
+        * @var array
+        */
+       private $theme_json = null;
+
+       /**
+        * Holds the allowed block names extracted from block.json.
+        * Shared among all instances so we only process it once.
+        *
+        * @var array
+        */
+       private static $allowed_block_names = null;
+
+       const ALLOWED_TOP_LEVEL_KEYS = array(
+               'version',
+               'settings',
+       );
+
+       const ALLOWED_SETTINGS = array(
+               'color'      => array(
+                       'custom'         => null,
+                       'customGradient' => null,
+                       'duotone'        => null,
+                       'gradients'      => null,
+                       'link'           => null,
+                       'palette'        => null,
+               ),
+               'custom'     => null,
+               'layout'     => null,
+               'spacing'    => array(
+                       'customMargin'  => null,
+                       'customPadding' => null,
+                       'units'         => null,
+               ),
+               'typography' => array(
+                       'customFontSize'   => null,
+                       'customLineHeight' => null,
+                       'dropCap'          => null,
+                       'fontSizes'        => null,
+               ),
+       );
+
+       const LATEST_SCHEMA = 1;
+
+       /**
+        * Constructor.
+        *
+        * @param array $theme_json A structure that follows the theme.json schema.
+        */
+       public function __construct( $theme_json = array() ) {
+               if ( ! isset( $theme_json['version'] ) || self::LATEST_SCHEMA !== $theme_json['version'] ) {
+                       $this->theme_json = array();
+                       return;
+               }
+
+               $this->theme_json  = self::sanitize( $theme_json );
+       }
+
+       /**
+        * Returns the allowed block names.
+        *
+        * @return array
+        */
+       private static function get_allowed_block_names() {
+               if ( null !== self::$allowed_block_names ) {
+                       return self::$allowed_block_names;
+               }
+
+               self::$allowed_block_names = array_keys( WP_Block_Type_Registry::get_instance()->get_all_registered() );
+
+               return self::$allowed_block_names;
+       }
+
+       /**
+        * Sanitizes the input according to the schemas.
+        *
+        * @param array $input Structure to sanitize.
+        *
+        * @return array The sanitized output.
+        */
+       private static function sanitize( $input ) {
+               $output = array();
+
+               if ( ! is_array( $input ) ) {
+                       return $output;
+               }
+
+               $allowed_blocks = self::get_allowed_block_names();
+
+               $output = array_intersect_key( $input, array_flip( self::ALLOWED_TOP_LEVEL_KEYS ) );
+
+               // Build the schema.
+               $schema                 = array();
+               $schema_settings_blocks = array();
+               foreach ( $allowed_blocks as $block ) {
+                       $schema_settings_blocks[ $block ] = self::ALLOWED_SETTINGS;
+               }
+               $schema['settings']           = self::ALLOWED_SETTINGS;
+               $schema['settings']['blocks'] = $schema_settings_blocks;
+
+               // Remove anything that's not present in the schema.
+               foreach ( array( 'settings' ) as $subtree ) {
+                       if ( ! isset( $input[ $subtree ] ) ) {
+                               continue;
+                       }
+
+                       if ( ! is_array( $input[ $subtree ] ) ) {
+                               unset( $output[ $subtree ] );
+                               continue;
+                       }
+
+                       $result = self::remove_keys_not_in_schema( $input[ $subtree ], $schema[ $subtree ] );
+
+                       if ( empty( $result ) ) {
+                               unset( $output[ $subtree ] );
+                       } else {
+                               $output[ $subtree ] = $result;
+                       }
+               }
+
+               return $output;
+       }
+
+       /**
+        * Given a tree, removes the keys that are not present in the schema.
+        *
+        * It is recursive and modifies the input in-place.
+        *
+        * @param array $tree Input to process.
+        * @param array $schema Schema to adhere to.
+        *
+        * @return array Returns the modified $tree.
+        */
+       private static function remove_keys_not_in_schema( $tree, $schema ) {
+               $tree = array_intersect_key( $tree, $schema );
+
+               foreach ( $schema as $key => $data ) {
+                       if ( ! isset( $tree[ $key ] ) ) {
+                               continue;
+                       }
+
+                       if ( is_array( $schema[ $key ] ) && is_array( $tree[ $key ] ) ) {
+                               $tree[ $key ] = self::remove_keys_not_in_schema( $tree[ $key ], $schema[ $key ] );
+
+                               if ( empty( $tree[ $key ] ) ) {
+                                       unset( $tree[ $key ] );
+                               }
+                       } elseif ( is_array( $schema[ $key ] ) && ! is_array( $tree[ $key ] ) ) {
+                               unset( $tree[ $key ] );
+                       }
+               }
+
+               return $tree;
+       }
+
+       /**
+        * Returns the existing settings for each block.
+        *
+        * Example:
+        *
+        * {
+        *   'root': {
+        *     'color': {
+        *       'custom': true
+        *     }
+        *   },
+        *   'core/paragraph': {
+        *     'spacing': {
+        *       'customPadding': true
+        *     }
+        *   }
+        * }
+        *
+        * @return array Settings per block.
+        */
+       public function get_settings() {
+               if ( ! isset( $this->theme_json['settings'] ) ) {
+                       return array();
+               } else {
+                       return $this->theme_json['settings'];
+               }
+       }
+
+       /**
+        * Builds metadata for the setting nodes, which returns in the form of:
+        *
+        * [
+        *   [
+        *     'path' => ['path', 'to', 'some', 'node' ]
+        *   ],
+        *   [
+        *     'path' => [ 'path', 'to', 'other', 'node' ]
+        *   ],
+        * ]
+        *
+        * @param array $theme_json The tree to extract setting nodes from.
+        *
+        * @return array
+        */
+       private static function get_setting_nodes( $theme_json ) {
+               $nodes = array();
+               if ( ! isset( $theme_json['settings'] ) ) {
+                       return $nodes;
+               }
+
+               // Top-level.
+               $nodes[] = array(
+                       'path' => array( 'settings' ),
+               );
+
+               // Calculate paths for blocks.
+               if ( ! isset( $theme_json['settings']['blocks'] ) ) {
+                       return $nodes;
+               }
+
+               foreach ( $theme_json['settings']['blocks'] as $name => $node ) {
+                       $nodes[] = array(
+                               'path' => array( 'settings', 'blocks', $name ),
+                       );
+               }
+
+               return $nodes;
+       }
+
+       /**
+        * Merge new incoming data.
+        *
+        * @param WP_Theme_JSON $incoming Data to merge.
+        */
+       public function merge( $incoming ) {
+               $incoming_data    = $incoming->get_raw_data();
+               $this->theme_json = array_replace_recursive( $this->theme_json, $incoming_data );
+
+               // The array_replace_recursive algorithm merges at the leaf level.
+               // For leaf values that are arrays it will use the numeric indexes for replacement.
+               // In those cases, what we want is to use the incoming value, if it exists.
+               //
+               // These are the cases that have array values at the leaf levels.
+               $properties   = array();
+               $properties[] = array( 'color', 'palette' );
+               $properties[] = array( 'color', 'gradients' );
+               $properties[] = array( 'custom' );
+               $properties[] = array( 'spacing', 'units' );
+               $properties[] = array( 'typography', 'fontSizes' );
+               $properties[] = array( 'typography', 'fontFamilies' );
+
+               $nodes = self::get_setting_nodes( $this->theme_json );
+               foreach ( $nodes as $metadata ) {
+                       foreach ( $properties as $property_path ) {
+                               $path = array_merge( $metadata['path'], $property_path );
+                               $node = _wp_array_get( $incoming_data, $path, array() );
+                               if ( ! empty( $node ) ) {
+                                       _wp_array_set( $this->theme_json, $path, $node );
+                               }
+                       }
+               }
+
+       }
+
+       /**
+        * Returns the raw data.
+        *
+        * @return array Raw data.
+        */
+       public function get_raw_data() {
+               return $this->theme_json;
+       }
+
+       /**
+        *
+        * Transforms the given editor settings according the
+        * add_theme_support format to the theme.json format.
+        *
+        * @param array $settings Existing editor settings.
+        *
+        * @return array Config that adheres to the theme.json schema.
+        */
+       public static function get_from_editor_settings( $settings ) {
+               $theme_settings = array(
+                       'version'  => self::LATEST_SCHEMA,
+                       'settings' => array(),
+               );
+
+               // Deprecated theme supports.
+               if ( isset( $settings['disableCustomColors'] ) ) {
+                       if ( ! isset( $theme_settings['settings']['color'] ) ) {
+                               $theme_settings['settings']['color'] = array();
+                       }
+                       $theme_settings['settings']['color']['custom'] = ! $settings['disableCustomColors'];
+               }
+
+               if ( isset( $settings['disableCustomGradients'] ) ) {
+                       if ( ! isset( $theme_settings['settings']['color'] ) ) {
+                               $theme_settings['settings']['color'] = array();
+                       }
+                       $theme_settings['settings']['color']['customGradient'] = ! $settings['disableCustomGradients'];
+               }
+
+               if ( isset( $settings['disableCustomFontSizes'] ) ) {
+                       if ( ! isset( $theme_settings['settings']['typography'] ) ) {
+                               $theme_settings['settings']['typography'] = array();
+                       }
+                       $theme_settings['settings']['typography']['customFontSize'] = ! $settings['disableCustomFontSizes'];
+               }
+
+               if ( isset( $settings['enableCustomLineHeight'] ) ) {
+                       if ( ! isset( $theme_settings['settings']['typography'] ) ) {
+                               $theme_settings['settings']['typography'] = array();
+                       }
+                       $theme_settings['settings']['typography']['customLineHeight'] = $settings['enableCustomLineHeight'];
+               }
+
+               if ( isset( $settings['enableCustomUnits'] ) ) {
+                       if ( ! isset( $theme_settings['settings']['spacing'] ) ) {
+                               $theme_settings['settings']['spacing'] = array();
+                       }
+                       $theme_settings['settings']['spacing']['units'] = ( true === $settings['enableCustomUnits'] ) ?
+                               array( 'px', 'em', 'rem', 'vh', 'vw' ) :
+                               $settings['enableCustomUnits'];
+               }
+
+               if ( isset( $settings['colors'] ) ) {
+                       if ( ! isset( $theme_settings['settings']['color'] ) ) {
+                               $theme_settings['settings']['color'] = array();
+                       }
+                       $theme_settings['settings']['color']['palette'] = $settings['colors'];
+               }
+
+               if ( isset( $settings['gradients'] ) ) {
+                       if ( ! isset( $theme_settings['settings']['color'] ) ) {
+                               $theme_settings['settings']['color'] = array();
+                       }
+                       $theme_settings['settings']['color']['gradients'] = $settings['gradients'];
+               }
+
+               if ( isset( $settings['fontSizes'] ) ) {
+                       $font_sizes = $settings['fontSizes'];
+                       // Back-compatibility for presets without units.
+                       foreach ( $font_sizes as $key => $font_size ) {
+                               if ( is_numeric( $font_size['size'] ) ) {
+                                       $font_sizes[ $key ]['size'] = $font_size['size'] . 'px';
+                               }
+                       }
+                       if ( ! isset( $theme_settings['settings']['typography'] ) ) {
+                               $theme_settings['settings']['typography'] = array();
+                       }
+                       $theme_settings['settings']['typography']['fontSizes'] = $font_sizes;
+               }
+
+               // This allows to make the plugin work with WordPress 5.7 beta
+               // as well as lower versions. The second check can be removed
+               // as soon as the minimum WordPress version for the plugin
+               // is bumped to 5.7.
+               if ( isset( $settings['enableCustomSpacing'] ) ) {
+                       if ( ! isset( $theme_settings['settings']['spacing'] ) ) {
+                               $theme_settings['settings']['spacing'] = array();
+                       }
+                       $theme_settings['settings']['spacing']['customPadding'] = $settings['enableCustomSpacing'];
+               }
+
+               // Things that didn't land in core yet, so didn't have a setting assigned.
+               if ( current( (array) get_theme_support( 'experimental-link-color' ) ) ) {
+                       if ( ! isset( $theme_settings['settings']['color'] ) ) {
+                               $theme_settings['settings']['color'] = array();
+                       }
+                       $theme_settings['settings']['color']['link'] = true;
+               }
+
+               return $theme_settings;
+       }
+
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/class-wp-theme-json.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesthemei18njson"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/theme-i18n.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/theme-i18n.json                             (rev 0)
+++ trunk/src/wp-includes/theme-i18n.json       2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,51 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+{
+       "settings": {
+               "typography": {
+                               "fontSizes": [
+                                       {
+                                               "name": "Font size name"
+                                       }
+                               ]
+               },
+               "color": {
+                               "palette": [
+                                       {
+                                               "name": "Color name"
+                                       }
+                               ],
+                               "gradients": [
+                                       {
+                                               "name": "Gradient name"
+                                       }
+                               ],
+                               "duotone": [
+                                       {
+                                               "name": "Duotone name"
+                                       }
+                               ]
+               },
+               "blocks": {
+                       "*": {
+                               "typography": {
+                                       "fontSizes": [
+                                               {
+                                                       "name": "Font size name"
+                                               }
+                                       ]
+                               },
+                               "color": {
+                                       "palette": [
+                                               {
+                                                       "name": "Color name"
+                                               }
+                                       ],
+                                       "gradients": [
+                                               {
+                                                       "name": "Gradient name"
+                                               }
+                                       ]
+                               }
+                       }
+               }
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/theme-i18n.json
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesthemejson"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: 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                          (rev 0)
+++ trunk/src/wp-includes/theme.json    2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,213 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+{
+       "version": 1,
+       "settings": {
+               "color": {
+                       "custom": true,
+                       "customGradient": true,
+                       "duotone": [
+                               {
+                                       "name":  "Dark grayscale" ,
+                                       "colors": [ "#000000", "#7f7f7f" ],
+                                       "slug": "dark-grayscale"
+                               },
+                               {
+                                       "name":  "Grayscale" ,
+                                       "colors": [ "#000000", "#ffffff" ],
+                                       "slug": "grayscale"
+                               },
+                               {
+                                       "name":  "Purple and yellow" ,
+                                       "colors": [ "#8c00b7", "#fcff41" ],
+                                       "slug": "purple-yellow"
+                               },
+                               {
+                                       "name":  "Blue and red" ,
+                                       "colors": [ "#000097", "#ff4747" ],
+                                       "slug": "blue-red"
+                               },
+                               {
+                                       "name":  "Midnight" ,
+                                       "colors": [ "#000000", "#00a5ff" ],
+                                       "slug": "midnight"
+                               },
+                               {
+                                       "name":  "Magenta and yellow" ,
+                                       "colors": [ "#c7005a", "#fff278" ],
+                                       "slug": "magenta-yellow"
+                               },
+                               {
+                                       "name":  "Purple and green" ,
+                                       "colors": [ "#a60072", "#67ff66" ],
+                                       "slug": "purple-green"
+                               },
+                               {
+                                       "name":  "Blue and orange" ,
+                                       "colors": [ "#1900d8", "#ffa96b" ],
+                                       "slug": "blue-orange"
+                               }
+                       ],
+                       "gradients": [
+                               {
+                                       "name": "Vivid cyan blue to vivid purple",
+                                       "gradient": "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",
+                                       "slug": "vivid-cyan-blue-to-vivid-purple"
+                               },
+                               {
+                                       "name": "Light green cyan to vivid green cyan",
+                                       "gradient": "linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",
+                                       "slug": "light-green-cyan-to-vivid-green-cyan"
+                               },
+                               {
+                                       "name": "Luminous vivid amber to luminous vivid orange",
+                                       "gradient": "linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",
+                                       "slug": "luminous-vivid-amber-to-luminous-vivid-orange"
+                               },
+                               {
+                                       "name": "Luminous vivid orange to vivid red",
+                                       "gradient": "linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",
+                                       "slug": "luminous-vivid-orange-to-vivid-red"
+                               },
+                               {
+                                       "name": "Very light gray to cyan bluish gray",
+                                       "gradient": "linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",
+                                       "slug": "very-light-gray-to-cyan-bluish-gray"
+                               },
+                               {
+                                       "name": "Cool to warm spectrum",
+                                       "gradient": "linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",
+                                       "slug": "cool-to-warm-spectrum"
+                               },
+                               {
+                                       "name": "Blush light purple",
+                                       "gradient": "linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",
+                                       "slug": "blush-light-purple"
+                               },
+                               {
+                                       "name": "Blush bordeaux",
+                                       "gradient": "linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",
+                                       "slug": "blush-bordeaux"
+                               },
+                               {
+                                       "name": "Luminous dusk",
+                                       "gradient": "linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",
+                                       "slug": "luminous-dusk"
+                               },
+                               {
+                                       "name": "Pale ocean",
+                                       "gradient": "linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",
+                                       "slug": "pale-ocean"
+                               },
+                               {
+                                       "name": "Electric grass",
+                                       "gradient": "linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",
+                                       "slug": "electric-grass"
+                               },
+                               {
+                                       "name": "Midnight",
+                                       "gradient": "linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",
+                                       "slug": "midnight"
+                               }
+                       ],
+                       "link": false,
+                       "palette": [
+                               {
+                                       "name": "Black",
+                                       "slug": "black",
+                                       "color": "#000000"
+                               },
+                               {
+                                       "name": "Cyan bluish gray",
+                                       "slug": "cyan-bluish-gray",
+                                       "color": "#abb8c3"
+                               },
+                               {
+                                       "name": "White",
+                                       "slug": "white",
+                                       "color": "#ffffff"
+                               },
+                               {
+                                       "name": "Pale pink",
+                                       "slug": "pale-pink",
+                                       "color": "#f78da7"
+                               },
+                               {
+                                       "name": "Vivid red",
+                                       "slug": "vivid-red",
+                                       "color": "#cf2e2e"
+                               },
+                               {
+                                       "name": "Luminous vivid orange",
+                                       "slug": "luminous-vivid-orange",
+                                       "color": "#ff6900"
+                               },
+                               {
+                                       "name": "Luminous vivid amber",
+                                       "slug": "luminous-vivid-amber",
+                                       "color": "#fcb900"
+                               },
+                               {
+                                       "name": "Light green cyan",
+                                       "slug": "light-green-cyan",
+                                       "color": "#7bdcb5"
+                               },
+                               {
+                                       "name": "Vivid green cyan",
+                                       "slug": "vivid-green-cyan",
+                                       "color": "#00d084"
+                               },
+                               {
+                                       "name": "Pale cyan blue",
+                                       "slug": "pale-cyan-blue",
+                                       "color": "#8ed1fc"
+                               },
+                               {
+                                       "name": "Vivid cyan blue",
+                                       "slug": "vivid-cyan-blue",
+                                       "color": "#0693e3"
+                               },
+                               {
+                                       "name": "Vivid purple",
+                                       "slug": "vivid-purple",
+                                       "color": "#9b51e0"
+                               }
+                       ]
+               },
+               "spacing": {
+                       "customMargin": false,
+                       "customPadding": false,
+                       "units": [ "px", "em", "rem", "vh", "vw" ]
+               },
+               "typography": {
+                       "customFontSize": true,
+                       "customLineHeight": false,
+                       "dropCap": true,
+                       "fontSizes": [
+                               {
+                                       "name": "Small",
+                                       "slug": "small",
+                                       "size": "13px"
+                               },
+                               {
+                                       "name": "Normal",
+                                       "slug": "normal",
+                                       "size": "16px"
+                               },
+                               {
+                                       "name": "Medium",
+                                       "slug": "medium",
+                                       "size": "20px"
+                               },
+                               {
+                                       "name": "Large",
+                                       "slug": "large",
+                                       "size": "36px"
+                               },
+                               {
+                                       "name": "Huge",
+                                       "slug": "huge",
+                                       "size": "42px"
+                               }
+                       ]
+               }
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/src/wp-includes/theme.json
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpsettingsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-settings.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-settings.php 2021-05-24 08:29:03 UTC (rev 50958)
+++ trunk/src/wp-settings.php   2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -295,6 +295,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require ABSPATH . WPINC . '/class-wp-block-parser.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require ABSPATH . WPINC . '/blocks.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require ABSPATH . WPINC . '/blocks/index.php';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+require ABSPATH . WPINC . '/class-wp-theme-json.php';
+require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php';
</ins><span class="cx" style="display: block; padding: 0 10px"> require ABSPATH . WPINC . '/block-editor.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require ABSPATH . WPINC . '/block-patterns.php';
</span><span class="cx" style="display: block; padding: 0 10px"> require ABSPATH . WPINC . '/class-wp-block-supports.php';
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksclasswpthemejsonresolvertestphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/blocks/class-wp-theme-json-resolver-test.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/class-wp-theme-json-resolver-test.php                            (rev 0)
+++ trunk/tests/phpunit/tests/blocks/class-wp-theme-json-resolver-test.php      2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,147 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * Test WP_Theme_JSON_Resolver class.
+ *
+ * @package Gutenberg
+ */
+
+class WP_Theme_JSON_Resolver_Test extends WP_UnitTestCase {
+
+       function setUp() {
+               parent::setUp();
+               $this->theme_root = realpath( __DIR__ . '/data/themedir1' );
+
+               $this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
+
+               // /themes is necessary as theme.php functions assume /themes is the root if there is only one root.
+               $GLOBALS['wp_theme_directories'] = array( WP_CONTENT_DIR . '/themes', $this->theme_root );
+
+               add_filter( 'theme_root', array( $this, 'filter_set_theme_root' ) );
+               add_filter( 'stylesheet_root', array( $this, 'filter_set_theme_root' ) );
+               add_filter( 'template_root', array( $this, 'filter_set_theme_root' ) );
+               // Clear caches.
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+       }
+
+       function tearDown() {
+               $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
+               wp_clean_themes_cache();
+               unset( $GLOBALS['wp_themes'] );
+               parent::tearDown();
+       }
+
+       function filter_set_theme_root() {
+               return $this->theme_root;
+       }
+
+       function filter_set_locale_to_polish() {
+               return 'pl_PL';
+       }
+
+       function test_fields_are_extracted() {
+               $actual = WP_Theme_JSON_Resolver::get_fields_to_translate();
+
+               $expected = array(
+                       array(
+                               'path'    => array( 'settings', 'typography', 'fontSizes' ),
+                               'key'     => 'name',
+                               'context' => 'Font size name',
+                       ),
+                       array(
+                               'path'    => array( 'settings', 'color', 'palette' ),
+                               'key'     => 'name',
+                               'context' => 'Color name',
+                       ),
+                       array(
+                               'path'    => array( 'settings', 'color', 'gradients' ),
+                               'key'     => 'name',
+                               'context' => 'Gradient name',
+                       ),
+                       array(
+                               'path'    => array( 'settings', 'color', 'duotone' ),
+                               'key'     => 'name',
+                               'context' => 'Duotone name',
+                       ),
+                       array(
+                               'path'    => array( 'settings', 'blocks', '*', 'typography', 'fontSizes' ),
+                               'key'     => 'name',
+                               'context' => 'Font size name',
+                       ),
+                       array(
+                               'path'    => array( 'settings', 'blocks', '*', 'color', 'palette' ),
+                               'key'     => 'name',
+                               'context' => 'Color name',
+                       ),
+                       array(
+                               'path'    => array( 'settings', 'blocks', '*', 'color', 'gradients' ),
+                               'key'     => 'name',
+                               'context' => 'Gradient name',
+                       ),
+               );
+
+               $this->assertEquals( $expected, $actual );
+       }
+
+       function test_translations_are_applied() {
+               add_filter( 'locale', array( $this, 'filter_set_locale_to_polish' ) );
+               load_textdomain( 'fse', realpath( __DIR__ . '/data/languages/themes/fse-pl_PL.mo' ) );
+
+               switch_theme( 'fse' );
+
+               $actual = WP_Theme_JSON_Resolver::get_theme_data();
+
+               unload_textdomain( 'fse' );
+               remove_filter( 'locale', array( $this, 'filter_set_locale_to_polish' ) );
+
+               $this->assertSame( wp_get_theme()->get( 'TextDomain' ), 'fse' );
+               $this->assertSame(
+                       array(
+                               'color'  => array(
+                                       'palette' => array(
+                                               array(
+                                                       'slug'  => 'light',
+                                                       'name'  => 'Jasny',
+                                                       'color' => '#f5f7f9',
+                                               ),
+                                               array(
+                                                       'slug'  => 'dark',
+                                                       'name'  => 'Ciemny',
+                                                       'color' => '#000',
+                                               ),
+                                       ),
+                                       'custom'  => false,
+                               ),
+                               'blocks' => array(
+                                       'core/paragraph' => array(
+                                               'color' => array(
+                                                       'palette' => array(
+                                                               array(
+                                                                       'slug'  => 'light',
+                                                                       'name'  => 'Jasny',
+                                                                       'color' => '#f5f7f9',
+                                                               ),
+                                                       ),
+                                               ),
+                                       ),
+                               ),
+                       ),
+                       $actual->get_settings()
+               );
+       }
+
+       function test_switching_themes_recalculates_data() {
+               // By default, the theme for unit tests is "default",
+               // which doesn't have theme.json support.
+               $default = WP_Theme_JSON_Resolver::theme_has_support();
+
+               // Switch to a theme that does have support.
+               switch_theme( 'fse' );
+               $fse = WP_Theme_JSON_Resolver::theme_has_support();
+
+               $this->assertSame( false, $default );
+               $this->assertSame( true, $fse );
+       }
+
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/blocks/class-wp-theme-json-resolver-test.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsblocksclasswpthemejsontestphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/blocks/class-wp-theme-json-test.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/class-wp-theme-json-test.php                             (rev 0)
+++ trunk/tests/phpunit/tests/blocks/class-wp-theme-json-test.php       2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,439 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/**
+ * Test WP_Theme_JSON class.
+ *
+ * @package Gutenberg
+ */
+
+class WP_Theme_JSON_Test extends WP_UnitTestCase {
+
+       function test_get_settings() {
+               $theme_json = new WP_Theme_JSON(
+                       array(
+                               'version'  => WP_Theme_JSON::LATEST_SCHEMA,
+                               'settings' => array(
+                                       'color'       => array(
+                                               'custom' => false,
+                                       ),
+                                       'invalid/key' => 'value',
+                                       'blocks'      => array(
+                                               'core/group' => array(
+                                                       'color'       => array(
+                                                               'custom' => false,
+                                                       ),
+                                                       'invalid/key' => 'value',
+                                               ),
+                                       ),
+                               ),
+                               'styles'   => array(
+                                       'color' => array(
+                                               'link' => 'blue',
+                                       ),
+                               ),
+                       )
+               );
+
+               $actual = $theme_json->get_settings();
+
+               $expected = array(
+                       'color'  => array(
+                               'custom' => false,
+                       ),
+                       'blocks' => array(
+                               'core/group' => array(
+                                       'color' => array(
+                                               'custom' => false,
+                                       ),
+                               ),
+                       ),
+               );
+
+               $this->assertEqualSetsWithIndex( $expected, $actual );
+       }
+
+       public function test_merge_incoming_data() {
+               $initial = array(
+                       'version'  => WP_Theme_JSON::LATEST_SCHEMA,
+                       'settings' => array(
+                               'color'  => array(
+                                       'custom'  => false,
+                                       'palette' => array(
+                                               array(
+                                                       'slug'  => 'red',
+                                                       'color' => 'red',
+                                               ),
+                                               array(
+                                                       'slug'  => 'green',
+                                                       'color' => 'green',
+                                               ),
+                                       ),
+                               ),
+                               'blocks' => array(
+                                       'core/paragraph' => array(
+                                               'color' => array(
+                                                       'custom' => false,
+                                               ),
+                                       ),
+                               ),
+                       ),
+                       'styles'   => array(
+                               'typography' => array(
+                                       'fontSize' => '12',
+                               ),
+                       ),
+               );
+
+               $add_new_block = array(
+                       'version'  => WP_Theme_JSON::LATEST_SCHEMA,
+                       'settings' => array(
+                               'blocks' => array(
+                                       'core/list' => array(
+                                               'color' => array(
+                                                       'custom' => false,
+                                               ),
+                                       ),
+                               ),
+                       ),
+                       'styles'   => array(
+                               'blocks' => array(
+                                       'core/list' => array(
+                                               'typography' => array(
+                                                       'fontSize' => '12',
+                                               ),
+                                               'color'      => array(
+                                                       'background' => 'brown',
+                                               ),
+                                       ),
+                               ),
+                       ),
+               );
+
+               $add_key_in_settings = array(
+                       'version'  => WP_Theme_JSON::LATEST_SCHEMA,
+                       'settings' => array(
+                               'color' => array(
+                                       'customGradient' => true,
+                               ),
+                       ),
+               );
+
+               $update_key_in_settings = array(
+                       'version'  => WP_Theme_JSON::LATEST_SCHEMA,
+                       'settings' => array(
+                               'color' => array(
+                                       'custom' => true,
+                               ),
+                       ),
+               );
+
+               $add_styles = array(
+                       'version' => WP_Theme_JSON::LATEST_SCHEMA,
+                       'styles'  => array(
+                               'blocks' => array(
+                                       'core/group' => array(
+                                               'spacing' => array(
+                                                       'padding' => array(
+                                                               'top' => '12px',
+                                                       ),
+                                               ),
+                                       ),
+                               ),
+                       ),
+               );
+
+               $add_key_in_styles = array(
+                       'version' => WP_Theme_JSON::LATEST_SCHEMA,
+                       'styles'  => array(
+                               'blocks' => array(
+                                       'core/group' => array(
+                                               'spacing' => array(
+                                                       'padding' => array(
+                                                               'bottom' => '12px',
+                                                       ),
+                                               ),
+                                       ),
+                               ),
+                       ),
+               );
+
+               $add_invalid_context = array(
+                       'version' => WP_Theme_JSON::LATEST_SCHEMA,
+                       'styles'  => array(
+                               'blocks' => array(
+                                       'core/para' => array(
+                                               'typography' => array(
+                                                       'lineHeight' => '12',
+                                               ),
+                                       ),
+                               ),
+                       ),
+               );
+
+               $update_presets = array(
+                       'version'  => WP_Theme_JSON::LATEST_SCHEMA,
+                       'settings' => array(
+                               'color'      => array(
+                                       'palette'   => array(
+                                               array(
+                                                       'slug'  => 'blue',
+                                                       'color' => 'blue',
+                                               ),
+                                       ),
+                                       'gradients' => array(
+                                               array(
+                                                       'slug'     => 'gradient',
+                                                       'gradient' => 'gradient',
+                                               ),
+                                       ),
+                               ),
+                               'typography' => array(
+                                       'fontSizes'    => array(
+                                               array(
+                                                       'slug' => 'fontSize',
+                                                       'size' => 'fontSize',
+                                               ),
+                                       ),
+                                       'fontFamilies' => array(
+                                               array(
+                                                       'slug'       => 'fontFamily',
+                                                       'fontFamily' => 'fontFamily',
+                                               ),
+                                       ),
+                               ),
+                       ),
+               );
+
+               $expected = array(
+                       'version'  => WP_Theme_JSON::LATEST_SCHEMA,
+                       'settings' => array(
+                               'color'      => array(
+                                       'custom'         => true,
+                                       'customGradient' => true,
+                                       'palette'        => array(
+                                               array(
+                                                       'slug'  => 'blue',
+                                                       'color' => 'blue',
+                                               ),
+                                       ),
+                                       'gradients'      => array(
+                                               array(
+                                                       'slug'     => 'gradient',
+                                                       'gradient' => 'gradient',
+                                               ),
+                                       ),
+                               ),
+                               'typography' => array(
+                                       'fontSizes' => array(
+                                               array(
+                                                       'slug' => 'fontSize',
+                                                       'size' => 'fontSize',
+                                               ),
+                                       ),
+                               ),
+                               'blocks'     => array(
+                                       'core/paragraph' => array(
+                                               'color' => array(
+                                                       'custom' => false,
+                                               ),
+                                       ),
+                                       'core/list'      => array(
+                                               'color' => array(
+                                                       'custom' => false,
+                                               ),
+                                       ),
+                               ),
+                       ),
+               );
+
+               $theme_json = new WP_Theme_JSON( $initial );
+               $theme_json->merge( new WP_Theme_JSON( $add_new_block ) );
+               $theme_json->merge( new WP_Theme_JSON( $add_key_in_settings ) );
+               $theme_json->merge( new WP_Theme_JSON( $update_key_in_settings ) );
+               $theme_json->merge( new WP_Theme_JSON( $add_styles ) );
+               $theme_json->merge( new WP_Theme_JSON( $add_key_in_styles ) );
+               $theme_json->merge( new WP_Theme_JSON( $add_invalid_context ) );
+               $theme_json->merge( new WP_Theme_JSON( $update_presets ) );
+               $actual = $theme_json->get_raw_data();
+
+               $this->assertEqualSetsWithIndex( $expected, $actual );
+       }
+
+       function test_get_from_editor_settings() {
+               $input = array(
+                       'disableCustomColors'    => true,
+                       'disableCustomGradients' => true,
+                       'disableCustomFontSizes' => true,
+                       'enableCustomLineHeight' => true,
+                       'enableCustomUnits'      => true,
+                       'colors'                 => array(
+                               array(
+                                       'slug'  => 'color-slug',
+                                       'name'  => 'Color Name',
+                                       'color' => 'colorvalue',
+                               ),
+                       ),
+                       'gradients'              => array(
+                               array(
+                                       'slug'     => 'gradient-slug',
+                                       'name'     => 'Gradient Name',
+                                       'gradient' => 'gradientvalue',
+                               ),
+                       ),
+                       'fontSizes'              => array(
+                               array(
+                                       'slug' => 'size-slug',
+                                       'name' => 'Size Name',
+                                       'size' => 'sizevalue',
+                               ),
+                       ),
+               );
+
+               $expected = array(
+                       'version'  => WP_Theme_JSON::LATEST_SCHEMA,
+                       'settings' => array(
+                               'color'      => array(
+                                       'custom'         => false,
+                                       'customGradient' => false,
+                                       'gradients'      => array(
+                                               array(
+                                                       'slug'     => 'gradient-slug',
+                                                       'name'     => 'Gradient Name',
+                                                       'gradient' => 'gradientvalue',
+                                               ),
+                                       ),
+                                       'palette'        => array(
+                                               array(
+                                                       'slug'  => 'color-slug',
+                                                       'name'  => 'Color Name',
+                                                       'color' => 'colorvalue',
+                                               ),
+                                       ),
+                               ),
+                               'spacing'    => array(
+                                       'units' => array( 'px', 'em', 'rem', 'vh', 'vw' ),
+                               ),
+                               'typography' => array(
+                                       'customFontSize'   => false,
+                                       'customLineHeight' => true,
+                                       'fontSizes'        => array(
+                                               array(
+                                                       'slug' => 'size-slug',
+                                                       'name' => 'Size Name',
+                                                       'size' => 'sizevalue',
+                                               ),
+                                       ),
+                               ),
+                       ),
+               );
+
+               $actual = WP_Theme_JSON::get_from_editor_settings( $input );
+
+               $this->assertEqualSetsWithIndex( $expected, $actual );
+       }
+
+       function test_get_editor_settings_no_theme_support() {
+               $input = array(
+                       '__unstableEnableFullSiteEditingBlocks' => false,
+                       'disableCustomColors'                   => false,
+                       'disableCustomFontSizes'                => false,
+                       'disableCustomGradients'                => false,
+                       'enableCustomLineHeight'                => false,
+                       'enableCustomUnits'                     => false,
+                       'imageSizes'                            => array(
+                               array(
+                                       'slug' => 'thumbnail',
+                                       'name' => 'Thumbnail',
+                               ),
+                               array(
+                                       'slug' => 'medium',
+                                       'name' => 'Medium',
+                               ),
+                               array(
+                                       'slug' => 'large',
+                                       'name' => 'Large',
+                               ),
+                               array(
+                                       'slug' => 'full',
+                                       'name' => 'Full Size',
+                               ),
+                       ),
+                       'isRTL'                                 => false,
+                       'maxUploadFileSize'                     => 123,
+               );
+
+               $expected = array(
+                       'version'  => WP_Theme_JSON::LATEST_SCHEMA,
+                       'settings' => array(
+                               'color'      => array(
+                                       'custom'         => true,
+                                       'customGradient' => true,
+                               ),
+                               'spacing'    => array(
+                                       'units' => false,
+                               ),
+                               'typography' => array(
+                                       'customFontSize'   => true,
+                                       'customLineHeight' => false,
+                               ),
+                       ),
+               );
+
+               $actual = WP_Theme_JSON::get_from_editor_settings( $input );
+
+               $this->assertEqualSetsWithIndex( $expected, $actual );
+       }
+
+       function test_get_editor_settings_blank() {
+               $expected = array(
+                       'version'  => WP_Theme_JSON::LATEST_SCHEMA,
+                       'settings' => array(),
+               );
+               $actual   = WP_Theme_JSON::get_from_editor_settings( array() );
+
+               $this->assertEqualSetsWithIndex( $expected, $actual );
+       }
+
+       function test_get_editor_settings_custom_units_can_be_disabled() {
+               add_theme_support( 'custom-units', array() );
+               $input = get_default_block_editor_settings();
+
+               $expected = array(
+                       'units'         => array( array() ),
+                       'customPadding' => false,
+               );
+
+               $actual = WP_Theme_JSON::get_from_editor_settings( $input );
+
+               $this->assertEqualSetsWithIndex( $expected, $actual['settings']['spacing'] );
+       }
+
+       function test_get_editor_settings_custom_units_can_be_enabled() {
+               add_theme_support( 'custom-units' );
+               $input = get_default_block_editor_settings();
+
+               $expected = array(
+                       'units'         => array( 'px', 'em', 'rem', 'vh', 'vw' ),
+                       'customPadding' => false,
+               );
+
+               $actual = WP_Theme_JSON::get_from_editor_settings( $input );
+
+               $this->assertEqualSetsWithIndex( $expected, $actual['settings']['spacing'] );
+       }
+
+       function test_get_editor_settings_custom_units_can_be_filtered() {
+               add_theme_support( 'custom-units', 'rem', 'em' );
+               $input = get_default_block_editor_settings();
+
+               $expected = array(
+                       'units'         => array( 'rem', 'em' ),
+                       'customPadding' => false,
+               );
+
+               $actual = WP_Theme_JSON::get_from_editor_settings( $input );
+
+               $this->assertEqualSetsWithIndex( $expected, $actual['settings']['spacing'] );
+       }
+
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/blocks/class-wp-theme-json-test.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsblocksdatalanguagesthemesfsepl_PLpo"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/blocks/data/languages/themes/fse-pl_PL.po</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/data/languages/themes/fse-pl_PL.po                               (rev 0)
+++ trunk/tests/phpunit/tests/blocks/data/languages/themes/fse-pl_PL.po 2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,31 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: 2015-12-31 16:31+0100\n"
+"PO-Revision-Date: 2021-03-15 13:10+0100\n"
+"Language: pl_PL\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 2.4.2\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
+"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
+"esc_html_x:1,2c\n"
+"X-Textdomain-Support: yes\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"X-Poedit-SearchPath-0: .\n"
+
+msgctxt "Custom template name"
+msgid "Homepage template"
+msgstr "Szablon strony głównej"
+
+msgctxt "Color name"
+msgid "Light"
+msgstr "Jasny"
+
+msgctxt "Color name"
+msgid "Dark"
+msgstr "Ciemny"
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/blocks/data/languages/themes/fse-pl_PL.po
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsblocksdatathemedir1fsestylecss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/blocks/data/themedir1/fse/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/data/themedir1/fse/style.css                             (rev 0)
+++ trunk/tests/phpunit/tests/blocks/data/themedir1/fse/style.css       2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,7 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/*
+Theme Name: FSE Theme
+Theme URI: https://wordpress.org/
+Description: For testing purposes only.
+Version: 1.0.0
+Text Domain: fse
+*/
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/blocks/data/themedir1/fse/style.css
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunktestsphpunittestsblocksdatathemedir1fsethemejson"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/tests/phpunit/tests/blocks/data/themedir1/fse/theme.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/data/themedir1/fse/theme.json                            (rev 0)
+++ trunk/tests/phpunit/tests/blocks/data/themedir1/fse/theme.json      2021-05-24 08:36:11 UTC (rev 50959)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,45 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+{
+       "version": 1,
+       "settings": {
+               "color": {
+                       "palette": [
+                               {
+                                       "slug": "light",
+                                       "name": "Light",
+                                       "color": "#f5f7f9"
+                               },
+                               {
+                                       "slug": "dark",
+                                       "name": "Dark",
+                                       "color": "#000"
+                               }
+                       ],
+                       "custom": false
+               },
+               "blocks": {
+                       "core/paragraph": {
+                               "color": {
+                                       "palette": [
+                                               {
+                                                       "slug": "light",
+                                                       "name": "Light",
+                                                       "color": "#f5f7f9"
+                                               }
+                                       ]
+                               }
+                       }
+               }
+       },
+       "customTemplates": [
+               {
+                       "name": "page-home",
+                       "title": "Homepage template"
+               }
+       ],
+       "templateParts": [
+               {
+                       "name": "small-header",
+                       "area": "header"
+               }
+       ]
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: trunk/tests/phpunit/tests/blocks/data/themedir1/fse/theme.json
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>

</body>
</html>