Make WordPress Core


Ignore:
Timestamp:
11/30/2021 12:22:30 AM (5 years ago)
Author:
noisysocks
Message:

Update @wordpress packages

Update packages to include these bug fixes from Gutenberg:

  • Update Pattern block category and add documentation
  • Fix non existent menu handling in nav block
  • Make Reusable blocks available in the Site Editor
  • Add caching to WP_Theme_JSON_Resolver_Gutenberg::get_user_data_from_custom_post_type()
  • theme.json: add appearanceTools flag to opt-in into appearance UI controls
  • Update the block theme folders to templates and parts
  • Remove reference to gutenberg_, swap with wp_
  • Use table layout in templates list screen
  • Update featured image placeholder graphic.
  • [Inserter]: Adjust order of theme blocks and reorder inserter items
  • Implement suitable fallback for Nav block on front end of site when no menu selected
  • Toggle Group Control: add tooltip
  • Use first non-empty Nav post as primary fallback for Nav block
  • Change .nvmrc and documentation for Node.js version (LTS to 14.18.1)
  • Update: Migrate global styles user database data on the rest endpoint
  • Update global styles public API
  • Update: Rename user preset origin to custom
  • Try always generating navigation post title
  • Show all templates and template parts on the site editor list screens
  • Highlight "Site" in the navigation panel
  • Fix template part slug generation when creating through the block placeholder
  • [Block Library - Post Title]: Fix render error when setting Page to homepage
  • Add 'Clear customizations' button to template list page
  • Gallery v1: Allow clicks within replace media placeholder state
  • Site Editor: Set the <title> on the list page to be same as the CPT name
  • Gallery: Fix stuck image size options loader
  • Cover: Fix undo trap
  • Add success and error snackbars to the templates list page
  • Fix: theme colors cannot override defaults
  • Fix: Color palette is not being stored
  • Add elements support to the typography panel in global styles
  • Make links plural in global styles
  • Add: Gradient palette editor
  • Update some small style regressions in the template list
  • Add: Transparency support on global styles colors
  • Fix: apply by slug on all origins
  • Render empty Nav block if no fallback block can be utilised
  • Allow filtering of Nav block fallback
  • Fix Nav block fallback DB query to match on full block grammar start tag
  • Remove unstable max pages attribute from Nav block
  • DateTimePicker: set PM hours correctly
  • Update delete template button
  • Site Editor: Template list add rename action
  • Fix Nav block editing wrong entity on creation of new Menu
  • [REST] Restore the missing double slash in the ID received by /templates
  • Add icons to navigation sidebar items
  • Update function names for the public global styles API functions
  • Templates Controller: Add missing 'is_custom' prop
  • Rename gutenberg_ to wp_ for some functions that land in WordPress 5.9
  • [Block Library - Template Part]:Remove support for conversion to Reusable block
  • Global Styles: Call "palettes" and not "color palettes" on panel label
  • Add button text when no colors found
  • Update: Global Styes: Count all color palette origins on the palette counter
  • Rename navigationMenuId to ref
  • Offset the parent iframe when computing Popover position
  • Fix: Failing PHPUnit test
  • Show theme, plugin or author in Added By column with appropriate icon or avatar
  • Add origin and author to template rest api

See #54487.
Props talldanwp, mamaduka, oandregal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/wpThemeJson.php

    r52232 r52275  
    201201        }
    202202
     203        function test_get_settings_using_opt_in_key() {
     204                $theme_json = new WP_Theme_JSON(
     205                        array(
     206                                'version'  => WP_Theme_JSON::LATEST_SCHEMA,
     207                                'settings' => array(
     208                                        'appearanceTools' => true,
     209                                        'blocks'          => array(
     210                                                'core/paragraph' => array(
     211                                                        'typography' => array(
     212                                                                'lineHeight' => false,
     213                                                        ),
     214                                                ),
     215                                                'core/group'     => array(
     216                                                        'appearanceTools' => true,
     217                                                        'typography'      => array(
     218                                                                'lineHeight' => false, // This should override appearanceTools.
     219                                                        ),
     220                                                ),
     221                                        ),
     222                                ),
     223                        )
     224                );
     225
     226                $actual   = $theme_json->get_settings();
     227                $expected = array(
     228                        'border'     => array(
     229                                'width'  => true,
     230                                'style'  => true,
     231                                'radius' => true,
     232                                'color'  => true,
     233                        ),
     234                        'color'      => array(
     235                                'link' => true,
     236                        ),
     237                        'spacing'    => array(
     238                                'blockGap' => true,
     239                                'margin'   => true,
     240                                'padding'  => true,
     241                        ),
     242                        'typography' => array(
     243                                'lineHeight' => true,
     244                        ),
     245                        'blocks'     => array(
     246                                'core/paragraph' => array(
     247                                        'typography' => array(
     248                                                'lineHeight' => false,
     249                                        ),
     250                                ),
     251                                'core/group'     => array(
     252                                        'border'     => array(
     253                                                'width'  => true,
     254                                                'style'  => true,
     255                                                'radius' => true,
     256                                                'color'  => true,
     257                                        ),
     258                                        'color'      => array(
     259                                                'link' => true,
     260                                        ),
     261                                        'spacing'    => array(
     262                                                'blockGap' => true,
     263                                                'margin'   => true,
     264                                                'padding'  => true,
     265                                        ),
     266                                        'typography' => array(
     267                                                'lineHeight' => false,
     268                                        ),
     269                                ),
     270                        ),
     271                );
     272
     273                $this->assertEqualSetsWithIndex( $expected, $actual );
     274        }
     275
    203276        /**
    204277         * @ticket 54336
    … …  
    10611134        }
    10621135
     1136        public function test_merge_incoming_data_removes_theme_presets_with_slugs_as_default_presets() {
     1137                $defaults = new WP_Theme_JSON(
     1138                        array(
     1139                                'version'  => WP_Theme_JSON::LATEST_SCHEMA,
     1140                                'settings' => array(
     1141                                        'color'  => array(
     1142                                                'palette' => array(
     1143                                                        array(
     1144                                                                'slug'  => 'red',
     1145                                                                'color' => 'red',
     1146                                                                'name'  => 'Red',
     1147                                                        ),
     1148                                                        array(
     1149                                                                'slug'  => 'green',
     1150                                                                'color' => 'green',
     1151                                                                'name'  => 'Green',
     1152                                                        ),
     1153                                                ),
     1154                                        ),
     1155                                        'blocks' => array(
     1156                                                'core/paragraph' => array(
     1157                                                        'color' => array(
     1158                                                                'palette' => array(
     1159                                                                        array(
     1160                                                                                'slug'  => 'blue',
     1161                                                                                'color' => 'blue',
     1162                                                                                'name'  => 'Blue',
     1163                                                                        ),
     1164                                                                ),
     1165                                                        ),
     1166                                                ),
     1167                                        ),
     1168                                ),
     1169                        ),
     1170                        'default'
     1171                );
     1172                $theme    = new WP_Theme_JSON(
     1173                        array(
     1174                                'version'  => WP_Theme_JSON::LATEST_SCHEMA,
     1175                                'settings' => array(
     1176                                        'color'  => array(
     1177                                                'palette' => array(
     1178                                                        array(
     1179                                                                'slug'  => 'pink',
     1180                                                                'color' => 'pink',
     1181                                                                'name'  => 'Pink',
     1182                                                        ),
     1183                                                        array(
     1184                                                                'slug'  => 'green',
     1185                                                                'color' => 'green',
     1186                                                                'name'  => 'Greenish',
     1187                                                        ),
     1188                                                ),
     1189                                        ),
     1190                                        'blocks' => array(
     1191                                                'core/paragraph' => array(
     1192                                                        'color' => array(
     1193                                                                'palette' => array(
     1194                                                                        array(
     1195                                                                                'slug'  => 'blue',
     1196                                                                                'color' => 'blue',
     1197                                                                                'name'  => 'Bluish',
     1198                                                                        ),
     1199                                                                        array(
     1200                                                                                'slug'  => 'yellow',
     1201                                                                                'color' => 'yellow',
     1202                                                                                'name'  => 'Yellow',
     1203                                                                        ),
     1204                                                                        array(
     1205                                                                                'slug'  => 'green',
     1206                                                                                'color' => 'green',
     1207                                                                                'name'  => 'Block Green',
     1208                                                                        ),
     1209                                                                ),
     1210                                                        ),
     1211                                                ),
     1212                                        ),
     1213                                ),
     1214                        )
     1215                );
     1216
     1217                $expected = array(
     1218                        'version'  => WP_Theme_JSON::LATEST_SCHEMA,
     1219                        'settings' => array(
     1220                                'color'  => array(
     1221                                        'palette' => array(
     1222                                                'default' => array(
     1223                                                        array(
     1224                                                                'slug'  => 'red',
     1225                                                                'color' => 'red',
     1226                                                                'name'  => 'Red',
     1227                                                        ),
     1228                                                        array(
     1229                                                                'slug'  => 'green',
     1230                                                                'color' => 'green',
     1231                                                                'name'  => 'Green',
     1232                                                        ),
     1233                                                ),
     1234                                                'theme'   => array(
     1235                                                        array(
     1236                                                                'slug'  => 'pink',
     1237                                                                'color' => 'pink',
     1238                                                                'name'  => 'Pink',
     1239                                                        ),
     1240                                                ),
     1241                                        ),
     1242                                ),
     1243                                'blocks' => array(
     1244                                        'core/paragraph' => array(
     1245                                                'color' => array(
     1246                                                        'palette' => array(
     1247                                                                'default' => array(
     1248                                                                        array(
     1249                                                                                'slug'  => 'blue',
     1250                                                                                'color' => 'blue',
     1251                                                                                'name'  => 'Blue',
     1252                                                                        ),
     1253                                                                ),
     1254                                                                'theme'   => array(
     1255                                                                        array(
     1256                                                                                'slug'  => 'yellow',
     1257                                                                                'color' => 'yellow',
     1258                                                                                'name'  => 'Yellow',
     1259                                                                        ),
     1260                                                                ),
     1261                                                        ),
     1262                                                ),
     1263                                        ),
     1264                                ),
     1265                        ),
     1266                );
     1267
     1268                $defaults->merge( $theme );
     1269                $actual = $defaults->get_raw_data();
     1270
     1271                $this->assertEqualSetsWithIndex( $expected, $actual );
     1272        }
     1273
    10631274        /**
    10641275         * @ticket 54336
    … …  
    12991510                                                'custom'  => true,
    13001511                                                'palette' => array(
    1301                                                         'user' => array(
     1512                                                        'custom' => array(
    13021513                                                                array(
    13031514                                                                        'name'  => 'Red',
    … …  
    13261537                                                                'custom'  => true,
    13271538                                                                'palette' => array(
    1328                                                                         'user' => array(
     1539                                                                        'custom' => array(
    13291540                                                                                array(
    13301541                                                                                        'name'  => 'Yellow',
    … …  
    13591570                                'color'  => array(
    13601571                                        'palette' => array(
    1361                                                 'user' => array(
     1572                                                'custom' => array(
    13621573                                                        array(
    13631574                                                                'name'  => 'Red',
    … …  
    13821593                                                'color' => array(
    13831594                                                        'palette' => array(
    1384                                                                 'user' => array(
     1595                                                                'custom' => array(
    13851596                                                                        array(
    13861597                                                                                'name'  => 'Yellow',
    … …  
    14181629                                        'color'      => array(
    14191630                                                'palette' => array(
    1420                                                         'user' => array(
     1631                                                        'custom' => array(
    14211632                                                                array(
    14221633                                                                        'name'  => 'Red/><b>ok</ok>',
    … …  
    14441655                                        'typography' => array(
    14451656                                                'fontFamilies' => array(
    1446                                                         'user' => array(
     1657                                                        'custom' => array(
    14471658                                                                array(
    14481659                                                                        'name'       => 'Helvetica Arial/><b>test</b>',
    … …  
    14721683                                                        'color' => array(
    14731684                                                                'palette' => array(
    1474                                                                         'user' => array(
     1685                                                                        'custom' => array(
    14751686                                                                                array(
    14761687                                                                                        'name'  => 'Red/><b>ok</ok>',
    … …  
    15071718                                'color'      => array(
    15081719                                        'palette' => array(
    1509                                                 'user' => array(
     1720                                                'custom' => array(
    15101721                                                        array(
    15111722                                                                'name'  => 'Pink',
    … …  
    15181729                                'typography' => array(
    15191730                                        'fontFamilies' => array(
    1520                                                 'user' => array(
     1731                                                'custom' => array(
    15211732                                                        array(
    15221733                                                                'name'       => 'Cambria',
    … …  
    15311742                                                'color' => array(
    15321743                                                        'palette' => array(
    1533                                                                 'user' => array(
     1744                                                                'custom' => array(
    15341745                                                                        array(
    15351746                                                                                'name'  => 'Pink',
Note: See TracChangeset for help on using the changeset viewer.