Update @wordpress packages

Update packages to include these bug fixes from Gutenberg:

- Site Logo: Add option to set site icon from Site Logo block
- Navigation: Enable even more compact setup state.
- Remove template parts from post content inserter an __unstable filter
- Template Editor Mode: Hide editor mode switcher
- Avoid using CSS variables for block gap styles
- Try to fix auto resizing in template part focus mode
- Lower the specificity of font size CSS Custom Properties in the editor
- Site icon: Fix site icon styling to display non-square site icons within a square button
- [Site Editor]: Register block editor shortcuts
- Update regex to handle 404 template slug
- Site Editor: Remove dead code
- [Block Editor]: Restrict delete multi selected blocks shortcut
- Fix: Gradients are not being applied by class
- Update: Make the global styles subtitles font smaller
- Post Content/Title: Reflect changes when previewing post
- ServerSideRender: Fix loading state
- [Block Library]: Fix editable post blocks in Query Loop with zero queryId
- Post Excerpt: Fix previews
- WP59: Contextualize "Export" string to differentiate it from other occurrences in WP Core
- Tools Panel: Fix race conditions caused by conditionally displayed ToolsPanelItems
- ToolsPanel: Allow items to register when panelId is null
- Font Size Picker: Allow non-integers as simple CSS values and in hints
- [Components - FontSizePicker]: Use incremental sequence of numbers as labels for the available font-sizes at the segmented control (conditionally)

See #54487.


git-svn-id: https://develop.svn.wordpress.org/trunk@52434 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Robert Anderson
2022-01-04 05:37:25 +00:00
parent 568bef0985
commit bd08b22127
18 changed files with 264 additions and 379 deletions

255
package-lock.json generated
View File

@@ -1397,9 +1397,9 @@
"dev": true
},
"@emotion/babel-plugin": {
"version": "11.7.1",
"resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.7.1.tgz",
"integrity": "sha512-K3/6Y+J/sIAjplf3uIteWLhPuOyuMNnE+iyYnTF/m294vc6IL90kTHp7y8ldZYbpKlP17rpOWDKM9DvTcrOmNQ==",
"version": "11.7.2",
"resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.7.2.tgz",
"integrity": "sha512-6mGSCWi9UzXut/ZAN6lGFu33wGR3SJisNl3c0tvlmb8XChH1b2SUvxvnOh7hvLpqyRdHHU9AiazV3Cwbk5SXKQ==",
"requires": {
"@babel/helper-module-imports": "^7.12.13",
"@babel/plugin-syntax-jsx": "^7.12.13",
@@ -2276,52 +2276,53 @@
"integrity": "sha512-zrsUxjLOKAzdewIDRWy9nsV1GQsKBCWaGwsZQlCgr6/q+vjyZhFgqedLfFBuI9anTPEUT4APq9Mu0SZBTzIcGQ=="
},
"@react-spring/animated": {
"version": "9.3.1",
"resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.3.1.tgz",
"integrity": "sha512-23YaERZ++BwZ8F8PxPFqrpOwp/JZun1Pj6aHZtPAU42j5LycBRasT9XMw7Eyr7zNFhT+rl3R3wFfd4WX6Ax+UA==",
"version": "9.4.0",
"resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.4.0.tgz",
"integrity": "sha512-hOj90pXC1ovukgA63l6zQRr7jq6Lay/kUgwlMZWOwgaZoPb1J02BjLtS0rbFvx+BUMd3mrL0QVdno+B6eYsLQQ==",
"requires": {
"@react-spring/shared": "~9.3.0",
"@react-spring/types": "~9.3.0"
"@react-spring/shared": "~9.4.0",
"@react-spring/types": "~9.4.0"
}
},
"@react-spring/core": {
"version": "9.3.1",
"resolved": "https://registry.npmjs.org/@react-spring/core/-/core-9.3.1.tgz",
"integrity": "sha512-8rmfmEHLHGtF1CUiXRn64YJqsXNxv2cGX8oNnBnsuoE33c48Zc34t2VIMB4R9q5zwIUCvDBGfiEenA8ZAPxqOQ==",
"version": "9.4.0",
"resolved": "https://registry.npmjs.org/@react-spring/core/-/core-9.4.0.tgz",
"integrity": "sha512-zJC6JgLTv42tdNLZiN8eRgKnVaQxRvGHt329GxZFB9/bhH9FqjOMQ2GsEu8uImw3eicaXlWy10Ssp4SQftZSPg==",
"requires": {
"@react-spring/animated": "~9.3.0",
"@react-spring/shared": "~9.3.0",
"@react-spring/types": "~9.3.0"
"@react-spring/animated": "~9.4.0",
"@react-spring/rafz": "~9.4.0",
"@react-spring/shared": "~9.4.0",
"@react-spring/types": "~9.4.0"
}
},
"@react-spring/rafz": {
"version": "9.3.1",
"resolved": "https://registry.npmjs.org/@react-spring/rafz/-/rafz-9.3.1.tgz",
"integrity": "sha512-fEBMCarGVl+/2kdO+g6Zig4F+3ymwmcGN8S71gb1c7Cbbxb87kviPz8EhshfIHoiLeJPGlqwcuGbxNmZbBamvA=="
"version": "9.4.0",
"resolved": "https://registry.npmjs.org/@react-spring/rafz/-/rafz-9.4.0.tgz",
"integrity": "sha512-CqBLODaAZ9HrTNZyOtrr4XQ7CdUNd4OU3Hh7T6JSdB88MyJScsJBKCT9QaJop6wuhvQPiQEviMnD8TfKEkVfuw=="
},
"@react-spring/shared": {
"version": "9.3.1",
"resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.3.1.tgz",
"integrity": "sha512-jhPpxzURGo6Nty90ex1lkxmZae7w/VAbnGmb/nXcYoZwSoNR+W2aAd00iXsh2ZGz6MgoJOsc495JeG3uC7Am8A==",
"version": "9.4.0",
"resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.4.0.tgz",
"integrity": "sha512-VgQd8NxfbLTeWqzKpGMXXVf1IrmBKO8/fsHFiW+OxZdmFpz77G1aJZ+AnMgCcwrV9KtLdeG0G8YXOQrhsLA7dA==",
"requires": {
"@react-spring/rafz": "~9.3.0",
"@react-spring/types": "~9.3.0"
"@react-spring/rafz": "~9.4.0",
"@react-spring/types": "~9.4.0"
}
},
"@react-spring/types": {
"version": "9.3.1",
"resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.3.1.tgz",
"integrity": "sha512-W/YMJMX35XgGGzX0gKORBTwnvQ+1loDOFN3XlZkW5fgpEY+7VkRUpPyqPWXQr3n6lHrsLmHIGdpznqZi54ACTQ=="
"version": "9.4.0",
"resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.4.0.tgz",
"integrity": "sha512-K49Fb/rPX6cSb15ZcW6d45NBYqAJbGh4MKpsBmvZWahJTXKtFDfQq10Bq0+wlLYQr8r1bgsE8v4blfCIdm6UoA=="
},
"@react-spring/web": {
"version": "9.3.1",
"resolved": "https://registry.npmjs.org/@react-spring/web/-/web-9.3.1.tgz",
"integrity": "sha512-sisZIgFGva/Z+xKWPSfXpukF0AP3kR9ALTxlHL87fVotMUCJX5vtH/YlVcywToEFwTHKt3MpI5Wy2M+vgVEeaw==",
"version": "9.4.0",
"resolved": "https://registry.npmjs.org/@react-spring/web/-/web-9.4.0.tgz",
"integrity": "sha512-czg38A12w5glP33cfbjiwRnpCw3TNBuJ8eVxP6H2frMnADESsxmSpe0vNlvxrCEOhZxbhUu3ILJ2v02H9LV7bw==",
"requires": {
"@react-spring/animated": "~9.3.0",
"@react-spring/core": "~9.3.0",
"@react-spring/shared": "~9.3.0",
"@react-spring/types": "~9.3.0"
"@react-spring/animated": "~9.4.0",
"@react-spring/core": "~9.4.0",
"@react-spring/shared": "~9.4.0",
"@react-spring/types": "~9.4.0"
}
},
"@sideway/address": {
@@ -3539,21 +3540,21 @@
}
},
"@wordpress/block-directory": {
"version": "3.0.19",
"resolved": "https://registry.npmjs.org/@wordpress/block-directory/-/block-directory-3.0.19.tgz",
"integrity": "sha512-gHD5cDjkri2NKY5vK+RubBgpHc+5zZA8uWULzvbqbVAlul9Qo+i8tkY900gYdhGQgxzcnfWJjU58zM9ML5MBRg==",
"version": "3.0.20",
"resolved": "https://registry.npmjs.org/@wordpress/block-directory/-/block-directory-3.0.20.tgz",
"integrity": "sha512-sm6dFYtHflHAeD1keC/oc7RN4GjdbOz18wxKGkyiOM8jzOIWqcrMcgfhzh98F6sSN/oJkYpTafpTQwT3Kz9nlQ==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/api-fetch": "^5.2.6",
"@wordpress/block-editor": "^8.0.12",
"@wordpress/block-editor": "^8.0.13",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/core-data": "^4.0.9",
"@wordpress/data": "^6.1.5",
"@wordpress/edit-post": "^5.0.19",
"@wordpress/editor": "^12.0.15",
"@wordpress/edit-post": "^5.0.20",
"@wordpress/editor": "^12.0.16",
"@wordpress/element": "^4.0.4",
"@wordpress/hooks": "^3.2.2",
"@wordpress/html-entities": "^3.2.3",
@@ -3566,9 +3567,9 @@
}
},
"@wordpress/block-editor": {
"version": "8.0.12",
"resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-8.0.12.tgz",
"integrity": "sha512-wif8ntsph9N9s6wAh6xfEOQMzXg0uTnqaczoK01K+5gou01JILvGwaApTbWucgPDrLvU3CVW1Mt8USvBB2ujhw==",
"version": "8.0.13",
"resolved": "https://registry.npmjs.org/@wordpress/block-editor/-/block-editor-8.0.13.tgz",
"integrity": "sha512-U/0Hj6wwayOFqBZg8ObR6XaDMpEnq1PXsNemxKp4BhLixiBDKMC0eXC0kBQJYm6BouMVwiw2r0StIyvl+XFovA==",
"requires": {
"@babel/runtime": "^7.16.0",
"@react-spring/web": "^9.2.4",
@@ -3577,7 +3578,7 @@
"@wordpress/blob": "^3.2.2",
"@wordpress/block-serialization-default-parser": "^4.2.3",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/data": "^6.1.5",
"@wordpress/deprecated": "^3.2.3",
@@ -3613,18 +3614,18 @@
}
},
"@wordpress/block-library": {
"version": "6.0.17",
"resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-6.0.17.tgz",
"integrity": "sha512-/YC1eOHcb5ZokSODx04rcA5Qco3EDi3nIVZVyx1VMeJHxWB+qaYb49dnliqvnG/A5DoaEJeV5YsOMMbHbz914Q==",
"version": "6.0.18",
"resolved": "https://registry.npmjs.org/@wordpress/block-library/-/block-library-6.0.18.tgz",
"integrity": "sha512-U7JiHp5d+JkUtsSByplkvfbWonUbRLFS1Gm6afbICT1w4hj3xFFxgBo9aCc8VzQOFS/2fpoQUANEK6h5QUBdAg==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/api-fetch": "^5.2.6",
"@wordpress/autop": "^3.2.3",
"@wordpress/blob": "^3.2.2",
"@wordpress/block-editor": "^8.0.12",
"@wordpress/block-editor": "^8.0.13",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/core-data": "^4.0.9",
"@wordpress/data": "^6.1.5",
@@ -3637,14 +3638,14 @@
"@wordpress/html-entities": "^3.2.3",
"@wordpress/i18n": "^4.2.4",
"@wordpress/icons": "^6.1.1",
"@wordpress/interface": "^4.1.14",
"@wordpress/interface": "^4.1.15",
"@wordpress/is-shallow-equal": "^4.2.1",
"@wordpress/keycodes": "^3.2.4",
"@wordpress/notices": "^3.2.8",
"@wordpress/primitives": "^3.0.4",
"@wordpress/reusable-blocks": "^3.0.18",
"@wordpress/reusable-blocks": "^3.0.19",
"@wordpress/rich-text": "^5.0.7",
"@wordpress/server-side-render": "^3.0.16",
"@wordpress/server-side-render": "^3.0.17",
"@wordpress/url": "^3.3.1",
"@wordpress/viewport": "^4.0.7",
"classnames": "^2.3.1",
@@ -3699,9 +3700,9 @@
"dev": true
},
"@wordpress/components": {
"version": "19.1.6",
"resolved": "https://registry.npmjs.org/@wordpress/components/-/components-19.1.6.tgz",
"integrity": "sha512-+Vmj+w7aLudXUzBdAOA/1a/RKoFvVSckGfuF/qpsFCVv80t2a22sgG8ZVnjm6f+L5dcCQdr3xgvqyRgE4lOvqQ==",
"version": "19.2.0",
"resolved": "https://registry.npmjs.org/@wordpress/components/-/components-19.2.0.tgz",
"integrity": "sha512-IFvbH7Jo9jqbH+ZXCMm+tLaJDn95Q783aNtm9GVA+z3nJSyh4Dl2MXsRfOSE/mLd2iToPDCrpuHi51hr/lrGcw==",
"requires": {
"@babel/runtime": "^7.16.0",
"@emotion/cache": "^11.4.0",
@@ -3795,16 +3796,16 @@
}
},
"@wordpress/customize-widgets": {
"version": "2.0.19",
"resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-2.0.19.tgz",
"integrity": "sha512-nEXbAn+9Nik71p3dabXoJYvP5U0vuGBY2/8BRgNQWWHG/qhU9pkXhG12medpu53Ng86c0YyzlxK5hfru93LqvQ==",
"version": "2.0.20",
"resolved": "https://registry.npmjs.org/@wordpress/customize-widgets/-/customize-widgets-2.0.20.tgz",
"integrity": "sha512-80tz/X4QtJwsGXzhNcEOuDE298dDWzpr+uVI/8a/g9/f5Y8O2Qf+0EfUmscQ8HHo4eKjY284im1HviAZYonOKg==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/block-editor": "^8.0.12",
"@wordpress/block-library": "^6.0.17",
"@wordpress/block-editor": "^8.0.13",
"@wordpress/block-library": "^6.0.18",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/core-data": "^4.0.9",
"@wordpress/data": "^6.1.5",
@@ -3813,12 +3814,12 @@
"@wordpress/hooks": "^3.2.2",
"@wordpress/i18n": "^4.2.4",
"@wordpress/icons": "^6.1.1",
"@wordpress/interface": "^4.1.14",
"@wordpress/interface": "^4.1.15",
"@wordpress/is-shallow-equal": "^4.2.1",
"@wordpress/keyboard-shortcuts": "^3.0.7",
"@wordpress/keycodes": "^3.2.4",
"@wordpress/media-utils": "^3.0.5",
"@wordpress/widgets": "^2.0.18",
"@wordpress/widgets": "^2.0.19",
"classnames": "^2.3.1",
"lodash": "^4.17.21"
}
@@ -3947,27 +3948,27 @@
}
},
"@wordpress/edit-post": {
"version": "5.0.19",
"resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-5.0.19.tgz",
"integrity": "sha512-uvEwH4cXsmZD+hMk/yOimUEyphhG0MsDwH5RVJQ/dTtuJZ+HmrzOAawF/L+GWP1/xpUHmTpbHFNdn2pULCS0CQ==",
"version": "5.0.20",
"resolved": "https://registry.npmjs.org/@wordpress/edit-post/-/edit-post-5.0.20.tgz",
"integrity": "sha512-7/8BT2vPin/vg6Opml3uFYhtFMjsdX4DGniiEUeZhoRLC7AiU1VNlxEKklTNRkMHQI4tCcr6+qc7YoMbB5nmyQ==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/api-fetch": "^5.2.6",
"@wordpress/block-editor": "^8.0.12",
"@wordpress/block-library": "^6.0.17",
"@wordpress/block-editor": "^8.0.13",
"@wordpress/block-library": "^6.0.18",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/core-data": "^4.0.9",
"@wordpress/data": "^6.1.5",
"@wordpress/data-controls": "^2.2.8",
"@wordpress/editor": "^12.0.15",
"@wordpress/editor": "^12.0.16",
"@wordpress/element": "^4.0.4",
"@wordpress/hooks": "^3.2.2",
"@wordpress/i18n": "^4.2.4",
"@wordpress/icons": "^6.1.1",
"@wordpress/interface": "^4.1.14",
"@wordpress/interface": "^4.1.15",
"@wordpress/keyboard-shortcuts": "^3.0.7",
"@wordpress/keycodes": "^3.2.4",
"@wordpress/media-utils": "^3.0.5",
@@ -3992,35 +3993,35 @@
}
},
"@wordpress/edit-site": {
"version": "3.0.19",
"resolved": "https://registry.npmjs.org/@wordpress/edit-site/-/edit-site-3.0.19.tgz",
"integrity": "sha512-TwZ2svgbmPl0pbIbCFoabFYVNx6HjGl6wOMbj5NBb8Vy2qszPM/6hJOTc18c20YoMid9uR1taHC+R0/uRGHiTQ==",
"version": "3.0.20",
"resolved": "https://registry.npmjs.org/@wordpress/edit-site/-/edit-site-3.0.20.tgz",
"integrity": "sha512-rfT8ex8uYn2DpcRFO3ola2NhywBrxV2Yzy2BA9MvI7tIo+/2UFJVrFROafycb1pXjufwrq35ST69XvUMRvL6Fg==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/api-fetch": "^5.2.6",
"@wordpress/block-editor": "^8.0.12",
"@wordpress/block-library": "^6.0.17",
"@wordpress/block-editor": "^8.0.13",
"@wordpress/block-library": "^6.0.18",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/core-data": "^4.0.9",
"@wordpress/data": "^6.1.5",
"@wordpress/data-controls": "^2.2.8",
"@wordpress/editor": "^12.0.15",
"@wordpress/editor": "^12.0.16",
"@wordpress/element": "^4.0.4",
"@wordpress/hooks": "^3.2.2",
"@wordpress/html-entities": "^3.2.3",
"@wordpress/i18n": "^4.2.4",
"@wordpress/icons": "^6.1.1",
"@wordpress/interface": "^4.1.14",
"@wordpress/interface": "^4.1.15",
"@wordpress/keyboard-shortcuts": "^3.0.7",
"@wordpress/keycodes": "^3.2.4",
"@wordpress/media-utils": "^3.0.5",
"@wordpress/notices": "^3.2.8",
"@wordpress/plugins": "^4.0.7",
"@wordpress/primitives": "^3.0.4",
"@wordpress/reusable-blocks": "^3.0.18",
"@wordpress/reusable-blocks": "^3.0.19",
"@wordpress/url": "^3.3.1",
"@wordpress/viewport": "^4.0.7",
"classnames": "^2.3.1",
@@ -4033,17 +4034,17 @@
}
},
"@wordpress/edit-widgets": {
"version": "3.1.14",
"resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-3.1.14.tgz",
"integrity": "sha512-7OpU4tGLUM7arEXFtIEK1l7ozelpyzQqjoY3jgVo+GS9mM6Ia87jhJGzy4coCNuumb9Jp8DHwI85oZapUY9FPg==",
"version": "3.1.15",
"resolved": "https://registry.npmjs.org/@wordpress/edit-widgets/-/edit-widgets-3.1.15.tgz",
"integrity": "sha512-mgetLhi5yaJ5b6VDD6GuTsMWZJhyt9yb/RBhtiubyVnCO9yPg9W1VoKFDT/r5+arDshqrHweSr5nxQG+qcRWww==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/api-fetch": "^5.2.6",
"@wordpress/block-editor": "^8.0.12",
"@wordpress/block-library": "^6.0.17",
"@wordpress/block-editor": "^8.0.13",
"@wordpress/block-library": "^6.0.18",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/core-data": "^4.0.9",
"@wordpress/data": "^6.1.5",
@@ -4052,16 +4053,16 @@
"@wordpress/hooks": "^3.2.2",
"@wordpress/i18n": "^4.2.4",
"@wordpress/icons": "^6.1.1",
"@wordpress/interface": "^4.1.14",
"@wordpress/interface": "^4.1.15",
"@wordpress/keyboard-shortcuts": "^3.0.7",
"@wordpress/keycodes": "^3.2.4",
"@wordpress/media-utils": "^3.0.5",
"@wordpress/notices": "^3.2.8",
"@wordpress/plugins": "^4.0.7",
"@wordpress/reusable-blocks": "^3.0.18",
"@wordpress/server-side-render": "^3.0.16",
"@wordpress/reusable-blocks": "^3.0.19",
"@wordpress/server-side-render": "^3.0.17",
"@wordpress/url": "^3.3.1",
"@wordpress/widgets": "^2.0.18",
"@wordpress/widgets": "^2.0.19",
"classnames": "^2.3.1",
"lodash": "^4.17.21",
"rememo": "^3.0.0",
@@ -4069,18 +4070,18 @@
}
},
"@wordpress/editor": {
"version": "12.0.15",
"resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-12.0.15.tgz",
"integrity": "sha512-eJ2ne6GYHnso6GPbRVRRhwTz3Eg4sp/HfV5bacfiKsdN4yd/3Ci1ABvhJD4JtFq2vXZPfE02sWhjRXgSpbcY1w==",
"version": "12.0.16",
"resolved": "https://registry.npmjs.org/@wordpress/editor/-/editor-12.0.16.tgz",
"integrity": "sha512-RtDf0h0lh613qudt5eG9EbG5Pp5PMuB8yfwnHCrA8d0yGaF24k3pxE7QMBaWeAcKGnDwev30Nt980nBtcm5+1w==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/api-fetch": "^5.2.6",
"@wordpress/autop": "^3.2.3",
"@wordpress/blob": "^3.2.2",
"@wordpress/block-editor": "^8.0.12",
"@wordpress/block-editor": "^8.0.13",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/core-data": "^4.0.9",
"@wordpress/data": "^6.1.5",
@@ -4097,9 +4098,9 @@
"@wordpress/keycodes": "^3.2.4",
"@wordpress/media-utils": "^3.0.5",
"@wordpress/notices": "^3.2.8",
"@wordpress/reusable-blocks": "^3.0.18",
"@wordpress/reusable-blocks": "^3.0.19",
"@wordpress/rich-text": "^5.0.7",
"@wordpress/server-side-render": "^3.0.16",
"@wordpress/server-side-render": "^3.0.17",
"@wordpress/url": "^3.3.1",
"@wordpress/wordcount": "^3.2.3",
"classnames": "^2.3.1",
@@ -4186,14 +4187,14 @@
}
},
"@wordpress/format-library": {
"version": "3.0.18",
"resolved": "https://registry.npmjs.org/@wordpress/format-library/-/format-library-3.0.18.tgz",
"integrity": "sha512-HWuCsG4/tDLRunEC5U4I6SqUGRe1jWPAO/62QFewRI/zxDi5tCi6pYl9N1Sn6rOCKWfcKKkEZcno6IN4H4g9Dw==",
"version": "3.0.19",
"resolved": "https://registry.npmjs.org/@wordpress/format-library/-/format-library-3.0.19.tgz",
"integrity": "sha512-MsXaS1QgMtkZUioStCnAQViIOcLPS5OqsJAwnl5/aVvmciV+IABtT4ffPCaiShiTyqBiZMj8UEaaJD8SOeZidw==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/block-editor": "^8.0.12",
"@wordpress/components": "^19.1.6",
"@wordpress/block-editor": "^8.0.13",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/data": "^6.1.5",
"@wordpress/dom": "^3.2.7",
@@ -4248,13 +4249,13 @@
}
},
"@wordpress/interface": {
"version": "4.1.14",
"resolved": "https://registry.npmjs.org/@wordpress/interface/-/interface-4.1.14.tgz",
"integrity": "sha512-jFz4l0OajxHBX9vI2muH6fs2ZlzAJKk2dIGnPcOHpZJbXdOIsu4D2lMQMQJOn8G0018q9f2iowMTU9JWYr31zg==",
"version": "4.1.15",
"resolved": "https://registry.npmjs.org/@wordpress/interface/-/interface-4.1.15.tgz",
"integrity": "sha512-11vTvDG08A0QMicNc4hJBNMFDATRxWPEEEiB0g2pZRyZ09kMXcJ4Je9SdZz5jl2Bz/x8oEeTYeLqyvioq928cw==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/a11y": "^3.2.4",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/data": "^6.1.5",
"@wordpress/deprecated": "^3.2.3",
@@ -4352,13 +4353,13 @@
}
},
"@wordpress/list-reusable-blocks": {
"version": "3.0.16",
"resolved": "https://registry.npmjs.org/@wordpress/list-reusable-blocks/-/list-reusable-blocks-3.0.16.tgz",
"integrity": "sha512-ABiWh7nxYU9zpfONvxw+OW/lSvgWwtpT119IWcBUq7mywl3IY48zessHbCkkeTllD0CFKJLceuLCPm95Nn0vng==",
"version": "3.0.17",
"resolved": "https://registry.npmjs.org/@wordpress/list-reusable-blocks/-/list-reusable-blocks-3.0.17.tgz",
"integrity": "sha512-tYmCzIVhOUHlmINMtCvWwUfgfaorwv1+mAHdPJ2XqCW5e27ws3EdWJxqdTWZNu1Z8Rz9ucv+mOHyOxL91JByhg==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/api-fetch": "^5.2.6",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/element": "^4.0.4",
"@wordpress/i18n": "^4.2.4",
@@ -4396,12 +4397,12 @@
"dev": true
},
"@wordpress/nux": {
"version": "5.0.16",
"resolved": "https://registry.npmjs.org/@wordpress/nux/-/nux-5.0.16.tgz",
"integrity": "sha512-pULdjKfs0XZR06Le1fI8+0wuyhNGn2gkKJugApXtsP5gB/pZ+YWyRG44ZEFEqN4mZ1gBq6n50BkfQ7u5NPEE3w==",
"version": "5.0.17",
"resolved": "https://registry.npmjs.org/@wordpress/nux/-/nux-5.0.17.tgz",
"integrity": "sha512-W122kgEW5ZfAsYPN7sc9372GPE4Iulx9h8zB2z5E+Vz/CqrVvw/TDQqJgqk7DPScQWGcqWTIfHJh0zyDdY8yRw==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/data": "^6.1.5",
"@wordpress/deprecated": "^3.2.3",
@@ -4526,13 +4527,13 @@
}
},
"@wordpress/reusable-blocks": {
"version": "3.0.18",
"resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-3.0.18.tgz",
"integrity": "sha512-AzKPtWFgeqCrW35Yui66JHYlPJp3GIfnm+syQRS/7Qn9hbcMe1awuoSbv2OI0FQeoe8oWQWykrex1QUA3w5rUw==",
"version": "3.0.19",
"resolved": "https://registry.npmjs.org/@wordpress/reusable-blocks/-/reusable-blocks-3.0.19.tgz",
"integrity": "sha512-EU4Vo3ETTTN5DAQCrgh3AOuVRsZCrIJ1LcRgGJfFBSEJe6Sto3pxxj3ZtI+Goc4U553q3M/qpghHZNo1JZcfew==",
"requires": {
"@wordpress/block-editor": "^8.0.12",
"@wordpress/block-editor": "^8.0.13",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/core-data": "^4.0.9",
"@wordpress/data": "^6.1.5",
@@ -5498,14 +5499,14 @@
}
},
"@wordpress/server-side-render": {
"version": "3.0.16",
"resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-3.0.16.tgz",
"integrity": "sha512-cHuzL9fowuVz8G4Yz+DbbS850h+iUjM8+5jYzRZ9DH04fv/Y/dEGbdxZQ2K/p9wFQrQfnJ4EWUxJV1lUN/HTUw==",
"version": "3.0.17",
"resolved": "https://registry.npmjs.org/@wordpress/server-side-render/-/server-side-render-3.0.17.tgz",
"integrity": "sha512-UIyywGUSlbOVFi1SNwI/uUmHmUJFX+N9XeBCAnS15PmfYflBkiuz9FPmZWoqLoOE4uWTI7K9lAP1tkY80lotIA==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/api-fetch": "^5.2.6",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/data": "^6.1.5",
"@wordpress/deprecated": "^3.2.3",
@@ -5571,15 +5572,15 @@
"integrity": "sha512-iG1Hq56RK3N6AJqAD1sRLWRIJatfYn+NrPyrfqRNZNYXHM8Vj/s7ABNMbIU0Y99vXkBE83rvCdbMkugNoI2jXA=="
},
"@wordpress/widgets": {
"version": "2.0.18",
"resolved": "https://registry.npmjs.org/@wordpress/widgets/-/widgets-2.0.18.tgz",
"integrity": "sha512-Hryq9W1V45zyNn0TFKSrdSYG0FrTLaApNYRpWM7nBuuyaUkFa4C3rqZsUIrsnpmjbKU9DKpT03W1o2BzOLq8ug==",
"version": "2.0.19",
"resolved": "https://registry.npmjs.org/@wordpress/widgets/-/widgets-2.0.19.tgz",
"integrity": "sha512-TSPV0pYikUXvSH3L3TToLFDXwB0gjRVcL7/TpQyFiaN5QfONOGpxZBoCbW0l3w+z/ZhzTtwe/BwX25TFmEHILg==",
"requires": {
"@babel/runtime": "^7.16.0",
"@wordpress/api-fetch": "^5.2.6",
"@wordpress/block-editor": "^8.0.12",
"@wordpress/block-editor": "^8.0.13",
"@wordpress/blocks": "^11.1.5",
"@wordpress/components": "^19.1.6",
"@wordpress/components": "^19.2.0",
"@wordpress/compose": "^5.0.7",
"@wordpress/core-data": "^4.0.9",
"@wordpress/data": "^6.1.5",

View File

@@ -82,53 +82,53 @@
"@wordpress/api-fetch": "5.2.6",
"@wordpress/autop": "3.2.3",
"@wordpress/blob": "3.2.2",
"@wordpress/block-directory": "3.0.19",
"@wordpress/block-editor": "8.0.12",
"@wordpress/block-library": "6.0.17",
"@wordpress/block-directory": "3.0.20",
"@wordpress/block-editor": "8.0.13",
"@wordpress/block-library": "6.0.18",
"@wordpress/block-serialization-default-parser": "4.2.3",
"@wordpress/blocks": "11.1.5",
"@wordpress/components": "19.1.6",
"@wordpress/components": "19.2.0",
"@wordpress/compose": "5.0.7",
"@wordpress/core-data": "4.0.9",
"@wordpress/customize-widgets": "2.0.19",
"@wordpress/customize-widgets": "2.0.20",
"@wordpress/data": "6.1.5",
"@wordpress/data-controls": "2.2.8",
"@wordpress/date": "4.2.3",
"@wordpress/deprecated": "3.2.3",
"@wordpress/dom": "3.2.7",
"@wordpress/dom-ready": "3.2.3",
"@wordpress/edit-post": "5.0.19",
"@wordpress/edit-site": "3.0.19",
"@wordpress/edit-widgets": "3.1.14",
"@wordpress/editor": "12.0.15",
"@wordpress/edit-post": "5.0.20",
"@wordpress/edit-site": "3.0.20",
"@wordpress/edit-widgets": "3.1.15",
"@wordpress/editor": "12.0.16",
"@wordpress/element": "4.0.4",
"@wordpress/escape-html": "2.2.3",
"@wordpress/format-library": "3.0.18",
"@wordpress/format-library": "3.0.19",
"@wordpress/hooks": "3.2.2",
"@wordpress/html-entities": "3.2.3",
"@wordpress/i18n": "4.2.4",
"@wordpress/icons": "6.1.1",
"@wordpress/interface": "4.1.14",
"@wordpress/interface": "4.1.15",
"@wordpress/is-shallow-equal": "4.2.1",
"@wordpress/keyboard-shortcuts": "3.0.7",
"@wordpress/keycodes": "3.2.4",
"@wordpress/list-reusable-blocks": "3.0.16",
"@wordpress/list-reusable-blocks": "3.0.17",
"@wordpress/media-utils": "3.0.5",
"@wordpress/notices": "3.2.8",
"@wordpress/nux": "5.0.16",
"@wordpress/nux": "5.0.17",
"@wordpress/plugins": "4.0.7",
"@wordpress/primitives": "3.0.4",
"@wordpress/priority-queue": "2.2.3",
"@wordpress/redux-routine": "4.2.2",
"@wordpress/reusable-blocks": "3.0.18",
"@wordpress/reusable-blocks": "3.0.19",
"@wordpress/rich-text": "5.0.7",
"@wordpress/server-side-render": "3.0.16",
"@wordpress/server-side-render": "3.0.17",
"@wordpress/shortcode": "3.2.3",
"@wordpress/token-list": "2.2.2",
"@wordpress/url": "3.3.1",
"@wordpress/viewport": "4.0.7",
"@wordpress/warning": "2.2.2",
"@wordpress/widgets": "2.0.18",
"@wordpress/widgets": "2.0.19",
"@wordpress/wordcount": "3.2.3",
"backbone": "1.4.0",
"clipboard": "2.0.8",

File diff suppressed because one or more lines are too long

View File

@@ -39,9 +39,10 @@ function wp_register_layout_support( $block_type ) {
* @param array $layout Layout object. The one that is passed has already checked
* the existence of default block layout.
* @param bool $has_block_gap_support Whether the theme has support for the block gap.
* @param string $gap_value The block gap value to apply.
* @return string CSS style.
*/
function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false ) {
function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false, $gap_value = null ) {
$layout_type = isset( $layout['type'] ) ? $layout['type'] : 'default';
$style = '';
@@ -72,8 +73,9 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false
$style .= "$selector .alignleft { float: left; margin-right: 2em; }";
$style .= "$selector .alignright { float: right; margin-left: 2em; }";
if ( $has_block_gap_support ) {
$style .= "$selector > * { margin-top: 0; margin-bottom: 0; }";
$style .= "$selector > * + * { margin-top: var( --wp--style--block-gap ); margin-bottom: 0; }";
$gap_style = $gap_value ? $gap_value : 'var( --wp--style--block-gap )';
$style .= "$selector > * { margin-top: 0; margin-bottom: 0; }";
$style .= "$selector > * + * { margin-top: $gap_style; margin-bottom: 0; }";
}
} elseif ( 'flex' === $layout_type ) {
$layout_orientation = isset( $layout['orientation'] ) ? $layout['orientation'] : 'horizontal';
@@ -96,7 +98,8 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false
$style = "$selector {";
$style .= 'display: flex;';
if ( $has_block_gap_support ) {
$style .= 'gap: var( --wp--style--block-gap, 0.5em );';
$gap_style = $gap_value ? $gap_value : 'var( --wp--style--block-gap, 0.5em )';
$style .= "gap: $gap_style;";
} else {
$style .= 'gap: 0.5em;';
}
@@ -156,8 +159,13 @@ function wp_render_layout_support_flag( $block_content, $block ) {
$used_layout = $default_layout;
}
$id = uniqid();
$style = wp_get_layout_style( ".wp-container-$id", $used_layout, $has_block_gap_support );
$id = uniqid();
$gap_value = _wp_array_get( $block, array( 'attrs', 'style', 'spacing', 'blockGap' ) );
// Skip if gap value contains unsupported characters.
// Regex for CSS value borrowed from `safecss_filter_attr`, and used here
// because we only want to match against the value, not the CSS attribute.
$gap_value = preg_match( '%[\\\(&=}]|/\*%', $gap_value ) ? null : $gap_value;
$style = wp_get_layout_style( ".wp-container-$id", $used_layout, $has_block_gap_support, $gap_value );
// This assumes the hook only applies to blocks with a single wrapper.
// I think this is a reasonable limitation for that particular hook.
$content = preg_replace(

View File

@@ -95,59 +95,6 @@ function wp_skip_spacing_serialization( $block_type ) {
$spacing_support['__experimentalSkipSerialization'];
}
/**
* Renders the spacing gap support to the block wrapper, to ensure
* that the CSS variable is rendered in all environments.
*
* @since 5.9.0
* @access private
*
* @param string $block_content Rendered block content.
* @param array $block Block object.
* @return string Filtered block content.
*/
function wp_render_spacing_gap_support( $block_content, $block ) {
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
$has_gap_support = block_has_support( $block_type, array( 'spacing', 'blockGap' ), false );
if ( ! $has_gap_support || ! isset( $block['attrs']['style']['spacing']['blockGap'] ) ) {
return $block_content;
}
$gap_value = $block['attrs']['style']['spacing']['blockGap'];
// Skip if gap value contains unsupported characters.
// Regex for CSS value borrowed from `safecss_filter_attr`, and used here
// because we only want to match against the value, not the CSS attribute.
if ( preg_match( '%[\\\(&=}]|/\*%', $gap_value ) ) {
return $block_content;
}
$style = sprintf(
'--wp--style--block-gap: %s',
esc_attr( $gap_value )
);
// Attempt to update an existing style attribute on the wrapper element.
$injected_style = preg_replace(
'/^([^>.]+?)(' . preg_quote( 'style="', '/' ) . ')(?=.+?>)/',
'$1$2' . $style . '; ',
$block_content,
1
);
// If there is no existing style attribute, add one to the wrapper element.
if ( $injected_style === $block_content ) {
$injected_style = preg_replace(
'/<([a-zA-Z0-9]+)([ >])/',
'<$1 style="' . $style . '"$2',
$block_content,
1
);
};
return $injected_style;
}
// Register the block support.
WP_Block_Supports::get_instance()->register(
'spacing',
@@ -156,5 +103,3 @@ WP_Block_Supports::get_instance()->register(
'apply' => 'wp_apply_spacing_support',
)
);
add_filter( 'render_block', 'wp_render_spacing_gap_support', 10, 2 );

View File

@@ -23,11 +23,10 @@
"link": true
},
"spacing": {
"blockGap": true,
"margin": [ "top", "bottom" ],
"padding": true,
"__experimentalDefaultControls": {
"blockGap": true
"padding": true
}
}
},

View File

@@ -98,17 +98,7 @@
}
},
"spacing": {
"blockGap": true,
"units": [
"px",
"em",
"rem",
"vh",
"vw"
],
"__experimentalDefaultControls": {
"blockGap": true
}
"units": [ "px", "em", "rem", "vh", "vw" ]
},
"__experimentalLayout": {
"allowSwitching": false,

View File

@@ -36,11 +36,16 @@ function render_block_core_post_content( $attributes, $content, $block ) {
$seen_ids[ $post_id ] = true;
// Check is needed for backward compatibility with third-party plugins
// that might rely on the `in_the_loop` check; calling `the_post` sets it to true.
if ( ! in_the_loop() && have_posts() ) {
the_post();
}
$content = get_the_content( null, false, $post_id );
// When inside the main loop, we want to use queried object
// so that `the_preview` for the current post can apply.
// We force this behavior by omitting the third argument (post ID) from the `get_the_content`.
$content = get_the_content( null, false );
/** This filter is documented in wp-includes/post-template.php */
$content = apply_filters( 'the_content', str_replace( ']]>', ']]&gt;', $content ) );
unset( $seen_ids[ $post_id ] );

View File

@@ -18,7 +18,7 @@ function render_block_core_post_excerpt( $attributes, $content, $block ) {
return '';
}
$excerpt = get_the_excerpt( $block->context['postId'] );
$excerpt = get_the_excerpt();
if ( empty( $excerpt ) ) {
return '';

View File

@@ -20,7 +20,7 @@ function render_block_core_post_title( $attributes, $content, $block ) {
}
$post_ID = $block->context['postId'];
$title = get_the_title( $post_ID );
$title = get_the_title();
if ( ! $title ) {
return '';

View File

@@ -76,6 +76,23 @@ function register_block_core_site_logo_setting() {
add_action( 'rest_api_init', 'register_block_core_site_logo_setting', 10 );
/**
* Register a core site setting for a site icon
*/
function register_block_core_site_icon_setting() {
register_setting(
'general',
'site_icon',
array(
'show_in_rest' => true,
'type' => 'integer',
'description' => __( 'Site icon.' ),
)
);
}
add_action( 'rest_api_init', 'register_block_core_site_icon_setting', 10 );
/**
* Registers the `core/site-logo` block on the server.
*/

View File

@@ -16,12 +16,16 @@
"linkTarget": {
"type": "string",
"default": "_self"
},
"shouldSyncIcon": {
"type": "boolean"
}
},
"example": {
"viewportWidth": 500,
"attributes": {
"width": 350
"width": 350,
"className": "block-editor-block-types-list__site-logo-example"
}
},
"supports": {

View File

@@ -317,7 +317,7 @@ class WP_Theme_JSON {
'spacing' => array(
'margin' => null,
'padding' => null,
'blockGap' => null,
'blockGap' => 'top',
),
'typography' => array(
'fontFamily' => null,
@@ -472,17 +472,28 @@ class WP_Theme_JSON {
$output = array_intersect_key( $input, array_flip( self::VALID_TOP_LEVEL_KEYS ) );
// Some styles are only meant to be available at the top-level (e.g.: blockGap),
// hence, the schema for blocks & elements should not have them.
$styles_non_top_level = self::VALID_STYLES;
foreach ( array_keys( $styles_non_top_level ) as $section ) {
foreach ( array_keys( $styles_non_top_level[ $section ] ) as $prop ) {
if ( 'top' === $styles_non_top_level[ $section ][ $prop ] ) {
unset( $styles_non_top_level[ $section ][ $prop ] );
}
}
}
// Build the schema based on valid block & element names.
$schema = array();
$schema_styles_elements = array();
foreach ( $valid_element_names as $element ) {
$schema_styles_elements[ $element ] = self::VALID_STYLES;
$schema_styles_elements[ $element ] = $styles_non_top_level;
}
$schema_styles_blocks = array();
$schema_settings_blocks = array();
foreach ( $valid_block_names as $block ) {
$schema_settings_blocks[ $block ] = self::VALID_SETTINGS;
$schema_styles_blocks[ $block ] = self::VALID_STYLES;
$schema_styles_blocks[ $block ] = $styles_non_top_level;
$schema_styles_blocks[ $block ]['elements'] = $schema_styles_elements;
}
$schema['styles'] = self::VALID_STYLES;

View File

@@ -781,7 +781,7 @@ class WP_REST_Templates_Controller extends WP_REST_Controller {
'context' => array( 'embed', 'view', 'edit' ),
'required' => true,
'minLength' => 1,
'pattern' => '[a-zA-Z_\-]+',
'pattern' => '[a-zA-Z0-9_\-]+',
),
'theme' => array(
'description' => __( 'Theme identifier for the template.' ),

View File

@@ -1,138 +0,0 @@
<?php
/**
* @group block-supports
*/
class Tests_Block_Supports_Spacing extends WP_UnitTestCase {
private $sample_block_content = '<div class="wp-block-test-block">Test</div>';
private $test_gap_block_value = array();
private $test_gap_block_args = array();
function set_up() {
parent::set_up();
$this->test_gap_block_value = array(
'blockName' => 'test/test-block',
'attrs' => array(
'style' => array(
'spacing' => array(
'blockGap' => '3em',
),
),
),
);
$this->test_gap_block_args = array(
'api_version' => 2,
'supports' => array(
'spacing' => array(
'blockGap' => true,
),
),
);
}
function tear_down() {
unregister_block_type( 'test/test-block' );
parent::tear_down();
}
function test_spacing_gap_block_support_renders_block_inline_style() {
register_block_type( 'test/test-block', $this->test_gap_block_args );
$render_output = wp_render_spacing_gap_support(
$this->sample_block_content,
$this->test_gap_block_value
);
$this->assertSame(
'<div style="--wp--style--block-gap: 3em" class="wp-block-test-block">Test</div>',
$render_output
);
}
function test_spacing_gap_block_support_renders_block_inline_style_with_inner_tag() {
register_block_type( 'test/test-block', $this->test_gap_block_args );
$render_output = wp_render_spacing_gap_support(
'<div class="wp-test-block"><p style="color: red;">Test</p></div>',
$this->test_gap_block_value
);
$this->assertSame(
'<div style="--wp--style--block-gap: 3em" class="wp-test-block"><p style="color: red;">Test</p></div>',
$render_output
);
}
function test_spacing_gap_block_support_renders_block_inline_style_with_no_other_attributes() {
register_block_type( 'test/test-block', $this->test_gap_block_args );
$render_output = wp_render_spacing_gap_support(
'<div><p>Test</p></div>',
$this->test_gap_block_value
);
$this->assertSame(
'<div style="--wp--style--block-gap: 3em"><p>Test</p></div>',
$render_output
);
}
function test_spacing_gap_block_support_renders_appended_block_inline_style() {
register_block_type( 'test/test-block', $this->test_gap_block_args );
$render_output = wp_render_spacing_gap_support(
'<div class="wp-test-block" style="background: green;"><p style="color: red;">Test</p></div>',
$this->test_gap_block_value
);
$this->assertSame(
'<div class="wp-test-block" style="--wp--style--block-gap: 3em; background: green;"><p style="color: red;">Test</p></div>',
$render_output
);
}
function test_spacing_gap_block_support_does_not_render_style_when_support_is_false() {
$this->test_gap_block_args['supports']['spacing']['blockGap'] = false;
register_block_type( 'test/test-block', $this->test_gap_block_args );
$render_output = wp_render_spacing_gap_support(
$this->sample_block_content,
$this->test_gap_block_value
);
$this->assertEquals(
$this->sample_block_content,
$render_output
);
}
function test_spacing_gap_block_support_does_not_render_style_when_gap_is_null() {
$this->test_gap_block_value['attrs']['style']['spacing']['blockGap'] = null;
$this->test_gap_block_args['supports']['spacing']['blockGap'] = true;
register_block_type( 'test/test-block', $this->test_gap_block_args );
$render_output = wp_render_spacing_gap_support(
$this->sample_block_content,
$this->test_gap_block_value
);
$this->assertEquals(
$this->sample_block_content,
$render_output
);
}
function test_spacing_gap_block_support_does_not_render_style_when_gap_is_illegal_value() {
$this->test_gap_block_value['attrs']['style']['spacing']['blockGap'] = '" javascript="alert("hello");';
$this->test_gap_block_args['supports']['spacing']['blockGap'] = true;
register_block_type( 'test/test-block', $this->test_gap_block_args );
$render_output = wp_render_spacing_gap_support(
$this->sample_block_content,
$this->test_gap_block_value
);
$this->assertEquals(
$this->sample_block_content,
$render_output
);
}
}

View File

@@ -108,6 +108,7 @@ class WP_Test_REST_Settings_Controller extends WP_Test_REST_Controller_Testcase
'posts_per_page',
'default_ping_status',
'default_comment_status',
'site_icon', // Registered in wp-includes/blocks/site-logo.php
);
if ( ! is_multisite() ) {

View File

@@ -419,18 +419,11 @@ class Tests_Theme_wpThemeJson extends WP_UnitTestCase {
'spacing' => array(
'blockGap' => '1em',
),
'blocks' => array(
'core/columns' => array(
'spacing' => array(
'blockGap' => '24px',
),
),
),
),
)
);
$expected = 'body { margin: 0; }body{--wp--style--block-gap: 1em;}.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.wp-site-blocks > * { margin-top: 0; margin-bottom: 0; }.wp-site-blocks > * + * { margin-top: var( --wp--style--block-gap ); }.wp-block-columns{--wp--style--block-gap: 24px;}';
$expected = 'body { margin: 0; }body{--wp--style--block-gap: 1em;}.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.wp-site-blocks > * { margin-top: 0; margin-bottom: 0; }.wp-site-blocks > * + * { margin-top: var( --wp--style--block-gap ); }';
$this->assertSame( $expected, $theme_json->get_stylesheet() );
$this->assertSame( $expected, $theme_json->get_stylesheet( array( 'styles' ) ) );
}
@@ -2348,4 +2341,47 @@ class Tests_Theme_wpThemeJson extends WP_UnitTestCase {
$this->assertEqualSetsWithIndex( $expected, $actual['settings']['spacing'] );
}
/**
* @ticket 54487
*/
public function test_sanitization() {
$theme_json = new WP_Theme_JSON(
array(
'version' => 2,
'styles' => array(
'spacing' => array(
'blockGap' => 'valid value',
),
'blocks' => array(
'core/group' => array(
'spacing' => array(
'margin' => 'valid value',
'blockGap' => 'invalid value',
),
),
),
),
)
);
$actual = $theme_json->get_raw_data();
$expected = array(
'version' => 2,
'styles' => array(
'spacing' => array(
'blockGap' => 'valid value',
),
'blocks' => array(
'core/group' => array(
'spacing' => array(
'margin' => 'valid value',
),
),
),
),
);
$this->assertEqualSetsWithIndex( $expected, $actual );
}
}

View File

@@ -5035,7 +5035,7 @@ mockedApiResponse.Schema = {
"description": "Unique slug identifying the template.",
"type": "string",
"minLength": 1,
"pattern": "[a-zA-Z_\\-]+",
"pattern": "[a-zA-Z0-9_\\-]+",
"required": true
},
"theme": {
@@ -5189,7 +5189,7 @@ mockedApiResponse.Schema = {
"description": "Unique slug identifying the template.",
"type": "string",
"minLength": 1,
"pattern": "[a-zA-Z_\\-]+",
"pattern": "[a-zA-Z0-9_\\-]+",
"required": false
},
"theme": {
@@ -5503,7 +5503,7 @@ mockedApiResponse.Schema = {
"description": "Unique slug identifying the template.",
"type": "string",
"minLength": 1,
"pattern": "[a-zA-Z_\\-]+",
"pattern": "[a-zA-Z0-9_\\-]+",
"required": false
},
"theme": {
@@ -5682,7 +5682,7 @@ mockedApiResponse.Schema = {
"description": "Unique slug identifying the template.",
"type": "string",
"minLength": 1,
"pattern": "[a-zA-Z_\\-]+",
"pattern": "[a-zA-Z0-9_\\-]+",
"required": true
},
"theme": {
@@ -5841,7 +5841,7 @@ mockedApiResponse.Schema = {
"description": "Unique slug identifying the template.",
"type": "string",
"minLength": 1,
"pattern": "[a-zA-Z_\\-]+",
"pattern": "[a-zA-Z0-9_\\-]+",
"required": false
},
"theme": {
@@ -6160,7 +6160,7 @@ mockedApiResponse.Schema = {
"description": "Unique slug identifying the template.",
"type": "string",
"minLength": 1,
"pattern": "[a-zA-Z_\\-]+",
"pattern": "[a-zA-Z0-9_\\-]+",
"required": false
},
"theme": {
@@ -9630,6 +9630,11 @@ mockedApiResponse.Schema = {
"description": "Site logo.",
"type": "integer",
"required": false
},
"site_icon": {
"description": "Site icon.",
"type": "integer",
"required": false
}
}
}
@@ -12212,5 +12217,6 @@ mockedApiResponse.settings = {
"posts_per_page": 10,
"default_ping_status": "open",
"default_comment_status": "open",
"site_logo": null
"site_logo": null,
"site_icon": 0
};