From dabe026b7f0b76a023335c310589aff5853c5942 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Wed, 1 Feb 2023 00:30:43 +0100 Subject: [PATCH 01/15] Add 'wp-scripts' actions to develop & build the 'core/site-logo'-block filter --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 9b549d96b..a295802de 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,8 @@ }, "scripts": { "build": "grunt build; grunt create-build-zip", + "blocks:build": "wp-scripts build", + "blocks:start": "wp-scripts start", "check-engines": "wp-scripts check-engines", "check-licenses": "wp-scripts check-licenses --production", "deploy": "grunt deploy", From a40c2689824c8b4422cba8b719dc91017d56e7e1 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Wed, 1 Feb 2023 03:54:48 +0100 Subject: [PATCH 02/15] Add 'core/site-logo'-block filter to handle the 'site_icon_maskable' setting --- pwa.php | 3 + site-icon-maskable/index.js | 45 +++++++ site-icon-maskable/maskable-icon-controls.js | 116 ++++++++++++++++++ .../site-icon-maskable-block-editor.php | 66 ++++++++++ webpack.config.js | 7 ++ 5 files changed, 237 insertions(+) create mode 100644 site-icon-maskable/index.js create mode 100644 site-icon-maskable/maskable-icon-controls.js create mode 100644 site-icon-maskable/site-icon-maskable-block-editor.php create mode 100644 webpack.config.js diff --git a/pwa.php b/pwa.php index 5b909da62..5e3cd223b 100644 --- a/pwa.php +++ b/pwa.php @@ -248,6 +248,9 @@ function _pwa_check_disabled_navigation_preload() { /** Hooks to add for when accessing admin. */ require_once PWA_PLUGIN_DIR . '/wp-admin/admin.php'; +/** Function to register maskable icon setting as 'core/site-logo'-block filter */ +require_once PWA_PLUGIN_DIR . '/site-icon-maskable/site-icon-maskable-block-editor.php'; + /** * Plugin activation hook. */ diff --git a/site-icon-maskable/index.js b/site-icon-maskable/index.js new file mode 100644 index 000000000..2bfd51d1b --- /dev/null +++ b/site-icon-maskable/index.js @@ -0,0 +1,45 @@ +/** + * The 'icon maskable' control allows to set the 'site_icon_maskable' option. + * + * It also provides a small preview of the image used as Site-Logo, + * using a cropping-preview to illustrate the safe space an logo needs + * to be an adaptive image. + */ +import MaskableControls from './maskable-icon-controls'; + +/** + * The compose package is a collection + * of handy Hooks and Higher Order Components (HOCs) + * you can use to wrap your WordPress components + * and provide some basic features like: state, instance id, pure… + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-compose/ + */ +import { createHigherOrderComponent } from '@wordpress/compose'; + +const withMaskableControls = createHigherOrderComponent((BlockEdit) => { + return (props) => { + if (props.name !== 'core/site-logo') { + return ; + } + + return ( + <> + + + + ); + }; +}, 'withMaskableControls'); + +/** + * To modify the behavior of existing blocks, + * WordPress exposes several APIs. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/filters/block-filters/ + */ +wp.hooks.addFilter( + 'editor.BlockEdit', + 'pwa/with-maskable-icon-controls', + withMaskableControls +); diff --git a/site-icon-maskable/maskable-icon-controls.js b/site-icon-maskable/maskable-icon-controls.js new file mode 100644 index 000000000..86167703c --- /dev/null +++ b/site-icon-maskable/maskable-icon-controls.js @@ -0,0 +1,116 @@ +/** + * Retrieves the translation of text. + * + * @see https://developer.wordpress.org/block-editor/packages/packages-i18n/ + */ +import { __ } from '@wordpress/i18n'; + +/** + * This module allows you to create and use standalone block editors. ;) + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/ + */ +import { InspectorControls } from '@wordpress/block-editor'; + +/** + * This package includes a library of generic WordPress components + * to be used for creating common UI elements shared between screens + * and features of the WordPress dashboard. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-components/ + */ +import { + // __experimentalHStack as HStack, + Flex, + FlexBlock, + FlexItem, + PanelBody, + ToggleControl, +} from '@wordpress/components'; + +/** + * Core Data is a data module intended to + * simplify access to and manipulation + * of core WordPress entities. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-core-data/ + */ +import { store as coreStore, useEntityProp } from '@wordpress/core-data'; + +/** + * WordPress’ data module serves as a hub + * to manage application state + * for both plugins and WordPress itself. + * + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/ + */ +import { useSelect } from '@wordpress/data'; + +export default function MaskableControls() { + const [siteIconMaskable, setSiteIconMaskable] = useEntityProp( + 'root', + 'site', + 'site_icon_maskable' + ); + + // mainly borrowed from ... + const { isRequestingSiteIcon, siteIconUrl } = useSelect((select) => { + const { getEntityRecord, isResolving } = select(coreStore); + const siteData = + getEntityRecord('root', '__unstableBase', undefined) || {}; + + return { + isRequestingSiteIcon: isResolving('getEntityRecord', [ + 'root', + '__unstableBase', + undefined, + ]), + siteIconUrl: siteData.site_icon_url, + }; + }, []); + + if (isRequestingSiteIcon) { + return null; + } + + const siteIconStyle = { + clipPath: siteIconMaskable ? 'inset(10% round 50%)' : '', + width: '64px', + }; + + let siteIcon =
; + + if (siteIconUrl) { + siteIcon = ( + {__('Site + ); + } + + return ( + + + + + + + {siteIcon} + + + + ); +} diff --git a/site-icon-maskable/site-icon-maskable-block-editor.php b/site-icon-maskable/site-icon-maskable-block-editor.php new file mode 100644 index 000000000..dc353eba6 --- /dev/null +++ b/site-icon-maskable/site-icon-maskable-block-editor.php @@ -0,0 +1,66 @@ + 'boolean', + 'show_in_rest' => true, + 'sanitize_callback' => 'rest_sanitize_boolean', + ) + ); +} +add_action( 'rest_api_init', __NAMESPACE__ . '\\register_setting__site_icon_maskable' ); +add_action( 'admin_init', __NAMESPACE__ . '\\register_setting__site_icon_maskable' ); diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 000000000..09877fed0 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,7 @@ +const defaultConfig = require('@wordpress/scripts/config/webpack.config'); +module.exports = { + ...defaultConfig, + entry: { + 'site-icon-maskable': './site-icon-maskable', + }, +}; From 0649bcaa96cfe16178b14dc9804e203f39dd1f51 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sat, 25 Feb 2023 17:13:23 +0100 Subject: [PATCH 03/15] Remove useless file as the two changed config options can also be introduced as a parameters on the wp-scripts calls --- package.json | 6 +++--- webpack.config.js | 7 ------- 2 files changed, 3 insertions(+), 10 deletions(-) delete mode 100644 webpack.config.js diff --git a/package.json b/package.json index 6b4411584..34fe652b8 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,9 @@ "workbox-cli": "6.5.4" }, "scripts": { - "build": "grunt build; grunt create-build-zip", - "blocks:build": "wp-scripts build", - "blocks:start": "wp-scripts start", + "build": "npm run block:build; grunt build; grunt create-build-zip", + "block:build": "wp-scripts build site-icon-maskable=./site-icon-maskable/index.js --output-path=wp-includes/js/dist", + "block:start": "wp-scripts start site-icon-maskable=./site-icon-maskable/index.js --output-path=wp-includes/js/dist", "check-engines": "wp-scripts check-engines", "check-licenses": "wp-scripts check-licenses --production", "deploy": "grunt deploy", diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 09877fed0..000000000 --- a/webpack.config.js +++ /dev/null @@ -1,7 +0,0 @@ -const defaultConfig = require('@wordpress/scripts/config/webpack.config'); -module.exports = { - ...defaultConfig, - entry: { - 'site-icon-maskable': './site-icon-maskable', - }, -}; From 47370814503dab51d4ddbcd45862479ca2ce9db6 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sat, 25 Feb 2023 23:27:42 +0100 Subject: [PATCH 04/15] Show admin notice, when files were not built, that are needed by the site-editor --- pwa.php | 5 ++++- .../site-icon-maskable-block-editor.php | 13 +++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pwa.php b/pwa.php index 5e3cd223b..ccced119a 100644 --- a/pwa.php +++ b/pwa.php @@ -96,7 +96,10 @@ function _pwa_print_build_needed_notice() {
Date: Sat, 25 Feb 2023 23:38:37 +0100 Subject: [PATCH 05/15] Unify registration of settings --- .../site-icon-maskable-block-editor.php | 16 --------------- wp-includes/class-wp-web-app-manifest.php | 20 +++++++++++++++---- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/site-icon-maskable/site-icon-maskable-block-editor.php b/site-icon-maskable/site-icon-maskable-block-editor.php index 437e29777..3cd411576 100644 --- a/site-icon-maskable/site-icon-maskable-block-editor.php +++ b/site-icon-maskable/site-icon-maskable-block-editor.php @@ -49,19 +49,3 @@ function enqueue_block_editor_assets__site_icon_maskable() { } add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\\enqueue_block_editor_assets__site_icon_maskable' ); -/** - * Register 'Site Icon maskable' setting. - */ -function register_setting__site_icon_maskable() { - register_setting( - 'general', - 'site_icon_maskable', - array( - 'type' => 'boolean', - 'show_in_rest' => true, - 'sanitize_callback' => 'rest_sanitize_boolean', - ) - ); -} -add_action( 'rest_api_init', __NAMESPACE__ . '\\register_setting__site_icon_maskable' ); -add_action( 'admin_init', __NAMESPACE__ . '\\register_setting__site_icon_maskable' ); diff --git a/wp-includes/class-wp-web-app-manifest.php b/wp-includes/class-wp-web-app-manifest.php index 5bdf32fa7..33839547a 100644 --- a/wp-includes/class-wp-web-app-manifest.php +++ b/wp-includes/class-wp-web-app-manifest.php @@ -68,8 +68,8 @@ public function init() { add_action( 'rest_api_init', array( $this, 'register_manifest_rest_route' ) ); add_filter( 'site_status_tests', array( $this, 'add_pwa_site_health_tests' ) ); - add_action( 'rest_api_init', array( $this, 'register_short_name_setting' ) ); - add_action( 'admin_init', array( $this, 'register_short_name_setting' ) ); + add_action( 'rest_api_init', array( $this, 'register_settings' ) ); + add_action( 'admin_init', array( $this, 'register_settings' ) ); add_action( 'admin_init', array( $this, 'add_short_name_settings_field' ) ); } @@ -533,9 +533,10 @@ public static function get_url() { } /** - * Register setting for short_name. + * Register pwa settings to the settings-API and make them visible to the REST API. */ - public function register_short_name_setting() { + public function register_settings() { + // Register setting for short_name. register_setting( 'general', self::SHORT_NAME_OPTION, @@ -546,6 +547,17 @@ public function register_short_name_setting() { 'show_in_rest' => true, ) ); + // Register setting for maskable site-icon. + register_setting( + 'general', + 'site_icon_maskable', + array( + 'type' => 'boolean', + 'description' => __( 'Wether the current site icon is maskable or not, as this is needed by some devices.', 'pwa' ), + 'sanitize_callback' => 'rest_sanitize_boolean', + 'show_in_rest' => true, + ) + ); } /** From 96cf3da4c8920717435ade52d7d42fb54e2c1ace Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sat, 25 Feb 2023 23:51:49 +0100 Subject: [PATCH 06/15] Fix folder structure for site-editor related source files --- package.json | 4 ++-- .../js/src/site-icon-maskable}/index.js | 0 .../js/src/site-icon-maskable}/maskable-icon-controls.js | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename {site-icon-maskable => wp-includes/js/src/site-icon-maskable}/index.js (100%) rename {site-icon-maskable => wp-includes/js/src/site-icon-maskable}/maskable-icon-controls.js (100%) diff --git a/package.json b/package.json index 34fe652b8..fb70335f6 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ }, "scripts": { "build": "npm run block:build; grunt build; grunt create-build-zip", - "block:build": "wp-scripts build site-icon-maskable=./site-icon-maskable/index.js --output-path=wp-includes/js/dist", - "block:start": "wp-scripts start site-icon-maskable=./site-icon-maskable/index.js --output-path=wp-includes/js/dist", + "block:build": "wp-scripts build site-icon-maskable=./wp-includes/js/src/site-icon-maskable/index.js --output-path=wp-includes/js/dist", + "block:start": "wp-scripts start site-icon-maskable=./wp-includes/js/src/site-icon-maskable/index.js --output-path=wp-includes/js/dist", "check-engines": "wp-scripts check-engines", "check-licenses": "wp-scripts check-licenses --production", "deploy": "grunt deploy", diff --git a/site-icon-maskable/index.js b/wp-includes/js/src/site-icon-maskable/index.js similarity index 100% rename from site-icon-maskable/index.js rename to wp-includes/js/src/site-icon-maskable/index.js diff --git a/site-icon-maskable/maskable-icon-controls.js b/wp-includes/js/src/site-icon-maskable/maskable-icon-controls.js similarity index 100% rename from site-icon-maskable/maskable-icon-controls.js rename to wp-includes/js/src/site-icon-maskable/maskable-icon-controls.js From 946c52e2fb5fb51c2842e0045dd438639648c231 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sat, 25 Feb 2023 23:58:33 +0100 Subject: [PATCH 07/15] Ignore built files with git --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c43d6e0d4..1dc7d908a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /phpcs.xml /.phpcs.xml *.zip +/wp-includes/js/dist/* /wp-includes/js/workbox* /wiki .vscode From d203583242c3fe89c66cfa84ede85abd81ef70a0 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sun, 26 Feb 2023 02:07:35 +0100 Subject: [PATCH 08/15] Fix folder structure for site-editor related source files | part 2 --- .../site-icon-maskable-block-editor.php | 51 ------------------- wp-includes/class-wp-web-app-manifest.php | 36 +++++++++++++ 2 files changed, 36 insertions(+), 51 deletions(-) delete mode 100644 site-icon-maskable/site-icon-maskable-block-editor.php diff --git a/site-icon-maskable/site-icon-maskable-block-editor.php b/site-icon-maskable/site-icon-maskable-block-editor.php deleted file mode 100644 index 3cd411576..000000000 --- a/site-icon-maskable/site-icon-maskable-block-editor.php +++ /dev/null @@ -1,51 +0,0 @@ - Date: Sun, 26 Feb 2023 12:46:34 +0100 Subject: [PATCH 09/15] Cleanup --- pwa.php | 3 --- wp-includes/class-wp-web-app-manifest.php | 12 +++++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pwa.php b/pwa.php index ccced119a..76660c186 100644 --- a/pwa.php +++ b/pwa.php @@ -251,9 +251,6 @@ function _pwa_check_disabled_navigation_preload() { /** Hooks to add for when accessing admin. */ require_once PWA_PLUGIN_DIR . '/wp-admin/admin.php'; -/** Function to register maskable icon setting as 'core/site-logo'-block filter */ -require_once PWA_PLUGIN_DIR . '/site-icon-maskable/site-icon-maskable-block-editor.php'; - /** * Plugin activation hook. */ diff --git a/wp-includes/class-wp-web-app-manifest.php b/wp-includes/class-wp-web-app-manifest.php index a0ce4ba0b..66abc0e5c 100644 --- a/wp-includes/class-wp-web-app-manifest.php +++ b/wp-includes/class-wp-web-app-manifest.php @@ -698,11 +698,10 @@ function updateShortNameField() { * Handle the 'site_icon_maskable' setting in a full-site-editing context, * by enqueing a filter to the 'wp:site-logo' block within the site-editor. * - * @package PWA - * @since 0.8.0-alpha - * @see https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/ + * @since 0.8.0-alpha + * @see https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/ * - * @return void + * @return void */ public function enqueue_site_icon_maskable_block_editor_assets() { $dir = '/wp-includes/js/dist'; @@ -712,9 +711,9 @@ public function enqueue_site_icon_maskable_block_editor_assets() { if ( ! file_exists( $script_asset_path ) ) { return; } - $index_js = "$dir/site-icon-maskable.js"; - $script_asset = require $script_asset_path; + $script_asset = require $script_asset_path; + $index_js = "$dir/site-icon-maskable.js"; wp_enqueue_script( 'pwa-site-icon-maskable-block-editor', plugins_url( $index_js, __FILE__ ), @@ -723,6 +722,5 @@ public function enqueue_site_icon_maskable_block_editor_assets() { true ); wp_set_script_translations( 'pwa-site-icon-maskable-block-editor', 'pwa' ); - } } From d30ac156b86d870d5ef856cb6e3ff862c7821123 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sun, 26 Feb 2023 12:48:33 +0100 Subject: [PATCH 10/15] Add phpdoc-blocks and inline-documentation --- pwa.php | 1 + wp-includes/class-wp-web-app-manifest.php | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/pwa.php b/pwa.php index 76660c186..6e2b6b81f 100644 --- a/pwa.php +++ b/pwa.php @@ -80,6 +80,7 @@ function _pwa_incorrect_plugin_slug_admin_notice() { * Print admin notice when a build has not been been performed. * * @since 0.2 + * @since 0.8.0-alpha Check for site-icon-maskable.asset.php, which should be auto-generated by wp-scripts */ function _pwa_print_build_needed_notice() { ?> diff --git a/wp-includes/class-wp-web-app-manifest.php b/wp-includes/class-wp-web-app-manifest.php index 66abc0e5c..fba72ac96 100644 --- a/wp-includes/class-wp-web-app-manifest.php +++ b/wp-includes/class-wp-web-app-manifest.php @@ -536,6 +536,11 @@ public static function get_url() { /** * Register pwa settings to the settings-API and make them visible to the REST API. + * + * @since 0.7.0 + * @since 0.8.0-alpha Added registration of 'site_icon_maskable' setting. + * + * @return void */ public function register_settings() { // Register setting for short_name. @@ -549,7 +554,18 @@ public function register_settings() { 'show_in_rest' => true, ) ); - // Register setting for maskable site-icon. + /** + * Register setting for maskable site-icon. + * + * Even that this option is not exposed + * to the settings UI within normal admin options pages, + * the registration is needed to make the option + * available to the REST API, which is used by + * the site-editor. + * + * In the site-editor, this option can be set with the help of + * UI that is added to the 'site-logo' core block. + */ register_setting( 'general', 'site_icon_maskable', @@ -693,8 +709,8 @@ function updateShortNameField() { } /** - * Load modifications to the 'site-logo'-block - * + * Load 'wp/site-logo'-block filter + * * Handle the 'site_icon_maskable' setting in a full-site-editing context, * by enqueing a filter to the 'wp:site-logo' block within the site-editor. * @@ -707,6 +723,7 @@ public function enqueue_site_icon_maskable_block_editor_assets() { $dir = '/wp-includes/js/dist'; $path = PWA_PLUGIN_DIR . $dir; + // Stop, if needed file was not built successfully. $script_asset_path = "$path/site-icon-maskable.asset.php"; if ( ! file_exists( $script_asset_path ) ) { return; From 37cf884847dda163e6ada47b1cc58587be237105 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sun, 26 Feb 2023 12:58:55 +0100 Subject: [PATCH 11/15] Update tests --- tests/test-class-wp-web-app-manifest.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/test-class-wp-web-app-manifest.php b/tests/test-class-wp-web-app-manifest.php index 6575f5bf4..3c6878d43 100644 --- a/tests/test-class-wp-web-app-manifest.php +++ b/tests/test-class-wp-web-app-manifest.php @@ -94,8 +94,8 @@ public function test_init() { $this->assertEquals( 10, has_action( 'wp_head', array( $this->instance, 'manifest_link_and_meta' ) ) ); $this->assertEquals( 10, has_action( 'rest_api_init', array( $this->instance, 'register_manifest_rest_route' ) ) ); - $this->assertEquals( 10, has_action( 'rest_api_init', array( $this->instance, 'register_short_name_setting' ) ) ); - $this->assertEquals( 10, has_action( 'admin_init', array( $this->instance, 'register_short_name_setting' ) ) ); + $this->assertEquals( 10, has_action( 'rest_api_init', array( $this->instance, 'register_settings' ) ) ); + $this->assertEquals( 10, has_action( 'admin_init', array( $this->instance, 'register_settings' ) ) ); $this->assertEquals( 10, has_action( 'admin_init', array( $this->instance, 'add_short_name_settings_field' ) ) ); } @@ -532,16 +532,16 @@ public function test_get_url() { } /** - * Test register_short_name_setting. + * Test register_settings. * - * @covers ::register_short_name_setting() + * @covers ::register_settings() */ - public function test_register_short_name_setting() { + public function test_register_settings() { global $wp_registered_settings; unset( $wp_registered_settings['short_name'] ); $this->assertArrayNotHasKey( 'short_name', $wp_registered_settings ); - $this->instance->register_short_name_setting(); + $this->instance->register_settings(); $this->assertArrayHasKey( 'short_name', $wp_registered_settings ); $setting = $wp_registered_settings['short_name']; @@ -549,6 +549,18 @@ public function test_register_short_name_setting() { $this->assertEquals( 'general', $setting['group'] ); $this->assertEquals( array( $this->instance, 'sanitize_short_name' ), $setting['sanitize_callback'] ); $this->assertEquals( true, $setting['show_in_rest'] ); + + unset( $wp_registered_settings['site_icon_maskable'] ); + + $this->assertArrayNotHasKey( 'site_icon_maskable', $wp_registered_settings ); + $this->instance->register_settings(); + $this->assertArrayHasKey( 'site_icon_maskable', $wp_registered_settings ); + $setting = $wp_registered_settings['site_icon_maskable']; + + $this->assertEquals( 'boolean', $setting['type'] ); + $this->assertEquals( 'general', $setting['group'] ); + $this->assertEquals( 'rest_sanitize_boolean', $setting['sanitize_callback'] ); + $this->assertEquals( true, $setting['show_in_rest'] ); } /** From dd03b79d34802760061dfb3b6aea4c09dc8358d3 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Sun, 26 Feb 2023 13:30:40 +0100 Subject: [PATCH 12/15] Remove generated output from CS checks --- .phpcs.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index ded5795d2..35ecaf78b 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -13,6 +13,7 @@ ./node_modules/ ./vendor/ ./build/ + ./wp-includes/js/dist/ From 144660458897f40892bc2a2e18f4e8c9fef2638d Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Thu, 2 Mar 2023 23:57:07 +0100 Subject: [PATCH 13/15] Update wp-includes/class-wp-web-app-manifest.php Co-authored-by: Weston Ruter --- wp-includes/class-wp-web-app-manifest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-web-app-manifest.php b/wp-includes/class-wp-web-app-manifest.php index fba72ac96..4bc3495b8 100644 --- a/wp-includes/class-wp-web-app-manifest.php +++ b/wp-includes/class-wp-web-app-manifest.php @@ -554,7 +554,8 @@ public function register_settings() { 'show_in_rest' => true, ) ); - /** + + /* * Register setting for maskable site-icon. * * Even that this option is not exposed From 812e59a2fb56080d9b0cde01251c9dbf69b685b0 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Thu, 2 Mar 2023 23:59:38 +0100 Subject: [PATCH 14/15] Update wp-includes/js/src/site-icon-maskable/maskable-icon-controls.js Co-authored-by: Weston Ruter --- wp-includes/js/src/site-icon-maskable/maskable-icon-controls.js | 1 - 1 file changed, 1 deletion(-) diff --git a/wp-includes/js/src/site-icon-maskable/maskable-icon-controls.js b/wp-includes/js/src/site-icon-maskable/maskable-icon-controls.js index 86167703c..fdfa358c6 100644 --- a/wp-includes/js/src/site-icon-maskable/maskable-icon-controls.js +++ b/wp-includes/js/src/site-icon-maskable/maskable-icon-controls.js @@ -20,7 +20,6 @@ import { InspectorControls } from '@wordpress/block-editor'; * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-components/ */ import { - // __experimentalHStack as HStack, Flex, FlexBlock, FlexItem, From 81d28600276b84d91581cd0969fb9124bf99a978 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Fri, 3 Mar 2023 00:26:11 +0100 Subject: [PATCH 15/15] Update wp-includes/class-wp-web-app-manifest.php Co-authored-by: Weston Ruter --- wp-includes/class-wp-web-app-manifest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/class-wp-web-app-manifest.php b/wp-includes/class-wp-web-app-manifest.php index 4bc3495b8..7b2b36126 100644 --- a/wp-includes/class-wp-web-app-manifest.php +++ b/wp-includes/class-wp-web-app-manifest.php @@ -734,7 +734,7 @@ public function enqueue_site_icon_maskable_block_editor_assets() { $index_js = "$dir/site-icon-maskable.js"; wp_enqueue_script( 'pwa-site-icon-maskable-block-editor', - plugins_url( $index_js, __FILE__ ), + plugins_url( $index_js, PWA_PLUGIN_FILE ), $script_asset['dependencies'], $script_asset['version'], true